2009-03-09 00:25:57 +01:00
|
|
|
Index: Makefile
|
|
|
|
===================================================================
|
2010-08-24 17:44:55 +02:00
|
|
|
--- Makefile.orig
|
|
|
|
+++ Makefile
|
|
|
|
@@ -63,7 +63,7 @@ ifneq ($(STATEFILE),)
|
2007-01-16 00:24:09 +01:00
|
|
|
endif
|
|
|
|
|
|
|
|
BINDIR = $(BASEDIR)/sbin
|
|
|
|
-MANDIR = $(BASEDIR)/man
|
|
|
|
+MANDIR = $(BASEDIR)/share/man
|
|
|
|
|
|
|
|
#--------------------------------------------------------------------------
|
|
|
|
|
2009-03-09 00:25:57 +01:00
|
|
|
Index: examples/logrotate.cron
|
|
|
|
===================================================================
|
2010-08-24 17:44:55 +02:00
|
|
|
--- examples/logrotate.cron.orig
|
|
|
|
+++ examples/logrotate.cron
|
|
|
|
@@ -1,8 +1,23 @@
|
2007-01-16 00:24:09 +01:00
|
|
|
#!/bin/sh
|
|
|
|
|
2010-08-24 17:44:55 +02:00
|
|
|
-/usr/sbin/logrotate /etc/logrotate.conf >/dev/null 2>&1
|
2007-01-16 00:24:09 +01:00
|
|
|
-EXITVALUE=$?
|
2010-08-24 17:44:55 +02:00
|
|
|
+# exit immediately if there is another instance running
|
|
|
|
+if checkproc /usr/sbin/logrotate; then
|
2010-09-17 21:25:24 +02:00
|
|
|
+ /bin/logger -p cron.warning -t logrotate "ALERT another instance of logrotate is running - exiting"
|
2010-08-24 17:44:55 +02:00
|
|
|
+ exit 1;
|
|
|
|
+fi;
|
|
|
|
+
|
2007-01-16 00:24:09 +01:00
|
|
|
+TMPF=`mktemp /tmp/logrotate.XXXXXXXXXX`
|
|
|
|
+
|
|
|
|
+/usr/sbin/logrotate /etc/logrotate.conf 2>&1 | tee $TMPF
|
|
|
|
+EXITVALUE=${PIPESTATUS[0]}
|
|
|
|
+
|
|
|
|
if [ $EXITVALUE != 0 ]; then
|
|
|
|
- /usr/bin/logger -t logrotate "ALERT exited abnormally with [$EXITVALUE]"
|
|
|
|
+ # wait a sec, we might just have restarted syslog
|
|
|
|
+ sleep 1
|
|
|
|
+ # tell what went wrong
|
2010-09-17 21:25:24 +02:00
|
|
|
+ /bin/logger -p cron.warning -t logrotate "ALERT exited abnormally with [$EXITVALUE]"
|
|
|
|
+ /bin/logger -p cron.warning -t logrotate -f $TMPF
|
2007-01-16 00:24:09 +01:00
|
|
|
fi
|
|
|
|
+
|
|
|
|
+rm -f $TMPF
|
|
|
|
exit 0
|