dumb-init/tests/lib/print-signals
2015-09-03 15:53:14 -07:00

20 lines
441 B
Bash
Executable file

#!/bin/sh -eux
# XXX: We use /bin/sh instead of /bin/bash since some old versions of bash
# exhibit an issue where they seem to receive the same signal twice.
# With /bin/sh, this does not seem to happen.
# Print received signals into a file, one per line
file="$1"
. ./lib/testlib.sh
for i in $(catchable_signals); do
trap "echo $i > \"$file\"" "$i"
done
echo 'ready' > "$file"
echo 'loop forever...'
set +x
while :; do true; done