From d165e1d1cf50b7b8cb1bc1002e104d139de74f3d Mon Sep 17 00:00:00 2001 From: Usman Nasir Date: Wed, 18 Sep 2019 15:06:58 +0500 Subject: [PATCH] bug fix: install process --- install/install.py | 7 ++++--- serverStatus/serverStatusUtil.py | 19 ++++++++++--------- .../serverStatus/litespeedStatus.html | 2 +- 3 files changed, 15 insertions(+), 13 deletions(-) diff --git a/install/install.py b/install/install.py index 8f24f563f..eda1718dd 100755 --- a/install/install.py +++ b/install/install.py @@ -1025,19 +1025,21 @@ def download_install_CyberPanel(self, mysqlPassword, mysql): logging.InstallLog.writeToFile("settings.py updated!") + self.setupVirtualEnv(self.distro) + ### Applying migrations os.chdir("CyberCP") - command = "python manage.py makemigrations" + command = "/usr/local/CyberCP/bin/python2 manage.py makemigrations" preFlightsChecks.call(command, self.distro, '[download_install_CyberPanel]', 'CyberPanel Make Migrations', 1, 1, os.EX_OSERR) ## - command = "python manage.py migrate" + command = "/usr/local/CyberCP/bin/python2 manage.py migrate" preFlightsChecks.call(command, self.distro, '[download_install_CyberPanel]', 'CyberPanel Migrate',1, 1, os.EX_OSERR) @@ -3847,7 +3849,6 @@ def main(): checks.configureOpenDKIM() checks.modSecPreReqs() - checks.setupVirtualEnv(distro) checks.installLSCPD() checks.setupLSCPDDaemon() checks.fixCyberPanelPermissions() diff --git a/serverStatus/serverStatusUtil.py b/serverStatus/serverStatusUtil.py index 72105b131..c0c999b14 100755 --- a/serverStatus/serverStatusUtil.py +++ b/serverStatus/serverStatusUtil.py @@ -145,15 +145,9 @@ def recover(): if os.path.exists('/usr/local/lsws'): shutil.rmtree('/usr/local/lsws') - command = 'tar -zxvf /usr/local/olsBackup.tar.gz -C /usr/local/' + command = 'mv /usr/local/lsws.bak /usr/local/lsws' ServerStatusUtil.executioner(command, FNULL) - command = 'mv /usr/local/usr/local/lsws /usr/local' - ServerStatusUtil.executioner(command, FNULL) - - if os.path.exists('/usr/local/usr'): - shutil.rmtree('/usr/local/usr') - @staticmethod def createWebsite(website): try: @@ -285,9 +279,16 @@ def switchTOLSWS(licenseKey): ProcessUtilities.killLiteSpeed() if os.path.exists('/usr/local/lsws'): - command = 'tar -zcvf /usr/local/olsBackup.tar.gz /usr/local/lsws' + command = 'mkdir /usr/local/lsws.bak' + if ServerStatusUtil.executioner(command, FNULL) == 0: + logging.CyberCPLogFileWriter.statusWriter(ServerStatusUtil.lswsInstallStatusPath, "Failed to create backup of current LSWS. [mkdir] [404]", 1) + ServerStatusUtil.recover() + return 0 + + command = 'cp -R /usr/local/lsws/* /usr/local/lsws.bak/' if ServerStatusUtil.executioner(command, FNULL) == 0: - logging.CyberCPLogFileWriter.statusWriter(ServerStatusUtil.lswsInstallStatusPath, "Failed to create backup of current LSWS. [404]", 1) + logging.CyberCPLogFileWriter.statusWriter(ServerStatusUtil.lswsInstallStatusPath, + "Failed to create backup of current LSWS. [cp][404]", 1) ServerStatusUtil.recover() return 0 diff --git a/serverStatus/templates/serverStatus/litespeedStatus.html b/serverStatus/templates/serverStatus/litespeedStatus.html index 7125fa8a0..f25b87598 100755 --- a/serverStatus/templates/serverStatus/litespeedStatus.html +++ b/serverStatus/templates/serverStatus/litespeedStatus.html @@ -146,7 +146,7 @@

- +