Files
finit/test/common/service.sh
T
Joachim Wiberg 6f802a7ff1 test: whitespace changes only
Coding style for shell scripts:

  - Tabs for indent (change in Emacs needed)
  - Braces on their own line, like C functions

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2022-04-02 10:45:30 +02:00

25 lines
393 B
Bash
Executable File

#!/bin/sh
cleanup()
{
echo "Got signal, stopping ..."
rm -f /run/service.pid
exit 0
}
# Hook SIGUSR1 and dump trace to file system
# shellcheck disable=SC2172
trap 'echo USR1 > /tmp/usr1.log' USR1
trap cleanup INT
trap cleanup TERM
trap cleanup QUIT
trap cleanup EXIT
echo $$ > /run/service.pid
# sleep may exit on known signal, so
# we cannot use 'set -e'
while true; do
sleep 1
done