Example systemd unit config

/etc/systemd/system/my-service.service

[Unit]
Description=My super service
After=network.target

[Service]
ExecStart=/full/path
#Type=forking
#PIDFile=
Restart=always
RestartSec=2
User=root
Group=root
WorkingDirectory=/opt/service/
StandardOutput=syslog
StandardError=syslog
SyslogIdentifier=my-service
Environment=PATH=/bin

[Install]
WantedBy=multi-user.target

systemctl daemon-reload
systemctl enable my-service

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.