4 ms·
I think I've gone through 4 different init systems, and SystemD is fairly easy to get a daemon running. Here's an example config: # sudo useradd -r -s /bin/f
by z3t4 3y ago
I think I've gone through 4 different init systems, and SystemD is fairly easy to get a daemon running. Here's an example config:
# sudo useradd -r -s /bin/false userofservice
# sudo cp thisfile.systemd /etc/systemd/system/nameofservice.service
# sudo systemctl enable nameofservice || sudo systemctl daemon-reload
# sudo systemctl start nameofservice
[Unit]
Description=What the service dose
Wants=network-online.target
After=syslog.target network.target network-online.target
[Service]
User=userofservice
Group=userofservice
WorkingDirectory=/srv/nameofservice/
ExecStart=/usr/bin/runtime somescript.xyz
ExecStopPost=+/srv/crashreport/report.xyz %n
Restart=always
[Install]
WantedBy=multi-user.target