Hi all,
last night I have implemented a very basic pluggable extension system
for x2goserver. The relevant folder structure will be installed by the
x2goserver-extensions package. What the package provides is described
on the x2goserver-run-extensions man page:
http://code.x2go.org/doc/x2goserver-extensions/man/man8/x2goserver-run-exten...
Feedback+Comments+Criticism are Welcome!!!
Mike
--
DAS-NETZWERKTEAM mike gabriel, dorfstr. 27, 24245 barmissen fon: +49 (4302) 281418, fax: +49 (4302) 281419
GnuPG Key ID 0xB588399B mail: mike.gabriel@das-netzwerkteam.de, http://das-netzwerkteam.de
freeBusy: https://mail.das-netzwerkteam.de/freebusy/m.gabriel%40das-netzwerkteam.de.xf...
On Thu, 2011-09-29 at 23:20 +0200, Mike Gabriel wrote:
Hi all,
last night I have implemented a very basic pluggable extension system
for x2goserver. The relevant folder structure will be installed by the
x2goserver-extensions package. What the package provides is described
on the x2goserver-run-extensions man page: http://code.x2go.org/doc/x2goserver-extensions/man/man8/x2goserver-run-exten...Feedback+Comments+Criticism are Welcome!!!
<snip> I like this idea very much. Thank you - John
Hi,
sounds reasonable to me. A few things that came to mind when reading the page (it it not a request to fix the - just a few thoughts):
Cheers Morty
On 2011-09-29 23:20, Mike Gabriel wrote:
Hi all,
last night I have implemented a very basic pluggable extension system for x2goserver. The relevant folder structure will be installed by the x2goserver-extensions package. What the package provides is described on the x2goserver-run-extensions man page: http://code.x2go.org/doc/x2goserver-extensions/man/man8/x2goserver-run-exten...
Feedback+Comments+Criticism are Welcome!!!
Mike
-- Dipl.-Ing. Moritz 'Morty' Struebe (Wissenschaftlicher Mitarbeiter) Lehrstuhl für Informatik 4 (Verteilte Systeme und Betriebssysteme) Friedrich-Alexander-Universität Erlangen-Nürnberg Martensstr. 1 91058 Erlangen
Tel : +49 9131 85-25419 Fax : +49 9131 85-28732 eMail : struebe@informatik.uni-erlangen.de WWW : http://www4.informatik.uni-erlangen.de/~morty
Hi Morty,
On Fr 30 Sep 2011 08:40:40 CEST Moritz Struebe wrote:
sounds reasonable to me. A few things that came to mind when reading
the page (it it not a request to fix the - just a few thoughts):
:-)
- what happens to stdout and stderr? What is propagated to the
client/logfile/</dev/null>?
The x2goserver-run-extensions script silence the sub-scripts complete.
Just committed to Git. Thanks.
- Why always return 0? At least for pre-* it might be nice if
something can fail.
Hmmmm... Really depends on the use case. On the one hand you are right
on the other hand failing extensions scare me. Hmmm...
- What do you mean with "fail during execution"? Maybe something
like "Return codes are ignored and failures are therefore not
propagated" is easier to understand.
Added to the man page.
- Most other systems have two-digit ordering
4 digits reduced to three... (I expect thousands of extensions ;-).
- I'd make digit ordering the rule, not a suggestion
Changed! Will be in next commit.
- What about the environment? What information do I get
(client-string/version/username/remote ip)?
You have the SESSION_NAME (as $1). With that the subscripts can obtain
the rest (from x2golistsessions etc.).
Greets, Mike
--
DAS-NETZWERKTEAM mike gabriel, dorfstr. 27, 24245 barmissen fon: +49 (4302) 281418, fax: +49 (4302) 281419
GnuPG Key ID 0xB588399B mail: mike.gabriel@das-netzwerkteam.de, http://das-netzwerkteam.de
freeBusy: https://mail.das-netzwerkteam.de/freebusy/m.gabriel%40das-netzwerkteam.de.xf...
On 2011-09-30 09:08, Mike Gabriel wrote:
- what happens to stdout and stderr? What is propagated to the client/logfile/</dev/null>?
The x2goserver-run-extensions script silence the sub-scripts complete. Just committed to Git. Thanks.
IS this a good idea? That is no fun debugging - and maybe those scripts want to output to the session log.
- Why always return 0? At least for pre-* it might be nice if something can fail.
Hmmmm... Really depends on the use case. On the one hand you are right on the other hand failing extensions scare me. Hmmm...
Well, actually I was mainly thinking of pre-start. It can be abused to implement access-control. Or you might not want to allow a new session if some service fails to start. We have fail-* to clean up already started services
- What about the environment? What information do I get (client-string/version/username/remote ip)?
You have the SESSION_NAME (as $1). With that the subscripts can obtain the rest (from x2golistsessions etc.).
Ah ok. Maybe a pointer to that wouldn't be too bad.
Another thing came to mind: What about turning around the naming-sceme: start-pre start-post start-fail That way things that belong together are listed together (also thinking of tab-compleation). I am happy with the current solution, too, though.
And yet another idea: What about passing "pre-start" etc as first parameter. (similar to intit.d) That way every service only needs one script and can use symlinks.
Cheers Morty
-- Dipl.-Ing. Moritz 'Morty' Struebe (Wissenschaftlicher Mitarbeiter) Lehrstuhl für Informatik 4 (Verteilte Systeme und Betriebssysteme) Friedrich-Alexander-Universität Erlangen-Nürnberg Martensstr. 1 91058 Erlangen
Tel : +49 9131 85-25419 Fax : +49 9131 85-28732 eMail : struebe@informatik.uni-erlangen.de WWW : http://www4.informatik.uni-erlangen.de/~morty
Hi Morty,
On Fr 30 Sep 2011 10:37:03 CEST Moritz Struebe wrote:
On 2011-09-30 09:08, Mike Gabriel wrote:
- what happens to stdout and stderr? What is propagated to the
client/logfile/</dev/null>?The x2goserver-run-extensions script silence the sub-scripts
complete. Just committed to Git. Thanks.IS this a good idea? That is no fun debugging - and maybe those
scripts want to output to the session log.
We have a new command: x2gosyslog and a loglevel option in
x2goserver.conf. This one should be used.
- Why always return 0? At least for pre-* it might be nice if
something can fail.Hmmmm... Really depends on the use case. On the one hand you are
right on the other hand failing extensions scare me. Hmmm...Well, actually I was mainly thinking of pre-start. It can be abused
to implement access-control. Or you might not want to allow a new
session if some service fails to start. We have fail-* to clean up
already started services
Ok, put on my internal wishlist. Sounds tempting.
- What about the environment? What information do I get
(client-string/version/username/remote ip)?You have the SESSION_NAME (as $1). With that the subscripts can
obtain the rest (from x2golistsessions etc.).Ah ok. Maybe a pointer to that wouldn't be too bad.
In the man page? Could you?
Another thing came to mind: What about turning around the naming-sceme: start-pre start-post start-fail That way things that belong together are listed together (also
thinking of tab-compleation). I am happy with the current solution,
too, though.
Hmmm... too cosmetic for me right now to make an effort.
And yet another idea: What about passing "pre-start" etc as first
parameter. (similar to intit.d) That way every service only needs
one script and can use symlinks.
currently pre-start is second parameter, first is SESSION_NAME. Will
that already do?
Cheers Morty
Cheerio, Mike
--
DAS-NETZWERKTEAM mike gabriel, dorfstr. 27, 24245 barmissen fon: +49 (4302) 281418, fax: +49 (4302) 281419
GnuPG Key ID 0xB588399B mail: mike.gabriel@das-netzwerkteam.de, http://das-netzwerkteam.de
freeBusy: https://mail.das-netzwerkteam.de/freebusy/m.gabriel%40das-netzwerkteam.de.xf...
Hi Mike,
2011/9/29 Mike Gabriel <mike.gabriel@das-netzwerkteam.de>:
Hi all,
last night I have implemented a very basic pluggable extension system for x2goserver. The relevant folder structure will be installed by the x2goserver-extensions package. What the package provides is described on the x2goserver-run-extensions man page: http://code.x2go.org/doc/x2goserver-extensions/man/man8/x2goserver-run-exten...
Feedback+Comments+Criticism are Welcome!!!
I just upgraded to 3.0.99.6-0~x2go1+squeeze~heuler~20110929~335~build1 and there were some error message when I tried to resume or terminate a session that was running (session started before upgrade):
ls: can't access /usr/lib/x2go/extensions/pre-terminate.d/*: The file or folder doesn't exist ls: can't access /usr/lib/x2go/extensions/fail-terminate.d/*: The file or folder doesn't exist
(Translated from swedish).
Similar messages when resuming, .../pre-resume.d/* ...
I have x2goserver-extensions installed.
Cheers, Daniel
Hi Daniel,
On Fr 30 Sep 2011 09:14:36 CEST Daniel Lindgren wrote:
Hi Mike,
2011/9/29 Mike Gabriel <mike.gabriel@das-netzwerkteam.de>:
Hi all,
last night I have implemented a very basic pluggable extension system for x2goserver. The relevant folder structure will be installed by the x2goserver-extensions package. What the package provides is described on the x2goserver-run-extensions man page: http://code.x2go.org/doc/x2goserver-extensions/man/man8/x2goserver-run-exten...
Feedback+Comments+Criticism are Welcome!!!
I just upgraded to 3.0.99.6-0~x2go1+squeeze~heuler~20110929~335~build1 and there were some error message when I tried to resume or terminate a session that was running (session started before upgrade):
ls: can't access /usr/lib/x2go/extensions/pre-terminate.d/*: The file or folder doesn't exist ls: can't access /usr/lib/x2go/extensions/fail-terminate.d/*: The file or folder doesn't exist
(Translated from swedish).
Similar messages when resuming, .../pre-resume.d/* ...
Ahhh... that's because the extension folders are empty. Fixed in Git
by this commit:
http://code.x2go.org/gitweb?p=x2goserver.git;a=commitdiff;h=92047718334612a8...
Mike
--
DAS-NETZWERKTEAM mike gabriel, dorfstr. 27, 24245 barmissen fon: +49 (4302) 281418, fax: +49 (4302) 281419
GnuPG Key ID 0xB588399B mail: mike.gabriel@das-netzwerkteam.de, http://das-netzwerkteam.de
freeBusy: https://mail.das-netzwerkteam.de/freebusy/m.gabriel%40das-netzwerkteam.de.xf...
Hi
On Fr 30 Sep 2011 10:33:59 CEST Mike Gabriel wrote:
Ahhh... that's because the extension folders are empty. Fixed in Git
by this commit:http://code.x2go.org/gitweb?p=x2goserver.git;a=commitdiff;h=92047718334612a8...
Sometimes it's good to read one's own emails and click on one's own links...
Fix for the fix: http://code.x2go.org/gitweb?p=x2goserver.git;a=commitdiff;h=0cc91226797b9ceb...
Mike
PS: Debian packages currently building...
--
DAS-NETZWERKTEAM mike gabriel, dorfstr. 27, 24245 barmissen fon: +49 (4302) 281418, fax: +49 (4302) 281419
GnuPG Key ID 0xB588399B mail: mike.gabriel@das-netzwerkteam.de, http://das-netzwerkteam.de
freeBusy: https://mail.das-netzwerkteam.de/freebusy/m.gabriel%40das-netzwerkteam.de.xf...