summaryrefslogtreecommitdiffstats
path: root/syslogd.c
diff options
context:
space:
mode:
Diffstat (limited to 'syslogd.c')
-rw-r--r--syslogd.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/syslogd.c b/syslogd.c
index 9c39f459..db31bf9a 100644
--- a/syslogd.c
+++ b/syslogd.c
@@ -381,8 +381,6 @@ static int logEveryMsg = 0;/* no repeat message processing - read-only after st
* 1 - do NOT suppress duplicate messages
*/
uchar *pszWorkDir = NULL;/* name of rsyslog's spool directory (without trailing slash) */
-uchar *pszMainMsgQFName = NULL;/* prefix for the main message queue file */
-size_t iMainMsgQueMaxFileSize = 1024*1024;
/* end global config file state variables */
static unsigned int Forwarding = 0;
@@ -420,6 +418,9 @@ static queue_t *pMsgQueue = NULL; /* the main message queue */
static int iMainMsgQueueSize = 10000; /* size of the main message queue above */
static int iMainMsgQueueNumWorkers = 1; /* number of worker threads for the mm queue above */
static queueType_t MainMsgQueType = QUEUETYPE_FIXED_ARRAY; /* type of the main message queue above */
+static uchar *pszMainMsgQFName = NULL; /* prefix for the main message queue file */
+static size_t iMainMsgQueMaxFileSize = 1024*1024;
+static int bMainMsgQImmediateShutdown = 0; /* shut down the queue immediately? */
/* This structure represents the files that will have log
@@ -523,6 +524,7 @@ static rsRetVal resetConfigVariables(uchar __attribute__((unused)) *pp, void __a
iMainMsgQueueSize = 10000;
iMainMsgQueMaxFileSize = 1024 * 1024;
iMainMsgQueueNumWorkers = 1;
+ bMainMsgQImmediateShutdown = 0;
MainMsgQueType = QUEUETYPE_FIXED_ARRAY;
return RS_RET_OK;
@@ -3136,8 +3138,9 @@ static void dbgPrintInitInfo(void)
cCCEscapeChar);
dbgprintf("Main queue size %d messages.\n", iMainMsgQueueSize);
- dbgprintf("Main queue worker threads: %d\n", iMainMsgQueueNumWorkers);
- dbgprintf("Spool Directory: '%s'.\n", pszWorkDir);
+ dbgprintf("Main queue worker threads: %d, ImmediateShutdown: %d\n",
+ iMainMsgQueueNumWorkers, bMainMsgQImmediateShutdown);
+ dbgprintf("Work Directory: '%s'.\n", pszWorkDir);
}
@@ -3391,6 +3394,7 @@ init(void)
logerrorInt("Invalid " #directive ", error %d. Ignored, running with default setting", iRet); \
}
+ setQPROP(queueSetbImmediateShutdown, "$MainMsgQueueImmediateShutdown", bMainMsgQImmediateShutdown);
setQPROP(queueSetMaxFileSize, "$MainMsgQueueFileSize", iMainMsgQueMaxFileSize);
setQPROPstr(queueSetFilePrefix, "$MainMsgQueueFileName",
(pszMainMsgQFName == NULL ? (uchar*) "mainq" : pszMainMsgQFName));
@@ -4553,6 +4557,7 @@ static rsRetVal loadBuildInModules(void)
CHKiRet(regCfSysLineHdlr((uchar *)"workdirectory", 0, eCmdHdlrGetWord, NULL, &pszWorkDir, NULL));
CHKiRet(regCfSysLineHdlr((uchar *)"mainmsgqueuefilename", 0, eCmdHdlrGetWord, NULL, &pszMainMsgQFName, NULL));
CHKiRet(regCfSysLineHdlr((uchar *)"mainmsgqueuesize", 0, eCmdHdlrInt, NULL, &iMainMsgQueueSize, NULL));
+ CHKiRet(regCfSysLineHdlr((uchar *)"mainmsgqueueimmediateshutdown", 0, eCmdHdlrBinary, NULL, &bMainMsgQImmediateShutdown, NULL));
CHKiRet(regCfSysLineHdlr((uchar *)"mainmsgqueuetype", 0, eCmdHdlrGetWord, setMainMsgQueType, NULL, NULL));
CHKiRet(regCfSysLineHdlr((uchar *)"mainmsgqueueworkerthreads", 0, eCmdHdlrInt, NULL, &iMainMsgQueueNumWorkers, NULL));
CHKiRet(regCfSysLineHdlr((uchar *)"mainmsgqueuemaxfilesize", 0, eCmdHdlrSize, NULL, &iMainMsgQueMaxFileSize, NULL));