Sorry for that, too many patches flying around. :)

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
>
>

-- 
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 6dfc2f7f93a4dd8c8c314d7c4fe00e366a9f091c 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 |    4 ++--
 2 files changed, 4 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..cb3e54a 100755
--- a/x2goserver/bin/x2gostartagent
+++ b/x2goserver/bin/x2gostartagent
@@ -120,8 +120,8 @@ 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.
+	if  [ -e "/tmp/.X${X2GO_PORT}-lock" ] || [ -e "/tmp/.X11-unix/X${X2GO_PORT}" ] || `netstat -ntl | grep ":${X2GO_PORT} "` ; then
 		OUTPUT="XXX"
 	else
 		SESSION_NAME=${USER}-${X2GO_PORT}-`date +"%s"`
-- 
1.7.2.5

Attachment: smime.p7s
Description: S/MIME Kryptografische Unterschrift

_______________________________________________
X2go-Dev mailing list
[email protected]
https://lists.berlios.de/mailman/listinfo/x2go-dev

Reply via email to