Merge pull request #150 from TechExhibeo/1.8.0

add a check for openvz containers for tmp.mount
This commit is contained in:
Usman Nasir
2019-10-27 17:18:20 +05:00
committed by GitHub

View File

@@ -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',