[X2Go-User] x2go disconnect timeout

Ulrich Sibiller uli42 at gmx.de
Tue Feb 7 00:49:15 CET 2023


On Mon, Feb 6, 2023 at 11:35 PM Hanno Foest <hurga-x2go at tigress.com> wrote:
>
> On Mon, Feb 06, 2023 at 09:18:22PM +0100, Ulrich Sibiller wrote:
>
> > In case you close your laptop the network connection
> > will go down. The x2goagent will notice after some time that the other
> > side (the laptop) is not answering/sending data anymore and will
> > detect a DISPLAY failure (since the remote X server is not available
> > anymore) and suspend the session.
> >
> > If you have configured sleep=0 then your applications (meaning
> > Xclients running on the server side, connecting to the x2goagent) will
> > not notice any change as the x2goagent is still there, otherwise they
> > will be slowed down until x2goagent is woken up again by an x2goclient
> > that wants to connect.
>
> But that's where I notice a difference. If I disconnect the x2go
> session cleanly, either using the "stop" button or just closing the
> window, things work as you described. If I don't close the session
> cleanly, e.g. by just sending the laptop to sleep, or by kill -9 on the
> x2go client, the remote session stops as if I didn't configure sleep=0.
>
> I'm not entirely sure if it's always the case, but quite often at least,
> and certainly today when I tested again. And I don't remember that
> behaviour from years ago, but that's probably just me.

Alright, now I understood. Well, normally both situations should
finally end in the same state where sleep is honored.

There are two timeouts you can configure: There's nxagent -timeout
(man nxagent) which is described as

       -timeout int
              auto-disconnect timeout in seconds (minimum allowed:
60). Default is 0 (no timeout).

and there's a timeout option in nxproxy (man nxproxy):

   timeout=t
              Specify the keep-alive timeout used by proxies to
determine if there is a network problem preventing communication with
the remote peer. A value of 0 disables the check.

Notes:
- there seems to be no minimum here
- the value's unit is seconds
- the default is 120s

The latter one seems to be the right one but ATM I don't know if
there's a way to set this with/for x2goclient.

But knowing that the proxy code is running on both sides to establish
the connection (all that is done in the nxcomp library that exists
both on the server and on the client side) it might be simply adding
timeout=<value> to X2GO_NXOPTIONS in /etc/x2go/x2goagent.options  on
the server side in addition to sleep=0.

To get a better overview if it helps I suggest to connect to the
server with a separate ssh session and run tail on the session log in
/tmp/.x2go-<user>/C.../session.log. You can then see when the
connection breaks and when it finally suspends. Check if adding a low
timeout changes things here.

Uli


More information about the x2go-user mailing list