Thank you for your feedback Stefan.

I understand your concern about terminating sessions when people are running 
tasks through screen or tmux. I would add a check to avoid killing these type 
of sessions.

Thank you and have a good day.
Ivan
 
-----Original Message-----
From: x2go-user [mailto:x2go-user-boun...@lists.x2go.org] On Behalf Of Stefan 
Baur
Sent: Friday, August 18, 2017 4:05 PM
To: x2go-user@lists.x2go.org
Subject: Re: [X2Go-User] Timeout user sessions

Am 18.08.2017 um 21:08 schrieb Ivan Gomez:
> I was wondering if there is a way to timeout sessions after a certain 
> period of inactivity?

> I have several users launching application through X2Go and they may 
> leave the windows idle for several days. Ideally I would like to be 
> able to kill those sessions after a certain period of inactivity. Is 
> this possible?

Well, some people might do this intentionally, like people use screen or tmux 
to keep a task running even when they're not present or not even connected to 
the system.  Terminating their sessions when they don't expect it might not be 
the best idea.

You could set up a cron job that parses the output of x2golistsessions_root and 
calls x2goterminate-session for each sessionid (field 2) that is older than n 
days (using field 6:init time, or field 11:last time dataset has been updated, 
or field 13, session age in seconds), but that will terminate sessions that 
have been open that long, no matter if they're idle or actively used.

Of course, if you filter for suspended sessions only (field 5, state S), then 
you could use it to terminate suspended sessions older than n days
- but be sure to use field 11 for the check, then, or you will terminate a user 
that had a running session for n days, and just suspended it a moment ago ...

-Stefan

--
BAUR-ITCS UG (haftungsbeschränkt)
Geschäftsführer: Stefan Baur
Eichenäckerweg 10, 89081 Ulm | Registergericht Ulm, HRB 724364 Fon/Fax 0731 40 
34 66-36/-35 | USt-IdNr.: DE268653243

_______________________________________________
x2go-user mailing list
x2go-user@lists.x2go.org
https://lists.x2go.org/listinfo/x2go-user

Reply via email to