1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
|
#!/bin/sh
# Check D-BUS activation and 10 s inactivity timeout
# Author: Martin Pitt <martin.pitt@ubuntu.com>
set -eux
CALL_MGR="gdbus call -y -d org.freedesktop.systemd1 -o /org/freedesktop/systemd1 -m org.freedesktop.systemd1.Manager"
# ensure it is not running
killall systemd-shim || true
# activate it
${CALL_MGR}.Reload
# should be running now
PID=`pidof systemd-shim`
[ -n "$PID" ]
# should still be running with the same pid after 5 s
sleep 5
[ "`pidof systemd-shim`" = "$PID" ]
# should time out after 10 s, so wait another 7
sleep 7
pidof systemd-shim && { echo "FAIL: not timing out after 10s"; exit 1; }
true
|