systemd
[Unit]
Description=[description]
After=network.target # Script runs after the network is UP
[Service]
ExecStart=/path/to/script.sh
Restart=always # Script will restart if it fails
User=root # run as the root user
[Install]
WantedBy=multi-user.target # Services start at bootsystemctl daemon-reload
systemctl enable [name_of_service].serviceCommon errors
Last updated