From mike.gabriel@das-netzwerkteam.de Thu Jun 6 01:01:06 2013 Received: (at 155) by bugs.x2go.org; 5 Jun 2013 23:01:07 +0000 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on ymir.das-netzwerkteam.de X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=URIBL_BLOCKED autolearn=ham version=3.3.2 Received: from freya.das-netzwerkteam.de (freya.das-netzwerkteam.de [88.198.48.199]) by ymir (Postfix) with ESMTPS id D2F305DB20; Thu, 6 Jun 2013 01:01:06 +0200 (CEST) Received: from grimnir.das-netzwerkteam.de (grimnir.das-netzwerkteam.de [78.46.204.98]) by freya.das-netzwerkteam.de (Postfix) with ESMTPS id A0FE51B4; Thu, 6 Jun 2013 01:01:07 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by grimnir.das-netzwerkteam.de (Postfix) with ESMTP id 064E83BBC7; Thu, 6 Jun 2013 01:01:06 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at grimnir.das-netzwerkteam.de Received: from grimnir.das-netzwerkteam.de ([127.0.0.1]) by localhost (grimnir.das-netzwerkteam.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id iqLO3JRT03UV; Thu, 6 Jun 2013 01:01:05 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by grimnir.das-netzwerkteam.de (Postfix) with ESMTP id CCA6D3BBFE; Thu, 6 Jun 2013 01:01:05 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by grimnir.das-netzwerkteam.de (Postfix) with ESMTP id AFB3F3BBF6; Thu, 6 Jun 2013 01:01:05 +0200 (CEST) Received: by grimnir.das-netzwerkteam.de (Postfix, from userid 33) id 593BC3BBFE; Thu, 6 Jun 2013 01:01:05 +0200 (CEST) Received: from 46.115.45.74 ([46.115.45.74]) by mail.das-netzwerkteam.de (Horde Framework) with HTTP; Thu, 06 Jun 2013 01:01:05 +0200 Message-ID: <20130606010105.68542iznst745wdt@mail.das-netzwerkteam.de> X-Priority: 3 (Normal) Date: Thu, 06 Jun 2013 01:01:05 +0200 From: Mike Gabriel To: Eugene San , 155@bugs.x2go.org Cc: 155-submitter@bugs.x2go.org Subject: Re: [X2Go-Dev] Multiple X2goclient instances fail (patch) References: In-Reply-To: MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=_2cayrr87cz01"; protocol="application/pgp-signature"; micalg="pgp-sha1" Content-Transfer-Encoding: 7bit User-Agent: Internet Messaging Program (IMP) H3 (4.3.4) This message is in MIME format and has been PGP signed. --=_2cayrr87cz01 Content-Type: multipart/mixed; boundary="=_kuzgixawf8x" Content-Transfer-Encoding: 7bit This message is in MIME format. --=_kuzgixawf8x Content-Type: text/plain; charset=UTF-8; DelSp="Yes"; format="flowed" Content-Disposition: inline Content-Transfer-Encoding: 7bit Hi Thomas, hi Eugene, ugene On Mi 05 Jun 2013 06:33:15 CEST Eugene San wrote: > Hi all, > > This subject was already discussed here, but since no solution exists till > now, I've hacked not ideal but practical solution. > > Attached patch should minimize chances of conflicting ports x2goserver is > using. > On the first run, x2gostartagent script randomly selects ports from > specific range (30000-30099) and save them to config file to be used for > the following sessions. > Later one can tune those values in config file > (/etc/x2go/x2goagent.options). > > Regards > Eugene: the patch your provided via x2go-dev ML won't work (as x2goagent.options cannot be written by the user). However, here is another patch that you and Thomas (the submitter of issue #155 in X2Go BTS) may test with your class room setups. Patch is attached. Please give feedback. The patch reverts some code introduced in x2goserver 3.1.1.3 (or so). Thanks+Greets, Mike -- DAS-NETZWERKTEAM mike gabriel, herweg 7, 24357 fleckeby fon: +49 (1520) 1976 148 GnuPG Key ID 0x25771B31 mail: mike.gabriel@das-netzwerkteam.de, http://das-netzwerkteam.de freeBusy: https://mail.das-netzwerkteam.de/freebusy/m.gabriel%40das-netzwerkteam.de.xfb --=_kuzgixawf8x Content-Type: text/x-diff; charset=UTF-8; name="detect-used-ports-correctly-again.patch" Content-Disposition: attachment; filename="detect-used-ports-correctly-again.patch" Content-Transfer-Encoding: 7bit diff --git a/x2goserver/bin/x2goresume-session b/x2goserver/bin/x2goresume-session index f4b5624..7eba167 100755 --- a/x2goserver/bin/x2goresume-session +++ b/x2goserver/bin/x2goresume-session @@ -68,7 +68,7 @@ $X2GO_LIB_PATH/x2gosyslog "$0" "debug" "old ports: $GR_PORT, $SOUND_PORT, $FS_PO ss=$(PATH="$PATH:/usr/sbin:/sbin" type -P ss); USED_PORTS=$( "$ss" -lnt | - perl -lne 'print$d{$2}="|$2|"if/^(\S+\s+){2}\S+:(\d+)/&&!exists$d{$2}'; + 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])} }'; ); #check if saved in DB ports free diff --git a/x2goserver/bin/x2gostartagent b/x2goserver/bin/x2gostartagent index 83e559d..f99b8d5 100755 --- a/x2goserver/bin/x2gostartagent +++ b/x2goserver/bin/x2gostartagent @@ -138,7 +138,7 @@ ss=$(PATH="$PATH:/usr/sbin:/sbin" type -P ss); USED_PORTS=$( "$X2GO_LIB_PATH/x2gogetports" "$HOSTNAME"; "$ss" -lnt | - perl -lne 'print$d{$2}="|$2|"if/^(\S+\s+){2}\S+:(\d+)/&&!exists$d{$2}'; + 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 --=_kuzgixawf8x-- --=_2cayrr87cz01 Content-Type: application/pgp-signature Content-Description: Digitale PGP-Unterschrift Content-Disposition: inline Content-Transfer-Encoding: 7bit -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.10 (GNU/Linux) iQIcBAABAgAGBQJRr8MxAAoJEJr0azAldxsxyuUQALvf3kr4sWSSRU619X4gIjwN wdNPjxDgtltEY7fDayR8kfd3b1+c/K7IorVi3yurO6XlPVWWNdSZU2GxJUlRj5os 5steObiTMjLMT6/n2ahVztd0YaXZTyxwDfGQRxqJQE4f9TooXcTq3WmvpgN3sCyT FGdELCgeK6dD/nd0SJaTLnNRE7+gUZEkxsa6PxEvbZdCPiL3G45IAkHbmabmJ+5U zOOfAe3xNqjocPvaKVQA/ooXx32w4rr3GlVrv5nrQQwW6VIPVTvx3I1wa7aYT3jW mJzm/wocKrOeWQZRWw8NEr2iKmG1b//bmIg7JruRdU6/A+7GkuuZTacay99w9pde kYVdQs2skvgHiGKKwOMcTSmm48L/BDbFxwVgJ3Mipedh4U2in9J/5SpTqt/fC3ig iI7zCDi3jsSDJ0ZhYdie6mqzeq0fdz9yh15UG5/6vanRkGgMqHjgiVAISfzqFJ3l 8Ql3kG919xoLCf7nD/AwKPMDYKKnLmlc5DW6rz8uGvF1SCgf00QLsrK5G9TON/Fq 8T60tFelS1cQYfzqAbDKqTtBmZSs36gWzYXlR0CFGNrMnNLoYgFlpsJBWrKQwTv7 wrgR0WF4ejqgNRHmed4PXx/DPa3+aha8ITITsJ2J9nl8gvmmJ8ftapYE5YFpMGsO imAikWsw8QS+au422ha2 =xm8d -----END PGP SIGNATURE----- --=_2cayrr87cz01--