File: lifecycle

package info (click to toggle)
systemd-shim 10-3
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 344 kB
  • ctags: 275
  • sloc: ansic: 1,981; sh: 154; makefile: 62
file content (40 lines) | stat: -rwxr-xr-x 1,080 bytes parent folder | download
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
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
#!/bin/sh
# Check D-BUS activation and 10 s inactivity timeout
# Author: Martin Pitt <martin.pitt@ubuntu.com>
set -eux

if [ -d /run/systemd/system ]; then
    if [ ! -x /tmp/autopkgtest-reboot ]; then
        echo "SKIP: testbed does not support reboot"
        exit 0
    fi
    if [ -n "${ADT_REBOOT_MARK:-}" ]; then
        echo "SKIP: Reboot with sysvinit-core still runs systemd; using init= ?"
        exit 0
    fi
    echo "Installing sysvinit-core..."
    apt-get install -y sysvinit-core
    echo "Rebooting into SysV init..."
    /tmp/autopkgtest-reboot b1
fi

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