[omd-commits] OMD Git: omd: FIX: Fixed logrotation when var/tmp does not exist

git version control git at mathias-kettner.de
Wed Aug 20 10:09:48 CEST 2014


Module:   omd
Branch:   master
Commit:   3d7cc46460dc7298df8c9594c98cc0016d580dfd
URL:      http://omdistro.org/projects/omd/repository/revisions/3d7cc46460dc7298df8c9594c98cc0016d580dfd

Author:   Lars Michelsen <lm at mathias-kettner.de>
Date:     Wed Aug 20 10:09:43 2014 +0200
Commiter: Lars Michelsen <lm at mathias-kettner.de>
Date:     Wed Aug 20 10:09:43 2014 +0200

FIX: Fixed logrotation when var/tmp does not exist

---

 Changelog                      |    2 ++
 packages/maintenance/logrotate |    4 ++++
 2 files changed, 6 insertions(+)

diff --git a/Changelog b/Changelog
index 1b85ec0..a517ae6 100644
--- a/Changelog
+++ b/Changelog
@@ -24,6 +24,8 @@ This file documents the revision history for the Open Monitoring Distribution
             already running (Modified nagios, apache and rrdcached scripts)
           - diskspace: Fixed error messages in syslog which were caused by
             exit codes of 3 when diskspace cleanup has not been configured
+          - FIX: Fixed logrotation when var/tmp does not exist
+            (seem to only be created when xinetd had been enabled before within a site)
           - Check_MK/MK Livestatus: new version 1.2.4p5
           - Thruk: Update to 1.84-6
           - PNP4Nagios: Update to 0.6.24
diff --git a/packages/maintenance/logrotate b/packages/maintenance/logrotate
index 41a860a..d94c3c2 100755
--- a/packages/maintenance/logrotate
+++ b/packages/maintenance/logrotate
@@ -18,6 +18,10 @@ LOCAL_LOGROTATE=$OMD_ROOT/var/tmp/logrotate
 if [ ! -x $LOCAL_LOGROTATE ] || \
     [ $(stat --dereference --format "%s" $LOCAL_LOGROTATE) -ne \
          $(stat --dereference --format "%s" $SBIN_LOGROTATE) ]; then
+  DIR=$(dirname $LOCAL_LOGROTATE)
+  if [ ! -d $DIR ]; then
+    mkdir -p $DIR
+  fi
   cp -f $SBIN_LOGROTATE $LOCAL_LOGROTATE
 fi
 $LOCAL_LOGROTATE $@



More information about the omd-commits mailing list