Home 用systemd製作服務
Post
Cancel

用systemd製作服務

可以用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

參考:
製作fastapi服務 設定檔重載
symbolic link 移除服務

This post is licensed under CC BY 4.0 by the author.

Python執行tensorrt-engine

-