All of lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH 1/1] package/sysklogd: bump to version 2.1.2
@ 2020-08-12 16:08 Andreas Hilse
  2020-08-13  8:25 ` Thomas Petazzoni
                   ` (2 more replies)
  0 siblings, 3 replies; 15+ messages in thread
From: Andreas Hilse @ 2020-08-12 16:08 UTC (permalink / raw)
  To: buildroot

- fixes: sysklogd 1.6 klogd with newer glibcs: kernel messages are logged to user facility
- sysklogd removed klogd, functionality has been moved to syslogd
- now supports config fragments in /etc/syslog.d
- disabled sysklogd logger to not interfere with other loggers

Signed-off-by: Andreas Hilse <andreas.hilse@googlemail.com>
---
 package/sysklogd/Config.in       |  4 +-
 package/sysklogd/S02klogd        | 65 --------------------------------
 package/sysklogd/klogd.service   | 11 ------
 package/sysklogd/sysklogd.hash   |  4 +-
 package/sysklogd/sysklogd.mk     | 12 ++----
 package/sysklogd/syslog.conf     |  2 +
 package/sysklogd/syslogd.service |  3 +-
 7 files changed, 11 insertions(+), 90 deletions(-)
 delete mode 100644 package/sysklogd/S02klogd
 delete mode 100644 package/sysklogd/klogd.service

diff --git a/package/sysklogd/Config.in b/package/sysklogd/Config.in
index fda58e020e..996c46ffa1 100644
--- a/package/sysklogd/Config.in
+++ b/package/sysklogd/Config.in
@@ -1,8 +1,8 @@
 config BR2_PACKAGE_SYSKLOGD
-	bool "syslogd & klogd"
+	bool "sysklogd"
 	depends on BR2_USE_MMU # fork()
 	depends on BR2_PACKAGE_BUSYBOX_SHOW_OTHERS
 	help
-	  System log daemons syslogd and klogd.
+	  System log daemon syslogd.
 
 	  https://github.com/troglobit/sysklogd/
diff --git a/package/sysklogd/S02klogd b/package/sysklogd/S02klogd
deleted file mode 100644
index ba728aa99a..0000000000
--- a/package/sysklogd/S02klogd
+++ /dev/null
@@ -1,65 +0,0 @@
-#!/bin/sh
-
-DAEMON="klogd"
-PIDFILE="/var/run/$DAEMON.pid"
-
-KLOGD_ARGS=""
-
-KLOGD_RELOAD="0"
-
-# shellcheck source=/dev/null
-[ -r "/etc/default/$DAEMON" ] && . "/etc/default/$DAEMON"
-
-start() {
-	printf 'Starting %s: ' "$DAEMON"
-	# shellcheck disable=SC2086 # we need the word splitting
-	start-stop-daemon -S -q -p "$PIDFILE" -x "/sbin/$DAEMON" \
-		-- $KLOGD_ARGS
-	status=$?
-	if [ "$status" -eq 0 ]; then
-		echo "OK"
-	else
-		echo "FAIL"
-	fi
-	return "$status"
-}
-
-stop() {
-	printf 'Stopping %s: ' "$DAEMON"
-	start-stop-daemon -K -q -p "$PIDFILE"
-	status=$?
-	if [ "$status" -eq 0 ]; then
-		echo "OK"
-	else
-		echo "FAIL"
-	fi
-	return "$status"
-}
-
-restart() {
-	stop
-	sleep 1
-	start
-}
-
-# SIGUSR1 makes klogd reload kernel module symbols
-# SIGUSR2 makes klogd reload static kernel symbols and kernel module symbols
-reload() {
-	printf 'Reloading %s: ' "$DAEMON"
-	start-stop-daemon -K -s "$KLOGD_RELOAD" -q -p "$PIDFILE"
-	status=$?
-	if [ "$status" -eq 0 ]; then
-		echo "OK"
-	else
-		echo "FAIL"
-	fi
-	return "$status"
-}
-
-case "$1" in
-	start|stop|restart|reload)
-		"$1";;
-	*)
-		echo "Usage: $0 {start|stop|restart|reload}"
-		exit 1
-esac
diff --git a/package/sysklogd/klogd.service b/package/sysklogd/klogd.service
deleted file mode 100644
index b5dbb93d7d..0000000000
--- a/package/sysklogd/klogd.service
+++ /dev/null
@@ -1,11 +0,0 @@
-[Unit]
-Description=Kernel Log Daemon
-
-[Service]
-ExecStart=/sbin/klogd -n
-StandardOutput=null
-Restart=on-failure
-
-[Install]
-WantedBy=multi-user.target
-WantedBy=syslogd.service
diff --git a/package/sysklogd/sysklogd.hash b/package/sysklogd/sysklogd.hash
index 6f7ab6ece8..88ae0c745d 100644
--- a/package/sysklogd/sysklogd.hash
+++ b/package/sysklogd/sysklogd.hash
@@ -1,3 +1,3 @@
 # Locally calculated
-sha256	1e9e18564c5bba474954d55ea6e2a0e3dc1bc145d8973c5fd098b088a9be9ceb	sysklogd-1.6.tar.gz
-sha256	91df39d1816bfb17a4dda2d3d2c83b1f6f2d38d53e53e41e8f97ad5ac46a0cad	COPYING
+sha256	09fe1edca882a9ae976cdbf516786edc1629347b9507d45dc005d9d969f94702	sysklogd-2.1.2.tar.gz
+sha256	7a71d7603a7c4456df441463e54da35acf151c1be0879246de63544f1f34f477	LICENSE
diff --git a/package/sysklogd/sysklogd.mk b/package/sysklogd/sysklogd.mk
index 7a25d0eb6f..cd013f658c 100644
--- a/package/sysklogd/sysklogd.mk
+++ b/package/sysklogd/sysklogd.mk
@@ -4,13 +4,13 @@
 #
 ################################################################################
 
-SYSKLOGD_VERSION = 1.6
+SYSKLOGD_VERSION = 2.1.2
 SYSKLOGD_SITE = $(call github,troglobit,sysklogd,v$(SYSKLOGD_VERSION))
-SYSKLOGD_LICENSE = GPL-2.0+
-SYSKLOGD_LICENSE_FILES = COPYING
+SYSKLOGD_LICENSE = BSD-3-Clause
+SYSKLOGD_LICENSE_FILES = LICENSE
 # From git
 SYSKLOGD_AUTORECONF = YES
-SYSKLOGD_CONF_OPTS = --exec-prefix=/
+SYSKLOGD_CONF_OPTS = --exec-prefix=/ --without-logger
 
 define SYSKLOGD_INSTALL_SAMPLE_CONFIG
 	$(INSTALL) -D -m 0644 package/sysklogd/syslog.conf \
@@ -22,15 +22,11 @@ SYSKLOGD_POST_INSTALL_TARGET_HOOKS += SYSKLOGD_INSTALL_SAMPLE_CONFIG
 define SYSKLOGD_INSTALL_INIT_SYSV
 	$(INSTALL) -m 755 -D package/sysklogd/S01syslogd \
 		$(TARGET_DIR)/etc/init.d/S01syslogd
-	$(INSTALL) -m 755 -D package/sysklogd/S02klogd \
-		$(TARGET_DIR)/etc/init.d/S02klogd
 endef
 
 define SYSKLOGD_INSTALL_INIT_SYSTEMD
 	$(INSTALL) -D -m 644 $(SYSKLOGD_PKGDIR)/syslogd.service \
 		$(TARGET_DIR)/usr/lib/systemd/system/syslogd.service
-	$(INSTALL) -D -m 644 $(SYSKLOGD_PKGDIR)/klogd.service \
-		$(TARGET_DIR)/usr/lib/systemd/system/klogd.service
 endef
 
 $(eval $(autotools-package))
diff --git a/package/sysklogd/syslog.conf b/package/sysklogd/syslog.conf
index 3184139052..db81da8868 100644
--- a/package/sysklogd/syslog.conf
+++ b/package/sysklogd/syslog.conf
@@ -1,5 +1,7 @@
 # /etc/syslog.conf - Configuration file for syslogd
 
+include /etc/syslog.d/*.conf
+
 auth,authpriv.*		/var/log/auth.log
 *.*;auth,authpriv.none	/var/log/messages
 user.*			/var/log/user.log
diff --git a/package/sysklogd/syslogd.service b/package/sysklogd/syslogd.service
index adaac679f2..1bf1bb3bd9 100644
--- a/package/sysklogd/syslogd.service
+++ b/package/sysklogd/syslogd.service
@@ -1,10 +1,9 @@
 [Unit]
 Description=System Logging Service
 Requires=syslog.socket
-Wants=klogd.service
 
 [Service]
-ExecStart=/sbin/syslogd -m 0 -n
+ExecStart=/sbin/syslogd -m 0 -F
 StandardOutput=null
 Restart=on-failure
 
-- 
2.28.0

^ permalink raw reply related	[flat|nested] 15+ messages in thread

* [Buildroot] [PATCH 1/1] package/sysklogd: bump to version 2.1.2
  2020-08-12 16:08 [Buildroot] [PATCH 1/1] package/sysklogd: bump to version 2.1.2 Andreas Hilse
@ 2020-08-13  8:25 ` Thomas Petazzoni
  2020-08-14  9:10   ` Andreas Hilse
  2020-12-05 21:21 ` Thomas Petazzoni
  2020-12-29 18:11 ` [Buildroot] [PATCH v2 " Andreas Hilse
  2 siblings, 1 reply; 15+ messages in thread
From: Thomas Petazzoni @ 2020-08-13  8:25 UTC (permalink / raw)
  To: buildroot

Hello Andreas,

Thanks for the patch.

On Wed, 12 Aug 2020 18:08:43 +0200
Andreas Hilse <andreas.hilse@googlemail.com> wrote:

> - fixes: sysklogd 1.6 klogd with newer glibcs: kernel messages are logged to user facility

I'd like to understand how disruptive/important this issue is. I.e,
should we have this sysklogd version bump be considered as a bug fix?

> - sysklogd removed klogd, functionality has been moved to syslogd
> - now supports config fragments in /etc/syslog.d
> - disabled sysklogd logger to not interfere with other loggers

I think the license change should also be mentioned in the commit log,
but that can be added when applying.

Best regards,

Thomas
-- 
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com

^ permalink raw reply	[flat|nested] 15+ messages in thread

* [Buildroot] [PATCH 1/1] package/sysklogd: bump to version 2.1.2
  2020-08-13  8:25 ` Thomas Petazzoni
@ 2020-08-14  9:10   ` Andreas Hilse
  0 siblings, 0 replies; 15+ messages in thread
From: Andreas Hilse @ 2020-08-14  9:10 UTC (permalink / raw)
  To: buildroot

Hello Thomas,

> > - fixes: sysklogd 1.6 klogd with newer glibcs: kernel messages are logged to user facility
>
> I'd like to understand how disruptive/important this issue is. I.e,
> should we have this sysklogd version bump be considered as a bug fix?

You would only notice it when you changed the default syslog.conf to
filter user.* messages to somewhere else than /var/log/messages.
But yes, in our case I would see this as a bug fix as we suddenly saw
kernel messages written to our user.log after switching from buildroot
2016.08 to 2020.02.

> I think the license change should also be mentioned in the commit log,
> but that can be added when applying.
Ok.

Best regards
Andreas

^ permalink raw reply	[flat|nested] 15+ messages in thread

* [Buildroot] [PATCH 1/1] package/sysklogd: bump to version 2.1.2
  2020-08-12 16:08 [Buildroot] [PATCH 1/1] package/sysklogd: bump to version 2.1.2 Andreas Hilse
  2020-08-13  8:25 ` Thomas Petazzoni
@ 2020-12-05 21:21 ` Thomas Petazzoni
  2020-12-08 20:41   ` Andreas Hilse
  2020-12-29 18:11 ` [Buildroot] [PATCH v2 " Andreas Hilse
  2 siblings, 1 reply; 15+ messages in thread
From: Thomas Petazzoni @ 2020-12-05 21:21 UTC (permalink / raw)
  To: buildroot

Hello Andreas,

On Wed, 12 Aug 2020 18:08:43 +0200
Andreas Hilse <andreas.hilse@googlemail.com> wrote:

> - fixes: sysklogd 1.6 klogd with newer glibcs: kernel messages are logged to user facility
> - sysklogd removed klogd, functionality has been moved to syslogd
> - now supports config fragments in /etc/syslog.d
> - disabled sysklogd logger to not interfere with other loggers
> 
> Signed-off-by: Andreas Hilse <andreas.hilse@googlemail.com>

I think the commit log should mention that the license has changed,
with a link to https://github.com/troglobit/sysklogd/releases/tag/v2.1.

However, I was about to apply, but got a build failure:

syslogd.c: In function ?opensys?:
syslogd.c:486:42: error: ?O_CLOEXEC? undeclared (first use in this function)
  fd = open(file, O_RDONLY | O_NONBLOCK | O_CLOEXEC, 0);
                                          ^
syslogd.c:486:42: note: each undeclared identifier is reported only once for each function it appears in
make[3]: *** [Makefile:646: syslogd-syslogd.o] Error 1
make[3]: *** Waiting for unfinished jobs....
syslog.c: In function ?vsyslogp_r?:
syslog.c:448:27: error: ?O_CLOEXEC? undeclared (first use in this function)
   O_WRONLY | O_NONBLOCK | O_CLOEXEC, 0)) >= 0) {
                           ^

which happens with the following defconfig:

BR2_arm=y
BR2_TOOLCHAIN_EXTERNAL=y
BR2_TOOLCHAIN_EXTERNAL_CUSTOM=y
BR2_TOOLCHAIN_EXTERNAL_DOWNLOAD=y
BR2_TOOLCHAIN_EXTERNAL_URL="http://autobuild.buildroot.org/toolchains/tarballs/br-arm-full-2020.02.tar.bz2"
BR2_TOOLCHAIN_EXTERNAL_GCC_5=y
BR2_TOOLCHAIN_EXTERNAL_HEADERS_4_14=y
BR2_TOOLCHAIN_EXTERNAL_LOCALE=y
# BR2_TOOLCHAIN_EXTERNAL_HAS_THREADS_DEBUG is not set
BR2_TOOLCHAIN_EXTERNAL_CXX=y
BR2_INIT_NONE=y
BR2_SYSTEM_BIN_SH_NONE=y
# BR2_PACKAGE_BUSYBOX is not set
BR2_PACKAGE_SYSKLOGD=y
# BR2_TARGET_ROOTFS_TAR is not set

Could you have a look ?

Thanks a lot!

Thomas
-- 
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com

^ permalink raw reply	[flat|nested] 15+ messages in thread

* [Buildroot] [PATCH 1/1] package/sysklogd: bump to version 2.1.2
  2020-12-05 21:21 ` Thomas Petazzoni
@ 2020-12-08 20:41   ` Andreas Hilse
  2020-12-09  8:11     ` Thomas Petazzoni
  2020-12-29 15:03     ` Andreas Hilse
  0 siblings, 2 replies; 15+ messages in thread
From: Andreas Hilse @ 2020-12-08 20:41 UTC (permalink / raw)
  To: buildroot

Hello Thomas,

> I think the commit log should mention that the license has changed,
> with a link to https://github.com/troglobit/sysklogd/releases/tag/v2.1.
Will do when I find out how to update the patch (have to read doc again).

> syslog.c:448:27: error: ?O_CLOEXEC? undeclared (first use in this
function)
>    O_WRONLY | O_NONBLOCK | O_CLOEXEC, 0)) >= 0) {
This is fixable by CFLAGS="-D_GNU_SOURCE" e.g. in MAKE_OPTS.
I contacted the sysklogd maintainer through github. Waiting on a response.

Best regards
Andreas
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.busybox.net/pipermail/buildroot/attachments/20201208/219e82b8/attachment.html>

^ permalink raw reply	[flat|nested] 15+ messages in thread

* [Buildroot] [PATCH 1/1] package/sysklogd: bump to version 2.1.2
  2020-12-08 20:41   ` Andreas Hilse
@ 2020-12-09  8:11     ` Thomas Petazzoni
  2020-12-29 15:03     ` Andreas Hilse
  1 sibling, 0 replies; 15+ messages in thread
From: Thomas Petazzoni @ 2020-12-09  8:11 UTC (permalink / raw)
  To: buildroot

Hello,

On Tue, 8 Dec 2020 21:41:27 +0100
Andreas Hilse <andreas.hilse@googlemail.com> wrote:

> Hello Thomas,
> 
> > I think the commit log should mention that the license has changed,
> > with a link to https://github.com/troglobit/sysklogd/releases/tag/v2.1.  
> Will do when I find out how to update the patch (have to read doc again).

git commit --amend

will allow you to update the commit log of the top-most commit.

Otherwise, I suggest you to document yourself about "git interactive
rebase", this is really the key functionality to understand to be able
to prepare patch series with Git.

> > syslog.c:448:27: error: ?O_CLOEXEC? undeclared (first use in this  
> function)
> >    O_WRONLY | O_NONBLOCK | O_CLOEXEC, 0)) >= 0) {  
> This is fixable by CFLAGS="-D_GNU_SOURCE" e.g. in MAKE_OPTS.
> I contacted the sysklogd maintainer through github. Waiting on a response.

Then the particular file using O_CLOEXEC should probably #define
_GNU_SOURCE before including any header file.

Thomas
-- 
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com

^ permalink raw reply	[flat|nested] 15+ messages in thread

* [Buildroot] [PATCH 1/1] package/sysklogd: bump to version 2.1.2
  2020-12-08 20:41   ` Andreas Hilse
  2020-12-09  8:11     ` Thomas Petazzoni
@ 2020-12-29 15:03     ` Andreas Hilse
  2020-12-29 15:13       ` Thomas Petazzoni
  1 sibling, 1 reply; 15+ messages in thread
From: Andreas Hilse @ 2020-12-29 15:03 UTC (permalink / raw)
  To: buildroot

Hello Thomas, Hello Joachim,

Joachim is the maintainer/developer of sysklogd. He already integrated the
newer sysklogd as an external package in his project "netbox":
https://github.com/westermo/netbox/tree/master/package/sysklogd2
The mentioned bug also has been fixed already by him (but not in a release).
For my correspondence with Joachim please refer to
https://github.com/troglobit/sysklogd/issues/24

Would it be useful for buildroot users to have the choice between the old
and the new version of sysklogd?

Best regards
Andreas
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.busybox.net/pipermail/buildroot/attachments/20201229/9165b088/attachment.html>

^ permalink raw reply	[flat|nested] 15+ messages in thread

* [Buildroot] [PATCH 1/1] package/sysklogd: bump to version 2.1.2
  2020-12-29 15:03     ` Andreas Hilse
@ 2020-12-29 15:13       ` Thomas Petazzoni
  0 siblings, 0 replies; 15+ messages in thread
From: Thomas Petazzoni @ 2020-12-29 15:13 UTC (permalink / raw)
  To: buildroot

Hello,

On Tue, 29 Dec 2020 16:03:18 +0100
Andreas Hilse via buildroot <buildroot@busybox.net> wrote:

> Joachim is the maintainer/developer of sysklogd. He already integrated the
> newer sysklogd as an external package in his project "netbox":
> https://github.com/westermo/netbox/tree/master/package/sysklogd2
> The mentioned bug also has been fixed already by him (but not in a release).
> For my correspondence with Joachim please refer to
> https://github.com/troglobit/sysklogd/issues/24
> 
> Would it be useful for buildroot users to have the choice between the old
> and the new version of sysklogd?

Well, in this very thread, you simply bumped the sysklogd package to
this new 2.x version, which is fine for me. There were just a few
issues to resolve, but other than that on the principle, I'm fine with
package/sysklogd simply using the 2.x version of the project.

Best regards,

Thomas
-- 
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com

^ permalink raw reply	[flat|nested] 15+ messages in thread

* [Buildroot] [PATCH v2 1/1] package/sysklogd: bump to version 2.1.2
  2020-08-12 16:08 [Buildroot] [PATCH 1/1] package/sysklogd: bump to version 2.1.2 Andreas Hilse
  2020-08-13  8:25 ` Thomas Petazzoni
  2020-12-05 21:21 ` Thomas Petazzoni
@ 2020-12-29 18:11 ` Andreas Hilse
  2021-01-16 19:33   ` Joachim Wiberg
  2021-01-19 21:22   ` Thomas Petazzoni
  2 siblings, 2 replies; 15+ messages in thread
From: Andreas Hilse @ 2020-12-29 18:11 UTC (permalink / raw)
  To: buildroot

- fixes: sysklogd 1.6 klogd with newer glibcs: kernel messages are logged to user facility
- sysklogd removed klogd, functionality has been moved to syslogd
- now supports config fragments in /etc/syslog.d
- disabled sysklogd logger to not interfere with other loggers
- license has changed from GPL-2.0+ to BSD-3-Clause

Signed-off-by: Andreas Hilse <andreas.hilse@googlemail.com>

---
Changes v1 -> v2:
  - added patch for O_CLOEXEC build failure with uClibc
  - mention license change
  - extended help text in Config.in

Signed-off-by: Andreas Hilse <andreas.hilse@googlemail.com>
---
 ...RCE_required_for_O_CLOEXEC_on_uClibc.patch | 43 ++++++++++++
 package/sysklogd/Config.in                    |  8 ++-
 package/sysklogd/S02klogd                     | 65 -------------------
 package/sysklogd/klogd.service                | 11 ----
 package/sysklogd/sysklogd.hash                |  5 +-
 package/sysklogd/sysklogd.mk                  | 12 ++--
 package/sysklogd/syslog.conf                  |  2 +
 package/sysklogd/syslogd.service              |  3 +-
 8 files changed, 59 insertions(+), 90 deletions(-)
 create mode 100644 package/sysklogd/0001-Define-_GNU_SOURCE_required_for_O_CLOEXEC_on_uClibc.patch
 delete mode 100644 package/sysklogd/S02klogd
 delete mode 100644 package/sysklogd/klogd.service

diff --git a/package/sysklogd/0001-Define-_GNU_SOURCE_required_for_O_CLOEXEC_on_uClibc.patch b/package/sysklogd/0001-Define-_GNU_SOURCE_required_for_O_CLOEXEC_on_uClibc.patch
new file mode 100644
index 0000000000..d794b7f2f3
--- /dev/null
+++ b/package/sysklogd/0001-Define-_GNU_SOURCE_required_for_O_CLOEXEC_on_uClibc.patch
@@ -0,0 +1,43 @@
+From 93117e58016de6f604e67263b5135adbba032367 Mon Sep 17 00:00:00 2001
+From: Joachim Wiberg <troglobit@gmail.com>
+Date: Sun, 30 Aug 2020 11:41:45 +0200
+Subject: [PATCH] Define _GNU_SOURCE, required for O_CLOEXEC on uClibc
+
+When building sysklogd on a uClibc system we must define _GNU_SOURCE to
+get O_CLOEXEC.
+
+Since _GNU_SOURCE is also required for asprintf() with GLIBC, as used by
+the pidfile() replacement function, we drop it from there and rely on
+AM_CPPFLAGS for all sources.
+
+Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
+---
+ lib/pidfile.c   | 1 -
+ src/Makefile.am | 2 +-
+ 2 files changed, 1 insertion(+), 2 deletions(-)
+
+diff --git a/lib/pidfile.c b/lib/pidfile.c
+index a26de73..886a29c 100644
+--- a/lib/pidfile.c
++++ b/lib/pidfile.c
+@@ -31,7 +31,6 @@
+  * POSSIBILITY OF SUCH DAMAGE.
+  */
+ 
+-#define _GNU_SOURCE		/* Needed with GLIBC to get asprintf() */
+ #include <sys/stat.h>		/* utimensat() */
+ #include <sys/time.h>		/* utimensat() on *BSD */
+ #include <sys/types.h>
+diff --git a/src/Makefile.am b/src/Makefile.am
+index 9b80a02..1909ada 100644
+--- a/src/Makefile.am
++++ b/src/Makefile.am
+@@ -36,7 +36,7 @@ endif
+ AM_CFLAGS             = -W -Wall -Wextra
+ AM_CFLAGS            += -Wno-unused-result -Wno-unused-parameter -fno-strict-aliasing
+ AM_CPPFLAGS           = -DSYSCONFDIR=\"@sysconfdir@\" -DRUNSTATEDIR=\"@runstatedir@\"
+-AM_CPPFLAGS          += -D_BSD_SOURCE -D_DEFAULT_SOURCE
++AM_CPPFLAGS          += -D_BSD_SOURCE -D_DEFAULT_SOURCE -D_GNU_SOURCE
+ 
+ syslogd_SOURCES       = syslogd.c syslogd.h socket.c socket.h syslog.h
+ syslogd_SOURCES      += timer.c timer.h queue.h compat.h
diff --git a/package/sysklogd/Config.in b/package/sysklogd/Config.in
index fda58e020e..18ef0e1e1e 100644
--- a/package/sysklogd/Config.in
+++ b/package/sysklogd/Config.in
@@ -1,8 +1,12 @@
 config BR2_PACKAGE_SYSKLOGD
-	bool "syslogd & klogd"
+	bool "sysklogd"
 	depends on BR2_USE_MMU # fork()
 	depends on BR2_PACKAGE_BUSYBOX_SHOW_OTHERS
 	help
-	  System log daemons syslogd and klogd.
+	  The continuation of the original sysklogd package, based on
+	  the original Berkeley syslog daemon.  Now with kernel logging,
+	  and log rotation built-in.  It ca both receive from and send
+	  to remote syslog servers.  The v2.x series include extended
+	  support for RFC5424 with an alt. syslogp() API for clients.
 
 	  https://github.com/troglobit/sysklogd/
diff --git a/package/sysklogd/S02klogd b/package/sysklogd/S02klogd
deleted file mode 100644
index ba728aa99a..0000000000
--- a/package/sysklogd/S02klogd
+++ /dev/null
@@ -1,65 +0,0 @@
-#!/bin/sh
-
-DAEMON="klogd"
-PIDFILE="/var/run/$DAEMON.pid"
-
-KLOGD_ARGS=""
-
-KLOGD_RELOAD="0"
-
-# shellcheck source=/dev/null
-[ -r "/etc/default/$DAEMON" ] && . "/etc/default/$DAEMON"
-
-start() {
-	printf 'Starting %s: ' "$DAEMON"
-	# shellcheck disable=SC2086 # we need the word splitting
-	start-stop-daemon -S -q -p "$PIDFILE" -x "/sbin/$DAEMON" \
-		-- $KLOGD_ARGS
-	status=$?
-	if [ "$status" -eq 0 ]; then
-		echo "OK"
-	else
-		echo "FAIL"
-	fi
-	return "$status"
-}
-
-stop() {
-	printf 'Stopping %s: ' "$DAEMON"
-	start-stop-daemon -K -q -p "$PIDFILE"
-	status=$?
-	if [ "$status" -eq 0 ]; then
-		echo "OK"
-	else
-		echo "FAIL"
-	fi
-	return "$status"
-}
-
-restart() {
-	stop
-	sleep 1
-	start
-}
-
-# SIGUSR1 makes klogd reload kernel module symbols
-# SIGUSR2 makes klogd reload static kernel symbols and kernel module symbols
-reload() {
-	printf 'Reloading %s: ' "$DAEMON"
-	start-stop-daemon -K -s "$KLOGD_RELOAD" -q -p "$PIDFILE"
-	status=$?
-	if [ "$status" -eq 0 ]; then
-		echo "OK"
-	else
-		echo "FAIL"
-	fi
-	return "$status"
-}
-
-case "$1" in
-	start|stop|restart|reload)
-		"$1";;
-	*)
-		echo "Usage: $0 {start|stop|restart|reload}"
-		exit 1
-esac
diff --git a/package/sysklogd/klogd.service b/package/sysklogd/klogd.service
deleted file mode 100644
index b5dbb93d7d..0000000000
--- a/package/sysklogd/klogd.service
+++ /dev/null
@@ -1,11 +0,0 @@
-[Unit]
-Description=Kernel Log Daemon
-
-[Service]
-ExecStart=/sbin/klogd -n
-StandardOutput=null
-Restart=on-failure
-
-[Install]
-WantedBy=multi-user.target
-WantedBy=syslogd.service
diff --git a/package/sysklogd/sysklogd.hash b/package/sysklogd/sysklogd.hash
index 6f7ab6ece8..9f9fd192e1 100644
--- a/package/sysklogd/sysklogd.hash
+++ b/package/sysklogd/sysklogd.hash
@@ -1,3 +1,4 @@
 # Locally calculated
-sha256	1e9e18564c5bba474954d55ea6e2a0e3dc1bc145d8973c5fd098b088a9be9ceb	sysklogd-1.6.tar.gz
-sha256	91df39d1816bfb17a4dda2d3d2c83b1f6f2d38d53e53e41e8f97ad5ac46a0cad	COPYING
+sha256	09fe1edca882a9ae976cdbf516786edc1629347b9507d45dc005d9d969f94702	sysklogd-2.1.2.tar.gz
+sha256	7a71d7603a7c4456df441463e54da35acf151c1be0879246de63544f1f34f477	LICENSE
+sha256	569321607efe6ba0ecb820b3cb23d933e92f6ab50d2f8fcceb23fc8a43756ef0	0001-Define-_GNU_SOURCE_required_for_O_CLOEXEC_on_uClibc.patch
diff --git a/package/sysklogd/sysklogd.mk b/package/sysklogd/sysklogd.mk
index 7a25d0eb6f..cd013f658c 100644
--- a/package/sysklogd/sysklogd.mk
+++ b/package/sysklogd/sysklogd.mk
@@ -4,13 +4,13 @@
 #
 ################################################################################
 
-SYSKLOGD_VERSION = 1.6
+SYSKLOGD_VERSION = 2.1.2
 SYSKLOGD_SITE = $(call github,troglobit,sysklogd,v$(SYSKLOGD_VERSION))
-SYSKLOGD_LICENSE = GPL-2.0+
-SYSKLOGD_LICENSE_FILES = COPYING
+SYSKLOGD_LICENSE = BSD-3-Clause
+SYSKLOGD_LICENSE_FILES = LICENSE
 # From git
 SYSKLOGD_AUTORECONF = YES
-SYSKLOGD_CONF_OPTS = --exec-prefix=/
+SYSKLOGD_CONF_OPTS = --exec-prefix=/ --without-logger
 
 define SYSKLOGD_INSTALL_SAMPLE_CONFIG
 	$(INSTALL) -D -m 0644 package/sysklogd/syslog.conf \
@@ -22,15 +22,11 @@ SYSKLOGD_POST_INSTALL_TARGET_HOOKS += SYSKLOGD_INSTALL_SAMPLE_CONFIG
 define SYSKLOGD_INSTALL_INIT_SYSV
 	$(INSTALL) -m 755 -D package/sysklogd/S01syslogd \
 		$(TARGET_DIR)/etc/init.d/S01syslogd
-	$(INSTALL) -m 755 -D package/sysklogd/S02klogd \
-		$(TARGET_DIR)/etc/init.d/S02klogd
 endef
 
 define SYSKLOGD_INSTALL_INIT_SYSTEMD
 	$(INSTALL) -D -m 644 $(SYSKLOGD_PKGDIR)/syslogd.service \
 		$(TARGET_DIR)/usr/lib/systemd/system/syslogd.service
-	$(INSTALL) -D -m 644 $(SYSKLOGD_PKGDIR)/klogd.service \
-		$(TARGET_DIR)/usr/lib/systemd/system/klogd.service
 endef
 
 $(eval $(autotools-package))
diff --git a/package/sysklogd/syslog.conf b/package/sysklogd/syslog.conf
index 3184139052..411bd645ff 100644
--- a/package/sysklogd/syslog.conf
+++ b/package/sysklogd/syslog.conf
@@ -5,3 +5,5 @@ auth,authpriv.*		/var/log/auth.log
 user.*			/var/log/user.log
 
 *.emerg			*
+
+include /etc/syslog.d/*.conf
diff --git a/package/sysklogd/syslogd.service b/package/sysklogd/syslogd.service
index adaac679f2..1bf1bb3bd9 100644
--- a/package/sysklogd/syslogd.service
+++ b/package/sysklogd/syslogd.service
@@ -1,10 +1,9 @@
 [Unit]
 Description=System Logging Service
 Requires=syslog.socket
-Wants=klogd.service
 
 [Service]
-ExecStart=/sbin/syslogd -m 0 -n
+ExecStart=/sbin/syslogd -m 0 -F
 StandardOutput=null
 Restart=on-failure
 
-- 
2.25.1

^ permalink raw reply related	[flat|nested] 15+ messages in thread

* [Buildroot] [PATCH v2 1/1] package/sysklogd: bump to version 2.1.2
  2020-12-29 18:11 ` [Buildroot] [PATCH v2 " Andreas Hilse
@ 2021-01-16 19:33   ` Joachim Wiberg
  2021-01-19 21:26     ` Thomas Petazzoni
  2021-01-19 21:22   ` Thomas Petazzoni
  1 sibling, 1 reply; 15+ messages in thread
From: Joachim Wiberg @ 2021-01-16 19:33 UTC (permalink / raw)
  To: buildroot

Hi Andreas,

I noticed this hasn't been merged yet, so I thought I'd provide my
feedback.  Sorry for the delay!  Overall it looks good, and I have
a few questions, and a little reveal.

On Tue, Dec 29, 2020 at 19:11, Andreas Hilse via buildroot <buildroot@busybox.net> wrote:
> - fixes: sysklogd 1.6 klogd with newer glibcs: kernel messages are logged to user facility
> - sysklogd removed klogd, functionality has been moved to syslogd
> - now supports config fragments in /etc/syslog.d
> - disabled sysklogd logger to not interfere with other loggers
> - license has changed from GPL-2.0+ to BSD-3-Clause

These two could also be relevant:

- RFC3164 style logging, fully RFC compliant not just BSD style
- RFC5424 style logging to file and remote log servers

> +	  The continuation of the original sysklogd package, based on
> +	  the original Berkeley syslog daemon.  Now with kernel logging,
> +	  and log rotation built-in.  It ca both receive from and send
                                           ^
Minor, spelling.

> +	  to remote syslog servers.  The v2.x series include extended
> +	  support for RFC5424 with an alt. syslogp() API for clients.
[snip]
> +sha256	09fe1edca882a9ae976cdbf516786edc1629347b9507d45dc005d9d969f94702	sysklogd-2.1.2.tar.gz
> +sha256	7a71d7603a7c4456df441463e54da35acf151c1be0879246de63544f1f34f477	LICENSE
> +sha256	569321607efe6ba0ecb820b3cb23d933e92f6ab50d2f8fcceb23fc8a43756ef0	0001-Define-_GNU_SOURCE_required_for_O_CLOEXEC_on_uClibc.patch

I actually released v2.2.0 the other day, and there's a SHA256 on GitHub
now.  This version comes with proper /dev/kmsg support on Linux, which
support multiple consumers, instead of the old /proc/kmsg support.  If
/dev/kmsg isn't found it falls back to the old.  It also has the build
fix for O_CLOEXEC and another fix for an ARMv5 build warning.

I've tested it with a few Bootlin toolchains in our NetBox repo, so it
should be a much smoother ride.

> +SYSKLOGD_CONF_OPTS = --exec-prefix=/ --without-logger

The logger tool that comes with sysklogd is quite advanced, allowing the
user to leverage the RFC5424 `syslogp()` API to its fullest.  However,
it collides with its namesake in BusyBox, but so does the logger tool in
util-linux.  I'd very much like to see it in Buildroot, but I can submit
a patch later to add menuconfig support :)


Best regards
 /Joachim

^ permalink raw reply	[flat|nested] 15+ messages in thread

* [Buildroot] [PATCH v2 1/1] package/sysklogd: bump to version 2.1.2
  2020-12-29 18:11 ` [Buildroot] [PATCH v2 " Andreas Hilse
  2021-01-16 19:33   ` Joachim Wiberg
@ 2021-01-19 21:22   ` Thomas Petazzoni
  1 sibling, 0 replies; 15+ messages in thread
From: Thomas Petazzoni @ 2021-01-19 21:22 UTC (permalink / raw)
  To: buildroot

On Tue, 29 Dec 2020 19:11:25 +0100
Andreas Hilse via buildroot <buildroot@busybox.net> wrote:

> - fixes: sysklogd 1.6 klogd with newer glibcs: kernel messages are logged to user facility
> - sysklogd removed klogd, functionality has been moved to syslogd
> - now supports config fragments in /etc/syslog.d
> - disabled sysklogd logger to not interfere with other loggers
> - license has changed from GPL-2.0+ to BSD-3-Clause
> 
> Signed-off-by: Andreas Hilse <andreas.hilse@googlemail.com>
> 
> ---
> Changes v1 -> v2:
>   - added patch for O_CLOEXEC build failure with uClibc
>   - mention license change
>   - extended help text in Config.in

Applied to master, thanks.

Thomas
-- 
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com

^ permalink raw reply	[flat|nested] 15+ messages in thread

* [Buildroot] [PATCH v2 1/1] package/sysklogd: bump to version 2.1.2
  2021-01-16 19:33   ` Joachim Wiberg
@ 2021-01-19 21:26     ` Thomas Petazzoni
  2021-01-20 10:11       ` Andreas Hilse
  2021-01-21 12:41       ` Joachim Wiberg
  0 siblings, 2 replies; 15+ messages in thread
From: Thomas Petazzoni @ 2021-01-19 21:26 UTC (permalink / raw)
  To: buildroot

Hello Joachim,

Thanks for your additional feedback!

On Sat, 16 Jan 2021 20:33:37 +0100
Joachim Wiberg <troglobit@gmail.com> wrote:

> On Tue, Dec 29, 2020 at 19:11, Andreas Hilse via buildroot <buildroot@busybox.net> wrote:
> > - fixes: sysklogd 1.6 klogd with newer glibcs: kernel messages are logged to user facility
> > - sysklogd removed klogd, functionality has been moved to syslogd
> > - now supports config fragments in /etc/syslog.d
> > - disabled sysklogd logger to not interfere with other loggers
> > - license has changed from GPL-2.0+ to BSD-3-Clause  
> 
> These two could also be relevant:
> 
> - RFC3164 style logging, fully RFC compliant not just BSD style
> - RFC5424 style logging to file and remote log servers

Right, but the commit log mainly documents the changes that have an
impact on packaging, not necessarily all the additional (good) features
of the the new upstream release.

> > +	  The continuation of the original sysklogd package, based on
> > +	  the original Berkeley syslog daemon.  Now with kernel logging,
> > +	  and log rotation built-in.  It ca both receive from and send  
>                                            ^
> Minor, spelling.

Fixed.

> > +	  to remote syslog servers.  The v2.x series include extended
> > +	  support for RFC5424 with an alt. syslogp() API for clients.  
> [snip]
> > +sha256	09fe1edca882a9ae976cdbf516786edc1629347b9507d45dc005d9d969f94702	sysklogd-2.1.2.tar.gz
> > +sha256	7a71d7603a7c4456df441463e54da35acf151c1be0879246de63544f1f34f477	LICENSE
> > +sha256	569321607efe6ba0ecb820b3cb23d933e92f6ab50d2f8fcceb23fc8a43756ef0	0001-Define-_GNU_SOURCE_required_for_O_CLOEXEC_on_uClibc.patch  
> 
> I actually released v2.2.0 the other day, and there's a SHA256 on GitHub
> now.  This version comes with proper /dev/kmsg support on Linux, which
> support multiple consumers, instead of the old /proc/kmsg support.  If
> /dev/kmsg isn't found it falls back to the old.  It also has the build
> fix for O_CLOEXEC and another fix for an ARMv5 build warning.
> 
> I've tested it with a few Bootlin toolchains in our NetBox repo, so it
> should be a much smoother ride.

Will definitely be good to have a follow-up patch bumping to 2.2.0.

> > +SYSKLOGD_CONF_OPTS = --exec-prefix=/ --without-logger  
> 
> The logger tool that comes with sysklogd is quite advanced, allowing the
> user to leverage the RFC5424 `syslogp()` API to its fullest.  However,
> it collides with its namesake in BusyBox, but so does the logger tool in
> util-linux.  I'd very much like to see it in Buildroot, but I can submit
> a patch later to add menuconfig support :)

Patch welcome indeed!

Regarding the collision with Busybox, we do have a mechanism in place
to handle that, so it should be fine. Busybox already has the sysklogd
package in its dependencies, which means that sysklogd if enabled will
always be built before Busybox. And the Busybox installation is careful
to not overwrite any file. So if /bin/foobar has been installed by
sysklogd, even if Busybox has support for /bin/foobar, it will not
overwrite /bin/foobar with its own symlink.

Best regards,

Thomas
-- 
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com

^ permalink raw reply	[flat|nested] 15+ messages in thread

* [Buildroot] [PATCH v2 1/1] package/sysklogd: bump to version 2.1.2
  2021-01-19 21:26     ` Thomas Petazzoni
@ 2021-01-20 10:11       ` Andreas Hilse
  2021-01-20 10:38         ` Thomas Petazzoni
  2021-01-21 12:41       ` Joachim Wiberg
  1 sibling, 1 reply; 15+ messages in thread
From: Andreas Hilse @ 2021-01-20 10:11 UTC (permalink / raw)
  To: buildroot

Hello Thomas, Hello Joachim,

> > > +SYSKLOGD_CONF_OPTS = --exec-prefix=/ --without-logger
> >
> > The logger tool that comes with sysklogd is quite advanced, allowing the
> > user to leverage the RFC5424 `syslogp()` API to its fullest.  However,
> > it collides with its namesake in BusyBox, but so does the logger tool in
> > util-linux.  I'd very much like to see it in Buildroot, but I can submit
> > a patch later to add menuconfig support :)
>
> Patch welcome indeed!
>
> Regarding the collision with Busybox, we do have a mechanism in place
> to handle that, so it should be fine. Busybox already has the sysklogd
> package in its dependencies, which means that sysklogd if enabled will
> always be built before Busybox. And the Busybox installation is careful
> to not overwrite any file. So if /bin/foobar has been installed by
> sysklogd, even if Busybox has support for /bin/foobar, it will not
> overwrite /bin/foobar with its own symlink.
>

The issue I had with the logger tool is that the base dir for sysklogd
(exec-prefix) is /, thus it is placed in /bin. The busybox logger is
placed in /usr/bin so I ended up with both in my rootfs.

To make this work sysklogd exec-prefix should be /usr - which implies
additional changes in the package files.
Would this be ok?

Best regards
Andreas

^ permalink raw reply	[flat|nested] 15+ messages in thread

* [Buildroot] [PATCH v2 1/1] package/sysklogd: bump to version 2.1.2
  2021-01-20 10:11       ` Andreas Hilse
@ 2021-01-20 10:38         ` Thomas Petazzoni
  0 siblings, 0 replies; 15+ messages in thread
From: Thomas Petazzoni @ 2021-01-20 10:38 UTC (permalink / raw)
  To: buildroot

On Wed, 20 Jan 2021 11:11:30 +0100
Andreas Hilse <andreas.hilse@googlemail.com> wrote:

> The issue I had with the logger tool is that the base dir for sysklogd
> (exec-prefix) is /, thus it is placed in /bin. The busybox logger is
> placed in /usr/bin so I ended up with both in my rootfs.
> 
> To make this work sysklogd exec-prefix should be /usr - which implies
> additional changes in the package files.
> Would this be ok?

Yes, it's certainly OK to change sysklogd.mk as necessary.

Thomas
-- 
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com

^ permalink raw reply	[flat|nested] 15+ messages in thread

* [Buildroot] [PATCH v2 1/1] package/sysklogd: bump to version 2.1.2
  2021-01-19 21:26     ` Thomas Petazzoni
  2021-01-20 10:11       ` Andreas Hilse
@ 2021-01-21 12:41       ` Joachim Wiberg
  1 sibling, 0 replies; 15+ messages in thread
From: Joachim Wiberg @ 2021-01-21 12:41 UTC (permalink / raw)
  To: buildroot


Hi :)

On Tue, Jan 19, 2021 at 22:26, Thomas Petazzoni <thomas.petazzoni@bootlin.com> wrote:
> On Sat, 16 Jan 2021 20:33:37 +0100
> Joachim Wiberg <troglobit@gmail.com> wrote:
>> These two could also be relevant:
>> - RFC3164 style logging, fully RFC compliant not just BSD style
>> - RFC5424 style logging to file and remote log servers
> Right, but the commit log mainly documents the changes that have an
> impact on packaging, not necessarily all the additional (good) features
> of the the new upstream release.

Ah, of course, thank you for taking the time to explain!

>> I've tested it with a few Bootlin toolchains in our NetBox repo, so it
>> should be a much smoother ride.
> Will definitely be good to have a follow-up patch bumping to 2.2.0.

I'll get on it then :)

>> > +SYSKLOGD_CONF_OPTS = --exec-prefix=/ --without-logger  
>> The logger tool that comes with sysklogd is quite advanced, allowing the
>> user to leverage the RFC5424 `syslogp()` API to its fullest.  However,
>> it collides with its namesake in BusyBox, but so does the logger tool in
>> util-linux.  I'd very much like to see it in Buildroot, but I can submit
>> a patch later to add menuconfig support :)
> Patch welcome indeed!

Great!

> Regarding the collision with Busybox, we do have a mechanism in place
> to handle that, so it should be fine. Busybox already has the sysklogd
> package in its dependencies, which means that sysklogd if enabled will
> always be built before Busybox. And the Busybox installation is careful
> to not overwrite any file. So if /bin/foobar has been installed by
> sysklogd, even if Busybox has support for /bin/foobar, it will not
> overwrite /bin/foobar with its own symlink.

Wow, that's awesome, didn't know about that collision handling, clever!
Very cool :)

Best regards
 /Joachim

^ permalink raw reply	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2021-01-21 12:41 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-08-12 16:08 [Buildroot] [PATCH 1/1] package/sysklogd: bump to version 2.1.2 Andreas Hilse
2020-08-13  8:25 ` Thomas Petazzoni
2020-08-14  9:10   ` Andreas Hilse
2020-12-05 21:21 ` Thomas Petazzoni
2020-12-08 20:41   ` Andreas Hilse
2020-12-09  8:11     ` Thomas Petazzoni
2020-12-29 15:03     ` Andreas Hilse
2020-12-29 15:13       ` Thomas Petazzoni
2020-12-29 18:11 ` [Buildroot] [PATCH v2 " Andreas Hilse
2021-01-16 19:33   ` Joachim Wiberg
2021-01-19 21:26     ` Thomas Petazzoni
2021-01-20 10:11       ` Andreas Hilse
2021-01-20 10:38         ` Thomas Petazzoni
2021-01-21 12:41       ` Joachim Wiberg
2021-01-19 21:22   ` Thomas Petazzoni

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.