26 lines
646 B
Desktop File
26 lines
646 B
Desktop File
# Gunicorn 后台常驻:复制到 /etc/systemd/system/vps_price.service
|
||
# 路径按你服务器改:WorkingDirectory、Environment、ExecStart 里的两处
|
||
#
|
||
# sudo systemctl daemon-reload
|
||
# sudo systemctl enable vps_price
|
||
# sudo systemctl start vps_price
|
||
# sudo systemctl status vps_price
|
||
|
||
[Unit]
|
||
Description=VPS Price Gunicorn
|
||
After=network.target
|
||
|
||
[Service]
|
||
Type=notify
|
||
User=root
|
||
Group=root
|
||
WorkingDirectory=/home/vps_web
|
||
Environment="PATH=/home/vps_web/.venv/bin"
|
||
ExecStart=/home/vps_web/.venv/bin/gunicorn -w 4 -b 0.0.0.0:5001 app:app
|
||
ExecReload=/bin/kill -s HUP $MAINPID
|
||
Restart=always
|
||
RestartSec=3
|
||
|
||
[Install]
|
||
WantedBy=multi-user.target
|