systemd 管理python 程序

[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

 

posted @ 2018-04-16 17:31  行知散人  阅读(458)  评论(0编辑  收藏  举报