mirror of
https://github.com/troglobit/finit.git
synced 2026-10-15 10:29:35 +00:00
Test case for initctl signal
This commit implements a test for the signal feature of initctl. The existing service used in tests (`common/service.sh`) has been extended with a signal trap handler. When SIGUSR1 is received, it will write the string `'USR1'` to `/tmp/usr1.log`. The test will run `initctl signal service.sh SIGUSR1` and assert that the contents of the file `/tmp/usr1.log` really is `USR1`.
This commit is contained in:
1 parent
4121113688
commit
beec0ee590
3 files changed
+42
No files matched your search
@@ -2,6 +2,10 @@
|
||||
|
||||
set -eu
|
||||
|
||||
# Hook SIGUSR1 and dump trace to file system
|
||||
# shellcheck disable=SC2172
|
||||
trap 'echo USR1 > /tmp/usr1.log' 10
|
||||
|
||||
echo $$ > /run/service.pid
|
||||
|
||||
while true; do
|
||||
|
||||
Reference in new issue
Block a user