Systemd

From Anthony Pastor Wiki Notes - Verba volant, scripta manent
Revision as of 18:10, 23 February 2016 by Anthoanthop (talk | contribs) (Created page with "=Configure a Bash script to run as a service= <syntaxhighlight lang="bash"> $ cat /etc/systemd/system/my-bash-script.service [Unit] Description=Basic Script Example After=...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Configure a Bash script to run as a service

$ cat /etc/systemd/system/my-bash-script.service 

[Unit]
Description=Basic Script Example
After=network-online.target

[Service]
Type=simple
User=root
Group=root
ExecStart=/home/my-script/my-script.sh

[Install]
WantedBy=multi-user.target

systemctl enable my-bash-script