home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 14 Text / 14-Text.zip / machdocs.zip / sup.doc < prev    next >
Internet Message Format  |  1993-02-26  |  42KB

  1. From Pa.dec.com!nobody Thu Feb 25 20:15:44 1993
  2. Return-Path: <Pa.dec.com!nobody>
  3. Received: by ukelele.GCR.COM (Smail3.1.28.1 #1)
  4.     id m0nRtfz-0001S0a; Thu, 25 Feb 93 20:15 EST
  5. Received: from inet-gw-2.pa.dec.com by uu5.psi.com (5.65b/4.0.071791-PSI/PSINet) via SMTP;
  6.         id AA01605 for spj@ukelele.GCR.COM; Thu, 25 Feb 93 19:09:45 -0500
  7. Received: by inet-gw-2.pa.dec.com; id AA28452; Thu, 25 Feb 93 16:09:49 -0800
  8. Date: Thu, 25 Feb 93 16:09:49 -0800
  9. Message-Id: <9302260009.AA28452@inet-gw-2.pa.dec.com>
  10. From: "ftpmail service on inet-gw-2.pa.dec.com" <nobody@Pa.dec.com>
  11. To: spj@ukelele.GCR.COM
  12. Subject: part 001 of /.0/Mach/doc/sup.doc (@gatekeeper.dec.com) [Mach Dox] (ascii, last)
  13. X-Complaints-To: ftpmail-admin@inet-gw-2.pa.dec.com
  14. X-Service-Address: ftpmail@inet-gw-2.pa.dec.com
  15. X-Job-Number: 730680718.24209
  16. Precedence: bulk
  17. Reply-To: <nobody@inet-gw-2.pa.dec.com>
  18. Content-Type: text
  19. Content-Length: 41250
  20. Status: O
  21.  
  22.  
  23.  
  24.  
  25.  
  26.  
  27.  
  28.  
  29.  
  30.  
  31.  
  32.  
  33.                        THE SUP SOFTWARE UPGRADE PROTOCOL
  34.  
  35.  
  36.  
  37.  
  38.  
  39.  
  40.  
  41.  
  42.  
  43.  
  44.  
  45.  
  46.  
  47.  
  48.  
  49.  
  50.  
  51.  
  52.  
  53.  
  54.  
  55.  
  56.  
  57.                           Carnegie Mellon University
  58.                           School of Computer Science
  59.  
  60.                                  Steven Shafer
  61.                                  Mary Thompson
  62.  
  63.                                8 September 1989
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70.  
  71.  
  72.  
  73.   The  SUP  system  is  a  set  of  programs  for maintaining a set of files in
  74. identical versions across a network of cooperating machines.  It runs under the
  75. Mach operating system.
  76. 1. Introduction
  77.   The  SUP System is a set of programs that provide for collections of files to
  78. be maintained in identical  versions  across  a  number  of  machines.    These
  79. programs are:
  80.  
  81. SUP             The "client" program, run by users or system maintainers, which
  82.                 initiates the upgrade activity  on  a  machine  requesting  the
  83.                 latest  version of a collection of files.  SUP will normally be
  84.                 run as a daemon, firing up once  each  night  (week,  etc.)  to
  85.                 upgrade the specified file collections.
  86.  
  87. SUPFILESRV      The  "file  server" program, a daemon that is run by the system
  88.                 maintainer to service requests for files  initiated  by  client
  89.                 SUP  programs.  The file server runs on every machine used as a
  90.                 "repository" of distributable  versions  of  files.    It  runs
  91.                 continuously  and  listens  for  network connection requests by
  92.                 individual  client  processes;  for  each   individual   client
  93.                 request, a process is forked to service that request.
  94.  
  95. SUPSCAN         The   "file  scanner"  program,  that  may  optionally  be  run
  96.                 periodically to speed up execution of  the  file  server.    It
  97.                 pre-compiles  a list of files on the file system that match the
  98.                 specifications for a given file collection  so  that  the  file
  99.                 server need not do this during each upgrade of that collection.
  100.                 The file scanner is normally used daily  for  very  large  file
  101.                 collections  that  are upgraded by many clients each day; it is
  102.                 not so useful for small file collections or for those that  are
  103.                 upgraded by only a few client machines per day.
  104.  
  105.   When SUP is run, the user designates the names of certain "file collections",
  106. sets of files, that should be upgraded.   All  pre-defined  system  collections
  107. have  entries in the coll.host file that gives the name of the host will act as
  108. the repository for that software collection.  The file server on  that  machine
  109. provides  a  list  of  the files included in the collection and which ones have
  110. been changed since the last time this collection was upgraded from that  client
  111. machine;  the  client decides which of these files it needs to receive; and the
  112. files are sent from the file server.  In this way, files can  be  installed  on
  113. the  repository machine once, and they will propagate to all machines upgrading
  114. from that repository as soon as the respective users execute SUP to perform the
  115. upgrade.    This  allows groups of cooperating users to establish sets of files
  116. that can be relied upon to be the same across a set of host machines.
  117.  
  118.   SUP is intended to provide a broadcast  facility  for  maintaining  identical
  119. versions  of  files  across  multiple  machines.  An alternative approach is to
  120. provide a common file system; even when such a  system  is  available,  SUP  is
  121. useful  for  maintaining  frequently  used files on local disk storage, and for
  122. maintaining files across the file server machines themselves.
  123.  
  124.   The SUP system does not  address  the  issues  of  version  control,  nor  of
  125. maintaining  compatibility  of  pieces of a system that are being independently
  126. changed by different users or on different machines; what  SUP  provides  is  a
  127. broadcast  mechanism  for issuing stable, reliable versions of software or data
  128. files, produced by a small number of maintainers and needed by a larger  number
  129. of users.  SUP is intended specifically to address these situations:
  130.  
  131.    - A large collection of system software prepared by a maintenance staff
  132.      for use by a large user community.  For  example,  the  CMU-CSD  UNIX
  133.      software  used  by hundreds of workstations.  In such situations, the
  134.      users know absolutely nothing about how to obtain such software,  but
  135.      they   need  to  keep  it  constantly  upgraded  on  their  machines.
  136.      Similarly, the  maintainers  cannot  possibly  maintain  each  user's
  137.      machine individually: they must rely on a broadcast mechanism such as
  138.      SUP.
  139.  
  140.    - A moderate collection of  software  and  data  files  shared  by  the
  141.      members  of  a  project.    For example, the vision libraries used by
  142.      computer vision researchers  at  CMU.    Again,  a  small  number  of
  143.      maintainers on a specific machine produce and maintain this software,
  144.      which is used by many users on many machines in the CMU  environment.
  145.      However,  SUP  will not support the practice of some groups that have
  146.      large programs with different pieces  being  simultaneously  modified
  147.      and tested in incompatible ways by various users.
  148.  
  149.    - A  user  with accounts on more than one machine.  Such a user can set
  150.      up SUP to automatically copy a collection of files from  one  machine
  151.      to  one  or  more  others whenever they are changed on the repository
  152.      machine.
  153.  
  154.   If the system maintenance staff is  involved  on  the  repository  machine  a
  155. "system"  file collection can be set up for which client SUP programs need know
  156. nothing but the name of the collection.  Otherwise, the file collection will be
  157. "private",  and  client  SUP programs must be specifically told the name of the
  158. repository host and the base directory name for the collection on that host.
  159.  
  160.   SUP provides facilities for upgrading read-protected files (i.e.  files  that
  161. are  not  readable by the general public), data encryption of transmitted files
  162. and filenames, allowing access only to selected host machines not on the  local
  163. network,  automatically  creating  backup  copies  of critical files, executing
  164. command-files or programs after upgrading files that require special  handling,
  165. and  mailing  progress  and error messages to designated users.  SUP is also as
  166. clever as can be about ensuring that upgraded files have  the  same  accounting
  167. information  (mode,  owner,  links,  etc.)  on  the  client  machine  as on the
  168. repository machine, and ensuring that upgrade problems don't wipe out  existing
  169. files when this is avoidable.
  170. 2. How to Use SUP to Upgrade a File Collection
  171.   You  will normally want to run SUP periodically, say every day or every week,
  172. using the at program, to upgrade important file collections such as UNIX system
  173. software.    You  can  also  execute SUP directly at any time.  The SUP command
  174. looks like this:
  175.  
  176.     $ sup [flags] [supfile]
  177.  
  178. These are the flags and arguments:
  179.  
  180. -a (all files)  Normally, SUP only upgrades files if they  are  out-of-date  or
  181.                 missing  on your machine.  If you specify the -a flag, then all
  182.                 files in the collection will be upgraded regardless of  whether
  183.                 they meet these conditions.  This is useful for recovering from
  184.                 catastrophic file deletions or disk crashes.
  185.  
  186. -b (backup)      If this flag  is  given,  or  the  backup  supfile  option  is
  187.                 specified,  the  contents  of regular files on the local system
  188.                 will be saved before they are overwritten with new data.    The
  189.                 file  collection  maintainer can designate specific files to be
  190.                 worthy of backing up whenever they are upgraded.  However, such
  191.                 backup  will  only  take  place if you specify this flag or the
  192.                 backup option to allow backups for a file  collection  on  your
  193.                 machine.    The  backup  mechanism  will  create  a copy of the
  194.                 current version of a file immediately  before  a  new  copy  is
  195.                 received  from the file server; the copy is given the same name
  196.                 as the original file but is put into a directory called  BACKUP
  197.                 within  the  directory  containing  the  original  file.    For
  198.                 example, /usr/sas/src/foo.c would have  a  backup  copy  called
  199.                 /usr/sas/src/BACKUP/foo.c.      There   is   no  provision  for
  200.                 automatically maintaining multiple old versions of  files;  you
  201.                 would have to do this yourself.
  202.  
  203. -B              overrides  and  disables  the  -b  flag  and the backup supfile
  204.                 option.
  205.  
  206. -d (delete)      Files that are no longer in the collection on  the  repository
  207.                 will be deleted if present on the local machine.  This may also
  208.                 be specified in a supfile with the deleteoption.
  209.  
  210. -D              This flag overrides and disables the -d  flag  and  the  delete
  211.                 supfile option.
  212.  
  213. -e (execute)    Sup  will execute commands sent from the repository that should
  214.                 be run when a file is upgraded.  If the  -e  flag  is  omitted,
  215.                 Sup will print a message that specifies the command to execute.
  216.                 This may also be  specified  in  a  supfile  with  the  execute
  217.                 option.
  218.  
  219. -E              overrides  and  disables  the  -e  flag and the execute supfile
  220.                 option.
  221.  
  222. -f (file list)  If you specify -f, then SUP will print a list of all the  files
  223.                 in  the specified collections, indicating which ones need to be
  224.                 upgraded, which  are  directories,  and  which  require  backup
  225.                 copies  to  be  created.    The  upgrade  itself  will  not  be
  226.                 performed.
  227.  
  228. -l (local)       Normally, SUP will not upgrade a collection if the  repository
  229.                 is  on  the same machine.  This allows users to run upgrades on
  230.                 all machines without having to  make  special  checks  for  the
  231.                 repository  machine.   If the -l flag is specified, collections
  232.                 will be upgraded even if the repository is local.
  233.  
  234. -m (mail)       Normally, SUP prints log messages on its  standard  output  and
  235.                 diagnostic  output.   With the -m flag, messages will be mailed
  236.                 to you instead.  This also  allows  the  notify  option  to  be
  237.                 effective  (see  the discussion of supfiles below) to send mail
  238.                 to someone else.
  239.  
  240. -N (network debugging)
  241.                 The  -N  flag  causes  SUP  to  produce  tons  of  output lines
  242.                 describing   the   progress   and   status   of   the   network
  243.                 communications with the name server and file server.
  244.  
  245. -P (debugging ports)
  246.                 The -P flag tells SUP to use an alternate set of TCP ports from
  247.                 the  normal  ports.    This  is  a  debugging  aid  for  system
  248.                 maintenance.
  249.  
  250. -o (old files)  This flag overrides the noold  option  if  it  appears  in  the
  251.                 supfile.    The  -a  flag also overrides the noold option.  See
  252.                 "Supfiles" below for details.
  253.  
  254. -O              overrides and disables the -o flag and the old supfile option.
  255.  
  256. -s (system collections)
  257.                 Normally,  you  will specify a specific supfile to describe the
  258.                 file collections you want.  If you use  the  -s  flag,  then  a
  259.                 specific  supfile  will  be  used  that  describes  the  system
  260.                 software file collections.  The supfile for system software  is
  261.                 /usr/cmu/lib/supfiles/coll.list.
  262.  
  263. -t (time)       If you specify -t, then SUP will simply print out the last time
  264.                 and  date  at  which  each  specified   file   collection   was
  265.                 successfully  upgraded; it will not perform any actual upgrade.
  266.                 This is a diagnostic aid  in  case  you  suspect  the  upgrades
  267.                 aren't working.
  268.  
  269. -v (verbose)    Normally,  SUP only produces messages to tell what's gone wrong
  270.                 (if anything does go wrong).  With the -v flag,  messages  will
  271.                 be  produced  to  tell  what is happening when things are going
  272.                 normally as well.
  273.  
  274. supfile         You must specify the name of a supfile, unless you use  the  -s
  275.                 flag  to  indicate  the  system software supfile.  The supfile,
  276.                 described below, specifies which file collections you  want  to
  277.                 upgrade.
  278.  
  279.   For example, to upgrade system software on your machine, type:
  280.  
  281.     $ sup -s
  282.  
  283. or, to have detailed log messages mailed to you:
  284.  
  285.     $ sup -v -m -s
  286.  
  287. Because  SUP runs with your user-id, you will not be able to upgrade the system
  288. software unless you are logged onto that account when you execute SUP.
  289.  
  290.   Each file collection being upgraded  must  have  a  base  directory  on  your
  291. machine,  which  will normally contain all the files in the collection.  Within
  292. this directory there should be a subdirectory called sup that will be  used  by
  293. the SUP program; it will be created automatically if you do not create it.  SUP
  294. will put files into this directory as needed.
  295.  
  296.   If you want to find out what files need to be upgraded, type:
  297.  
  298.     $ sup -f supfile
  299.  
  300. This will list all the files in the collection, indicating  which  need  to  be
  301. upgraded  (and  why), which are directories, and which would have backup copies
  302. created if the upgrade were performed.  If you simply want to find out the date
  303. and time of the last successful upgrades, type:
  304.  
  305.     $ sup -t supfile
  306.  
  307. This  will  print  the  collection  name  and time of the last upgrade for each
  308. collection described in the indicated supfile.  For the system collections, you
  309. can use:
  310.  
  311.     $ sup -s -t
  312.  
  313. 2.1 Supfiles
  314.   When you execute SUP, you specify a supfile either by name or by using the -s
  315. flag.  This file is a list of the file collections you wish to upgrade.
  316.  
  317.   The supfile is a text file, with each file collection described on  a  single
  318. line.    The  line  begins with the name of the collection, and may then have a
  319. number of options separated by spaces.  The options are:
  320.  
  321. base=directory  The name of the base directory on this machine  for  this  file
  322.                 collection,   when   you   don't   want   to  use  the  default
  323.                 (/usr/collection).
  324.  
  325. host=hostname   The name of the host machine acting as the repository for  this
  326.                 file  collection,  used  for  "private"  file collections.  For
  327.                 "system" file collections, this is unnecessary because the this
  328.                 information is kept in /usr/cs/lib/supfiles/coll.host.
  329.  
  330. hostbase=directory
  331.                 The name of the base directory on the  repository  machine  for
  332.                 the  file  collection  (see  "How  to Set Up a File Collection"
  333.                 below).  This is also used only for "private" file collections;
  334.                 for  "system"  file  collections,  the  information is obtained
  335.                 automatically by the file server.  The default name of the host
  336.                 base directory is /usr/collection.
  337.  
  338. login=accountid The name of the account to be used by the file server, when the
  339.                 default is not acceptable (i.e. it doesn't have  the  necessary
  340.                 file  access  privileges  to  read  the  file collection).  The
  341.                 default at CMU is  the  "Anonymous  FTP"  account  if  no  data
  342.                 encryption   is   used,   or   the   owner   of  the  directory
  343.                 sup/collection within the repository machine's  base  directory
  344.                 if encryption is used.
  345.  
  346. password=password
  347.                 The password used  for  the  login  account  specified  by  the
  348.                 "login" option.  This password will be transmitted in encrypted
  349.                 form over the network.
  350.  
  351. crypt=key       An optional encryption key for filenames and file data for this
  352.                 file  collection.    If used, the same key must be specified on
  353.                 the repository machine or the  upgrade  will  not  take  place.
  354.                 This  key  is  used  for  filenames  and  data  only -- not for
  355.                 transmission of the passsword in the "password"  option.    The
  356.                 use  of  data  encryption  also  implies  an  alternate default
  357.                 account for the file server (see the "login" option above).
  358.  
  359. notify=mailaddress
  360.                 The  account  name  to  which  mail  is to be addressed for log
  361.                 messages for this file collection, when the -m flag is given to
  362.                 SUP.  The account name can be a complete mail address, possibly
  363.                 including a network host name such as sas@cmu-cs-ius.
  364.  
  365. noexec          This option prevents the automatic execution of  command  files
  366.                 on  your  machine  with  the upgrade is finished (see "What SUP
  367.                 Does" below).
  368.  
  369. backup          This option enables backup  copies  of  critical  files  to  be
  370.                 created by SUP as specified in "What SUP Does" below.
  371.  
  372. nodelete        This option prevents SUP from deleting files on your machine if
  373.                 they are deleted from the file  collection  on  the  repository
  374.                 machine.
  375.  
  376. noold           This  option  tells SUP not to check on files in the collection
  377.                 that have not been modified or created since the last  upgrade.
  378.                 This  allows  SUP to run much faster on large file collections,
  379.                 but prevents it from deleting files on the  client  machine  if
  380.                 they  are  deleted from the repository, or from restoring files
  381.                 that have been accidentally deleted from  the  client  machine.
  382.                 This  option  is  normally  useful  only  for  very  large file
  383.                 collections.   Its  function  subsumes  that  of  the  nodelete
  384.                 option.    The noold flag will be ignored when either the -a or
  385.                 -o flag is specified to SUP; this allows a complete file  check
  386.                 to  be  performed with the -o flag when needed to recover from,
  387.                 say, accidental deletion of critical files.
  388.  
  389.   Here is an example of a supfile:
  390.  
  391.     cmu  backup
  392.     vision  crypt=pupil backup notify=vision@cmu-cs-ius
  393.     sas  host=ius hostbase=/usr/sas/sun login=sas password=foo crypt=bletch
  394.  
  395. This supfile specifies the following file collection upgrades:
  396.  
  397. cmu             The "cmu" file collection, which is a "system" file collection,
  398.                 with  local  base  directory  /usr/cmu  (the  default).  Backup
  399.                 copies of critical files will be created during upgrading.
  400.  
  401. vision          The "vision" file collection, also a "system" file  collection,
  402.                 with  local  base  directory  /usr/vision.    Backups  will  be
  403.                 created.  The data will be encrypted with key  pupil,  and  log
  404.                 messages will be sent to the vision account on cmu-cs-ius.
  405.  
  406. sas             A   "private"   file  collection  will  be  upgraded  from  the
  407.                 cmu-cs-ius machine.  The remote base directory is /usr/sas/sun,
  408.                 but the local base directory is /usr/sas.  The file server will
  409.                 login on account sas  with  password  foo;  the  data  will  be
  410.                 encrypted with key bletch.
  411. 3. What SUP Does
  412.   An upgrade involves several steps:
  413.  
  414.    1. SUP  first  reads  the specified supfile, checking it for errors and
  415.       recording all the specifications and options.
  416.  
  417.    2. If any collections do not specify a host  name,  SUP  will  look  in
  418.       /usr/cs/supfiles/coll.host  to  find  out the names of the hosts for
  419.       these collections.  In the preceding example, the name server  would
  420.       be  asked  to  supply  the  host  names  for the cmu and vision file
  421.       collections.
  422.  
  423.    3. For each collection on the list, SUP will connect to the file server
  424.       on  the  appropriate host and carry on the upgrade process.  (If the
  425.       file server is on the same host machine as the client, and the  base
  426.       directories are the same, then no upgrade is performed.)
  427.  
  428.          a. The  file server and SUP exchange setup information, including
  429.             the host base directory, login  account  name,  password,  and
  430.             encryption  key.    SUP  also  reports  the  time  of the last
  431.             upgrade, by looking  in  the  file  sup/collection/when  (e.g.
  432.             /usr/vision/sup/vision/when)  on the client machine.  The file
  433.             server gets the base directory name, if needed, by looking  in
  434.             the   file   /usr/cs/lib/supservers/coll.dir,   and  gets  the
  435.             encryption key from  sup/collection/crypt  on  the  repository
  436.             machine.  The connection may be refused by the file server for
  437.             such reasons as:
  438.  
  439.                - incorrect login name or password
  440.                - base  directory  is  protected  against  access  by   the
  441.                  specified account
  442.                - incorrect data encryption key
  443.                - host not allowed access
  444.  
  445.          b. Once  the  connection is established and access permission has
  446.             been granted as above, the file server builds a  list  of  all
  447.             files  and  directories in the file collection.  The list file
  448.             sup/collection/list (see "How to Set  Up  a  File  Collection"
  449.             below)  is used to generate this list.  The files indicated in
  450.             the list file are marked with  a  special  flag  if  they  are
  451.             indicated  to  have  backup copies created in case of upgrade.
  452.             The last modification date of each file is checked against the
  453.             time  of  the last upgrade (reported by the client above), and
  454.             if it has been modified since the last upgrade, a flag is  set
  455.             to  indicate  that  the  client's  copy of this file is out of
  456.             date.  The file list, along with the  backup  and  out-of-date
  457.             flag  for  each  file,  is sent to the client.  If a scan file
  458.             exists as created by SUPSCAN (sup/collection/scan),  then  the
  459.             file  list  is  taken  from  the  scan  file  instead of being
  460.             constructed from the list file by the file server.    In  this
  461.             case,  the  time of record for the upgrade will be the time at
  462.             which the scan file was created rather than the time at  which
  463.             the  upgrade  actually  occurs.    If  the  noold  option  was
  464.             specified in the supfile (and not overridden by the -a  or  -o
  465.             flag to SUP), the list of filenames sent to the client process
  466.             will exclude those files that were  not  created  or  modified
  467.             since the last upgrade.
  468.  
  469.          c. The  client  SUP  process  receives  the  list  of  files  and
  470.             constructs a list of the files it needs.  This  will  normally
  471.             be those files that are either (1) out-of-date as indicated by
  472.             the flag sent from the file server, or (2)  missing  from  the
  473.             local  machine.  However, if the -a flag was specified to SUP,
  474.             then every file in the list will be  selected  by  the  client
  475.             process.  The list of needed files is sent to the file server.
  476.             For each selected file, if the backup flag was marked and  the
  477.             user specified the backup option in the supfile, then a backup
  478.             copy of the file will be created.  This will be a copy of  the
  479.             file  with  "backup/"  inserted in the filename just after the
  480.             directory name, i.e.  /usr/vision/lib/libvision.a would have a
  481.             backup  copy  named  /usr/vision/lib/backup/libvision.a.  (The
  482.             indicated  directory,  e.g.  /usr/vision/lib/backup,  will  be
  483.             created if needed.)  Also at this time, if the nodelete option
  484.             was not specified, the client reads its list of files  in  the
  485.             collection     during    the    last    successful    upgrade,
  486.             sup/collection/last, and deletes any files appearing  in  that
  487.             list that are not in the current file list.
  488.  
  489.          d. The  file  server  receives the list of files requested by the
  490.             client.  It checks to see that each file is  on  its  list  of
  491.             files  for  this collection, and that each file is accessible;
  492.             if a file fails either condition its name will be reported  to
  493.             the  client as being denied to that client.  Each file will be
  494.             sent to the client machine,  along  with  the  owning  account
  495.             name,  the  owning group name, the 12 low-order mode bits, and
  496.             the last modification time for that file.  If a file has  more
  497.             than  one  link (filename), both of which are requested by the
  498.             client, then the file will be sent once and the second  (etc.)
  499.             filename will be accompanied only by a flag saying it's a link
  500.             and the name of the file actually sent.  The  client  receives
  501.             each   file   and   processes  it  as  described  under  "File
  502.             Installation" below.  Directories  are  treated  similarly  to
  503.             files;  the  mode,  owning account and group, and modification
  504.             time  are  transmitted  to  the  client  machine  whenever   a
  505.             directory is upgraded.
  506.  
  507.          e. When all files have been transmitted, the file server looks at
  508.             the list of command-files to be executed after  upgrading  for
  509.             this collection (see "How to Set Up a File Collection" below).
  510.             If any of the command-files or their trigger files  have  been
  511.             upgraded,  then  the  client  is  sent  the  filename  of  the
  512.             command-file.  The client SUP process  will  normally  execute
  513.             these  files; however, if the user has specified noexec in the
  514.             supfile, then the files will not be executed.  In this case, a
  515.             log message will be created and printed or mailed, telling the
  516.             user to please execute these files.    When  creating  command
  517.             files  to be executed by SUP, you should bear in mind that the
  518.             command file might be  executed  several  times  on  the  same
  519.             version of the trigger files.
  520.  
  521.          f. Finally,  if  the  upgrade is successfully completed, the file
  522.             server reports the time  (on  its  own  clock)  at  which  the
  523.             upgrade  began;  the  client will record this time in the file
  524.             sup/collection/when to be reported as above at  the  start  of
  525.             the  next  upgrade.  If the nodelete option was not specified,
  526.             then the list of all files in the collection is  written  into
  527.             sup/collection/last.
  528.  
  529.   SUP  and  the  server  processes begin each connection by determining whether
  530. byte-swapping is necessary for passing integers across the network.  If so, the
  531. server  process  performs  byte-swapping  on input or output of integers to the
  532. network, while the client uses its natural representation for network I/O.
  533.  
  534. 3.1 File Installation
  535.   When SUP receives an ordinary file  (i.e.  one  that  is  not  a  link  to  a
  536. previously sent file), it follows this procedure:
  537.  
  538.    1. If  the  file doesn't already exist on the local machine, it's a new
  539.       file.  It will be created and the data will be  read  directly  into
  540.       this file.
  541.  
  542.    2. Otherwise, the file already exists.  An attempt will be made to read
  543.       the file contents from the network into a temporary file, which will
  544.       later  be  renamed to replace the destination file.  SUP will try to
  545.       create a temporary file in  the  following  directories,  proceeding
  546.       down the list until one of the attempts succeeds:
  547.  
  548.          a. destination-directory   (the  directory  containing  the  file
  549.             itself)
  550.          b. sup (the sup subdirectory of the local base directory)
  551.          c. . (the local base directory)
  552.          d. /usr/tmp
  553.          e. /tmp
  554.  
  555.       If all these attempts fail, SUP will try to create  the  destination
  556.       file  itself  instead of using a temporary file.  If that fails, SUP
  557.       will complain with a log message and go on to the next file.
  558.  
  559.    3. The file data itself is read into the temporary or destination file.
  560.       Interrupts are disabled during this process.
  561.  
  562.    4. If  the  file  read  was  a  temporary  file,  it  is renamed to the
  563.       destination file.  This is done via link/unlink, if possible, unless
  564.       the destination file has more than one link already on this machine.
  565.       If the link/unlink fails or if the  destination  file  has  multiple
  566.       links, then the temporary file is actually copied to the destination
  567.       and the temporary file is unlinked.
  568.  
  569.    5. The owner, group, modification time, and low-order 12 mode  bits  of
  570.       the  destination  file  are set to the values received from the file
  571.       server.  The last-access time of the file  is  set  to  the  current
  572.       local clock.
  573.  
  574.    6. If  the  -v  flag  was  specified  to  SUP, a log message is printed
  575.       indicating the successful receipt of the file.
  576.  
  577.   When SUP receives a new link to a file previously received, it  simply  tries
  578. to  unlink  and  link unless the two names are on different file systems on the
  579. local machine.  If this is the case, or if the link fails, then the  previously
  580. received  file  is  actually  copied  to  the  new name (using exactly the same
  581. process as described above for creating a temporary file if needed, etc.)   The
  582. file-system  comparison  checks  the file system of the old file itself and the
  583. directory containing the new name.
  584.  
  585.   In all cases, if the directory containing a received file or  link  does  not
  586. exist  on  the local machine, SUP creates it with mkdir (recursively if needed)
  587. before creating that file or link.  The mode, owner,  group,  and  modification
  588. time of the newly created directory will then be set to be the same as the mode
  589. of the corresponding directory on the  repository  machine.    This  accounting
  590. information  will  be  updated  whenever  the  directory  is  modified  on  the
  591. repository machine.
  592.  
  593.   As can be seen from this description, SUP will work the most  smoothly  (i.e.
  594. always  using link/unlink for file name changing) if it has write permission in
  595. the local base directory and in all subdirectories of that directory.
  596. 4. How to Set Up a File Collection
  597.   It takes only a little bit of effort  to  set  up  a  file  collection  on  a
  598. repository machine to be upgraded by authorized clients.
  599.  
  600.   First,  the file collection must be given a name and a base directory.  There
  601. can  be  several  collections  with  different  names  sharing  the  same  base
  602. directory;  for example, there might be a file collection called cmulib for the
  603. CMU C library, and one called cmumathlib for just the math routines in the  CMU
  604. C library, both using /usr/cmu as the base directory.
  605.  
  606.   If  it  is a "private" file collection, client users must be told the name of
  607. the repository host and the name of the host base directory for use in the host
  608. and  hostbase  options  in  the  supfile, described above.  If it is a "system"
  609. collection instead, the system maintainers must alert the name servers  of  the
  610. host  name  (in  /usr/cmu/lib/supservers/coll.host)  and  the  appropriate file
  611. server of the base directory name (if not  the  default,  by  putting  it  into
  612. /usr/cmu/lib/supservers/coll.dir).
  613.  
  614.   Within the base directory, a subdirectory must be created called sup.  Within
  615. this subdirectory will be a further subdirectory whose name is the name of  the
  616. collection (there may be several of these if several collections share the same
  617. base directory).  Each collection's subdirectory will contain  any  or  all  of
  618. four files:
  619.  
  620. collection/list The  list  file,  describing  the files in the collection.  The
  621.                 format of this file is explained below.
  622.  
  623. collection/host Normally, the file server allows access to a collection by  all
  624.                 machines.   If you wish to allow access only to specific remote
  625.                 hosts, you can list their names, one per  line,  in  this  text
  626.                 file.    If a remote host has several alias names, it need only
  627.                 be listed once in this file.  The name LOCAL  can  be  used  to
  628.                 allow access to all machines on the local network.  This access
  629.                 control is in addition to the  other  forms  of  authentication
  630.                 provided  by  SUP  (data  encryption  and  UNIX file protection
  631.                 modes).
  632.  
  633. collection/crypt
  634.                 If  you wish to apply data encryption to the filenames and file
  635.                 contents in this collection during upgrading, create this  file
  636.                 and place in it the encryption key.  This should be on a single
  637.                 line of text containing nothing else except an optional newline
  638.                 character.    The client must supply the same key via the crypt
  639.                 option in the supfile for this file collection; the file server
  640.                 checks  that  explicitly before authorizing the upgrade to take
  641.                 place.
  642.  
  643. collection/scan To speed up execution of the  file  server,  you  may  wish  to
  644.                 create a scan file periodically.  This is done by executing the
  645.                 SUPSCAN program:
  646.  
  647.                     $ supscan [-v] collection [basedir]
  648.  
  649.                 This  will  construct  a  list  of  all  files   matching   the
  650.                 specifications  in  the  list  file,  and record it in the scan
  651.                 file.  When an upgrade is performed on the collection, the file
  652.                 server  will  notice that the scan file is present and use this
  653.                 list  instead  of  actually  building  the  filename  list   by
  654.                 analyzing  the  list  file.  The time of record for the upgrade
  655.                 will then be the time at which the scan file was created rather
  656.                 than the time at which the upgrade occurs.  A scan file is only
  657.                 useful for very large file collections that are  upgraded  many
  658.                 times  each  day.    The options for the SUPSCAN program are -v
  659.                 ("verbose") to produce messages as it scans the file list,  and
  660.                 basedir  if  the  collection is a private collection whose base
  661.                 directory name is not the default name.
  662.  
  663.   This is all the preparation required for a file collection to be upgraded.
  664.  
  665.   Note that the default user-id for the file server is "Anonymous  FTP"  if  no
  666. data  encryption  is used; if encryption is used, the default will be the owner
  667. of the subdirectory sup/collection within the base directory.
  668.  
  669. 4.1 The List File
  670.   The list file contains a description  of  the  files  to  be  upgraded.    It
  671. contains  any  number  of commands, each on a separate line of text.  Each line
  672. contains a keyword and a number of operands separated by spaces.  All filenames
  673. in  the  list  are evaluated relative to the collection's base directory on the
  674. repository machine for the file server, and relative to the base  directory  on
  675. the  client  machine  for the client SUP process.  All (except execfile) may be
  676. file specifications containing the shell's meta-characters  *,  ?,  [...],  and
  677. {...}.
  678.  
  679.   The commands are:
  680.  
  681. upgrade filename ...
  682.                 These files will be  included  in  the  list  of  files  to  be
  683.                 upgraded.   If a directory name is given, all the files in that
  684.                 directory will be  included  and  any  subdirectories  will  be
  685.                 recursively included as well.
  686.  
  687. omit filename ...
  688.                 These files will not be included in the list; if a directory is
  689.                 specified,  it  will  not  be included nor will its contents be
  690.                 included.  For example, the specifications upgrade lib and omit
  691.                 lib/test  will  include  all  files  and  subdirectories of lib
  692.                 except  lib/test  (and  any  subdirectories  or  files   within
  693.                 lib/test).
  694.  
  695. omitany pattern ...
  696.                 The specified patterns are compared against the  files  in  the
  697.                 upgrade  list.  If a pattern matches, the file is omitted.  The
  698.                 omitany  command  currently  supports  all  wild-card  patterns
  699.                 except  {...}.    Also,  the  pattern  must  match  the  entire
  700.                 filename, so a leading */, or a trailing /*, may  be  necessary
  701.                 in the pattern.
  702.  
  703. backup filename ...
  704.                 The files will be marked for creating  backup  copies  whenever
  705.                 they  are  upgraded  (as  described  above).  Only files can be
  706.                 included in this list -- not  directories.    As  noted  above,
  707.                 actual  backup  copies  will  only be created by SUP when these
  708.                 files are being  upgraded,  and  then  only  if  the  user  has
  709.                 specified the backup option in the supfile.
  710.  
  711. execute execfile (triggerfile ...) ...
  712.                 The listed execfiles  are  command  files  or  programs  to  be
  713.                 executed  after  an  upgrade to perform routine installation of
  714.                 the upgraded files.  Each execfile will be executed  only  when
  715.                 it  is  upgraded itself, or when any of its listed triggerfiles
  716.                 have been upgraded.  The installation tasks performed  by  such
  717.                 files  might  be, for example, creating a table of contents for
  718.                 manual entries or for a subroutine library, or modifying a host
  719.                 name field within a data file.
  720.  
  721. include listfile ...
  722.                 The named listfiles will be read at this point.  This allows  a
  723.                 collection  to  contain  another collection in its entirety, by
  724.                 simply specifying the name  of  the  listfile  for  that  other
  725.                 collection.
  726.  
  727. backup filename...
  728.                 The specified file(s)  are  marked  for  backup;  if  they  are
  729.                 upgraded  and the client has specified the backup option in the
  730.                 corresponding line of the supfile, then backup copies  will  be
  731.                 created  as described above.  Directories may not be specified,
  732.                 and no recursive filename construction is performed;  you  must
  733.                 specify  the names of the specific files to be backed up before
  734.                 upgrading.
  735.  
  736. symlink filename...
  737.                 The  specified  file(s) are to be treated as symbolic links and
  738.                 will be transfered as such and not followed.  By  default,  SUP
  739.                 will follow symbolic links.
  740.  
  741. rsymlink dirname...
  742.                 All the symbolic links in the specified subdirectories  are  to
  743.                 be transferred as such and not followed.
  744.  
  745.   Blank  lines  may  appear  freely  in  the  list file, and the order in which
  746. command lines appear within the file does not matter.  Filenames must generally
  747. match  as  strings, e.g.  with base directory /usr/vision, "lib" in the upgrade
  748. command would not match "/usr/vision/lib" in the omit command;  it  would  only
  749. match  "lib"  in  the omit command.  However, one special exception exists:  if
  750. the base directory is specified via "dot"  (.)  in  the  upgrade  command,  the
  751. filenames  within  that  directory  need not begin with "./" in other commands.
  752. For example, with base directory /usr/vision,  the  commands  "upgrade  ."  and
  753. "omit  exp"  specify  a  file  list  including all files and directories within
  754. /usr/vision except the subdirectory /usr/vision/exp and its subdirectories  and
  755. files.
  756. 5. Setup for SUP
  757.   You need to add the following entries to /etc/services:
  758.  
  759.     supfilesrv      871/tcp
  760.     supfiledbg      1127/tcp
  761.  
  762.   A  supfilsrv  daemon  should be kept running on any machine that may act as a
  763. repository for a collection. Since this includes  private  collections,  it  is
  764. advisable  to  have  supfilesrv  running on all machines if SUP is to be widely
  765. used. nanny can be used to start the supfilesrv.
  766.  
  767.   The program modcoll.8 is used to set up the control files  for  the  "system"
  768. collections. See /usr/cs/man/man8/modcoll.8
  769.                                Table of Contents
  770.  
  771. 1. Introduction                                                               1
  772.  
  773. 2. How to Use SUP to Upgrade a File Collection                                2
  774.  
  775.    2.1 Supfiles                                                               2
  776.  
  777. 3. What SUP Does                                                              4
  778.  
  779.    3.1 File Installation                                                      4
  780.  
  781. 4. How to Set Up a File Collection                                            5
  782.  
  783.    4.1 The List File                                                          5
  784.  
  785. 5. Setup for SUP                                                              6
  786.  
  787.