Emonhub Systemd Ubuntu 15.10

The init script used by emonhub to start the service is in sysv and with ubuntu 15.10 is using systemd. In order to make the service start at boot time I have done the following:

Create the file emonhub.service in /etc/systemd/system with:

[Unit]
Documentation=man:systemd-sysv-generator(8)
SourcePath=/etc/init.d/emonhub
Description=LSB: Emonhub server
Before=multi-user.target multi-user.target multi-user.target graphical.target shutdown.target
After=local-fs.target remote-fs.target network-online.target systemd-journald-dev-log.socket nss-lookup.target
Wants=network-online.target
Conflicts=shutdown.target

[Service]
Type=forking
Restart=no
TimeoutSec=5min
IgnoreSIGPIPE=no
KillMode=process
GuessMainPID=no
RemainAfterExit=yes
ExecStart=/etc/init.d/emonhub start
ExecStop=/etc/init.d/emonhub stop

After this change is possĂ­vel to start the service with systemdctl command.

systemctl start emonhub.service

1 Like

Thanks for sharing, I have yet to test with 15.10. Is sysv depreciated in 15.10?

Ubuntu in 15.10 still gives backward support do sysv script but for some
reason it doesn’t work with emonhub script. One thing that doesn’t help is
the fact that the LSB header of the script is not the first in the header
of the file.

Thanks everyone for this project … i just did something very small here :slight_smile:

A 23 de Julho de 2016 00:46:38 Glyn Hudson
[email protected] escreveu:

1 Like

@pb66 what are your thoughts about upgrading emonhub from init service to systemd (see above). This seems to be the way forward and is required for 15.10 as @slackluis reports.

Has anyone else confirmed this to be the case with Ubuntu 15.10? or tried to get it working?

It shouldn’t be mandatory due to backward compatibility, but yes if I was actively developing emonHub it would be on my agenda, but behind a long string of far more important considerations.

1 Like

Bump

Did any more come of this? I am in the process of building a new Pi server for EmonCMS (amongst other things) and I’d like to just go to systemd wherever possible.