summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
Diffstat (limited to 'tools')
-rw-r--r--tools/syslogd.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/tools/syslogd.c b/tools/syslogd.c
index 1840030b..01d3af71 100644
--- a/tools/syslogd.c
+++ b/tools/syslogd.c
@@ -2237,6 +2237,7 @@ init(void)
DEFiRet;
rsRetVal localRet;
int iNbrActions;
+ int bHadConfigErr = 0;
char cbuf[BUFSIZ];
char bufStartUpMsg[512];
struct sigaction sigAct;
@@ -2287,9 +2288,11 @@ init(void)
if(localRet != RS_RET_OK) {
errmsg.LogError(0, localRet, "CONFIG ERROR: could not interpret master config file '%s'.", ConfFile);
+ bHadConfigErr = 1;
} else if(iNbrActions == 0) {
errmsg.LogError(0, RS_RET_NO_ACTIONS, "CONFIG ERROR: there are no active actions configured. Inputs will "
"run, but no output whatsoever is created.");
+ bHadConfigErr = 1;
}
if(localRet != RS_RET_OK || iNbrActions == 0) {
@@ -2355,8 +2358,13 @@ init(void)
/* we are done checking the config - now validate if we should actually run or not.
* If not, terminate. -- rgerhards, 2008-07-25
*/
- if(iConfigVerify)
+ if(iConfigVerify) {
+ if(bHadConfigErr) {
+ /* a bit dirty, but useful... */
+ exit(1);
+ }
ABORT_FINALIZE(RS_RET_VALIDATION_RUN);
+ }
/* switch the message object to threaded operation, if necessary */
if(MainMsgQueType == QUEUETYPE_DIRECT || iMainMsgQueueNumWorkers > 1) {