RSTARTD(1)
okay bestie, sit DOWN π
this is RSTARTD(1), from the General Commands Manual, and we are gonna get you fluent in the Remote Start helper situation. it's giving sysadmin lore, it's giving 90s X11 energy, and honestly? it's iconic. no cap.
πΈ NAME πΈ
rstartd β a sample implementation of a Remote Start rsh helper π«Ά
β¨ SYNOPSIS β¨
rstartd
rstartd.real [-c configfilename]
π¦ DESCRIPTION π¦
rstartd is an implementation of a Remote Start "helper" as defined in "A Flexible Remote Execution Protocol Based on rsh". literally the blueprint. the source material.
This document describes the peculiarities of rstartd and how it is configured. and bestie, there are peculiarities. we love her for it. π
π OPTIONS π
-cconfigfilename β this one right here? it specifies the "global" configuration file thatrstartdis to read. Normally,rstartdis a shell script that invokesrstartd.realwith the-cswitch, which is how you get local configuration of the location of the configuration file β cute, right? but ifrstartd.realgets started with no-coption at all, it just goes ahead and reads/etc/X11/rstart/config. default behavior, main character energy. π
π INSTALLATION π
okay this part is CRITICAL, not even being dramatic. for the Remote Start protocol to interoperate successfully, it is critical that rstartd be installed in a directory which is in the "default" search path. why? so that default rsh requests and the ilk will be able to find it. if it's not findable, the whole vibe collapses. π
π CONFIGURATION AND OPERATION π
rstartd is by design highly configurable. like, the most configurable. one would like things like configuration file locations to be fixed, so that users and administrators can find them without searching β but reality is that no two vendors will agree on where things should go, and nobody thinks the original location is "right". thus, rstartd allows one to relocate all of its files and directories. slay, honestly. flexible queen. π
the config file hierarchy ποΈ
rstartd has a hierarchy of configuration files which are executed in order when a request is made. They are:
- global config
- per-user ("local") config
- global per-context config
- per-user ("local") per-context config
- config from request
As you might guess from the presence of "config from request", all of the config files are in the format of an rstart request. rstartd defines a few additional keywords with the INTERNAL- prefix for specifying its configuration. (those are down below, bestie, don't scroll past them π)
the actual flow β¨
rstartd starts by reading and executing the global config file. This file will normally specify the locations of the other configuration files and any systemwide defaults.
rstartd will then read the user's local config file, default name $HOME/.rstart.
rstartd will then start interpreting the request.
Presumably one of the first lines in the request will be a CONTEXT line. The context name is converted to lower case. (lowercase supremacy π«Ά)
rstartd will read the global config file for that context, default name /usr/lib/X11/rstart/contexts/<name>, if any.
It will then read the user's config file for that context, default name $HOME/.rstart.contexts/<name>, if any.
(If neither of these exists,rstartdaborts with aFailuremessage.) π that's it, that's the whole thing, no context no service.
rstartd will finish interpreting the request, and execute the program specified.
who's actually in charge here π€
This allows the system administrator and the user a large degree of control over the operation of rstartd. The administrator has final say, because the global config file doesn't need to specify a per-user config file. If it does, however, the user can override anything from the global file, and can even completely replace the global context config files. power dynamics, but make it config files. π
format tea β
The config files have a somewhat more flexible format than requests do; they are allowed to contain blank lines and lines beginning with # are comments and ignored. (#s in the middle of lines are data, not comment markers.) so # at the start = ignored, # in the middle = real actual data. don't get it twisted. π₯
environment variables that get passed to the kids π§
Any commands run are provided a few useful pieces of information in environment variables. The exact names are configurable, but the supplied defaults are:
$RSTART_CONTEXT$RSTART_GLOBAL_CONTEXTSβ the global contexts directory$RSTART_LOCAL_CONTEXTSβ the local contexts directory$RSTART_GLOBAL_COMMANDSβ the global generic commands directory$RSTART_LOCAL_COMMANDSβ the local generic commands directory
$RSTART_{GLOBAL,LOCAL}_CONTEXTS should contain one special file, @List, which contains a list of the contexts in that directory in the format specified for ListContexts. The supplied version of ListContexts will cat both the global and local copies of @List. two files, one cat, no thoughts. π
where do generic commands live π
Generic commands are searched for in several places (defaults, in this order):
- per-user per-context directory (
$HOME/.rstart.commands/<context>) - global per-context directory (
/usr/lib/X11/rstart/commands/<context>) - per-user all-contexts directory (
$HOME/.rstart.commands) - global all-contexts directory (
/usr/lib/X11/rstart/commands)
(Yes, this means you can't have an all-contexts generic command with the same name as a context. It didn't seem like a big deal.) π
Each of these directories should have a file called @List that gives the names and descriptions of the commands in that directory in the format specified for ListGenericCommands.
π CONFIGURATION KEYWORDS π
There are several "special" rstart keywords defined for rstartd configuration. Unless otherwise specified, there are no defaults; related features are disabled in this case. (so if you don't set it, it's off. simple as.)
INTERNAL-REGISTRIESname ... β Gives a space-separated list of "MISC" registries that this system understands. (Registries other than this are accepted but generate aWarning.) β οΈINTERNAL-LOCAL-DEFAULTrelative_filename β Gives the name ($HOMErelative) of the per-user config file.INTERNAL-GLOBAL-CONTEXTSabsolute_directory_name β Gives the name of the system-wide contexts directory.INTERNAL-LOCAL-CONTEXTSrelative_directory_name β Gives the name ($HOMErelative) of the per-user contexts directory.INTERNAL-GLOBAL-COMMANDSabsolute_directory_name β Gives the name of the system-wide generic commands directory.INTERNAL-LOCAL-COMMANDSrelative_directory_name β Gives the name ($HOMErelative) of the per-user generic commands directory.INTERNAL-VARIABLE-PREFIXprefix β Gives the prefix for the configuration environment variablesrstartdpasses to its kids.INTERNAL-AUTH-PROGRAMauthscheme program argv[0] argv[1] ... β Specifies the program to run to set up authentication for the specified authentication scheme. "program argv[0] ..." gives the program to run and its arguments, in the same form as theEXECkeyword.INTERNAL-AUTH-INPUTauthscheme β Specifies the data to be given to the authorization program as its standard input. Each argument is passed as a single line.$n, where n is a number, is replaced by the n'th argument to the "AUTHauthscheme arg1 arg2 ..." line.INTERNAL-PRINTarbitrary text β Prints its arguments as aDebugmessage. Mostly forrstartddebugging, but could be used to debug config files. (debug queen behavior π)
π NOTES π
okay this is the lore dump section, grab a snack.
When using the C shell, or any other shell which runs a script every time the shell is started, the script may get run several times. In the worst case, the script may get run three times:
- By
rsh, to runrstartd - By
rstartd, to run the specified command - By the command, eg
xterm
rstartd currently limits lines, both from config files and requests, to BUFSIZ bytes. π
DETACH is implemented by redirecting file descriptors 0, 1, and 2 to /dev/null and forking before executing the program.
CMD is implemented by invoking $SHELL (default /bin/sh) with "-c" and the specified command as arguments.
POSIX-UMASK is implemented in the obvious way.
The authorization programs are run in the same context as the target program β same environment variables, path, etc. Long term this might be a problem. π
In the X context, GENERIC-CMD Terminal runs xterm. In the OpenWindows context, GENERIC-CMD Terminal runs cmdtool.
In the X context, GENERIC-CMD LoadMonitor runs xload. In the OpenWindows context, GENERIC-CMD LoadMonitor runs perfmeter.
GENERIC-CMD ListContexts lists the contents of @List in both the system-wide and per-user contexts directories. It is available in all contexts.
GENERIC-CMD ListGenericCommands lists the contents of @List in the system-wide and per-user commands directories, including the per-context subdirectories for the current context. It is available in all contexts.
CONTEXT None is not implemented. π«
CONTEXT Default is really dull. π΄ (no shade but like, shade)
For installation ease, the "contexts" directory in the distribution contains a file "@Aliases" which lists a context name and aliases for that context. This file is used to make symlinks in the contexts and commands directories.
All MISC values are passed unmodified as environment variables.
One can mistreat rstartd in any number of ways, resulting in anything from stupid behavior to core dumps. π Other than by explicitly running programs I don't think it can write or delete any files, but there's no guarantee of that. The important thing is that (a) it probably won't do anything REALLY stupid and (b) it runs with the user's permissions, so it can't do anything catastrophic. so like... chaotic but contained. we stan a bounded chaos. π
@List files need not be complete; contexts or commands which are dull or which need not or should not be advertised need not be listed. In particular, per-user @List files should not list things which are in the system-wide @List files. In the future, perhaps ListContexts and ListGenericCommands will automatically suppress lines from the system-wide files when there are per-user replacements for those lines.
Error handling is OK to weak. In particular, no attempt is made to properly report errors on the exec itself. (Perversely, exec errors could be reliably reported when detaching, but not when passing the stdin/out socket to the app.) π it's giving "we tried our best."
If compiled with -DODT1_DISPLAY_HACK, rstartd will work around a bug in SCO ODT version 1. (1.1?) (The bug is that the X clients are all compiled with a bad library that doesn't know how to look host names up using DNS. The fix is to look up a host name in $DISPLAY and substitute an IP address.) This is a trivial example of an incompatibility that rstart can hide. π₯ historical tea, honestly.
π₯ SEE ALSO π₯
π AUTHOR π
Jordan Brown, Quarterdeck Office Systems
and that's the whole page, bestie!! π this was RSTARTD(1) from X Version 11, rstart 1.0.6 β go forth and remote-start responsibly, you absolute legend. periodt. π
β¨
π¦ where this page comes from
- debian bookworm: x11-session-utils 7.7+5
- debian trixie: x11-session-utils 7.7+6+b1
- ubuntu noble: x11-session-utils 7.7+6build2
- ubuntu questing: x11-session-utils 7.7+6build2
- ubuntu resolute: x11-session-utils 7.7+6build3
- ubuntu stonking: x11-session-utils 7.7+6build3
- Copyright (c) 1993 Quarterdeck Office Systems
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms