1 .\" $NetBSD: sup.1,v 1.17 2009/11/01 20:25:57 joerg Exp $
3 .\" Copyright (c) 1992 Carnegie Mellon University
4 .\" All Rights Reserved.
6 .\" Permission to use, copy, modify and distribute this software and its
7 .\" documentation is hereby granted, provided that both the copyright
8 .\" notice and this permission notice appear in all copies of the
9 .\" software, derivative works or modified versions, and any portions
10 .\" thereof, and that both notices appear in supporting documentation.
12 .\" CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
13 .\" CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR
14 .\" ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
16 .\" Carnegie Mellon requests users of this software to return to
18 .\" Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU
19 .\" School of Computer Science
20 .\" Carnegie Mellon University
21 .\" Pittsburgh PA 15213-3890
23 .\" any improvements or extensions that they make and grant Carnegie Mellon
24 .\" the rights to redistribute these changes.
25 .\"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
27 .\" Revision 1.4 92/08/11 12:08:40 mrt
29 .\" Add description of releases and use-rel-suffix
32 .\" Revision 1.3 92/02/08 18:24:31 mja
33 .\" Added description of -k and -K switches and "keep" option.
34 .\" [92/01/17 vdelvecc]
36 .\" 10-May-86 Glenn Marcy (gm0w) at Carnegie-Mellon University
37 .\" Replaced reference to /usr/cmu with /usr/cs.
39 .\" 29-Mar-86 Glenn Marcy (gm0w) at Carnegie-Mellon University
40 .\" Updated manual entry to version 5.14 of sup.
42 .\" 14-Jan-86 Glenn Marcy (gm0w) at Carnegie-Mellon University
43 .\" Updated manual entry to version 5.7 of sup.
45 .\" 04-Apr-85 Steven Shafer (sas) at Carnegie-Mellon University
51 sup \- software upgrade protocol
53 \fBsup\fR [ \fIflags\fR ] [ \fIsupfile\fR ] [ \fIcollection\fR ...]
56 is a program used for upgrading collections of files from other machines
57 to your machine. You execute
61 program, which talks over the network using IP/TCP to a
64 The file server process cooperates with
66 to determine which files of the collection need to be upgraded on
69 Sup collections can have multiple releases. One use for such releases is
70 to provide different versions of the same files. At CMU, for example,
71 system binaries have alpha, beta and default release corresponding to
72 different staging levels of the software. We also use release names
73 default and minimal to provide complete releases or subset releases.
74 In both of these cases, it only makes sense to sup one release of the
75 collections. Releases have also been used in private or external sups to
76 provide subsets of collections where it makes sense to pick up several
77 of the releases. For example the Mach 3.0 kernel sources has a default
78 release of machine independent sources and separate releases of
79 machine dependent sources for each supported platform.
81 In performing an upgrade, the file server constructs a list of
82 files included in the specified release of the collection. The list is sent to your machine,
83 which determines which files are needed. Those files are then sent
85 It will be most useful to run
87 as a daemon each night so you will continually have the latest version of the
88 files in the needed collections.
90 The only required argument to
92 is the name of a supfile. It must either be given explicitly on the command
95 flag must be specified. If the
97 flag is given, the system supfile will be used and a supfile command argument
98 should not be specified. The list of collections is optional and if specified
99 will be the only collections upgraded. The following flags affect all
100 collections specified:
106 When this flag is given,
109 that each collection was last upgraded, rather than
110 performing actual upgrades.
113 When this flag is given,
115 will not try to restore the user access and modified times of files in
116 the collections from the server.
119 Operate silently printing messages only on errors.
123 will trace network messages sent and received that implement the
128 Sup will use a set of non-privileged network
129 ports reserved for debugging purposes.
133 The remaining flags affect all collections unless an explicit list
134 of collections are given with the flags. Multiple flags may be
135 specified together that affect the same collections. For the sake
136 of convenience, any flags that always affect all collections can be
137 specified with flags that affect only some collections. For
139 .B sup -sde=coll1,coll2
140 would perform a system upgrade,
141 and the first two collections would allow both file deletions and
142 command executions. Note that this is not the same command as
143 .B sup -sde=coll1 coll2,
144 which would perform a system upgrade of
145 just the coll2 collection and would ignore the flags given for the
149 All files in the collection will be copied from
150 the repository, regardless of their status on the
151 current machine. Because of this, it is a very
152 expensive operation and should only be done for
153 small collections if data corruption is suspected
154 and been confirmed. In most cases, the
156 flag should be sufficient.
161 flag if given, or the
164 option is specified, the contents of regular files
165 on the local system will be saved before they are
166 overwritten with new data. The file collection maintainer
167 can designate specific files to be
168 worthy of backing up whenever they are upgraded.
170 backup will only take place if you specify this flag or the
173 backups for a file collection on your machine.
175 will create a copy of the current version of a file immediately
176 before a new copy is received from the file server; the copy is
177 given the same name as the original file but is put into a directory
181 within the directory containing the original file.
185 would have a backup copy called
187 /usr/sas/src/BACKUP/foo.c.
188 There is no provision for automatically maintaining multiple old
189 versions of files; you would have to do this yourself.
194 flag overrides and disables the
201 Files that are no longer in the collection on the
202 repository will be deleted if present on the local
203 machine and were put there by a previous sup.
204 This may also be specified in a supfile with the
211 flag overrides and disables the
218 Sup will execute commands sent from the repository
219 that should be run when a file is upgraded. If
222 flag is omitted, Sup will print a message
223 that specifies the command to execute. This may
224 also be specified in a supfile with the
231 flag overrides and disables the
240 upgrade will be performed. Messages
241 will be printed that indicate what would happen if
242 an actual upgrade were done.
246 will check the modification times of
247 files on the local disk before updating them. Only files which are
248 newer on the repository than on the local disk will be updated;
249 files that are newer on the local disk will be kept as they are.
250 This may also be specified in a supfile with the
257 flag overrides and disables the
266 will not upgrade a collection if the
267 repository is on the same machine. This allows
268 users to run upgrades on all machines without
269 having to make special checks for the repository
272 flag is specified, collections
273 will be upgraded even if the repository is local.
278 used standard output for messages.
283 will send mail to the user running
285 or a user specified with the
287 supfile option, that contains messages
294 but send mail to the specified user.
298 will normally only upgrade files that have
299 changed on the repository since the last time an
300 upgrade was performed. That is, if the file in the
301 repository is newer than the date stored in the
303 file on the client. The
307 supfile option, will cause
310 in the collection for changes instead of just the
316 flag overrides and disables the
323 Normally sup transfers files directly without any
324 other processing, but with the
328 supfile option, sup will compress the file
329 before sending it across the network and
330 uncompress it and restore all the correct
331 file attributes at the receiving end.
336 flag overrides and disables the
345 will only print messages if there
346 are problems. This flag causes
349 messages during normal progress showing what
354 .SH "SETTING UP UPGRADES"
355 Each file collection to be upgraded must have a
357 which contains a subdirectory called
359 that will be used by the
361 program; it will be created automatically if you do not create it.
363 will put subdirectories and files into this directory as needed.
366 will look for a subdirectory with the same name as the
367 collection within the
371 If it exists it may contain any of the following files:
373 .B when.\*[Lt]rel-suffix\*[Gt]
374 This file is automatically updated by
376 when a collection is successfully upgraded and contains the
377 time that the file server, or possibly
379 created the list of files in the upgrade list.
381 will send this time to the file server for generating the list
382 of files that have been changed on the repository machine.
385 This file contains a list of files and directories, one per line, that
386 the client is not interested in that should not be upgraded.
391 to lock a collection while it is being upgraded.
393 will get exclusive access to the lock file using
395 preventing more than one
397 from upgrading the same collection at the same time.
399 .B last.\*[Lt]rel-suffix\*[Gt]
400 This file contains a list of files and directories, one per line, that
401 have been upgraded by
403 in the past. This information is used when the
407 flag is used to locate files previously upgraded that are no longer
408 in the collection that should be deleted.
412 Each file collection must also be described in one or more supfiles.
415 is executed, it reads the specified supfile to determine what file
416 collections and releases to upgrade.
417 Each collection-release set is described by a single
418 line of text in the supfile; this line must contain the name of the
419 collection, and possibly one or more options separated by spaces.
422 .BI release= releasename
423 If a collection contains multiple releases, you need to specify which
424 release you want. You can only specify one release per line, so
425 if you want multiple releases from the same collections, you will need
426 to specify the collection more than once. In this case, you should use
429 option in the supfile
430 to keep the last and when files for the two releases separate.
433 The usual default name of the base directory for a collection is
434 described below (see FILES); if you want to specify another
435 directory name, use this option specifying the desired
438 .BI prefix= directory
439 Each collection may also have an associated
441 which is used instead of the base directory to specify in what
442 directory files within the collection will be placed.
448 .BI hostbase= directory
451 collections are supported by the system maintainers, and
453 will automatically find out the name of the host machine and
454 base directory on that machine.
455 However, you can also upgrade
457 collections; you simply specify with these options
460 of the machine containing the files and the
462 used as a base directory for the file server on that machine.
463 Details of setting up a file collection are given in the section
470 .BI password= password
477 Files on the file server may be protected, and network transmissions
479 This prevents unauthorized access to files via
481 When files are not accessible to the default account (e.g.
484 anonymous account), you can specify an alternative
488 for the file server to use on the repository host.
490 transmission of the password will be always be encrypted.
492 also have the actual file data encrypted by specifying a
494 the file collection on the repository must specify the same key
497 will not be able to upgrade files from that collection.
498 In this case, the default account used by the file server on the
499 repository machine will be the owner of the encryption key
500 file (see FILES) rather than the
508 option to receive log messages by mail, you can have the mail
509 sent to different user, possibly on another host, than the user
510 running the sup program.
511 Messages will be sent to the specified
513 which can be any legal netmail address.
515 project maintainer can be designated to receive mail for that
516 project's file collection from all users running
518 to upgrade that collection.
521 As described above under the
526 As described above under the
531 As described above under the
536 As described above under the
541 As described above under the
546 Causes the release name to be used as a suffix to the
550 files. This is necessary whenever you are supping more than one
551 release in the same collection.
554 .SH "PREPARING A FILE COLLECTION REPOSITORY"
555 A set of files residing on a repository must be prepared before
557 client processes can upgrade those files.
563 If it is a private collection, client users
564 must be told the name of the collection, repository host, and
566 these will be specified in the supfile via the
571 For a system-maintained file collection, entries must be
572 placed into the host list file and directory list file as described
576 Within the base directory, a subdirectory must be created called
578 Within this directory there must be a subdirectory for each
579 collection using that base directory, whose name is the name of the
580 collection; within each of these directories will be a
581 list file and possibly a prefix file, a host file, an encryption key
584 The filenames are listed under FILES below.
587 Normally, all files in the collection are relative to the base directory.
588 This file contains a single line which is the name of a directory to be
589 used in place of the base directory for file references.
593 all remote host machines are allowed access to a file collection.
594 If you wish to restrict access to specific remote hosts for this
596 put each allowed hostname on a
597 separate line of text in this file.
598 If a host has more than one name, only one of its names needs to be
602 can be used to grant access to all hosts on the local
603 network. The host name may be a numeric network address
604 or a network name. If a crypt appears on the same line as
605 the host name, that crypt will be used for that host. Otherwise,
606 the crypt appearing in the
608 file, if any will be used.
611 If you wish to use the
613 data encryption mechanism, create an encryption file containing,
614 on a single line of text, the desired encryption key.
616 processes must then specify the same key with the
618 option in the supfile or they will be denied access to the files.
619 In addition, actual network transmission of file contents and
620 filenames will be encrypted.
623 This file describes the actual list of files to be included in this
624 file collection, in a format described below.
627 This file describes any releases that the collection may have. Each
628 line starts with the release name and then may specify any of the following
630 .I prefix=\*[Lt]dirname\*[Gt]
631 to use a different parent directory for the files in this release.
632 .I list=\*[Lt]listname\*[Gt]
633 to specify the list of files in the release.
634 .I scan=\*[Lt]scanfile\*[Gt]
635 must be used in multi-release collections that are scanned to keep
636 the scan files for the different releases separate.
637 .I host=\*[Lt]hostfile\*[Gt]
638 to allow different host restrictions for this release.
639 .I next=\*[Lt]release\*[Gt]
640 used to chain releases together. This has the effect of making one release
641 be a combination of several other releases. If the same file appears in
642 more than one chained release, the first one found will be used.
643 If these files are not specified for a release the default names:
644 prefix,list,scan and host will be used.
647 This file, created by
649 is the list of filenames that correspond to the instructions in the
650 list file. The scan file is only used for frequently updated file
651 collections; it makes the file server run much faster. See
653 for more information.
656 As previously mentioned, this file is used to indicate that the
657 collection should be locked while upgrades are in progress. All
658 file servers will try to get shared access to the lock file with
662 If a log file exists in the collection directory, the file server
663 will append the last time an upgrade was successfully completed,
664 the time the last upgrade started and finished, and the name of
665 the host requesting the upgrade.
668 It should be noted that
670 allows several different named collections to use the same base
671 directory. Separate encryption, remote host access, and file lists
672 are used for each collection, since these files reside in subdirectories
673 .I \*[Lt]basedir\*[Gt]/sup/\*[Lt]coll.name\*[Gt].
675 The list file is a text file with one command on each line.
677 contains a keyword and a number of operands separated by spaces.
678 All filenames in the list file are evaluated on the repository machine
679 relative to the host's base directory, or prefix directory if one is
680 specified, and on your machine with respect
681 to the base, or prefix, directory for the client.
684 below (except \fIexec-command\fR)
685 may all include wild-cards and meta-characters as used by
687 including *, ?, [...], and {...}. The commands are:
689 \fBupgrade\fR \fIfilename\fR ...
690 The specified file(s) (or directories) will be included in the list
691 of files to be upgraded.
692 If a directory name is given, it recursively
693 includes all subdirectories and files within that directory.
695 \fBalways\fR \fIfilename\fR ...
696 The always command is identical to upgrade, except that omit and
697 omitany commands do not affect filenames specified with the always
700 \fBomit\fR \fIfilename\fR ...
701 The specified file(s) (or directories) will be excluded from the
702 list of files to be upgraded.
703 For example, by specifying
704 .B upgrade /usr/vision
706 .B omit /usr/vision/exp,
708 of files would include all subdirectories and files of /usr/vision
709 except /usr/vision/exp (and its subdirectories and files).
711 \fBomitany\fR \fIpattern\fR ...
712 The specified patterns are compared against the files in the upgrade
713 list. If a pattern matches, the file is omitted. The omitany command
714 currently supports all wild-card patterns except {...}. Also, the
715 pattern must match the entire filename, so a leading */, or a trailing /*,
716 may be necessary in the pattern.
718 \fBbackup\fR \fIfilename\fR ...
719 The specified file(s) are marked for backup; if they are upgraded
720 and the client has specified the
722 option in the corresponding
723 line of the supfile, then backup copies will be created as described
725 Directories may not be specified, and no recursive filename
726 construction is performed; you must specify the names of the specific
727 files to be backed up before upgrading.
729 \fBnoaccount\fR \fIfilename\fR ...
730 The accounting information of the specified file(s) will not be
733 Accounting information consists of the owner,
734 group, mode and modified time of a file.
736 \fBsymlink\fR \fIfilename\fR ...
737 The specified file(s) are to be treated as symbolic links
738 and will be transferred as such and not followed. By default,
740 will follow symbolic links.
742 \fBrsymlink\fR \fIdirname\fR ...
743 All symbolic links in the specified directory and its
744 subdirectories are to be treated as symbolic links. That
745 is the links will be transferred and not the files to which
748 \fBexecute\fR \fIexec-command\fR (\fIfilename\fR ...)
751 you specified will be executed on the client process
752 whenever any of the files listed in parentheses are upgraded.
755 may be specified in the
757 and will be replaced by the name of the file that was upgraded.
758 For example, if you say
759 \fBexecute ranlib %s (libc.a)\fR,
760 then whenever libc.a is upgraded, the client machine will execute
763 As described above, the client must invoke
767 flag to allow the automatic execution of command files.
769 \fBinclude\fR \fIlistfile\fR ...
772 will be read at this point. This is useful
773 when one collection subsumes other collections; the larger collection
774 can simply specify the listfiles for the smaller collections contained
778 The order in which the command lines appear in the list file does not
779 matter. Blank lines may appear freely in the list file.
781 Files on the client machine for
784 .B /etc/supfiles/coll.list
785 supfile used for -s flag
787 .B /etc/supfiles/coll.what
788 supfile used for -s flag when -t flag is also specified
790 .B /etc/supfiles/coll.host
791 host name list for system collections
793 \*[Lt]\fIbase-directory\fR\*[Gt]\fB/sup/\fR\*[Lt]\fIcollection\fR\*[Gt]\fB/last\fR\*[Lt]\fI.release\fR\*[Gt]
794 recorded list of files in collection as of last upgrade
796 \*[Lt]\fIbase-directory\fR\*[Gt]\fB/sup/\fR\*[Lt]\fIcollection\fR\*[Gt]\fB/lock
797 file used to lock collection
799 \*[Lt]\fIbase-directory\fR\*[Gt]\fB/sup/\fR\*[Lt]\fIcollection\fR\*[Gt]\fB/refuse
800 list of files to refuse in collection
802 \*[Lt]\fIbase-directory\fR\*[Gt]\fB/sup/\fR\*[Lt]\fIcollection\fR\*[Gt]\fB/when\fR\*[Lt]\fI.release\fR\*[Gt]
803 recorded time of last upgrade
805 \fB/usr/sup/\fR\*[Lt]\fIcollection\fR\*[Gt]
806 default base directory for file collection
810 Files needed on each repository machine for the file server:
812 .B /etc/supfiles/coll.dir
813 base directory list for system
816 \*[Lt]\fIbase-directory\fR\*[Gt]\fB/sup/\fR\*[Lt]\fIcollection\fR\*[Gt]\fB/crypt
817 data encryption key for a
818 collection. the owner of this file is the
819 default account used when data encryption is specified
821 \*[Lt]\fIbase-directory\fR\*[Gt]\fB/sup/\fR\*[Lt]\fIcollection\fR\*[Gt]\fB/host
822 list of remote hosts allowed to
825 \*[Lt]\fIbase-directory\fR\*[Gt]\fB/sup/\fR\*[Lt]\fIcollection\fR\*[Gt]\fB/list
826 list file for a collection
828 \*[Lt]\fIbase-directory\fR\*[Gt]\fB/sup/\fR\*[Lt]\fIcollection\fR\*[Gt]\fB/lock
829 lock file for a collection
831 \*[Lt]\fIbase-directory\fR\*[Gt]\fB/sup/\fR\*[Lt]\fIcollection\fR\*[Gt]\fB/logfile
832 log file for a collection
834 \*[Lt]\fIbase-directory\fR\*[Gt]\fB/sup/\fR\*[Lt]\fIcollection\fR\*[Gt]\fB/prefix
835 file containing the name of the prefix directory
838 \*[Lt]\fIbase-directory\fR\*[Gt]\fB/sup/\fR\*[Lt]\fIcollection\fR\*[Gt]\fB/scan
839 scan file for a collection
841 \fB/usr/\fR\*[Lt]\fIcollection\fR\*[Gt]
842 default base directory for a file collection
848 \fIThe SUP Software Upgrade Protocol\fR, S. A. Shafer,
849 CMU Computer Science Department, 1985.
853 The encryption mechanism should be strengthened, although it's
857 can delete files it should not with the delete option.
858 This is because in the delete pass, it tries to delete all files
859 in the old list that don't exist in the new list.
860 This is a problem when a directory becomes a symlink to a hierarchy
861 that contains the same names.
862 Then sup will cross the symlink and start deleting files and directories
863 from the destination.
864 This is not easily fixed.
865 Don't use sup with symlink/rsymlink and the delete
866 option at the same time or *be careful*!