Monday, July 17, 2017

Service/program Start at startup Ubuntu 16.04




vi /etc/systemd/system/myscript.service

Create a file in /etc/systemd/system and add the following lines.
---------------------------------------------
[Unit]
Description=cifs start script

[Service]
ExecStart=/usr/bin/docker-volume-netshare cifs
Restart=always

[Install]
WantedBy=multi-user.target

---------------------------------------------
Then execute following commands.

sudo systemctl daemon-reload
sudo systemctl enable myscript.service
sudo systemctl start myscript.service

No comments:

Post a Comment