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
This commit is contained in:
Rainer Gerhards 2023-07-25 12:26:30 +02:00
parent f7930469cc
commit 26e885ff96
No known key found for this signature in database
GPG Key ID: 0CB6B2A8BE80B499
5 changed files with 6 additions and 14 deletions

View File

@ -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" ;;

View File

@ -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

View File

@ -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:
*/

View File

@ -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)

View File

@ -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:
*/