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