Hi there, here is the updated version checking for the right port (DISPLAY+6000) and adding Reinhard's suggestions.
Looking forward to another round of comments. ;) Cheers Morty On 2011-12-09 18:57, Moritz Struebe wrote: > Hi there, > > this did cost us some pains, because a sshd was using port 6050, so even > reinstalling x2goserver didn't solve any issues. > This is a pretty hackish solution and maybe someone with a little more > bash experience could take a look. > > Cheers > Morty > > > > _______________________________________________ > X2go-Dev mailing list > [email protected] > https://lists.berlios.de/mailman/listinfo/x2go-dev -- Dipl.-Ing. Moritz 'Morty' Struebe (Wissenschaftlicher Mitarbeiter) Lehrstuhl für Informatik 4 (Verteilte Systeme und Betriebssysteme) Friedrich-Alexander-Universität Erlangen-Nürnberg Martensstr. 1 91058 Erlangen Tel : +49 9131 85-25419 Fax : +49 9131 85-28732 eMail : [email protected] WWW : http://www4.informatik.uni-erlangen.de/~morty
From 90ea369e26cbaf7aa76d746b73fe743d47db0b22 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Moritz=20'Morty'=20Str=C3=BCbe?= <[email protected]> Date: Fri, 9 Dec 2011 18:52:34 +0100 Subject: [PATCH] Make sure the socket used by nxagent is not already in use --- debian/control | 3 ++- x2goserver/bin/x2gostartagent | 8 ++++++-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/debian/control b/debian/control index 89dc5b2..6990bf3 100644 --- a/debian/control +++ b/debian/control @@ -27,7 +27,8 @@ Depends: libdbd-sqlite3-perl, adduser, xauth, - psmisc + psmisc, + net-tools Recommends: sshfs, x11-apps, diff --git a/x2goserver/bin/x2gostartagent b/x2goserver/bin/x2gostartagent index df72a70..aee1846 100755 --- a/x2goserver/bin/x2gostartagent +++ b/x2goserver/bin/x2gostartagent @@ -120,8 +120,12 @@ USED_DISPLAYS=`$X2GO_LIB_PATH/x2gogetdisplays $HOSTNAME` while [ "$OUTPUT" != "inserted" ]; do X2GO_PORT=$(($X2GO_PORT + 1)) X2GO_PORT=`echo "for(\\$i=$X2GO_PORT;\\$br ne \"true\";\\$i++){ if(\"$USED_DISPLAYS\" =~ m/\\|\\$i\\|/){\\$br=\"false\";}else{\\$br=\"true\";print \\$i;}}"|perl` - - if [ -e "/tmp/.X${X2GO_PORT}-lock" ] || [ -e "/tmp/.X11-unix/X${X2GO_PORT}" ]; then + + #Test if the session is already in use. nxagent uses 6000+DISPLAY to open a port. Therefore this must be tested, too. + NX_PORT=$(($X2GO_PORT + 6000)) + if [ -e "/tmp/.X${X2GO_PORT}-lock" ] || + [ -e "/tmp/.X11-unix/X${X2GO_PORT}" ] || + netstat -ntl 2>/dev/null | grep -q ":${NX_PORT} "; then OUTPUT="XXX" else SESSION_NAME=${USER}-${X2GO_PORT}-`date +"%s"` -- 1.7.2.5
smime.p7s
Description: S/MIME Kryptografische Unterschrift
_______________________________________________ X2go-Dev mailing list [email protected] https://lists.berlios.de/mailman/listinfo/x2go-dev
