From 55659b96a38d926445c9ae4123df4b1d29e18c32 Mon Sep 17 00:00:00 2001 From: Rainer Gerhards Date: Mon, 4 Jun 2012 12:01:24 +0200 Subject: add small delay (50ms) after sending shutdown message There seem to be cases where the shutdown message is otherwise not processed, not even on an idle system. Thanks to Marcin for bringing this problem up. --- tools/syslogd.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'tools') diff --git a/tools/syslogd.c b/tools/syslogd.c index 7872cb5f..0988d462 100644 --- a/tools/syslogd.c +++ b/tools/syslogd.c @@ -1072,6 +1072,11 @@ die(int sig) errno = 0; logmsgInternal(NO_ERRCODE, LOG_SYSLOG|LOG_INFO, (uchar*)buf, 0); } + /* we sleep for 50ms to give the queue a chance to pick up the exit message; + * otherwise we have seen cases where the message did not make it to log + * files, even on idle systems. + */ + srSleep(0, 50); /* drain queue (if configured so) and stop main queue worker thread pool */ DBGPRINTF("Terminating main queue...\n"); -- cgit