From 26e885ff96f3653718755aa87b407693f781cbf0 Mon Sep 17 00:00:00 2001 From: Rainer Gerhards Date: Tue, 25 Jul 2023 12:26:30 +0200 Subject: [PATCH] build system: make rsyslogd execute when --disable-inet is configured This option is mostly useless, as network functionality depends on the modules loaded by the config. The only real, and important, effect it has is to control auto-load of omfwd - a feature almost all installations depend in (backward compatibility). This has been clarified in ./configure -help Also, when --disable-inet is given, rsyslog now executes successfully. The reason for the abort was that previously building of the lmnet component was prevented, but that component is also needed by rsyslog startup itself to query its own (correct) hostname. Note that --disable-inet still does not compile some networking libraries. So do not use it if you intend to load standard networking modules like omfwd, imtcp or imudp. closes https://github.com/rsyslog/rsyslog/issues/5188 --- configure.ac | 2 +- parse.c | 2 -- parse.h | 4 ---- runtime/Makefile.am | 7 ++++--- runtime/conf.c | 5 +---- 5 files changed, 6 insertions(+), 14 deletions(-) diff --git a/configure.ac b/configure.ac index d5411a1e8..38fb57089 100644 --- a/configure.ac +++ b/configure.ac @@ -677,7 +677,7 @@ fi # inet AC_ARG_ENABLE(inet, - [AS_HELP_STRING([--enable-inet],[Enable networking support @<:@default=yes@:>@])], + [AS_HELP_STRING([--enable-inet],[Enable automatic load of omfwd and limit build of networking libraries @<:@default=yes@:>@])], [case "${enableval}" in yes) enable_inet="yes" ;; no) enable_inet="no" ;; diff --git a/parse.c b/parse.c index 28cc525be..520c7c467 100644 --- a/parse.c +++ b/parse.c @@ -373,7 +373,6 @@ finalize_it: * full hostname (e.g.: localhost.localdomain) or hostname wildcard * (e.g.: *.localdomain). */ -#ifdef SYSLOG_INET rsRetVal parsAddrWithBits(rsParsObj *pThis, struct NetAddr **pIP, int *pBits) { register uchar *pC; @@ -509,7 +508,6 @@ finalize_it: free(pszIP); RETiRet; } -#endif /* #ifdef SYSLOG_INET */ /* tell if the parsepointer is at the end of the diff --git a/parse.h b/parse.h index 653e2283a..b8c8422a4 100644 --- a/parse.h +++ b/parse.h @@ -100,10 +100,6 @@ rsRetVal rsParsDestruct(rsParsObj *pThis); int parsIsAtEndOfParseString(rsParsObj *pThis); int parsGetCurrentPosition(rsParsObj *pThis); char parsPeekAtCharAtParsPtr(rsParsObj *pThis); -#ifdef SYSLOG_INET rsRetVal parsAddrWithBits(rsParsObj *pThis, netAddr_t **pIP, int *pBits); -#endif #endif -/* vim:set ai: - */ diff --git a/runtime/Makefile.am b/runtime/Makefile.am index b752a8c0c..8a25f21a7 100644 --- a/runtime/Makefile.am +++ b/runtime/Makefile.am @@ -160,16 +160,17 @@ lmzlibw_la_LDFLAGS += $(LIBLOGGING_STDLOG_LIBS) endif -if ENABLE_INET -pkglib_LTLIBRARIES += lmnet.la lmnetstrms.la # -# network support +# basic network support, needed for rsyslog startup (e.g. our own system name) # +pkglib_LTLIBRARIES += lmnet.la lmnet_la_SOURCES = net.c net.h lmnet_la_CPPFLAGS = $(PTHREADS_CFLAGS) $(RSRT_CFLAGS) lmnet_la_LDFLAGS = -module -avoid-version ../compat/compat_la-getifaddrs.lo lmnet_la_LIBADD = +if ENABLE_INET +pkglib_LTLIBRARIES += lmnetstrms.la if ENABLE_LIBLOGGING_STDLOG lmnet_la_CPPFLAGS += $(LIBLOGGING_STDLOG_CFLAGS) lmnet_la_LDFLAGS += $(LIBLOGGING_STDLOG_LIBS) diff --git a/runtime/conf.c b/runtime/conf.c index 3e56301ef..5eee37e8a 100644 --- a/runtime/conf.c +++ b/runtime/conf.c @@ -629,7 +629,7 @@ ENDObjClassExit(conf) BEGINAbstractObjClassInit(conf, 1, OBJ_IS_CORE_MODULE) /* class, version - CHANGE class also in END MACRO! */ /* request objects we use */ CHKiRet(objUse(module, CORE_COMPONENT)); - CHKiRet(objUse(net, LM_NET_FILENAME)); /* TODO: make this dependcy go away! */ + CHKiRet(objUse(net, LM_NET_FILENAME)); CHKiRet(objUse(ruleset, CORE_COMPONENT)); /* These commands will NOT be supported -- the new v6.3 config system provides @@ -638,6 +638,3 @@ BEGINAbstractObjClassInit(conf, 1, OBJ_IS_CORE_MODULE) /* class, version - CHANG CHKiRet(regCfSysLineHdlr((uchar *)"resetconfigvariables", 1, eCmdHdlrCustomHandler, resetConfigVariables, NULL, NULL)); ENDObjClassInit(conf) - -/* vi:set ai: - */