[X2go-Dev] [PATCH] Make sure the [...] - The right patch!
Mike Gabriel
mike.gabriel at das-netzwerkteam.de
Fri Jan 27 13:26:43 CET 2012
Hi Reinhard, hi Morty
On Fr 09 Dez 2011 21:53:05 CET Reinhard Tartler wrote:
> On Fr, Dez 09, 2011 at 18:58:35 (CET), Moritz Struebe wrote:
>
>
>> --- 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"`
>
> That looks overly convoluted to me. What about this (untested, but shell
> syntax works):
>
> if [ -e "/tmp/.X${X2GO_PORT}-lock" ] ||
> [ -e "/tmp/.X11-unix/X${X2GO_PORT}" ] ||
> netstat -ntl 2>/dev/null | grep -q ":${X2GO_PORT}"; then
> OUTPUT="XXX"
> else
> SESSION_NAME=${USER}-${X2GO_PORT}-`date +"%s"`
> fi
I picked this mail from a port detection discussion. Has a fix for the
discussed problem been committed to x2goserver.git?
Can any of you send the latest patch proposal to the list? Or, if
tested well enough simply commit?
Greets,
Mike
--
DAS-NETZWERKTEAM
mike gabriel, dorfstr. 27, 24245 barmissen
fon: +49 (4302) 281418, fax: +49 (4302) 281419
GnuPG Key ID 0xB588399B
mail: mike.gabriel at das-netzwerkteam.de, http://das-netzwerkteam.de
freeBusy:
https://mail.das-netzwerkteam.de/freebusy/m.gabriel%40das-netzwerkteam.de.xfb
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 490 bytes
Desc: Digitale PGP-Unterschrift
URL: <http://lists.x2go.org/pipermail/x2go-dev/attachments/20120127/41a484dc/attachment.pgp>
More information about the x2go-dev
mailing list