testing: create XDG_RUNTIME_DIR in dbus-session.sh
More recent distros (for example, Ubuntu Saucy) rely on XDG_RUNTIME_DIR. Each time dbus-session.sh runs, it must ensure that the runtime dir exists and is empty. Not doing so may have caused random concurrency issues in parallel nightly testing. It also was a problem when trying to run activesyncd + SyncEvolution on a headless Ubuntu Saucy server (see FDO #76273).
This commit is contained in:
parent
07d7a9f306
commit
7df500d509
|
@ -3,8 +3,12 @@
|
|||
# Wrapper script which starts a new D-Bus session before
|
||||
# running a program and kills the D-Bus daemon when done.
|
||||
|
||||
unset DBUS_SESSION_BUS_ADDRESS DBUS_SESSION_BUS_PID XDG_RUNTIME_DIR
|
||||
|
||||
# Ensure that we have a unique, empty XDG_RUNTIME_DIR.
|
||||
export XDG_RUNTIME_DIR=`mktemp -d`
|
||||
|
||||
# start D-Bus session
|
||||
unset DBUS_SESSION_BUS_ADDRESS DBUS_SESSION_BUS_PID
|
||||
eval `dbus-launch`
|
||||
export DBUS_SESSION_BUS_ADDRESS
|
||||
|
||||
|
@ -43,6 +47,7 @@ atexit() {
|
|||
[ ! "$KEYRING_PID" ] || ( echo >&2 "dbus-session.sh $$: killing keyring pid $KEYRING_PID"; kill -9 $KEYRING_PID )
|
||||
[ ! "$DBUS_SESSION_SH_SYSTEM_BUS" ] || [ ! "$DBUS_SYSTEM_BUS_PID" ] || ( echo >&2 "dbus-session.sh $$: killing system bus daemon $DBUS_SYSTEM_BUS_PID"; kill -9 $DBUS_SYSTEM_BUS_PID )
|
||||
[ ! "$DBUS_SESSION_BUS_PID" ] || ( echo >&2 "dbus-session.sh $$: killing session bus daemon $DBUS_SESSION_BUS_PID"; kill -9 $DBUS_SESSION_BUS_PID )
|
||||
[ ! "$XDG_RUNTIME_DIR" ] || ( echo >&2 "dbus-session.sh $$: removing XDG_RUNTIME_DIR=$XDG_RUNTIME_DIR"; rm -rf $XDG_RUNTIME_DIR )
|
||||
}
|
||||
trap atexit EXIT
|
||||
|
||||
|
|
Loading…
Reference in a new issue