mirror of
https://github.com/midoks/mdserver-web.git
synced 2026-10-10 01:39:25 +08:00
@@ -74,11 +74,15 @@ def checkArgs(data, ck=[]):
|
|||||||
|
|
||||||
|
|
||||||
def status():
|
def status():
|
||||||
data = mw.execShell(
|
# data = mw.execShell(
|
||||||
"ps -ef|grep supervisor | grep -v grep | grep -v index.py | awk '{print $2}'")
|
# "ps -ef|grep supervisor | grep -v grep | grep -v index.py | awk '{print $2}'")
|
||||||
if data[0] == '':
|
# if data[0] == '':
|
||||||
|
# return 'stop'
|
||||||
|
|
||||||
|
pid_file = getServerDir() + "/run/supervisor.pid"
|
||||||
|
if os.path.exists(pid_file):
|
||||||
|
return "start"
|
||||||
return 'stop'
|
return 'stop'
|
||||||
return 'start'
|
|
||||||
|
|
||||||
|
|
||||||
def initDreplace():
|
def initDreplace():
|
||||||
|
|||||||
@@ -9,8 +9,12 @@ serverPath=$(dirname "$rootPath")
|
|||||||
|
|
||||||
VERSION=$2
|
VERSION=$2
|
||||||
|
|
||||||
|
# cd /www/server/mdserver-web/plugins/supervisor && bash install.sh install 1.0
|
||||||
|
# /www/server/mdserver-web/bin/supervisord -n -c /etc/supervisor/supervisord.conf
|
||||||
# /www/server/mdserver-web/bin/supervisorctl -c /www/server/supervisor/supervisor.conf
|
# /www/server/mdserver-web/bin/supervisorctl -c /www/server/supervisor/supervisor.conf
|
||||||
# cmd | status
|
# cmd | status
|
||||||
|
# systemctl status supervisor
|
||||||
|
# journalctl -u supervisor -f
|
||||||
|
|
||||||
bash ${rootPath}/scripts/getos.sh
|
bash ${rootPath}/scripts/getos.sh
|
||||||
OSNAME=`cat ${rootPath}/data/osname.pl`
|
OSNAME=`cat ${rootPath}/data/osname.pl`
|
||||||
|
|||||||
+8
-3
@@ -839,12 +839,17 @@ class plugin(object):
|
|||||||
|
|
||||||
if not os.path.exists(path):
|
if not os.path.exists(path):
|
||||||
return ('', '')
|
return ('', '')
|
||||||
py_cmd = 'cd ' + mw.getPanelDir() + " && "+ py_cmd
|
|
||||||
data = mw.execShell(py_cmd)
|
source_bin_activate = mw.getPanelDir() + "/bin/activate"
|
||||||
|
py_cmd_dir = 'cd ' + mw.getPanelDir()
|
||||||
|
if os.path.exists(source_bin_activate):
|
||||||
|
py_cmd_dir += " && source "+source_bin_activate
|
||||||
|
do_cmd = py_cmd_dir + " && "+ py_cmd
|
||||||
|
data = mw.execShell(do_cmd)
|
||||||
|
|
||||||
# print(data)
|
# print(data)
|
||||||
if mw.isDebugMode():
|
if mw.isDebugMode():
|
||||||
print('run:', py_cmd)
|
print('run:', do_cmd)
|
||||||
print(data)
|
print(data)
|
||||||
# print os.path.exists(py_cmd)
|
# print os.path.exists(py_cmd)
|
||||||
return (data[0].strip(), data[1].strip())
|
return (data[0].strip(), data[1].strip())
|
||||||
|
|||||||
Reference in New Issue
Block a user