Craig White <craigwhite at azapple.com>

David G. Miller dave at davenjudy.org
Wed Feb 21 04:38:40 UTC 2007


Re: [Fedora] Sendmail's 2GiB limit? wrote:

> On Tue, 2007-02-20 at 20:05 -0700, Ashley M. Kirchner wrote:
>   
>> > Chris Mohler wrote:
>>     
>>> > > If I follow this discussion:
>>> > > http://www.mail-archive.com/devel@kannel.org/msg06223.html
>>> > >
>>> > > you may be able to recompile sysklogd and have it pass the 2g limit.
>>> > > It might be easier to move the rotation frequency back to one week,
>>> > > and then glom the rotated files together once a month via cron.
>>>       
>> >     That was easier said than done.  Once I recompiled sysklogd and 
>> > installed the new binary, restarted and all that jazz, when I tried to 
>> > start sendmail back up (with the >2 GiB file in place) I got this:
>> > 
>> >     > service sendmail start
>> >     Starting sendmail: 451 4.0.0 cannot open /var/log/sm-mta: File too large
>> > 
>> > 
>> >     If I'm not mistaken, those error codes are sendmail's.  *sigh*
>> > 
>> >     Now I have to write another script just to work in conjunction with 
>> > logrotate and rotate twice a month.  At the end of the month, take both 
>> > files and cat them together and then zip it up.  This is just stupid in 
>> > my opinion.
>>     
> ----
> a script samurai would welcome the challenge.
>
> Come to think of it, I don't recall ever seeing savvy administrators whining over a new scripting challenge, especially something that is this easy.
>
> Craig
An easier solution might be to create a /etc/logrotateMail.conf file 
that specifies rotating the maillog daily instead of weekly.  Maillog 
processing is currently specified in /etc/logrotate.d/syslog along with 
several other log files.  The steps would be something like:

Create /etc/logrotateMail.conf from one of the existing logrotate.conf 
configuration files and specify that maillog files are to be rotated daily.

Modify the /etc/cron.daily/logrotate file to use *both* the standard 
logrotate.conf and the new logrotateMail.conf files (logrotate claims to 
use all configuration files specified on the command line).

Remove /var/log/maillog from /etc/logrotate.d/syslog. 

Then just have a monthly cron job that grabs the previous month's set of 
daily maillog files and does whatever you'd like with them.  This 
approach also has the advantage that sendmail startup time isn't bogged 
down by finding the end of a huge log file.  The downside is you will 
have a proliferation of maillog.N files in /var/log.

Alternatively, you could just break out maillog processing into a 
separate config fragment in /etc/logrotate.d and override the default 
rotation interval.  Either way, need to remove maillog processing from 
/etc/logrotate.d/syslog. 

I'm guessing Ashley is already familiar with logrotate configuration 
files in order to get logrotate to only process maillog on a monthly 
basis.  Some of the bits of this approach may already be in place in 
order to get the monthly rotation.

Cheers,
Dave

-- 
Politics, n. Strife of interests masquerading as a contest of principles.
-- Ambrose Bierce




More information about the fedora-list mailing list