supervisor 优化

pull/109/head
midoks 3 years ago
parent 570792196c
commit c03155d9b0
  1. 2
      plugins/supervisor/index.py
  2. 4
      plugins/supervisor/init.d/supervisor.service

@ -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

Loading…
Cancel
Save