|
|
|
@ -504,11 +504,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() |
|
|
|
|
|
|
|
|
|
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()) |
|
|
|
|
|
|
|
|
|
mw.execShell('systemctl ' + method + ' ' + 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) |
|
|
|
|