victorssouza
8/1/2017 - 1:56 PM

Automated Linux

Automated Linux

Set up

Create a file '*.service at: /etc/systemd/system/

sudo vi /etc/systemd/system/myservice.service

Include the default template:

[Unit]
Description=systemd poc
After = someservice.service

[Service]
User=root
Group=root
ExecStart=/opt/poc.sh &
KillMode=process
Restart=on-failure
RestartSec=1min

[Install]
WantedBy=multi-user.target

Reload systemd daemon

sudo systemctl daemon-reload

Check service status

sudo service myservice status sudo systemctl status myservice