diff options
author | Rainer Gerhards <rgerhards@adiscon.com> | 2010-04-26 12:12:37 +0200 |
---|---|---|
committer | Rainer Gerhards <rgerhards@adiscon.com> | 2010-04-26 12:12:37 +0200 |
commit | 0944d4b5422b232daadfe4acc6a73c5e2e83c77b (patch) | |
tree | 51b0b9377ac5b13b05d319d4951364360a03fb11 /tools | |
parent | 7ef0821d4cc8582b01ab56d2fe304993186e40e7 (diff) | |
parent | d19806431653e6575a002ab48206c16d3041e465 (diff) | |
download | rsyslog-0944d4b5422b232daadfe4acc6a73c5e2e83c77b.tar.gz rsyslog-0944d4b5422b232daadfe4acc6a73c5e2e83c77b.tar.xz rsyslog-0944d4b5422b232daadfe4acc6a73c5e2e83c77b.zip |
Merge branch 'v4-devel' into tmp
Diffstat (limited to 'tools')
-rw-r--r-- | tools/syslogd.c | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/tools/syslogd.c b/tools/syslogd.c index b0a61abf..2432a28d 100644 --- a/tools/syslogd.c +++ b/tools/syslogd.c @@ -1749,6 +1749,25 @@ finalize_it: } + +/* Put the rsyslog main thread to sleep for n seconds. This was introduced as + * a quick and dirty workaround for a privilege drop race in regard to listener + * startup, which itself was a result of the not-yet-done proper coding of + * privilege drop code (quite some effort). It may be useful for other occasions, too. + * is specified). + * rgerhards, 2009-06-12 + */ +static rsRetVal +putToSleep(void __attribute__((unused)) *pVal, int iNewVal) +{ + DEFiRet; + DBGPRINTF("rsyslog main thread put to sleep via $sleep %d directive...\n", iNewVal); + srSleep(iNewVal, 0); + DBGPRINTF("rsyslog main thread continues after $sleep %d\n", iNewVal); + RETiRet; +} + + /* Switch to either an already existing rule set or start a new one. The * named rule set becomes the new "current" rule set (what means that new * actions are added to it). @@ -2005,6 +2024,7 @@ static rsRetVal loadBuildInModules(void) CHKiRet(regCfSysLineHdlr((uchar *)"actionresumeretrycount", 0, eCmdHdlrInt, NULL, &glbliActionResumeRetryCount, NULL)); CHKiRet(regCfSysLineHdlr((uchar *)"defaultruleset", 0, eCmdHdlrGetWord, setDefaultRuleset, NULL, NULL)); CHKiRet(regCfSysLineHdlr((uchar *)"ruleset", 0, eCmdHdlrGetWord, setCurrRuleset, NULL, NULL)); + CHKiRet(regCfSysLineHdlr((uchar *)"sleep", 0, eCmdHdlrInt, putToSleep, NULL, NULL)); CHKiRet(regCfSysLineHdlr((uchar *)"mainmsgqueuefilename", 0, eCmdHdlrGetWord, NULL, &pszMainMsgQFName, NULL)); CHKiRet(regCfSysLineHdlr((uchar *)"mainmsgqueuesize", 0, eCmdHdlrInt, NULL, &iMainMsgQueueSize, NULL)); CHKiRet(regCfSysLineHdlr((uchar *)"mainmsgqueuehighwatermark", 0, eCmdHdlrInt, NULL, &iMainMsgQHighWtrMark, NULL)); |