home *** CD-ROM | disk | FTP | other *** search
/ InfoMagic Source Code 1993 July / THE_SOURCE_CODE_CD_ROM.iso / mach / doc / unpublished / sup.1.Z / sup.1
Encoding:
Text File  |  1992-09-01  |  22.2 KB  |  487 lines

  1.  
  2.  
  3.  
  4. SUP(1)              UNIX Programmer's Manual               SUP(1)
  5.  
  6.  
  7.  
  8. NAME
  9.      sup - software upgrade protocol
  10.  
  11. SYNOPSIS
  12.      sup [ _f_l_a_g_s ] [ _s_u_p_f_i_l_e ] [ _c_o_l_l_e_c_t_i_o_n ...]
  13.  
  14. DESCRIPTION
  15.      _S_u_p is a program used for upgrading collections of files
  16.      from other machines to your machine.  You execute _s_u_p, the
  17.      _c_l_i_e_n_t program, which talks over the network using IP/TCP to
  18.      a _f_i_l_e _s_e_r_v_e_r and possibly a _n_a_m_e _s_e_r_v_e_r process.  The name
  19.      server process determines appropriate _r_e_p_o_s_i_t_o_r_y machines
  20.      from which to request upgrades.  The file server process
  21.      cooperates with _s_u_p to determine which files of the collec-
  22.      tion need to be upgraded on your machine.
  23.  
  24.      In performing an upgrade, the file server constructs a list
  25.      of files included in the collection.  The list is sent to
  26.      your machine, which determines which files are needed.
  27.      Those files are then sent from the file server.  It will be
  28.      most useful to run _s_u_p as a daemon each night so you will
  29.      continually have the latest version of the files in the
  30.      needed collections.
  31.  
  32.      The only required argument to _s_u_p is the name of a supfile.
  33.      It must either be given explicitly on the command line, or
  34.      the -s flag must be specified.  If the -s flag is given, the
  35.      system supfile will be used and a supfile command argument
  36.      should not be specified.  The list of collections is
  37.      optional and if specified will be the only collections
  38.      upgraded.  The following flags affect all collections speci-
  39.      fied:
  40.  
  41.      -s   As described above.
  42.  
  43.      -t   When this flag is given, _s_u_p will print the time that
  44.           each collection was last upgraded, rather than perform-
  45.           ing actual upgrades.
  46.  
  47.      -N   _S_u_p will trace network messages sent and received that
  48.           implement the _s_u_p network protocol.
  49.  
  50.      -P   Sup will use a set of non-privileged network ports
  51.           reserved for debugging purposes.
  52.  
  53.      The remaining flags affect all collections unless an expli-
  54.      cit list of collections are given with the flags.  Multiple
  55.      flags may be specified together that affect the same collec-
  56.      tions.  For the sake of convience, any flags that always
  57.      affect all collections can be specified with flags that
  58.      affect only some collections.  For example, sup
  59.      -sde=coll1,coll2 would perform a system upgrade, and the
  60.      first two collections would allow both file deletions and
  61.      command executions.  Note that this is not the same command
  62.      as sup -sde=coll1 coll2, which would perform a system
  63.      upgrade of just the coll2 collection and would ignore the
  64.      flags given for the coll1 collection.
  65.  
  66.      -a   All files in the collection will be copied from the
  67.           repository, regardless of their status on the current
  68.           machine.  Because of this, it is a very expensive
  69.           operation and should only be done for small collections
  70.           if data corruption is suspected and been confirmed.  In
  71.           most cases, the -o flag should be sufficient.
  72.  
  73.      -b   If the -b flag if given, or the backup supfile option
  74.           is specified, the contents of regular files on the
  75.           local system will be saved before they are overwritten
  76.           with new data.  The file collection maintainer can
  77.           designate specific files to be worthy of backing up
  78.           whenever they are upgraded.  However, such backup will
  79.           only take place if you specify this flag or the backup
  80.           option to allow backups for a file collection on your
  81.           machine.  The backup mechanism will create a copy of
  82.           the current version of a file immediately before a new
  83.           copy is received from the file server; the copy is
  84.           given the same name as the original file but is put
  85.           into a directory called BACKUP within the directory
  86.           containing the original file.  For example,
  87.           /usr/sas/src/foo.c would have a backup copy called
  88.           /usr/sas/src/BACKUP/foo.c.  There is no provision for
  89.           automatically maintaining multiple old versions of
  90.           files; you would have to do this yourself.
  91.  
  92.      -B   The -B flag overrides and disables the -b flag and the
  93.           backup supfile option.
  94.  
  95.      -d   Files that are no longer in the collection on the repo-
  96.           sitory will be deleted if present on the local machine.
  97.           This may also be specified in a supfile with the delete
  98.           option.
  99.  
  100.      -D   The -D flag overrides and disables the -d flag and the
  101.           delete supfile option.
  102.  
  103.      -e   Sup will execute commands sent from the repository that
  104.           should be run when a file is upgraded.  If the -e flag
  105.           is omitted, Sup will print a message that specifies the
  106.           command to execute.  This may also be specified in a
  107.           supfile with the execute option.
  108.  
  109.      -E   The -E flag overrides and disables the -e flag and the
  110.           execute supfile option.
  111.  
  112.      -f   A _l_i_s_t-_o_n_l_y upgrade will be performed.  Messages will
  113.           be printed that indicate what would happen if an actual
  114.           upgrade were done.
  115.  
  116.      -l   Normally, _s_u_p will not upgrade a collection if the
  117.           repository is on the same machine.  This allows users
  118.           to run upgrades on all machines without having to make
  119.           special checks for the repository machine.  If the -l
  120.           flag is specified, collections will be upgraded even if
  121.           the repository is local.
  122.  
  123.      -m   Normally, _s_u_p used standard output for messages.  If
  124.           the -m flag if given, _s_u_p will send mail to the user
  125.           running _s_u_p, or a user specified with the notify sup-
  126.           file option, that contains messages printed by _s_u_p.
  127.  
  128.      -o   _S_u_p will normally only upgrade files that have changed
  129.           on the repository since the last time an upgrade was
  130.           performed.  The -o flag, or the old supfile option,
  131.           will cause _s_u_p to check all files in the collection for
  132.           changes instead of just the new ones.
  133.  
  134.      -O   The -O flag overrides and disables the -o flag and the
  135.           old supfile option.
  136.  
  137.      -v   Normally, _s_u_p will only print messages if there are
  138.           problems.  This flag causes _s_u_p to also print messages
  139.           during normal progress showing what _s_u_p is doing.
  140.  
  141. SETTING UP UPGRADES
  142.      Each file collection to be upgraded must have a _b_a_s_e _d_i_r_e_c_-
  143.      _t_o_r_y which contains a subdirectory called sup that will be
  144.      used by the _s_u_p program; it will be created automatically if
  145.      you do not create it.  _S_u_p will put subdirectories and files
  146.      into this directory as needed.
  147.  
  148.      _S_u_p will look for a subdirectory with the same name as the
  149.      collection within the sup subdirectory of the _b_a_s_e _d_i_r_e_c_-
  150.      _t_o_r_y. If it exists it may contain any of the following
  151.      files:
  152.  
  153.      when This file is automatically updated by _s_u_p when a col-
  154.           lection is successfully upgraded and contains the time
  155.           that the file server, or possibly _s_u_p_s_c_a_n, created the
  156.           list of files in the upgrade list.  _S_u_p will send this
  157.           time to the file server for generating the list of
  158.           files that have been changed on the repository machine.
  159.  
  160.      refuse
  161.           This file contains a list of files and directories, one
  162.           per line, that the client is not interested in that
  163.           should not be upgraded.
  164.  
  165.      lock This file is used by _s_u_p to lock a collection while it
  166.           is being upgraded.  _S_u_p will get exclusive access to
  167.           the lock file using _f_l_o_c_k(2), preventing more than one
  168.           _s_u_p from upgrading the same collection at the same
  169.           time.
  170.  
  171.      last This file contains a list of files and directories, one
  172.           per line, that have been upgraded by _s_u_p in the past.
  173.           This information is used when the delete option, or the
  174.           -d flag is used to locate files previously upgraded
  175.           that are no longer in the collection that should be
  176.           deleted.
  177.  
  178.      Each file collection must also be described in one or more
  179.      supfiles.  When _s_u_p is executed, it reads the specified sup-
  180.      file to determine what file collections to upgrade.  Each
  181.      collection is described by a single line of text in the sup-
  182.      file; this line must contain the name of the collection, and
  183.      possibly one or more options separated by spaces.  The
  184.      options are:
  185.  
  186.      base=_d_i_r_e_c_t_o_r_y
  187.           The usual default name of the base directory for a col-
  188.           lection is described below (see FILES); if you want to
  189.           specify another directory name, use this option speci-
  190.           fying the desired directory.
  191.  
  192.      prefix=_d_i_r_e_c_t_o_r_y
  193.           Each collection may also have an associated _p_r_e_f_i_x
  194.           _d_i_r_e_c_t_o_r_y which is used instead of the base directory
  195.           for references to files within the collection.
  196.  
  197.      host=_h_o_s_t_n_a_m_e
  198.      hostbase=_d_i_r_e_c_t_o_r_y
  199.           _S_y_s_t_e_m collections are supported by the system main-
  200.           tainers, and _s_u_p will automatically find out the name
  201.           of the host machine and base directory on that machine.
  202.           However, you can also upgrade _p_r_i_v_a_t_e collections; you
  203.           simply specify with these options the _h_o_s_t_n_a_m_e of the
  204.           machine containing the files and the _d_i_r_e_c_t_o_r_y used as
  205.           a base directory for the file server on that machine.
  206.           Details of setting up a file collection are given in
  207.           the section below.
  208.  
  209.      login=_a_c_c_o_u_n_t_i_d
  210.      password=_p_a_s_s_w_o_r_d
  211.      crypt=_k_e_y
  212.           Files on the file server may be protected, and network
  213.           transmissions may be encrypted.  This prevents unau-
  214.           thorized access to files via _s_u_p.  When files are not
  215.           accessible to the default account (e.g.  the anon
  216.           anonymous account), you can specify an alternative
  217.           _a_c_c_o_u_n_t_i_d and _p_a_s_s_w_o_r_d for the file server to use on
  218.           the repository host.  Network transmission of the pass-
  219.           word will be always be encrypted.  You can also have
  220.           the actual file data encrypted by specifying a _k_e_y; the
  221.           file collection on the repository must specify the same
  222.           key or else _s_u_p will not be able to upgrade files from
  223.           that collection.  In this case, the default account
  224.           used by the file server on the repository machine will
  225.           be the owner of the encryption key file (see FILES)
  226.           rather than the anon anonymous account.
  227.  
  228.      notify=_a_d_d_r_e_s_s
  229.           If you use the -m option to receive log messages by
  230.           mail, you can have the mail sent to different user,
  231.           possibly on another host, than the user running the sup
  232.           program.  Messages will be sent to the specified
  233.           _a_d_d_r_e_s_s, which can be any legal netmail address.  In
  234.           particular, a project maintainer can be designated to
  235.           receive mail for that project's file collection from
  236.           all users running _s_u_p to upgrade that collection.
  237.  
  238.      backup
  239.           As described above under the -b flag.
  240.  
  241.      delete
  242.           As described above under the -d flag.
  243.  
  244.      execute
  245.           As described above under the -e flag.
  246.  
  247.      old  As described above under the -o flag.
  248.  
  249. PREPARING A FILE COLLECTION REPOSITORY
  250.      A set of files residing on a repository must be prepared
  251.      before _s_u_p client processes can upgrade those files.  The
  252.      collection must be given a _n_a_m_e and a _b_a_s_e _d_i_r_e_c_t_o_r_y. If it
  253.      is a private collection, client users must be told the name
  254.      of the collection, repository host, and base directory;
  255.      these will be specified in the supfile via the host and
  256.      hostbase options.  For a system-maintained file collection,
  257.      entries must be placed into the host list file and directory
  258.      list file as described in _s_u_p_f_i_l_e_s_r_v(8).
  259.  
  260.      Within the base directory, a subdirectory must be created
  261.      called sup . Within this directory there must be a subdirec-
  262.      tory for each collection using that base directory, whose
  263.      name is the name of the collection; within each of these
  264.      directories will be a list file and possibly a prefix file,
  265.      a host file, an encryption key file, a log file and a scan
  266.      file.  The filenames are listed under FILES below.
  267.  
  268.      prefix
  269.           Normally, all files in the collection are relative to
  270.           the base directory.  This file contains a single line
  271.           which is the name of a directory to be used in place of
  272.           the base directory for file references.
  273.  
  274.      host Normally, all remote host machines are allowed access
  275.           to a file collection.  If you wish to restrict access
  276.           to specific remote hosts for this collection, put each
  277.           allowed hostname on a separate line of text in this
  278.           file.  If a host has more than one name, only one of
  279.           its names needs to be listed.  The name LOCAL can be
  280.           used to grant access to all hosts on the local network.
  281.  
  282.      crypt
  283.           If you wish to use the _s_u_p data encryption mechanism,
  284.           create an encryption file containing, on a single line
  285.           of text, the desired encryption key.  Client processes
  286.           must then specify the same key with the crypt option in
  287.           the supfile or they will be denied access to the files.
  288.           In addition, actual network transmission of file con-
  289.           tents and filenames will be encrypted.
  290.  
  291.      list This file describes the actual list of files to be
  292.           included in this file collection, in a format described
  293.           below.
  294.  
  295.      scan This file, created by _s_u_p_s_c_a_n, is the list of filenames
  296.           that correspond to the instructions in the list file.
  297.           The scan file is only used for frequently-updated file
  298.           collections; it makes the file server run much faster.
  299.           See _s_u_p_s_e_r_v_e_r_s(8) for more information.
  300.  
  301.      lock As previously mentioned, this file is used to indicate
  302.           that the collection should be locked while upgrades are
  303.           in progress.  All file servers will try to get shared
  304.           access to the lock file with _f_l_o_c_k(2).
  305.  
  306.      logfile
  307.           If a log file exists in the collection directory, the
  308.           file server will append the last time an upgrade was
  309.           successfully completed, the time the last upgrade
  310.           started and finished, and the name of the host request-
  311.           ing the upgrade.
  312.  
  313.      It should be noted that _s_u_p allows several different named
  314.      collections to use the same base directory.  Separate
  315.      encryption, remote host access, and file lists are then used
  316.      for each collection.
  317.  
  318.      The list file is a text file with one command on each line.
  319.      Each command contains a keyword and a number of operands
  320.      separated by spaces.  All filenames in the list file are
  321.      evaluated on the repository machine relative to the host's
  322.      base directory, or prefix directory if one is specified, and
  323.      on your machine with respect to the base, or prefix, direc-
  324.      tory for the client.  The _f_i_l_e_n_a_m_e_s below (except _e_x_e_c-
  325.      _c_o_m_m_a_n_d) may all include wild-cards and meta-characters as
  326.      used by _c_s_h(1) including *, ?, [...], and {...}.  The com-
  327.      mands are:
  328.  
  329.      upgrade _f_i_l_e_n_a_m_e ...
  330.           The specified file(s) (or directories) will be included
  331.           in the list of files to be upgraded.  If a directory
  332.           name is given, it recursively includes all subdirec-
  333.           tories and files within that directory.
  334.  
  335.      always _f_i_l_e_n_a_m_e ...
  336.           The always command is identical to upgrade, except that
  337.           omit and omitany commands do not affect filenames
  338.           specified with the always command.
  339.  
  340.      omit _f_i_l_e_n_a_m_e ...
  341.           The specified file(s) (or directories) will be excluded
  342.           from the list of files to be upgraded.  For example, by
  343.           specifying upgrade /usr/vision and omit
  344.           /usr/vision/exp, the generated list of files would
  345.           include all subdirectories and files of /usr/vision
  346.           except /usr/vision/exp (and its subdirectories and
  347.           files).
  348.  
  349.      omitany _p_a_t_t_e_r_n ...
  350.           The specified patterns are compared against the files
  351.           in the upgrade list.  If a pattern matches, the file is
  352.           omitted.  The omitany command currently supports all
  353.           wild-card patterns except {...}.  Also, the pattern
  354.           must match the entire filename, so a leading */, or a
  355.           trailing /*, may be necessary in the pattern.
  356.  
  357.      backup _f_i_l_e_n_a_m_e ...
  358.           The specified file(s) are marked for backup; if they
  359.           are upgraded and the client has specified the backup
  360.           option in the corresponding line of the supfile, then
  361.           backup copies will be created as described above.
  362.           Directories may not be specified, and no recursive
  363.           filename construction is performed; you must specify
  364.           the names of the specific files to be backed up before
  365.           upgrading.
  366.  
  367.      noaccount _f_i_l_e_n_a_m_e ...
  368.           The accounting information of the specified file(s)
  369.           will not be preserved by _s_u_p.  Accounting information
  370.           consists of the owner, group, mode and modified time of
  371.           a file.
  372.  
  373.      symlink _f_i_l_e_n_a_m_e ...
  374.           The specified file(s) are to be treated as symbolic
  375.           links and will be transfered as such and not followed.
  376.           By default, _s_u_p will follow symbolic links.
  377.  
  378.      execute _e_x_e_c-_c_o_m_m_a_n_d (_f_i_l_e_n_a_m_e ...)
  379.           The _e_x_e_c-_c_o_m_m_a_n_d you specified will be executed on the
  380.           client process whenever any of the files listed in
  381.           parentheses are upgraded.  A special token, %s, may be
  382.           specified in the _e_x_e_c-_c_o_m_m_a_n_d and will be replaced by
  383.           the name of the file that was upgraded.  For example,
  384.           if you say execute ranlib %s (libc.a), then whenever
  385.           libc.a is upgraded, the client machine will execute
  386.           ranlib libc.a.  As described above, the client must
  387.           invoke _s_u_p with the -e flag to allow the automatic exe-
  388.           cution of command files.
  389.  
  390.      include _l_i_s_t_f_i_l_e ...
  391.           The specified _l_i_s_t_f_i_l_e_s will be read at this point.
  392.           This is useful when one collection subsumes other col-
  393.           lections; the larger collection can simply specify the
  394.           listfiles for the smaller collections contained within
  395.           it.
  396.  
  397.      The order in which the command lines appear in the list file
  398.      does not matter.  Blank lines may appear freely in the list
  399.      file.
  400.  
  401. FILES
  402.      Files on the client machine for _s_u_p:
  403.  
  404.      /usr/cs/lib/supfiles/name.host
  405.           list of names of host machines acting as name servers
  406.  
  407.      /usr/cs/lib/supfiles/coll.list
  408.           supfile used for -s flag
  409.  
  410.      <_b_a_s_e-_d_i_r_e_c_t_o_r_y>/sup/<_c_o_l_l_e_c_t_i_o_n>/last
  411.           recorded list of files in collection as of last upgrade
  412.  
  413.      <_b_a_s_e-_d_i_r_e_c_t_o_r_y>/sup/<_c_o_l_l_e_c_t_i_o_n>/lock
  414.           file used to lock collection
  415.  
  416.      <_b_a_s_e-_d_i_r_e_c_t_o_r_y>/sup/<_c_o_l_l_e_c_t_i_o_n>/refuse
  417.           list of files to refuse in collection
  418.  
  419.      <_b_a_s_e-_d_i_r_e_c_t_o_r_y>/sup/<_c_o_l_l_e_c_t_i_o_n>/when
  420.           recorded time of last upgrade
  421.  
  422.      /usr/<_c_o_l_l_e_c_t_i_o_n>
  423.           default base directory for file collection
  424.  
  425.      Files needed on each name-server machine for the name
  426.      server:
  427.  
  428.      /usr/cs/lib/supservers/coll.host
  429.           host name list for system collections
  430.  
  431.      Files needed on each repository machine for the file server:
  432.  
  433.      /usr/cs/lib/supservers/coll.dir
  434.           base directory list for system collections
  435.  
  436.      <_b_a_s_e-_d_i_r_e_c_t_o_r_y>/sup/<_c_o_l_l_e_c_t_i_o_n>/crypt
  437.           data encryption key for a collection. the owner of this
  438.           file is the default account used when data encryption
  439.           is specified
  440.  
  441.      <_b_a_s_e-_d_i_r_e_c_t_o_r_y>/sup/<_c_o_l_l_e_c_t_i_o_n>/host
  442.           list of remote hosts allowed to upgrade a collection
  443.  
  444.      <_b_a_s_e-_d_i_r_e_c_t_o_r_y>/sup/<_c_o_l_l_e_c_t_i_o_n>/list
  445.           list file for a collection
  446.  
  447.      <_b_a_s_e-_d_i_r_e_c_t_o_r_y>/sup/<_c_o_l_l_e_c_t_i_o_n>/lock
  448.           lock file for a collection
  449.  
  450.      <_b_a_s_e-_d_i_r_e_c_t_o_r_y>/sup/<_c_o_l_l_e_c_t_i_o_n>/logfile
  451.           log file for a collection
  452.  
  453.      <_b_a_s_e-_d_i_r_e_c_t_o_r_y>/sup/<_c_o_l_l_e_c_t_i_o_n>/prefix
  454.           file containing the name of the prefix directory for a
  455.           collection
  456.  
  457.      <_b_a_s_e-_d_i_r_e_c_t_o_r_y>/sup/<_c_o_l_l_e_c_t_i_o_n>/scan
  458.           scan file for a collection
  459.  
  460.      /usr/<_c_o_l_l_e_c_t_i_o_n>
  461.           default base directory for a file collection
  462.  
  463. SEE ALSO
  464.      _s_u_p_s_e_r_v_e_r_s(8)
  465.      _T_h_e _S_U_P _S_o_f_t_w_a_r_e _U_p_g_r_a_d_e _P_r_o_t_o_c_o_l, S. A. Shafer, CMU Com-
  466.      puter Science Department, 1985.
  467.  
  468. EXAMPLE
  469.      <example>
  470.  
  471. BUGS
  472.      The encryption mechanism should be strengthened, although
  473.      it's not trivial.
  474.  
  475. HISTORY
  476.      10-May-86  Glenn Marcy (gm0w) at Carnegie-Mellon University
  477.           Replaced reference to /usr/cmu with /usr/cs.
  478.  
  479.      29-Mar-86  Glenn Marcy (gm0w) at Carnegie-Mellon University
  480.           Updated manual entry to version 5.14 of sup.
  481.  
  482.      14-Jan-86  Glenn Marcy (gm0w) at Carnegie-Mellon University
  483.           Updated manual entry to version 5.7 of sup.
  484.  
  485.      04-Apr-85  Steven Shafer (sas) at Carnegie-Mellon University
  486.           Created.
  487.