Blame SOURCES/dbus-kill-process-with-session

a0d93f
#!/bin/bash
a0d93f
# This script ensures the dbus-daemon is killed when the session closes.
a0d93f
# It's used by SSH sessions that have X forwarding (since the X display
a0d93f
# may outlive the session in those cases)
a0d93f
[ $# != 1 ] && exit 1
a0d93f
a0d93f
exec >& /dev/null
a0d93f
a0d93f
trap "kill -TERM $1" EXIT
a0d93f
a0d93f
export GVFS_DISABLE_FUSE=1
a0d93f
coproc SESSION_MONITOR (gio monitor -f "/run/systemd/sessions/${XDG_SESSION_ID}")
a0d93f
a0d93f
while grep -q ^State=active <(loginctl show-session $XDG_SESSION_ID)
a0d93f
do
a0d93f
    read -u ${SESSION_MONITOR[0]}
a0d93f
done