Hello, writing systemd unit files is pretty simple, it's more straight forward than for the good old init. I will demonstrate it on a short example:
Code:
[Unit] Description=My cool daemon After=mysql.service [Service] User=daemon_user ExecStart=/usr/local/bin/daemon [Install] WantedBy=multi-user.target
If your daemon depends on some other processes you should add it to After section. Maybe you also want to replace daemon_user with the your spcific daemon user. Then copy this file to /etc/systemd/system/daemon.service, reload configuration with
Code:
systemctl --system daemon-reload
and start it with systemctl start daemon.service that's it. To enable it on startup just type systemctl enable daemon.service. It's really quite simple, isn't it
Hope this helps
Bookmarks