[syslog-ng]HUP'ing syslog-ng causes data loss
Balazs Scheidler
bazsi@balabit.hu
Tue, 18 Dec 2001 18:07:31 +0100
On Wed, Dec 12, 2001 at 10:40:25AM -0600, UK wrote:
> Greetings,
>
> Trying to see what happens when syslog-ng (Version 1.4.14 on Solaris 8) gets
> HUP'ed, as my logrotate scripts will do, while it's receiving UDP data.
> Using the stresstes.sh script on another host (which is using the syslog-ng
> box as a loghost), a stream of messages will be sent. The while loop was
> changed to:
>
> while [ "$i" -lt "1000" ]
>
> After the script ran, a "cat messages | wc -l" was done against the log and
> the results would be approx 995 lines (probably because it's UDP). Then I'd
> move the file and HUP syslog-ng and retested a few more times. Same results
> each time.
>
> Next, while stresstest.sh was running, syslog-ng would be HUP'ed two or
> three times. After every test the "cat messages | wc -l" would show between
> 965 - 975 lines.
When syslog-ng receives a HUP signal it closes and reopens all listening
sockets. Because this takes some time, it may be responsible for the data
loss.
There was a request in private mail to add a keep-listener-alive() option,
which would avoid this close operation, which could help a bit, this is
however a todo item, and not reality.
--
Bazsi
PGP info: KeyID 9AF8D0A9 Fingerprint CD27 CFB0 802C 0944 9CFD 804E C82C 8EB1