# Mount in the client session, if logged in.
for LDM_SOCKET in /var/run/ldm_socket_*; do
+ SSH_OPTS="-X"
SERVER=${LDM_SOCKET##*_}
if [ -S ${LDM_SOCKET} ]; then
+ # see if we have a command with DISPLAY matching our socket
+ IS_DIRECTX=$(pgrep -f -l DISPLAY |grep ${LDM_SOCKET})
+
+ unset DISPLAY_INFO
+ # get the DISPLAY info for ltspfsmounter
+ if [ -n "${IS_DIRECTX}" ];then
+ unset SSH_OPTS
+ for line in $IS_DIRECTX; do
+ if [ -n "$(echo $line|grep DISPLAY)" ]; then
+ DISPLAY_INFO="${line}"
+ fi
+ done
+ fi
+
# ltspfs needs access to the X display
- /usr/bin/ssh -X -S ${LDM_SOCKET} ${SERVER} \
- "/usr/sbin/ltspfsmounter ${MOUNTPOINT} add"
+ /usr/bin/ssh $SSH_OPTS -S ${LDM_SOCKET} ${SERVER} \
+ "$DISPLAY_INFO /usr/sbin/ltspfsmounter ${MOUNTPOINT} add"
fi
done
--- scripts/ add_fstab_ entry 2008-01-11 00:37:11.000000000 +0100 add_fstab_ entry.new 2008-04-17 22:07:09.000000000 +0200
+++ scripts/
@@ -28,10 +28,25 @@
# Mount in the client session, if logged in. ldm_socket_ *; do ${LDM_SOCKET# #*_} INFO="$ {line}" ltspfsmounter ${MOUNTPOINT} add" ltspfsmounter ${MOUNTPOINT} add"
for LDM_SOCKET in /var/run/
+ SSH_OPTS="-X"
SERVER=
if [ -S ${LDM_SOCKET} ]; then
+ # see if we have a command with DISPLAY matching our socket
+ IS_DIRECTX=$(pgrep -f -l DISPLAY |grep ${LDM_SOCKET})
+
+ unset DISPLAY_INFO
+ # get the DISPLAY info for ltspfsmounter
+ if [ -n "${IS_DIRECTX}" ];then
+ unset SSH_OPTS
+ for line in $IS_DIRECTX; do
+ if [ -n "$(echo $line|grep DISPLAY)" ]; then
+ DISPLAY_
+ fi
+ done
+ fi
+
# ltspfs needs access to the X display
- /usr/bin/ssh -X -S ${LDM_SOCKET} ${SERVER} \
- "/usr/sbin/
+ /usr/bin/ssh $SSH_OPTS -S ${LDM_SOCKET} ${SERVER} \
+ "$DISPLAY_INFO /usr/sbin/
fi
done