Adding and enabling a simple systemd service unit#
Create a basic service unit#
Run the following command to create a new system service unit file#
systemctl edit --force --full servicename.service
Modify the file to contain something similar to the following#
[Unit]
Description=Description for your service
Wants=network.target
[Service]
ExecStart=/usr/bin/full-service-path
[Install]
WantedBy=multi-user.target
Enable the service, while also starting it#
systemctl enable --now servicename.service
Debug errors#
Status#
systemctl status servicename.service
Running log of the service#
journalctl -u servicename.service -f