1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33RSTARTD(1)                  General Commands Manual                 RSTARTD(1)
34
35
36

NAME

38       rstartd - a sample implementation of a Remote Start rsh helper
39

SYNOPSIS

41       rstartd
42
43       rstartd.real [-c configfilename]
44

DESCRIPTION

46       Rstartd  is  an implementation of a Remote Start "helper" as defined in
47       "A Flexible Remote Execution Protocol Based on rsh".
48
49       This document describes the peculiarities of rstartd and how it is con‐
50       figured.
51

OPTIONS

53       -c configfilename
54               This  option  specifies  the  "global"  configuration file that
55               rstartd is to read.  Normally, rstartd is a shell  script  that
56               invokes rstartd.real with the -c switch, allowing local config‐
57               uration  of  the  location  of  the  configuration  file.    If
58               rstartd.real  is  started  without  the  -c  option,  it  reads
59               /usr/lib/X11/rstart/config.
60

INSTALLATION

62       It is critical to successful interoperation of the Remote Start  proto‐
63       col  that rstartd be installed in a directory which is in the "default"
64       search path, so that default rsh requests and the ilk will be  able  to
65       find it.
66

CONFIGURATION AND OPERATION

68       Rstartd  is  by design highly configurable.  One would like things like
69       configuration file locations to be fixed, so that users and administra‐
70       tors  can  find them without searching, but reality is that no two ven‐
71       dors will agree on where things should go, and nobody thinks the origi‐
72       nal  location  is "right".  Thus, rstartd allows one to relocate all of
73       its files and directories.
74
75       Rstartd has a hierarchy of configuration files which  are  executed  in
76       order when a request is made.  They are:
77       global config
78       per-user ("local") config
79       global per-context config
80       per-user ("local") per-context config
81       config from request
82       As  you  might guess from the presence of "config from request", all of
83       the config files are in the format of an rstart request.   Rstartd  de‐
84       fines  a few additional keywords with the INTERNAL- prefix for specify‐
85       ing its configuration.
86
87       Rstartd starts by reading and executing the global config  file.   This
88       file  will  normally  specify  the locations of the other configuration
89       files and any systemwide defaults.
90
91       Rstartd will then read the  user's  local  config  file,  default  name
92       $HOME/.rstart.
93
94       Rstartd will then start interpreting the request.
95
96       Presumably  one  of  the  first  lines in the request will be a CONTEXT
97       line.  The context name is converted to lower case.
98
99       Rstartd will read the global config file for that context, default name
100       /usr/lib/X11/rstart/contexts/<name>, if any.
101
102       It will then read the user's config file for that context, default name
103       $HOME/.rstart.contexts/<name>, if any.
104
105       (If neither of these exists, rstartd aborts with a Failure message.)
106
107       Rstartd will finish interpreting the request, and execute  the  program
108       specified.
109
110       This  allows  the  system  administrator and the user a large degree of
111       control over the operation of rstartd.   The  administrator  has  final
112       say,  because the global config file doesn't need to specify a per-user
113       config file.  If it does, however, the user can override anything  from
114       the  global  file,  and  can even completely replace the global context
115       config files.
116
117       The config files have a somewhat more flexible format than requests do;
118       they  are  allowed  to contain blank lines and lines beginning with "#"
119       are comments and ignored.  (#s in the middle of  lines  are  data,  not
120       comment markers.)
121
122       Any commands run are provided a few useful pieces of information in en‐
123       vironment variables.  The exact names are configurable,  but  the  sup‐
124       plied defaults are:
125       $RSTART_CONTEXT          the name of the context
126       $RSTART_GLOBAL_CONTEXTS  the global contexts directory
127       $RSTART_LOCAL_CONTEXTS   the local contexts directory
128       $RSTART_GLOBAL_COMMANDS  the global generic commands directory
129       $RSTART_LOCAL_COMMANDS   the local generic commands directory
130       $RSTART_{GLOBAL,LOCAL}_CONTEXTS should contain one special file, @List,
131       which contains a list of the contexts in that directory in  the  format
132       specified  for ListContexts.  The supplied version of ListContexts will
133       cat both the global and local copies of @List.
134
135       Generic commands are searched for in several places: (defaults)
136       per-user per-context directory ($HOME/.rstart.commands/<context>)
137       global per-context directory (/usr/lib/X11/rstart/commands/<context>)
138       per-user all-contexts directory ($HOME/.rstart.commands)
139       global all-contexts directory (/usr/lib/X11/rstart/commands)
140       (Yes, this means you can't have an all-contexts  generic  command  with
141       the same name as a context.  It didn't seem like a big deal.)
142
143       Each  of  these  directories should have a file called @List that gives
144       the names and descriptions of the commands in  that  directory  in  the
145       format specified for ListGenericCommands.
146

CONFIGURATION KEYWORDS

148       There are several "special" rstart keywords defined for rstartd config‐
149       uration.  Unless otherwise specified, there are  no  defaults;  related
150       features are disabled in this case.
151
152       INTERNAL-REGISTRIES name ...
153               Gives  a  space-separated  list  of "MISC" registries that this
154               system understands.  (Registries other than this  are  accepted
155               but generate a Warning.)
156
157       INTERNAL-LOCAL-DEFAULT relative_filename
158               Gives the name ($HOME relative) of the per-user config file.
159
160       INTERNAL-GLOBAL-CONTEXTS absolute_directory_name
161               Gives the name of the system-wide contexts directory.
162
163       INTERNAL-LOCAL-CONTEXTS relative_directory_name
164               Gives the name ($HOME relative) of the per-user contexts direc‐
165               tory.
166
167       INTERNAL-GLOBAL-COMMANDS absolute_directory_name
168               Gives the name of the system-wide generic commands directory.
169
170       INTERNAL-LOCAL-COMMANDS relative_directory_name
171               Gives the name ($HOME relative) of the  per-user  generic  com‐
172               mands directory.
173
174       INTERNAL-VARIABLE-PREFIX prefix
175               Gives  the  prefix  for the configuration environment variables
176               rstartd passes to its kids.
177
178       INTERNAL-AUTH-PROGRAM authscheme program argv[0] argv[1] ...
179               Specifies the program to run to set up authentication  for  the
180               specified  authentication  scheme.  "program argv[0] ..." gives
181               the program to run and its arguments, in the same form  as  the
182               EXEC keyword.
183
184       INTERNAL-AUTH-INPUT authscheme
185               Specifies  the data to be given to the authorization program as
186               its standard input.  Each argument is passed as a single  line.
187               $n,  where  n  is a number, is replaced by the n'th argument to
188               the "AUTH authscheme arg1 arg2 ..." line.
189
190       INTERNAL-PRINT arbitrary text
191               Prints its arguments as a Debug message.   Mostly  for  rstartd
192               debugging, but could be used to debug config files.
193

NOTES

195       When  using  the  C shell, or any other shell which runs a script every
196       time the shell is started, the script may get run  several  times.   In
197       the worst case, the script may get run three times:
198       By rsh, to run rstartd
199       By rstartd, to run the specified command
200       By the command, eg xterm
201       rstartd currently limits lines, both from config files and requests, to
202       BUFSIZ bytes.
203
204       DETACH is implemented by redirecting file descriptors  0,1,  and  2  to
205       /dev/null and forking before executing the program.
206
207       CMD  is  implemented by invoking $SHELL (default /bin/sh) with "-c" and
208       the specified command as arguments.
209
210       POSIX-UMASK is implemented in the obvious way.
211
212       The authorization programs are run in the same context  as  the  target
213       program  - same environment variables, path, etc.  Long term this might
214       be a problem.
215
216       In the X context, GENERIC-CMD Terminal runs xterm.  In the  OpenWindows
217       context, GENERIC-CMD Terminal runs cmdtool.
218
219       In  the X context, GENERIC-CMD LoadMonitor runs xload.  In the OpenWin‐
220       dows context, GENERIC-CMD LoadMonitor runs perfmeter.
221
222       GENERIC-CMD ListContexts lists the contents of @List in both  the  sys‐
223       tem-wide  and  per-user  contexts  directories.  It is available in all
224       contexts.
225
226       GENERIC-CMD ListGenericCommands lists the contents of @List in the sys‐
227       tem-wide  and  per-user commands directories, including the per-context
228       subdirectories for the current context.  It is available  in  all  con‐
229       texts.
230
231       CONTEXT None is not implemented.
232
233       CONTEXT Default is really dull.
234
235       For  installation  ease,  the  "contexts" directory in the distribution
236       contains a file "@Aliases" which lists a context name and  aliases  for
237       that  context.   This file is used to make symlinks in the contexts and
238       commands directories.
239
240       All MISC values are passed unmodified as environment variables.
241
242       One can mistreat rstartd in any number of ways, resulting  in  anything
243       from  stupid  behavior to core dumps.  Other than by explicitly running
244       programs I don't think it can write or delete any files, but there's no
245       guarantee  of  that.  The important thing is that (a) it probably won't
246       do anything REALLY stupid and (b) it runs with the user's  permissions,
247       so it can't do anything catastrophic.
248
249       @List  files  need not be complete; contexts or commands which are dull
250       or which need not or should not be advertised need not be  listed.   In
251       particular,  per-user  @List  files should not list things which are in
252       the system-wide @List files.  In the future, perhaps  ListContexts  and
253       ListGenericCommands  will automatically suppress lines from the system-
254       wide files when there are per-user replacements for those lines.
255
256       Error handling is OK to weak.  In particular, no  attempt  is  made  to
257       properly  report  errors  on the exec itself.  (Perversely, exec errors
258       could be reliably reported when detaching, but  not  when  passing  the
259       stdin/out socket to the app.)
260
261       If compiled with -DODT1_DISPLAY_HACK, rstartd will work around a bug in
262       SCO ODT version 1.  (1.1?)  (The bug is that the X clients are all com‐
263       piled  with  a  bad library that doesn't know how to look host names up
264       using DNS.  The fix is to look up a host name in $DISPLAY  and  substi‐
265       tute  an  IP address.)  This is a trivial example of an incompatibility
266       that rstart can hide.
267

SEE ALSO

269       rstart(1), rsh(1), A Flexible Remote Execution Protocol Based on rsh
270

AUTHOR

272       Jordan Brown, Quarterdeck Office Systems
273
274
275
276X Version 11                     rstart 1.0.2                       RSTARTD(1)
Impressum