Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 3 Mar 2003 01:43:23 +0100
From:      Clement Laforet <sheepkiller@cultdeadsheep.org>
To:        "Chad Kline" <i18rabbit@hotmail.com>
Cc:        freebsd-questions@freebsd.org
Subject:   Re: log rotation
Message-ID:  <20030303014323.3097a56e.sheepkiller@cultdeadsheep.org>
In-Reply-To: <F25WFNonDcOmvgbUteE0000682a@hotmail.com>
References:  <F25WFNonDcOmvgbUteE0000682a@hotmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Sun, 02 Mar 2003 23:50:55 +0000
"Chad Kline" <i18rabbit@hotmail.com> wrote:

> 
> Since I upgraded to FreeBSD 4.7, I notice the
> following problem:
> 
> Once a month when my log files rotate
> (simply gzipping the old, and the creating a new empty log file
> via a cron job) the log files stay empty.  all permissions and
> ownerships are correct.  it takes a "reboot" - then the
> daemons are able to fill up the new log files - but not
> until a reboot.

Daemons write logs to a file descriptor (fd) without a syscall it can't
change fd.
using mv on a local file system use rename(), so fd is the same, and
daemon fills this fd. Usually you can send a kill -HUP to the daemon to
make him look for a new fd.

tipically :
mv current.log old.log
<fills old.log>
kill -HUP <pid of daemon>
<fills current.old>
gzip -9 old.old

and it should work

clem

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-questions" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20030303014323.3097a56e.sheepkiller>