arch-dev-public on dcron 4.3 and logrotate

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]



On Tue, Jan 12, 2010 at 04:28:40PM -0500, Paul Mattal wrote:
> On 01/12/2010 04:16 PM, Eric Bélanger wrote:
> >>>As the dcron logging is now managed by syslog-ng, it shouldn't provide
> >>>a /etc/logrotate.d/crond.  Instead, we should release a new syslog-ng
> >>>package with /var/log/crond.log added to the list of logfiles being
> >>>taken care of in its /etc/logrotate.d/syslog-ng. We could add, at the
> >>>same time, the other logfiles created by syslog-ng but currently
> >>>ignored in the log rotation:
> >>>
> >>>/var/log/lpr.log
> >>>/var/log/uucp.log
> >>>/var/log/news.log
> >>>/var/log/ppp.log
> >>>/var/log/debug.log
> >>>/var/log/acpid.log
> >>>
> >>>Am I missing something? Any objections, comments?
> >>
> >>Actually, that sounds backwards to me. If cron isn't installed, we
> >>have no log file. It makes sense to me - if pkgA adds more log files
> >>that get big, it should also provide its own logrotate file.
> >
> >I guess it depends how you see it.  The way I see it is that it's
> >syslog-ng who creates the file and appends to it so it should be
> >responsible for the rotation as well.  Plus, we use the missingok
> >option so if the file is missing, it just skips it whithout even
> >issuing an error message.  So no harm is done.
> 
> I can see both sides of this, but in essence, it seems like it's
> syslog-ng which ultimately decides the filename-- if syslog-ng.conf
> is changed to log cron output to another file, it's syslog-ng that
> decides where they go. So I think I agree with Eric that syslog-ng
> should be responsible for the rotating the files it determines
> should exist in its default configuration.
> 
> I'll wait a while to hear from others before doing anything directly
> to address this.

Yes, the logrotate script was needed when dcron didn't use syslog. And
I'll leave it in the release tarballs "extra" folder as an example for
users who continue to use dcron that way. But on my own system I have
syslog logging the cron output to "cron.log" not "crond.log":

from /etc/syslog-ng.conf:

    destination d_cron { file("/var/log/cron.log"); };
    filter f_cron { facility(cron) or program("rsnapshot"); };
    log { source(src); filter(f_cron); destination(d_cron); };

And I have /var/log/cron.log handled by my /etc/logrotate.d/syslog-ng
script:

/var/log/[..lots of logs, including cron.log..] {
    missingok
    sharedscripts
    postrotate
        /bin/kill -HUP `cat /var/run/syslog-ng.pid 2>/dev/null`  2>
/dev/null || true
    endscript
}

I can appreciate arguments both ways myself, but for my own use found it
easiest to just ignore the dcron-supplied logrotate script and edit it
into my syslog-ng logrotate script.

-- 
profjim@xxxxxxxxxxxx
dcron developer



[Index of Archives]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Share Photos]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]
  Powered by Linux