当前位置:   article > 正文

systemd 管理python 程序

配置systemd管理你的python app.py服务
[Unit]
Description = test-minapp
After = network.target

[Service]
PermissionsStartOnly = true
PIDFile = /data/www/test/test.pid
User = www
Group = www
WorkingDirectory = /data/www/test
ExecStart = /usr/bin/env gunicorn -w 4 -b 0.0.0.0:7171 app:application --pid /data/www/test/rapidcal.pid
ExecReload = /bin/kill -s HUP $MAINPID
ExecStop = /bin/kill -s TERM $MAINPID
ExecStopPost = /bin/rm -f /data/www/test/test.pid
PrivateTmp = true

[Install]
WantedBy = multi-user.target

 

转载于:https://www.cnblogs.com/mikeluwen/p/8857182.html

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/blog/article/detail/50995
推荐阅读
相关标签
  

闽ICP备14008679号