[prev in list] [next in list] [prev in thread] [next in thread] 

List:       freenx-knx
Subject:    Re: [FreeNX-kNX] $SESS_DISPLAY in server_startrestore_session()
From:       "Marcelo Boveto Shima" <marceloshima () gmail ! com>
Date:       2008-12-11 14:15:56
Message-ID: 7d3bf3160812110615p3fbda11bp665b00eae846b185 () mail ! gmail ! com
[Download RAW message or body]

[Attachment #2 (multipart/alternative)]

[Attachment #4 (text/plain)]

The proxy will start listening when a kill signal is sent to nxagent, and
after the connection
is established it stops listening. After that, the port is in use but there
are no daemon
listening on it.

Maybe freenx should use something like:
$ netstat -t | grep -e ":5000 " -e ":7000"

This will make not listening connections skip used ports.

On Thu, Dec 11, 2008 at 11:13 AM, jhonyl <jhonyl@netscape.net> wrote:

> Hi,
> 
> I have tried to run 'netcat -z -v localhost 5001' where 5001 is the
> PROXY_DISPLAY of my current session, and I got connection refused. Same
> happen if I choose any other unused port. So I think that this command
> doesn't tell us the difference between used ports and unused ports (As long
> as these used ports are not also listening ports, and it seems that the
> established sessions are no longer listening on their ports)
> I am trying to figure it out... I thought that in this case 'netcat -l -p
> 5001' will fail, but it doesn't fail either.
> 
> 
> 
> -----Original Message-----
> From: Marcelo Boveto Shima <marceloshima@gmail.com>
> To: User Support for FreeNX Server and kNX Client <freenx-knx@kde.org>
> Sent: Wed, 10 Dec 2008 9:18 pm
> Subject: Re: [FreeNX-kNX] $SESS_DISPLAY in server_startrestore_session()
> 
> I agree with jhonyl. I don't want to see the display number too high.
> We should add the remaining tests to make sure the resources are free
> and the nxagent will succeed.
> 
> There is one forgotten test before defining the display:
> 
> diff -urNad freenx-server-0.7.3+svn612~/nxserver
> freenx-server-0.7.3+svn612/nxserver
> --- freenx-server-0.7.3+svn612~/nxserver        2008-12-10
> 19:06:54.000000000 -0200
> +++ freenx-server-0.7.3+svn612/nxserver 2008 -12-10 19:06:55.000000000
> -0200
> @@ -1443,6 +1443,14 @@
> continue
> fi
> 
> +                        let PROXY_DISPLAY=$SESS_DISPLAY+4000
> +                        if [ $COMMAND_NETCAT -z "$SERVER_HOST"
> $PROXY_DISPLAY ]
> +                        then
> +                                log 2 "Warning: nxagent proxy without
> .nX$SESS_DISPLAY-lock found on host:port $SERVER_HOST:$AGENT_DISPLAY."
> +                                let SESS_DISPLAY=$SESS_DISPLAY+1
> +                                continue
> +                        fi
> +
> # Now check for the other enabled services
> 
> let SAMBA_DISPLAY=$SESS_DISPLAY+3000
> 
> 
> Regards,
> Shima
> 
> On Wed, Dec 10, 2008 at 11:58 AM, jhonyl <jhonyl@netscape.net> wrote:
> 
> > I think that what you did is perfectly ok, but I think it would be
> > better in the public algorithm, if the script will check if the session
> > failed due to display and if so it will lock the display number for NX, and
> > try again on the next free port. All this without failing the session, that
> > is, it will try and try (up to max attempts) until it will be able to
> > establish a session.
> > 
> > 
> > -----Original Message-----
> > From: Kai Lappalainen <nxlist@httgmbh.net>
> > To: freenx-knx@kde.org
> > Sent: Tue, 9 Dec 2008 10:32 pm
> > Subject: [FreeNX-kNX] $SESS_DISPLAY in server_startrestore_session()
> > 
> > Hello,    recently we've had some trouble with FreeNX under load not beeing able \
> > to   start a new session, because the "stupid but working algo..." (comment from  \
> > nxserver script!) was not really working. ;-)    The problem was, that nxserver \
> > (in server_startrestore_session()) always tried   to use the same $SESS_DISPLAY, \
> > which was locked somehow(?) - eventhough no   lock-files existed.   The reason \
> > for the "lock" could not be found. There were no processes left   running from \
> > the user who last successfully used this display number.    If we forced FreeNX \
> > to use the next display by manually "blocking" this faulty   display number \
> > (touch /tmp/.X<displaynum>-lock) people were able to login   again using the next \
> > free (working) numbers.    The commercial NXServer uses another logic here: It \
> > does not search for the   next free display number (starting from display-base) \
> > but instead always   increments the display number, starting again at \
> > display_base when reaching   the limit (round-robin).  It uses \
> > /usr/NX/var/db/running/display.{last} for storing the last used   display number. \
> > I modified nxserver to mimic this behaviour and hope there will be no more   \
> > troubles in the future.    Maybe this should generally be implemented in FreeNX \
> > this way?    Best regards,  Kai Lappalainen  --   \
> > ________________________________________________________________________  HOULDER \
> > TERRATRANS GMBH - Dorotheenstr. 82 - D-22301 Hamburg   Commercial Re gister No.: \
> > Hamburg HRB 8674 - Management: Stefan W. Dircks  \
> > ________________________________________________________________       Were you \
> > helped on this list with your FreeNX problem?      Then please write up the \
> > solution in the FreeNX Wiki/FAQ:    \
> > http://openfacts2.berlios.de/wikien/index.php/BerliosProject:FreeNX_-_FAQ         \
> > Don't forget to check the     NX Knowledge Base:                   \
> > http://www.nomachine.com/kb/     \
> > ________________________________________________________________         \
> > FreeNX-kNX mailing list --- FreeNX-kNX@kde.org        \
> > https://mail.kde.org/mailman/listinfo/freenx-knx  \
> > ________________________________________________________________ 
> > 
> > ------------------------------
> > Listen to 350+ music, sports, & news radio stations – including songs for
> > the holidays – FREE while you browse. Start Listening \
> > Now<http://toolbar.aol.com/aolradio/download.html?ncid=emlweusdown00000013>! 
> > 
> > ________________________________________________________________
> > Were you helped on this list with your FreeNX problem?
> > Then please write up the solution in the FreeNX Wiki/FAQ:
> > 
> > http://openfacts2.berlios.de/wikien/index.php/BerliosProject:FreeNX_-_FAQ
> > 
> > Don't forget to check the NX Knowledge Base:
> > http://www.nomachine.com/kb/
> > 
> > ________________________________________________________________
> > FreeNX-kNX mailing list --- FreeNX-kNX@kde.org
> > https://mail.kde.org/mailman/listinfo/freenx-knx
> > ________________________________________________________________
> > 
> 
> ________________________________________________________________       Were you \
> helped on this list with your FreeNX problem?      Then please write up the \
> solution in the FreeNX Wiki/FAQ:    \
> http://openfacts2.berlios.de/wikien/index.php/BerliosProject:FreeNX_-_FAQ           \
> Don't forget to check the NX Knowledge Base:                   \
> http://www.nomachine.com/kb/     \
> ________________________________________________________________         FreeNX-kNX \
> mailing list --- FreeNX-kNX@kde.org        https://mail.kde.o \
> rg/mailman/listinfo/freenx-knx <https://mail.kde.org/mailman/listinfo/freenx-knx>  \
> ________________________________________________________________ 
> 
> ------------------------------
> Listen to 350+ music, sports, & news radio stations  – including songs for
> the holidays  – FREE while you browse. Start Listening \
> Now<http://toolbar.aol.com/aolradio/download.html?ncid=emlweusdown00000013>! 
> 


[Attachment #5 (text/html)]

The proxy will start listening when a kill signal is sent to nxagent, and after the \
connection<br>is established it stops listening. After that, the port is in use but \
there are no daemon<br>listening on it.<br><br>Maybe freenx should use something \
like:<br> $ netstat -t | grep -e &quot;:5000 &quot; -e &quot;:7000&quot;<br><br>This \
will make not listening connections skip used ports.<br><br><div \
class="gmail_quote">On Thu, Dec 11, 2008 at 11:13 AM, jhonyl <span dir="ltr">&lt;<a \
href="mailto:jhonyl@netscape.net">jhonyl@netscape.net</a>&gt;</span> wrote:<br> \
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); \
margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"> <div>Hi,</div>


<div>&nbsp;</div>


<div>I have tried to run &#39;netcat -z -v&nbsp;localhost 5001&#39;&nbsp;where \
5001&nbsp;is the PROXY_DISPLAY&nbsp;of my current session, and I got connection \
refused. Same happen if I choose any other unused port. So I think that this command \
doesn&#39;t tell us the difference between used ports and unused ports (As long as \
these used ports are not also listening ports, and&nbsp;it seems&nbsp;that the \
established sessions are no longer listening on their ports)<br>

</div>


<div>I am trying to figure it out... I thought that in this case&nbsp;&#39;netcat -l \
-p 5001&#39; will fail, but it doesn&#39;t fail either.</div><div><div></div><div \
class="Wj3C7c">


<div>&nbsp;</div>


<div><br>
&nbsp;</div>
-----Original Message-----<br>
From: Marcelo Boveto Shima &lt;<a href="mailto:marceloshima@gmail.com" \
                target="_blank">marceloshima@gmail.com</a>&gt;<br>
To: User Support for FreeNX Server and kNX Client &lt;<a \
                href="mailto:freenx-knx@kde.org" \
                target="_blank">freenx-knx@kde.org</a>&gt;<br>
Sent: Wed, 10 Dec 2008 9:18 pm<br>
Subject: Re: [FreeNX-kNX] $SESS_DISPLAY in server_startrestore_session()<br>
<br>


<div>I agree with jhonyl. I don&#39;t want to see the display number too high.<br>
We should add the remaining tests to make sure the resources are free<br>
and the nxagent will succeed.<br>
<br>
There is one forgotten test before defining the display:<br>
<br>
diff -urNad freenx-server-0.7.3+svn612~/nxserver \
                freenx-server-0.7.3+svn612/nxserver<br>
--- freenx-server-0.7.3+svn612~/nxserver&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \
                2008-12-10 19:06:54.000000000 -0200<br>
+++ freenx-server-0.7.3+svn612/nxserver 2008
-12-10 19:06:55.000000000 -0200<br>
@@ -1443,6 +1443,14 @@<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&n \
bsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \
continue<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \
fi<br> <br>
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \
let PROXY_DISPLAY=$SESS_DISPLAY+4000<br> \
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \
if [ $COMMAND_NETCAT -z &quot;$SERVER_HOST&quot; $PROXY_DISPLAY ]<br> \
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;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nbsp;&nbsp;&nbsp;&nbsp; # Now check for the other enabled \
services<br> <br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \
let SAMBA_DISPLAY=$SESS_DISPLAY+3000<br> <br>
<br>
Regards,<br>
Shima<br>
<br>


<div class="gmail_quote">On Wed, Dec 10, 2008 at 11:58 AM, jhonyl <span \
dir="ltr">&lt;<a href="mailto:jhonyl@netscape.net" \
target="_blank">jhonyl@netscape.net</a>&gt;</span> wrote:<br>

<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); \
margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">

<div>I think&nbsp;that what you did is perfectly ok, but I think it would be \
better&nbsp;in the public algorithm,&nbsp;if the script will check if the session \
failed due to display and if so&nbsp;it will lock the display number for NX, and try \
again on the next free port. All this without failing the session, that is, it will \
try and try (up to max attempts) until it will be able to establish a session.<span \
style="display: inline-block;"></span></div>



<div>

<div></div>


<div>

<div><br>
</div>


<div><br>
</div>
-----Original Message-----<br>
From: Kai Lappalainen &lt;<a href="mailto:nxlist@httgmbh.net" \
                target="_blank">nxlist@httgmbh.net</a>&gt;<br>
To: <a href="mailto:freenx-knx@kde.org" target="_blank">freenx-knx@kde.org</a><br>
Sent: Tue, 9 Dec 2008 10:32 pm<br>
Subject: [FreeNX-kNX] $SESS_DISPLAY in server_startrestore_session()<br>
<br>


<div style="margin: 0px; font-size: 12px; color: rgb(0, 0, 0); font-family: \
Tahoma,Verdana,Arial,Sans-Serif;"><pre style="font-size: 9pt;"><tt>Hello,    recently \
we&#39;ve had some trouble with FreeNX under load not beeing able to   start a new \
session, because the &quot;stupid but working algo...&quot; (comment from   nxserver \
script!) was not really working. ;-)    The problem was, that nxserver (in \
server_startrestore_session()) always tried   to use the same $SESS_DISPLAY, which \
was locked somehow(?) - eventhough no   lock-files existed.   The reason for the \
&quot;lock&quot; could not be found. There were no processes left   running from the \
user who last successfully used this display number.    If we forced FreeNX to use \
the next display by manually &quot;blocking&quot; this faulty   display number (touch \
/tmp/.X&lt;displaynum&gt;-lock) people were able to login   again using the next free \
(working) numbers.    The commercial NXServer uses another logic here: It does not \
search for the   next free display number (starting from display-base) but instead \
always   increments the display number, starting again at display_base when reaching  \
the limit (round-robin).  It uses /usr/NX/var/db/running/display.{last} for storing \
the last used   display number.    I modified nxserver to mimic this behaviour and \
hope there will be no more   troubles in the future.    Maybe this should generally \
be implemented in FreeNX this way?    Best regards,  Kai Lappalainen  --   \
________________________________________________________________________  HOULDER \
TERRATRANS GMBH - Dorotheenstr. 82 - D-22301 Hamburg   Commercial Re gister No.: \
Hamburg HRB 8674 - Management: Stefan W. Dircks  \
________________________________________________________________       Were you \
helped on this list with your FreeNX problem?      Then please write up the solution \
in the FreeNX Wiki/FAQ:    \
<a>http://openfacts2.berlios.de/wikien/index.php/BerliosProject:FreeNX_-_FAQ</a>      \
Don&#39;t forget to check the     NX Knowledge Base:                   \
<a>http://www.nomachine.com/kb/</a>     \
________________________________________________________________         FreeNX-kNX \
mailing list --- <a>FreeNX-kNX@kde.org</a>        \
<a>https://mail.kde.org/mailman/listinfo/freenx-knx</a>  \
________________________________________________________________  </tt></pre> </div>
</div>
</div>


<div><br>
<font style="font-family: ARIAL,SAN-SERIF; font-style: normal; font-variant: normal; \
font-weight: normal; font-size: 10pt; line-height: normal; color: black; \
font-size-adjust: none; font-stretch: normal;"> <hr style="margin-top: 10px;">
Listen to 350+ music, sports, &amp; news radio stations – including songs for the \
holidays – FREE while you browse. <a \
href="http://toolbar.aol.com/aolradio/download.html?ncid=emlweusdown00000013" \
target="_blank">Start Listening Now</a>! </font></div>

<br>
________________________________________________________________<br>
&nbsp; &nbsp; Were you helped on this list with your FreeNX problem?<br>
&nbsp; &nbsp;Then please write up the solution in the FreeNX Wiki/FAQ:<br>
<br>
<a href="http://openfacts2.berlios.de/wikien/index.php/BerliosProject:FreeNX_-_FAQ" \
target="_blank">http://openfacts2.berlios.de/wikien/index.php/BerliosProject:FreeNX_-_FAQ</a><br>
 <br>
&nbsp; &nbsp; &nbsp; 
&nbsp; Don&#39;t forget to check the NX Knowledge Base:<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <a \
href="http://www.nomachine.com/kb/" \
target="_blank">http://www.nomachine.com/kb/</a><br> <br>
________________________________________________________________<br>
&nbsp; &nbsp; &nbsp; FreeNX-kNX mailing list --- <a href="mailto:FreeNX-kNX@kde.org" \
target="_blank">FreeNX-kNX@kde.org</a><br> &nbsp; &nbsp; &nbsp;<a \
href="https://mail.kde.org/mailman/listinfo/freenx-knx" \
target="_blank">https://mail.kde.org/mailman/listinfo/freenx-knx</a><br> \
________________________________________________________________<br> \
</blockquote></div> <br>
</div>


<div style="margin: 0px; font-size: 12px; color: rgb(0, 0, 0); font-family: \
Tahoma,Verdana,Arial,Sans-Serif; background-color: rgb(255, 255, 255);"><pre \
style="font-size: 9pt;"><tt>________________________________________________________________ \
Were you helped on this list with your FreeNX problem?      Then please write up the \
solution in the FreeNX Wiki/FAQ:    <a \
href="http://openfacts2.berlios.de/wikien/index.php/BerliosProject:FreeNX_-_FAQ" \
target="_blank">http://openfacts2.berlios.de/wikien/index.php/BerliosProject:FreeNX_-_FAQ</a> \
Don&#39;t forget to check the NX Knowledge Base:                   <a \
href="http://www.nomachine.com/kb/" target="_blank">http://www.nomachine.com/kb/</a>  \
________________________________________________________________         FreeNX-kNX \
mailing list --- <a href="mailto:FreeNX-kNX@kde.org" \
target="_blank">FreeNX-kNX@kde.org</a>        <a \
href="https://mail.kde.org/mailman/listinfo/freenx-knx" \
target="_blank">https://mail.kde.o rg/mailman/listinfo/freenx-knx</a>  \
________________________________________________________________  </tt></pre></div> \
<div><br><font style="color: black; font-family: ARIAL,SAN-SERIF; font-style: normal; \
font-variant: normal; font-weight: normal; font-size: 10pt; line-height: normal; \
font-size-adjust: none; font-stretch: normal;"><hr style="margin-top: 10px;"> Listen \
to 350+ music, sports, &amp; news radio stations  – including songs for the holidays  \
– FREE while you browse. <a \
href="http://toolbar.aol.com/aolradio/download.html?ncid=emlweusdown00000013" \
target="_blank">Start Listening Now</a>! </font></div>

</div></div></blockquote></div><br>



________________________________________________________________
     Were you helped on this list with your FreeNX problem?
    Then please write up the solution in the FreeNX Wiki/FAQ:

http://openfacts2.berlios.de/wikien/index.php/BerliosProject:FreeNX_-_FAQ
  
         Don't forget to check the NX Knowledge Base:
                 http://www.nomachine.com/kb/ 

________________________________________________________________
       FreeNX-kNX mailing list --- FreeNX-kNX@kde.org
      https://mail.kde.org/mailman/listinfo/freenx-knx
________________________________________________________________

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic