From c90ba6537424eb5dd6d97e26abf03c2e61fd26a7 Mon Sep 17 00:00:00 2001 From: f Date: Sun, 29 May 2022 21:05:05 -0300 Subject: [PATCH 1/7] alpine 3.16 --- .woodpecker.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.woodpecker.yml b/.woodpecker.yml index c0d55fe..2cbbd43 100644 --- a/.woodpecker.yml +++ b/.woodpecker.yml @@ -18,6 +18,7 @@ pipeline: event: push matrix: ALPINE_VERSION: + - 3.16.0 - 3.15.4 - 3.14.6 - 3.13.10 From e38f6a1fe67efb031c325ea87f11c0bccd09453f Mon Sep 17 00:00:00 2001 From: f Date: Sat, 4 Jun 2022 16:48:38 -0300 Subject: [PATCH 2/7] syslogize a wrapper for sending output to syslog when the program doesn't support it. if adds syslogging support to daemonize as well. --- syslogize.sh | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100755 syslogize.sh diff --git a/syslogize.sh b/syslogize.sh new file mode 100755 index 0000000..97060ff --- /dev/null +++ b/syslogize.sh @@ -0,0 +1,20 @@ +#!/bin/sh +# A wrapper for programs that can't write to syslog. Output and error +# are sent to syslog. +# +# Use LOGGER environment variable to pass options to `logger`. They'll +# probably be system-dependent, so handle with care. +# +# Usage: +# +# LOGGER="-t program" syslogize program -o -p --tions argu ments +# +# daemonize syslogize program + +if test $# -eq 0 ; then + grep "^#" $0 | grep -v /bin/sh | sed -re "s/^#\s*//" >&2 + + exit 1 +fi + +$@ 2>&1 | logger ${LOGGER} From 9f2673b4e19aa7cf11fad6021f009376f77ff968 Mon Sep 17 00:00:00 2001 From: f Date: Sat, 4 Jun 2022 16:53:04 -0300 Subject: [PATCH 3/7] daemonize requires the full path --- syslogize.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/syslogize.sh b/syslogize.sh index 97060ff..074c29f 100755 --- a/syslogize.sh +++ b/syslogize.sh @@ -9,7 +9,7 @@ # # LOGGER="-t program" syslogize program -o -p --tions argu ments # -# daemonize syslogize program +# daemonize /usr/local/bin/syslogize program if test $# -eq 0 ; then grep "^#" $0 | grep -v /bin/sh | sed -re "s/^#\s*//" >&2 From 94583cdcca610d73f979c5b5812b772fbabcf6b1 Mon Sep 17 00:00:00 2001 From: f Date: Sat, 4 Jun 2022 16:53:38 -0300 Subject: [PATCH 4/7] add to container --- Dockerfile | 1 + 1 file changed, 1 insertion(+) diff --git a/Dockerfile b/Dockerfile index dbcab97..138b508 100644 --- a/Dockerfile +++ b/Dockerfile @@ -34,6 +34,7 @@ RUN install -dm 2750 -o root -g root /var/lib/monit COPY --from=build /etc/monitrc /etc/monitrc COPY ./nsupdate.sh /usr/local/bin/nsupdate COPY ./whatsmyip6.sh /usr/local/bin/whatsmyip6 +COPY ./syslogize.sh /usr/local/bin/syslogize COPY ./zeroconf.sh /usr/local/bin/zeroconf COPY ./zeroconf.conf /etc/zeroconf.conf From af44e95be9f717df60458206dba51a369f10883d Mon Sep 17 00:00:00 2001 From: f Date: Sat, 4 Jun 2022 17:38:44 -0300 Subject: [PATCH 5/7] propagate signals send signals received by syslogize to the wrapped program. this way we can treat syslogize as we treated the program itself. --- syslogize.sh | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/syslogize.sh b/syslogize.sh index 074c29f..21f28fe 100755 --- a/syslogize.sh +++ b/syslogize.sh @@ -17,4 +17,15 @@ if test $# -eq 0 ; then exit 1 fi -$@ 2>&1 | logger ${LOGGER} +propagate_signal () { + logger ${LOGGER} "Received $1 signal" + jobs -p | xargs kill -$1 +} + +for signal in HUP INT QUIT USR1 USR2 TERM; do + trap "propagate_signal ${signal}" ${signal} +done + +$@ 2>&1 | logger ${LOGGER} & + +wait $! From 75df2530e34fa47cc3ca7141ade909e9082eb030 Mon Sep 17 00:00:00 2001 From: f Date: Sat, 4 Jun 2022 17:40:00 -0300 Subject: [PATCH 6/7] tag with the program name by default --- syslogize.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/syslogize.sh b/syslogize.sh index 21f28fe..aa4cfdf 100755 --- a/syslogize.sh +++ b/syslogize.sh @@ -17,6 +17,8 @@ if test $# -eq 0 ; then exit 1 fi +LOGGER="${LOGGER:--t $1}" + propagate_signal () { logger ${LOGGER} "Received $1 signal" jobs -p | xargs kill -$1 From 08209d764d1298dc457a81ce421cb8b5a248f79e Mon Sep 17 00:00:00 2001 From: f Date: Sat, 9 Jul 2022 23:17:04 -0300 Subject: [PATCH 7/7] alpine 3.16 --- .woodpecker.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.woodpecker.yml b/.woodpecker.yml index b02757c..567b6d1 100644 --- a/.woodpecker.yml +++ b/.woodpecker.yml @@ -30,3 +30,6 @@ matrix: - ALPINE_VERSION: 3.15.4 RUBY_VERSION: 3.0 RUBY_PATCH: 4 + - ALPINE_VERSION: 3.16.0 + RUBY_VERSION: 3.1 + RUBY_PATCH: 2