Files
mgmt/test/shell/graph-exit1.sh
Karpfen 7e8ced534f misc: Use /usr/bin/env for a more generic shebang
Use path based SHELL in Makefiles. It was suggested that this is a
better solution for make for cases when there is no /usr/bin/env.

See: https://github.com/purpleidea/mgmt/pull/694#discussion_r1015596204
2025-03-22 14:53:21 -04:00

15 lines
570 B
Bash
Executable File

#!/usr/bin/env -S bash -e
. "$(dirname "$0")/../util.sh"
# should take 15 seconds for longest resources plus startup time to shutdown
# we don't want the ^C to allow the rest of the graph to continue executing!
# this is a test of mgmt exiting quickly via a fast pause after it sees a ^C
$TIMEOUT "$MGMT" run --no-watch --no-pgp --tmp-prefix lang graph-exit1.mcl &
pid=$!
sleep 5s # let the initial resources start to run...
killall -SIGINT mgmt # send ^C to exit mgmt
killall -SIGINT mgmt # send a second ^C to activate fast pause
wait $pid # get exit status
exit $?