This is a slightly questionable change.
Typical behavior of any module is that if it is loaded but doesn't actually do anything, a warning message is emitted to prevent mistakes in configuration. I think I have a use case for the imuxsock module to be loaded but inactive.

A generalized rationale goes like this: there might be additional conf files in /etc/rsyslog.d that just tune some parameters. If the module is enabled, they are desirable, but when it is disabled, they can be ignored.

The real scenario is this: systemd provides a separate conf file that specifies where to look for the log socket. If the imuxsock module is to be disabled, it can be done through the '$OmitLocalLogging' directive. At that point the module is needed to parse the conf file but it does not do any real work.

Given an explicit directive is needed, it can be assumed that this state is intended and no warning is necessary.
>From ac6c45537391d67beb55b03ccf301bdaa150cd8a Mon Sep 17 00:00:00 2001
From: Tomas Heinrich <[email protected]>
Date: Mon, 3 Jun 2013 15:09:07 +0200
Subject: [PATCH] imuxsock: don't report an error message for
 $OmitLocalLogging

---
 plugins/imuxsock/imuxsock.c |    4 ++++
 1 file changed, 4 insertions(+)

diff --git a/plugins/imuxsock/imuxsock.c b/plugins/imuxsock/imuxsock.c
index c503852..dad09ab 100644
--- a/plugins/imuxsock/imuxsock.c
+++ b/plugins/imuxsock/imuxsock.c
@@ -1284,6 +1284,8 @@ BEGINactivateCnfPrePrivDrop
 	instanceConf_t *inst;
 CODESTARTactivateCnfPrePrivDrop
 	runModConf = pModConf;
+	if(runModConf->bOmitLocalLogging && nfd == 1)
+		ABORT_FINALIZE(RS_RET_OK);
 	for(inst = runModConf->root ; inst != NULL ; inst = inst->next) {
 		addListner(inst);
 	}
@@ -1325,6 +1327,8 @@ BEGINrunInput
 #endif
 
 CODESTARTrunInput
+	if(runModConf->bOmitLocalLogging && nfd == 1)
+		ABORT_FINALIZE(RS_RET_OK);
 	/* this is an endless loop - it is terminated when the thread is
 	 * signalled to do so. This, however, is handled by the framework,
 	 * right into the sleep below.
-- 
1.7.10.4

_______________________________________________
rsyslog mailing list
http://lists.adiscon.net/mailman/listinfo/rsyslog
http://www.rsyslog.com/professional-services/
What's up with rsyslog? Follow https://twitter.com/rgerhards
NOTE WELL: This is a PUBLIC mailing list, posts are ARCHIVED by a myriad of 
sites beyond our control. PLEASE UNSUBSCRIBE and DO NOT POST if you DON'T LIKE 
THAT.

Reply via email to