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 command line argument the session ID and as the second command line argument a so-called 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.
These X2Go Server core scripts currently call x2goserver-run-extensions: x2gostartagent(8), x2goruncommand(8), x2goresume-session(8), x2gosuspend-session(8) and 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:
CALLING SCRIPT MODALITY NAMES EXTENSION SCRIPTS LOCATION
-------------- --------------- --------------------------
x2gostartagent pre-start extensions/pre-start.d/
x2goruncommand pre-runcommand extensions/pre-runcommand.d/
x2goresume-session pre-resume extensions/pre-resume.d/
x2gosuspend-session pre-suspend extensions/pre-suspend.d/
x2goterminate-session pre-terminate extensions/pre-terminate.d/
When providing X2Go Server extensions by this mechanism, please pretty well make sure that extension scripts 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 followed by an underscore character. This restriction is in place to make sure that X2Go Server extensions get executed in the correct/wanted order:
x2goserver-run-extensions always returns 0 as exit code and pretends to be permanently happy :-).
x2gostartagent(8), x2goruncommand(8), x2goresume-session(8), x2gosuspend-session(8) and x2goterminate-session(8).
This manual has been written by Mike Gabriel <email@example.com> for the X2Go project (https://www.x2go.org).