From dbf412b77cac434256f0a62f222256ec3da6e5e2 Mon Sep 17 00:00:00 2001 From: Tim G Date: Tue, 1 Apr 2014 21:09:08 +1000 Subject: [PATCH] Bugfix, fix crontab commands on HP-UX --- library/system/cron | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/library/system/cron b/library/system/cron index 15c21fb157d..902442b5d5f 100644 --- a/library/system/cron +++ b/library/system/cron @@ -353,6 +353,8 @@ class CronTab(object): if self.user: if platform.system() == 'SunOS': return "su %s -c '%s -l'" % (pipes.quote(self.user), pipes.quote(CRONCMD)) + elif platform.system() == 'HP-UX': + return "%s %s %s" % (CRONCMD , '-l', pipes.quote(self.user)) else: user = '-u %s' % pipes.quote(self.user) return "%s %s %s" % (CRONCMD , user, '-l') @@ -363,7 +365,7 @@ class CronTab(object): """ user = '' if self.user: - if platform.system() == 'SunOS': + if platform.system() in ['SunOS', 'HP-UX']: return "chown %s %s ; su '%s' -c '%s %s'" % (pipes.quote(self.user), pipes.quote(path), pipes.quote(self.user), CRONCMD, pipes.quote(path)) else: user = '-u %s' % pipes.quote(self.user)