Skip to content

Commit db17cd1

Browse files
committed
bug fix cron on ubuntu
1 parent 595fc6f commit db17cd1

3 files changed

Lines changed: 13 additions & 0 deletions

File tree

install/install.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1702,6 +1702,11 @@ def setup_cron(self):
17021702
cronFile.write(content)
17031703
cronFile.close()
17041704

1705+
if not os.path.exists(CentOSPath):
1706+
command = 'chmod 600 %s' % (cronPath)
1707+
preFlightsChecks.call(command, self.distro, command, command, 1, 0, os.EX_OSERR)
1708+
1709+
17051710
if self.distro == centos or self.distro == cent8:
17061711
command = 'systemctl restart crond.service'
17071712
else:

plogical/cronUtil.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,10 @@ def addNewCron(externalApp, finalCron):
8585
with open(cronPath, "a") as file:
8686
file.write(finalCron + "\n")
8787

88+
if ProcessUtilities.decideDistro() == ProcessUtilities.ubuntu:
89+
command = 'chmod 600 %s' % (cronPath)
90+
ProcessUtilities.executioner(command)
91+
8892
print("1,None")
8993
except BaseException as msg:
9094
print("0," + str(msg))

plogical/upgrade.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2133,6 +2133,10 @@ def runSomeImportantBash():
21332133
writeToFile.write(content)
21342134
writeToFile.close()
21352135

2136+
if not os.path.exists(CentOSPath):
2137+
command = 'chmod 600 %s' % (cronPath)
2138+
Upgrade.executioner(command, 0)
2139+
21362140
@staticmethod
21372141
def upgrade(branch):
21382142

0 commit comments

Comments
 (0)