Update index.py

pull/109/head
midoks 6 years ago
parent 0635ceb7fe
commit fdc5d901d1
  1. 37
      plugins/mysql/index.py

@ -102,36 +102,35 @@ def status():
return 'start' return 'start'
def myOp(method):
init_file = initDreplace()
data = public.execShell(init_file + ' ' + method)
if data[1] == '':
return 'ok'
return data[1]
def start(): def start():
return myOp('start')
init_file = initDreplace()
initMysql = getServerDir() + '/scripts/mysql_install_db ' + '--basedir=' + \
getServerDir() + ' --datadir=' + getServerDir() + '/data'
return initMysql
cmd = getServerDir() + '/bin/mysqld_safe ' + getServerDir() + \
'/conf/my.cnf ' + '--user=mysql&'
# return cmd
data = public.execShell(cmd)
if data[0] == '':
return 'stop'
return data[0]
# def stop():
# data = public.execShell(
# "ps -ef|grep mysql |grep -v grep |grep -v python |awk '{print $2}' | xargs kill -9")
# if data[0] == '':
# return 'ok'
# return 'fail'
def stop(): def stop():
data = public.execShell( return myOp('stop')
"ps -ef|grep mysql |grep -v grep |grep -v python |awk '{print $2}' | xargs kill -9")
if data[0] == '':
return 'ok'
return 'fail'
def restart(): def restart():
return 'ok' return myOp('restart')
def reload(): def reload():
return 'ok' return myOp('reload')
def initdStatus(): def initdStatus():

Loading…
Cancel
Save