Skip to content

Commit 0bcca16

Browse files
committed
Update for OpenVZ in Centos 7
1 parent ecbba69 commit 0bcca16

1 file changed

Lines changed: 13 additions & 2 deletions

File tree

install/installCyberPanel.py

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -356,6 +356,17 @@ def installPureFTPD(self):
356356

357357
####### Install pureftpd to system startup
358358

359+
### Deal with some Centos 7 OpenVZ issues:
360+
if self.distro == centos:
361+
if subprocess.check_output('systemd-detect-virt').decode("utf-8").find("openvz") > -1:
362+
varTmp = "[Service]\nPIDFile=/run/pure-ftpd.pid"
363+
writeToFile = open("/etc/systemd/system/pure-ftpd.service.d/override.conf", "w")
364+
writeToFile.writelines(varTmp)
365+
writeToFile.close()
366+
367+
command = "systemctl daemon-reload"
368+
install.preFlightsCheck.call(command, self.distro. command, command, 1, 1, os.EX_OSERR);
369+
359370
command = "systemctl enable " + install.preFlightsChecks.pureFTPDServiceName(self.distro)
360371
install.preFlightsChecks.call(command, self.distro, command, command, 1, 1, os.EX_OSERR)
361372

@@ -366,7 +377,7 @@ def installPureFTPD(self):
366377

367378
command = 'useradd -u 2001 -s /bin/false -d /bin/null -c "pureftpd user" -g ftpgroup ftpuser'
368379
install.preFlightsChecks.call(command, self.distro, command, command, 1, 1, os.EX_OSERR)
369-
380+
370381
def startPureFTPD(self):
371382
############## Start pureftpd ######################
372383
if self.distro == ubuntu:
@@ -654,4 +665,4 @@ def Main(cwd, mysql, distro, ent, serial = None, port = "8090", ftp = None, dns
654665
if dns == 'ON':
655666
installer.installPowerDNS()
656667
installer.installPowerDNSConfigurations(InstallCyberPanel.mysqlPassword, mysql)
657-
installer.startPowerDNS()
668+
installer.startPowerDNS()

0 commit comments

Comments
 (0)