Compare commits
2 commits
94583cdcca
...
75df2530e3
Author | SHA1 | Date | |
---|---|---|---|
|
75df2530e3 | ||
|
af44e95be9 |
1 changed files with 14 additions and 1 deletions
15
syslogize.sh
15
syslogize.sh
|
@ -17,4 +17,17 @@ if test $# -eq 0 ; then
|
|||
exit 1
|
||||
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 $!
|
||||
|
|
Loading…
Reference in a new issue