mirror of
https://github.com/troglobit/finit.git
synced 2026-10-11 17:02:42 +07:00
Instead of having to create files, and copying them in place for each test, we move all static test files to a skeleton rootfs. This makes it a lot easier to get an overview of how things and how they work. Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
25 lines
393 B
Bash
Executable File
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
|