Systemd – creating a custom service

Generally speaking when creating new custom service, best practice dictates that it is saved in the /etc/systemd/system directory (as opposed to the /lib/systemd/system)

My template for systemd service startup script:

Description=My service description

ExecStart=/full/path/to/command -with "Parameters"


The script is saved as service_name.service under /etc/systemd/system
Once the service unit file is saved it needs to be enabled:

systemctl enable service_name.service
systemctl start service_name
systemctl status service_name

and to double check:

journalctl -xn

to see if there are any errors caused by the new service.

To memorise few useful systemd terms I have created a memrise course: