mirror of
https://github.com/usmannasir/cyberpanel.git
synced 2025-11-08 06:16:08 +01:00
Merge pull request #150 from TechExhibeo/1.8.0
add a check for openvz containers for tmp.mount
This commit is contained in:
@@ -136,6 +136,19 @@ class preFlightsChecks:
|
|||||||
|
|
||||||
def mountTemp(self):
|
def mountTemp(self):
|
||||||
try:
|
try:
|
||||||
|
## On OpenVZ there is an issue using .tempdisk for /tmp as it breaks network on container after reboot.
|
||||||
|
|
||||||
|
if subprocess.check_output('systemd-detect-virt').find("openvz") > -1:
|
||||||
|
|
||||||
|
varTmp = "/var/tmp /tmp none bind 0 0\n"
|
||||||
|
|
||||||
|
fstab = "/etc/fstab"
|
||||||
|
writeToFile = open(fstab, "a")
|
||||||
|
writeToFile.writelines(varTmp)
|
||||||
|
writeToFile.close()
|
||||||
|
|
||||||
|
else:
|
||||||
|
|
||||||
command = "dd if=/dev/zero of=/usr/.tempdisk bs=100M count=15"
|
command = "dd if=/dev/zero of=/usr/.tempdisk bs=100M count=15"
|
||||||
preFlightsChecks.call(command, self.distro, '[mountTemp]',
|
preFlightsChecks.call(command, self.distro, '[mountTemp]',
|
||||||
'mountTemp',
|
'mountTemp',
|
||||||
|
|||||||
Reference in New Issue
Block a user