35 lines
836 B
SYSTEMD
35 lines
836 B
SYSTEMD
|
|
[Unit]
|
||
|
|
Description=Flask Prompt Master Application
|
||
|
|
After=network.target
|
||
|
|
Wants=network.target
|
||
|
|
|
||
|
|
[Service]
|
||
|
|
Type=forking
|
||
|
|
User=renjianbo
|
||
|
|
Group=renjianbo
|
||
|
|
WorkingDirectory=/home/renjianbo/aitsc
|
||
|
|
Environment=PATH=/home/renjianbo/miniconda3/envs/myenv/bin
|
||
|
|
ExecStart=/home/renjianbo/aitsc/scripts/port_manager.sh start
|
||
|
|
ExecStop=/home/renjianbo/aitsc/scripts/port_manager.sh stop
|
||
|
|
ExecReload=/home/renjianbo/aitsc/scripts/port_manager.sh restart
|
||
|
|
PIDFile=/home/renjianbo/aitsc/logs/gunicorn.pid
|
||
|
|
Restart=always
|
||
|
|
RestartSec=10
|
||
|
|
StartLimitInterval=60
|
||
|
|
StartLimitBurst=3
|
||
|
|
|
||
|
|
# 安全设置
|
||
|
|
NoNewPrivileges=true
|
||
|
|
PrivateTmp=true
|
||
|
|
ProtectSystem=strict
|
||
|
|
ProtectHome=true
|
||
|
|
ReadWritePaths=/home/renjianbo/aitsc/logs /home/renjianbo/aitsc/data
|
||
|
|
|
||
|
|
# 日志设置
|
||
|
|
StandardOutput=journal
|
||
|
|
StandardError=journal
|
||
|
|
SyslogIdentifier=flask-app
|
||
|
|
|
||
|
|
[Install]
|
||
|
|
WantedBy=multi-user.target
|