diff options
author | Rainer Gerhards <rgerhards@adiscon.com> | 2008-01-11 10:11:55 +0000 |
---|---|---|
committer | Rainer Gerhards <rgerhards@adiscon.com> | 2008-01-11 10:11:55 +0000 |
commit | e095d1ab45b205b4849151b15592c2824f04373a (patch) | |
tree | 73fec9662d199fece800817138c2f87505ee7499 /syslogd.c | |
parent | c9430404dbf38d5c7fdbbb8aebc78fce38c0906c (diff) | |
download | rsyslog-e095d1ab45b205b4849151b15592c2824f04373a.tar.gz rsyslog-e095d1ab45b205b4849151b15592c2824f04373a.tar.xz rsyslog-e095d1ab45b205b4849151b15592c2824f04373a.zip |
added $MainMsgQueueImmediateShutdown config directive
Diffstat (limited to 'syslogd.c')
-rw-r--r-- | syslogd.c | 13 |
1 files changed, 9 insertions, 4 deletions
@@ -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)); |