summaryrefslogtreecommitdiffstats
path: root/syslogd.c
diff options
context:
space:
mode:
authorRainer Gerhards <rgerhards@adiscon.com>2007-08-03 10:07:38 +0000
committerRainer Gerhards <rgerhards@adiscon.com>2007-08-03 10:07:38 +0000
commitadbf55ece666c71e882c370a74efa0bbf3239226 (patch)
treee95a9c8927460313b02141ed3d66f9d672c717cc /syslogd.c
parente0414c4b9ed88a39e08870030c673bec9a3f1d4b (diff)
downloadrsyslog-adbf55ece666c71e882c370a74efa0bbf3239226.tar.gz
rsyslog-adbf55ece666c71e882c370a74efa0bbf3239226.tar.xz
rsyslog-adbf55ece666c71e882c370a74efa0bbf3239226.zip
- added CODE_STD_FINALIZERparseSelectorAct to module-generation macros
- restructered rsyslogd startup - moved startWorker() to a more appropriate place - updated ommysql.c to fully support suspension/resumption by rule engine
Diffstat (limited to 'syslogd.c')
-rw-r--r--syslogd.c35
1 files changed, 19 insertions, 16 deletions
diff --git a/syslogd.c b/syslogd.c
index 1888d47d..7ec50134 100644
--- a/syslogd.c
+++ b/syslogd.c
@@ -1992,7 +1992,7 @@ static rsRetVal actionDbgPrint(action_t *pThis)
printf(" next retry: %u, number retries: %d", (unsigned) pThis->ttResumeRtry, pThis->iNbrResRtry);
}
printf("\n");
- printf("\tDisabled: %d\n", pThis->bEnabled);
+ printf("\tDisabled: %d\n", !pThis->bEnabled);
printf("\tExec only when previous is suspended: %d\n", pThis->bExecWhenPrevSusp);
printf("\n");
@@ -4269,7 +4269,7 @@ finalize_it:
/* INIT -- Initialize syslogd from configuration table
* init() is called at initial startup AND each time syslogd is HUPed
*/
-static void init()
+static void init(void)
{
DEFiRet;
register int i;
@@ -4428,6 +4428,10 @@ static void init()
}
#endif
+# ifdef USE_PTHREADS
+ startWorker();
+# endif
+
Initialized = 1;
if(Debug) {
@@ -5640,9 +5644,6 @@ static void mainloop(void)
dprintf("\nReceived SIGHUP, reloading rsyslogd.\n");
/* worker thread is stopped as part of init() */
init();
-# ifdef USE_PTHREADS
- startWorker();
-# endif
restart = 0;
continue;
}
@@ -5924,12 +5925,25 @@ int main(int argc, char **argv)
funix[i] = -1;
}
+ /* doing some core initializations */
+
+#ifdef USE_PTHREADS
+ /* create message queue */
+ pMsgQueue = queueInit();
+ if(pMsgQueue == NULL) {
+ errno = 0;
+ logerror("error: could not create message queue - running single-threaded!\n");
+ }
+#endif
+
if((iRet = loadBuildInModules()) != RS_RET_OK) {
fprintf(stderr, "fatal error: could not activate built-in modules. Error code %d.\n",
iRet);
exit(1); /* "good" exit, leaving at init for fatal error */
}
+ /* END core initializations */
+
while ((ch = getopt(argc, argv, "46Aa:dehi:f:l:m:nop:r::s:t:u:vwx")) != EOF) {
switch((char)ch) {
case '4':
@@ -6192,18 +6206,7 @@ int main(int argc, char **argv)
* do the init() and then restart things.
* rgerhards, 2005-10-24
*/
-#ifdef USE_PTHREADS
- /* create message queue */
- pMsgQueue = queueInit();
- if(pMsgQueue == NULL) {
- errno = 0;
- logerror("error: could not create message queue - running single-threaded!\n");
- } else { /* start up worker thread */
- startWorker();
- }
-#endif
- /* --------------------- Main loop begins here. ----------------------------------------- */
mainloop();
die(bFinished);
return 0;