-
Create EXAMPLE.service in /etc/systemd/system/
-
Modify service script as necessary
ExecStartis the command to run on startupExecStopis the command to run on shutdownRestart=alwaystells systemd to try to restart the script after 30 seconds if it exits for any reason
- Tell systemd to start this service automatically when the machine starts:
sudo systemctl enable EXAMPLE.service
- Start the service right now (optional):
sudo systemctl start EXAMPLE.service
- Check the status (optional):
sudo systemctl status EXAMPLE.service