new copyright; att/bsd/shared
[unix-history] / usr / src / usr.bin / uucp / SMM.doc / uucpimpl / implement.ms
CommitLineData
ff262511
KB
1.\" Copyright (c) 1986 The Regents of the University of California.
2.\" All rights reserved.
a9073747 3.\"
ff262511
KB
4.\" %sccs.include.proprietary.roff%
5.\"
6.\" @(#)implement.ms 6.5 (Berkeley) %G%
10bd7bb5 7.\"
0b1fa720
KM
8.ds UU UUCP
9.ds Uu U\s-2UCP\s+2
10.ds uu \s-2UUCP\s+2
10bd7bb5 11.TL
0b1fa720 12Installation and Operation of \*(UU
a9073747
KM
13.br
144.3BSD Edition
15.AU
16D. A. Nowitz
17.AI
0b1fa720
KM
18AT&T Bell Laboratories
19Murray Hill, New Jersey 07974
a9073747 20.AU
0b1fa720 21Carl S. Gutekunst
a9073747 22.AI
0b1fa720
KM
23Communications Software Research and Development
24Pyramid Technology Corporation
25Mountain View, California 94039
10bd7bb5 26.AB
0b1fa720
KM
27\*(Uu is a series of programs designed to permit communication
28between
10bd7bb5 29.UX
0b1fa720
KM
30systems using a variety of communications links.
31\*(Uu provides batched, error free file transfers and remote command
32execution.
33It is well suited for tasks such as electronic mail, public news networks,
34and software distribution, particularly when only slow,
35low-cost communication links are available (e.g., 1200 baud dial-up).
36.PP
37This document describes the 4.3BSD version of \*(Uu.
38This is a distant but direct descendent of the ``second implementation''
39of \*(Uu developed by D. A. Nowitz at AT&T Bell Laboratories.
40A number of other \*(Uu versions are in common usage; these are discussed
41only to the extent that they affect administration of 4.3BSD systems.
42.LP
43Revised August 24, 1986
a9073747 44.AE
10bd7bb5 45.LP
a9073747
KM
46.OH 'Installation and Operation of UUCP''SMM:9-%'
47.EH 'SMM:9-%''Installation and Operation of UUCP'
0b1fa720 48.ne 5
a9073747 49.NH
0b1fa720 50\*(UU OVERVIEW
a9073747 51.PP
0b1fa720
KM
52\*(Uu is a batch-type operation.
53Users issue commands that are queued in a spool directory for processing
54by background daemons.
55.LP
56\fIUucp\fP (UNIX-to-UNIX Copy) and \fIuux\fP (UNIX-to-UNIX Execution)
57provide the user interface to \*(Uu.
58.I Uucp
59has syntax and semantics similar to the standard
60.UX
61utility \fIcp\fP(1), with the added ability to prefix filenames with
62system names.
63Similarly, \fIuux\fP mimics the conventions of \fIsh\fP(1), and allows
64commands to be prefixed with system names.
65.LP
66\fIUucico\fP (Copy-In, Copy-Out) is the primary \*(Uu daemon.
67It processes the requests queued by \fIuucp\fP and \fIuux\fP,
68initiates calls to remote systems, transfers files, and forks other
69daemons to execute \fIuux\fP-requested commands.
70\fIUucico\fP also acts as the \*(Uu ``shell'' when remote systems call in
71to requests transfers.
72.LP
73Three types of files are used in \*(Uu operation.
74\fIControl files\fP describe the \*(Uu environment, including
75known remote hosts, available devices, and remote file access permissions.
76Control files are relatively static; they are generally changed only by the
77system administrator.
78\fISpool files\fP (also called \fIQueue files\fP) contain transfer requests
79and data; they are created and deleted as necessary
80by \fIuucp\fP, \fIuux\fP, and \fIuucico\fP.
81\fILog files\fP accumulate a history of \*(Uu activity; these tend to
82grow forever if not periodically cleaned up.
83.LP
84Spool files are further divided into three types:
85\fIWork files\fP
86contain directions for file transfers between systems.
87Every invocation of \fIuucp\fP or \fIuux\fP creates one or more work files.
88\fIData files\fP contain data for transfer to or from remote systems.
89\fIExecution files\fP contain directions for
10bd7bb5
KM
90.UX
91command executions which
92involve the resources of one or more systems.
0b1fa720
KM
93Execution files are created only by \fIuux\fP.
94.\"===========================================================================
95.\" SECTION 2: USER UTILITIES
96.\"===========================================================================
97.ne 5
98.NH
99USER UTILITIES
100.PP
101\*(Uu includes a total of ten ``primary'' utilities, that is, ten
102utilities for general users.
103All reside in the \fB/usr/bin\fP directory, where they are easily accessible.
104This section provides detailed implementation descriptions for the more
105important commands; see the corresponding \fIman\fP pages for additional
106information.
10bd7bb5 107.LP
0b1fa720 108The following two commands queue transfer requests:
10bd7bb5 109.RS
0b1fa720
KM
110.IP uucp(1C) 15
111UNIX-to-UNIX File Copy.
112One of more \fIcontrol files\fP are created, containing names of files to be
113transferred.
114When necessary, local files are copied into \fIdata files\fP for
115transmission.
116.IP uux(1C)
117Execute command.
118An \fIexecute file\fP is created, containing a
10bd7bb5 119.UX
0b1fa720
KM
120command to be executed and its arguments.
121A \fIcontrol file\fP is created that includes all files that must be
122transferred to execute the command, including the \fIexecute file\fP itself.
123When necessary, local files are copied into \fIdata files\fP for
124transmission.
125Any output from the command will also be written to \fIdata files\fP.
a9073747 126.RE
a9073747 127.LP
0b1fa720 128The following four commands provide \*(Uu status information:
a9073747 129.RS
0b1fa720
KM
130.IP uulog(1C) 15
131Display selected information from the \*(Uu log.
132.IP uuname(1C)
133Display the names of all remote hosts that are directly accessible via \*(Uu.
134.IP uusnap(8C)
135Provide a snapshot of the current queue, including
136the number of work files, data files, and execute files for each site.
137.IP uuq(1C)
138A variant of \fIuusnap\fP, lists files and \fIuux\fP commands
139queued for each site.
140\fIUuq\fP also permits the \*(Uu administrator to delete jobs.
10bd7bb5 141.RE
a9073747 142.LP
0b1fa720
KM
143The following four commands provide miscellaneous support services:
144.RS
145.IP uudecode(1C) 15
146The decoder for files created by \fIuuencode\fP, below.
147.IP uuencode(1C)
148A filter to convert binary files into printable ASCII.
149This is useful when transferring object files over communications links
150that do not support 8-bit transfers.
151.IP uupoll(8C)
152A user utility to conveniently fork the \*(Uu daemon, \fIuucico\fP.
153.IP uusend(1C)
154A utility to send files to remote sites more than one ``hop'' distant.
155.RE
156.\"===========================================================================
157.NH 2
10bd7bb5
KM
158Uucp - UNIX to UNIX File Copy
159.LP
0b1fa720 160The \fIuucp\fP
10bd7bb5
KM
161command is the user's primary interface with the system.
162The
163.I uucp
164command was designed to look like
165.I cp
166to the user.
167The syntax is
168.IP
169.I uucp\ \
170.B [
171option
172.B ]
173\ ...\ \ source\ ...\ \ destination
174.LP
175where the source and destination
0b1fa720 176may contain the prefix \fIsystem-name\fP\fB!\fP
10bd7bb5
KM
177which indicates the system on which the file
178or files reside
179or where they will be copied.
180.LP
181The options interpreted by
182.I uucp
183are:
184.RS
b414db01
JB
185.IP \-f 10
186Don't make directories when copying the file.
187The default is to make the necessary directories.
188.IP \-C
189Copy source files to the spool directory.
190The default is to use the specified source when the actual
10bd7bb5 191transfer takes place.
0b1fa720 192.IP \-g\fIgrade\fR
10bd7bb5 193Put
0b1fa720 194.I grade
10bd7bb5 195in as the grade in the name of the work file.
0b1fa720
KM
196This is a single character in the range \fB[0-9][A-Z][a-z]\fP.
197The \fIgrade\fP will be used by \fIuucico\fP to establish the
198priority of requests.
199\fB0\fP is the highest (best) grade; \fBz\fP is the lowest (worst).
200The default
201.I grade
202for
203.I uucp
204is \fBn\fP.
10bd7bb5
KM
205.IP \-m
206Send mail on completion of the work.
b414db01
JB
207.IP \-n\fIuser\fR
208Notify \fIuser\fR on the destination system that a file was sent.
10bd7bb5 209.LP
0b1fa720
KM
210The following options are used primarily for debugging, or when
211.I uucp
212is invoked from other programs:
10bd7bb5 213.IP \-r 10
0b1fa720
KM
214Queue the job but do not start \fIuucico\fP.
215The assumption is that \fIuucico\fP will be started at a later time, perhaps
216by \fIcron\fP(8) or \fIuupoll\fP.
10bd7bb5
KM
217.IP \-s\fIdir\fR
218Use directory
219.I dir
b414db01 220for the top level spool directory.
10bd7bb5
KM
221.IP \-x\fInum\fR
222.I Num
223is the level of debugging output desired.
0b1fa720
KM
224This option requires the user to have read permission to the \*(Uu
225control file \fIL.sys\fP.
10bd7bb5
KM
226.RE
227.LP
228The destination may be a directory name,
229in which case the file name is taken from the last part of the
230source's name.
231The source
232name may contain special shell characters
0b1fa720
KM
233such as ``\fB?*[]\fR'';
234these and other shell characters such as ``\fB!<>\fP'' will need to be quoted
235or escaped.
10bd7bb5 236If a source argument has a
0b1fa720 237\fIsystem-name\fP\fB!\fP
10bd7bb5
KM
238prefix for a remote system,
239the file name expansion will be done on the remote system.
240.LP
241The command
242.IP "" 12
243uucp\ \ *.c\ \ usg!/usr/dan
244.LP
245will set up the transfer of all files whose names end with ``.c''
b414db01 246to the ``/usr/dan'' directory on the ``usg'' machine.
10bd7bb5 247.LP
0b1fa720 248The source and/or destination names may also contain a \fB~\fP\fIuser\fP
10bd7bb5
KM
249prefix.
250This translates to the login directory on
251the specified system.
0b1fa720
KM
252A lone \fB~\fP prefix is expanded to the name of the specified system's
253public access directory, usually
254\fB/usr/spool/uucppublic\fP.
10bd7bb5
KM
255For names with partial path-names,
256the current directory is prepended to the file name.
257File names with
258.I ../
259are not permitted.
260.LP
261The command
262.IP "" 12
263uucp\ \ usg!~dan/*.h\ \ ~dan
264.LP
265will set up the transfer of files whose names end with ``.h''
266in dan's login
267directory on system ``usg'' to dan's local
268login directory.
269.LP
270For each source file,
271the program will check the source and destination
272file-names
273and the system-part of each to
274classify the work into one of five types:
275.RS
276.IP [1]
277Copy source to destination on local system.
278.IP [2]
b414db01 279Receive files from a remote system.
10bd7bb5 280.IP [3]
b414db01 281Send files to a remote system.
10bd7bb5 282.IP [4]
b414db01 283Send files from remote system
10bd7bb5
KM
284to another remote system.
285.IP [5]
b414db01 286Receive files from remote system when the source pathname
10bd7bb5
KM
287contains special shell characters as
288mentioned above.
289.RE
290.LP
b414db01 291After the work has been set up in the spool directories,
0b1fa720 292the \*(Uu daemon \fIuucico\fP is started to try to contact the other
10bd7bb5
KM
293machine to execute the work (unless the \-r option
294was specified).
295.SH
296Type 1
297.LP
b414db01
JB
298.I Uucp
299makes a copy of the file.
10bd7bb5 300The
10bd7bb5 301.I \-m
b414db01 302option is not honored in this case.
10bd7bb5
KM
303.SH
304Type 2
305.LP
306A one line
307.I "work file"
0b1fa720 308is created for each file requested and put in the \fBC.\fP spool directory
10bd7bb5
KM
309with the following fields, each separated by a blank.
310(All
311.I "work files"
312and
313.I "execute files"
314use a blank as the field separator.)
315.RS
316.IP [1]
317R
318.IP [2]
319The full path-name of the source or a ~user/path-name.
320The
321.I ~user
322part will be expanded on the remote system.
323.IP [3]
b414db01 324The full path-name of the local destination file.
10bd7bb5
KM
325If the
326.I ~user
327notation is used, it will be immediately
328expanded to be the login directory for the user.
329.IP [4]
330The user's login name.
331.IP [5]
0b1fa720 332A `\-' followed by an option list.
10bd7bb5
KM
333.RE
334.KS
335.SH
336Type 3
337.LP
338For each source file, a
339.I "work file"
b414db01 340is created.
0b1fa720 341A \fB\-C\fP option on the
10bd7bb5 342.I uucp
b414db01 343command will cause the
10bd7bb5 344.I "data file"
b414db01
JB
345to be copied into the spool directory
346and the file to be transmitted from
0b1fa720 347the copy; the copy is deleted when the transfer completes.
10bd7bb5
KM
348The fields of each entry are given below.
349.RS
350.IP [1]
351S
352.IP [2]
353The full-path name of the source file.
354.IP [3]
355The full-path name of the destination or
356~user/file-name.
357.IP [4]
358The user's login name.
359.IP [5]
0b1fa720 360A `\-' followed by an option list.
10bd7bb5 361.IP [6]
0b1fa720
KM
362The full path-name of the local source file.
363If the
364.I ~user
365notation is used, it will be immediately
366expanded to be the login directory for the user.
367If the \fB\-C\fP option was used, this will be the name of a
10bd7bb5
KM
368.I "data file"
369in the spool directory.
370.IP [7]
371The file mode bits of the source file
372in octal print format
373(e.g. 0666).
b414db01
JB
374.IP [8]
375The user to notify on the remote system that the transfer has completed.
10bd7bb5
KM
376.RE
377.KE
378.SH
379Type 4 and Type 5
380.LP
381.I Uucp
382generates a
383.I uucp
384command and sends it to the remote machine;
385the remote
386.I uucico
387executes the
388.I uucp
389command.
0b1fa720
KM
390.\"===========================================================================
391.NH 2
10bd7bb5
KM
392Uux - UNIX To UNIX Execution
393.LP
0b1fa720 394The \fIuux\fP
10bd7bb5
KM
395command is used to set up the execution of a
396.UX
397command
398where the execution machine and/or some of the
399files are remote.
400The syntax of the uux command is
401.IP
402.I uux\ \
403.B [
404\-
405.B "] ["
406option
407.B ]
408\ ...\ \ command-string
409.LP
410where the command-string is made up of one or more arguments.
b414db01 411All special shell characters such as ``<>|*?!'' must be quoted
10bd7bb5
KM
412either by quoting the entire command-string
413or quoting the character as a separate argument.
414Within the command-string, the command and file names may
415contain a
0b1fa720 416\fIsystem-name\fP\fB!\fP
10bd7bb5
KM
417prefix.
418All arguments which do not contain a ``!'' will not
419be treated as files.
420(They will not be copied to the execution machine.)
0b1fa720 421The `\-' is used to indicate that the standard input
10bd7bb5
KM
422for
423.I command-string
424should be inherited from the standard input
425of the
426.I uux
427command.
0b1fa720
KM
428.LP
429The options, used mostly for debugging and by other programs, are:
10bd7bb5 430.RS
0b1fa720
KM
431.IP \-a\fIname\fP 10
432Use \fIname\fP as the requestor of the \fIuux\fP command, instead of the
433real system and login names.
434Unlike most other \*(Uu arguments, \fIname\fP may consist of a chain of
435system names separated by `!' characters, as in:
436.IP \ 15
437uux\ \ \-\ \ \-r\ \ \-aihnp4!decwrl!pyramid!csg\ \ seismo!rmail\ \ rick
438.IP \-C 10
439Copy source files to the spool directory.
440Same as for \fIuucp\fP.
441.IP \-g\fIgrade\fR
442Put
443.I grade
444in as the grade in the name of the work file.
445Same as for \fIuucp\fP.
446The default
447.I grade
448for
449.I uux
450is \fBA\fP.
451.IP \-n
452Do not mail an acknowledgement to the requestor of the command.
453Normally the execution daemon, \fIuuxqt\fP, will mail a message
454to the user who entered the \fIuux\fP command.
455This message includes the status return value that the program exited with.
456The \fB\-n\fP option requests that this message not be sent.
457.IP \-r
458Do not start the \*(Uucp daemons \fIuucico\fP(8C) or \fIuuxqt\fP(8C)
459after queuing the job.
10bd7bb5
KM
460.IP \-x\fInum\fR
461Num is the level of debugging output desired.
0b1fa720
KM
462.IP \-z
463Mail an acknowledgement to the requestor only if the command fails, that
464is, the command exits with a non-zero status.
10bd7bb5
KM
465.RE
466.LP
467The command
468.IP "" 12
469pr\ \ abc\ \ |\ \ uux\ \ \-\ \ usg!lpr
470.LP
471will set up the output of ``pr abc''
472as standard input to an lpr command
473to be executed on system ``usg''.
474.LP
475.I Uux
476generates an
477.I "execute file"
478which contains the
479names of the files required
480for execution (including standard input),
481the user's login name, the destination
482of the standard output, and the command to be executed.
0b1fa720
KM
483This file is either put in the \fBX.\fP spool directory
484for local execution,
485or in the \fBD.\fP\fIhostname\fP\fBX\fP directory
486for transfer to the remote system.
10bd7bb5
KM
487.LP
488For required files which are not on the execution machine,
489.I uux
490will generate receive command files (type 2 above).
491These command-files will be put on the execution machine and
0b1fa720
KM
492executed by
493\fIuucico\fP.
10bd7bb5
KM
494(This will work only if the local system has permission
495to put files in the remote spool directory as controlled
496by the remote
0b1fa720 497\fIUSERFILE\fP.)
10bd7bb5
KM
498.LP
499The
500.I "execute file"
501will be processed
502by the
0b1fa720 503\fIuuxqt\fP(8C)
10bd7bb5
KM
504program on the execution machine.
505It is made up of several lines,
506each of which contains an identification character
507and one or more arguments.
508The order of the lines in the file is not relevant
509and some of the lines may not be present.
510Each line is described below.
511.RS
512.SH
513User Line
514.IP
515U\ \ user\ \ system
516.LP
517where the
518.I user
519and
520.I system
0b1fa720 521are the requestor's login name and system.
10bd7bb5
KM
522.SH
523Required File Line
524.IP
525F file-name real-name
526.LP
527where the
528.I file-name
529is the generated name of a file for the execute machine
530and
531.I real-name
532is the last part of the actual file name (contains no
533path information).
534Zero or more of these lines may be present in the
535.I "execute file" .
536The
537.I uuxqt
538program will check for the existence of all required
539files before the command is executed.
540.SH
541Standard Input Line
542.IP
543I\ \ file-name
544.LP
0b1fa720 545The standard input is either specified by a `<' in the
10bd7bb5
KM
546command-string or inherited from the standard input of the
547.I uux
0b1fa720 548command if the `\-' option is used.
10bd7bb5 549If a standard input is not specified,
0b1fa720
KM
550.B /dev/null
551is used.
10bd7bb5
KM
552.SH
553Standard Output Line
554.IP
555O\ \ file-name\ \ system-name
556.LP
0b1fa720 557The standard output is specified by a `>' within the
10bd7bb5
KM
558command-string.
559If a standard output is not specified,
0b1fa720
KM
560.B /dev/null
561is used.
10bd7bb5
KM
562(Note \- the use of ``>>'' is not implemented.)
563.SH
0b1fa720
KM
564Status Return Line
565.IP
566N
567.LP
568Normally \fIuuxqt\fP mails an acknowledgement message to the
569requestor after the command completes.
570The message includes the status return value that the program exited with.
571This line inhibits mailing of the acknowledgement message.
572It is generated by the \fB-n\fP option of \fIuux\fP;
573it is also quietly assumed by \fIuuxqt\fP on the command \fBrmail\fP.
574.SH
575Error Status Return Line
576.IP
577Z
578.LP
579A variant of the \fIStatus Return\fP line, this line indicates that
580an acknowledgement should be mailed only if the command's status
581return is non-zero, i.e., the program exited with an error.
582This line is generated by the \fB-z\fP option of \fIuux\fP.
583It is also quietly assumed by \fIuuxqt\fP on the command \fBrnews\fP.
584If both the \fBZ\fP and \fBN\fP lines appear, the \fBZ\fP line has
585precedence.
586.SH
587Requestor Line
588.IP
589R\ \ requestor
590.LP
591where
592.I requestor
593is a complete return mailing address to the original requestor.
594This line is generated by the \fB-a\fP option of \fIuux\fP, and is used
595to override the mail return address implied by the \fIUser\fP line.
596This is commonly used by mailers and programs like \fIuusend\fP that
597know how to ``hop'' a file from system to system.
598.SH
10bd7bb5
KM
599Command Line
600.IP
601C\ \ command\ \
602.B [
603arguments
604.B ]
605\ ...
606.LP
607The arguments are those specified in the command-string.
608The standard input and standard output will not appear on this
609line.
610All
611.I "required files"
612will be moved to the execution directory (a subdirectory
613of the spool directory)
614and the
615.UX
616command is executed using the Shell specified in the
617.I uucp.h
0b1fa720 618header file (usually \fI/bin/sh\fP).
10bd7bb5 619In addition, a shell ``PATH'' statement is prepended
b414db01 620to the command line.
10bd7bb5 621.LP
b414db01
JB
622After execution, the temporary standard output file is copied to
623or set up to be
10bd7bb5
KM
624sent to the proper place.
625.RE
0b1fa720
KM
626.\"===========================================================================
627.\" SECTION 3: SYSTEM UTILITIES
628.\"===========================================================================
629.ne 5
10bd7bb5 630.NH
0b1fa720 631SYSTEM AND ADMINISTRATIVE UTILITIES
a9073747 632.LP
0b1fa720
KM
633\*(Uu includes four system utilities;
634these are not normally referenced by users.
635All except \fIuucpd\fP reside in the \*(Uu administrative directory,
636\fB/usr/lib/uucp\fP.
637These include:
638.RS
639.IP uucico(8C) 15
640Copy In, Copy Out. This is the primary \*(Uu daemon.
641.IP uuclean(8C)
642A handy utility to clean up the \*(Uu spool directories.
643.IP uucpd
644The \*(Uu TCP/IP daemon.
645This daemon ``answers'' the connection request from a remote \fIuucico\fP
646to a TCP/IP socket.
647It is functionally a stripped-down version of \fIrlogind\fP(8) that provides
648full 8-bit communication.
649(Note: this utility does not have a \fIman\fP page.)
650.IP uuxqt(8C)
651Execution Daemon.
652This is forked by \fIuucico\fP to interpret execution files
653transferred from a remote system.
654.RE
655.\"===========================================================================
656.NH 2
657Uucico - Copy In, Copy Out (\*(Uu Daemon)
10bd7bb5 658.LP
0b1fa720
KM
659.I Uucico
660is the ``heart'' of the \*(Uu system.
661The program performs the following major functions:
10bd7bb5
KM
662.RS
663.IP -\ \ 3
664Scan the spool directory for work.
665.IP -\ \
666Place a call to a remote system.
667.IP -\ \
668Negotiate a line protocol to be used.
669.IP -\ \
670Execute all requests from both systems.
671.IP -\ \
672Log work requests and work completions.
673.RE
674.LP
675.I Uucico
676may be started in several ways;
677.RS
678.IP a) 5
0b1fa720 679by a system daemon (such as \fIcron\fP(8)),
10bd7bb5
KM
680.IP b)
681by one of the
682.I
683uucp, uux, uuxqt
684.R
685or
b414db01 686.I uupoll
10bd7bb5
KM
687programs,
688.IP c)
689directly by the user (this is usually for testing),
690.IP d)
691by a remote system.
b414db01 692(The \fIuucico\fP program should be specified as the ``shell''
0b1fa720 693field in the \fB/etc/passwd\fP file for the \*(Uu logins.)
10bd7bb5
KM
694.RE
695.LP
696When started by method a, b or c, the program is considered to
697be in
698.I MASTER
699mode.
700In this mode, a connection will be made to a remote system.
701If started by a remote system (method d),
702the program is considered to be in
703.I SLAVE
704mode.
705.LP
706The
707.I MASTER
708mode will operate in one of two ways.
709If no system name is specified
710(\-s option not specified)
711the program will scan the spool directory for
712systems to call.
713If a system name is specified, that system will be called,
714and work will only be done for that system.
715.LP
716The
717.I uucico
718program is generally started by another program.
719There are several options used for execution:
720.RS
0b1fa720
KM
721.IP \-g\fIgrade\fP 10
722Set the minimum grade of this \fIuucico\fP run to \fIgrade\fP.
723Only files of this grade or better will be transferred.
724.IP \-r1
10bd7bb5
KM
725Start the program in
726.I MASTER
727mode.
728This is used when
729.I uucico
0b1fa720 730is started by a program or \fIcron\fP shell.
10bd7bb5
KM
731.IP \-s\fIsys\fR
732Do work only for system
733.I sys.
734If
b414db01 735.B \-s
10bd7bb5
KM
736is specified,
737a call to the specified system
738will be made even if there is no work for system
739.I sys
740in the spool directory.
741This is useful for polling systems which do not have
742the hardware to initiate a connection.
743.LP
744The following options are used primarily for debugging:
745.IP \-d\fIdir\fR
746Use directory
747.I dir
b414db01 748for the top level spool directory.
10bd7bb5
KM
749.IP \-x\fInum\fR
750.I Num
751is the level of debugging output desired.
752.RE
753.LP
754The next part of this section will describe the major steps within
755the
756.I uucico
757program.
758.SH
759Scan For Work
760.LP
b414db01 761The names of the work related files in a spool subdirectory have format
10bd7bb5 762.IP
0b1fa720 763type \fB.\fP system-name grade number
10bd7bb5
KM
764.LP
765where:
766.IP
767.I Type
768is an upper case letter,
769(
0b1fa720
KM
770.B C
771-\ work (copy command) file,
772.B D
10bd7bb5 773-\ data file,
0b1fa720 774.B X
10bd7bb5
KM
775-\ execute file);
776.IP
777.I System-name
778is the remote system;
779.IP
780.I Grade
0b1fa720 781is a character in the range \fB[0-9][A-Z][a-z]\fP;
10bd7bb5
KM
782.IP
783.I Number
784is a four digit, padded sequence number.
785.LP
786The file
787.IP "" 12
788C.res45n0031
789.LP
790would be a
791.I "work file"
792for a file transfer between the local
793machine and the ``res45'' machine.
794.LP
795The scan for work is done by looking through the
b414db01 796appropriate spool directory for
0b1fa720
KM
797\fIwork files\fP
798(files with prefix \fBC.\fP).
10bd7bb5
KM
799A list is made of all systems to be called.
800.I Uucico
801will then call each system and process all
802.I "work files" .
803.SH
804Call Remote System
805.LP
0b1fa720
KM
806The call is made using information from the \fIcontrol\fP files
807that reside in the \fB/usr/lib/uucp\fP directory.
10bd7bb5
KM
808At the start of the call process, a lock is
809set to forbid multiple conversations
810between the same two systems.
811.LP
812The system name is found in the
0b1fa720
KM
813.I L.sys
814control file.
10bd7bb5
KM
815The information contained for each system is;
816.RS
817.IP [1]
818system name,
819.IP [2]
820times to call the system
821(days-of-week and times-of-day),
822.IP [3]
0b1fa720 823the \fIcaller\fP, that is, the type of device to be used for the call,
10bd7bb5 824.IP [4]
0b1fa720 825the line speed or network number (as appropriate),
10bd7bb5 826.IP [5]
0b1fa720 827telephone number or device name (as appropriate),
10bd7bb5 828.IP [6]
0b1fa720 829login information (multiple fields).
10bd7bb5
KM
830.RE
831.LP
832The time field is checked against the present time to see
833if the call should be made.
834.LP
835The
836.I
837phone number
838.R
839may contain abbreviations (e.g. mh, py, boston) which get translated into dial
840sequences using the
841.I L-dialcodes
842file.
843.LP
844The
845.I L-devices
846file is scanned using fields [3] and [4] from the
0b1fa720 847.I L.sys
10bd7bb5
KM
848file to find an available device for the call.
849The program will try all devices which satisfy
b414db01 850[3] and [4] until the call is made or no more
10bd7bb5
KM
851devices can be tried.
852If a device is successfully opened, a lock file
853is created so that another copy of
854.I uucico
855will not try to use it.
856If the call is complete, the
857.I
858login information
859.R
860(field [6] of
0b1fa720 861\fIL.sys\fP)
10bd7bb5
KM
862is used to login.
863.LP
864The conversation between the two
865.I uucico
866programs begins with a handshake started by the called,
867.I SLAVE ,
868system.
869The
870.I SLAVE
871sends a message to let the
872.I MASTER
873know it is ready to receive the system
874identification and conversation sequence number.
875The response from the
876.I MASTER
877is
878verified by the
879.I SLAVE
880and if acceptable, protocol selection begins.
881The
882.I SLAVE
883can also reply with a ``call-back required''
884message in which case, the current conversation
885is terminated.
886.SH
887Line Protocol Selection
888.LP
889The remote system sends a message
890.IP "" 12
891P\fIproto-list\fR
892.LP
893where proto-list is a string of characters, each
894representing a line protocol.
895.LP
896The calling program checks the proto-list
897for a letter corresponding to an available line
898protocol and returns a
899.I use-protocol
900message.
901The
902.I use-protocol
903message is
904.IP "" 12
905U\fIcode\fR
906.LP
0b1fa720
KM
907where
908.I code
909is either a one character
10bd7bb5 910protocol letter or
0b1fa720 911.B N
10bd7bb5 912which means there is no common protocol.
0b1fa720
KM
913.LP
914The following protocols are implemented in 4.3BSD \*(Uu:
915.RS
916.IP \fBg\fP
917General.
918Default for dialup or hardwired lines, supported by all versions of \*(Uu.
919This protocol employs small (64 byte) data packets with
920checksums and packet-by-packet retransmission.
921This ensures reliable and efficient transfers over slow and noisy links
922like 1200-baud dial-up lines.
923These same characteristics make the \fBg\fP protocol bulky and slow over
924error free links, and very expensive on public data-switched networks.
925.IP \fBf\fP
926Optimized for use on X.25 PAD public data-switched networks.
927The protocol employs larger (256 byte) data packets,
928passes no control characters except CR,
929and uses only a 7-bit data path.
930(Note that the files transferred may still contain full 8-bit data.)
931It assumes that the link is ``mostly'' error-free, calculating a checksum
932for the entire file only.
933When an error is detected, the entire file is retransmitted.
934.IP \fBt\fP
935Optimized for use on TCP/IP networks and other completely error free links.
936It employs large (1024 byte) packets, and uses the full 8-bit data path.
937.RE
938.LP
939Note: AT&T System VR2 \*(UU supports the \fBx\fP (\fIX.25\fP) and \fBe\fP
940(\fIError Free\fP) protocols, which provide functionality similar to the
9414.3BSD \fBf\fP and \fBt\fP protocols, respectively.
942They are incompatible, however.
943Thus when attempting to connect two systems via X.25 or an local area network,
944it is not adequate for both systems to simply ``support X.25'' or ``support
945error free transfers.''
946Both must support the same \*(Uu protocols.
10bd7bb5
KM
947.SH
948Work Processing
949.LP
950The initial roles (
951.I MASTER
952or
953.I SLAVE
954) for the work processing are
955the mode in which each program starts.
956(The
957.I MASTER
0b1fa720 958has been specified by the \fB\-r1\fP \fIuucico\fP option.)
10bd7bb5
KM
959The
960.I MASTER
961program does a work search similar to the
962one used in the ``Scan For Work'' section.
963.LP
964There are five messages used during the
965work processing, each specified by the first
966character of the message.
967They are;
968.IP "" 12
969.RS
970.IP S 3
971send a file,
972.IP R
973receive a file,
974.IP C
975copy complete,
976.IP X
977execute a
978.I uucp
b414db01 979command, and
10bd7bb5
KM
980.IP H
981hangup.
982.RE
983.LP
984The
985.I MASTER
986will send
987.I R ,
988.I S
989or
990.I X
991messages until all work from the spool directory is
992complete, at which point an
993.I H
994message will be sent.
995The
996.I SLAVE
997will reply with
998\fISY\fR, \fISN\fR, \fIRY\fR, \fIRN\fR, \fIHY\fR, \fIHN\fR,
a9073747 999\fIXY\fR, \fIXN\fR,
10bd7bb5
KM
1000corresponding to
1001.I yes
1002or
1003.I no
1004for each request.
1005.LP
1006The send and receive replies are
1007based on permission to access the
0b1fa720
KM
1008requested file/directory using
1009.I USERFILE
10bd7bb5
KM
1010and read/write permissions of the file/directory.
1011After each file is copied into the spool directory
1012of the receiving system,
1013a copy-complete message is sent by the receiver of the file.
1014The message
1015.I CY
1016will be sent if the
1017file has successfully been moved from the
1018temporary spool file to the actual destination.
1019Otherwise, a
1020.I CN
1021message is sent.
1022(In the case of
1023.I CN ,
0b1fa720 1024the transferred file will be in the \fBTM.\fP spool subdirectory.)
10bd7bb5
KM
1025The requests and results are logged on both systems.
1026.LP
1027The hangup response is determined by the
1028.I SLAVE
b414db01
JB
1029program by a work scan of its spool directory.
1030If work for the \fIMASTER\fP\|'s system exists in the
1031\fISLAVE\fP\|'s
10bd7bb5
KM
1032spool directory, an
1033.I HN
1034message is sent and the programs switch roles.
1035If no work exists, an
1036.I HY
1037response is sent.
1038.SH
1039Conversation Termination
1040.LP
1041When a
1042.I HY
1043message is received by the
1044.I MASTER
1045it is echoed back to the
1046.I SLAVE
1047and the protocols are turned off.
1048Each program sends a final ``OO'' message to the
1049other.
1050The original
1051.I SLAVE
1052program will clean up and terminate.
1053The
1054.I MASTER
1055will proceed to call other systems
1056and process work as long as possible
1057or terminate if a
0b1fa720 1058.B \-s
10bd7bb5
KM
1059option was specified.
1060.LP
0b1fa720
KM
1061.\"===========================================================================
1062.NH 2
10bd7bb5
KM
1063Uuxqt - Uucp Command Execution
1064.LP
1065The
1066.I uuxqt
1067program is used to execute
1068.I
1069execute files
1070.R
1071generated by
1072.I uux.
1073The
1074.I uuxqt
1075program may be started by either the
1076.I uucico
1077or
1078.I uux
1079programs.
0b1fa720
KM
1080The program scans the \fBX.\fP spool directory for
1081\fIexecute files\fP.
10bd7bb5
KM
1082Each one is checked to see if all the required files are available and
1083if so, the command line or send line is executed.
1084.LP
1085The
1086.I
1087execute file
1088.R
0b1fa720
KM
1089is described in the
1090.I uux
10bd7bb5
KM
1091section above.
1092.SH
1093Command Execution
1094.LP
1095The execution is accomplished by executing a
1096.I
1097sh \-c
1098.R
1099of the command line after appropriate
1100standard input and standard output have been opened.
1101If a standard output is specified, the program
1102will create a send command or copy the output
1103file as appropriate.
0b1fa720
KM
1104.\"===========================================================================
1105.NH 2
10bd7bb5
KM
1106Uuclean - Uucp Spool Directory Cleanup
1107.LP
0b1fa720
KM
1108This program is typically started by the
1109\fIcron\fP(8)
1110daemon, once a day.
b414db01 1111Its function is to remove files from the spool directories which
10bd7bb5
KM
1112are more than 3 days old.
1113These are usually files for work which can not be completed.
1114.LP
1115.LP
1116The options available are:
1117.RS
1118.IP \-d\fIdir\fR 10
1119The directory to be scanned is
1120.I dir .
1121.IP \-m
1122Send mail to the owner of each file being removed.
1123(Note that most files put into the spool directory
1124will be owned by the owner of the
1125uucp programs since the setuid bit will be set on these
1126programs.
1127The mail will therefore most often go to the owner
1128of the uucp programs.)
1129.IP \-n\fIhours\fR
1130Change the aging time from 72 hours to
1131.I hours
1132hours.
1133.IP \-p\fIpre\fR
1134Examine files with prefix
1135.I pre
1136for deletion.
1137(Up to 10 file prefixes may be specified.)
1138.IP \-x\fInum\fR
1139This is the level of debugging output desired.
1140.RE
0b1fa720
KM
1141.\"===========================================================================
1142.\" SECTION 4: CONTROL FILES
1143.\"===========================================================================
1144.ne 5
10bd7bb5 1145.NH
0b1fa720
KM
1146SYSTEM CONTROL FILES
1147.PP
1148Seven \fIControl Files\fP are referenced by the \*(Uu utilities.
1149All live in the \*(Uu administrative directory, \fB/usr/lib/uucp\fP.
1150These are ASCII files, and can be modified using standard text editors such
1151as \fIvi\fP and \fIex\fP.
1152Lines beginning with a `#' character are comments;
1153lines ending with a `\e' are continued on the next input line.
10bd7bb5 1154.RS
0b1fa720
KM
1155.IP L-devices(5) 15
1156Declares all devices that are available to \fIuucico\fP for calling out.
1157.IP L-dialcodes(5)
1158Phone number prefixes.
1159Used to map alphabetic prefixes on phone numbers from \fIL.sys\fP to
1160real phone numbers.
1161Also useful to keep a phone number database outside of \fIL.sys\fP.
1162.IP L.sys(5)
1163Systems.
1164Declares all ``adjacent'' \*(Uu hosts, with directions on how to reach them.
1165.IP L.aliases(5)
1166Contains aliases used to map obsolete or truncated host names to the
1167correct names.
1168.IP L.cmds(5)
1169Commands Permissions.
1170Declares those commands for which remote \fIuux\fP execution is permitted.
1171.IP SQFILE
1172Sequence-number check file. (Optional)
1173.IP USERFILE(5)
1174Directory Tree Permissions.
1175Specifies the set of directory trees that a particular user or host may
1176reference.
10bd7bb5 1177.RE
0b1fa720
KM
1178.LP
1179A general description of each file follows; see the \fIman\fP pages for
1180complete information.
1181Examples of the six standard files are included in the distribution in the
1182\fB/usr/lib/uucp/UUAIDS\fP directory.
1183.NH 2
1184L-devices \- \*(UU Devices File
1185.LP
1186This file declares all devices that are available to
1187\fIuucico\fP
1188for calling out.
1189The special device files are assumed to be in the
1190.I /dev
1191directory.
1192The format for each entry is
1193.IP "" 12
1194caller line call-unit class dialer [chat....]
10bd7bb5
KM
1195.LP
1196where;
1197.RS
0b1fa720
KM
1198.IP caller 12
1199is the caller mechanism, that is, the type of device to be used.
1200This can be one of \fBACU\fP (for Automatic
1201Call Units (modem)), \fBDIR\fP (direct hardwired), \fBPAD\fP
1202(X.25/PAD), and others.
1203.IP line
1204is the device for the link.
1205For example, \fBcul0\fP for a modem, \fBtty10\fP for a hardwired line.
1206.IP call-unit
1207is the automatic call unit associated with
1208\fIdevice\fP.
1209This is used on autodialers such as the Racal-Vadic MACS and the
1210DEC DN-11 that use one device for data, and a second device for dialing.
1211If unused, this field must contain a placeholder such as ``unused'' or ``0''.
1212Some modems use this field to specify tone or pulse dialing.
1213.IP class
1214is the line speed, plus an optional alphabetic prefix.
1215The prefix can be used to distinguish among different devices that
1216have identical \fIcaller\fP and line speed.
1217.IP dialer
1218applies to \fBACU\fP devices only;
1219this is the type or brand name of the modem.
1220Supported modems include \fBDN11\fP (DEC DN-11),
1221\fBhayes\fP (Hayes Smartmodem),
1222\fBvadic\fP (Racal-Vadic 3451),
1223\fBventel\fP (VenTel 212A), and others.
1224.IP chat
1225refers to an \fIexpect/send\fP script, similar to that provided in
1226\fIL.sys\fP.
1227The difference is that the script in
1228.I L-devices
1229is executed before the connection is established, while the script in
1230.I L.sys
1231is executed afterwards.
10bd7bb5 1232.RE
0b1fa720
KM
1233.LP
1234The line
1235.IP "" 12
1236ACU\ \ tty47\ \ unused\ \ 1200\ \ hayes
1237.LP
1238would be set up for a system which
1239had device tty47 wired to a
1240Hayes ``Smartmodem 1200''
1241for use at 1200 baud.
1242.NH 2
1243L-dialcodes \- Phone Number Prefix File
1244.LP
10bd7bb5 1245This file contains entries with location abbreviations used
0b1fa720
KM
1246in the
1247.I L.sys
1248file (e.g. py, mh, boston).
1249The entry format is
1250.IP "" 12
10bd7bb5
KM
1251abb\ \ dial-seq
1252.LP
1253where;
1254.RS
1255.IP abb 12
1256is the abbreviation,
1257.IP dial-seq
1258is the dial sequence to call that location.
1259.RE
b414db01 1260.LP
10bd7bb5
KM
1261The line
1262.IP "" 12
1263py\ \ 165\-
1264.LP
0b1fa720 1265would be set up so that entry py7777 would
10bd7bb5 1266send 165\-7777 to the dial-unit.
0b1fa720
KM
1267.NH 2
1268L.aliases \- Hostname Aliases File
1269.LP
1270This file defines mapping (aliasing) of remote host names.
1271This is intended for compensating for systems that have
1272changed names, or do not provide their entire machine name
1273(like most USG systems).
1274It is also useful when a machine's name is not obvious or commonly misspelled.
1275.LP
1276Each line is of the form
1277.IP
1278real-name\ \ alias-name
1279.LP
1280where
1281.I real-name
1282is the full, correct name for the host, and
1283.I alias-name
1284is the old or truncated name.
1285.NH 2
1286L.sys \- \*(Uu Systems File
1287.LP
10bd7bb5 1288Each entry in this file represents one system
0b1fa720
KM
1289which can be called by the local uucp programs.
1290The format for each entry is
1291.IP
1292system times caller class device/phone-number [login]
1293.LP
1294where;
10bd7bb5 1295.RS
0b1fa720
KM
1296.IP "system" 12
1297is the hostname of the remote system.
1298.IP times
1299is a keyword-encoded string that indicates the days-of-the-week
1300and times-of-day when the system may
1301be called.
1302For example \fBMoTuTh0800\-1730\fP would denote Monday, Tuesday,
1303and Thursday, between 8 a.m. and 5:30p.m.
1304.IP
1305The day portion may be a list containing
1306any of
1307\fBSu\fP, \fBMo\fP, \fBTu\fP, \fBWe\fP, \fBTh\fP, \fBFr\fP, \fBSa\fP,
1308or
1309.B Wk
1310for any week-day or
1311.B Any
1312for any day.
1313.IP
1314The time should be a range of times (as in \fB0800\-1230\fP).
1315If no time portion is specified, any time
1316of day is assumed to be acceptable for the call.
1317.IP caller
1318is one of the caller device-types listed in \fIL-devices\fP.
1319.IP class
1320is the line speed for the call (e.g., 300, 1200, 9600),
1321plus an optional alphabetic prefix.
1322Network devices use this field for the network port number.
1323.IP phone
1324is the the phone number to call (for \fBACU\fP devices) or the
1325device filename.
1326A phone number is made up of an optional
1327alphabetic abbreviation and a numeric part.
1328The abbreviation is one which appears in the
1329.I L-dialcodes
1330file (e.g. mh5900, boston995\-9980).
1331.IP login
1332is a script describing how to log in to the remote host.
1333It is expressed as a series of
1334fields and subfields in the format
1335.IP "" 17
1336expect\ \ send\
1337[
1338expect\ \ send
1339]
1340\ ...
1341.IP "" 12
1342where;
a9073747 1343.I expect
0b1fa720 1344is the string expected to be read and
a9073747 1345.I send
0b1fa720
KM
1346is the string to be sent when the
1347.I expect
1348string is received.
1349The
b414db01 1350.I send
0b1fa720
KM
1351string is normally terminated with carriage-return;
1352an empty
a9073747 1353.I send
0b1fa720
KM
1354string will send only a carriage-return.
1355.IP
1356The expect field may be made up of subfields
1357of the form
1358.IP "" 17
1359expect\fB[\fR\-send\-expect\fB]\fR...
1360.IP "" 12
1361where the
10bd7bb5 1362.I send
0b1fa720 1363is sent if the prior
a9073747 1364.I expect
0b1fa720
KM
1365is not successfully read
1366and the
a9073747 1367.I expect
0b1fa720 1368following the
a9073747 1369.I send
0b1fa720
KM
1370is the next expected string.
1371.RE
1372.LP
1373A typical entry in the L.sys file would be
1374.IP "" 6
1375sys\ Any\ ACU\ 1200\ \ mh7654\ login:--login:\ uucp\ ssword:\ word
1376.LP
1377The expect algorithm looks at the last part of the
1378string as illustrated in the password field.
1379.NH 2
1380L.cmds \- Commands Permissions File
1381.LP
1382This file contains a list of commands, one per line, that are permitted
1383for remote execution via \fIuux\fP.
1384This list should be chosen with great care, since commands that take filenames
1385as arguments will allow users to easily circumvent \*(Uu's security.
1386For most sites,
1387.I L.cmds
1388should only include the lines:
a9073747 1389.DS
0b1fa720
KM
1390rmail
1391ruusend
a9073747 1392.DE
0b1fa720
KM
1393.NH 2
1394SQFILE \- Sequence Check File (Optional)
1395.LP
1396This file contains an entry for each remote
1397system with which this site agrees to perform conversation
1398sequence checks.
1399The initial entry is just the system name of
1400the remote system.
1401The first conversation will add two items to the line,
1402the conversation count, and the date/time of the most
1403resent conversation.
1404These items will be updated with each conversation.
1405If a sequence check fails, which could indicate that an unauthorized
1406connection has been attempted, the entry will have to
1407be adjusted.
1408.LP
1409This facility is technically no longer supported in 4.3BSD \*(Uu,
1410since it was hardly ever used and consumed precious memory space on PDP-11
1411systems.
1412The compile-time #define GNXSEQ can be set to enable sequence checking
1413should it be needed.
1414.NH 2
1415USERFILE \- Pathnames Permissions File
1416.LP
a9073747 1417This file contains user accessibility information.
0b1fa720
KM
1418It specifies four types of constraint;
1419.RS
1420.IP [1]
1421which files can be accessed by a normal user of the local machine,
1422.IP [2]
1423which files can be accessed from a remote computer,
1424.IP [3]
1425which login name is used by a particular remote computer,
1426.IP [4]
1427whether a remote computer should be called back in order to confirm
1428its identity.
1429.RE
1430.LP
1431Each line in the file has the following format
1432.IP "" 6
1433login,sys\ \
1434.B [
1435c
1436.B ]
1437\ \ path-name\ \
1438.B [
1439path-name
1440.B ]
1441\ ...
1442.LP
1443where;
1444.RS
1445.IP login 12
1446is the login name for a user or the remote computer,
1447.IP sys
1448is the system name for a remote computer,
1449.IP c
1450is the optional
1451.I
1452call-back required
1453.R
1454flag,
1455.IP path-name
1456is a path-name prefix that is acceptable for
1457.I user.
1458.LP
1459.RE
1460.LP
1461The constraints are implemented as follows.
1462.RS
1463.IP [1]
1464When the program is obeying a command stored on the local machine,
1465.I MASTER
1466mode,
1467the path-names allowed are those given for the first line in the
1468.I USERFILE
1469that has a login name that matches the login name of the user
1470who entered the command.
1471If no such line is found, the first line with a
1472.I null
1473login name is used.
1474.IP [2]
1475When the program is responding to a command from a remote machine,
1476.I SLAVE
1477mode, the path-names allowed are those given for the first line
1478in the file that has the system name that matches the system name
1479of the remote machine.
1480If no such line is found, the first one with a
1481.I null
1482system name is used.
1483.IP [3]
1484When a remote computer logs in, the login name that
1485it uses must appear in the
1486.I USERFILE .
1487There may be several lines with the same login name but one of them must
1488either have the name of the remote system or must contain a
1489.I null
1490system name.
1491.B Note:
1492This constraint, although stated in the original Nowitz \*(Uu document,
1493was not implemented in Version 7 \*(Uu.
1494For all practical purposes,
1495a remote computer's login was not validated by \*(Uu.
1496This is still the case in 4.3BSD.
1497Remote login checking \fIis\fP implemented in AT&T's System VR2.2 release,
1498and in the \*(Uu provided with Digital Equipment Corporation's ULTRIX.
1499HoneyDanBer analogously requires all remote logins to be listed in
1500its \fIPermissions\fP file.
1501.IP [4]
1502If the line matched in ([3]) contains a ``c'',
1503the remote machine is called back before any transactions take place.
1504.RE
1505.LP
1506The line
1507.IP "" 12
1508u,m /usr/xyz
1509.LP
1510allows machine
1511.I m
1512to login with name
1513.I u
1514and request the transfer of files whose names start with
1515``/usr/xyz''.
1516.LP
1517The line
1518.IP "" 12
1519dan, /usr/dan
1520.LP
1521allows the ordinary user
1522.I dan
1523to issue commands for files whose name starts with
1524``/usr/dan''.
1525.LP
1526The lines
1527.IP "" 12
1528u,m /usr/xyz /usr/spool
1529.br
1530u, /usr/spool
1531.LP
1532allows any remote machine to login with name
1533.I u ,
1534but if its system name is not
1535.I m ,
1536it can only ask to transfer files whose names start with
1537``/usr/spool''.
1538.LP
1539The lines
1540.IP "" 12
1541root, /
1542.br
1543, /usr
1544.LP
1545allows any user to transfer files beginning with ``/usr''
1546but the user with login
1547.I root
1548can transfer any file.
a9073747 1549.PP
0b1fa720
KM
1550.\"===========================================================================
1551.\" SECTION 5: SPOOL FILES
1552.\"===========================================================================
1553.ne 5
a9073747 1554.NH
0b1fa720
KM
1555SPOOL FILES
1556.PP
1557Spool Files contain \*(Uu transfer requests and data.
1558Most have been described in detail earlier in this document.
1559.LP
1560All spool files live in the
1561.B /usr/spool/uucp
1562directory tree.
1563To keep the spool directory from becoming hopelessly cluttered,
1564each type of spool file is kept in its own subdirectory.
1565The name of the directory is the same as the common prefix of the
1566filename.
1567For example, \fIwork files\fP (files beginning with \fBC.\fP) are kept
1568in the \fBC.\fP directory; \fIexecute files\fP (which begin with \fBX.\fP)
1569are kept in the \fBX.\fP directory, and so on.
1570.LP
1571A total of ten spool subdirectories are used, one of which is optional:
a9073747 1572.RS
0b1fa720
KM
1573.IP C. 15
1574\fIWork\fP files.
b414db01 1575.IP CORRUPT
0b1fa720
KM
1576Corrupted \fIwork\fP and \fIexecute\fP files.
1577\fIUucico\fP and \fIuuxqt\fP will deposit \fBC.\fP and \fBX.\fP files here
1578when they are unable to parse them.
1579A notice will also be placed in the \*(Uu log.
1580.IP D.
1581\fIData files\fP received from remote hosts.
1582.IP D.\fIhostname\fP
1583\fIData files\fP to be sent to remote hosts.
1584.IP D.\fIhostname\fPX
1585\fIExecution files\fP to be sent to remote hosts.
b414db01 1586.IP LCK
0b1fa720 1587Per-device and per-site lock (\fBLCK.\fP) files. (Optional)
b414db01 1588.IP STST
0b1fa720
KM
1589Per-site system status files.
1590.IP TM.
1591Temporary files used in data transfer.
1592When the transfer is complete, the file is typically
1593\fImv\fP'ed to the \fBD.\fP or \fBX.\fP directory.
1594.IP X.
1595\fIExecution files\fP received from remote sites.
1596.IP XTMP
1597Temporary files and home directory for \fIuuxqt\fP.
10bd7bb5 1598.RE
0b1fa720
KM
1599.LP
1600The following sections describe only those spool files that were not
1601discussed earlier.
1602.NH 2
1603LCK \- lock files
1604.LP
1605Lock files are created for each device in use (except for TCP/IP sockets)
1606and each system conversing.
1607This prevents duplicate conversations and multiple attempts to use the
1608same devices.
1609The form of the lock file name is
1610.IP "" 12
1611\fBLCK..\fRstr
1612.LP
1613where
1614.I str
1615is either a device or system name.
1616The files may be left in the spool directory if
1617.I uucico
1618aborts.
1619They will be ignored (reused) after 90 minutes.
1620When runs abort and calls are desired before the time limit expires,
1621the lock files should be removed.
1622If the \fBLCK.\fP subdirectory is used, it's access mode can be set to 777,
1623thus allowing normal users to remove dead lock files when necessary.
1624.NH 2
1625STST \- system status files
1626.LP
1627These files are created in the \fBSTST\fP subdirectory by
1628\fIuucico\fP.
1629They contain information of failures such as login, dialup, or
1630sequence check, and will contain a
1631\fITALKING\fP, \fIRECEIVING\fP, or \fPSENDING\fP
1632status when two machines are conversing.
1633The file name is
1634\fBSTST/\fP\fIsystem\fP,
1635where \fIsystem\fP is the host name of the remote machine.
1636.LP
1637For ordinary failures (dialup, login), the file indicates the time
1638of the last failure;
1639this allows \fIuucico\fP to avoid retrying the failed call too soon.
1640For sequence check failures, the file must be removed before
1641any future attempts to converse with that remote system.
1642.LP
1643If the file is left due to an aborted run, it may contain a
1644.I TALKING
1645status.
1646In this case, the file must be removed before a conversation
1647is attempted.
1648The easiest way to do this is to use the \fIuupoll\fP command to
1649force \fIuucico\fP to start up.
1650.NH 2
1651TM \- temporary data files
1652.LP
1653These files are created in the
1654.B /usr/spool/uucp/TM.
1655directory while files are being copied
1656from a remote machine.
1657Their names have the form
1658.IP "" 12
1659\fBTM\fR.pid.ddd
1660.LP
1661where
1662.I pid
1663is a process-id and
1664.I ddd
1665is a sequential three digit number starting at zero
1666for each invocation of
1667.I uucico
1668and incremented for each file received.
1669After the entire remote file is received, the
1670.B TM
1671file is moved to the requested destination,
1672often the \fBX.\fP or \fBD.\fP directory.
1673If processing is abnormally terminated or the
1674move fails, the file will remain in the
1675\fBTM.\fP directory.
1676.LP
1677The stranded files should be periodically removed;
1678the
1679.I uuclean
1680program is useful in this regard.
a9073747 1681The command
0b1fa720
KM
1682.IP "" 12
1683uuclean\ \ -d/usr/spool/uucp/TM.\ \ \-pTM.
1684.LP
1685will remove all
1686.B TM
1687files older than three days.
1688.\"===========================================================================
1689.\" SECTION 6: LOG FILES
1690.\"===========================================================================
1691.ne 5
1692.NH
1693LOG FILES
1694.LP
1695The following files provide a history of \*(Uu activities.
1696All live in the spool directory, \fB/usr/spool/uucp\fP.
1697They grow forever, and must be periodically trimmed or deleted;
1698this is usually done weekly (or daily) via \fIcron\fP.
1699.RS
1700.IP AUDIT 12
1701This is a directory of audit trail files, one file per site.
1702.I Uucico
1703uses an audit file for debugging output
1704whenever it is run with debug enabled (via the \fB-x\fP option or a
1705\fBSIGFPE\fP signal), but the standard message output file \fBstderr\fP is
1706not available.
1707.IP ERRLOG
1708This is an oft-forgotten log of \*(Uu ``Assert'' errors.
1709An Assert error is a catastrophic and unrecoverable failure of the \*(Uu
1710system.
1711These include spool directories or control files that cannot be opened,
1712an unexpected error return from a system call, or an ``impossible case''
1713in a utility's control flow.
1714.IP
1715Utilities that abort with an Assert error return a status code of -1.
1716If a user reports \fIuucp\fP or \fIuux\fP dying with a message like
1717``uux failed, status -1,'' then the ERRLOG file should be checked.
1718.IP LOGFILE
1719This is the primary \*(Uu log. All \*(Uu activity is recorded here,
1720including queue requests from \fIuucp\fP and \fIuux\fP, attempted
1721connections, file transfers, and communications failures.
1722.IP SYSLOG
1723This is a log of file transfer statistics: number of bytes, time required,
1724and number of packet retries.
1725The effective data rate can be calculated simply by dividing the number of
1726bytes by the time;
1727low data rates or a large number of retries implies that the communication
1728link may marginal.
1729.RE
1730.LP
1731Optionally, one \fILOGFILE\fP per site may be maintained in the \fBLOG\fP
1732subdirectory.
1733This option can be selected at \*(Uu compile time via the LOGBYSITE #define
1734in \fBuucp.h\fP.
1735.\"===========================================================================
1736.\" SECTION 7: ADMINSTRATION AND SYSTEM SECURITY
1737.\"===========================================================================
1738.ne 5
1739.NH
1740ADMINISTRATION AND SYSTEM SECURITY
1741.NH 2
1742.UX
1743System Files
1744.SH
1745/etc/passwd
1746.LP
1747\*(Uu requires a login in \fB/etc/passwd\fP;
1748at its simplest the entry would be
a9073747 1749.DS
0b1fa720 1750uucp::66:1:UNIX-to-UNIX Copy:/usr/spool/uucppublic:/usr/lib/uucp/uucico
a9073747 1751.DE
0b1fa720
KM
1752.LP
1753This user should own all the \*(Uu files and utilities.
1754Remote sites wishing to call in for \*(Uu transfers would login to
1755\fBuucp\fP (with the correct password, if any), and get
1756.I uucico
1757as their ``shell.''
1758Since \fIuucico\fP would be called without any options, it would run in
1759.I SLAVE
1760mode, thus responding correctly to the remote system, which
1761would be in
1762.I MASTER
1763mode.
1764.LP
1765The directory
1766.B /usr/spool/uucppublic
1767should be created with 777 access modes, owned by \fBuucp\fP.
1768In addition to serving as the home directory for \*(Uu remote logins,
1769.B uucppublic
1770provides a ``public-access'' directory where any user can read, write,
1771or transfer files.
1772.LP
1773There are a number of security problems with using a single login, not
1774the least of which is that superuser permission would be necessary to
1775edit the \fIcontrol\fP files.
1776A better arrangement would be:
a9073747 1777.DS
0b1fa720
KM
1778uucp::66:1:UUCP Administrator:/usr/lib/uucp:
1779nuucp::67:1:UNIX-to-UNIX Copy:/usr/spool/uucppublic:/usr/lib/uucp/uucico
a9073747 1780.DE
0b1fa720
KM
1781This provides one login for the \*(Uu administrator (which must be kept
1782secure!) and a second for remote machines to use for login.
1783A still more elaborate setup would use a separate login for each remote
1784site, and possibly provide the administrator with a choice of shells:
a9073747 1785.DS
0b1fa720
KM
1786uucp::66:1:UUCP Administrator:/usr/lib/uucp:
1787UUCP::66:1:UUCP Administrator:/usr/lib/uucp:/bin/csh
1788Uhosta::6001:1:UNIX-to-UNIX Copy:/usr/spool/uucppublic:/usr/lib/uucp/uucico
1789Uhostb::6002:1:UNIX-to-UNIX Copy:/usr/spool/uucppublic:/usr/lib/uucp/uucico
1790Uhostc::6003:1:UNIX-to-UNIX Copy:/usr/spool/uucppublic:/usr/lib/uucp/uucico
a9073747 1791.DE
0b1fa720
KM
1792.LP
1793It is assumed that the login name
1794used by a remote computer to dial in
1795is not the same as the login name of a normal user
1796of the machine.
1797However, several remote computers may employ the same
1798login name.
1799.LP
1800Note that
1801.B uucppublic
1802is
1803.I not
1804used as the home directory for
1805.B uucp
1806when it logs into a regular shell.
1807This would be an extreme security hazard, since anyone could slip a
1808``Trojan horse'' into a
1809.B .profile
1810or
1811.B .cshrc
1812file, which would be automatically executed when the \*(Uu administrator
1813logged in.
1814.SH
1815/etc/rc
1816.LP
1817The system startup file, \fB/etc/rc\fP, should clean up any stray lock
1818files with the line
1819.IP
1820rm -f /usr/spool/uucp/LCK.*
1821.LP
1822or, if the LCK subdirectory is being used,
1823.IP
1824rm -f /usr/spool/uucp/LCK/LCK.*
1825.SH
1826/etc/services
1827.LP
1828If \*(Uu is to be used over TCP/IP links, then an entry for \*(Uu's port
1829number should be added to \fB/etc/services\fP:
1830.IP
1831uucp\ \ 540/tcp\ \ uucpd\ \ # UUCP TCP/IP
1832.\"===========================================================================
1833.NH 2
1834Shell Scripts For Periodic Cleanup
1835.LP
1836The \*(Uu system has a fairly large number of activities that must
1837occur periodically.
1838These include starting \fIuucico\fP to process queued requests,
1839running \fIuuclean\fP to remove old spool files, and
1840shuffling the boundlessly-growing log files.
1841Some sites will also want to poll other sites periodically.
1842.LP
1843While it's possible to put all the necessary commands into \fIcron\fP's
1844control file \fB/usr/lib/crontab\fP, this would be extremely awkward.
1845The usual technique is to use three separate shells scripts, one each
1846for hourly, daily, and weekly operations.
1847Examples are provided in the
1848.B UUAIDS
1849directory; the following sections provide some specific recommendations.
1850.SH
1851Hourly
1852.LP
1853Activities that should occur hourly include:
1854.RS
1855.IP - 2
1856Polling of selected sites.
1857Sites that have no dial-out capability will need to be periodically polled.
1858The \fIuupoll\fP command works well for this.
1859.IP -
1860Start \fIuucico\fP to complete all unfinished work.
1861This can be as simple as:
1862.IP "" 7
1863uucico -r1 &
1864.RE
1865.SH
1866Daily
1867.LP
1868The daily script should be started by \fIcron\fP in the wee hours, around
18694 a.m.
1870Activities that should occur daily include:
1871.RS
1872.IP - 2
1873Call
1874.I uuclean
1875to remove old spool files.
1876The preferred technique is something like the following:
1877.DS
1878cd /usr/lib/uucp
1879deadtime=`expr 24 * 7`
1880uuclean -d/usr/spool/uucp/AUDIT -n72
1881uuclean -d/usr/spool/uucp/LCK -pLCK. -pLTMP. -n24
1882uuclean -d/usr/spool/uucp/STST -n72
1883uuclean -d/usr/spool/uucp/TM. -pTM. -n72
1884uuclean -d/usr/spool/uucp/XTMP -n72
1885uuclean -d/usr/spool/uucp/X. -pX. -n$deadtime
1886uuclean -d/usr/spool/uucp/C. -pC. -n$deadtime
1887uuclean -d/usr/spool/uucp/D. -pD. -n$deadtime
1888uuclean -d/usr/spool/uucp/D.`uuname -l` -pD. -n$deadtime
1889uuclean -d/usr/spool/uucp/D.`uuname -l`X -pD. -n$deadtime
1890.DE
1891.IP
1892In this example,
1893Audit files, Lock files, System Status files, temp files, and \fIuuxqt\fP
1894output files are cleaned up every 72 hours (3 days).
1895(\fBLTMP.\fP files are temporary files created by the lock mechanism;
1896they are rarely around for more than a few seconds.
1897Note, the above assumes that the
1898.B LCK
1899subdirectory is being used.)
1900All normal data files are cleaned up every 24 * 7 hours, or every 7 days.
1901.IP -
1902Shuffle the log files.
1903At the very least, LOGFILE should be moved to LOGFILE.old, and SYSLOG moved
1904to SYSLOG.old.
1905Busy sites may want to use \fIcompress\fP(1) to squeeze down the old files.
1906.IP -
1907Use \fIfind\fP(1) to clean up the
1908.B /usr/spool/uucppublic
1909directory.
1910If left unattended, garbage will gradually accumulate there until it fills
1911the file system.
1912.RE
1913.SH
1914Weekly
1915.LP
1916Small sites with very little traffic may chose to shuffle the log files once
1917per week, instead of once per day.
1918The weekly script should, like the daily script, be run early in the morning.
1919.\"===========================================================================
1920.NH 2
1921Connecting new systems
1922.LP
1923When first connecting a new machine to a \*(Uu network,
1924it is useful to try and establish a connection with
a9073747 1925\fItip\fR or \fIcu\fR first.
0b1fa720 1926The \*(Uu administrator will quickly become aware of any special facilities
a9073747 1927that are going to be required,
0b1fa720 1928for example:
a9073747 1929What lines and modems are to be used?
b414db01 1930Is the connection through different hardware and carriers?
a9073747
KM
1931Does the remote system care about parity?
1932What speed lines are being used and do they cycle through several speeds?
0b1fa720
KM
1933Is there a line switch front end that will require special login dialogue in
1934\fBL.sys\fP?
1935.LP
1936Once a successful login is achieved ``by hand,'' the administrator should
1937have enough information to allow the correct setup of the \fIcontrol\fR files
1938in
1939.B /usr/lib/uucp.
1940.LP
1941The \*(Uu administrator should then
1942negotiate with the remote site's \*(Uu administrator
1943as to who (if anyone) will do polling and when.
b414db01 1944Both administrators must set up the relevant accounts and passwords.
0b1fa720 1945The local administrator should
b414db01
JB
1946decide on what permissions and security precautions are to be observed.
1947Testing time and facilities will need to be arranged
1948to complete initial connection testing between the systems.
0b1fa720
KM
1949.\"============================================================================
1950.NH 2
1951Miscellaneous Security Issues
1952.LP
1953The \*(Uu system, left unrestricted,
a9073747 1954will let any outside user execute any commands
b414db01 1955and copy any files that are accessible
0b1fa720
KM
1956to the
1957.B uucp
1958login user.
a9073747
KM
1959It is up to the individual sites to be aware of this and
1960apply the protections that they feel are necessary.
1961.PP
1962There are several security features available aside from the
1963normal file mode protections.
1964These must be set up by the installer of the
0b1fa720 1965\*(Uu
a9073747
KM
1966system.
1967.IP - 3
1968The login for uucp does not get a standard shell.
0b1fa720 1969Instead,
a9073747 1970.I uucico
0b1fa720 1971is started.
a9073747
KM
1972Therefore, the only work that can be done is through
1973.I uucico .
1974.IP -
1975A path check is done on file names that are to be sent
1976or received.
0b1fa720 1977.I USERFILE
a9073747 1978supplies the information for these checks.
0b1fa720 1979.I USERFILE
a9073747
KM
1980can also be set up to require call-back
1981for certain login-ids.
0b1fa720
KM
1982(See the description of
1983.I USERFILE
1984above.)
a9073747
KM
1985.IP -
1986A conversation sequence count can be set up so
1987that the called system
1988can be more confident that the caller
1989is who he says he is.
1990.IP -
0b1fa720
KM
1991.I Uuxqt
1992is restricted via the
1993.I L.cmds
1994file to a small list of commands that it
a9073747
KM
1995will execute.
1996A ``PATH'' shell statement is prepended to the command
b414db01 1997line as specified in the
0b1fa720
KM
1998.I L.cmds
1999file.
2000The administrator may modify the list or remove the
a9073747
KM
2001restrictions as desired.
2002.IP -
0b1fa720
KM
2003All the \*(Uu utilities except \fIuudecode\fP, \fIuuencode\fP,
2004and \fIuusend\fP should be owned by the
2005.B uucp
2006login with the ``setuid'' bit set and only execute
2007permissions (e.g. mode 04111).
2008This will prevent outsiders from modifying the programs
2009to get at a standard shell with a
2010.B uucp
2011login.
2012Optionally, the utilities may belong to group \fBdaemon\fP and be given
2013``setgid'' permissions (mode 06111).
2014\fIUuxqt\fP should only permit other \*(Uu programs to execute it;
2015its mode should be 04100 or 06110.
2016.IP -
2017The \fIcontrol\fP files \fIL.sys\fP, \fIUSERFILE\fP, and \fISQFILE\fP
2018contain highly sensitive information.
2019They should be owned by the
2020.B uucp
2021login, with read and write permission granted only to the owner (mode 0600).
2022.\"===========================================================================
2023.\" SECTION 7: UUCP SOURCE INSTALLATION
2024.\"===========================================================================
2025.ne 5
2026.NH
2027INSTALLING THE \*(UU SYSTEM
2028.PP
2029The source for the \*(UU system resides in the
2030.B /usr/src/usr.bin/uucp
2031directory.
2032The README file includes complete instructions on how to rebuild the
2033\*(Uu system from source.
2034.LP
2035For most environments, only two files will need to be modified:
2036.B uucp.h
2037includes a large number of tunable system-dependent parameters,
2038including operating system type, devices to be supported,
2039and a variety of optional features.
a9073747 2040The
0b1fa720
KM
2041.B Makefile
2042may also have to be modified,
2043particularly if you chose to keep certain files in different
2044directories from usual.
2045.\"===========================================================================
2046.\" SECTION 8: ACKNOWLEDGMENTS
2047.\"===========================================================================
2048.ne 5
10bd7bb5 2049.NH
0b1fa720 2050ACKNOWLEDGEMENTS
a9073747 2051.PP
0b1fa720
KM
20524.3BSD UUCP was a group development effort, involving the contributed work
2053of over one hundred members of the USENET community.
2054We're extremely grateful to them all.
10bd7bb5 2055.LP
0b1fa720
KM
2056Special thanks go to the following individuals, whose contributions were
2057especially valuable:
2058.RS
2059.IP - 2
2060Rick Adams (Center for Seismic Studies) coordinated the 4.3BSD UUCP release,
2061incorporating (and often correcting) hundreds of bug fixes that
2062were posted on the USENET and mailed to him directly.
2063Rick also managed to find time to add many enhancements
2064and corrections of his own.
2065.IP -
2066Tom Truscott (Research Triangle Institute) and Bob Gray (then with
2067PAR Tech Corp, now at Univ of Colorado)
2068coordinated the 4.2BSD UUCP release, which was also a group effort.
2069Tom has continued to provide enhancements and fixes in 4.3BSD.
2070.IP -
2071Guy Harris (then with Computer Consoles, Inc., now with Sun Microsystems)
2072contributed many general bug fixes;
2073in particular, he was the first to isolate the infamous 4.2BSD ``TIMEOUT'' bug.
2074.IP -
2075Lou Salkind (New York University) wrote the \fIuuq\fP utility.
2076.IP -
2077James Bloom (U.C. Berkeley) isolated a major
2078day-one bug in the \fBg\fP-protocol driver
2079that had eluded many people's attempts to squash it.
2080.IP -
2081Piet Beertema (Centrum voor Wiskunde en Informatica, Amsterdam) wrote the
2082\fBf\fP-protocol to support ``mostly error-free links'';
2083Robert Elz (University of Melbourne) modified the protocol
2084specifically for X.25/PAD.
2085.IP -
2086Peter Honeyman (Princeton) assisted Rick by providing information on the
2087facilities provided in HoneyDanBer UUCP;
2088Rick then added many HDB-compatibility features and HDB-like
2089extensions to 4.3BSD UUCP.
2090.IP -
2091Ross Green (U.C. Berkeley) produced the first revision of this chapter,
2092updating the aging Nowitz document to more closely reflect reality.
2093.RE
10bd7bb5 2094.LP
0b1fa720
KM
2095Thanks again to everyone who contributed.
2096Berkeley UUCP continues to be a product of its own users,
2097and would not exist as it does today without them.