[omd-commits] OMD Git: omd: FIX: Set correct shell environment for cronjobs

git version control git at mathias-kettner.de
Fri Apr 15 14:36:13 CEST 2016


Module:   omd
Branch:   master
Commit:   618ed501519f44603f37072030b2320bbb312315
URL:      http://omdistro.org/projects/omd/repository/revisions/618ed501519f44603f37072030b2320bbb312315

Author:   Lars Michelsen <lm at mathias-kettner.de>
Date:     Fri Apr 15 14:36:11 2016 +0200
Commiter: Lars Michelsen <lm at mathias-kettner.de>
Date:     Fri Apr 15 14:36:11 2016 +0200

FIX: Set correct shell environment for cronjobs

---

 Changelog                           |    1 +
 packages/maintenance/merge-crontabs |    6 ++++--
 2 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/Changelog b/Changelog
index b11216a..c9fd3fa 100644
--- a/Changelog
+++ b/Changelog
@@ -7,6 +7,7 @@ This file documents the revision history for the Open Monitoring Distribution
                    to restore invalid backup files
             - FIX: Added missing but documented --conflict flag to "omd restore"
             - FIX: Skipping partially created sites during omd start/stop/restart
+	    - FIX: Set correct shell environment for cronjobs
             - omd backup: Can use --no-rrds,--no-logs or --no-past now to
               exclude RRDs and/or the monitoring history from the backup. These
               options can be used to make the backup/restore procedure faster
diff --git a/packages/maintenance/merge-crontabs b/packages/maintenance/merge-crontabs
index 00517de..b56531f 100755
--- a/packages/maintenance/merge-crontabs
+++ b/packages/maintenance/merge-crontabs
@@ -13,10 +13,12 @@ sys.stdout.write("""#
 # is started or reloaded.
 #
 # execute 'omd reload crontab'
-# to rebuild this file out of %s/etc/cron.d/*
+# to rebuild this file out of %(omd_root)s/etc/cron.d/*
 #
 # --ENVIRONMENT------------------------------------------------
-""" % os.environ['OMD_ROOT'])
+SHELL=/bin/bash
+BASH_ENV=%(omd_root)s/.profile
+""" % {"omd_root": os.environ['OMD_ROOT']})
 
 sys.stdout.write("OMD_ROOT=%s\n" % os.environ['OMD_ROOT'])
 sys.stdout.write("OMD_SITE=%s\n" % os.environ['OMD_SITE'])



More information about the omd-commits mailing list