可以用symble link的方式,將服務檔放到/etc/systemd/system/
目錄下,讓systemd管理服務。
更改service檔後,需執行以下指令,讓systemd重新載入設定檔:
1
2
3
sudo systemctl daemon-reload
sudo systemctl enable appname
sudo systemctl start appname
移除服務:
1
2
3
4
5
6
7
systemctl stop [servicename]
systemctl disable [servicename]
rm /your/service/locations/[servicename]
# and symlinks that might be related
rm /your/service/locations/[servicename]
systemctl daemon-reload
systemctl reset-failed