diff options
author | Rainer Gerhards <rgerhards@adiscon.com> | 2009-05-28 19:01:34 +0200 |
---|---|---|
committer | Rainer Gerhards <rgerhards@adiscon.com> | 2009-05-28 19:01:34 +0200 |
commit | 29cacc3c8ad6694b1ae2a5480fca7059773d06f0 (patch) | |
tree | 1c4996d03a90ddb4ad6ea236ee8f72194a13b99e /tools/syslogd.c | |
parent | cbbf1586a204a897a050b6cb294b120e3ff5f23c (diff) | |
parent | d7c98e7a6ec28a6c76bccf16d83f36b34a705410 (diff) | |
download | rsyslog-29cacc3c8ad6694b1ae2a5480fca7059773d06f0.tar.gz rsyslog-29cacc3c8ad6694b1ae2a5480fca7059773d06f0.tar.bz2 rsyslog-29cacc3c8ad6694b1ae2a5480fca7059773d06f0.zip |
Merge branch 'master' into v5-devel
Conflicts:
tests/Makefile.am
Diffstat (limited to 'tools/syslogd.c')
-rw-r--r-- | tools/syslogd.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/tools/syslogd.c b/tools/syslogd.c index 31cc4a4d..db52effc 100644 --- a/tools/syslogd.c +++ b/tools/syslogd.c @@ -980,7 +980,7 @@ logmsgInternal(int iErr, int pri, uchar *msg, int flags) * permits us to process unmodified config files which otherwise contain a * supressor statement. */ - if(bErrMsgToStderr || iConfigVerify) { + if(((Debug || NoFork) && bErrMsgToStderr) || iConfigVerify) { fprintf(stderr, "rsyslogd: %s\n", msg); } @@ -2563,6 +2563,7 @@ init(void) DEFiRet; rsRetVal localRet; int iNbrActions; + int bHadConfigErr = 0; char cbuf[BUFSIZ]; char bufStartUpMsg[512]; struct sigaction sigAct; @@ -2613,9 +2614,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) { @@ -2685,8 +2688,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) { |