Skip to contentSkip to conversation

package/syslog-ng: bump version to 3.22.1

PATCH New Chris Packham 4 participants 9 messages Aug 15, 2019 – Sep 16, 2019

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 package/syslog-ng: bump version to 3.22.1

Import new version an drop two patches that have been applied upstream.

---
 .../0002-build-make-dlsym-optional.patch      | 160 ------------------
 ...thread-atfork-also-in-libc-nonshared.patch |  49 ------
 package/syslog-ng/syslog-ng.hash              |   2 +-
 package/syslog-ng/syslog-ng.mk                |   2 +-
 4 files changed, 2 insertions(+), 211 deletions(-)
 delete mode 100644 package/syslog-ng/0002-build-make-dlsym-optional.patch
 delete mode 100644 package/syslog-ng/0003-look-for-pthread-atfork-also-in-libc-nonshared.patch
package/syslog-ng/0002-build-make-dlsym-optional.patch deleted +0 -160
deleted file mode 100644
index bb29e1ed7c..0000000000
@@ -1,160 +0,0 @@
-From d85121c0dc700cad4bd9735b0ee1dab9addf9dd7 Mon Sep 17 00:00:00 2001
-From: Kokan <[email protected]>
-Date: Thu, 17 Jan 2019 18:44:41 +0100
-Subject: [PATCH] build: make dlsym optional
-
-In case of static uClibc-ng lib, the <dlfcn.h> does not exists.
-
-The signal-handler.c solves an issue in case of program src/dst
-and Java destination. That combination is really rare if not impossible.
-
-This patch simply disables own sigaction if <dlfcn.h> is not present.
-
-Signed-off-by: Kokan <[email protected]>
-
-Downloaded from upstream commit
-https://github.com/balabit/syslog-ng/commit/d85121c0dc700cad4bd9735b0ee1dab9addf9dd7
-
-Signed-off-by: Chris Packham <[email protected]>
----
- CMakeLists.txt        |  1 +
- configure.ac          |  1 +
- lib/CMakeLists.txt    |  1 -
- lib/Makefile.am       |  1 -
- lib/signal-handler.c  |  8 ++++----
- lib/signal-handler.h  | 31 -------------------------------
- syslog-ng-config.h.in |  1 +
- 7 files changed, 7 insertions(+), 37 deletions(-)
- delete mode 100644 lib/signal-handler.h
-
-diff --git a/CMakeLists.txt b/CMakeLists.txt
-index c847a547b..dee691388 100644
---- a/CMakeLists.txt
-+++ b/CMakeLists.txt
-@@ -106,6 +106,7 @@ check_symbol_exists("getrandom" "sys/random.h" SYSLOG_NG_HAVE_GETRANDOM)
- 
- check_include_files(utmp.h SYSLOG_NG_HAVE_UTMP_H)
- check_include_files(utmpx.h SYSLOG_NG_HAVE_UTMPX_H)
-+check_include_files(dlfcn.h SYSLOG_NG_HAVE_DLFCN_H)
- 
- check_struct_has_member("struct utmpx" "ut_type" "utmpx.h" UTMPX_HAS_UT_TYPE LANGUAGE C)
- check_struct_has_member("struct utmp" "ut_type" "utmp.h" UTMP_HAS_UT_TYPE LANGUAGE C)
-diff --git a/configure.ac b/configure.ac
-index 6bdd8d252..6ef0ad2b4 100644
---- a/configure.ac
-+++ b/configure.ac
-@@ -627,6 +627,7 @@ dnl ***************************************************************************
- 
- AC_HEADER_STDC
- AC_CHECK_HEADER(dmalloc.h)
-+AC_CHECK_HEADER(dlfcn.h)
- AC_CHECK_HEADERS(strings.h	\
- 	getopt.h		\
- 	stropts.h		\
-diff --git a/lib/CMakeLists.txt b/lib/CMakeLists.txt
-index be2da32a4..5268712e9 100644
---- a/lib/CMakeLists.txt
-+++ b/lib/CMakeLists.txt
-@@ -91,7 +91,6 @@ set (LIB_HEADERS
-     logthrdestdrv.h
-     logwriter.h
-     mainloop.h
--    signal-handler.h
-     mainloop-call.h
-     mainloop-worker.h
-     mainloop-io-worker.h
-diff --git a/lib/Makefile.am b/lib/Makefile.am
-index ec1928795..5f9e93d79 100644
---- a/lib/Makefile.am
-+++ b/lib/Makefile.am
-@@ -129,7 +129,6 @@ pkginclude_HEADERS			+= \
- 	lib/logthrdestdrv.h		\
- 	lib/logwriter.h			\
- 	lib/mainloop.h			\
--	lib/signal-handler.h		\
- 	lib/mainloop-call.h		\
- 	lib/mainloop-worker.h		\
- 	lib/mainloop-io-worker.h	\
-diff --git a/lib/signal-handler.c b/lib/signal-handler.c
-index 5657ba182..8f52f675b 100644
---- a/lib/signal-handler.c
-+++ b/lib/signal-handler.c
-@@ -21,14 +21,15 @@
-  * COPYING for details.
-  *
-  */
--#include "signal-handler.h"
- 
- #include "syslog-ng.h"
- #include "children.h"
- 
--#ifndef _WIN32
-+#include <signal.h>
-+
-+#if SYSLOG_NG_HAVE_DLFCN_H
-+
- #include <dlfcn.h>
--#endif
- 
- static const struct sigaction *sgchld_handler;
- 
-@@ -41,7 +42,6 @@ trigger_sigchld_handler_chain(int signum)
-     }
- }
- 
--#ifndef _WIN32
- static int
- call_original_sigaction(int signum, const struct sigaction *act, struct sigaction *oldact)
- {
-diff --git a/lib/signal-handler.h b/lib/signal-handler.h
-deleted file mode 100644
-index 36e5ac293..000000000
---- a/lib/signal-handler.h
-+++ /dev/null
-@@ -1,31 +0,0 @@
--/*
-- * Copyright (c) 2018 Balabit
-- * Copyright (c) 2018 Kokan
-- *
-- * This library is free software; you can redistribute it and/or
-- * modify it under the terms of the GNU Lesser General Public
-- * License as published by the Free Software Foundation; either
-- * version 2.1 of the License, or (at your option) any later version.
-- *
-- * This library is distributed in the hope that it will be useful,
-- * but WITHOUT ANY WARRANTY; without even the implied warranty of
-- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-- * Lesser General Public License for more details.
-- *
-- * You should have received a copy of the GNU Lesser General Public
-- * License along with this library; if not, write to the Free Software
-- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
-- *
-- * As an additional exemption you are allowed to compile & link against the
-- * OpenSSL libraries as published by the OpenSSL project. See the file
-- * COPYING for details.
-- *
-- */
--#ifndef SIGNAL_HANDLER_H_INCLUDED
--#define SIGNAL_HANDLER_H_INCLUDED
--
--#include <signal.h>
--
--void trigger_sigchld_handler_chain(int);
--
--#endif
-diff --git a/syslog-ng-config.h.in b/syslog-ng-config.h.in
-index 9e372f103..d8208eedd 100644
---- a/syslog-ng-config.h.in
-+++ b/syslog-ng-config.h.in
-@@ -38,6 +38,7 @@
- #cmakedefine SYSLOG_NG_PATH_XSDDIR "@SYSLOG_NG_PATH_XSDDIR@"
- #cmakedefine SYSLOG_NG_HAVE_GETUTENT @SYSLOG_NG_HAVE_GETUTENT@
- #cmakedefine SYSLOG_NG_HAVE_GETUTXENT @SYSLOG_NG_HAVE_GETUTXENT@
-+#cmakedefine SYSLOG_NG_HAVE_DLFCN_H @SYSLOG_NG_HAVE_DLFCN_H@
- #cmakedefine SYSLOG_NG_HAVE_UTMPX_H @SYSLOG_NG_HAVE_UTMPX_H@
- #cmakedefine SYSLOG_NG_HAVE_UTMP_H @SYSLOG_NG_HAVE_UTMP_H@
- #cmakedefine SYSLOG_NG_HAVE_MODERN_UTMP @SYSLOG_NG_HAVE_MODERN_UTMP@
--- 
-2.20.1
-
package/syslog-ng/0003-look-for-pthread-atfork-also-in-libc-nonshared.patch deleted +0 -49

49 lines not on this page · raw message

package/syslog-ng/syslog-ng.hash +1 -1
index 1f83e39ff0..1a71224d91 100644
@@ -1,5 +1,5 @@
 # Locally computed
-sha256 5cf931a9d7bead0e6d9a2c65eee8f6005a005878f59aa280f3c4294257ed5178  syslog-ng-3.19.1.tar.gz
+sha256 0656443776fa554320cb81bbebeac72bdf871298dd2ebef7413c393aec4d74c8  syslog-ng-3.22.1.tar.gz
 sha256 835219c8ca76156e6337236d1bcb8e617c0b1c2783b4a8bc478e18a86743d607  COPYING
 sha256 ce3324c9f22299cfc7c281e5a6ab40fbe9c2ea1a67cee87226cb8cd39db1e1d2  GPL.txt
 sha256 dc626520dcd53a22f727af3ee42c770e56c97a64fe3adb063799d8ab032fe551  LGPL.txt
package/syslog-ng/syslog-ng.mk +1 -1
index 4ac25a675b..05ccd751e4 100644
@@ -6,7 +6,7 @@
 
 # When updating the version, please check at runtime if the version in
 # syslog-ng.conf header needs to be updated
-SYSLOG_NG_VERSION = 3.19.1
+SYSLOG_NG_VERSION = 3.22.1
 SYSLOG_NG_SITE = https://github.com/balabit/syslog-ng/releases/download/syslog-ng-$(SYSLOG_NG_VERSION)
 SYSLOG_NG_LICENSE = LGPL-2.1+ (syslog-ng core), GPL-2.0+ (modules)
 SYSLOG_NG_LICENSE_FILES = COPYING GPL.txt LGPL.txt
Signature · 1 line
2.22.1
#1 lore raw

PATCH 1/1 package/syslog-ng: bump version to 3.22.1

Quoted 11 lines · On Thu, 15 Aug 2019 20:50:55 +1200 Chris Packham <[email protected]>…

Import new version an drop two patches that have been applied upstream.

---
 .../0002-build-make-dlsym-optional.patch      | 160 ------------------
 ...thread-atfork-also-in-libc-nonshared.patch |  49 ------
 package/syslog-ng/syslog-ng.hash              |   2 +-
 package/syslog-ng/syslog-ng.mk                |   2 +-
 4 files changed, 2 insertions(+), 211 deletions(-)
 delete mode 100644 package/syslog-ng/0002-build-make-dlsym-optional.patch
 delete mode 100644 package/syslog-ng/0003-look-for-pthread-atfork-also-in-libc-nonshared.patch

Applied to next, thanks.

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
#2 lore raw

PATCH 1/1 package/syslog-ng: bump version to 3.22.1

In reply to Chris Packham

Hello,

+ Thomas P
+ Carlos, because of the init script

This bump made the syslog-ng runtime test to start to fail, see the run before
[1] and after [2] this patch.

[1] https://gitlab.com/RicardoMartincoski/buildroot/-/jobs/290060873
[2] https://gitlab.com/RicardoMartincoski/buildroot/-/jobs/290060905

It fails for 2 reasons, see below. Can you investigate/fix them?

On Thu, Aug 15, 2019 at 05:50 AM, Chris Packham wrote:

[snip]

package/syslog-ng/syslog-ng.mk line 9

Quoted 7 lines

+++ b/package/syslog-ng/syslog-ng.mk

package/syslog-ng/syslog-ng.mk +1 -1
@@ -6,7 +6,7 @@
 
 # When updating the version, please check at runtime if the version in
 # syslog-ng.conf header needs to be updated
-SYSLOG_NG_VERSION = 3.19.1
+SYSLOG_NG_VERSION = 3.22.1

REASON 1. You forgot to update the version number in syslog-ng.conf This makes syslog-ng to generate a warning message every time the target is started (I wrapped the message below):
WARNING: log-fifo-size() works differently starting with syslog-ng 3.22 to avoid dropping flow-controlled messages when log-fifo-size() is misconfigured. From now on, log-fifo-size() only affects messages that are not flow-controlled. (Flow-controlled log paths have the flags(flow-control) option set.) To enable the new behaviour, update the @version string in your configuration and consider lowering the value of log-fifo-size().;
At first look it seems harmless to the minimal config we use by default and all that needs to be done is to update the version in the .conf file.

REASON 2. It seems there is either a bug in upstream or the upstream changed behavior and we need to add a dependency or change our default init script. I saw in another thread you mentioned there is a new upstream version and you are already planning to send another bump. Maybe the new bump fix this second issue. Anyway I will describe below the tests I did.
I downloaded the artifacts from the gitlab-ci run and started the image using the qemu command displayed in the first line of the -run.log file.

The daemon seems to not reload correctly:
3.19.1:

|# syslog-ng-ctl reload
|OK Config reload initiated
|# 
3.22.1:
|# syslog-ng-ctl reload
|EOF occurred while reading control socket
|# 

The daemon never stops:
3.19.1:

|# ps aux | grep syslog
|   44 root     {syslog-ng} supervising syslog-ng
|   45 root     /usr/sbin/syslog-ng
|   72 root     grep syslog
|# /etc/init.d/S01syslog-ng stop
|Stopping syslog-ng: OK
|# ps aux | grep syslog
|   77 root     grep syslog
|#
3.22.1:
|# ps aux | grep syslog
|   44 root     {syslog-ng} supervising syslog-ng
|   70 root     /usr/sbin/syslog-ng
|   75 root     grep syslog
|# /etc/init.d/S01syslog-ng stop
|Stopping syslog-ng: OK
|# ps aux | grep syslog
|   44 root     {syslog-ng} supervising syslog-ng
|   79 root     /usr/sbin/syslog-ng
|   83 root     grep syslog
|# 
So I tried to change the command used by the init script, 'KILL' works:
3.22.1:
|# ps aux | grep syslog
|   44 root     {syslog-ng} supervising syslog-ng
|   98 root     /usr/sbin/syslog-ng
|  124 root     grep syslog
|# start-stop-daemon -K -p /var/run/syslog-ng.pid
|stopped process in pidfile '/var/run/syslog-ng.pid' (pid 98)
|# ps aux | grep syslog
|   44 root     {syslog-ng} supervising syslog-ng
|  127 root     /usr/sbin/syslog-ng
|  131 root     grep syslog
|# start-stop-daemon -K -s KILL -p /var/run/syslog-ng.pid
|stopped process in pidfile '/var/run/syslog-ng.pid' (pid 127)
|# ps aux | grep syslog
|  134 root     grep syslog
|# 

When the daemon receives a message it seems to fail and another PID is created:
3.22.1:

|# ps aux | grep syslog
|   44 root     {syslog-ng} supervising syslog-ng
|   74 root     /usr/sbin/syslog-ng
|   78 root     grep syslog
|# logger my-message
|# ps aux | grep syslog
|   44 root     {syslog-ng} supervising syslog-ng
|   82 root     /usr/sbin/syslog-ng
|   84 root     grep syslog
|# grep my-message /var/log/messages
|#

If I keep trying sending messages using logger, some are received, some are not.

Regards,
Ricardo

#3 lore raw

PATCH 1/1 package/syslog-ng: bump version to 3.22.1

Quoted 110 lines · Ricardo Martincoski

Hello,

+ Thomas P
+ Carlos, because of the init script

This bump made the syslog-ng runtime test to start to fail, see the run before
[1] and after [2] this patch.

[1] https://gitlab.com/RicardoMartincoski/buildroot/-/jobs/290060873
[2] https://gitlab.com/RicardoMartincoski/buildroot/-/jobs/290060905

It fails for 2 reasons, see below. Can you investigate/fix them?

On Thu, Aug 15, 2019 at 05:50 AM, Chris Packham wrote:

[snip]

package/syslog-ng/syslog-ng.mk line 9

Quoted 7 lines

+++ b/package/syslog-ng/syslog-ng.mk

package/syslog-ng/syslog-ng.mk +1 -1
@@ -6,7 +6,7 @@
 
 # When updating the version, please check at runtime if the version in
 # syslog-ng.conf header needs to be updated
-SYSLOG_NG_VERSION = 3.19.1
+SYSLOG_NG_VERSION = 3.22.1

REASON 1. You forgot to update the version number in syslog-ng.conf This makes syslog-ng to generate a warning message every time the target is started (I wrapped the message below):
WARNING: log-fifo-size() works differently starting with syslog-ng 3.22 to avoid dropping flow-controlled messages when log-fifo-size() is misconfigured. From now on, log-fifo-size() only affects messages that are not flow-controlled. (Flow-controlled log paths have the flags(flow-control) option set.) To enable the new behaviour, update the @version string in your configuration and consider lowering the value of log-fifo-size().;
At first look it seems harmless to the minimal config we use by default and all that needs to be done is to update the version in the .conf file.

REASON 2. It seems there is either a bug in upstream or the upstream changed behavior and we need to add a dependency or change our default init script. I saw in another thread you mentioned there is a new upstream version and you are already planning to send another bump. Maybe the new bump fix this second issue. Anyway I will describe below the tests I did.
I downloaded the artifacts from the gitlab-ci run and started the image using the qemu command displayed in the first line of the -run.log file.

The daemon seems to not reload correctly:
3.19.1:

|# syslog-ng-ctl reload
|OK Config reload initiated
|#
3.22.1:
|# syslog-ng-ctl reload
|EOF occurred while reading control socket
|#

The daemon never stops:
3.19.1:

|# ps aux | grep syslog
|   44 root     {syslog-ng} supervising syslog-ng
|   45 root     /usr/sbin/syslog-ng
|   72 root     grep syslog
|# /etc/init.d/S01syslog-ng stop
|Stopping syslog-ng: OK
|# ps aux | grep syslog
|   77 root     grep syslog
|#
3.22.1:
|# ps aux | grep syslog
|   44 root     {syslog-ng} supervising syslog-ng
|   70 root     /usr/sbin/syslog-ng
|   75 root     grep syslog
|# /etc/init.d/S01syslog-ng stop
|Stopping syslog-ng: OK
|# ps aux | grep syslog
|   44 root     {syslog-ng} supervising syslog-ng
|   79 root     /usr/sbin/syslog-ng
|   83 root     grep syslog
|#
So I tried to change the command used by the init script, 'KILL' works:
3.22.1:
|# ps aux | grep syslog
|   44 root     {syslog-ng} supervising syslog-ng
|   98 root     /usr/sbin/syslog-ng
|  124 root     grep syslog
|# start-stop-daemon -K -p /var/run/syslog-ng.pid
|stopped process in pidfile '/var/run/syslog-ng.pid' (pid 98)
|# ps aux | grep syslog
|   44 root     {syslog-ng} supervising syslog-ng
|  127 root     /usr/sbin/syslog-ng
|  131 root     grep syslog
|# start-stop-daemon -K -s KILL -p /var/run/syslog-ng.pid
|stopped process in pidfile '/var/run/syslog-ng.pid' (pid 127)
|# ps aux | grep syslog
|  134 root     grep syslog
|#

When the daemon receives a message it seems to fail and another PID is created:
3.22.1:

|# ps aux | grep syslog
|   44 root     {syslog-ng} supervising syslog-ng
|   74 root     /usr/sbin/syslog-ng
|   78 root     grep syslog
|# logger my-message
|# ps aux | grep syslog
|   44 root     {syslog-ng} supervising syslog-ng
|   82 root     /usr/sbin/syslog-ng
|   84 root     grep syslog
|# grep my-message /var/log/messages
|#
Quoted 4 lines

If I keep trying sending messages using logger, some are received, some are not.

Regards,
Ricardo

Hi Ricardo,

I ran a test on a QEMU build with udev and noticed that syslog-g hangs on start-up. Using strace I found that it blocks on a getrandom() call, which seems to be make sense since the start-up order is

    /etc/init.d/S01syslog-ng
    /etc/init.d/S10udev
    /etc/init.d/S20urandom

So when syslog-ng starts the random number generator is not working properly because virtio-rng is not loaded yet.

It does not hang if I revert the order to start syslog-ng after udev or modifi the init script to load virtio-rng by before starting syslog-ng.

I observed the same behaviour with versions 3.19.1 and 3.22.1.

I tested with an ARM qemu based on qemu_arm_versatile_defconfig (no udev, no virtio support in the kernel). It shows the same behavior except that loading the rng-coremodule suffices.

--
Carlos Santos <[email protected]>

#4 lore raw

PATCH 1/1 package/syslog-ng: bump version to 3.22.1

Quoted 23 lines · Carlos Santos
Quoted 20 lines · Ricardo Martincoski

Hello,

+ Thomas P
+ Carlos, because of the init script

This bump made the syslog-ng runtime test to start to fail, see the run before
[1] and after [2] this patch.

[1] https://gitlab.com/RicardoMartincoski/buildroot/-/jobs/290060873
[2] https://gitlab.com/RicardoMartincoski/buildroot/-/jobs/290060905

It fails for 2 reasons, see below. Can you investigate/fix them?

On Thu, Aug 15, 2019 at 05:50 AM, Chris Packham wrote:

[snip]

Quoted 3 lines

+++ b/package/syslog-ng/syslog-ng.mk

(quoted diff) +0 -0
@@ -6,7 +6,7 @@
 
Quoted 16 lines
Quoted 8 lines

package/syslog-ng/syslog-ng.mk line 9

Quoted 4 lines
package/syslog-ng/syslog-ng.mk +1 -1
 # When updating the version, please check at runtime if the version in
 # syslog-ng.conf header needs to be updated
-SYSLOG_NG_VERSION = 3.19.1
+SYSLOG_NG_VERSION = 3.22.1

REASON 1. You forgot to update the version number in syslog-ng.conf This makes syslog-ng to generate a warning message every time the target is started (I wrapped the message below):

Quoted 8 lines

WARNING: log-fifo-size() works differently starting with syslog-ng 3.22 to avoid dropping flow-controlled messages when log-fifo-size() is misconfigured. From now on, log-fifo-size() only affects messages that are not flow-controlled. (Flow-controlled log paths have the flags(flow-control) option set.) To enable the new behaviour, update the @version string in your configuration and consider lowering the value of log-fifo-size().;
At first look it seems harmless to the minimal config we use by default and all that needs to be done is to update the version in the .conf file.

I'll fix that up.

Quoted 80 lines
Quoted 73 lines

REASON 2. It seems there is either a bug in upstream or the upstream changed behavior and we need to add a dependency or change our default init script. I saw in another thread you mentioned there is a new upstream version and you are already planning to send another bump. Maybe the new bump fix this second issue. Anyway I will describe below the tests I did.
I downloaded the artifacts from the gitlab-ci run and started the image using the qemu command displayed in the first line of the -run.log file.

The daemon seems to not reload correctly:
3.19.1:

|# syslog-ng-ctl reload
|OK Config reload initiated
|#
3.22.1:
|# syslog-ng-ctl reload
|EOF occurred while reading control socket
|#

The daemon never stops:
3.19.1:

|# ps aux | grep syslog
|   44 root     {syslog-ng} supervising syslog-ng
|   45 root     /usr/sbin/syslog-ng
|   72 root     grep syslog
|# /etc/init.d/S01syslog-ng stop
|Stopping syslog-ng: OK
|# ps aux | grep syslog
|   77 root     grep syslog
|#
3.22.1:
|# ps aux | grep syslog
|   44 root     {syslog-ng} supervising syslog-ng
|   70 root     /usr/sbin/syslog-ng
|   75 root     grep syslog
|# /etc/init.d/S01syslog-ng stop
|Stopping syslog-ng: OK
|# ps aux | grep syslog
|   44 root     {syslog-ng} supervising syslog-ng
|   79 root     /usr/sbin/syslog-ng
|   83 root     grep syslog
|#
So I tried to change the command used by the init script, 'KILL' works:
3.22.1:
|# ps aux | grep syslog
|   44 root     {syslog-ng} supervising syslog-ng
|   98 root     /usr/sbin/syslog-ng
|  124 root     grep syslog
|# start-stop-daemon -K -p /var/run/syslog-ng.pid
|stopped process in pidfile '/var/run/syslog-ng.pid' (pid 98)
|# ps aux | grep syslog
|   44 root     {syslog-ng} supervising syslog-ng
|  127 root     /usr/sbin/syslog-ng
|  131 root     grep syslog
|# start-stop-daemon -K -s KILL -p /var/run/syslog-ng.pid
|stopped process in pidfile '/var/run/syslog-ng.pid' (pid 127)
|# ps aux | grep syslog
|  134 root     grep syslog
|#

When the daemon receives a message it seems to fail and another PID is created:
3.22.1:

|# ps aux | grep syslog
|   44 root     {syslog-ng} supervising syslog-ng
|   74 root     /usr/sbin/syslog-ng
|   78 root     grep syslog
|# logger my-message
|# ps aux | grep syslog
|   44 root     {syslog-ng} supervising syslog-ng
|   82 root     /usr/sbin/syslog-ng
|   84 root     grep syslog
|# grep my-message /var/log/messages
|#
Quoted 4 lines

If I keep trying sending messages using logger, some are received, some are not.

Regards,
Ricardo

Hi Ricardo,

Quoted 7 lines

I ran a test on a QEMU build with udev and noticed that syslog-g hangs on start-up. Using strace I found that it blocks on a getrandom() call, which seems to be make sense since the start-up order is

    /etc/init.d/S01syslog-ng
    /etc/init.d/S10udev
    /etc/init.d/S20urandom

I didn't have any particular reason for S01 other than that's what rsyslog does. Moving it after urandom would be fine.

Quoted 16 lines

So when syslog-ng starts the random number generator is not working properly because virtio-rng is not loaded yet.

It does not hang if I revert the order to start syslog-ng after udev or modifi the init script to load virtio-rng by before starting syslog-ng.

I observed the same behaviour with versions 3.19.1 and 3.22.1.

I tested with an ARM qemu based on qemu_arm_versatile_defconfig (no udev, no virtio support in the kernel). It shows the same behavior except that loading the rng-coremodule suffices.

--
Carlos Santos <[email protected]>

#5 lore raw

PATCH 1/1 package/syslog-ng: bump version to 3.22.1

Quoted 42 lines · Chris Packham
Quoted 23 lines · Carlos Santos
Quoted 20 lines · Ricardo Martincoski

Hello,

+ Thomas P
+ Carlos, because of the init script

This bump made the syslog-ng runtime test to start to fail, see the run before
[1] and after [2] this patch.

[1] https://gitlab.com/RicardoMartincoski/buildroot/-/jobs/290060873
[2] https://gitlab.com/RicardoMartincoski/buildroot/-/jobs/290060905

It fails for 2 reasons, see below. Can you investigate/fix them?

On Thu, Aug 15, 2019 at 05:50 AM, Chris Packham wrote:

[snip]

Quoted 3 lines

+++ b/package/syslog-ng/syslog-ng.mk

(quoted diff) +0 -0
@@ -6,7 +6,7 @@
 
Quoted 16 lines
Quoted 8 lines

package/syslog-ng/syslog-ng.mk line 9

Quoted 4 lines
package/syslog-ng/syslog-ng.mk +1 -1
 # When updating the version, please check at runtime if the version in
 # syslog-ng.conf header needs to be updated
-SYSLOG_NG_VERSION = 3.19.1
+SYSLOG_NG_VERSION = 3.22.1

REASON 1. You forgot to update the version number in syslog-ng.conf This makes syslog-ng to generate a warning message every time the target is started (I wrapped the message below):

Quoted 8 lines

WARNING: log-fifo-size() works differently starting with syslog-ng 3.22 to avoid dropping flow-controlled messages when log-fifo-size() is misconfigured. From now on, log-fifo-size() only affects messages that are not flow-controlled. (Flow-controlled log paths have the flags(flow-control) option set.) To enable the new behaviour, update the @version string in your configuration and consider lowering the value of log-fifo-size().;
At first look it seems harmless to the minimal config we use by default and all that needs to be done is to update the version in the .conf file.

Quoted 1 line

I'll fix that up.

OK, I saw your patch.

Quoted 84 lines
Quoted 84 lines
Quoted 73 lines

REASON 2. It seems there is either a bug in upstream or the upstream changed behavior and we need to add a dependency or change our default init script. I saw in another thread you mentioned there is a new upstream version and you are already planning to send another bump. Maybe the new bump fix this second issue. Anyway I will describe below the tests I did.
I downloaded the artifacts from the gitlab-ci run and started the image using the qemu command displayed in the first line of the -run.log file.

The daemon seems to not reload correctly:
3.19.1:

|# syslog-ng-ctl reload
|OK Config reload initiated
|#
3.22.1:
|# syslog-ng-ctl reload
|EOF occurred while reading control socket
|#

The daemon never stops:
3.19.1:

|# ps aux | grep syslog
|   44 root     {syslog-ng} supervising syslog-ng
|   45 root     /usr/sbin/syslog-ng
|   72 root     grep syslog
|# /etc/init.d/S01syslog-ng stop
|Stopping syslog-ng: OK
|# ps aux | grep syslog
|   77 root     grep syslog
|#
3.22.1:
|# ps aux | grep syslog
|   44 root     {syslog-ng} supervising syslog-ng
|   70 root     /usr/sbin/syslog-ng
|   75 root     grep syslog
|# /etc/init.d/S01syslog-ng stop
|Stopping syslog-ng: OK
|# ps aux | grep syslog
|   44 root     {syslog-ng} supervising syslog-ng
|   79 root     /usr/sbin/syslog-ng
|   83 root     grep syslog
|#
So I tried to change the command used by the init script, 'KILL' works:
3.22.1:
|# ps aux | grep syslog
|   44 root     {syslog-ng} supervising syslog-ng
|   98 root     /usr/sbin/syslog-ng
|  124 root     grep syslog
|# start-stop-daemon -K -p /var/run/syslog-ng.pid
|stopped process in pidfile '/var/run/syslog-ng.pid' (pid 98)
|# ps aux | grep syslog
|   44 root     {syslog-ng} supervising syslog-ng
|  127 root     /usr/sbin/syslog-ng
|  131 root     grep syslog
|# start-stop-daemon -K -s KILL -p /var/run/syslog-ng.pid
|stopped process in pidfile '/var/run/syslog-ng.pid' (pid 127)
|# ps aux | grep syslog
|  134 root     grep syslog
|#

When the daemon receives a message it seems to fail and another PID is created:
3.22.1:

|# ps aux | grep syslog
|   44 root     {syslog-ng} supervising syslog-ng
|   74 root     /usr/sbin/syslog-ng
|   78 root     grep syslog
|# logger my-message
|# ps aux | grep syslog
|   44 root     {syslog-ng} supervising syslog-ng
|   82 root     /usr/sbin/syslog-ng
|   84 root     grep syslog
|# grep my-message /var/log/messages
|#
Quoted 4 lines

If I keep trying sending messages using logger, some are received, some are not.

Regards,
Ricardo

Hi Ricardo,

I ran a test on a QEMU build with udev and noticed that syslog-g hangs on start-up. Using strace I found that it blocks on a getrandom() call, which seems to be make sense since the start-up order is

Quoted 6 lines
Quoted 3 lines
    /etc/init.d/S01syslog-ng
    /etc/init.d/S10udev
    /etc/init.d/S20urandom

I didn't have any particular reason for S01 other than that's what rsyslog does. Moving it after urandom would be fine.

S01 is the right place, since udevd uses syslog and starting syslog-ng later would prevent error messages from being saved in /var/logmessages.

The correct solution is to configure the kernel with the random hardware support embedded, not as a module (e.g. HW_RANDOM=y , CONFIG_VIRTIO_PCI=y and HW_RANDOM_VIRTIO=y in board/qemu/arm-versatile/linux.config).

Quoted 16 lines
Quoted 16 lines

So when syslog-ng starts the random number generator is not working properly because virtio-rng is not loaded yet.

It does not hang if I revert the order to start syslog-ng after udev or modifi the init script to load virtio-rng by before starting syslog-ng.

I observed the same behaviour with versions 3.19.1 and 3.22.1.

I tested with an ARM qemu based on qemu_arm_versatile_defconfig (no udev, no virtio support in the kernel). It shows the same behavior except that loading the rng-coremodule suffices.

--
Carlos Santos <[email protected]>

Signature · 1 line
Carlos Santos <[email protected]>
#6 lore raw

PATCH 1/1 package/syslog-ng: bump version to 3.22.1

Quoted 13 lines · On Mon, 9 Sep 2019 23:40 Carlos Santos, <[email protected]> wrote:
Quoted 6 lines
Quoted 6 lines

Hi Ricardo,

I ran a test on a QEMU build with udev and noticed that syslog-g hangs on start-up. Using strace I found that it blocks on a getrandom() call, which seems to be make sense since the start-up order is

Quoted 6 lines
Quoted 3 lines
    /etc/init.d/S01syslog-ng
    /etc/init.d/S10udev
    /etc/init.d/S20urandom

I didn't have any particular reason for S01 other than that's what rsyslog does. Moving it after urandom would be fine.

Quoted 9 lines

S01 is the right place, since udevd uses syslog and starting syslog-ng later would prevent error messages from being saved in /var/logmessages.

The correct solution is to configure the kernel with the random hardware support embedded, not as a module (e.g. HW_RANDOM=y , CONFIG_VIRTIO_PCI=y and HW_RANDOM_VIRTIO=y in board/qemu/arm-versatile/linux.config).

Still seems odd that this dependency exhists. Maybe there is an option to disable it.

Quoted 14 lines
Quoted 14 lines
Quoted 14 lines

So when syslog-ng starts the random number generator is not working properly because virtio-rng is not loaded yet.

It does not hang if I revert the order to start syslog-ng after udev or modifi the init script to load virtio-rng by before starting syslog-ng.

I observed the same behaviour with versions 3.19.1 and 3.22.1.

I tested with an ARM qemu based on qemu_arm_versatile_defconfig (no udev, no virtio support in the kernel). It shows the same behavior except that loading the rng-coremodule suffices.

Quoted 6 lines
Quoted 2 lines
Quoted 2 lines

--
Carlos Santos <[email protected]>

--
Carlos Santos <[email protected]>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.busybox.net/pipermail/buildroot/attachments/20190909/e11003ea/attachment.html>

#7 lore raw

PATCH 1/1 package/syslog-ng: bump version to 3.22.1

Quoted 22 lines · Chris Packham
Quoted 18 lines · On Mon, 9 Sep 2019 23:40 Carlos Santos, <[email protected]> wrote:
Quoted 7 lines
Quoted 7 lines

Hi Ricardo,

I ran a test on a QEMU build with udev and noticed that syslog-g hangs on start-up. Using strace I found that it blocks on a getrandom() call, which seems to be make sense since the start-up order is

Quoted 6 lines
Quoted 3 lines
    /etc/init.d/S01syslog-ng
    /etc/init.d/S10udev
    /etc/init.d/S20urandom

I didn't have any particular reason for S01 other than that's what rsyslog does. Moving it after urandom would be fine.

S01 is the right place, since udevd uses syslog and starting syslog-ng later would prevent error messages from being saved in /var/logmessages.

Quoted 7 lines
Quoted 4 lines

The correct solution is to configure the kernel with the random hardware support embedded, not as a module (e.g. HW_RANDOM=y , CONFIG_VIRTIO_PCI=y and HW_RANDOM_VIRTIO=y in board/qemu/arm-versatile/linux.config).

Still seems odd that this dependency exhists. Maybe there is an option to disable it.

The dependency is unavoidable. RHEL 8, for instance, which is a distribution with a well defined set of target environments has CONFIG_HW_RANDOM_VIRTIO=y in the kernel config file. On the other hand the linux.config files provided by Buildroot are generic and can not match all possible configurations.

Signature · 1 line
Carlos Santos <[email protected]>
#8 lore raw

PATCH 1/1 package/syslog-ng: bump version to 3.22.1

Hello,

Few more tests from my side, but no conclusion yet.

Quoted 8 lines · Carlos Santos
Quoted 7 lines · Chris Packham
Quoted 3 lines · On Mon, 9 Sep 2019 23:40 Carlos Santos, <[email protected]> wrote:
Quoted 3 lines
Quoted 3 lines

Hi Ricardo,

Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines

I ran a test on a QEMU build with udev and noticed that syslog-g hangs on start-up. Using strace I found that it blocks on a getrandom() call, which seems to be make sense since the start-up order is

    /etc/init.d/S01syslog-ng
    /etc/init.d/S10udev
    /etc/init.d/S20urandom

Thank you for your tests.

Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines

I didn't have any particular reason for S01 other than that's what rsyslog does. Moving it after urandom would be fine.

I tested renaming S01syslog-ng to S22syslog-ng but the issue still occurs.
[1] https://gitlab.com/RicardoMartincoski/buildroot/-/jobs/290335678

I also run strace with the original script name [2] and after rename [3].
[2] https://gitlab.com/RicardoMartincoski/buildroot/-/jobs/290350949
[3] https://gitlab.com/RicardoMartincoski/buildroot/-/jobs/290351179
The timeout the tests infra waits for the login prompt in those jobs is 10 minutes, then it prints '==> System does not boot' to the log file and fails.

In both cases the messages hang in a similar way:

[pid    48] 00:01:50 <... futex resumed>) = 0
[pid    48] 00:01:50 epoll_wait(3, [{EPOLLIN, {u32=160804, u64=1058090963334180}}], 9, -1) = 1
[pid    48] 00:02:29 read(19, "\1\0\0\0\0\0\0\0", 8) = 8
[pid    48] 00:02:29 clock_gettime(CLOCK_MONOTONIC, {tv_sec=149, tv_nsec=122924000}) = 0
[pid    48] 00:02:29 close(5)           = 0
[pid    48] 00:02:29 epoll_wait(3, 

Strace never prints the other parameters for the last epoll_wait call.

Quoted 9 lines
Quoted 9 lines
Quoted 9 lines

S01 is the right place, since udevd uses syslog and starting syslog-ng later would prevent error messages from being saved in /var/logmessages.

The correct solution is to configure the kernel with the random hardware support embedded, not as a module (e.g. HW_RANDOM=y , CONFIG_VIRTIO_PCI=y and HW_RANDOM_VIRTIO=y in board/qemu/arm-versatile/linux.config).

It should be already the case. Of course, maybe I missed something.
First the drivers were added [4] and the test run on gitlab-ci.
From one run, the binary kernel was saved and is now used by tests that select the builtin kernel for armv5 [5], '-device virtio-rng-pci' is also passed to qemu when this kernel image is used.
And finally the syslog-ng test was updated to use the builtin binary kernel [6].
[4] https://github.com/buildroot/buildroot/commit/450863097f588fe85d23e83cff14a75f1740d8fa
[5] https://github.com/buildroot/buildroot/commit/7acb32dabb80cc9f0dfc48f14e9bc86b3ef5df74
[6] https://github.com/buildroot/buildroot/commit/56e38a705e62a429576635b0a26cc4d3b3e88023

Quoted 9 lines
Quoted 3 lines

Still seems odd that this dependency exhists. Maybe there is an option to disable it.

The dependency is unavoidable. RHEL 8, for instance, which is a distribution with a well defined set of target environments has CONFIG_HW_RANDOM_VIRTIO=y in the kernel config file. On the other hand the linux.config files provided by Buildroot are generic and can not match all possible configurations.

Indeed, but I used a defconfig fragment to add them for this runtime test.

I also tested changing the version of syslog-ng:
2.19.1 OK
2.20.1 OK
2.21.1 FAIL
2.23.1 FAIL
So the next bump will not fix the runtime test.

I looked the diff between syslog-ng-3.19.1 and syslog-ng-3.20.1 but I was unable to find some obvious problem or change in behavior.

In the lack of better ideas I also tested using another libc:

| class TestSyslogNg(infra.basetest.BRTest):
|-    config = infra.basetest.BASIC_TOOLCHAIN_CONFIG + \
|+    config = \
|         """
|+        BR2_arm=y
|+        BR2_TOOLCHAIN_EXTERNAL=y

The same runtime issue occurs.

Regards,
Ricardo