Update index.py

pull/597/head
Mr Chen 11 months ago
parent 21df235fd5
commit fb20289a80
  1. 33
      plugins/mysql-apt/index.py

@ -505,11 +505,38 @@ def my8cmd(version, method):
isInited = initMysql8Data()
if not isInited:
mw.execShell('systemctl start ' + getPluginName())
if not mw.isSupportSystemctl():
cmd_init_start = init_file + ' start'
subprocess.Popen(cmd_init_start, stdout=subprocess.PIPE, shell=True,
bufsize=4096, stderr=subprocess.PIPE)
time.sleep(6)
else:
mw.execShell('systemctl start '+getPluginName())
for x in range(10):
mydb_status = process_status()
if mydb_status == 'start':
initMysql8Pwd()
break
time.sleep(1)
initMysql8Pwd()
mw.execShell('systemctl stop ' + getPluginName())
mw.execShell('systemctl ' + method + ' ' + getPluginName())
if not mw.isSupportSystemctl():
cmd_init_stop = init_file + ' stop'
subprocess.Popen(cmd_init_stop, stdout=subprocess.PIPE, shell=True,
bufsize=4096, stderr=subprocess.PIPE)
time.sleep(3)
else:
mw.execShell('systemctl stop ' + getPluginName())
if not mw.isSupportSystemctl():
sub = subprocess.Popen(cmd, stdout=subprocess.PIPE, shell=True,
bufsize=4096, stderr=subprocess.PIPE)
sub.wait(5)
else:
mw.execShell('systemctl ' + method + ' '+getPluginName())
return 'ok'
except Exception as e:
return str(e)

Loading…
Cancel
Save