Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 69391 - app-admin/sysklogd cronjob does not rotate logs
Summary: app-admin/sysklogd cronjob does not rotate logs
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: New packages (show other bugs)
Hardware: x86 Linux
: High normal (vote)
Assignee: Gentoo's Team for Core System packages
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-10-29 04:00 UTC by Ronald Moesbergen
Modified: 2008-06-07 16:23 UTC (History)
3 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Ronald Moesbergen 2004-10-29 04:00:41 UTC
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"
Comment 1 Martin Holzer (RETIRED) gentoo-dev 2004-12-13 10:34:18 UTC
did you try the package logrotate ?
Comment 2 Ronald Moesbergen 2004-12-13 11:26:16 UTC
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 ...
Comment 3 Robert Forsman 2005-11-09 10:51:38 UTC
Perhaps a script should be added to /etc/cron.weekly/ which rotates the logfiles
output by syslogd-listfiles -w.
Comment 4 valli 2006-03-10 06:20:50 UTC
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 ---
Comment 5 Martin von Gagern 2006-04-27 16:20:13 UTC
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?
Comment 6 Steve Herber 2006-07-08 14:02:14 UTC
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? 
Comment 7 Whit Blauvelt 2006-12-15 17:18:05 UTC
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?

Comment 8 SpanKY gentoo-dev 2008-06-07 16:23:52 UTC
fixed in sysklogd-1.5