Skip to content

Instantly share code, notes, and snippets.

@meysius
Created September 19, 2019 05:51
Show Gist options
  • Save meysius/265e3b553895f1f94102d82f2a102793 to your computer and use it in GitHub Desktop.
Save meysius/265e3b553895f1f94102d82f2a102793 to your computer and use it in GitHub Desktop.

To create a systemd (systemctl) job, put your service description file in:

/lib/systemd/system/name.service
or 
/etc/systemd/system/name.service

Then to enable it do: sudo systemctl enable name

Everytime, you edit the service definition file, you have to reload the daemon: sudo systemctl daemon-reload

To control the service:

sudo systemctl {start,stop,restart,status} name

To lively monitor the logs, in another terminal do:

sudo journalctl -u name.service -f
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment