package/sysklogd: bump to version 2.1.2
authorAndreas Hilse <andreas.hilse@googlemail.com>
Tue, 29 Dec 2020 18:11:25 +0000 (19:11 +0100)
committerThomas Petazzoni <thomas.petazzoni@bootlin.com>
Tue, 19 Jan 2021 21:21:25 +0000 (22:21 +0100)
- 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>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
package/sysklogd/0001-Define-_GNU_SOURCE_required_for_O_CLOEXEC_on_uClibc.patch [new file with mode: 0644]
package/sysklogd/Config.in
package/sysklogd/S02klogd [deleted file]
package/sysklogd/klogd.service [deleted file]
package/sysklogd/sysklogd.hash
package/sysklogd/sysklogd.mk
package/sysklogd/syslog.conf
package/sysklogd/syslogd.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 (file)
index 0000000..684b6b3
--- /dev/null
@@ -0,0 +1,44 @@
+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>
+Signed-off-by: Andreas Hilse <andreas.hilse@googlemail.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
index fda58e020ec9c6293a527ba477ec6e240876c83a..18aff091c0b66e23d602fb4a735a23d088e3c972 100644 (file)
@@ -1,8 +1,13 @@
 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 can 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 (file)
index ba728aa..0000000
+++ /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 (file)
index b5dbb93..0000000
+++ /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
index 6f7ab6ece81d714bf74c5229fa778c925722126b..9f9fd192e1e47c57b007fc3575976df6329997d1 100644 (file)
@@ -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
index 7a25d0eb6f49556ba0d793fafc6074fb627073f2..cd013f658c39d7406c2f10c8863efd348f67ffa1 100644 (file)
@@ -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))
index 318413905261963db1cdffcbe2dab3eb7f0de226..411bd645ff84aca9689b839600d3535cc9726a4f 100644 (file)
@@ -5,3 +5,5 @@ auth,authpriv.*         /var/log/auth.log
 user.*                 /var/log/user.log
 
 *.emerg                        *
+
+include /etc/syslog.d/*.conf
index adaac679f28fed308d133657162a82f75e7abdaa..1bf1bb3bd92a9f2261e6aede2de89ffafb150a4a 100644 (file)
@@ -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