From 4105f276f636d3d37cecf9b774c226147996ec3e Mon Sep 17 00:00:00 2001 From: Rainer Gerhards Date: Mon, 1 Aug 2005 10:24:23 +0000 Subject: -o option added (omit local log socket) --- NEWS | 4 ++++ syslogd.c | 15 ++++++++++++--- 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/NEWS b/NEWS index f252bc5c..ad606959 100644 --- a/NEWS +++ b/NEWS @@ -12,6 +12,10 @@ Version 0.9.5 (RGer), around 2005-07-28 - improved error reporting for template errors on startup. They are now shown on the console and the start-up tty. Formerly, they were only visible in debug mode. +- added new option "-o" --> omit local unix domain socket. This option + enables rsyslogd NOT to listen to the local socket. This is most + helpful when multiple instances of rsyslogd (or rsyslogd and another + syslogd) shall run on a single system. --------------------------------------------------------------------------- Version 0.9.4 (RGer), 2005-07-25 - finally added the TCP sender. It now supports non-blocking mode, no diff --git a/syslogd.c b/syslogd.c index dfadecf3..694222a6 100644 --- a/syslogd.c +++ b/syslogd.c @@ -258,6 +258,9 @@ static int restart = 0; #define MAXFUNIX 20 int nfunix = 1; +int startIndexUxLocalSockets = 0; /* process funix from that index on (used to + * suppress local logging. rgerhards 2005-08-01 + */ char *funixn[MAXFUNIX] = { _PATH_LOG }; int funix[MAXFUNIX] = { -1, }; @@ -2197,7 +2200,7 @@ int main(argc, argv) funix[i] = -1; } - while ((ch = getopt(argc, argv, "a:dhf:l:m:np:rs:t:v")) != EOF) + while ((ch = getopt(argc, argv, "a:dhf:l:m:nop:rs:t:v")) != EOF) switch((char)ch) { case 'a': if (nfunix < MAXFUNIX) @@ -2228,6 +2231,9 @@ int main(argc, argv) case 'n': /* don't fork */ NoFork = 1; break; + case 'o': /* omit local logging (/dev/log) */ + startIndexUxLocalSockets = 1; + break; case 'p': /* path to regular log socket */ funixn[0] = optarg; break; @@ -2403,7 +2409,7 @@ int main(argc, argv) if ( Debug ) { dprintf("Debugging disabled, SIGUSR1 to turn on debugging.\n"); - /* DEBUG-AID: comment out line below if you need that */ + /* DEBUG-AID/RELEASE: comment out line below if you need that */ debugging_on = 0; } /* @@ -2424,9 +2430,12 @@ int main(argc, argv) /* * Add the Unix Domain Sockets to the list of read * descriptors. + * rgerhards 2005-08-01: we must now check if there are + * any local sockets to listen to at all. If the -o option + * is given without -a, we do not need to listen at all.. */ /* Copy master connections */ - for (i = 0; i < nfunix; i++) { + for (i = startIndexUxLocalSockets; i < nfunix; i++) { if (funix[i] != -1) { FD_SET(funix[i], &readfds); if (funix[i]>maxfds) maxfds=funix[i]; -- cgit