hr-system/deploy/hr-web.service

20 lines
596 B
Desktop File

[Unit]
Description=HR Web System (hr-web) - ahserver 服务,监听端口 9280
After=network.target mariadb.service redis.service
Wants=mariadb.service redis.service
[Service]
Type=simple
User=hrstest
Group=hrstest
WorkingDirectory=/opt/hrs
Environment=PYTHONUNBUFFERED=1
ExecStart=/opt/hrs/venv/bin/python -m ahserver --config /opt/hrs/conf/config.json
Restart=always
RestartSec=5
# 端口 9280 探活(健康检查):启动后确认监听
ExecStartPost=/bin/sh -c 'for i in $(seq 1 30); do ss -ltn | grep -q ":9280" && exit 0; sleep 1; done; exit 1'
[Install]
WantedBy=multi-user.target