mirror of
https://github.com/usmannasir/cyberpanel.git
synced 2025-11-07 22:06:05 +01:00
bug fix: https://forums.cyberpanel.net/discussion/5405/litespeed-enterprise-is-rebooting-every-3-minutes
This commit is contained in:
@@ -1685,9 +1685,26 @@ imap_folder_list_limit = 0
|
|||||||
0 0 * * 0 /usr/local/CyberCP/bin/python /usr/local/CyberCP/IncBackups/IncScheduler.py Weekly
|
0 0 * * 0 /usr/local/CyberCP/bin/python /usr/local/CyberCP/IncBackups/IncScheduler.py Weekly
|
||||||
*/3 * * * * if ! find /home/*/public_html/ -maxdepth 2 -type f -newer /usr/local/lsws/cgid -name '.htaccess' -exec false {} +; then /usr/local/lsws/bin/lswsctrl restart; fi
|
*/3 * * * * if ! find /home/*/public_html/ -maxdepth 2 -type f -newer /usr/local/lsws/cgid -name '.htaccess' -exec false {} +; then /usr/local/lsws/bin/lswsctrl restart; fi
|
||||||
"""
|
"""
|
||||||
|
|
||||||
cronFile.write(content)
|
cronFile.write(content)
|
||||||
cronFile.close()
|
cronFile.close()
|
||||||
|
|
||||||
|
### Check and remove OLS restart if lsws ent detected
|
||||||
|
|
||||||
|
if not os.path.exists('/usr/local/lsws/bin/openlitespeed'):
|
||||||
|
|
||||||
|
data = open(cronPath, 'r').readlines()
|
||||||
|
|
||||||
|
writeToFile = open(cronPath, 'w')
|
||||||
|
|
||||||
|
for items in data:
|
||||||
|
if items.find('-maxdepth 2 -type f -newer') > -1:
|
||||||
|
pass
|
||||||
|
else:
|
||||||
|
writeToFile.writelines(items)
|
||||||
|
|
||||||
|
writeToFile.close()
|
||||||
|
|
||||||
if not os.path.exists(CentOSPath):
|
if not os.path.exists(CentOSPath):
|
||||||
command = 'chmod 600 %s' % (cronPath)
|
command = 'chmod 600 %s' % (cronPath)
|
||||||
preFlightsChecks.call(command, self.distro, command, command, 1, 0, os.EX_OSERR)
|
preFlightsChecks.call(command, self.distro, command, command, 1, 0, os.EX_OSERR)
|
||||||
|
|||||||
@@ -2406,6 +2406,23 @@ vmail
|
|||||||
writeToFile.write(content)
|
writeToFile.write(content)
|
||||||
writeToFile.close()
|
writeToFile.close()
|
||||||
|
|
||||||
|
### Check and remove OLS restart if lsws ent detected
|
||||||
|
|
||||||
|
if not os.path.exists('/usr/local/lsws/bin/openlitespeed'):
|
||||||
|
|
||||||
|
data = open(cronPath, 'r').readlines()
|
||||||
|
|
||||||
|
writeToFile = open(cronPath, 'w')
|
||||||
|
|
||||||
|
for items in data:
|
||||||
|
if items.find('-maxdepth 2 -type f -newer') > -1:
|
||||||
|
pass
|
||||||
|
else:
|
||||||
|
writeToFile.writelines(items)
|
||||||
|
|
||||||
|
writeToFile.close()
|
||||||
|
|
||||||
|
|
||||||
if not os.path.exists(CentOSPath):
|
if not os.path.exists(CentOSPath):
|
||||||
command = 'chmod 600 %s' % (cronPath)
|
command = 'chmod 600 %s' % (cronPath)
|
||||||
Upgrade.executioner(command, 0)
|
Upgrade.executioner(command, 0)
|
||||||
|
|||||||
@@ -348,6 +348,28 @@ class ServerStatusUtil:
|
|||||||
ProcessUtilities.stopLitespeed()
|
ProcessUtilities.stopLitespeed()
|
||||||
ProcessUtilities.restartLitespeed()
|
ProcessUtilities.restartLitespeed()
|
||||||
|
|
||||||
|
### Check and remove OLS restart if lsws ent detected
|
||||||
|
|
||||||
|
CentOSPath = '/etc/redhat-release'
|
||||||
|
|
||||||
|
if os.path.exists(CentOSPath):
|
||||||
|
cronPath = '/var/spool/cron/root'
|
||||||
|
else:
|
||||||
|
cronPath = '/var/spool/cron/crontabs/root'
|
||||||
|
|
||||||
|
data = open(cronPath, 'r').readlines()
|
||||||
|
|
||||||
|
writeToFile = open(cronPath, 'w')
|
||||||
|
|
||||||
|
for items in data:
|
||||||
|
if items.find('-maxdepth 2 -type f -newer') > -1:
|
||||||
|
pass
|
||||||
|
else:
|
||||||
|
writeToFile.writelines(items)
|
||||||
|
|
||||||
|
writeToFile.close()
|
||||||
|
|
||||||
|
###
|
||||||
|
|
||||||
logging.CyberCPLogFileWriter.statusWriter(ServerStatusUtil.lswsInstallStatusPath,"Successfully switched to LITESPEED ENTERPRISE WEB SERVER. [200]\n", 1)
|
logging.CyberCPLogFileWriter.statusWriter(ServerStatusUtil.lswsInstallStatusPath,"Successfully switched to LITESPEED ENTERPRISE WEB SERVER. [200]\n", 1)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user