Bug 68917 - bad logrotate configuration for mailman
bad logrotate configuration for mailman
Status: CLOSED RAWHIDE
Product: Red Hat Linux
Classification: Retired
Component: logrotate (Show other bugs)
7.2
i386 Linux
medium Severity medium
: ---
: ---
Assigned To: Elliot Lee
Aaron Brown
:
: 75364 77619 (view as bug list)
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2002-07-15 18:42 EDT by ferulisses
Modified: 2007-04-18 12:44 EDT (History)
3 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2002-12-10 13:07:00 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:


Attachments (Terms of Use)

  None (edit)
Description ferulisses 2002-07-15 18:42:54 EDT
Description of problem:
The default configuration of mailman causes loop on logrotate, fill
the /var/log/mailman directory of compressed files

Version-Release number of selected component (if applicable):
mailman-2.0.11-1
logrotate-3.5.9-1

How reproducible:
Always

Steps to Reproduce:
1. install mailman
2. enable compression on /etc/logrotate.conf (not sure if this is
   necessary)
3. wait logrotate run thwo times
4. ls /var/log/mailman
	

Actual Results:  the file instaled in /etc/logrotate.d/mailman is:
---------------------------
/var/log/mailman/* {
    missingok
}
---------------------------

with this configuration the logrotate program don't work well, it
doesn't recognize the old compressed files, and create backup of
them, creating a lot of backup of backup of backup, filling
the directory and the disk, like this:

$ cd /var/log/mailman
$ ls
post.1.gz
post.1.gz.1.gz
post.1.gz.1.gz.1.gz
post.1.gz.1.gz.1.gz.1.gz
post.1.gz.1.gz.1.gz.1.gz.1.gz
post.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz
post.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz
post.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz
post.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz
post.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.1.gz.2.gz



Expected Results:  just rotate the logs, may use a config file like this:

---------------------------
/var/log/mailman/bounce /var/log/mailman/digest /var/log/mailman/error/var/log/m
ailman/post /var/log/mailman/qrunner /var/log/mailman/smtp 
/var/log/mailman/subscribe /var/log/mailman/vette {
    missingok
}
---------------------------


Additional info:

may be considered a logrotate bug, but just the mailman package have a 
configuration file that "exploit" the bug.

I think that is more easy fix the configuration file now and schedule to fix 
the logrotate in the future.
Comment 1 Bernd Bartmann 2002-07-22 04:11:29 EDT
This also happens without log file compression.
Comment 2 Elliot Lee 2002-08-08 11:57:02 EDT
Yea, sorry, there's really no good way to protect against a bad wildcard. The administrator 
is responsible for deciding what files they want to rotate and knowing how to specify those 
files.
Comment 3 Bernd Bartmann 2002-08-08 12:12:58 EDT
No, you as Red Hat are responsible for providing proper and working defaults. A
simple solution was posted by the original bug reporter. Why don't you just use
this a the default for /etc/logrotate.d/mailman?
Comment 4 Elliot Lee 2002-08-08 12:22:12 EDT
Ahh, you are correct sir; I did not realize that this was the default config. I went and  
checked the mailman-2.0.13-2 logrotate setup in rawhide and it does not use the wildcard, 
so hopefully that eliminates the issue for the future.
Comment 5 Bernd Bartmann 2002-08-08 12:33:34 EDT
Fine. Any chance on getting an official errata for RH 7.2 / 7.3?
Comment 6 R P Herrold 2002-09-12 16:55:06 EDT
Quick and dirty fix -- add this to crontab pending a fix, and in any backport
release:

rm /var/log/mailman/*z.[0-9]*.gz

The question of a backport release could safely incorporate it, to cure damage
inadvertently caused.
Comment 7 Tomasz Orzechowski 2002-10-22 12:57:08 EDT
actually, using wildcards is 'supported' in an example in 'man logrotate':

       /var/log/news/* {
           monthly

etc. so fix for logrotate should be provided or docs updated
Comment 8 Elliot Lee 2002-12-10 13:04:57 EST
*** Bug 77619 has been marked as a duplicate of this bug. ***
Comment 9 Elliot Lee 2002-12-10 13:06:52 EST
*** Bug 75364 has been marked as a duplicate of this bug. ***
Comment 10 Elliot Lee 2002-12-10 15:09:14 EST
man page fixed, 3.6.6 should have the change.
Comment 11 Adam Oline 2003-06-18 16:42:23 EDT
The news example in the old man page for logrotate was not an error. The full
example for the news logs read as follows in logrotate-3.6.4-1:

/var/log/news/* {
           monthly
           rotate 2
           olddir /var/log/news/old
           missingok
           postrotate
                                     kill -HUP `cat /var/run/inn.pid`
           endscript
           nocompress
}

This was fine, because of the use of the 'olddir' option. There is a paragraph
explaining this further down in the man page:

       Please use wildcards with  caution.   If  you  specify  *,
       logrotate  will  rotate  all  files,  including previously
       rotated ones.  A way around this  is  to  use  the  olddir
       directive or a more exact wildcard (such as *.log).

The new man page for logrotate from rawhide now has the example as:

/var/log/news/news.crit {
           monthly
           rotate 2
           olddir /var/log/news/old
           missingok
           postrotate
                                     kill -HUP `cat /var/run/inn.pid`
           endscript
           nocompress
}

This does not quite jive with the paragraph explaining this example:

       The last section defines the parameters  for  all  of  the
       files  in /var/log/news. Each file is rotated on a monthly
       basis.  This is considered a single rotation directive and
       if  errors occur for more then one file, the log files are
       not compressed.

The paragraph states that *all* of the files in /var/log/news are rotated, when
the example actually only rotates the file 'news.crit'. On my 7.3 distribution,
I see news.err and news.notice in the directory as well.

The mailman packages logrotate config file was in error, but the logrotate man
page was fine. Perhaps consider changing the logrotate man page back to the way
it read previously, since I believe the example was intended to show the proper
way of using a '*' wildcard.

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