summaryrefslogtreecommitdiffstats
path: root/syslogd.c
diff options
context:
space:
mode:
authorRainer Gerhards <rgerhards@adiscon.com>2008-01-13 17:16:59 +0000
committerRainer Gerhards <rgerhards@adiscon.com>2008-01-13 17:16:59 +0000
commitbbf0aecbbd3d4adf2f952011418701dce0236234 (patch)
treec84a9cfb128177c596b0d4173194bf2bf2b50e66 /syslogd.c
parent7791cf780f348c18de06bd06627bb986078db063 (diff)
downloadrsyslog-bbf0aecbbd3d4adf2f952011418701dce0236234.tar.gz
rsyslog-bbf0aecbbd3d4adf2f952011418701dce0236234.tar.xz
rsyslog-bbf0aecbbd3d4adf2f952011418701dce0236234.zip
added $MainMsgQueuePersistUpdateCount config file directive
Diffstat (limited to 'syslogd.c')
-rw-r--r--syslogd.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/syslogd.c b/syslogd.c
index 4950a8f9..c3135237 100644
--- a/syslogd.c
+++ b/syslogd.c
@@ -421,6 +421,7 @@ static queueType_t MainMsgQueType = QUEUETYPE_FIXED_ARRAY; /* type of the main m
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? */
+static int iMainMsgQPersistUpdCnt = 0; /* persist queue info every n updates */
/* This structure represents the files that will have log
@@ -525,6 +526,7 @@ static rsRetVal resetConfigVariables(uchar __attribute__((unused)) *pp, void __a
iMainMsgQueMaxFileSize = 1024 * 1024;
iMainMsgQueueNumWorkers = 1;
bMainMsgQImmediateShutdown = 0;
+ iMainMsgQPersistUpdCnt = 0;
MainMsgQueType = QUEUETYPE_FIXED_ARRAY;
return RS_RET_OK;
@@ -3138,8 +3140,8 @@ static void dbgPrintInitInfo(void)
cCCEscapeChar);
dbgprintf("Main queue size %d messages.\n", iMainMsgQueueSize);
- dbgprintf("Main queue worker threads: %d, ImmediateShutdown: %d\n",
- iMainMsgQueueNumWorkers, bMainMsgQImmediateShutdown);
+ dbgprintf("Main queue worker threads: %d, ImmediateShutdown: %d, Perists every %d updates.\n",
+ iMainMsgQueueNumWorkers, bMainMsgQImmediateShutdown, iMainMsgQPersistUpdCnt);
dbgprintf("Work Directory: '%s'.\n", pszWorkDir);
}
@@ -3398,6 +3400,7 @@ init(void)
setQPROP(queueSetMaxFileSize, "$MainMsgQueueFileSize", iMainMsgQueMaxFileSize);
setQPROPstr(queueSetFilePrefix, "$MainMsgQueueFileName",
(pszMainMsgQFName == NULL ? (uchar*) "mainq" : pszMainMsgQFName));
+ setQPROP(queueSetiPersistUpdCnt, "$MainMsgQueuePersistUpdateCount", iMainMsgQPersistUpdCnt);
# undef setQPROP
# undef setQPROPstr
@@ -4559,6 +4562,7 @@ static rsRetVal loadBuildInModules(void)
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 *)"mainmsgqueuepersistupdatecount", 0, eCmdHdlrInt, NULL, &iMainMsgQPersistUpdCnt, 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));