Bug 85577 - Logrotate include directive not working
Logrotate include directive not working
Status: CLOSED NOTABUG
Product: Red Hat Linux
Classification: Retired
Component: logrotate (Show other bugs)
7.3
All Linux
low Severity medium
: ---
: ---
Assigned To: Elliot Lee
Jay Turner
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2003-03-04 12:42 EST by kop
Modified: 2015-01-07 19:04 EST (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2003-07-15 08:19:23 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description kop 2003-03-04 12:42:42 EST
Description of problem:

Logrotate include directive does not appear to be working.
(It could be that syntax is wrong, in which case the
documentation needs clarification.)  Further,
there are no error messages showing up in the system
logs.  (A second problem, perhaps because it's the
syslogd rotate scripts.  grep logrotate /var/log/messages*
finds nothing.)

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

logrotate-3.6.4-1

How reproducible:

It's always happening for me.

Steps to Reproduce:
 
Here's the configuration files:

[root@jcp tmp]# cat /etc/logrotate.d/syslog
/var/log/messages /var/log/secure /var/log/spooler /var/log/boot.log /var/log/cron {
    sharedscripts
    postrotate
	/bin/kill -HUP `cat /var/run/syslogd.pid 2> /dev/null` 2> /dev/null || true
    endscript
}
/var/log/maillog {
    sharedscripts
    # Keep 3 months of mail logs in case of complaints
    rotate 12
    postrotate
	/bin/kill -HUP `cat /var/run/syslogd.pid 2> /dev/null` 2> /dev/null || true
    endscript
}

# Special jcp stuff.
include /etc/logrotate.d/syslog.local
[root@jcp tmp]# cat /etc/logrotate.d/syslog.local 
# included into the standard system's syslog rotate config

/var/log/jcp {
    sharedscripts
    monthly
    rotate 12
    postrotate
	/bin/kill -HUP `cat /var/run/syslogd.pid 2> /dev/null` 2> /dev/null || true
    endscript
}

    
Actual results:

(Note that the include file was created by copying stuff out of
the 'master' into the included file in jan.)

[root@jcp tmp]# ls -lh /var/log/jcp*
-rw-r-----    1 root     jcp-staf     188k Mar  4 10:54 /var/log/jcp
-rw-r-----    1 root     jcp-staf      80k Jan  1 04:16 /var/log/jcp.1
-rw-r-----    1 root     jcp-staf      73k Dec  1 04:18 /var/log/jcp.2
-rw-r-----    1 root     jcp-staf      25k Nov  1 04:14 /var/log/jcp.3


Expected results:


Additional info:

The included file is a softlink.

[root@jcp tmp]# ls -lh /etc/logrotate.d/syslog.local 
lrwxrwxrwx    1 root     root           39 Jan  2 14:47
/etc/logrotate.d/syslog.local -> /usr/local/etc/logrotate.d/syslog.local
Comment 1 Elliot Lee 2003-07-09 15:18:37 EDT
Does it start working if you include the syslog.local file manually in 
/etc/logrotate.d/syslog?
Comment 2 kop 2003-07-14 10:58:45 EDT
I'll have to wait until the end of the month to find out if including the file
locally works.

I have more information.  It doesn't look as if logrotate is running at all, yet
it's in /etc/cron.daily as usual.  There's no mention of logrotate in the cron
logs, in /var/log/messages or in mail sent to root.

(The configuration
remains as above, except now the /var/log/maillog section has a "compress" on
the line after "rotate 12".  For the future, I've commented out the 'include'
line and included the contents manually.)

Could the problem be that syslog.local is being included twice?  Once in
/etc/logrotate.conf (as /etc/logrotate.d/syslog.local) and once in
/etc/logrotate.d/syslog?  If this is the problem why am I not getting an error
message _somewhere_?
Comment 3 Elliot Lee 2003-07-14 15:29:47 EDT
try running logrotate manually if you want to know whether it gives any errors.
Comment 4 kop 2003-07-14 23:09:28 EDT
Duh, should'a thought of that.

[root@jcp root]# /etc/cron.daily/logrotate 
error: syslog.local:3 duplicate log entry for /var/log/jcp

For other reasons I'm not getting root's mail.

So, go ahead and close this bug.

Unless you want to use this opportunity to fix the error message
so it starts with the name of the program generating the
error as is (sorta) standard.  (IIRC as in the GNU coding standards.
See 'info standards', node 'Errors'.)  That'd make it easier to
grep for and to tell where the message is coming from
when it's buried in with other errors.  I'm not making any
claims, but it's possible I wouldn't have had to file this bug
if my grepping had found the error message.

Sorry for the false alarm.

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