diff options
author | Rainer Gerhards <rgerhards@adiscon.com> | 2011-08-05 14:56:20 +0200 |
---|---|---|
committer | Rainer Gerhards <rgerhards@adiscon.com> | 2011-08-05 14:56:20 +0200 |
commit | f8342ced6f7c17ecd2f043254151c786257b3fbb (patch) | |
tree | d1fdaa84ba6ad90078f1affb3433de62cb35d8d3 | |
parent | 0bf454aba2b62618ab6c2a7c4b17641c0bce297b (diff) | |
download | rsyslog-f8342ced6f7c17ecd2f043254151c786257b3fbb.tar.gz rsyslog-f8342ced6f7c17ecd2f043254151c786257b3fbb.tar.xz rsyslog-f8342ced6f7c17ecd2f043254151c786257b3fbb.zip |
- imudp&imtcp now report error if no listener at all was defined
Thanks to Marcin for suggesting this error message
-rw-r--r-- | ChangeLog | 4 | ||||
-rw-r--r-- | plugins/imtcp/imtcp.c | 5 | ||||
-rw-r--r-- | plugins/imudp/imudp.c | 5 | ||||
-rw-r--r-- | runtime/rsyslog.h | 1 |
4 files changed, 14 insertions, 1 deletions
@@ -1,5 +1,7 @@ --------------------------------------------------------------------------- -Version 6.3.5 [DEVEL] (al), 2011-??-?? +Version 6.3.5 [DEVEL] (rgerhards/al), 2011-??-?? +- imudp&imtcp now report error if no listener at all was defined + Thanks to Marcin for suggesting this error message. - bugfix: potential misadressing in property replacer --------------------------------------------------------------------------- Version 6.3.4 [DEVEL] (rgerhards), 2011-08-02 diff --git a/plugins/imtcp/imtcp.c b/plugins/imtcp/imtcp.c index 4fd717d7..98f49051 100644 --- a/plugins/imtcp/imtcp.c +++ b/plugins/imtcp/imtcp.c @@ -332,6 +332,11 @@ CODESTARTcheckCnf for(inst = pModConf->root ; inst != NULL ; inst = inst->next) { std_checkRuleset(pModConf, inst); } + if(pModConf->root == NULL) { + errmsg.LogError(0, RS_RET_NO_LISTNERS , "imtcp: module loaded, but " + "no listeners defined - no input will be gathered"); + iRet = RS_RET_NO_LISTNERS; + } ENDcheckCnf diff --git a/plugins/imudp/imudp.c b/plugins/imudp/imudp.c index 161223fd..b5cae4df 100644 --- a/plugins/imudp/imudp.c +++ b/plugins/imudp/imudp.c @@ -655,6 +655,11 @@ CODESTARTcheckCnf for(inst = pModConf->root ; inst != NULL ; inst = inst->next) { std_checkRuleset(pModConf, inst); } + if(pModConf->root == NULL) { + errmsg.LogError(0, RS_RET_NO_LISTNERS , "imudp: module loaded, but " + "no listeners defined - no input will be gathered"); + iRet = RS_RET_NO_LISTNERS; + } ENDcheckCnf diff --git a/runtime/rsyslog.h b/runtime/rsyslog.h index c2dbc2b2..cc1044a1 100644 --- a/runtime/rsyslog.h +++ b/runtime/rsyslog.h @@ -365,6 +365,7 @@ enum rsRetVal_ /** return value. All methods return this if not specified oth RS_RET_MOD_UNKNOWN = -2209,/**< module (config name) is unknown */ RS_RET_CONFOBJ_UNSUPPORTED = -2210,/**< config objects (v6 conf) are not supported here */ RS_RET_MISSING_CNFPARAMS = -2211, /**< missing configuration parameters */ + RS_RET_NO_LISTNERS = -2212, /**< module loaded, but no listeners are defined */ /* RainerScript error messages (range 1000.. 1999) */ RS_RET_SYSVAR_NOT_FOUND = 1001, /**< system variable could not be found (maybe misspelled) */ |