4aeeca5915
OBS-URL: https://build.opensuse.org/package/show/Base:System/logrotate?expand=0&rev=5a26a0fe1feb8e0da19cc9746b16a93a
45 lines
1.3 KiB
Diff
45 lines
1.3 KiB
Diff
Index: Makefile
|
|
===================================================================
|
|
--- Makefile.orig
|
|
+++ Makefile
|
|
@@ -63,7 +63,7 @@ ifneq ($(STATEFILE),)
|
|
endif
|
|
|
|
BINDIR = $(BASEDIR)/sbin
|
|
-MANDIR = $(BASEDIR)/man
|
|
+MANDIR = $(BASEDIR)/share/man
|
|
|
|
#--------------------------------------------------------------------------
|
|
|
|
Index: examples/logrotate.cron
|
|
===================================================================
|
|
--- examples/logrotate.cron.orig
|
|
+++ examples/logrotate.cron
|
|
@@ -1,8 +1,23 @@
|
|
#!/bin/sh
|
|
|
|
-/usr/sbin/logrotate /etc/logrotate.conf >/dev/null 2>&1
|
|
-EXITVALUE=$?
|
|
+# exit immediately if there is another instance running
|
|
+if checkproc /usr/sbin/logrotate; then
|
|
+ /bin/logger -p cron.warning -t logrotate "ALERT another instance of logrotate is running - exiting"
|
|
+ exit 1;
|
|
+fi;
|
|
+
|
|
+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
|
|
+ /bin/logger -p cron.warning -t logrotate "ALERT exited abnormally with [$EXITVALUE]"
|
|
+ /bin/logger -p cron.warning -t logrotate -f $TMPF
|
|
fi
|
|
+
|
|
+rm -f $TMPF
|
|
exit 0
|