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