The branch, release/4.0.1.x has been updated via 15860d2e1e69ae9e5b58e4957aa3efa925410d00 (commit) from 74f823a903ad9d83b9ed9ea49d8125c4dff45d1c (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 15860d2e1e69ae9e5b58e4957aa3efa925410d00 Author: Mike Gabriel <mike.gabriel@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. ----------------------------------------------------------------------- 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 97ab7b3..08d3a39 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,11 @@ +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@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 e137368..d25a48a 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).