The sysklogd package comes with a cronjob to rotate the logfiles. It uses the syslogd-listfiles command to list which files are to be logged. However, when I run this command only one logfile is returned, '/var/log/syslog', all the other logfiles are not in the list. According to bug #40304 the -a switch was removed from the syslogd-listfiles command to work around an issue with news logfiles, but it seems now it doesn't rotate at all, because without -a only logfiles with faciliy.prio *.* are returned. (See man syslogd-listfiles) After adding back -a it works again. Reproducible: Always Steps to Reproduce: 1. Install sysklogd 2. Run syslog.cron 3. Actual Results: Logfiles are not rotated. Expected Results: Rotated logfiles. Portage 2.0.51-r2 (default-x86-2004.2, gcc-3.3.4, glibc-2.3.4.20040808-r1, 2.6.9 i686) ================================================================= System uname: 2.6.9 i686 Pentium II (Deschutes) Gentoo Base System version 1.4.16 Autoconf: sys-devel/autoconf-2.59-r5 Automake: sys-devel/automake-1.8.5-r1 Binutils: sys-devel/binutils-2.14.90.0.8-r1 Headers: sys-kernel/linux26-headers-2.6.8.1 Libtools: sys-devel/libtool-1.5.2-r5 ACCEPT_KEYWORDS="x86" AUTOCLEAN="yes" CFLAGS="-march=pentium2 -O2 -pipe" CHOST="i686-pc-linux-gnu" COMPILER="" CONFIG_PROTECT="/etc /usr/kde/2/share/config /usr/kde/3/share/config /usr/share/ config /var/qmail/control" CONFIG_PROTECT_MASK="/etc/gconf /etc/terminfo /etc/env.d" CXXFLAGS="-O2 -mcpu=i686 -pipe" DISTDIR="/usr/portage/distfiles" FEATURES="autoaddcvs ccache distlocks sandbox" GENTOO_MIRRORS="http://ftp.snt.utwente.nl/pub/os/linux/gentoo" MAKEOPTS="-j3" PKGDIR="/usr/portage/packages" PORTAGE_TMPDIR="/var/tmp" PORTDIR="/usr/portage" PORTDIR_OVERLAY="" SYNC="rsync://rsync.europe.gentoo.org/gentoo-portage" USE="x86 mmx nptl pam readline ssl userlocales"
did you try the package logrotate ?
No, no need for it with the -a flag added back. If it's not going to be 'fixed' then maybe the syslog rotate script should be removed completely? Not much use for a rotate script that doesn't work ...
Perhaps a script should be added to /etc/cron.weekly/ which rotates the logfiles output by syslogd-listfiles -w.
Place the following content in the file /etc/cron.weekly/syslog.cron (it's from debian) --- FILECONTENT OF /etc/cron.weekly/syslog.cron BEGIN --- #! /bin/sh # sysklogd Cron script to rotate system log files weekly. # # If you want to rotate logfiles weekly, edit # this script and /etc/cron.daily/syslog.cron to get # the logfiles in sync (they must not occur in both # files). # # This is a configration file. You are invited to edit # it and maintain it on your own. You'll have to do # that if you don't like the default policy # wrt. rotating logfiles (i.e. with large logfiles # weekly and daily rotation may interfere). # # Written by Ian A. Murdock <imurdock@debian.org>. # (This file is ported from Debian) cd /var/log for LOG in `/usr/sbin/syslogd-listfiles --weekly | /bin/grep -v auth` do if [ -s $LOG ]; then /usr/sbin/savelog -g adm -m 640 -u root -c 4 $LOG >/dev/null fi done # Restart syslogd # /bin/killall -HUP syslogd --- FILECONTENT OF /etc/cron.weekly/syslog.cron END ---
Perhaps the subject should be changed to "sysklogd does not rotate all logs", as the syslog.log file is rotated on a daily basis, isn't it?
I just got bit by my /var partition filling up with huge log files. As mentioned in comment #2, one occurance of the -a flag needs to be added back into the /etc/cron.daily/syslog.cron file. This bug has been sitting here for almost two years. What does it take to get the changed pushed out?
Yes, why hasn't this been fixed?? It needs to be /usr/sbin/syslogd-listfiles -a Is this being left broken because syslog-ng is more politically correct? Well, syslog-ng has it's own problems - that I'm still tracing so no bug report yet. The old standby still is useful. Why leave this easy-to-correct bug in portage?
fixed in sysklogd-1.5