mirror of
https://github.com/midoks/mdserver-web.git
synced 2026-10-18 23:45:52 +08:00
supervisor 优化
This commit is contained in:
@@ -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')
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user