wrappercheck.sh: add --wait-for-dbus-daemon

EDS 3.12 on Ubuntu Vivid no longer prints the message about obtaining
the D-Bus name. Instead we need to wait for it to show up on the session
bus.
This commit is contained in:
Patrick Ohly 2015-03-03 00:49:25 -08:00
parent f7b19f645e
commit f192b140eb
1 changed files with 13 additions and 0 deletions

View File

@ -20,6 +20,7 @@ trap "[ \"$PIDS\" ] && kill -INT $PIDS" INT
DAEMON_LOG=
WAIT_FOR_DAEMON_OUTPUT=
WAIT_FOR_DBUS_DAEMON=
declare -a BACKGROUND
declare -a ENV
@ -30,6 +31,10 @@ while [ $# -gt 1 ] && [ "$1" != "--" ] ; do
shift
DAEMON_LOG="$1"
;;
--wait-for-dbus-daemon)
shift
WAIT_FOR_DBUS_DAEMON="$1"
;;
--wait-for-daemon-output)
shift
WAIT_FOR_DAEMON_OUTPUT="$1"
@ -78,6 +83,14 @@ if [ "$DAEMON_LOG" ] && [ "$WAIT_FOR_DAEMON_OUTPUT" ]; then
)
fi
if [ "$WAIT_FOR_DBUS_DAEMON" ]; then
( set +x; echo >&2 "*** waiting for daemon to connect to D-Bus as '$WAIT_FOR_DBUS_DAEMON'"
while ! (dbus-send --session --print-reply --dest=org.freedesktop.DBus /org/freedesktop/DBus org.freedesktop.DBus.ListNames | grep -q "$WAIT_FOR_DBUS_DAEMON"); do
sleep 1
done
)
fi
if kill -0 $BACKGROUND_PID 2>/dev/null; then
set +e
if [ "$DAEMON_SLEEP" ]; then