Service

作者: Plenari | 来源:发表于2019-12-20 18:10 被阅读0次

像是http服务占着个端口,就不肯能启动多次的,我感觉可以用nohup

cd workingdirectory
nohup python -m http.server 8888 >/dev/null &

jobs -l或者用ps -ef |grep com查询出来之后用kill pid停止进程。

[Unit]
Description = some service
After = network-onnline.target nginx.service
[Service]
WorkingDirectory= /home/app
Type=idle
ExecStart= python -m http.server 9000
ExecReload=/bin/kill -s HUP $MINPID
killMode=mixed# 可以杀死全部进程
Restart=on-failure
RestartLimitBurst=3
StartLimitInterval=60s

[Install]
WantedBy=multi-user.target

相关文章

网友评论

      本文标题:Service

      本文链接:https://www.haomeiwen.com/subject/tqwvnctx.html