On Fri, 2020-02-21 at 08:47 +0100, Michael Olbrich wrote:
> On Thu, Feb 20, 2020 at 09:39:47AM +0100, Matthias Schiffer wrote:
> > Update and move out of staging. The new version adds compatiblity
> > with
> > OpenSSL 1.1.x and switches to Python 3.
> > 
> > The AMQP and MongoDB destinations are removed, they were never
> > buildable
> > without additional packages not available in plain PTXdist. Various
> > other modules are disabled explicitly to avoid the build
> > nondeterministically picking up undeclared dependencies.
> > 
> > A simple replacement for the old systemd unit is added, as the new
> > version
> > only provides an instanced unit which cannot be linked as
> > syslog.service
> > (which is necessary to use syslog-ng as the default system logger
> > by
> > enabling ForwardToSyslog in journald.conf).
> > 
> > Signed-off-by: Matthias Schiffer <matthias.schif...@ew.tq-group.com
> > >
> > ---
> >  projectroot/etc/syslog-ng.conf                |  6 ++-
> >  .../usr/lib/systemd/system/syslog-ng.service  | 20 +++++++++
> >  rules/syslogng.in                             | 30 ++++++-------
> >  rules/syslogng.make                           | 45
> > ++++++++++++++++---
> >  4 files changed, 76 insertions(+), 25 deletions(-)
> >  create mode 100644 projectroot/usr/lib/systemd/system/syslog-
> > ng.service
> > 
> > diff --git a/projectroot/etc/syslog-ng.conf
> > b/projectroot/etc/syslog-ng.conf
> > index 254aecfd2..0235b9857 100644
> > --- a/projectroot/etc/syslog-ng.conf
> > +++ b/projectroot/etc/syslog-ng.conf
> > @@ -1,13 +1,15 @@
> >  #
> > -# syslog-ng configuration 
> > +# syslog-ng configuration
> >  #
> >  
> > +@version: 3.25
> > +
> >  #
> >  # Options
> >  #
> >  
> >  # sync every 0 lines
> > -options { long_hostnames(off); sync(0); };
> > +options { chain_hostnames(off); flush_lines(0); };
> >  
> >  #
> >  # Sources
> > diff --git a/projectroot/usr/lib/systemd/system/syslog-ng.service
> > b/projectroot/usr/lib/systemd/system/syslog-ng.service
> > new file mode 100644
> > index 000000000..6bf591efd
> > --- /dev/null
> > +++ b/projectroot/usr/lib/systemd/system/syslog-ng.service
> > @@ -0,0 +1,20 @@
> > +[Unit]
> > +Description=System Logger Daemon
> > +Documentation=man:syslog-ng(8)
> > +Conflicts=emergency.service emergency.target
> > +Requires=syslog.socket
> > +Wants=network.target network-online.target
> > +After=network.target network-online.target
> > +
> > +[Service]
> > +Type=notify
> > +ExecStartPre=/bin/mkdir -p /var/lib/syslog-ng
> > +ExecStart=/usr/sbin/syslog-ng -F --enable-core --cfgfile
> > /etc/syslog-ng.conf --control /var/run/syslog-ng.ctl --persist-file 
> > /var/lib/syslog-ng/syslog-ng.persist --pidfile /var/run/syslog-
> > ng.pid
> > +ExecReload=/bin/kill -HUP $MAINPID
> > +StandardOutput=journal
> > +StandardError=journal
> > +Restart=on-failure
> > +
> > +[Install]
> > +Alias=syslog.service
> > +WantedBy=multi-user.target
> > diff --git a/rules/syslogng.in b/rules/syslogng.in
> > index 3b1af844b..7707c8c32 100644
> > --- a/rules/syslogng.in
> > +++ b/rules/syslogng.in
> > @@ -1,6 +1,4 @@
> > -## SECTION=staging
> > -## old section:
> > -### SECTION=networking
> > +## SECTION=networking
> >  # syslog-ng configuration
> >  
> >  menuconfig SYSLOGNG
> > @@ -9,7 +7,9 @@ menuconfig SYSLOGNG
> >     select EVENTLOG
> >     select GLIB
> >     select OPENSSL
> > -   select PYTHON           if SYSLOGNG_PYTHON_DESTINATION
> > +   select LIBCURL          if SYSLOGNG_HTTP
> > +   select JSON_C           if SYSLOGNG_JSON
> > +   select PYTHON3          if SYSLOGNG_PYTHON_DESTINATION
> >     select LIBC_NSL
> >     select LIBC_RT
> >     select LIBNET           if SYSLOGNG_SPOOF_SOURCE
> > @@ -19,10 +19,6 @@ menuconfig SYSLOGNG
> >     help
> >       The next generation syslog daemon.
> >  
> > -     STAGING: remove in ptxdist-2020.01.0
> > -     Fails to build with OpenSSL 1.1.x. Update to a new version is
> > -     needed.
> > -
> >  if SYSLOGNG
> >  
> >  config SYSLOGNG_TCP_WRAPPER
> > @@ -46,28 +42,30 @@ config SYSLOGNG_SPOOF_SOURCE
> >       destinations though the original message can be
> >       received by TCP as well.
> >  
> > -config SYSLOGNG_AMQP_DESTINATION
> > +config SYSLOGNG_HTTP
> >     bool
> > -   prompt "support the AMQP destination"
> > +   prompt "Enable HTTP support"
> >     help
> > -     Enables the ability to publish AMQP messages.
> > +     Enable support for the http() destination that is based
> > +     on libcurl.
> >  
> > -config SYSLOGNG_MONGODB_DESTINATION
> > +config SYSLOGNG_JSON
> >     bool
> > -   prompt "support the MongoDB destination"
> > +   prompt "Enable JSON support"
> >     help
> > -     Enables the ability to send messages to a MongoDB database.
> > +     JSON support is required for json-parser, and the format-cim
> > +     and format-json template functions.
> >  
> >  config SYSLOGNG_PYTHON_DESTINATION
> >     bool
> > -   prompt "support the python destination"
> > +   prompt "Support the python destination"
> >     help
> >       Enables the ability to use inline python in the
> >       syslog-ng configuration file.
> >  
> >  config SYSLOGNG_STOMP_DESTINATION
> >     bool
> > -   prompt "support the STOMP destination"
> > +   prompt "Support the STOMP destination"
> >     help
> >       Enables the ability to send STOMP messages to message
> > brokers.
> >  
> > diff --git a/rules/syslogng.make b/rules/syslogng.make
> > index 114f72cef..6175a9e31 100644
> > --- a/rules/syslogng.make
> > +++ b/rules/syslogng.make
> > @@ -16,9 +16,9 @@ PACKAGES-$(PTXCONF_SYSLOGNG) += syslogng
> >  #
> >  # Paths and names
> >  #
> > -SYSLOGNG_VERSION   := 3.7.3
> > -SYSLOG_LIBVERSION  := 3.7
> > -SYSLOGNG_MD5               := 803d61a713d6d41a973942d417fec999
> > +SYSLOGNG_VERSION   := 3.25.1
> > +SYSLOG_LIBVERSION  := 3.25
> > +SYSLOGNG_MD5               := 07c2ebb712ddacd201b24b265b857b0d
> >  SYSLOGNG           := syslog-ng-$(SYSLOGNG_VERSION)
> >  SYSLOGNG_SUFFIX            := tar.gz
> >  SYSLOGNG_URL               := 
> > https://github.com/balabit/syslog-ng/releases/download/syslog-ng-$(SYSLOGNG_VERSION)/$(SYSLOGNG).$(SYSLOGNG_SUFFIX
> > )
> > @@ -32,7 +32,7 @@ SYSLOGNG_LICENSE  := GPL-2.0-or-later AND LGPL-
> > 2.1-only
> >  
> >  SYSLOGNG_ENV       = \
> >     $(CROSS_ENV) \
> > -   ac_cv_path_PYTHON=$(CROSS_PYTHON)
> > +   ac_cv_path_PYTHON=$(CROSS_PYTHON3)
> >  
> >  #
> >  # autoconf
> > @@ -41,10 +41,21 @@ SYSLOGNG_AUTOCONF = \
> >     $(CROSS_AUTOCONF_USR) \
> >     $(GLOBAL_IPV6_OPTION) \
> >     --enable-dynamic-linking \
> > +   --disable-amqp \
> >     --disable-debug \
> > +   --disable-geoip2 \
> > +   --disable-java \
> > +   --disable-java-modules \
> > +   --disable-kafka \
> > +   --disable-mongodb \
> > +   --disable-redis \
> > +   --disable-riemann \
> > +   --disable-smtp \
> > +   --disable-snmp-dest \
> > +   --disable-sql \
> >     --disable-sun-streams \
> > -   --$(call ptx/endis, PTXCONF_SYSLOGNG_AMQP_DESTINATION)-amqp \
> > -   --$(call ptx/endis, PTXCONF_SYSLOGNG_MONGODB_DESTINATION)-
> > mongodb \
> > +   --$(call ptx/endis, PTXCONF_SYSLOGNG_HTTP)-http \
> > +   --$(call ptx/endis, PTXCONF_SYSLOGNG_JSON)-json \
> >     --$(call ptx/endis, PTXCONF_SYSLOGNG_PYTHON_DESTINATION)-python 
> > \
> >     --$(call ptx/endis, PTXCONF_SYSLOGNG_SYSTEMD)-systemd \
> >     --$(call ptx/endis, PTXCONF_SYSLOGNG_SPOOF_SOURCE)-spoof-source 
> > \
> > @@ -53,8 +64,26 @@ SYSLOGNG_AUTOCONF = \
> >     --with-systemd-journal=$(call ptx/ifdef,
> > PTXCONF_SYSLOGNG_SYSTEMD,system,no) \
> >     --with-systemdsystemunitdir=/usr/lib/systemd/system \
> >     --localstatedir=/var/run \
> > +   --with-ivykis=internal \
> > +   --with-jsonc=$(if $(PTXCONF_SYSLOGNG_JSON),system,no) \
> >     --with-libnet=$(SYSROOT)/usr/bin \
> > -   --with-python=$(PYTHON_MAJORMINOR)
> > +   --with-python=$(PYTHON3_MAJORMINOR)
> 
> As I noted in my last review, please use configure_helper.py to check
> and
> improve the options.
> - GLOBAL_LARGE_FILE_OPTION should be used
> - the sorting should be corrected
> - there are several enable/disable and with/without options that are
>   missing and may pick up dependencies automatically.

Ah, I didn't know about GLOBAL_LARGE_FILE_OPTION, and mostly used
configure_helper.py to compare the old and the new syslogng version.

Should I list *all* options that configure supports, even when the
defaults are fine? I thought I had caught everything that has an actual
effect. I guess disabling libcurl etc. could be made explicit as well,
but these deps are only used when the corresponding modules are
enabled.

I also found the option --disable-all-modules, which overrides the
defaults for various other options to "no" - which would allow us to
make the SYSLOGNG_AUTOCONF section shorter, but the diff shown by
configure_helper.py larger. Which way should I go here?

Matthias


> 
> Ignore the --with-python output: configure_helper.py currently cannot
> handle two options with the same name --enable-python and --with-
> python in
> this case. The two options are merged so the output for this is
> wrong.
> 
> > +
> > +# ----------------------------------------------------------------
> > ------------
> > +# Install
> > +# ----------------------------------------------------------------
> > ------------
> > +
> > +$(STATEDIR)/syslogng.install:
> > +   @$(call targetinfo)
> > +
> > +   @$(call world/install, SYSLOGNG)
> > +
> > +   @rm "$(SYSLOGNG_PKGDIR)/usr/bin/loggen"
> > +   @rm -r "$(SYSLOGNG_PKGDIR)/usr/lib/libloggen_"*
> > +   @rm -r "$(SYSLOGNG_PKGDIR)/usr/lib/syslog-ng/loggen"
> 
> Why are these removed? This deserves a comment above.
> 
> Michael
> 
> > +   @$(call touch)
> > +
> >  
> >  # ----------------------------------------------------------------
> > ------------
> >  # Target-Install
> > @@ -73,6 +102,8 @@ $(STATEDIR)/syslogng.targetinstall:
> >     @$(call install_copy, syslogng, 0, 0, 0755, -, \
> >             /usr/sbin/syslog-ng)
> >     @$(call install_lib, syslogng, 0, 0, 0644, libsyslog-ng-
> > $(SYSLOG_LIBVERSION))
> > +   @$(call install_lib, syslogng, 0, 0, 0644, libevtlog-
> > $(SYSLOG_LIBVERSION))
> > +   @$(call install_lib, syslogng, 0, 0, 0644, libsecret-storage)
> >     @$(call install_glob, syslogng, 0, 0, -, /usr/lib/syslog-ng,
> > *.so)
> >  
> >  #  # config
> > -- 
> > 2.17.1
> > 
> > 
> > _______________________________________________
> > ptxdist mailing list
> > ptxdist@pengutronix.de
> > 
> 
> 


_______________________________________________
ptxdist mailing list
ptxdist@pengutronix.de

Reply via email to