supervisor 优化

This commit is contained in:
midoks
2022-06-17 21:48:48 +08:00
parent 570792196c
commit c03155d9b0
2 changed files with 4 additions and 2 deletions
+2
View File
@@ -103,8 +103,10 @@ def initDreplace():
mw.writeFile(conf, conf_content)
if os.path.exists(systemDir) and not os.path.exists(systemService):
supervisord_bin = mw.execShell('which supervisord')[0].strip()
se_content = mw.readFile(systemServiceTpl)
se_content = se_content.replace('{$SERVER_PATH}', service_path)
se_content = se_content.replace('{$SUP_BIN}', supervisord_bin)
mw.writeFile(systemService, se_content)
mw.execShell('systemctl daemon-reload')
+2 -2
View File
@@ -5,8 +5,8 @@ After=network.target
[Service]
Type=forking
ExecStart=supervisord -c {$SERVER_PATH}/supervisor/supervisor.conf
ExecStop=supervisorctl -c {$SERVER_PATH}/supervisor/supervisor.conf $OPTIONS shutdown
ExecReload=supervisorctl -c {$SERVER_PATH}/supervisor/supervisor.conf $OPTIONS reload
ExecStop=/bin/kill -s TERM $MAINPID
ExecReload=/bin/kill -s HUP $MAINPID
KillMode=process
Restart=on-failure