Looks like you’re running jessie, I thought there was an extra manual step to enable service-runner on jessie, something like linking the .service file into a different place?
Can you provide the output of:
ls -l /etc/systemd/system/service-runner*
ls -l /lib/systemd/system/service-runner*
pi@emonpi(ro):~$ ls -l /etc/systemd/system/service-runner*
ls: cannot access /etc/systemd/system/service-runner*: No such file or directory
pi@emonpi(ro):~$ ls -l /lib/systemd/system/service-runner*
lrwxrwxrwx 1 root root 71 Feb 27 20:43 /lib/systemd/system/service-runner.service -> /var/www/emoncms/scripts/services/service-runner/service-runner.service
pi@emonpi(ro):~$
If I do need to run that script to correct as I have not done that for several months can I have a reminder how to do it from the PuTTY console?
pi@emonpi(ro):~$ cd ~/emonpi
pi@emonpi(ro):emonpi$ git status
On branch master
Your branch is up-to-date with 'origin/master'.
Untracked files:
(use "git add <file>..." to include in what will be committed)
1
nothing added to commit but untracked files present (use "git add" to track)
pi@emonpi(ro):emonpi$
Hi @IM35461, sorry about this. It seems it is possibly an oddity of the Jessie systemd although I’ve searched out a Jessie system I have and I can see symlinks in the /lib/ systemd folder so do not know why these are not working. As it is a running system (doing other things) I really do not want to play with it!
The solution might be a slight change to the enable command. Can you try this and see if it creates an error message.
pi@emonpi(ro):~$ sudo systemctl enable /lib/systemd/system/service-runner.service
Failed to execute operation: Too many levels of symbolic links
pi@emonpi(ro):~$
Could this have anything to do with the shenanigans that happens in the rc.local file? The feedwriter service is the only one of the 3 services that gets restarted in rc.local.
If this is still Jessie based, it is still a read-only filesystem, could that be causing any issue with the new services?
I know that the services do not have thier own log files, but are they dependent on other services that do require a log file (eg redis) therefore failing to start as the required service(s) have failed to start due to a missing log file and then only the feedwriter gets restarted once the log files are created, leaving the other 2 not running.
[edit]
As a quick test you could edit the service mqtt_input restart to service emoncms_mqtt restart or add it to the bottom of the list. Any services that cannot start (eg mqtt_input?) should be removed as rc.local will just abort on the first error and not continue with the rest of the commands.
Interesting point. @glyn.hudson I’m not sure this was changed as part of the update script.
Ah yes, very possible - obvious really. The enable command would be unable to create the symlinks in /etc/systemd/system/. Doesn’t explain why the script would fail though as it is in RW mode.
Trouble is, if you forget, need to disable it for some reason, then come to enable it again, it won’t work as the original symlink in /etc/systemd/system has been deleted by the disable command and you need to add in the link manually as well.
What is annoying is that it should work. I think the RO issue might be it - needs to be RW when enabled.
Yep, that’s absolutely correct. Its a bug in the systemd version running on jessie and there’s no good way around it while still using systemd.
jessie is running systemd v215, the jessie-backports version is v230, stretch is running v232.
Its possible that the jessie-backports version fixes it but I’ve not tried it.
The instructions for using backports are here: Instructions
For this particular thread, replace stretch with jessie in all references in commands from that link.
I’m not trying to sell it to you
I went through the exact same thought process at the time that you’re going through right now. “But it should work!”… I spent quite a few hours on this only to come to the realisation that there are things less frustrating to spend my time on