[Lunar-commits] <moonbase> logrotate: Make use of the new cron.plugin

Stefan Wold ratler at lunar-linux.org
Sat Nov 7 14:55:49 CET 2009


commit 3f9865f83822bcbe3f676196e4def256587ed618
Author: Stefan Wold <ratler at lunar-linux.org>
Date:   Sat Nov 7 14:55:49 2009 +0100

    logrotate: Make use of the new cron.plugin
---
 utils/logrotate/BUILD                |    8 --------
 utils/logrotate/cron.daily/logrotate |    8 ++++++++
 2 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/utils/logrotate/BUILD b/utils/logrotate/BUILD
index 0caae44..ccb3aaf 100644
--- a/utils/logrotate/BUILD
+++ b/utils/logrotate/BUILD
@@ -14,14 +14,6 @@
     install -m 0644 examples/logrotate-default /etc/logrotate.conf
   fi &&
 
-  if [ ! -d /etc/cron.daily ]; then 
-    mkdir -p /etc/cron.daily
-  fi &&
-
-  if [ ! -e /etc/cron.daily/logrotate ]; then
-    install -m 0755 examples/logrotate.cron /etc/cron.daily/logrotate
-  fi &&
-
   gather_docs examples
 
 ) > $C_FIFO 2>&1
diff --git a/utils/logrotate/cron.daily/logrotate b/utils/logrotate/cron.daily/logrotate
new file mode 100644
index 0000000..c6d50d4
--- /dev/null
+++ b/utils/logrotate/cron.daily/logrotate
@@ -0,0 +1,8 @@
+#!/bin/sh
+
+/usr/sbin/logrotate /etc/logrotate.conf
+EXITVALUE=$?
+if [ $EXITVALUE != 0 ]; then
+    /usr/bin/logger -t logrotate "ALERT exited abnormally with [$EXITVALUE]"
+fi
+exit 0


More information about the Lunar-commits mailing list