[syslog-ng]deleting log files - syslog-ng]
Balazs Scheidler
bazsi@balabit.hu
Fri, 26 Oct 2001 17:49:26 +0200
On Fri, Oct 26, 2001 at 02:31:56PM +0300, Mikko Niskanen wrote:
> > On Fri, Oct 26, 2001 at 12:11:48PM +0200, Thomas Kaehn wrote:
> > But a fstat() call at each write would be a more elegant solutuion if it
> > doesn't slow down writing too much.
>
> Can't comment this performance issue, perhaps Bazsi has given it
> a thought?
fstat() is crude, at least I don't like it (tm) :) you might try the
afremctl interface, however it's also a bit crude, though working:
source ctl { unix-stream("/dev/logctl"); };
destination dst { remote_control(); };
filter f_reopen { program("reopen"); };
log { source(ctl); filter(f_reopen); destination(dst); };
---
and send a message to /dev/logctl (using logger for example), coming from a
command named "reopen" with contents having the filename to be reopened.
so for example: (strictly untested, just like the above config):
logger -u /dev/logctl -t reopen /var/log/messages
This hack was implemented by _tgz.
--
Bazsi
PGP info: KeyID 9AF8D0A9 Fingerprint CD27 CFB0 802C 0944 9CFD 804E C82C 8EB1