|
|
@ -503,22 +503,22 @@ def checkPHPVersion(version): |
|
|
|
return False |
|
|
|
return False |
|
|
|
|
|
|
|
|
|
|
|
# 检查Web服务是否启动 |
|
|
|
# 检查Web服务是否启动 |
|
|
|
if result.find('Connection refused') != -1: |
|
|
|
# if result.find('Connection refused') != -1: |
|
|
|
global isTask |
|
|
|
# global isTask |
|
|
|
if os.path.exists(isTask): |
|
|
|
# if os.path.exists(isTask): |
|
|
|
isStatus = mw.readFile(isTask) |
|
|
|
# isStatus = mw.readFile(isTask) |
|
|
|
if isStatus == 'True': |
|
|
|
# if isStatus == 'True': |
|
|
|
return True |
|
|
|
# return True |
|
|
|
|
|
|
|
|
|
|
|
# systemd |
|
|
|
# # systemd |
|
|
|
systemd = mw.systemdCfgDir() + '/openresty.service' |
|
|
|
# systemd = mw.systemdCfgDir() + '/openresty.service' |
|
|
|
if os.path.exists(systemd): |
|
|
|
# if os.path.exists(systemd): |
|
|
|
execShell('systemctl reload openresty') |
|
|
|
# execShell('systemctl reload openresty') |
|
|
|
return True |
|
|
|
# return True |
|
|
|
# initd |
|
|
|
# # initd |
|
|
|
initd = '/etc/init.d/openresty' |
|
|
|
# initd = '/etc/init.d/openresty' |
|
|
|
if os.path.exists(initd): |
|
|
|
# if os.path.exists(initd): |
|
|
|
os.system(initd + ' reload') |
|
|
|
# os.system(initd + ' reload') |
|
|
|
return True |
|
|
|
return True |
|
|
|
|
|
|
|
|
|
|
|
# --------------------------------------PHP监控 end--------------------------------------------- # |
|
|
|
# --------------------------------------PHP监控 end--------------------------------------------- # |
|
|
@ -536,7 +536,7 @@ def openrestyAutoRestart(): |
|
|
|
continue |
|
|
|
continue |
|
|
|
|
|
|
|
|
|
|
|
# systemd |
|
|
|
# systemd |
|
|
|
systemd = '/lib/systemd/system/openresty.service' |
|
|
|
systemd = mw.systemdCfgDir()+'/openresty.service' |
|
|
|
initd = '/etc/init.d/openresty' |
|
|
|
initd = '/etc/init.d/openresty' |
|
|
|
if os.path.exists(systemd): |
|
|
|
if os.path.exists(systemd): |
|
|
|
execShell('systemctl reload openresty') |
|
|
|
execShell('systemctl reload openresty') |
|
|
|