diff options
author | Rainer Gerhards <rgerhards@adiscon.com> | 2013-11-14 15:51:52 +0100 |
---|---|---|
committer | Rainer Gerhards <rgerhards@adiscon.com> | 2013-11-14 15:51:52 +0100 |
commit | 2387c9281d847b68f9c6268c1ba5e557e78f906c (patch) | |
tree | a4052fc66312709b4d7c25ed56d462f2c889c602 /runtime/rsconf.c | |
parent | f6e6e5edf172a06a20305895bcf0bf8509f08261 (diff) | |
download | rsyslog-2387c9281d847b68f9c6268c1ba5e557e78f906c.tar.gz rsyslog-2387c9281d847b68f9c6268c1ba5e557e78f906c.tar.bz2 rsyslog-2387c9281d847b68f9c6268c1ba5e557e78f906c.zip |
fix: ruleset queues were activated too early
This does not cause issues in v7, but here we have the problem
that the total number of actions, which now is required for wti sizing,
is not available at that early stage. So we needed to delay queue
startup until everything is processed (just as it should have been
already!). Note the previously we could have a segfault on first message
when ruleset queues were used.
Diffstat (limited to 'runtime/rsconf.c')
-rw-r--r-- | runtime/rsconf.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/runtime/rsconf.c b/runtime/rsconf.c index c855779e..f2feb989 100644 --- a/runtime/rsconf.c +++ b/runtime/rsconf.c @@ -679,8 +679,12 @@ activateMainQueue() mainqCnfObj = glbl.GetmainqCnfObj(); DBGPRINTF("activateMainQueue: mainq cnf obj ptr is %p\n", mainqCnfObj); /* create message queue */ - CHKiRet_Hdlr(createMainQueue(&pMsgQueue, UCHAR_CONSTANT("main Q"), - (mainqCnfObj == NULL) ? NULL : mainqCnfObj->nvlst)) { + iRet = createMainQueue(&pMsgQueue, UCHAR_CONSTANT("main Q"), + (mainqCnfObj == NULL) ? NULL : mainqCnfObj->nvlst); + if(iRet == RS_RET_OK) { + iRet = startMainQueue(pMsgQueue); + } + if(iRet != RS_RET_OK) { /* no queue is fatal, we need to give up in that case... */ fprintf(stderr, "fatal error %d: could not create message queue - rsyslogd can not run!\n", iRet); FINALIZE; @@ -743,6 +747,7 @@ activate(rsconf_t *cnf) tellModulesActivateConfig(); startInputModules(); CHKiRet(activateActions()); + CHKiRet(activateRulesetQueues()); CHKiRet(activateMainQueue()); /* finally let the inputs run... */ runInputModules(); |