parent
9a5b56c1d0
commit
7cd39d230c
@ -0,0 +1,17 @@
|
||||
#!/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
|
||||
|
||||
trap "kill -TERM $1" EXIT
|
||||
|
||||
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
|
@ -1,7 +1,12 @@
|
||||
# DBus session bus over SSH with X11 forwarding
|
||||
[ -z "$SSH_CONNECTION" ] && return
|
||||
[ -z "$DISPLAY" ] && return
|
||||
[ "$SHLVL" -gt 1 ] && return
|
||||
[ "${DISPLAY:0:1}" = ":" ] && return
|
||||
[ "$SHLVL" -ne 1 ] && return
|
||||
|
||||
GDK_BACKEND=x11; export GDK_BACKEND
|
||||
eval $(dbus-launch --sh-syntax --exit-with-x11)
|
||||
export GDK_BACKEND=x11
|
||||
|
||||
eval `dbus-launch --sh-syntax`
|
||||
|
||||
[ -z "$DBUS_SESSION_BUS_PID" ] && return
|
||||
setsid -f /usr/libexec/dbus-1/dbus-kill-process-with-session "$DBUS_SESSION_BUS_PID"
|
||||
|
Loading…
Reference in New Issue