home *** CD-ROM | disk | FTP | other *** search
/ Geek Gadgets 1 / ADE-1.bin / ade-bin / x11r6.1 / man / cat1 / rstartd.0 < prev    next >
Encoding:
Text File  |  1996-10-17  |  13.3 KB  |  397 lines

  1.  
  2.  
  3.  
  4. RSTARTD(1)                           RSTARTD(1)
  5.  
  6.  
  7. NNAAMMEE
  8.        rstartd    -  a  sample implementation of a Remote Start rsh
  9.        helper
  10.  
  11. SSYYNNOOPPSSIISS
  12.        rrssttaarrttdd
  13.  
  14.        rrssttaarrttdd..rreeaall [-c _c_o_n_f_i_g_f_i_l_e_n_a_m_e]
  15.  
  16. DDEESSCCRRIIPPTTIIOONN
  17.        _R_s_t_a_r_t_d is an implementation of a Remote Start "helper" as
  18.        defined    in "A Flexible Remote Execution Protocol Based on
  19.        rrsshh".
  20.  
  21.        This document describes the peculiarities of  _r_s_t_a_r_t_d  and
  22.        how it is configured.
  23.  
  24. OOPPTTIIOONNSS
  25.        --cc _c_o_n_f_i_g_f_i_l_e_n_a_m_e
  26.            This  option  specifies the "global" configuration
  27.            file that _r_s_t_a_r_t_d is to read.   Normally,  _r_s_t_a_r_t_d
  28.            is  a  shell script that invokes _r_s_t_a_r_t_d_._r_e_a_l with
  29.            the --cc switch, allowing local configuration of the
  30.            location       of    the   configuration   file.    If
  31.            _r_s_t_a_r_t_d_._r_e_a_l is started without the -c option,  it
  32.            reads <XRoot>/lib/X11/rstart/config, where <XRoot>
  33.            refers to the root of the X11 install tree.
  34.  
  35. IINNSSTTAALLLLAATTIIOONN
  36.        It is critical to successful interoperation of the  Remote
  37.        Start  protocol    that  _r_s_t_a_r_t_d be installed in a directory
  38.        which is in the "default" search path, so that default rsh
  39.        requests and the ilk will be able to find it.
  40.  
  41. CCOONNFFIIGGUURRAATTIIOONN AANNDD OOPPEERRAATTIIOONN
  42.        _R_s_t_a_r_t_d    is by design highly configurable.  One would like
  43.        things like configuration file locations to be  fixed,  so
  44.        that  users  and     administrators     can  find  them  without
  45.        searching, but reality is that no two vendors  will  agree
  46.        on  where things should go, and nobody thinks the original
  47.        location is "right".  Thus, _r_s_t_a_r_t_d allows one to relocate
  48.        aallll of its files and directories.
  49.  
  50.        _R_s_t_a_r_t_d    has  a hierarchy of configuration files which are
  51.        executed in order when a request is made.  They are:
  52.  
  53.         global config
  54.         per-user ("local") config
  55.         global per-context config
  56.         per-user ("local") per-context config
  57.         config from request
  58.  
  59.        As you might guess  from     the  presence    of  "config  from
  60.        request",  all of the config files are in the format of an
  61.  
  62.  
  63.  
  64. X Version 11           Release 6.1                1
  65.  
  66.  
  67.  
  68.  
  69.  
  70. RSTARTD(1)                           RSTARTD(1)
  71.  
  72.  
  73.        _r_s_t_a_r_t request.    _R_s_t_a_r_t_d defines a few additional keywords
  74.        with    the    INTERNAL-      prefix   for     specifying   its
  75.        configuration.
  76.  
  77.        _R_s_t_a_r_t_d starts by reading and executing the global  config
  78.        file.   This  file  will normally specify the locations of
  79.        the other configuration files and any systemwide defaults.
  80.  
  81.        _R_s_t_a_r_t_d    will  then  read  the  user's  local config file,
  82.        default name $HOME/.rstart.
  83.  
  84.        _R_s_t_a_r_t_d will then start interpreting the request.
  85.  
  86.        Presumably one of the first lines in the request will be a
  87.        CONTEXT    line.    The  context  name  is converted to lower
  88.        case.
  89.  
  90.        _R_s_t_a_r_t_d will read the global config file for that context,
  91.        default    name  <XRoot>/lib/X11/rstart/contexts/<name>,  if
  92.        any.
  93.  
  94.        It will then read the user's config file for that context,
  95.        default name $HOME/.rstart.contexts/<name>, if any.
  96.  
  97.        (If neither of these exists, _r_s_t_a_r_t_d aborts with a Failure
  98.        message.)
  99.  
  100.        _R_s_t_a_r_t_d will finish interpreting the request, and  execute
  101.        the program specified.
  102.  
  103.        This  allows the system administrator and the user a large
  104.        degree of control over  the  operation  of  _r_s_t_a_r_t_d.   The
  105.        administrator  has  final  say,    because the global config
  106.        file doesn't need to specify a per-user config  file.   If
  107.        it  does, however, the user can override anything from the
  108.        global file, and can even completely  replace  the  global
  109.        context config files.
  110.  
  111.        The config files have a somewhat more flexible format than
  112.        requests do; they are allowed to contain blank  lines  and
  113.        lines beginning with "#" are comments and ignored.  (#s in
  114.        the middle of lines are data, not comment markers.)
  115.  
  116.        Any commands run are  provided  a  few  useful  pieces  of
  117.        information in environment variables.  The exact names are
  118.        configurable, but the supplied defaults are:
  119.  
  120.         $RSTART_CONTEXT         the name of the context
  121.         $RSTART_GLOBAL_CONTEXTS  the global contexts directory
  122.         $RSTART_LOCAL_CONTEXTS   the local contexts directory
  123.         $RSTART_GLOBAL_COMMANDS  the global generic commands directory
  124.         $RSTART_LOCAL_COMMANDS   the local generic commands directory
  125.  
  126.        $RSTART_{GLOBAL,LOCAL}_CONTEXTS should contain one special
  127.  
  128.  
  129.  
  130. X Version 11           Release 6.1                2
  131.  
  132.  
  133.  
  134.  
  135.  
  136. RSTARTD(1)                           RSTARTD(1)
  137.  
  138.  
  139.        file, @List, which contains a list of the contexts in that
  140.        directory in the format specified for  ListContexts.   The
  141.        supplied     version of ListContexts will cat both the global
  142.        and local copies of @List.
  143.  
  144.        Generic commands     are  searched    for  in     several  places:
  145.        (defaults)
  146.  
  147.         per-user per-context directory ($HOME/.rstart.commands/<context>)
  148.         global per-context directory (<XRoot>/lib/X11/rstart/commands/<context>)
  149.         per-user all-contexts directory ($HOME/.rstart.commands)
  150.         global all-contexts directory (<XRoot>/lib/X11/rstart/commands)
  151.  
  152.        (Yes,  this  means  you can't have an all-contexts generic
  153.        command with the same name as a context.     It  didn't  seem
  154.        like a big deal.)
  155.  
  156.        Each  of these directories should have a file called @List
  157.        that gives the names and descriptions of the  commands  in
  158.        that    directory    in      the     format      specified   for
  159.        ListGenericCommands.
  160.  
  161. CCOONNFFIIGGUURRAATTIIOONN KKEEYYWWOORRDDSS
  162.        There are several "special" _r_s_t_a_r_t  keywords  defined  for
  163.        _r_s_t_a_r_t_d    configuration.    Unless otherwise specified, there
  164.        are no defaults; related features  are  disabled     in  this
  165.        case.
  166.  
  167.  
  168.        IINNTTEERRNNAALL--RREEGGIISSTTRRIIEESS nnaammee ......
  169.            Gives  a space-separated list of "MISC" registries
  170.            that this system understands.   (Registries  other
  171.            than this are accepted but generate a Warning.)
  172.  
  173.        IINNTTEERRNNAALL--LLOOCCAALL--DDEEFFAAUULLTT rreellaattiivvee__ffiilleennaammee
  174.            Gives  the  name     ($HOME relative) of the per-user
  175.            config file.
  176.  
  177.        IINNTTEERRNNAALL--GGLLOOBBAALL--CCOONNTTEEXXTTSS aabbssoolluuttee__ddiirreeccttoorryy__nnaammee
  178.            Gives  the  name     of  the   system-wide     contexts
  179.            directory.
  180.  
  181.        IINNTTEERRNNAALL--LLOOCCAALL--CCOONNTTEEXXTTSS rreellaattiivvee__ddiirreeccttoorryy__nnaammee
  182.            Gives  the  name     ($HOME relative) of the per-user
  183.            contexts directory.
  184.  
  185.        IINNTTEERRNNAALL--GGLLOOBBAALL--CCOOMMMMAANNDDSS aabbssoolluuttee__ddiirreeccttoorryy__nnaammee
  186.            Gives the name of the system-wide generic commands
  187.            directory.
  188.  
  189.        IINNTTEERRNNAALL--LLOOCCAALL--CCOOMMMMAANNDDSS rreellaattiivvee__ddiirreeccttoorryy__nnaammee
  190.            Gives  the  name     ($HOME relative) of the per-user
  191.            generic commands directory.
  192.  
  193.  
  194.  
  195.  
  196. X Version 11           Release 6.1                3
  197.  
  198.  
  199.  
  200.  
  201.  
  202. RSTARTD(1)                           RSTARTD(1)
  203.  
  204.  
  205.        IINNTTEERRNNAALL--VVAARRIIAABBLLEE--PPRREEFFIIXX pprreeffiixx
  206.            Gives the prefix for the configuration environment
  207.            variables _r_s_t_a_r_t_d passes to its kids.
  208.  
  209.        IINNTTEERRNNAALL--AAUUTTHH--PPRROOGGRRAAMM aauutthhsscchheemmee pprrooggrraamm aarrggvv[[00]] aarrggvv[[11]]
  210.            ......
  211.            Specifies  the  program     to   run   to     set   up
  212.            authentication  for  the     specified authentication
  213.            scheme.    "program argv[0] ..." gives  the  program
  214.            to  run and its arguments, in the same form as the
  215.            EXEC keyword.
  216.  
  217.        IINNTTEERRNNAALL--AAUUTTHH--IINNPPUUTT aauutthhsscchheemmee
  218.            Specifies  the    data   to   be     given     to   the
  219.            authorization program as its standard input.  Each
  220.            argument is passed as a single line.  $n, where    n
  221.            is  a  number, is replaced by the n'th argument to
  222.            the "AUTH authscheme arg1 arg2 ..." line.
  223.  
  224.        IINNTTEERRNNAALL--PPRRIINNTT aarrbbiittrraarryy tteexxtt
  225.            Prints its arguments as a Debug    message.   Mostly
  226.            for  _r_s_t_a_r_t_d debugging, but could be used to debug
  227.            config files.
  228.  
  229. NNOOTTEESS
  230.        When using the C shell, or any other shell  which  runs    a
  231.        script every time the shell is started, the script may get
  232.        run several times.  In the worst case, the script may  get
  233.        run tthhrreeee times:
  234.  
  235.         By rsh, to run _r_s_t_a_r_t_d
  236.         By _r_s_t_a_r_t_d, to run the specified command
  237.         By the command, eg _x_t_e_r_m
  238.  
  239.        _r_s_t_a_r_t_d currently limits lines, both from config files and
  240.        requests, to BUFSIZ bytes.
  241.  
  242.        DETACH is implemented by redirecting file descriptors 0,1,
  243.        and  2  to  /dev/null  and  forking  before  executing the
  244.        program.
  245.  
  246.        CMD is implemented by invoking  $SHELL  (default     /bin/sh)
  247.        with "-c" and the specified command as arguments.
  248.  
  249.        POSIX-UMASK is implemented in the obvious way.
  250.  
  251.        The  authorization programs are run in the same context as
  252.        the target program -  same  environment    variables,  path,
  253.        etc.  Long term this might be a problem.
  254.  
  255.        In the X context, GENERIC-CMD Terminal runs xterm.  In the
  256.        OpenWindows context, GENERIC-CMD Terminal runs cmdtool.
  257.  
  258.        In the X context, GENERIC-CMD LoadMonitor runs xload.   In
  259.  
  260.  
  261.  
  262. X Version 11           Release 6.1                4
  263.  
  264.  
  265.  
  266.  
  267.  
  268. RSTARTD(1)                           RSTARTD(1)
  269.  
  270.  
  271.        the  OpenWindows     context,  GENERIC-CMD    LoadMonitor  runs
  272.        perfmeter.
  273.  
  274.        GGEENNEERRIICC--CCMMDD LLiissttCCoonntteexxttss lists the contents  of    @List  in
  275.        both  the  system-wide  and per-user contexts directories.
  276.        It is available in all contexts.
  277.  
  278.        GGEENNEERRIICC--CCMMDD  LLiissttGGeenneerriiccCCoommmmaannddss     lists    the  contents  of
  279.        @List   in   the      system-wide    and   per-user     commands
  280.        directories, including the per-context subdirectories  for
  281.        the current context.  It is available in all contexts.
  282.  
  283.        CCOONNTTEEXXTT NNoonnee is not implemented.
  284.  
  285.        CCOONNTTEEXXTT DDeeffaauulltt is really dull.
  286.  
  287.        For  installation  ease,     the  "contexts" directory in the
  288.        distribution contains a    file  "@Aliases"  which     lists    a
  289.        context    name  and aliases for that context.  This file is
  290.        used  to     make  symlinks     in  the  contexts  and     commands
  291.        directories.
  292.  
  293.        All  MMIISSCC  values  are  passed  unmodified  as environment
  294.        variables.
  295.  
  296.        One can mistreat _r_s_t_a_r_t_d in any number of ways,    resulting
  297.        in  anything  from  stupid  behavior to core dumps.  Other
  298.        than by explicitly running programs I don't think  it  can
  299.        write  or  delete  any  files, but there's no guarantee of
  300.        that.  The important thing is that (a) it  probably  won't
  301.        do  anything REALLY stupid and (b) it runs with the user's
  302.        permissions, so it can't do anything catastrophic.
  303.  
  304.        @List files need not be    complete;  contexts  or     commands
  305.        which  are  dull     or  which  need  not  or  should  not be
  306.        advertised need not be listed.    In  particular,     per-user
  307.        @List  files  should  not  list    things    which  are in the
  308.        system-wide  @List  files.    In      the    future,      perhaps
  309.        ListContexts  and  ListGenericCommands  will automatically
  310.        suppress lines from the system-wide files when  there  are
  311.        per-user replacements for those lines.
  312.  
  313.        Error  handling    is OK to weak.    In particular, no attempt
  314.        is made to properly report  errors  on  the  exec  itself.
  315.        (Perversely,  exec  errors could be reliably reported when
  316.        detaching, but not when passing the  stdin/out  socket  to
  317.        the app.)
  318.  
  319.        If  compiled  with  -DODT1_DISPLAY_HACK, _r_s_t_a_r_t_d will work
  320.        around a bug in SCO ODT version 1.  (1.1?)   (The  bug  is
  321.        that  the  X  clients  are all compiled with a bad library
  322.        that doesn't know how to look host  names  up  using  DNS.
  323.        The  fix     is  to     look  up  a  host  name  in $DISPLAY and
  324.        substitute an IP address.)  This is a trivial  example  of
  325.  
  326.  
  327.  
  328. X Version 11           Release 6.1                5
  329.  
  330.  
  331.  
  332.  
  333.  
  334. RSTARTD(1)                           RSTARTD(1)
  335.  
  336.  
  337.        an incompatibility that _r_s_t_a_r_t can hide.
  338.  
  339. SSEEEE AALLSSOO
  340.        rstart(1),  rsh(1),  A  Flexible Remote Execution Protocol
  341.        Based on rrsshh
  342.  
  343. AAUUTTHHOORR
  344.        Jordan Brown, Quarterdeck Office Systems
  345.  
  346.  
  347.  
  348.  
  349.  
  350.  
  351.  
  352.  
  353.  
  354.  
  355.  
  356.  
  357.  
  358.  
  359.  
  360.  
  361.  
  362.  
  363.  
  364.  
  365.  
  366.  
  367.  
  368.  
  369.  
  370.  
  371.  
  372.  
  373.  
  374.  
  375.  
  376.  
  377.  
  378.  
  379.  
  380.  
  381.  
  382.  
  383.  
  384.  
  385.  
  386.  
  387.  
  388.  
  389.  
  390.  
  391.  
  392.  
  393.  
  394. X Version 11           Release 6.1                6
  395.  
  396.  
  397.