newsyslog configuration issues

Matthew Seaman m.seaman at infracaninophile.co.uk
Thu Apr 24 11:00:24 PDT 2003


On Thu, Apr 24, 2003 at 09:32:50AM -0800, admin2 wrote:
 
> FreeBSD 4.7 Stable
> 
> can anybody recommend how to properly configure newsyslog for log files that
> are constantly opened and written.  Some of my log files rotate but the new
> log file can never written to.

It depends which process is holding an open descriptor on the file.
Many daemons can be persuaded to restart on receipt of a signal --
that includes closing and reopening logfiles.  Check man pages to see
if it's possible and what signal to use for the purpose.

For example, apache can be persuaded to do a graceful restart on
receipt of a SIGUSR1 (signal 30), so the following newsyslog.conf line
will prevent the httpd-access.log growing without bound:

    /var/log/httpd-access.log               644  20    100  *     Z   /var/run/httpd.pid 30

If your process doesn't support this sort of restart, and you can't
configure it to log via syslog, but you can log to a pipe rather than
a regular file, then you may be able to use something like cronolog --
(ports/sysutils/cronolog, http://www.cronolog.org/)

	Cheers,

	Matthew

-- 
Dr Matthew J Seaman MA, D.Phil.                       26 The Paddocks
                                                      Savill Way
PGP: http://www.infracaninophile.co.uk/pgpkey         Marlow
Tel: +44 1628 476614                                  Bucks., SL7 1TH UK
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 187 bytes
Desc: not available
Url : http://lists.freebsd.org/pipermail/freebsd-questions/attachments/20030424/b3189211/attachment.bin


More information about the freebsd-questions mailing list