[X2Go-Commits] x2goserver.git - master (branch) updated: 3.1.1.3-192-g65169c9

X2Go dev team git-admin at x2go.org
Fri Jul 19 17:55:58 CEST 2013


The branch, master has been updated
       via  65169c9d65b117802e50631be0bbd719163d969e (commit)
      from  daca6ae5e260aef889cef8bc707ae89819b67c01 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 65169c9d65b117802e50631be0bbd719163d969e
Author: Mike Gabriel <mike.gabriel at das-netzwerkteam.de>
Date:   Fri Jul 19 17:55:09 2013 +0200

    Multiply query USED_DISPLAYS and USED_PORTS in x2gostartagent to minimize race conditions in cases where many clients launch session simultaneously.
    
    Conflicts (resolved by Mike Gabriel)
    	debian/changelog

-----------------------------------------------------------------------

Summary of changes:
 debian/changelog              |    8 ++++++++
 x2goserver/bin/x2gostartagent |   27 +++++++++++++++++++--------
 2 files changed, 27 insertions(+), 8 deletions(-)

The diff of changes is:
diff --git a/debian/changelog b/debian/changelog
index 48a874b..0c5ede7 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -51,6 +51,14 @@ x2goserver (4.1.0.0-0~x2go1) UNRELEASED; urgency=low
 
  -- Reinhard Tartler <siretart at tauware.de>  Thu, 20 Dec 2012 10:15:26 +0100
 
+x2goserver (4.0.1.4-0~x2go1) UNRELEASED; urgency=low
+
+  * New upstream versino (4.0.1.4):
+    - Multiply query USED_DISPLAYS and USED_PORTS in x2gostartagent to minimize
+      race conditions in cases where many clients launch session simultaneously.
+
+ -- Mike Gabriel <mike.gabriel at das-netzwertkeam.de>  Fri, 19 Jul 2013 17:53:11 +0200
+
 x2goserver (4.0.1.3-0~x2go1) unstable; urgency=low
 
   * New upstream version (4.0.1.3):
diff --git a/x2goserver/bin/x2gostartagent b/x2goserver/bin/x2gostartagent
index 4418542..1b3f454 100755
--- a/x2goserver/bin/x2gostartagent
+++ b/x2goserver/bin/x2gostartagent
@@ -131,17 +131,20 @@ if [ "$X2GO_CLIENT" == "" ]; then
 	X2GO_CLIENT="$HOSTNAME"
 fi
 
-USED_DISPLAYS=`$X2GO_LIB_PATH/x2gogetdisplays $HOSTNAME`
-
-#Get all used in system ports from X2Go database and ss output
+# define the full path to the ss utility
 ss=$(PATH="$PATH:/usr/sbin:/sbin" type -P ss);
-USED_PORTS=$(
-	"$X2GO_LIB_PATH/x2gogetports" "$HOSTNAME";
-	"$ss" -nt -all |
-	awk '{ n=split($0,lines,"\n"); for(i=1;i<=n;i++){split (lines[i],words," ");delim=split(words[4],ports,":"); if(delim>1)printf ("|%s|\n",ports[delim])} }';
-);
 
 while [ "$OUTPUT"  != "inserted" ]; do
+
+	USED_DISPLAYS=`$X2GO_LIB_PATH/x2gogetdisplays $HOSTNAME`
+
+	#Get all used in system ports from X2Go database and ss output
+	USED_PORTS=$(
+	    "$X2GO_LIB_PATH/x2gogetports" "$HOSTNAME";
+	    "$ss" -nt -all |
+	    awk '{ n=split($0,lines,"\n"); for(i=1;i<=n;i++){split (lines[i],words," ");delim=split(words[4],ports,":"); if(delim>1)printf ("|%s|\n",ports[delim])} }';
+	);
+
 	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`
 	
@@ -167,6 +170,13 @@ while [ "$GR_PORT" == "" ] || [ "$SOUND_PORT" == "" ] || [ "$FS_PORT" == "" ]; d
 	while [ "$OUTPUT"  != "inserted" ]; do
 		SSH_PORT=$(($SSH_PORT + 1))
 
+		#Get all used in system ports from X2Go database and ss output
+		USED_PORTS=$(
+		    "$X2GO_LIB_PATH/x2gogetports" "$HOSTNAME";
+		    "$ss" -nt -all |
+		    awk '{ n=split($0,lines,"\n"); for(i=1;i<=n;i++){split (lines[i],words," ");delim=split(words[4],ports,":"); if(delim>1)printf ("|%s|\n",ports[delim])} }';
+		);
+
 		#get free port
 		SSH_PORT=`echo "for(\\$i=$SSH_PORT;\\$br ne \"true\";\\$i++){ if(\"$USED_PORTS\" =~ m/\\|\\$i\\|/){\\$br=\"false\";}else{\\$br=\"true\";print \\$i;}}"|perl`
 
@@ -176,6 +186,7 @@ while [ "$GR_PORT" == "" ] || [ "$SOUND_PORT" == "" ] || [ "$FS_PORT" == "" ]; d
 			OUTPUT=`$X2GO_LIB_PATH/x2goinsertport "$HOSTNAME" "$SESSION_NAME" "$SSH_PORT"`
 		fi
 	done
+
 	if [ "$GR_PORT" == "" ]; then
 		GR_PORT="$SSH_PORT"
 	elif [ "$SOUND_PORT" == "" ]; then


hooks/post-receive
-- 
x2goserver.git (X2Go Server)

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "x2goserver.git" (X2Go Server).




More information about the x2go-commits mailing list