Am 06.09.2017 um 19:01 schrieb Ivan Gomez:
Is it possible to disable session suspension in x2goserver? Instead of suspending, I’d like to terminate them. Hmm, weren't your last words "I can easily combine the information from x2golistsessions_root and the load balancer to determine if sessions are executing work in the background and thus avoid killing them."?
So now you're planning to kill them regardless? Parse the output of x2golistsessions_root in a cronjob, select those that have the suspended flag, and issue x2goterminate-session on their session id (as root). Of course, one small network glitch and they're gone before the user has a chance to reconnect, so you might want to check the timestamp in the x2golistsessions_root output, and only terminate those that are suspended for longer than n minutes.
Untested and nasty hack that could/should work without a cronjob: Create a Symlink in "/usr/local/bin/" named "x2gosuspend-session" and have it point at "/usr/bin/x2goterminate-session".
Of course, the sane approach would be using a load balancer that can actually handle reconnects. Ours does and is called X2Go Session Broker. ;-)
-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