Bug 1410630 - rsyslogd -N doesn't set return status to non-zero value
Summary: rsyslogd -N doesn't set return status to non-zero value
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: rsyslog
Version: 7.2
Hardware: x86_64
OS: Linux
Target Milestone: rc
: ---
Assignee: Jiří Vymazal
QA Contact: Stefan Dordevic
Depends On: rsyslog-rhel74-rebase
TreeView+ depends on / blocked
Reported: 2017-01-05 23:26 UTC by SHAURYA
Modified: 2020-09-10 10:09 UTC (History)
5 users (show)

Fixed In Version: rsyslog-8.24.0-6.el7
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Last Closed: 2017-08-01 09:56:22 UTC
Target Upstream Version:

Attachments (Terms of Use)

System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2017:2306 0 normal SHIPPED_LIVE rsyslog bug fix and enhancement update 2017-08-01 12:41:59 UTC

Description SHAURYA 2017-01-05 23:26:59 UTC
Description of problem:

I'm using the form rsyslogd -N to verify a config file.  However I see that it doesn't set the return status to some non-zero value if an error is found in said file  (to be sure, the manpage doesn't advertise such a thing anyway, so it's not a bug).  It makes taking automatic action a bit problematic.

Version-Release number of selected component (if applicable):

KEDDESADM01:/usr/local/sbin/des_checkout # rsyslogd -v
rsyslogd 7.4.7, compiled with:
     FEATURE_REGEXP:      Yes
     GSSAPI Kerberos 5 support:      Yes
     FEATURE_DEBUG (debug build, slow code):    No
     32bit Atomic operations supported: Yes
     64bit Atomic operations supported: Yes
     Runtime Instrumentation (slow code):   No
     uuid support:        Yes

How reproducible:


Steps to Reproduce:

Starting with the out-of-the-box /etc/rsyslog.conf, I have installed a customized config. in /etc/rsyslog.d/DCS.conf:

:msg, eregex, "^(Starting|Stopping) user-[0-9]+\.slice"           stop

Clearly the designator "eregex" is erroneous and is indeed detected via -N, yet $? is not set non-zero as perhaps it should be:

KEDDESADM01:/usr/local/src/functions/utils # rsyslogd -N 1
rsyslogd: version 7.4.7, config validation run (level 1), master config /etc/rsyslog.conf
rsyslogd: error: invalid compare operation 'eregex' - ignoring selector
rsyslogd: End of config validation run. Bye.
KEDDESADM01:/usr/local/src/functions/utils # echo $?

Actual results:

Set as 0

Expected results:

Should be set as non-zero

Additional info:


Comment 2 Radovan Sroka 2017-01-09 12:17:28 UTC
Does your config file contain such option like "$AbortOnUncleanConfig on" ?

Comment 11 errata-xmlrpc 2017-08-01 09:56:22 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.


Note You need to log in before you can comment on or make changes to this bug.