x2goserver-run-extensions man page

x2goserver-run-extensions — Run X2Go Server Extensions


x2goserver-run-extensions <session_id> <modality>


x2goserver-run-extensions is called from within a number of X2Go Server core scripts.

WARNING: Do not call it directly unless you really know what you are doing.

x2goserver-run-extensions executes scripts that have been provided by third-party X2Go extension packages.

What this man page is about is not the script usage itself but the way of how to provide X2Go server extensions and features without the need to change the core X2Go server scripts.


x2goserver-run-extensions is called with user privileges, as first cmd line argument the session ID is provided as the second cmd line argument a (what we call it) modality is provided.

This modality tells x2goserver-run-extensions at what stage of an X2go session startup, resumption, suspension or termination the calling script currently is at.

Calling X2Go Server core scripts currently are: x2gostartagent(8), x2goruncommand(8), x2goresume-session(8), x2gosuspend-session(8) or x2goterminate-session(8).

The modality names all refer to a sub-directory of the path:


where <libexecdir> is /usr/libexec/x2go or /usr/lib/x2go on commonly-used GNU/Linux systems.

In any of these sub-directories third-party X2Go extension packages can place scripts or binaries that will then get executed by the core X2Go server commands, either before or after the essential functionality (e.g. x2goagent startup, x2goagent suspension, x2goagent resumption, etc.) or on failure of that essential functionality.

The following table shows the available modalities, the calling scripts and the location where to place third-party extension scripts:

--------------        ---------------   --------------------------
x2gostartagent        pre-start         extensions/pre-start.d/
                      post-start        extensions/post-start.d/
                      fail-start        extensions/fail-start.d/
x2goruncommand        pre-runcommand    extensions/pre-runcommand.d/
                      post-runcommand   extensions/post-runcommand.d/
                      fail-runcommand   extensions/fail-runcommand.d/
x2goresume-session    pre-resume        extensions/pre-resume.d/
                      post-resume       extensions/post-resume.d/
                      fail-resume       extensions/fail-resume.d/
x2gosuspend-session   pre-suspend       extensions/pre-suspend.d/
                      post-suspend      extensions/post-suspend.d/
                      fail-suspend      extensions/fail-suspend.d/
x2goterminate-session pre-terminate     extensions/pre-terminate.d/
                      post-terminate    extensions/post-terminate.d/
                      fail-terminate    extensions/fail-terminate.d/

IMPORTANT: When providing X2Go Server extensions by this mechanism, please pretty well make sure that these extension scripts of yours that you place in either of the above folders do under no circumstance fail during execution. Return codes are ignored and failures are therefore not (yet) propagated.

Execution of Extensions

Scripts (or binaries) that have been placed into one of the pre/post/fail modality folders (see above) are executed in alpha-numerical sorting order.

Extensions will only get executed if their file names start with three digits. This restriction is there to make sure that X2Go Server extensions get executed in the correct/wanted order:

For example:

Return Values

As exitcode x2goserver-run-extensions always returns 0 and pretends to be permanently happy :-).

See Also

x2gostartagent(8), x2goruncommand(8), x2goresume-session(8), x2gosuspend-session(8) and x2goterminate-session(8).


This manual has been written by Mike Gabriel <mike.gabriel@das-netzwerkteam.de> for the X2Go project (http://www.x2go.org).


Okt 2014 Version X2Go Server Tool