summaryrefslogtreecommitdiffstats
path: root/syslogd.c
diff options
context:
space:
mode:
authorRainer Gerhards <rgerhards@adiscon.com>2008-01-14 17:53:35 +0000
committerRainer Gerhards <rgerhards@adiscon.com>2008-01-14 17:53:35 +0000
commitec27ea55f38d78fd97c80f8554870693a96be332 (patch)
treef1b13978cda52a0353d13fd3b4ac304407a659ba /syslogd.c
parent16eba18af23dad76e717ae9fde5dfea31ce6f2aa (diff)
downloadrsyslog-ec27ea55f38d78fd97c80f8554870693a96be332.tar.gz
rsyslog-ec27ea55f38d78fd97c80f8554870693a96be332.tar.xz
rsyslog-ec27ea55f38d78fd97c80f8554870693a96be332.zip
begin disk assisted queue memory queue modes (not fully implemented yet)
Diffstat (limited to 'syslogd.c')
-rw-r--r--syslogd.c21
1 files changed, 14 insertions, 7 deletions
diff --git a/syslogd.c b/syslogd.c
index d3c93f92..4dcfa337 100644
--- a/syslogd.c
+++ b/syslogd.c
@@ -3361,10 +3361,18 @@ init(void)
iMainMsgQueueNumWorkers = 1;
}
- if(MainMsgQueType == QUEUETYPE_DISK && pszWorkDir == NULL) {
- fprintf(stderr, "No $WorkDirectory specified - can not run main message queue in 'disk' mode. "
- "Using 'FixedArray' instead.\n");
- MainMsgQueType = QUEUETYPE_FIXED_ARRAY;
+ if(MainMsgQueType == QUEUETYPE_DISK) {
+ errno = 0; /* for logerror! */
+ if(pszWorkDir == NULL) {
+ logerror("No $WorkDirectory specified - can not run main message queue in 'disk' mode. "
+ "Using 'FixedArray' instead.\n");
+ MainMsgQueType = QUEUETYPE_FIXED_ARRAY;
+ }
+ if(pszMainMsgQFName == NULL) {
+ logerror("No $MainMsgQueueFileName specified - can not run main message queue in "
+ "'disk' mode. Using 'FixedArray' instead.\n");
+ MainMsgQueType = QUEUETYPE_FIXED_ARRAY;
+ }
}
/* switch the message object to threaded operation, if necessary */
@@ -3384,13 +3392,12 @@ init(void)
logerrorInt("Invalid " #directive ", error %d. Ignored, running with default setting", iRet); \
}
# define setQPROPstr(func, directive, data) \
- CHKiRet_Hdlr(func(pMsgQueue, data, strlen((char*) data))) { \
+ CHKiRet_Hdlr(func(pMsgQueue, data, (data == NULL)? 0 : strlen((char*) data))) { \
logerrorInt("Invalid " #directive ", error %d. Ignored, running with default setting", iRet); \
}
setQPROP(queueSetMaxFileSize, "$MainMsgQueueFileSize", iMainMsgQueMaxFileSize);
- setQPROPstr(queueSetFilePrefix, "$MainMsgQueueFileName",
- (pszMainMsgQFName == NULL ? (uchar*) "mainq" : pszMainMsgQFName));
+ setQPROPstr(queueSetFilePrefix, "$MainMsgQueueFileName", pszMainMsgQFName);
setQPROP(queueSetiPersistUpdCnt, "$MainMsgQueueCheckpointInterval", iMainMsgQPersistUpdCnt);
setQPROP(queueSettoQShutdown, "$MainMsgQueueTimeoutShutdown", iMainMsgQtoQShutdown );
setQPROP(queueSettoActShutdown, "$MainMsgQueueTimeoutActionCompletion", iMainMsgQtoActShutdown);