package/sysklogd: version bump, some fixes, and more menuconfig
cover package/sysklogd: version bump, some fixes, and more menuconfig
Hi!
This series bumps sysklogd to the latest version, fixes an issue with fetching from GitHub (release tarballs exist), and finally adds some menuconfig options enabling the native logger tool and controlling the back-off time for unreachable remote syslog servers.
Cheers
/Joachim
Joachim Wiberg (3):
package/sysklogd: bump to verson 2.2.0
package/sysklogd: add menuconfig support for enabling native logger package/sysklogd: menuconfig support for remote syslog retry delay
...RCE_required_for_O_CLOEXEC_on_uClibc.patch | 44 ------------------- package/sysklogd/Config.in | 30 +++++++++++++ package/sysklogd/sysklogd.hash | 2 +- package/sysklogd/sysklogd.mk | 12 ++--- package/sysklogd/syslogd.service | 3 +- 5 files changed, 40 insertions(+), 51 deletions(-) delete mode 100644 package/sysklogd/0001-Define-_GNU_SOURCE_required_for_O_CLOEXEC_on_uClibc.patch
Signature · 1 line
2.25.1
PATCH 1/3 package/sysklogd: bump to verson 2.2.0
- Prefer maintainer provided package, not GitHub generated archive
- Local backport of O_CLOEXEC patch not needed anymore, in v2.2.0
- Install to /usr, with config in /etc and logs in /var
- Update systemd unit file
- New daemon path, /usr/sbin
- Add support for /etc/default/syslogd, same as SysV init script
--- ...RCE_required_for_O_CLOEXEC_on_uClibc.patch | 44 ------------------- package/sysklogd/sysklogd.hash | 2 +- package/sysklogd/sysklogd.mk | 8 ++-- package/sysklogd/syslogd.service | 3 +- 4 files changed, 6 insertions(+), 51 deletions(-) delete mode 100644 package/sysklogd/0001-Define-_GNU_SOURCE_required_for_O_CLOEXEC_on_uClibc.patch
package/sysklogd/0001-Define-_GNU_SOURCE_required_for_O_CLOEXEC_on_uClibc.patch deleted +0 -44
@@ -1,44 +0,0 @@ -From 93117e58016de6f604e67263b5135adbba032367 Mon Sep 17 00:00:00 2001 -From: Joachim Wiberg <[email protected]> -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 <[email protected]> -Signed-off-by: Andreas Hilse <[email protected]> ---- - 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
package/sysklogd/sysklogd.hash +1 -1
@@ -1,3 +1,3 @@ # Locally calculated -sha256 09fe1edca882a9ae976cdbf516786edc1629347b9507d45dc005d9d969f94702 sysklogd-2.1.2.tar.gz +sha256 60546ae50a9f30b31c19ed9a3ad788ce5798025b0f9a0d552c1a04d5eeac494d sysklogd-2.2.0.tar.gz sha256 7a71d7603a7c4456df441463e54da35acf151c1be0879246de63544f1f34f477 LICENSE
package/sysklogd/sysklogd.mk +3 -5
@@ -4,14 +4,12 @@ # ################################################################################ -SYSKLOGD_VERSION = 2.1.2 -SYSKLOGD_SITE = $(call github,troglobit,sysklogd,v$(SYSKLOGD_VERSION)) +SYSKLOGD_VERSION = 2.2.0 +SYSKLOGD_SITE = https://github.com/troglobit/sysklogd/releases/download/v$(SYSKLOGD_VERSION) SYSKLOGD_LICENSE = BSD-3-Clause SYSKLOGD_LICENSE_FILES = LICENSE SYSKLOGD_CPE_ID_VALID = YES -# From git -SYSKLOGD_AUTORECONF = YES -SYSKLOGD_CONF_OPTS = --exec-prefix=/ --without-logger +SYSKLOGD_CONF_OPTS = --prefix=/usr --sysconfdir=/etc --localstatedir=/var define SYSKLOGD_INSTALL_SAMPLE_CONFIG $(INSTALL) -D -m 0644 package/sysklogd/syslog.conf \
package/sysklogd/syslogd.service +2 -1
@@ -3,7 +3,8 @@ Description=System Logging Service Requires=syslog.socket [Service] -ExecStart=/sbin/syslogd -m 0 -F +EnvironmentFile=-/etc/default/syslogd +ExecStart=/usr/sbin/syslogd -m 0 -F $SYSLOGD_ARGS StandardOutput=null Restart=on-failure
Signature · 1 line
2.25.1
Yann E. MORIN
AppliedPATCH 1/3 package/sysklogd: bump to verson 2.2.0
Joachim, All,
On 2021-01-22 16:43 +0100, Joachim Wiberg spake thusly:
Quoted 6 lines
- Prefer maintainer provided package, not GitHub generated archive
- Local backport ofO_CLOEXECpatch not needed anymore, in v2.2.0
- Install to /usr, with config in /etc and logs in /var
- Update systemd unit file
- New daemon path,/usr/sbin
- Add support for/etc/default/syslogd, same as SysV init script
This patch does four different things;
1. bumps the version, switching to maintainer's archive
2. removes the --without-logger configure option
3. changes the ./configure options for prefix et al. (more on that later)
4. extends the systemd service unit to include the environment
This should have been four patches.
However, as already discussed in a review for mrouted, the --prefix, --sysconfdir, and --localstatedir are already the value passed by the autotools-package infra, so aer not needed. But wy do you want to switch the logger from / to /usr ?
See commit 33642d8d959 (package/sysklogd: fix installation path of the daemons), where the installation path was changed:
1. to match the paths tht are used in the init scripts
2. to match the location where busybox would install its applet
So your patch breaks that, because it does not update the two init scripts, and will let busybox install its applet in /sbin.
Granted, there should have been a comment above the _CONF_OPTS line to explain that was intentional.
Finally, why is the --without-logger option removed entirely in this patch, when your patch 2 makes it a configurable option?
I've applied the version bump and the systemd stuff as two separate patches, and dropped the rest.
Applied to master, thanks.
Regards,
Yann E. MORIN.
Quoted 111 lines
Signed-off-by Joachim Wiberg <[email protected]>--- ...RCE_required_for_O_CLOEXEC_on_uClibc.patch | 44 ------------------- package/sysklogd/sysklogd.hash | 2 +- package/sysklogd/sysklogd.mk | 8 ++-- package/sysklogd/syslogd.service | 3 +- 4 files changed, 6 insertions(+), 51 deletions(-) delete mode 100644 package/sysklogd/0001-Define-_GNU_SOURCE_required_for_O_CLOEXEC_on_uClibc.patchpackage/sysklogd/0001-Define-_GNU_SOURCE_required_for_O_CLOEXEC_on_uClibc.patch deleted +0
-44@@ -1,44 +0,0 @@ -From 93117e58016de6f604e67263b5135adbba032367 Mon Sep 17 00:00:00 2001 -From: Joachim Wiberg <[email protected]> -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 <[email protected]> -Signed-off-by: Andreas Hilse <[email protected]> ---- - 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.hpackage/sysklogd/sysklogd.hash +1
-1@@ -1,3 +1,3 @@ # Locally calculated -sha256 09fe1edca882a9ae976cdbf516786edc1629347b9507d45dc005d9d969f94702 sysklogd-2.1.2.tar.gz +sha256 60546ae50a9f30b31c19ed9a3ad788ce5798025b0f9a0d552c1a04d5eeac494d sysklogd-2.2.0.tar.gz sha256 7a71d7603a7c4456df441463e54da35acf151c1be0879246de63544f1f34f477 LICENSEpackage/sysklogd/sysklogd.mk +3
-5@@ -4,14 +4,12 @@ # ################################################################################ -SYSKLOGD_VERSION = 2.1.2 -SYSKLOGD_SITE = $(call github,troglobit,sysklogd,v$(SYSKLOGD_VERSION)) +SYSKLOGD_VERSION = 2.2.0 +SYSKLOGD_SITE = https://github.com/troglobit/sysklogd/releases/download/v$(SYSKLOGD_VERSION) SYSKLOGD_LICENSE = BSD-3-Clause SYSKLOGD_LICENSE_FILES = LICENSE SYSKLOGD_CPE_ID_VALID = YES -# From git -SYSKLOGD_AUTORECONF = YES -SYSKLOGD_CONF_OPTS = --exec-prefix=/ --without-logger +SYSKLOGD_CONF_OPTS = --prefix=/usr --sysconfdir=/etc --localstatedir=/var define SYSKLOGD_INSTALL_SAMPLE_CONFIG $(INSTALL) -D -m 0644 package/sysklogd/syslog.conf \package/sysklogd/syslogd.service +2
-1@@ -3,7 +3,8 @@ Description=System Logging Service Requires=syslog.socket [Service] -ExecStart=/sbin/syslogd -m 0 -F +EnvironmentFile=-/etc/default/syslogd +ExecStart=/usr/sbin/syslogd -m 0 -F $SYSLOGD_ARGS StandardOutput=null Restart=on-failureSignature · 6 lines
2.25.1 _______________________________________________ buildroot mailing list buildroot at busybox.net http://lists.busybox.net/mailman/listinfo/buildroot
Signature · 6 lines
.-----------------.--------------------.------------------.--------------------. | Yann E. MORIN | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: | | +33 662 376 056 | Software Designer | \ / CAMPAIGN | ___ | | +33 561 099 427 `------------.-------: X AGAINST | \e/ There is no | | http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL | v conspiracy. | '------------------------------^-------^------------------^--------------------'
PATCH 1/3 package/sysklogd: bump to verson 2.2.0
Hi Yann,
Quoted 7 lines · Yann E. MORIN
On 2021-01-22 16:43 +0100, Joachim Wiberg spake thusly:
This patch does four different things;
1. bumps the version, switching to maintainer's archive
2. removes the --without-logger configure option
3. changes the ./configure options for prefix et al. (more on that later)
4. extends the systemd service unit to include the environment
This should have been four patches.
Aha, splitting it up even furhter makes sense, thank you!
Quoted 4 lines
However, as already discussed in a review for mrouted, the --prefix, --sysconfdir, and --localstatedir are already the value passed by the autotools-package infra, so aer not needed. But wy do you want to switch the logger from / to /usr ?
Possibly I got confused by /sbin vs /usr/sbin for system daemons/tools, in particular with BR2_ROOTFS_MERGED_USR. I went about it backwards and thought it applied to all non-BusyBox tools. Sorry about that.
I realize now that I was completely wrong and for tools/daemons that replece functionality that BusyBox provides the package must install each tool and daemon to the BusyBox path.
I apologize for the confusion and head scratching this has caused!
Quoted 6 lines
See commit
33642d8d959(package/sysklogd: fix installation path of the daemons), where the installation path was changed:
1. to match the paths tht are used in the init scripts
2. to match the location where busybox would install its applet
So your patch breaks that, because it does not update the two init scripts, and will let busybox install its applet in /sbin.
I see, for past sysklogd that worked. Now we provide the logger tool as well, and --exec-prefix=/ changes to /bin/logger and /sbin/syslogd. Since BusyBox logger is in /usr/bin, I believe we need to change the SYSKLOGD_CONF_OPTS to use --bindir and --sbindir instead.
I'll post another patch shortly.
Quoted 2 lines
Granted, there should have been a comment above the
_CONF_OPTSline to explain that was intentional.
I understand. Thank yhou for explaining.
Quoted 2 lines
Finally, why is the --without-logger option removed entirely in this patch, when your patch 2 makes it a configurable option?
Yes, that was sloppy.
Quoted 2 lines
I've applied the version bump and the systemd stuff as two separate patches, and dropped the rest.
It looks great!
Best regards
/Joachim
PATCH 1/3 package/sysklogd: bump to verson 2.2.0
Joachim, All
On 2021-01-24 16:22 +0100, Joachim Wiberg spake thusly:
Quoted 1 line
I apologize for the confusion and head scratching this has caused!
No need for an apology ;-)
Quoted 3 lines
I see, for past sysklogd that worked. Now we provide the logger tool as well, and --exec-prefix=/ changes to
/bin/loggerand/sbin/syslogd. Since BusyBox logger is in/usr/bin,
Ah, this is the kind of explanations that should go in a commit message!
Indeed, a commit message that just describes the changes is not very helpful. What is important in a commit message is to explain what the problem is and why the change fixes it.
Quoted 3 lines
I believe we need to change the
SYSKLOGD_CONF_OPTSto use --bindir and --sbindir instead. I'll post another patch shortly.
Thanks! :-)
Regards,
Yann E. MORIN.
Signature · 6 lines
.-----------------.--------------------.------------------.--------------------. | Yann E. MORIN | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: | | +33 662 376 056 | Software Designer | \ / CAMPAIGN | ___ | | +33 561 099 427 `------------.-------: X AGAINST | \e/ There is no | | http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL | v conspiracy. | '------------------------------^-------^------------------^--------------------'
PATCH 1/3 package/sysklogd: bump to verson 2.2.0
Hi Yann!
Quoted 3 lines · Yann E. MORIN
On 2021-01-24 16:22 +0100, Joachim Wiberg spake thusly:
Quoted 1 line
I apologize for the confusion and head scratching this has caused!
No need for an apology ;-)
You're too kind :)
Quoted 4 lines
Quoted 3 lines
I see, for past sysklogd that worked. Now we provide the logger tool as well, and --exec-prefix=/ changes to
/bin/loggerand/sbin/syslogd. Since BusyBox logger is in/usr/bin,Ah, this is the kind of explanations that should go in a commit message!
Yup
Quoted 3 lines
Indeed, a commit message that just describes the changes is not very helpful. What is important in a commit message is to explain what the problem is and why the change fixes it.
This is exactly what I'm preaching to our junior devs (sometimes on a daily basis) at $DAYJOB. So it's a painful realization that when push comes to shove, I'm no better myself LOL :-)
Best regards
/Joachim
PATCH 2/3 package/sysklogd: add menuconfig support for enabling native logger
In reply to Joachim WibergInstalls to /usr/bin and thus replaces the BusyBox logger if enabled.
--- package/sysklogd/Config.in | 17 +++++++++++++++++ package/sysklogd/sysklogd.mk | 4 ++++ 2 files changed, 21 insertions(+)
package/sysklogd/Config.in +17 -0
@@ -13,7 +13,24 @@ config BR2_PACKAGE_SYSKLOGD https://github.com/troglobit/sysklogd/ +if BR2_PACKAGE_SYSKLOGD + +config BR2_PACKAGE_SYSKLOGD_LOGGER + bool "logger tool" + help + Generate log messages from scripts or from the command line. + + This version of logger is receommended for use with sysklogd. + It makes use of the new syslogp() API for RFC5424 style logs, + e.g. MSGID, strucutred data (SD), etc. + + The BusyBox, or util-linux, logger tools can also be used, but + are limited to RFC3164 style messages. + +endif + comment "sysklogd needs a toolchain w/ threads" depends on BR2_USE_MMU depends on !BR2_TOOLCHAIN_HAS_THREADS depends on BR2_PACKAGE_BUSYBOX_SHOW_OTHERS +
package/sysklogd/sysklogd.mk +4 -0
@@ -11,6 +11,10 @@ SYSKLOGD_LICENSE_FILES = LICENSE SYSKLOGD_CPE_ID_VALID = YES SYSKLOGD_CONF_OPTS = --prefix=/usr --sysconfdir=/etc --localstatedir=/var +# Disable/Enable utilities +SYSKLOGD_CONF_OPTS += \ + $(if $(BR2_PACKAGE_SYSKLOGD_LOGGER),--with-logger,--without-logger) + define SYSKLOGD_INSTALL_SAMPLE_CONFIG $(INSTALL) -D -m 0644 package/sysklogd/syslog.conf \ $(TARGET_DIR)/etc/syslog.conf
Signature · 1 line
2.25.1
PATCH 3/3 package/sysklogd: menuconfig support for remote syslog retry delay
In reply to Joachim Wiberg--- package/sysklogd/Config.in | 13 +++++++++++++ package/sysklogd/sysklogd.mk | 2 +- 2 files changed, 14 insertions(+), 1 deletion(-)
package/sysklogd/Config.in +13 -0
@@ -15,6 +15,19 @@ config BR2_PACKAGE_SYSKLOGD if BR2_PACKAGE_SYSKLOGD +config BR2_PACKAGE_SYSKLOGD_REMOTE_DELAY + int "Retry delay (sec)" + default "180" + help + Retry delay (seconds) for sending to remote syslog servers. + + When set up to forward logs to a remote syslog server, the + network may not always be available. E.g., default interface + down, or no route to the remote server. This setting controls + the back-off time before retrying. + + Default: 180 seconds + config BR2_PACKAGE_SYSKLOGD_LOGGER bool "logger tool" help
package/sysklogd/sysklogd.mk +1 -1
@@ -12,7 +12,7 @@ SYSKLOGD_CPE_ID_VALID = YES SYSKLOGD_CONF_OPTS = --prefix=/usr --sysconfdir=/etc --localstatedir=/var # Disable/Enable utilities -SYSKLOGD_CONF_OPTS += \ +SYSKLOGD_CONF_OPTS += --with-suspend-time=$(BR2_PACKAGE_SYSKLOGD_REMOTE_DELAY) \ $(if $(BR2_PACKAGE_SYSKLOGD_LOGGER),--with-logger,--without-logger) define SYSKLOGD_INSTALL_SAMPLE_CONFIG
Signature · 1 line
2.25.1
cover package/sysklogd: version bump, some fixes, and more menuconfig
In reply to Joachim WibergJoachim, All,
On 2021-01-22 16:43 +0100, Joachim Wiberg spake thusly:
Quoted 7 lines
Hi!
This series bumps sysklogd to the latest version, fixes an issue with fetching from GitHub (release tarballs exist), and finally adds some menuconfig options enabling the native logger tool and controlling the back-off time for unreachable remote syslog servers.
Quoted 7 lines
Cheers
/JoachimJoachim Wiberg (3):
package/sysklogd: bump to verson 2.2.0
package/sysklogd: add menuconfig support for enabling native logger package/sysklogd: menuconfig support for remote syslog retry delay
All three patches applied to master, thanks.
Please review my comments and rework on patch 1. I also slightly reworked patch 2 to use the more traditional ifew-else-endif block rather than the $(if) construct.
Thanks!
Regards,
Yann E. MORIN.
Quoted 15 lines
...RCE_required_for_O_CLOEXEC_on_uClibc.patch | 44 ------------------- package/sysklogd/Config.in | 30 +++++++++++++ package/sysklogd/sysklogd.hash | 2 +- package/sysklogd/sysklogd.mk | 12 ++--- package/sysklogd/syslogd.service | 3 +- 5 files changed, 40 insertions(+), 51 deletions(-) delete mode 100644 package/sysklogd/0001-Define-_GNU_SOURCE_required_for_O_CLOEXEC_on_uClibc.patchSignature · 6 lines
2.25.1 _______________________________________________ buildroot mailing list buildroot at busybox.net http://lists.busybox.net/mailman/listinfo/buildroot
Signature · 6 lines
.-----------------.--------------------.------------------.--------------------. | Yann E. MORIN | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: | | +33 662 376 056 | Software Designer | \ / CAMPAIGN | ___ | | +33 561 099 427 `------------.-------: X AGAINST | \e/ There is no | | http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL | v conspiracy. | '------------------------------^-------^------------------^--------------------'
cover package/sysklogd: version bump, some fixes, and more menuconfig
Quoted 8 lines · Yann E. MORIN
On 2021-01-22 16:43 +0100, Joachim Wiberg spake thusly:
Quoted 3 lines
package/sysklogd: bump to verson 2.2.0
package/sysklogd: add menuconfig support for enabling native logger package/sysklogd: menuconfig support for remote syslog retry delayAll three patches applied to master, thanks.
Please review my comments and rework on patch 1. I also slightly reworked patch 2 to use the more traditional ifew-else-endif block rather than the $(if) construct.
Looks good, much better with your rework. Only issue, as I mentioned in the previous thread, is the install path for the logger tool, which I'm posting another patch for.
Thank you! :)
Regards
/Joachim