systemd
To add a systemd
service, simply add a file with the .service
extension in the /etc/systemd/system
directory.
Basic systemd service configuration file:
The script /path/to/script.sh
will be executed by the root user after the network is UP.
Start the service
Common errors
ExecStart
Script path not found
Script is not executable
Script does not contain shebang (
#!
) — alternatively, include shell path before the script path
Eg.
/bin/bash /path/to/script.sh
Last updated