2015-09-04 01:53:14 +03:00
|
|
|
#!/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.
|
|
|
|
|
2015-08-05 20:56:55 +03:00
|
|
|
# Print received signals into a file, one per line
|
|
|
|
file="$1"
|
|
|
|
|
2015-08-07 00:24:27 +03:00
|
|
|
. ./lib/testlib.sh
|
2015-08-05 20:56:55 +03:00
|
|
|
|
|
|
|
for i in $(catchable_signals); do
|
2015-08-10 19:32:56 +03:00
|
|
|
trap "echo $i > \"$file\"" "$i"
|
2015-08-05 20:56:55 +03:00
|
|
|
done
|
|
|
|
|
|
|
|
echo 'ready' > "$file"
|
|
|
|
|
2015-08-12 00:31:08 +03:00
|
|
|
echo 'loop forever...'
|
|
|
|
set +x
|
2015-08-05 20:56:55 +03:00
|
|
|
while :; do true; done
|