- Take the example file and copy it into
/lib/systemd/system/
asroot
:
sudo cp example.service /lib/systemd/system
-
Modify it so it fits your needs. A good resource for this is: https://fedoramagazine.org/what-is-an-init-system/ and https://fedoraproject.org/wiki/Systemd
-
Enable the service so it will start on boot and restart on crash:
sudo systemctl enable example.service
- Start the service:
sudo systemctl start example.service