Compare commits

...

2 commits

Author SHA1 Message Date
f
75df2530e3 tag with the program name by default
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
2022-06-04 17:40:00 -03:00
f
af44e95be9 propagate signals
send signals received by syslogize to the wrapped program.  this way we
can treat syslogize as we treated the program itself.
2022-06-04 17:38:44 -03:00

View file

@ -17,4 +17,17 @@ if test $# -eq 0 ; then
exit 1 exit 1
fi fi
$@ 2>&1 | logger ${LOGGER} LOGGER="${LOGGER:--t $1}"
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 $!