diff options
Diffstat (limited to 'tools')
-rw-r--r-- | tools/omfile.c | 22 | ||||
-rw-r--r-- | tools/omfwd.c | 6 | ||||
-rw-r--r-- | tools/rsyslog.conf.5 | 4 | ||||
-rw-r--r-- | tools/syslogd.c | 1 |
4 files changed, 25 insertions, 8 deletions
diff --git a/tools/omfile.c b/tools/omfile.c index 2c547b2b..efdaead4 100644 --- a/tools/omfile.c +++ b/tools/omfile.c @@ -111,6 +111,7 @@ static uchar *pszTplName = NULL; /* name of the default template to use */ typedef struct _instanceData { uchar f_fname[MAXFNAME];/* file or template name (display only) */ strm_t *pStrm; /* our output stream */ + strmType_t strmType; /* stream type, used for named pipes */ char bDynamicName; /* 0 - static name, 1 - dynamic name (with properties) */ int fCreateMode; /* file creation mode for open() */ int fDirCreateMode; /* creation mode for mkdir() */ @@ -425,7 +426,7 @@ prepareFile(instanceData *pData, uchar *newFileName) CHKiRet(strm.SettOperationsMode(pData->pStrm, STREAMMODE_WRITE_APPEND)); CHKiRet(strm.SettOpenMode(pData->pStrm, fCreateMode)); CHKiRet(strm.SetbSync(pData->pStrm, pData->bSyncFile)); - CHKiRet(strm.SetsType(pData->pStrm, STREAMTYPE_FILE_SINGLE)); + CHKiRet(strm.SetsType(pData->pStrm, pData->strmType)); CHKiRet(strm.SetiSizeLimit(pData->pStrm, pData->iSizeLimit)); /* set the flush interval only if we actually use it - otherwise it will activate * async processing, which is a real performance waste if we do not do buffered @@ -596,8 +597,11 @@ writeFile(uchar **ppString, unsigned iMsgOpts, instanceData *pData) finalize_it: if(iRet != RS_RET_OK) { - /* in v5, we shall return different states for message-cause failur (but only there!) */ - iRet = RS_RET_SUSPENDED; + /* in v5, we shall return different states for message-caused failure (but only there!) */ + if(pData->strmType == STREAMTYPE_NAMED_PIPE) + iRet = RS_RET_DISABLE_ACTION; /* this is the traditional semantic -- rgerhards, 2010-01-15 */ + else + iRet = RS_RET_SUSPENDED; } RETiRet; } @@ -685,11 +689,17 @@ CODESTARTparseSelectorAct case '|': case '/': CODE_STD_STRING_REQUESTparseSelectorAct(1) - /* we now have the same semantics for files and pipes, but we need to skip over - * the pipe indicator traditionally seen in config files... + /* we now have *almost* the same semantics for files and pipes, but we still need + * to know we deal with a pipe, because we must do non-blocking opens in that case + * (to keep consistent with traditional semantics and prevent rsyslog from hanging). */ - if(*p == '|') + if(*p == '|') { ++p; + pData->strmType = STREAMTYPE_NAMED_PIPE; + } else { + pData->strmType = STREAMTYPE_FILE_SINGLE; + } + CHKiRet(cflineParseFileName(p, (uchar*) pData->f_fname, *ppOMSR, 0, OMSR_NO_RQD_TPL_OPTS, (pszTplName == NULL) ? (uchar*)"RSYSLOG_FileFormat" : pszTplName)); pData->bDynamicName = 0; diff --git a/tools/omfwd.c b/tools/omfwd.c index fe65f515..02f19eac 100644 --- a/tools/omfwd.c +++ b/tools/omfwd.c @@ -483,6 +483,12 @@ CODESTARTdoAction } } finalize_it: +# ifdef USE_NETZIP + if(psz != (char*) ppString[0]) { + /* we need to free temporary buffer, alloced above - Naoya Nakazawa, 2010-01-11 */ + free(psz); + } +# endif ENDdoAction diff --git a/tools/rsyslog.conf.5 b/tools/rsyslog.conf.5 index 0a2422c6..f2b915e2 100644 --- a/tools/rsyslog.conf.5 +++ b/tools/rsyslog.conf.5 @@ -164,8 +164,8 @@ a pattern of facilities and priorities belonging to the specified action. The selector field itself again consists of two parts, a facility and a priority, separated by a period ('.'). Both parts are case insensitive and can also be specified as decimal numbers, but don't do that, you have been warned. -Both facilities and priorities are described in rsyslog(3). The names mentioned -below correspond to the similar LOG_-values in /usr/include/rsyslog.h. +Both facilities and priorities are described in syslog(3). The names mentioned +below correspond to the similar LOG_-values in /usr/include/syslog.h. The facility is one of the following keywords: auth, authpriv, cron, daemon, kern, lpr, mail, mark, news, security (same as auth), syslog, user, uucp and diff --git a/tools/syslogd.c b/tools/syslogd.c index 17fcf9f3..8fcb8dd0 100644 --- a/tools/syslogd.c +++ b/tools/syslogd.c @@ -3216,6 +3216,7 @@ int realMain(int argc, char **argv) iCompatibilityMode = atoi(optarg); break; case 'd': /* debug - must be handled now, so that debug is active during init! */ + debugging_on = 1; Debug = 1; break; case 'e': /* log every message (no repeat message supression) */ |