home *** CD-ROM | disk | FTP | other *** search
/ Chip 2001 August - Disc 2 / chip_20018102_hu.iso / linux / X-4.1.0 / doc / rstart.txt < prev    next >
Text File  |  2001-06-27  |  33KB  |  1,261 lines

  1.  
  2.  
  3.  
  4.  
  5.  
  6.  
  7. X Consortium                            J. Brown
  8. INTERNET-DRAFT                      Quarterdeck Office Systems
  9.                                  August 1993
  10.  
  11.  
  12.        A Flexible Remote Execution Protocol Based on rsh
  13.  
  14.  
  15. Status of this Memo
  16.  
  17.  
  18.      This document is being distributed to members of the Internet
  19.      community in order to solicit their reactions to the proposals
  20.      contained in it.  This memo does not specify an Internet
  21.      Standard.    Distribution of this memo is unlimited.
  22.  
  23.      This document is an Internet-Draft.  Internet-Drafts are
  24.      working documents of the Internet Engineering Task Force
  25.      (IETF), its areas, and its working groups.  Note that other
  26.      groups may also distribute working documents as Internet-
  27.      Drafts.
  28.  
  29.      Internet-Drafts are draft documents valid for a maximum of six
  30.      months.  Internet-Drafts may be updated, replaced, or
  31.      obsoleted by other documents at any time.    It is not
  32.      appropriate to use Internet-Drafts as reference material or to
  33.      cite them other than as a "working draft" or "work in
  34.      progress."
  35.  
  36.      To learn the current status of any Internet-Draft, please
  37.      check the 1id-abstracts.txt listing contained in the Internet-
  38.      Drafts Shadow Directories on ds.internic.net, nic.nordu.net,
  39.      ftp.nisc.sri.com, or munnari.oz.au.
  40.  
  41.      This document is filed under "(filename here)".
  42.  
  43.  
  44. Background:
  45.  
  46. One of the X Window System's main strengths is the ability to display
  47. and control graphical applications remotely.  It does not, however,
  48. address the issue of how to start these applications - the application
  49. initiates the connection to the server sitting in front of the user, not
  50. the other way 'round.  Some other, non-X, mechanism must be used to
  51. start the application.
  52.  
  53.  
  54.  
  55.  
  56.  
  57.  
  58. Brown                            FORMFEED[Page 1]
  59.  
  60.  
  61.  
  62.  
  63.  
  64. DRAFT                                 August 1993
  65.  
  66.  
  67. Current methods and their problems:
  68.  
  69. 1)   Walk over to the other machine, log in, and run something with its
  70.      display redirected to your workstation.  Not very appealing, but
  71.      simple.  No security problems associated with whether or not you
  72.      should be able to run something on that machine.
  73.  
  74. 2)   Telnet to the other machine, log in, and run something with its
  75.      display redirected to your workstation.  Relatively simple, but
  76.      doesn't allow for starting remote apps using a menu item - requires
  77.      either human intervention or an autologin mechanism with its
  78.      associated troubles.  Security implication is that the password is
  79.      passed "raw" over the telnet connection and is susceptible to
  80.      snooping.
  81.  
  82. 3)   Use one of the non-standard Berkeley UNIX(R) "remote command"
  83.      facilities, or their Kerberized equivalents - rsh, rexec, krsh.
  84.      These can provide for the no-human-involved startup desired for
  85.      menus, but have security implications which have been adequately
  86.      documented elsewhere and require tuning to achieve "desirable"
  87.      operation, or indeed operation at all.
  88.  
  89. 4)   Other proprietary schemes.
  90.  
  91. Well, (1) is obviously not very pleasant.  (2) isn't much better,
  92. because you can't run things off menu items.  Neither (1) nor (2) is
  93. "friendly" to an automatic session-restart system.  (4), being
  94. proprietary, isn't of much interest in a wide context.    (Note that in
  95. any of these cases once you've started an app, an xterm say, you can ask
  96. it to start others.  This is OK for some people, but not very acceptable
  97. if you want things picked off menus and especially not if you want apps
  98. on various machines picked off the same menu.  It also isn't friendly to
  99. automatic session-restart schemes.)
  100.  
  101. (3) is what this memo discusses.
  102.  
  103. Problems:
  104.  
  105. o    Systems and shells vary in what exactly constitutes a "command" and
  106.      what the syntax is.
  107.  
  108. o    The apps might not be in the "system default search path".
  109.  
  110. o    The apps might require additional setup before they can run -
  111.      environment variables, etc.  (LD_LIBRARY_PATH with OpenWindows 2 on
  112.      Suns)
  113.  
  114.  
  115.  
  116.  
  117.  
  118. Brown                            FORMFEED[Page 2]
  119.  
  120.  
  121.  
  122.  
  123.  
  124. DRAFT                                 August 1993
  125.  
  126.  
  127. o    Resources (TCP connections, processes, etc) get held open on both
  128.      ends to support the (mostly-idle) rsh connection.
  129.  
  130. o    No standard way to pass environment variables - DISPLAY,
  131.      SESSION_MANAGER, etc.
  132.  
  133. These issues, both in their complexity and in their system-specificity,
  134. cause continual trouble for less technically aware users and are a
  135. nuisance even for technical users.  In addition, more sophisticated uses
  136. of remote execution mechanisms (session restart for instance) may
  137. require more control over the environment than is available through the
  138. normal rsh mechanism.
  139.  
  140. The result is that a great deal of system-dependent manual tuning is
  141. required to achieve a pleasant result, where the DISPLAY and
  142. SESSION_MANAGER values (and others in the future) are passed
  143. transparently, where the app actually gets started(!), where unnecessary
  144. resources are not held open, etc.
  145.  
  146. The obvious answer is to define a "better" remote execution mechanism,
  147. but that has a host of problems - while rsh and friends have their
  148. security problems, at least they are reasonably well understood and the
  149. "trusted" executables have been extensively tested.  A new mechanism
  150. would have to be analysed and tested before it could be trusted.
  151.  
  152. Better to make effective use of current services, and take advantage of
  153. such services as may become available in the future.  In the future some
  154. better remote execution protocol may become available.    Such a protocol
  155. may address some of the issues this paper is intended to address like
  156. passing auxiliary information, but will probably not address issues like
  157. setting up the environment required to run an X app.  Fine, adopt it,
  158. and adopt conventions like those discussed here to allow its convenient
  159. use for X applications.
  160.  
  161. In this spirit this paper does not mandate "thou shalt start X apps
  162. using rsh", but rather "If you support X, you should arrange that the
  163. following rsh request will start an X app properly".
  164.  
  165. Such a solution would be to layer a more flexible protocol on top of rsh
  166. et al, using rsh's standard in/out mechanism to pass initial setup
  167. information to a "helper" program on the other end.  Since rsh (or
  168. whatever) has already handled the security aspects of the request, the
  169. helper need have no particular special privileges and hence adds no new
  170. security considerations.
  171.  
  172. "Why rsh?"  While this paper refers to "rsh" all over the place, few if
  173. any of the concepts are peculiar to rsh.  Any form of remote execution
  174. protocol that handles the security aspects of remote execution and
  175.  
  176.  
  177.  
  178. Brown                            FORMFEED[Page 3]
  179.  
  180.  
  181.  
  182.  
  183.  
  184. DRAFT                                 August 1993
  185.  
  186.  
  187. provides a bidirectional data stream to the resulting program can be
  188. used.  Rsh, rexec, and krsh are obvious examples, but there is no reason
  189. why telnet could not be used, when combined with a scripting mechanism
  190. to do autologin.
  191.  
  192. "But I don't use X, why do I want this?"  Again, while this paper refers
  193. to X all over the place and the impetus for creation of this protocol is
  194. starting and restarting X applications, the mechanisms defined are as
  195. independent of X as possible and are applicable to non-X start/restart
  196. problems.
  197.  
  198. "I don't use POSIX.  What do I do?"  The initial target systems are
  199. generally POSIX-based or POSIX-like, and so there are some POSIX-
  200. specific features and lots of POSIX-specific examples, but the protocol
  201. is designed to be operating-system independent.  Such OS independence
  202. is, in fact, one of the primary goals - to provide an OS-independent
  203. remote execution mechanism.
  204.  
  205.  
  206.  
  207.  
  208.  
  209.  
  210.  
  211.  
  212.  
  213.  
  214.  
  215.  
  216.  
  217.  
  218.  
  219.  
  220.  
  221.  
  222.  
  223.  
  224.  
  225.  
  226.  
  227.  
  228.  
  229.  
  230.  
  231.  
  232.  
  233.  
  234.  
  235.  
  236.  
  237.  
  238. Brown                            FORMFEED[Page 4]
  239.  
  240.  
  241.  
  242.  
  243.  
  244. DRAFT                                 August 1993
  245.  
  246.  
  247.            The Remote Start Protocol "rstart"
  248.  
  249. Goals:
  250.  
  251.  
  252. o    A requester should be able to have a program started in any of a
  253.      number of predefined "contexts".  (For instance, on a dual-universe
  254.      Berkeley UNIX / System V UNIX system those might be two such
  255.      contexts.    On a system with multiple versions of the X Window
  256.      System installed each would be available as a predefined context.
  257.      A VAX might support VMS and Eunice contexts.)
  258.  
  259. o    A requester should be able to override (within security bounds
  260.      usual to the system) any aspect of the environment.
  261.  
  262. o    Neither the requesting program nor the "helper" program on the host
  263.      end should need to have any special privileges.
  264.  
  265. o    Any parameter of the environment that can be controlled should be
  266.      controllable through this mechanism.  In particular, on POSIX
  267.      systems environment variables, open files(?), umask, current
  268.      directory, etc should all be controllable.
  269.  
  270. o    The full richness of the host's command argument mechanism should
  271.      be available.  In particular, on POSIX this means that arguments
  272.      may contain any character and may be of any length.
  273.  
  274. o    Notwithstanding all of the control afforded the requester, none of
  275.      it should be required - the requester should be able to provide
  276.      simple "command lines" which will be executed in the desired
  277.      environment much as if they were typed to a conventional command
  278.      processor.
  279.  
  280. o    A "Generic Command" mechanism is provided, where standardized
  281.      commands result in an appropriate response, independent of the host
  282.      system.  (This might be considered to be similar to the FTP model,
  283.      where the LIST command will produce a directory listing no matter
  284.      what the underlying system.)
  285.  
  286.  
  287. Requesting System Requirements:
  288.  
  289. The requesting system MUST support an "rsh" client or a suitable
  290. replacement.  Support of the rsh standard error and control connection
  291. is desirable but not essential.
  292.  
  293. Host System Requirements:
  294.  
  295.  
  296.  
  297.  
  298. Brown                            FORMFEED[Page 5]
  299.  
  300.  
  301.  
  302.  
  303.  
  304. DRAFT                                 August 1993
  305.  
  306.  
  307. The host system MUST support an "rsh" server or a suitable replacement.
  308. Support of the rsh standard error and control connection is desirable
  309. but not essential.  Invocation of the "rstartd" program in the default
  310. rsh environment MUST "work".  On POSIX systems this might require that
  311. rstartd be installed in one of the directories in the default $PATH and
  312. that rstartd not need any non-default shared library setup, etc.  On
  313. other systems it might require that the rsh server specially recognize
  314. the string "rstartd" and take appropriate action.
  315.  
  316. The protocol itself:
  317.  
  318. The requesting system makes a remote execution request using rsh (or
  319. other suitable protocol) to execute the program "rstartd".  The host
  320. system responds with any amount of data (to accomodate systems that want
  321. to natter before starting a program), and then sends a line consisting
  322. of (exactly):
  323.      rstartd:<space>Ready:<space><welcome/version message>
  324. Failure to receive this line before the connection closes indicates that
  325. the host system does not support Extended rsh.    A timeout is probably
  326. appropriate in addition.
  327.  
  328. The requester then sends a series of lines of ASCII specifying the
  329. program to be run and the environment in which it is to be run.  The
  330. request is terminated by a blank line.
  331.  
  332. Syntax:  rstart data is passed as a series of lines of ASCII, with
  333. spaces delimiting words in each line, terminated by a blank line.  A
  334. "line" is terminated by an ASCII LF.  CRs and NULs MUST be ignored, to
  335. allow for a system transmitting in Internet NVT ASCII.    (Yes, rsh et al
  336. are POSIX-style tools and won't have CRs, but if there's ever an
  337. Internet standard remote exec mechanism it will almost certainly require
  338. NVT ASCII, so it seems wise to provide for that possibility from the
  339. start.)  It is explicitly allowed for a system to discard characters
  340. other than LF outside the range decimal 32-126; characters outside that
  341. range MUST NOT be used.  Words may contain spaces and non-printable
  342. characters by representing them as octal escape sequences consisting of
  343. a backslash followed by three octal digits.  Note that backslashes
  344. themselves MUST be passed using this mechanism.  Thus the initial
  345. parsing sequence consists of:
  346.  
  347.  
  348. 1)   Receive data until the first blank line.
  349.  
  350. 2)   Break data into lines at LFs, discarding CRs and NULs.
  351.  
  352. 3)   Break lines into words at spaces.
  353.  
  354.  
  355.  
  356.  
  357.  
  358. Brown                            FORMFEED[Page 6]
  359.  
  360.  
  361.  
  362.  
  363.  
  364. DRAFT                                 August 1993
  365.  
  366.  
  367. 4)   Translate \nnn sequences in words into the appropriate characters.
  368.  
  369. 5)   Process each line as appropriate.
  370.  
  371. 6)   Pass (or more likely, allow to be passed) the connection and any
  372.      data after the blank line to the program.    (??? Hmm.  stdio
  373.      buffering considerations.    Byte count instead of blank line?)
  374.  
  375. The first word of each line is a keyword specifying the interpretation
  376. of the line.  Keywords SHOULD be transmitted as shown in this document,
  377. but the receiver MUST accept them in any case, even mIxEd.
  378.  
  379. Unless otherwise specified, only one instance of any given keyword is
  380. permitted in a given request.  CONTEXT MUST be specified first, and
  381. after that keywords may be given in any order.
  382.  
  383. After receiving the blank line, the host responds with any number of
  384. lines of output of the following forms, terminated by a blank line.
  385.  
  386. rstartd: Ready: <message>
  387.  
  388.      (This isn't one of the "response" lines, but it's included here for
  389.      completeness.)  This is rstartd's "hello" line, and confirms that
  390.      the host does indeed support rstartd.
  391.  
  392.  
  393. rstartd: Failure: <message>
  394.  
  395.      An unrecoverable error has occurred which indicates that either the
  396.      requester or the host is fatally misconfigured.  This might occur
  397.      if, for instance, a request is malformed or a required
  398.      configuration file is not present.
  399.  
  400.  
  401. rstartd: Error: <message>
  402.  
  403.      An unrecoverable error has occurred which indicates that the
  404.      request is in error.  The most common such error would be that the
  405.      requested program is unavailable.
  406.  
  407.  
  408. rstartd: Warning: <message>
  409.  
  410.      A recoverable error has occurred.    The program will be executed but
  411.      may not behave as desired.
  412.  
  413.  
  414. rstartd: Success: <message>
  415.  
  416.  
  417.  
  418. Brown                            FORMFEED[Page 7]
  419.  
  420.  
  421.  
  422.  
  423.  
  424. DRAFT                                 August 1993
  425.  
  426.  
  427.      No errors were detected.  Unfortunately this does not mean that no
  428.      errors will occur, because there are many classes of errors that
  429.      cannot be detected until rstartd actually attempts to pass control
  430.      to the program.
  431.  
  432.  
  433. rstartd: Debug: <message>
  434.  
  435.      A debug message.  Programs (and most humans!) should ignore these.
  436.  
  437.  
  438. <anything else>
  439.  
  440.      Indicates that something else in the system just HAD to say
  441.      something; should be treated as a Warning.
  442.  
  443.  
  444.  
  445.  
  446.  
  447.  
  448.  
  449.  
  450.  
  451.  
  452.  
  453.  
  454.  
  455.  
  456.  
  457.  
  458.  
  459.  
  460.  
  461.  
  462.  
  463.  
  464.  
  465.  
  466.  
  467.  
  468.  
  469.  
  470.  
  471.  
  472.  
  473.  
  474.  
  475.  
  476.  
  477.  
  478. Brown                            FORMFEED[Page 8]
  479.  
  480.  
  481.  
  482.  
  483.  
  484. DRAFT                                 August 1993
  485.  
  486.  
  487. Keywords
  488.  
  489. CONTEXT name
  490.  
  491. Initializes defaults suitable for the specified context.  See the
  492. section on contexts for more information.
  493.  
  494. CONTEXT must be present, and must be the first line of the request.
  495.  
  496. CMD command args args args
  497.  
  498. Executes the specified command with the specified arg in the same
  499. general way as it would have been executed if typed to a the user's
  500. command interpreter.  (If the user's primary interface is not a command
  501. language, a system default command language should be used.)  It is
  502. expected that the command will have been provided by a user, who will
  503. expect "normal" command language handling of it.  (For POSIX people,
  504. consider this as roughly equivalent to system().)
  505.  
  506. Note:  No particular parsing or interpretation is guaranteed.  The
  507. interpretation should be unsurprising to an ordinary user of the host
  508. system.  This mechanism is therefore unsuitable for completely automated
  509. use; EXEC and GENERIC-CMD are provided for that purpose.
  510.  
  511. Exactly one of CMD, EXEC, or GENERIC-CMD must be present.
  512.  
  513. EXEC progname namearg arg arg arg ...
  514.  
  515. Executes a program using a low-level execution mechanism which provides
  516. minimal interpretation; in particular a command processor should not
  517. enter the picture and no quoting other than that required by this
  518. protocol should be required.  It is expected that this interface will be
  519. used by programs requesting restart; presumably they know exactly what
  520. their desired arguments are and a command processor will only confuse
  521. the issue.  (For POSIX people, consider this to be like execlp().)
  522.  
  523. Progname is the name of the executable.  This will typically be a single
  524. word but is allowed to be a (system-specific) full filename
  525. specification; if the latter then the behavior is system-specific but
  526. normally path searching would be disabled.
  527.  
  528. Namearg should be the program name as it should be passed to the
  529. program.  Generally, it should be exactly equal to progname.  Hosts
  530. which do not pass a program's name to it should ignore it.
  531.  
  532. The args are the arguments to be passed to the program.  Hosts which do
  533. not separate their arguments into words should concatenate the arguments
  534. back together with spaces between them.  (Optionally, they could elect
  535.  
  536.  
  537.  
  538. Brown                            FORMFEED[Page 9]
  539.  
  540.  
  541.  
  542.  
  543.  
  544. DRAFT                                 August 1993
  545.  
  546.  
  547. to not fully parse the line, and leave in the spaces as originally
  548. delivered.)
  549.  
  550. Note:  The interpretation of the command may not be intuitive to an
  551. ordinary user of the host system; this interface is for precision, not
  552. intuition.
  553.  
  554. Exactly one of CMD, EXEC, or GENERIC-CMD must be present.
  555.  
  556. DIR initial-directory
  557.  
  558. Specifies (in a system-specific way) the initial default file system
  559. location for the program.  If no DIR line is supplied the program is
  560. started in a system-specific initial location, presumably the user's
  561. "home".
  562.  
  563. Note:  It is expected that this value would come from a source with a
  564. priori knowlege of the host - either the user or a "restart" request.
  565. It is not expected that an automated mechanism with no advance knowlege
  566. would be able to make use of this request.
  567.  
  568. MISC registryname name=value
  569.  
  570. Passes a value to the program using a system-specific mechanism.  (Under
  571. POSIX and similar systems environment variables should generally be
  572. used.)    The registryname specifies the naming authority, and is intended
  573. to prevent conflicts and allow for intelligent conversion.  The idea is
  574. that systems that understand a given registry will map these straight
  575. into environment variables.  Systems that don't entirely understand a
  576. given registry or use a different but convertable mechanism can be picky
  577. and convert as needed.    An appendix lists the names that all systems are
  578. strongly encouraged to support.
  579.  
  580. Note:  The names in the "suggested" appendix are expected to be supplied
  581. by requesters with no advance knowlege of the host, only the blind
  582. assumption that the host will support those "well-known" names with
  583. their "well-known" semantics.  Other names may be used by requesters
  584. with advance knowlege of the host - restart requests, for example.
  585.  
  586. Any number of MISC lines may be present.
  587.  
  588. DETACH
  589.  
  590. This line directs rstartd to attempt to "detach" the resulting process
  591. from the rsh connection, leaving as little overhead (processes,
  592. connections, etc) as possible.    In POSIX-land, this will probably
  593. consist of redirecting standard input, output, and error to /dev/null or
  594. a log file and then executing the program using fork() and exec() and
  595.  
  596.  
  597.  
  598. Brown                               FORMFEED[Page 10]
  599.  
  600.  
  601.  
  602.  
  603.  
  604. DRAFT                                 August 1993
  605.  
  606.  
  607. not having the parent wait.
  608.  
  609. It would be nice to have a mechanism for specifying where the output
  610. should be redirected - log file or perhaps log/display program/server.
  611. For the moment that's left as a matter of local implementation and
  612. configuration.
  613.  
  614. Only one of DETACH and NODETACH may be present.
  615.  
  616. NODETACH
  617.  
  618. This line directs rstartd to attempt NOT to "detach".  It is intended to
  619. allow one to override a configuration default to DETACH.
  620.  
  621. Only one of DETACHand NODETACH may be present.
  622.  
  623. AUTH authscheme authdata ...
  624.  
  625. Specifies authentication data to be used by the specified authentication
  626. scheme.  This keyword may be given multiple times to give data for
  627. multiple authentication schemes or for a single scheme to use for
  628. multiple purposes.
  629.  
  630.  
  631.  
  632.  
  633.  
  634.  
  635.  
  636.  
  637.  
  638.  
  639.  
  640.  
  641.  
  642.  
  643.  
  644.  
  645.  
  646.  
  647.  
  648.  
  649.  
  650.  
  651.  
  652.  
  653.  
  654.  
  655.  
  656.  
  657.  
  658. Brown                               FORMFEED[Page 11]
  659.  
  660.  
  661.  
  662.  
  663.  
  664. DRAFT                                 August 1993
  665.  
  666.  
  667. System-specific lines begin with SYSTEMNAME-.  No system-independent
  668. line will be defined that includes a "-" in its name.  X- is reserved
  669. for experimental use.  ("Reserved" is an interesting word, there;
  670. anybody can use X- for experiments and nobody can rely on there not
  671. being a conflict.)  INTERNAL- is reserved for internal use by rstartd.
  672.  
  673. POSIX-UMASK nnn
  674.  
  675. Sets the POSIX umask to nnn (octal).
  676.  
  677. MSDOS-DIR d:path
  678.  
  679. Sets the current directory on drive d: to path.  This differs from DIR
  680. in that DIR sets the current working drive and directory and MSDOS-DIR
  681. doesn't set the current drive; MSDOS-DIR would be used to set the
  682. current directory on drives other than the current one.
  683.  
  684. DESQVIEW-MEM nnn
  685.  
  686. Requests nnn kilobytes of conventional memory.
  687.  
  688. DESQVIEW-EXPMEM nnn
  689.  
  690. Requests nnn kilobytes of expanded memory.  (To be more verbose,
  691. requests that the "max expanded memory" parameter be nnn.)
  692.  
  693. GENERIC-xxx
  694.  
  695. The GENERIC system is a hypothetical system that offers various services
  696. that can be supported on different real systems; it provides a common
  697. interface for heterogenous systems.
  698.  
  699. GENERIC-CMD generic-command-name args ...
  700.  
  701. Runs the local equivalent to generic-command-name.  See the section on
  702. generic commands for more information.    Exactly one of CMD, EXEC, or
  703. GENERIC-CMD must be present.
  704.  
  705.  
  706.  
  707.  
  708.  
  709.  
  710.  
  711.  
  712.  
  713.  
  714.  
  715.  
  716.  
  717.  
  718. Brown                               FORMFEED[Page 12]
  719.  
  720.  
  721.  
  722.  
  723.  
  724. DRAFT                                 August 1993
  725.  
  726.  
  727. Generic Commands
  728.  
  729. Unless otherwise noted, generic commands are optional.
  730.  
  731. GENERIC-CMD Terminal
  732.  
  733. Runs a default terminal emulator for the current context.  (It's not
  734. clear what, if anything, this means outside a windowing system context.)
  735. In POSIX X contexts this probably means xterm.
  736.  
  737. GENERIC-CMD LoadMonitor
  738.  
  739. Runs a default load monitor for the current context.  In POSIX X
  740. contexts, this probably means xload.
  741.  
  742. GENERIC-CMD ListContexts
  743.  
  744. Sends to standard output a list of available contexts, one per line,
  745. with a comma-separated list of context names followed by a space
  746. followed by a brief description of the context.  If multiple context
  747. names invoke the same context (as for instance X, X11, and X11R4 might)
  748. ListContexts SHOULD list the most specific context first.
  749.  
  750. This command MUST be available in the Default context, and SHOULD be
  751. available in every context.
  752.  
  753. GENERIC-CMD ListGenericCommands
  754.  
  755. Sends to standard output a list of generic commands available in the
  756. current context, one per line, with the command name followed by a space
  757. followed by a brief description of the command.
  758.  
  759. This command SHOULD be available in every context.
  760.  
  761.  
  762.  
  763.  
  764.  
  765.  
  766.  
  767.  
  768.  
  769.  
  770.  
  771.  
  772.  
  773.  
  774.  
  775.  
  776.  
  777.  
  778. Brown                               FORMFEED[Page 13]
  779.  
  780.  
  781.  
  782.  
  783.  
  784. DRAFT                                 August 1993
  785.  
  786.  
  787. Contexts
  788.  
  789. A request can specify what context a program should be run in.    A
  790. context will most likely include a set of default values for all of the
  791. controllable aspects of the program's execution environment.
  792.  
  793. Examples of Predefined Context Names
  794.  
  795. None      A minimal environment.  Under POSIX, no environment variables.
  796. Default        The default environment.
  797. X      The X Window System, any version
  798. X11      Version 11 of the X Window System, any release
  799. X11R4           Version 11 of the X Window System, Release 4
  800. X11R5           Version 11 of the X Window System, Release 5
  801. OpenWindows    Sun's OpenWindows, any version
  802. OpenWindows2   Version 2 of Sun's OpenWindows
  803. OpenWindows3   Version 3 of Sun's OpenWindows
  804. NeWS      Some version of Sun's Network Window System.
  805.  
  806. Contexts are allowed (encouraged even) to support multiple names for the
  807. same environment configuration.  For instance: "X", "X11", "X11R4" might
  808. all refer to exactly the same configuration.  "OpenWindows3" might well
  809. refer to a configuration that is a union of "X11R4" and "NeWS".
  810.  
  811.  
  812.  
  813.  
  814.  
  815.  
  816.  
  817.  
  818.  
  819.  
  820.  
  821.  
  822.  
  823.  
  824.  
  825.  
  826.  
  827.  
  828.  
  829.  
  830.  
  831.  
  832.  
  833.  
  834.  
  835.  
  836.  
  837.  
  838. Brown                               FORMFEED[Page 14]
  839.  
  840.  
  841.  
  842.  
  843.  
  844. DRAFT                                 August 1993
  845.  
  846.  
  847. Suggested "required" MISC commands
  848.  
  849. General
  850.  
  851. For most of these the "simple" behavior is to simply pass the value to
  852. the app as an environment variable.  This should be appropriate on any
  853. POSIX systems.    Other systems should use whatever mechanism is
  854. appropriate to the given item; note that different mechanisms may be
  855. appropriate to different items.
  856.  
  857. All systems are encouraged to "understand" all of these names,
  858. translating them as appropriate to the local environment.
  859.  
  860. MISC X LANG=locale identifier
  861.  
  862. Specifies the locale desired.  If POSIX specifies a list of locale
  863. identifiers then we can use that (and move it to the POSIX registry),
  864. but if not then we will have to define a list (perhaps based on a good
  865. de facto standard).  Note that if there is no POSIX-standardized list of
  866. locale names the host SHOULD translate from our list to the local list.
  867. Note that this is based on the POSIX LANG environment variable, but
  868. rumor says that POSIX does not specify a list of identifiers; since we
  869. want a standarized list we must specify a registry and must assume
  870. "control" of the name.    If in the future POSIX specifies a different
  871. list then during a transition period MISC X LANG and MISC POSIX LANG
  872. would perform similar functions but using different names for the
  873. locales. [[ It may be that ISO country/language codes may supply a
  874. suitable registry. -- jb ]]
  875.  
  876. MISC X DISPLAY=host:displaynum
  877.  
  878. Specifies the X server the app is to connect to.
  879.  
  880. MISC X SESSION_MANAGER=tcp/host:port
  881.  
  882. Specifies the session manager the app is to connect to.
  883.  
  884. MISC POSIX TZ=time zone info
  885.  
  886. Specifies the time zone the user is in, using POSIX standard notation.
  887.  
  888.  
  889.  
  890.  
  891.  
  892.  
  893.  
  894.  
  895.  
  896.  
  897.  
  898. Brown                               FORMFEED[Page 15]
  899.  
  900.  
  901.  
  902.  
  903.  
  904. DRAFT                                 August 1993
  905.  
  906.  
  907. Specific Notes on use of Extended rsh with the X Window System
  908.  
  909. To start an X program, the requester should specify an X context ("X" if
  910. nothing else) and specify the display parameter by saying
  911.  
  912.      MISC X DISPLAY=host:port.screen
  913.  
  914. If the program is to join a session the requester should say:
  915.  
  916.      MISC X SESSION_MANAGER=tcp/host:port
  917.  
  918.  
  919. An X host MUST understand at least the X context and MUST, regardless of
  920. whether or not it has environment variables as a system concept,
  921. interpret MISC X DISPLAY=host:port and pass it to the program in
  922. whatever way is locally appropriate.  An X host supporting session
  923. management (which all will do by the time this is adopted, right?)  MUST
  924. interpret MISC X SESSION_MANAGER=tcp/host:port similarly.
  925.  
  926. An X host MUST understand the X11 authentication scheme for the AUTH
  927. keyword.  The data given MUST be in the form given by "xauth list" and
  928. understood by "xauth add".  AUTH X11 may be given several times to pass
  929. multiple kinds of authorization data or data about multiple displays.
  930.  
  931. Input methods?    Extensibility?    (Would be nice if new features could be
  932. incorporated without new rstartd executables, which argues for passing
  933. most data as environment variables.)
  934.  
  935.  
  936.  
  937.  
  938.  
  939.  
  940.  
  941.  
  942.  
  943.  
  944.  
  945.  
  946.  
  947.  
  948.  
  949.  
  950.  
  951.  
  952.  
  953.  
  954.  
  955.  
  956.  
  957.  
  958. Brown                               FORMFEED[Page 16]
  959.  
  960.  
  961.  
  962.  
  963.  
  964. DRAFT                                 August 1993
  965.  
  966.  
  967. Suggestions for Implementation
  968.  
  969. Configurability, extensibility.  Nobody is ever happy with the default.
  970. The host implementation should allow for as much configurability and
  971. extensibility as possible.  In particular, provision should be made for
  972. administrator- and user- defined contexts, with user defined contexts
  973. overriding or augmenting the administrator-defined and system-supplied
  974. contexts.  One good implementation scheme would be to have system-wide
  975. and per-user configuration files which use the same syntax as the
  976. protocol.  ListContexts SHOULD list both system-wide and per-user
  977. contexts.
  978.  
  979. Provision SHOULD be made for administrator- and user- defined generic
  980. commands, with user-defined commands overriding system-wide ones.
  981. ListGenericCommands SHOULD list both.
  982.  
  983.  
  984.  
  985.  
  986.  
  987.  
  988.  
  989.  
  990.  
  991.  
  992.  
  993.  
  994.  
  995.  
  996.  
  997.  
  998.  
  999.  
  1000.  
  1001.  
  1002.  
  1003.  
  1004.  
  1005.  
  1006.  
  1007.  
  1008.  
  1009.  
  1010.  
  1011.  
  1012.  
  1013.  
  1014.  
  1015.  
  1016.  
  1017.  
  1018. Brown                               FORMFEED[Page 17]
  1019.  
  1020.  
  1021.  
  1022.  
  1023.  
  1024. DRAFT                                 August 1993
  1025.  
  1026.  
  1027. Notes on Outstanding specification issues
  1028.  
  1029. Note:  This is not part of the proposal.
  1030.  
  1031. Syntax
  1032.  
  1033.      The syntax is OK so far for machine generation, but is yucky for
  1034.      human generation, especially spaces in environment variables in
  1035.      config files.
  1036.  
  1037.  
  1038. Environment variables
  1039.  
  1040.      it would be nice if one could say things like $HOME in values,
  1041.      especially in config files.
  1042.  
  1043.  
  1044. Error handling
  1045.  
  1046.      how to reliably mark successfully starting the app.  Can report
  1047.      syntax errors or lack thereof, but reporting startup or execution
  1048.      errors is problematical.  (Application execution errors are tough
  1049.      no matter what; startup errors are tough because you want to report
  1050.      an error if the exec*() fails, but if it succeeds you don't have
  1051.      the opportunity to give a success report.) [[Clive gives a clever
  1052.      trick for reliably distinguishing success, but I think there's a
  1053.      race condition if the app is allowed to use the rsh channel for
  1054.      output after it starts. -- jb]]
  1055.  
  1056.  
  1057. Error handling
  1058.  
  1059.      how to report post-startup errors and warnings to the user.  (Can
  1060.      say "not our problem", but it would be nice if there was a standard
  1061.      way to say "give output to a program that will report it back to
  1062.      the user" or something like that.    Session Manager "death reason"
  1063.      messages might be adequate, but don't cover warnings.)
  1064.  
  1065.  
  1066. I18n
  1067.  
  1068.      What character set should messages and requests be in?  Can this be
  1069.      determined by the locale as specified by MISC X LANG?  (Does this
  1070.      require that MISC X LANG be one of the first lines?)
  1071.  
  1072.  
  1073. Protocol
  1074.  
  1075.  
  1076.  
  1077.  
  1078. Brown                               FORMFEED[Page 18]
  1079.  
  1080.  
  1081.  
  1082.  
  1083.  
  1084. DRAFT                                 August 1993
  1085.  
  1086.  
  1087.      One reviewer suggests an FTP- and SMTP- style protocol with
  1088.      requests and responses.  Personally I don't think individual
  1089.      responses to the lines are required and that the roundtrips
  1090.      involved would be wasted.    The entire conversation is a single
  1091.      request and can be rejected or accepted en toto.  The response
  1092.      mechanism does not provide for fabulously rich interpretation by an
  1093.      automaton, but it does allow for a success / serious failure /
  1094.      routine failure / warning distinction.
  1095.  
  1096.  
  1097. Multiple requests/connection
  1098.  
  1099.      Some have suggested that you should be able to start multiple
  1100.      programs with a single connection, either to start multiple apps on
  1101.      login or to allow a "master" to request apps occasionally during
  1102.      the course of a session.  As doing so would make it less possible
  1103.      (or at least more difficult) to use the data channel for
  1104.      communicating with the app after start, and as the overhead of
  1105.      starting a new connection isn't all that high, I'm not enchanted
  1106.      with the idea.  Admittedly, if the overhead involved got higher
  1107.      (how fast is a Kerberos authentication?)  it might become more
  1108.      attractive.
  1109.  
  1110.  
  1111.  
  1112.  
  1113.  
  1114.  
  1115.  
  1116.  
  1117.  
  1118.  
  1119.  
  1120.  
  1121.  
  1122.  
  1123.  
  1124.  
  1125.  
  1126.  
  1127.  
  1128.  
  1129.  
  1130.  
  1131.  
  1132.  
  1133.  
  1134.  
  1135.  
  1136.  
  1137.  
  1138. Brown                               FORMFEED[Page 19]
  1139.  
  1140.  
  1141.  
  1142.  
  1143.  
  1144. DRAFT                                 August 1993
  1145.  
  1146.  
  1147. Conclusion:
  1148.  
  1149. A small protocol could be easily defined which would layer on top of a
  1150. relatively primitive remote execution facility like rsh, rexec, or krsh,
  1151. that would allow flexible application startup in a fairly machine-
  1152. independent way.  By mandating appropriate local configuration, X
  1153. applications could be started (or restarted) conveniently, without
  1154. requiring the requester to understand the detailed requirements of the
  1155. remote system.    The implementation cost, for both the requester and the
  1156. "server", is small.  Security issues are "not our problem", since they
  1157. are all handled by existing protocols.
  1158.  
  1159. Security Considerations
  1160.  
  1161.  
  1162.      Security is assumed handled by the underlying remote execution
  1163.      mechanism.  The "helper" program described by this memo runs
  1164.      with the privileges of the user and so generally introduces no
  1165.      additional security considerations.  Systems where security is
  1166.      controlled by controlling what programs may be run - where
  1167.      programs are trusted but users are not - may see a security
  1168.      impact unless their "helper" is careful about what programs it
  1169.      is willing to run.
  1170.  
  1171.  
  1172. Copyright
  1173.  
  1174.  
  1175.      Copyright (c) 1993 Quarterdeck Office Systems
  1176.  
  1177.      Permission to use, copy, modify, distribute, and sell this
  1178.      software and its documentation for any purpose is hereby
  1179.      granted without fee, provided that the above copyright notice
  1180.      appear in all copies and that both that copyright notice and
  1181.      this permission notice appear in supporting documentation, and
  1182.      that the name Quarterdeck Office Systems, Inc. not be used in
  1183.      advertising or publicity pertaining to distribution of this
  1184.      software without specific, written prior permission.
  1185.  
  1186.      THIS SOFTWARE IS PROVIDED `AS-IS'.  QUARTERDECK OFFICE
  1187.      SYSTEMS, INC., DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS
  1188.      SOFTWARE, INCLUDING WITHOUT LIMITATION ALL IMPLIED WARRANTIES
  1189.      OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR
  1190.      NONINFRINGEMENT.  IN NO EVENT SHALL QUARTERDECK OFFICE
  1191.      SYSTEMS, INC., BE LIABLE FOR ANY DAMAGES WHATSOEVER, INCLUDING
  1192.      SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES, INCLUDING LOSS
  1193.      OF USE, DATA, OR PROFITS, EVEN IF ADVISED OF THE POSSIBILITY
  1194.      THEREOF, AND REGARDLESS OF WHETHER IN AN ACTION IN CONTRACT,
  1195.  
  1196.  
  1197.  
  1198. Brown                               FORMFEED[Page 20]
  1199.  
  1200.  
  1201.  
  1202.  
  1203.  
  1204. DRAFT                                 August 1993
  1205.  
  1206.  
  1207.      TORT OR NEGLIGENCE, ARISING OUT OF OR IN CONNECTION WITH THE
  1208.      USE OR PERFORMANCE OF THIS SOFTWARE.
  1209.  
  1210.  
  1211. Author's  Address:
  1212.  
  1213.  
  1214.      Jordan Brown
  1215.      Quarterdeck Office Systems
  1216.      Santa Monica, CA
  1217.      jbrown@qdeck.com
  1218.  
  1219.  
  1220.  
  1221.  
  1222.  
  1223.  
  1224.  
  1225.  
  1226.  
  1227.  
  1228.  
  1229.  
  1230.  
  1231.  
  1232.  
  1233.  
  1234.  
  1235.  
  1236.  
  1237.  
  1238.  
  1239.  
  1240.  
  1241.  
  1242.  
  1243.  
  1244.  
  1245.  
  1246.  
  1247.  
  1248.  
  1249.  
  1250.  
  1251.  
  1252.  
  1253.  
  1254.  
  1255.  
  1256.  
  1257.  
  1258. Brown                               FORMFEED[Page 21]
  1259.  
  1260.  
  1261.