mirror of
https://github.com/troglobit/finit.git
synced 2026-10-17 10:49:34 +00:00
This change makes it possible to use the standard continuation character
in .conf files. For example:
service [23456] \
log:stderr \
<!pid/foo> \
bar \
-- This is the bar service, it depends on foo # comment that's dropped
Notice the additional support for comments on .conf lines. If you use
the comment character today you must change to escape it. Like this:
service :2 foo -- Foo \#2
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
42 lines
865 B
Bash
Executable File
42 lines
865 B
Bash
Executable File
#!/bin/sh
|
|
# Verifies initctl can send arbitrary signals (USR1 in this case) to finit managed services
|
|
|
|
set -eu
|
|
|
|
TEST_DIR=$(dirname "$0")
|
|
|
|
# shellcheck source=/dev/null
|
|
. "$TEST_DIR/tenv/lib.sh"
|
|
|
|
test_teardown()
|
|
{
|
|
say "Test done $(date)"
|
|
say "Running test teardown."
|
|
|
|
texec rm -f "$FINIT_CONF"
|
|
}
|
|
|
|
say "Test start $(date)"
|
|
|
|
say 'Ensure file system is cleared'
|
|
run "rm -f /tmp/usr1.log"
|
|
|
|
# Verifies line continuation as well
|
|
say "Add service stanza in $FINIT_CONF"
|
|
run "echo 'service [2345] kill:20 \\
|
|
log service.sh \\
|
|
-- Test service' > $FINIT_CONF"
|
|
run "cat $FINIT_CONF"
|
|
#run "initctl debug"
|
|
|
|
say 'Reload Finit'
|
|
run "initctl reload"
|
|
|
|
#run "initctl status service.sh"
|
|
|
|
say 'Send SIGUSR1 to service...'
|
|
run "initctl signal service.sh SIGUSR1"
|
|
|
|
# shellcheck disable=SC2016
|
|
retry 'assert "service.sh received SIGUSR" "$(texec cat /tmp/usr1.log)" = "USR1"' 10 1
|