[X2go-Dev] Clean sessions
Mike Gabriel
mike.gabriel at das-netzwerkteam.de
Mon Jul 25 23:24:05 CEST 2011
Hi all,
On Mo 25 Jul 2011 15:12:32 CEST Moritz Struebe wrote:
>>> The first is probably better done as daemon/cron-job. The daemon needs
>>> extended rights, because it needs access to all sessions (this is
>>> relevant due to the postgres-implementation), and needs to run on every
>>> server. Running as x2gouser should do the trick, though.
>
>> Why can't this run in user context? I mean the user has priviledges to
>> create sessions, why can't he clean up after himself?
>
> He can, of course. But we also want to clean up sessions of people who
> only log in once in a while.
One reason for keeping a house keeper (someone who cleans up after
you) is that you can fulfil your own tasks as quickly as possible.
Most of the x2goserver scripts do not fork to background: the clients
calls that script and waits for a return value. Each operation issued
in that way should be really fast.
>>> The second is probably best placed in x2gocreatesession, as the user
>>> should have the rights to clean up it's old sessions (root normally may
>>> not access foreign homes via NFS).
>> Why is this cleanup better done at 'create session' time rather than at
>> 'listing sessions' time?
>
> List session should list sessions. You don't want it to have strange
> side-effects (IMO deleting files is such a strange side-effect).
I agree here fully. Esp. x2golistsessions has to come up with results
quickly. One reason we use a database for querying session information
opposed to collecting the details from the system state (ps aux etc.).
The problem that occurs, however, is that we indeed have home
locations (NFS+Krb5, AFS, CIFS) that might not be accessible by some
generic local user (such as root). Thus: the clean process for files
in $HOME has to run as x2go user and should not delay any
communication between server and client.
My suggestion is to fork such a cleanup daemon in user space that
intellegently cleans up after the session has started up...
x2gostartagent
... sleep for 20 seconds -> then launch x2gocleanup-session
This is only necessary once per logged in user (you do not want a
session cleaner for each of multiple rootless applications, started on
the server).
> While
> not perfect, x2gocreatesession (and x2goresumesession?) is rather
> something you expect to do more, as it also creates a profile folder.
> You might even want it to wait a week before it cleans up, so you can
> "debug" your session.
Indeed! Or at least have an option for that...
> Cheers
> Morty
Greetings,
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/20110725/08a19384/attachment.pgp>
More information about the x2go-dev
mailing list