syslog log rotation

James Ralston qralston+ml.inn-workers at andrew.cmu.edu
Wed Apr 25 03:55:30 UTC 2001


On Wed, 25 Apr 2001, Olaf Titz wrote:

> As I see it the rotating program should not create the new log file
> at all, since syslog will do that as soon as it is reloaded (and at
> the same moment the old one gets closed).  [...]  Or are there
> syslogds braindamaged enough that they can't handle this?

Yes: most of them.  For example, no version of SunOS/Solaris syslogd
(up to and including Solaris 8) will create log files.  In fact, the
Linux syslogd is the first syslog implementation I've encountered that
*will* create log files if they don't exist.  (I don't have access to
a *BSD box at the moment, although I'd guess that most of their
syslogds would be able to create log files as well.)

Besides, even if all syslogd implementations could create log files,
INN would still need to create its new log files itself, because if it
were to let syslogd create them, they'd be owned by root (instead of
news), and you wouldn't be able to guarantee that they'd be readable
by news.  In fact, they probably wouldn't be; when I tested if Red Hat
7.0's syslogd could create new log files, it created the new log files
user root, group root, mode 0600.  Scanlogs wouldn't be able to access
them.

> What I do is to let the system's logrotate handle it, but
> unfortunately every system does that differently...

...even if they did, synchronizing the system's logrotate with INN's
scanlogs would be just about impossible.  The only reasonable way to
do it would be to have scanlogs' processing lag one day behind the
actual logs, which I don't think too many people would find
acceptable.

BTW, it occurred to me that an alternative to writing a hupsyslogd
program would be to redesign the news.daily script to be invoked as
root.  That way, it could su to news for most of its tasks, but run
scanlogs as root.  Scanlogs would be modified to ensure that all files
it creates are user news, group news.

Writing a hupsyslogd program would probably take less effort,
though...

-- 
James Ralston, Information Technology
Software Engineering Institute
Carnegie Mellon University, Pittsburgh, PA, USA



More information about the inn-workers mailing list