diff options
author | Rainer Gerhards <rgerhards@adiscon.com> | 2008-01-14 17:53:35 +0000 |
---|---|---|
committer | Rainer Gerhards <rgerhards@adiscon.com> | 2008-01-14 17:53:35 +0000 |
commit | ec27ea55f38d78fd97c80f8554870693a96be332 (patch) | |
tree | f1b13978cda52a0353d13fd3b4ac304407a659ba /syslogd.c | |
parent | 16eba18af23dad76e717ae9fde5dfea31ce6f2aa (diff) | |
download | rsyslog-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.c | 21 |
1 files changed, 14 insertions, 7 deletions
@@ -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); |