x2goserver-run-extensions(8)
π x2goserver-run-extensions π
okay bestie, this is a page from the X2Go Server Tool manual set, and it's about x2goserver-run-extensions(8) β the little script-runner that lets third-party extension packages do their thing without anyone having to touch the X2Go core. buckle up, it's giving β¨ infrastructure β¨.
β¨ NAME β¨
x2goserver-run-extensions β run X2Go Server extensions π§
πΈ SYNOPSIS πΈ
x2goserver-run-extensions <session_id> <modality>
π¦ DESCRIPTION π¦
x2goserver-run-extensions is called from within a number of X2Go Server core scripts. it's a backstage-pass situation, iykyk.
β οΈ WARNING: do not call it directly unless you really, really know what you're doing. like, genuinely. no cap.
what it does: x2goserver-run-extensions executes scripts that have been provided by third-party X2Go extension packages. slay.
but the tea is β this man page is not actually about how to use the script itself. it's about how you provide X2Go server extensions and features without needing to change the core X2Go server scripts. that's the whole point, and honestly? iconic design. periodt.
π MODALITIES π
x2goserver-run-extensions gets called with user privileges. the first command line argument is the session ID, and the second command line argument is a so-called modality.
that modality is basically a little vibe check for the calling script: it tells x2goserver-run-extensions at what stage of an X2Go session startup, resumption, suspension or termination the caller currently is at. π
these X2Go Server core scripts currently call x2goserver-run-extensions:
x2gostartagent(8)x2goruncommand(8)x2goresume-session(8)x2gosuspend-session(8)x2goterminate-session(8)
every modality name refers to a sub-directory of this path:
<libexecdir>/x2go/extensions
where <libexecdir> is /usr/libexec/x2go or /usr/lib/x2go on commonly-used GNU/Linux systems. yes, both, depends on your distro's whole thing. π«Ά
so in any of these sub-directories, third-party X2Go extension packages can drop scripts or binaries β and those then get executed by the core X2Go server commands, either before or after the essential functionality (think x2goagent startup, x2goagent suspension, x2goagent resumption, etc.) or on failure of that essential functionality. a whole little choreography. π
here's the full rundown of available modalities, which script calls them, and where you park your extension scripts:
x2gostartagent calls:
pre-startβ scripts live inextensions/pre-start.d/post-startβ scripts live inextensions/post-start.d/fail-startβ scripts live inextensions/fail-start.d/
x2goruncommand calls:
pre-runcommandβ scripts live inextensions/pre-runcommand.d/post-runcommandβ scripts live inextensions/post-runcommand.d/fail-runcommandβ scripts live inextensions/fail-runcommand.d/
x2goresume-session calls:
pre-resumeβ scripts live inextensions/pre-resume.d/post-resumeβ scripts live inextensions/post-resume.d/fail-resumeβ scripts live inextensions/fail-resume.d/
x2gosuspend-session calls:
pre-suspendβ scripts live inextensions/pre-suspend.d/post-suspendβ scripts live inextensions/post-suspend.d/fail-suspendβ scripts live inextensions/fail-suspend.d/
x2goterminate-session calls:
pre-terminateβ scripts live inextensions/pre-terminate.d/post-terminateβ scripts live inextensions/post-terminate.d/fail-terminateβ scripts live inextensions/fail-terminate.d/
π¨ IMPORTANT: when you're providing X2Go Server extensions through this mechanism, please pretty well make sure that the 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. so like, your script's little feelings are not being heard. write defensively, bestie. π
π EXECUTION OF EXTENSIONS π
scripts (or binaries) that have been placed into one of the pre/post/fail modality folders (see above π) get executed in alpha-numerical sorting order. alphabetical, basically. orderly. cute.
but here's the catch, and it's a big one: extensions will only get executed if their file names start with three digits followed by an underscore character. ___ style. that restriction is in place to make sure X2Go Server extensions get executed in the correct/wanted order. the vibes must be sequenced. π₯
for example:
010_x2goserver-statistics
020_x2goserver-mail-notify
021_x2goserver-monitoring
etc. pp.
see how they line up? 010 before 020 before 021. chef's kiss. π
π RETURN VALUES π
x2goserver-run-extensions always returns 0 as exit code and pretends to be permanently happy :-).
that's it. that's the return value. it's thriving. it refuses to elaborate. π
β SEE ALSO β
x2gostartagent(8), x2goruncommand(8), x2goresume-session(8), x2gosuspend-session(8) and x2goterminate-session(8).
π AUTHOR π
this manual has been written by Mike Gabriel <mike.gabriel@das-netzwerkteam.de> for the X2Go project (https://www.x2go.org).
and that's the whole page, bestie!! π«Ά this was Version 4.1.0.6, dated Aug 2023, and it's the x2goserver-run-extensions(8) page β go forth and write extensions that never fail, mwah π
β¨
π¦ where this page comes from
- alpine 3.24: x2goserver-doc 4.1.0.6-r0 Β· GPL-2.0-or-later
- debian trixie: x2goserver-extensions 4.1.0.6-1.1 Β· GPL-2.0-or-later
- fedora 43: x2goserver 4.1.0.6-13.fc43 Β· GPL-2.0-or-later
- fedora 44: x2goserver 4.1.0.6-14.fc44 Β· GPL-2.0-or-later
- ubuntu noble: x2goserver-extensions 4.1.0.6-1.1build1 Β· GPL-2.0-or-later
- ubuntu questing: x2goserver-extensions 4.1.0.6-1.1build2
- ubuntu resolute: x2goserver-extensions 4.1.0.6-1.1build3 Β· GPL-2.0-or-later
- ubuntu stonking: x2goserver-extensions 4.1.0.6-1.1build3 Β· GPL-2.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms