mirror of
https://github.com/Dasharo/systemd.git
synced 2026-03-06 15:02:31 -08:00
test: wait after sending a signal if necessary
On overloaded systems it might take a bit until the signal is sent, processed, and the respective file is created.
This commit is contained in:
@@ -89,17 +89,17 @@ machinectl disable long-running long-running long-running container1
|
||||
# Equivalent to machinectl kill --signal=SIGRTMIN+4 --kill-whom=leader
|
||||
rm -f /var/lib/machines/long-running/poweroff
|
||||
machinectl poweroff long-running
|
||||
test -e /var/lib/machines/long-running/poweroff
|
||||
timeout 10 sh -c "while ! test -e /var/lib/machines/long-running/poweroff; do sleep .5; done"
|
||||
machinectl poweroff long-running long-running long-running
|
||||
# Equivalent to machinectl kill --signal=SIGINT --kill-whom=leader
|
||||
rm -f /var/lib/machines/long-running/reboot
|
||||
machinectl reboot long-running
|
||||
test -e /var/lib/machines/long-running/reboot
|
||||
timeout 10 sh -c "while ! test -e /var/lib/machines/long-running/reboot; do sleep .5; done"
|
||||
machinectl reboot long-running long-running long-running
|
||||
# Skip machinectl terminate for now, as it doesn't play well with our "init"
|
||||
rm -f /var/lib/machines/long-running/trap
|
||||
machinectl kill --signal=SIGTRAP --kill-whom=leader long-running
|
||||
test -e /var/lib/machines/long-running/trap
|
||||
timeout 10 sh -c "while ! test -e /var/lib/machines/long-running/trap; do sleep .5; done"
|
||||
machinectl kill --signal=SIGTRAP --kill-whom=leader long-running long-running long-running
|
||||
# All used signals should've been caught by a handler
|
||||
[[ "$(machinectl show --property=State --value long-running)" == "running" ]]
|
||||
|
||||
Reference in New Issue
Block a user