Bug 85577 - Logrotate include directive not working
Summary: Logrotate include directive not working
Alias: None
Product: Red Hat Linux
Classification: Retired
Component: logrotate
Version: 7.3
Hardware: All
OS: Linux
Target Milestone: ---
Assignee: Elliot Lee
QA Contact: Jay Turner
Depends On:
TreeView+ depends on / blocked
Reported: 2003-03-04 17:42 UTC by Karl O. Pinc
Modified: 2015-01-08 00:04 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Last Closed: 2003-07-15 12:19:23 UTC

Attachments (Terms of Use)

Description Karl O. Pinc 2003-03-04 17:42:42 UTC
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):


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 {
	/bin/kill -HUP `cat /var/run/syslogd.pid 2> /dev/null` 2> /dev/null || true
/var/log/maillog {
    # Keep 3 months of mail logs in case of complaints
    rotate 12
	/bin/kill -HUP `cat /var/run/syslogd.pid 2> /dev/null` 2> /dev/null || true

# 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 {
    rotate 12
	/bin/kill -HUP `cat /var/run/syslogd.pid 2> /dev/null` 2> /dev/null || true

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 19:18:37 UTC
Does it start working if you include the syslog.local file manually in 

Comment 2 Karl O. Pinc 2003-07-14 14:58:45 UTC
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 19:29:47 UTC
try running logrotate manually if you want to know whether it gives any errors.

Comment 4 Karl O. Pinc 2003-07-15 03:09:28 UTC
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.