add a wrapper for logrotate to fool the system logrotate's checkproc
[omd.git] / packages / maintenance / logrotate
blob41a860a3d36fa1e4920b4b74e52f8639c715c819
1 #! /bin/sh
4 # Whenever /etc/cron.daily/logrotate starts to run under a SLES system,
5 # it first calls checkproc to make sure that there is no other logrotate
6 # process already running.
7 # Under rare circumstances (system-logrotate running at midnight)
8 # the omd-logrotate can be such a rival process. If it is the first to run
9 # (even a few microseconds before /etc/cron.daily/logrotate is launched)
10 # there will be no more rotation of the logs in /var/log/apache.
11 # In a heavily used OMD-system the /var-partition will be filled up very
12 # quickly.
13 # checkproc is symlink-aware, so we need to run our own copy of logrotate.
16 SBIN_LOGROTATE=/usr/sbin/logrotate
17 LOCAL_LOGROTATE=$OMD_ROOT/var/tmp/logrotate
18 if [ ! -x $LOCAL_LOGROTATE ] || \
19 [ $(stat --dereference --format "%s" $LOCAL_LOGROTATE) -ne \
20 $(stat --dereference --format "%s" $SBIN_LOGROTATE) ]; then
21 cp -f $SBIN_LOGROTATE $LOCAL_LOGROTATE
23 $LOCAL_LOGROTATE $@