Bug 113840 - Logrotate executes post rotate scripts every day
Logrotate executes post rotate scripts every day
Product: Red Hat Enterprise Linux 2.1
Classification: Red Hat
Component: logrotate (Show other bugs)
i686 Linux
medium Severity medium
: ---
: ---
Assigned To: Peter Vrabec
Depends On:
  Show dependency treegraph
Reported: 2004-01-19 08:22 EST by Silver Kuusk
Modified: 2007-11-30 17:06 EST (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2005-04-28 11:37:34 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Silver Kuusk 2004-01-19 08:22:09 EST
Description of problem:
The post rotate scripts on weekly and monthly rotations jobs are 
running every day.

Version-Release number of selected component (if applicable):

How reproducible:
Every time

Steps to Reproduce:
Create configuration file for a weekly rotations job.
Example files in /etc/logrotate.d 
‘cat apache’

/usr/local/apache/logs/*log {
  rotate 6
  olddir /usr/local/apache/logs/arhiiv
    /usr/local/apache/bin/apachectl graceful
    /bin/sleep 10

or original RH syslog file ‘cat syslog’:
/var/log/messages /var/log/secure /var/log/maillog /var/log/spooler /v
ar/log/boot.log /var/log/cron {
        /bin/kill -HUP `cat /var/run/syslogd.pid 2> /dev/null` 
2> /dev/null || true

2. Check message log or check mail from cron daemon on next days.
Actual results:
I ’m getting a mail from cron daemon every day:

Subject: Cron <root@brc> run-parts /etc/cron.daily


/usr/local/apache/bin/apachectl graceful: httpd gracefully restarted

The post rotate script for syslog is running every day (lines from 
message log):
Jan 11 04:14:28 www syslogd 1.4.1: restart.
Jan 12 04:09:26 www syslogd 1.4.1: restart.
Jan 13 04:08:02 www syslogd 1.4.1: restart.
Jan 14 04:09:20 www syslogd 1.4.1: restart.
Jan 15 04:09:07 www syslogd 1.4.1: restart.
Jan 16 04:08:32 www syslogd 1.4.1: restart.
Jan 17 04:07:59 www syslogd 1.4.1: restart.

Expected results:
The post rotation script should run only once a week.
There should be only one line per week in a message log.

Additional info:
Comment 1 Elliot Lee 2004-02-24 11:24:48 EST
Can you verify that the actual logfile rotation is happening as well?

Weekly rotation happens if:
1. The current weekday is before the weekday of the last rotation
2. More than a week has passed since the last rotation.
Comment 2 Silver Kuusk 2004-02-25 02:40:40 EST
Actual logfile rotation is happening on every Sunday. But post 
scripts are running every day.
Comment 4 John Flanagan 2005-04-28 11:37:34 EDT
An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on the solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.


Note You need to log in before you can comment on or make changes to this bug.