sudo vi /etc/systemd/system/ms.service
[Unit] Description=myservice [Service] User=myuser ExecStart=/bin/bash /path/to/script/ms.sh start ExecStop=/bin/bash /path/to/script/ms.sh stop RemainAfterExit=yes [Install] WantedBy=multi-user.target
sudo chmod 744 /etc/systemd/system/ms.service
sudo systemctl enable ms.service
(this should give you "Created symlink from /etc/systemd/system/multi-user.target.wants/ms.service to /etc/systemd/system/ms.service." )
How to troubleshoot? https://www.certdepot.net/systemd-service-debugging-tips/
systemctl start ms
systemctl status ms
journalctl -u ms
No comments:
Post a Comment