Systemd: Difference between revisions
		
		
		
		Jump to navigation
		Jump to search
		
| Anthoanthop (talk | contribs) No edit summary | Anthoanthop (talk | contribs) No edit summary | ||
| Line 17: | Line 17: | ||
| [Install] | [Install] | ||
| WantedBy=multi-user.target | WantedBy=multi-user.target | ||
| </syntaxhighlight> | |||
| <syntaxhighlight lang="bash"> | <syntaxhighlight lang="bash"> | ||
| systemctl enable my-bash-script | systemctl enable my-bash-script | ||
| </syntaxhighlight> | </syntaxhighlight> | ||
Revision as of 17:11, 23 February 2016
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