1.\" Copyright (c) 1980, 1986, 1988 The Regents of the University of California. 2.\" All rights reserved. 3.\" 4.\" Redistribution and use in source and binary forms, with or without 5.\" modification, are permitted provided that the following conditions 6.\" are met: 7.\" 1. Redistributions of source code must retain the above copyright 8.\" notice, this list of conditions and the following disclaimer. 9.\" 2. Redistributions in binary form must reproduce the above copyright 10.\" notice, this list of conditions and the following disclaimer in the 11.\" documentation and/or other materials provided with the distribution. 12.\" 3. All advertising materials mentioning features or use of this software 13.\" must display the following acknowledgement: 14.\" This product includes software developed by the University of 15.\" California, Berkeley and its contributors. 16.\" 4. Neither the name of the University nor the names of its contributors 17.\" may be used to endorse or promote products derived from this software 18.\" without specific prior written permission. 19.\" 20.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 21.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 22.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 23.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 24.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 25.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 26.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 27.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 28.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 29.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 30.\" SUCH DAMAGE. 31.\" 32.\" @(#)4.t 8.1 (Berkeley) 7/29/93
| 1.\" Copyright (c) 1980, 1986, 1988 The Regents of the University of California. 2.\" All rights reserved. 3.\" 4.\" Redistribution and use in source and binary forms, with or without 5.\" modification, are permitted provided that the following conditions 6.\" are met: 7.\" 1. Redistributions of source code must retain the above copyright 8.\" notice, this list of conditions and the following disclaimer. 9.\" 2. Redistributions in binary form must reproduce the above copyright 10.\" notice, this list of conditions and the following disclaimer in the 11.\" documentation and/or other materials provided with the distribution. 12.\" 3. All advertising materials mentioning features or use of this software 13.\" must display the following acknowledgement: 14.\" This product includes software developed by the University of 15.\" California, Berkeley and its contributors. 16.\" 4. Neither the name of the University nor the names of its contributors 17.\" may be used to endorse or promote products derived from this software 18.\" without specific prior written permission. 19.\" 20.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 21.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 22.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 23.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 24.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 25.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 26.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 27.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 28.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 29.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 30.\" SUCH DAMAGE. 31.\" 32.\" @(#)4.t 8.1 (Berkeley) 7/29/93
|
| 33.\" $FreeBSD: head/share/doc/smm/01.setup/4.t 215334 2010-11-15 05:25:51Z dougb $
|
33.\" 34.ds LH "Installing/Operating \*(4B 35.ds CF \*(Dy 36.ds RH "System setup 37.Sh 1 "System setup" 38.PP 39This section describes procedures used to set up a \*(4B UNIX system. 40These procedures are used when a system is first installed 41or when the system configuration changes. Procedures for normal 42system operation are described in the next section. 43.Sh 2 "Kernel configuration" 44.PP 45This section briefly describes the layout of the kernel code and 46how files for devices are made. 47For a full discussion of configuring 48and building system images, consult the document ``Building 494.3BSD UNIX Systems with Config'' (SMM:2). 50.Sh 3 "Kernel organization" 51.PP 52As distributed, the kernel source is in a 53separate tar image. The source may be physically 54located anywhere within any filesystem so long as 55a symbolic link to the location is created for the file 56.Pn /sys 57(many files in 58.Pn /usr/include 59are normally symbolic links relative to 60.Pn /sys ). 61In further discussions of the system source all path names 62will be given relative to 63.Pn /sys . 64.LP 65The kernel is made up of several large generic parts: 66.TS 67l l l. 68sys main kernel header files 69kern kernel functions broken down as follows 70 init system startup, syscall dispatching, entry points 71 kern scheduling, descriptor handling and generic I/O 72 sys process management, signals 73 tty terminal handling and job control 74 vfs filesystem management 75 uipc interprocess communication (sockets) 76 subr miscellaneous support routines 77vm virtual memory management 78ufs local filesystems broken down as follows 79 ufs common local filesystem routines 80 ffs fast filesystem 81 lfs log-based filesystem 82 mfs memory based filesystem 83nfs Sun-compatible network filesystem 84miscfs miscellaneous filesystems broken down as follows 85 deadfs where rejected vnodes go to die 86 fdesc access to per-process file descriptors 87 fifofs IEEE Std1003.1 FIFOs 88 kernfs filesystem access to kernel data structures 89 lofs loopback filesystem 90 nullfs another loopback filesystem 91 portal associate processes with filesystem locations 92 specfs device special files 93 umapfs provide alternate uid/gid mappings 94dev generic device drivers (SCSI, vnode, concatenated disk) 95.TE 96.LP 97The networking code is organized by protocol 98.TS 99l l. 100net routing and generic interface drivers 101netinet Internet protocols (TCP, UDP, IP, etc) 102netiso ISO protocols (TP-4, CLNP, CLTP, etc) 103netns Xerox network systems protocols (IDP, SPP, etc) 104netx25 CCITT X.25 protocols (X.25 Packet Level, HDLC/LAPB) 105.TE 106.LP 107A separate subdirectory is provided for each machine architecture 108.TS 109l l. 110hp300 HP 9000/300 series of Motorola 68000-based machines 111hp code common to both HP 68k and (non-existent) PA-RISC ports 112i386 Intel 386/486-based PC machines 113luna68k Omron 68000-based workstations 114news3400 Sony News MIPS-based workstations 115pmax Digital 3100/5000 MIPS-based workstations 116sparc Sun Microsystems SPARCstation 1, 1+, and 2 117tahoe (deprecated) CCI Power 6-series machines 118vax (deprecated) Digital VAX machines 119.TE 120.LP 121Each machine directory is subdivided by function; 122for example the hp300 directory contains 123.TS 124l l. 125include exported machine-dependent header files 126hp300 machine-dependent support code and private header files 127dev device drivers 128conf configuration files 129stand machine-dependent standalone code 130.TE 131.LP 132Other kernel related directories 133.TS 134l l. 135compile area to compile kernels 136conf machine-independent configuration files 137stand machine-independent standalone code 138.TE 139.Sh 3 "Devices and device drivers" 140.PP 141Devices supported by UNIX are implemented in the kernel 142by drivers whose source is kept in 143.Pn /sys/<architecture>/dev . 144These drivers are loaded 145into the system when included in a cpu specific configuration file 146kept in the conf directory. Devices are accessed through special 147files in the filesystem, made by the 148.Xr mknod (8) 149program and normally kept in the 150.Pn /dev 151directory. 152For all the devices supported by the distribution system, the 153files in 154.Pn /dev
| 34.\" 35.ds LH "Installing/Operating \*(4B 36.ds CF \*(Dy 37.ds RH "System setup 38.Sh 1 "System setup" 39.PP 40This section describes procedures used to set up a \*(4B UNIX system. 41These procedures are used when a system is first installed 42or when the system configuration changes. Procedures for normal 43system operation are described in the next section. 44.Sh 2 "Kernel configuration" 45.PP 46This section briefly describes the layout of the kernel code and 47how files for devices are made. 48For a full discussion of configuring 49and building system images, consult the document ``Building 504.3BSD UNIX Systems with Config'' (SMM:2). 51.Sh 3 "Kernel organization" 52.PP 53As distributed, the kernel source is in a 54separate tar image. The source may be physically 55located anywhere within any filesystem so long as 56a symbolic link to the location is created for the file 57.Pn /sys 58(many files in 59.Pn /usr/include 60are normally symbolic links relative to 61.Pn /sys ). 62In further discussions of the system source all path names 63will be given relative to 64.Pn /sys . 65.LP 66The kernel is made up of several large generic parts: 67.TS 68l l l. 69sys main kernel header files 70kern kernel functions broken down as follows 71 init system startup, syscall dispatching, entry points 72 kern scheduling, descriptor handling and generic I/O 73 sys process management, signals 74 tty terminal handling and job control 75 vfs filesystem management 76 uipc interprocess communication (sockets) 77 subr miscellaneous support routines 78vm virtual memory management 79ufs local filesystems broken down as follows 80 ufs common local filesystem routines 81 ffs fast filesystem 82 lfs log-based filesystem 83 mfs memory based filesystem 84nfs Sun-compatible network filesystem 85miscfs miscellaneous filesystems broken down as follows 86 deadfs where rejected vnodes go to die 87 fdesc access to per-process file descriptors 88 fifofs IEEE Std1003.1 FIFOs 89 kernfs filesystem access to kernel data structures 90 lofs loopback filesystem 91 nullfs another loopback filesystem 92 portal associate processes with filesystem locations 93 specfs device special files 94 umapfs provide alternate uid/gid mappings 95dev generic device drivers (SCSI, vnode, concatenated disk) 96.TE 97.LP 98The networking code is organized by protocol 99.TS 100l l. 101net routing and generic interface drivers 102netinet Internet protocols (TCP, UDP, IP, etc) 103netiso ISO protocols (TP-4, CLNP, CLTP, etc) 104netns Xerox network systems protocols (IDP, SPP, etc) 105netx25 CCITT X.25 protocols (X.25 Packet Level, HDLC/LAPB) 106.TE 107.LP 108A separate subdirectory is provided for each machine architecture 109.TS 110l l. 111hp300 HP 9000/300 series of Motorola 68000-based machines 112hp code common to both HP 68k and (non-existent) PA-RISC ports 113i386 Intel 386/486-based PC machines 114luna68k Omron 68000-based workstations 115news3400 Sony News MIPS-based workstations 116pmax Digital 3100/5000 MIPS-based workstations 117sparc Sun Microsystems SPARCstation 1, 1+, and 2 118tahoe (deprecated) CCI Power 6-series machines 119vax (deprecated) Digital VAX machines 120.TE 121.LP 122Each machine directory is subdivided by function; 123for example the hp300 directory contains 124.TS 125l l. 126include exported machine-dependent header files 127hp300 machine-dependent support code and private header files 128dev device drivers 129conf configuration files 130stand machine-dependent standalone code 131.TE 132.LP 133Other kernel related directories 134.TS 135l l. 136compile area to compile kernels 137conf machine-independent configuration files 138stand machine-independent standalone code 139.TE 140.Sh 3 "Devices and device drivers" 141.PP 142Devices supported by UNIX are implemented in the kernel 143by drivers whose source is kept in 144.Pn /sys/<architecture>/dev . 145These drivers are loaded 146into the system when included in a cpu specific configuration file 147kept in the conf directory. Devices are accessed through special 148files in the filesystem, made by the 149.Xr mknod (8) 150program and normally kept in the 151.Pn /dev 152directory. 153For all the devices supported by the distribution system, the 154files in 155.Pn /dev
|
155are created by the 156.Pn /dev/MAKEDEV 157shell script.
| 156are created by devfs.
|
158.PP 159Determine the set of devices that you have and create a new 160.Pn /dev
| 157.PP 158Determine the set of devices that you have and create a new 159.Pn /dev
|
161directory by running the MAKEDEV script. 162First create a new directory 163.Pn /newdev , 164copy MAKEDEV into it, edit the file MAKEDEV.local 165to provide an entry for local needs, 166and run it to generate a 167.Pn /newdev directory. 168For instance, 169.DS 170\fB#\fP \fIcd /\fP 171\fB#\fP \fImkdir newdev\fP 172\fB#\fP \fIcp dev/MAKEDEV newdev/MAKEDEV\fP 173\fB#\fP \fIcd newdev\fP 174\fB#\fP \fIMAKEDEV \*(Dk0 pt0 std LOCAL\fP 175.DE 176Note the ``std'' argument causes standard devices such as 177.Pn /dev/console , 178the machine console, to be created. 179.PP 180You can then do 181.DS 182\fB#\fP \fIcd /\fP 183\fB#\fP \fImv dev olddev ; mv newdev dev\fP 184\fB#\fP \fIsync\fP 185.DE 186to install the new device directory.
| 160directory by mounting devfs.
|
187.Sh 3 "Building new system images" 188.PP 189The kernel configuration of each UNIX system is described by 190a single configuration file, stored in the 191.Pn /sys/<architecture>/conf 192directory. 193To learn about the format of this file and the procedure used 194to build system images, 195start by reading ``Building 4.3BSD UNIX Systems with Config'' (SMM:2), 196look at the manual pages in section 4 197of the UNIX manual for the devices you have, 198and look at the sample configuration files in the 199.Pn /sys/<architecture>/conf 200directory. 201.PP 202The configured system image 203.Pn kernel 204should be copied to the root, and then booted to try it out. 205It is best to name it 206.Pn /newkernel 207so as not to destroy the working system until you are sure it does work: 208.DS 209\fB#\fP \fIcp kernel /newkernel\fP 210\fB#\fP \fIsync\fP 211.DE 212It is also a good idea to keep the previous system around under some other 213name. In particular, we recommend that you save the generic distribution 214version of the system permanently as 215.Pn /genkernel 216for use in emergencies. 217To boot the new version of the system you should follow the 218bootstrap procedures outlined in section 6.1. 219After having booted and tested the new system, it should be installed as 220.Pn /kernel 221before going into multiuser operation. 222A systematic scheme for numbering and saving old versions 223of the system may be useful. 224.Sh 2 "Configuring terminals" 225.PP 226If UNIX is to support simultaneous 227access from directly-connected terminals other than the console, 228the file 229.Pn /etc/ttys 230(see 231.Xr ttys (5)) 232must be edited. 233.PP 234To add a new terminal device, be sure the device is configured into the system
| 161.Sh 3 "Building new system images" 162.PP 163The kernel configuration of each UNIX system is described by 164a single configuration file, stored in the 165.Pn /sys/<architecture>/conf 166directory. 167To learn about the format of this file and the procedure used 168to build system images, 169start by reading ``Building 4.3BSD UNIX Systems with Config'' (SMM:2), 170look at the manual pages in section 4 171of the UNIX manual for the devices you have, 172and look at the sample configuration files in the 173.Pn /sys/<architecture>/conf 174directory. 175.PP 176The configured system image 177.Pn kernel 178should be copied to the root, and then booted to try it out. 179It is best to name it 180.Pn /newkernel 181so as not to destroy the working system until you are sure it does work: 182.DS 183\fB#\fP \fIcp kernel /newkernel\fP 184\fB#\fP \fIsync\fP 185.DE 186It is also a good idea to keep the previous system around under some other 187name. In particular, we recommend that you save the generic distribution 188version of the system permanently as 189.Pn /genkernel 190for use in emergencies. 191To boot the new version of the system you should follow the 192bootstrap procedures outlined in section 6.1. 193After having booted and tested the new system, it should be installed as 194.Pn /kernel 195before going into multiuser operation. 196A systematic scheme for numbering and saving old versions 197of the system may be useful. 198.Sh 2 "Configuring terminals" 199.PP 200If UNIX is to support simultaneous 201access from directly-connected terminals other than the console, 202the file 203.Pn /etc/ttys 204(see 205.Xr ttys (5)) 206must be edited. 207.PP 208To add a new terminal device, be sure the device is configured into the system
|
235and that the special files for the device have been made by 236.Pn /dev/MAKEDEV .
| 209and that the special files for the device exist in 210.Pn /dev .
|
237Then, enable the appropriate lines of 238.Pn /etc/ttys 239by setting the ``status'' 240field to \fBon\fP (or add new lines). 241Note that lines in 242.Pn /etc/ttys 243are one-for-one with entries in the file of current users 244(see 245.Pn /var/run/utmp ), 246and therefore it is best to make changes 247while running in single-user mode 248and to add all the entries for a new device at once. 249.PP 250Each line in the 251.Pn /etc/ttys 252file is broken into four tab separated 253fields (comments are shown by a `#' character and extend to 254the end of the line). For each terminal line the four fields 255are: 256the device (without a leading 257.Pn /dev ), 258the program 259.Pn /sbin/init 260should startup to service the line 261(or \fBnone\fP if the line is to be left alone), 262the terminal type (found in 263.Pn /usr/share/misc/termcap ), 264and optional status information describing if the terminal is 265enabled or not and if it is ``secure'' (i.e. the super user should 266be allowed to login on the line). 267If the console is marked as ``insecure'', 268then the root password is required to bring the machine up single-user. 269All fields are character strings 270with entries requiring embedded white space enclosed in double 271quotes. 272Thus a newly added terminal 273.Pn /dev/tty00 274could be added as 275.DS 276tty00 "/usr/libexec/getty std.9600" vt100 on secure # mike's office 277.DE 278The std.9600 parameter provided to 279.Pn /usr/libexec/getty 280is used in searching the file 281.Pn /etc/gettytab ; 282it specifies a terminal's characteristics (such as baud rate). 283To make custom terminal types, consult 284.Xr gettytab (5) 285before modifying 286.Pn /etc/gettytab . 287.PP 288Dialup terminals should be wired so that carrier is asserted only when the 289phone line is dialed up. 290For non-dialup terminals, from which modem control is not available, 291you must wire back the signals so that 292the carrier appears to always be present. For further details, 293find your terminal driver in section 4 of the manual. 294.PP 295For network terminals (i.e. pseudo terminals), no program should 296be started up on the lines. Thus, the normal entry in 297.Pn /etc/ttys 298would look like 299.DS 300ttyp0 none network 301.DE 302(Note, the fourth field is not needed here.) 303.PP 304When the system is running multi-user, all terminals that are listed in 305.Pn /etc/ttys 306as \fBon\fP have their line enabled. 307If, during normal operations, you wish 308to disable a terminal line, you can edit the file 309.Pn /etc/ttys 310to change the terminal's status to \fBoff\fP and 311then send a hangup signal to the 312.Xr init 313process, by doing 314.DS 315\fB#\fP \fIkill \-1 1\fP 316.DE 317Terminals can similarly be enabled by changing the status field 318from \fBoff\fP to \fBon\fP and sending a hangup signal to 319.Xr init . 320.PP 321Note that if a special file is inaccessible when 322.Xr init 323tries to create a process for it, 324.Xr init 325will log a message to the 326system error logging process (see 327.Xr syslogd (8)) 328and try to reopen the terminal every minute, reprinting the warning 329message every 10 minutes. Messages of this sort are normally 330printed on the console, though other actions may occur depending 331on the configuration information found in 332.Pn /etc/syslog.conf . 333.PP 334Finally note that you should change the names of any dialup 335terminals to ttyd? 336where ? is in [0-9a-zA-Z], as some programs use this property of the 337names to determine if a terminal is a dialup.
| 211Then, enable the appropriate lines of 212.Pn /etc/ttys 213by setting the ``status'' 214field to \fBon\fP (or add new lines). 215Note that lines in 216.Pn /etc/ttys 217are one-for-one with entries in the file of current users 218(see 219.Pn /var/run/utmp ), 220and therefore it is best to make changes 221while running in single-user mode 222and to add all the entries for a new device at once. 223.PP 224Each line in the 225.Pn /etc/ttys 226file is broken into four tab separated 227fields (comments are shown by a `#' character and extend to 228the end of the line). For each terminal line the four fields 229are: 230the device (without a leading 231.Pn /dev ), 232the program 233.Pn /sbin/init 234should startup to service the line 235(or \fBnone\fP if the line is to be left alone), 236the terminal type (found in 237.Pn /usr/share/misc/termcap ), 238and optional status information describing if the terminal is 239enabled or not and if it is ``secure'' (i.e. the super user should 240be allowed to login on the line). 241If the console is marked as ``insecure'', 242then the root password is required to bring the machine up single-user. 243All fields are character strings 244with entries requiring embedded white space enclosed in double 245quotes. 246Thus a newly added terminal 247.Pn /dev/tty00 248could be added as 249.DS 250tty00 "/usr/libexec/getty std.9600" vt100 on secure # mike's office 251.DE 252The std.9600 parameter provided to 253.Pn /usr/libexec/getty 254is used in searching the file 255.Pn /etc/gettytab ; 256it specifies a terminal's characteristics (such as baud rate). 257To make custom terminal types, consult 258.Xr gettytab (5) 259before modifying 260.Pn /etc/gettytab . 261.PP 262Dialup terminals should be wired so that carrier is asserted only when the 263phone line is dialed up. 264For non-dialup terminals, from which modem control is not available, 265you must wire back the signals so that 266the carrier appears to always be present. For further details, 267find your terminal driver in section 4 of the manual. 268.PP 269For network terminals (i.e. pseudo terminals), no program should 270be started up on the lines. Thus, the normal entry in 271.Pn /etc/ttys 272would look like 273.DS 274ttyp0 none network 275.DE 276(Note, the fourth field is not needed here.) 277.PP 278When the system is running multi-user, all terminals that are listed in 279.Pn /etc/ttys 280as \fBon\fP have their line enabled. 281If, during normal operations, you wish 282to disable a terminal line, you can edit the file 283.Pn /etc/ttys 284to change the terminal's status to \fBoff\fP and 285then send a hangup signal to the 286.Xr init 287process, by doing 288.DS 289\fB#\fP \fIkill \-1 1\fP 290.DE 291Terminals can similarly be enabled by changing the status field 292from \fBoff\fP to \fBon\fP and sending a hangup signal to 293.Xr init . 294.PP 295Note that if a special file is inaccessible when 296.Xr init 297tries to create a process for it, 298.Xr init 299will log a message to the 300system error logging process (see 301.Xr syslogd (8)) 302and try to reopen the terminal every minute, reprinting the warning 303message every 10 minutes. Messages of this sort are normally 304printed on the console, though other actions may occur depending 305on the configuration information found in 306.Pn /etc/syslog.conf . 307.PP 308Finally note that you should change the names of any dialup 309terminals to ttyd? 310where ? is in [0-9a-zA-Z], as some programs use this property of the 311names to determine if a terminal is a dialup.
|
338Shell commands to do this should be put in the 339.Pn /dev/MAKEDEV.local 340script.
| |
341.PP 342While it is possible to use truly arbitrary strings for terminal names, 343the accounting and noticeably the 344.Xr ps (1) 345command make good use of the convention that tty names 346(by default, and also after dialups are named as suggested above) 347are distinct in the last 2 characters. 348Change this and you may be sorry later, as the heuristic 349.Xr ps (1) 350uses based on these conventions will then break down and 351.Xr ps 352will run MUCH slower. 353.Sh 2 "Adding users" 354.PP 355The procedure for adding a new user is described in 356.Xr adduser (8). 357You should add accounts for the initial user community, giving 358each a directory and a password, and putting users who will wish 359to share software in the same groups. 360.PP 361Several guest accounts have been provided on the distribution 362system; these accounts are for people at Berkeley, 363Bell Laboratories, and others 364who have done major work on UNIX in the past. You can delete these accounts, 365or leave them on the system if you expect that these people would have 366occasion to login as guests on your system. 367.Sh 2 "Site tailoring" 368.PP 369All programs that require the site's name, or some similar 370characteristic, obtain the information through system calls 371or from files located in 372.Pn /etc . 373Aside from parts of the 374system related to the network, to tailor the system to your 375site you must simply select a site name, then edit the file 376.DS 377/etc/netstart 378.DE 379The first lines in 380.Pn /etc/netstart 381use a variable to set the hostname, 382.DS 383hostname=\fImysitename\fP 384/bin/hostname $hostname 385.DE 386to define the value returned by the 387.Xr gethostname (2) 388system call. If you are running the name server, your site 389name should be your fully qualified domain name. Programs such as 390.Xr getty (8), 391.Xr mail (1), 392.Xr wall (1), 393and 394.Xr uucp (1) 395use this system call so that the binary images are site 396independent. 397.PP 398You will also need to edit 399.Pn /etc/netstart 400to do the network interface initialization using 401.Xr ifconfig (8). 402If you are not sure how to do this, see sections 5.1, 5.2, and 5.3. 403If you are not running a routing daemon and have 404more than one Ethernet in your environment 405you will need to set up a default route; 406see section 5.4 for details. 407Before bringing your system up multiuser, 408you should ensure that the networking is properly configured. 409The network is started by running 410.Pn /etc/netstart . 411Once started, you should test connectivity using 412.Xr ping (8). 413You should first test connectivity to yourself, 414then another host on your Ethernet, 415and finally a host on another Ethernet. 416The 417.Xr netstat (8) 418program can be used to inspect and debug 419your routes; see section 5.4. 420.Sh 2 "Setting up the line printer system" 421.PP 422The line printer system consists of at least 423the following files and commands: 424.DS 425.TS 426l l. 427/usr/bin/lpq spooling queue examination program 428/usr/bin/lprm program to delete jobs from a queue 429/usr/bin/lpr program to enter a job in a printer queue 430/etc/printcap printer configuration and capability database 431/usr/sbin/lpd line printer daemon, scans spooling queues 432/usr/sbin/lpc line printer control program 433/etc/hosts.lpd list of host allowed to use the printers 434.TE 435.DE 436.PP 437The file 438.Pn /etc/printcap 439is a master database describing line 440printers directly attached to a machine and, also, printers 441accessible across a network. The manual page 442.Xr printcap (5) 443describes the format of this database and also 444shows the default values for such things as the directory 445in which spooling is performed. The line printer system handles 446multiple printers, multiple spooling queues, local and remote 447printers, and also printers attached via serial lines that require 448line initialization such as the baud rate. Raster output devices 449such as a Varian or Versatec, and laser printers such as an Imagen, 450are also supported by the line printer system. 451.PP 452Remote spooling via the network is handled with two spooling 453queues, one on the local machine and one on the remote machine. 454When a remote printer job is started with 455.Xr lpr , 456the job is queued locally and a daemon process created to oversee the 457transfer of the job to the remote machine. If the destination 458machine is unreachable, the job will remain queued until it is 459possible to transfer the files to the spooling queue on the 460remote machine. The 461.Xr lpq 462program shows the contents of spool 463queues on both the local and remote machines. 464.PP 465To configure your line printers, consult the printcap manual page 466and the accompanying document, ``4.3BSD Line Printer Spooler Manual'' (SMM:7). 467A call to the 468.Xr lpd 469program should be present in 470.Pn /etc/rc . 471.Sh 2 "Setting up the mail system" 472.PP 473The mail system consists of the following commands: 474.DS 475.TS 476l l. 477/usr/bin/mail UCB mail program, described in \fImail\fP\|(1) 478/usr/sbin/sendmail mail routing program 479/var/spool/mail mail spooling directory 480/var/spool/secretmail secure mail directory 481/usr/bin/xsend secure mail sender 482/usr/bin/xget secure mail receiver 483/etc/aliases mail forwarding information 484/usr/bin/newaliases command to rebuild binary forwarding database 485/usr/bin/biff mail notification enabler 486/usr/libexec/comsat mail notification daemon 487.TE 488.DE 489Mail is normally sent and received using the 490.Xr mail (1) 491command (found in 492.Pn /usr/bin/mail ), 493which provides a front-end to edit the messages sent 494and received, and passes the messages to 495.Xr sendmail (8) 496for routing. 497The routing algorithm uses knowledge of the network name syntax, 498aliasing and forwarding information, and network topology, as 499defined in the configuration file 500.Pn /usr/lib/sendmail.cf , 501to process each piece of mail. 502Local mail is delivered by giving it to the program 503.Pn /usr/libexec/mail.local 504that adds it to the mailboxes in the directory 505.Pn /var/spool/mail/<username> , 506using a locking protocol to avoid problems with simultaneous updates. 507After the mail is delivered, the local mail delivery daemon 508.Pn /usr/libexec/comsat 509is notified, which in turn notifies users who have issued a 510``\fIbiff\fP y'' command that mail has arrived. 511.PP 512Mail queued in the directory 513.Pn /var/spool/mail 514is normally readable only by the recipient. 515To send mail that is secure against perusal 516(except by a code-breaker) you should use the secret mail facility, 517which encrypts the mail. 518.PP 519To set up the mail facility you should read the instructions in the 520file READ_ME in the directory 521.Pn /usr/src/usr.sbin/sendmail 522and then adjust the necessary configuration files. 523You should also set up the file 524.Pn /etc/aliases 525for your installation, creating mail groups as appropriate. 526For more informations see 527``Sendmail Installation and Operation Guide'' (SMM:8) and 528``Sendmail \- An Internetwork Mail Router'' (SMM:9). 529.Sh 3 "Setting up a UUCP connection" 530.LP 531The version of 532.Xr uucp 533included in \*(4B has the following features: 534.IP \(bu 3 535support for many auto call units and dialers 536in addition to the DEC DN11, 537.IP \(bu 3 538breakup of the spooling area into multiple subdirectories, 539.IP \(bu 3 540addition of an 541.Pn L.cmds 542file to control the set 543of commands that may be executed by a remote site, 544.IP \(bu 3 545enhanced ``expect-send'' sequence capabilities when 546logging in to a remote site, 547.IP \(bu 3 548new commands to be used in polling sites and 549obtaining snap shots of 550.Xr uucp 551activity, 552.IP \(bu 3 553additional protocols for different communication media. 554.LP 555This section gives a brief overview of 556.Xr uucp 557and points out the most important steps in its installation. 558.PP 559To connect two UNIX machines with a 560.Xr uucp 561network link using modems, 562one site must have an automatic call unit 563and the other must have a dialup port. 564It is better if both sites have both. 565.PP 566You should first read the paper in the UNIX System Manager's Manual: 567``Uucp Implementation Description'' (SMM:14). 568It describes in detail the file formats and conventions, 569and will give you a little context. 570In addition, 571the document ``setup.tblms'', 572located in the directory 573.Pn /usr/src/usr.bin/uucp/UUAIDS , 574may be of use in tailoring the software to your needs. 575.PP 576The 577.Xr uucp 578support is located in three major directories: 579.Pn /usr/bin, 580.Pn /usr/lib/uucp, 581and 582.Pn /var/spool/uucp . 583User commands are kept in 584.Pn /usr/bin, 585operational commands in 586.Pn /usr/lib/uucp , 587and 588.Pn /var/spool/uucp 589is used as a spooling area. 590The commands in 591.Pn /usr/bin 592are: 593.DS 594.TS 595l l. 596/usr/bin/uucp file-copy command 597/usr/bin/uux remote execution command 598/usr/bin/uusend binary file transfer using mail 599/usr/bin/uuencode binary file encoder (for \fIuusend\fP) 600/usr/bin/uudecode binary file decoder (for \fIuusend\fP) 601/usr/bin/uulog scans session log files 602/usr/bin/uusnap gives a snap-shot of \fIuucp\fP activity 603/usr/bin/uupoll polls remote system until an answer is received 604/usr/bin/uuname prints a list of known uucp hosts 605/usr/bin/uuq gives information about the queue 606.TE 607.DE 608The important files and commands in 609.Pn /usr/lib/uucp 610are: 611.DS 612.TS 613l l. 614/usr/lib/uucp/L-devices list of dialers and hard-wired lines 615/usr/lib/uucp/L-dialcodes dialcode abbreviations 616/usr/lib/uucp/L.aliases hostname aliases 617/usr/lib/uucp/L.cmds commands remote sites may execute 618/usr/lib/uucp/L.sys systems to communicate with, how to connect, and when 619/usr/lib/uucp/SEQF sequence numbering control file 620/usr/lib/uucp/USERFILE remote site pathname access specifications 621/usr/lib/uucp/uucico \fIuucp\fP protocol daemon 622/usr/lib/uucp/uuclean cleans up garbage files in spool area 623/usr/lib/uucp/uuxqt \fIuucp\fP remote execution server 624.TE 625.DE 626while the spooling area contains the following important files and directories: 627.DS 628.TS 629l l. 630/var/spool/uucp/C. directory for command, ``C.'' files 631/var/spool/uucp/D. directory for data, ``D.'', files 632/var/spool/uucp/X. directory for command execution, ``X.'', files 633/var/spool/uucp/D.\fImachine\fP directory for local ``D.'' files 634/var/spool/uucp/D.\fImachine\fPX directory for local ``X.'' files 635/var/spool/uucp/TM. directory for temporary, ``TM.'', files 636/var/spool/uucp/LOGFILE log file of \fIuucp\fP activity 637/var/spool/uucp/SYSLOG log file of \fIuucp\fP file transfers 638.TE 639.DE 640.PP 641To install 642.Xr uucp 643on your system, 644start by selecting a site name 645(shorter than 14 characters). 646A 647.Xr uucp 648account must be created in the password file and a password set up. 649Then, 650create the appropriate spooling directories with mode 755 651and owned by user 652.Xr uucp , 653group \fIdaemon\fP. 654.PP 655If you have an auto-call unit, 656the L.sys, L-dialcodes, and L-devices files should be created. 657The L.sys file should contain 658the phone numbers and login sequences 659required to establish a connection with a 660.Xr uucp 661daemon on another machine. 662For example, our L.sys file looks something like: 663.DS 664adiron Any ACU 1200 out0123456789- ogin-EOT-ogin uucp 665cbosg Never Slave 300 666cbosgd Never Slave 300 667chico Never Slave 1200 out2010123456 668.DE 669The first field is the name of a site, 670the second shows when the machine may be called, 671the third field specifies how the host is connected 672(through an ACU, a hard-wired line, etc.), 673then comes the phone number to use in connecting through an auto-call unit, 674and finally a login sequence. 675The phone number 676may contain common abbreviations that are defined in the L-dialcodes file. 677The device specification should refer to devices 678specified in the L-devices file. 679Listing only ACU causes the 680.Xr uucp 681daemon, 682.Xr uucico , 683to search for any available auto-call unit in L-devices. 684Our L-dialcodes file is of the form: 685.DS 686ucb 2 687out 9% 688.DE 689while our L-devices file is: 690.DS 691ACU cul0 unused 1200 ventel 692.DE 693Refer to the README file in the 694.Xr uucp 695source directory for more information about installation. 696.PP 697As 698.Xr uucp 699operates it creates (and removes) many small 700files in the directories underneath 701.Pn /var/spool/uucp . 702Sometimes files are left undeleted; 703these are most easily purged with the 704.Xr uuclean 705program. 706The log files can grow without bound unless trimmed back; 707.Xr uulog 708maintains these files. 709Many useful aids in maintaining your 710.Xr uucp 711installation are included in a subdirectory UUAIDS beneath 712.Pn /usr/src/usr.bin/uucp . 713Peruse this directory and read the ``setup'' instructions also located there.
| 312.PP 313While it is possible to use truly arbitrary strings for terminal names, 314the accounting and noticeably the 315.Xr ps (1) 316command make good use of the convention that tty names 317(by default, and also after dialups are named as suggested above) 318are distinct in the last 2 characters. 319Change this and you may be sorry later, as the heuristic 320.Xr ps (1) 321uses based on these conventions will then break down and 322.Xr ps 323will run MUCH slower. 324.Sh 2 "Adding users" 325.PP 326The procedure for adding a new user is described in 327.Xr adduser (8). 328You should add accounts for the initial user community, giving 329each a directory and a password, and putting users who will wish 330to share software in the same groups. 331.PP 332Several guest accounts have been provided on the distribution 333system; these accounts are for people at Berkeley, 334Bell Laboratories, and others 335who have done major work on UNIX in the past. You can delete these accounts, 336or leave them on the system if you expect that these people would have 337occasion to login as guests on your system. 338.Sh 2 "Site tailoring" 339.PP 340All programs that require the site's name, or some similar 341characteristic, obtain the information through system calls 342or from files located in 343.Pn /etc . 344Aside from parts of the 345system related to the network, to tailor the system to your 346site you must simply select a site name, then edit the file 347.DS 348/etc/netstart 349.DE 350The first lines in 351.Pn /etc/netstart 352use a variable to set the hostname, 353.DS 354hostname=\fImysitename\fP 355/bin/hostname $hostname 356.DE 357to define the value returned by the 358.Xr gethostname (2) 359system call. If you are running the name server, your site 360name should be your fully qualified domain name. Programs such as 361.Xr getty (8), 362.Xr mail (1), 363.Xr wall (1), 364and 365.Xr uucp (1) 366use this system call so that the binary images are site 367independent. 368.PP 369You will also need to edit 370.Pn /etc/netstart 371to do the network interface initialization using 372.Xr ifconfig (8). 373If you are not sure how to do this, see sections 5.1, 5.2, and 5.3. 374If you are not running a routing daemon and have 375more than one Ethernet in your environment 376you will need to set up a default route; 377see section 5.4 for details. 378Before bringing your system up multiuser, 379you should ensure that the networking is properly configured. 380The network is started by running 381.Pn /etc/netstart . 382Once started, you should test connectivity using 383.Xr ping (8). 384You should first test connectivity to yourself, 385then another host on your Ethernet, 386and finally a host on another Ethernet. 387The 388.Xr netstat (8) 389program can be used to inspect and debug 390your routes; see section 5.4. 391.Sh 2 "Setting up the line printer system" 392.PP 393The line printer system consists of at least 394the following files and commands: 395.DS 396.TS 397l l. 398/usr/bin/lpq spooling queue examination program 399/usr/bin/lprm program to delete jobs from a queue 400/usr/bin/lpr program to enter a job in a printer queue 401/etc/printcap printer configuration and capability database 402/usr/sbin/lpd line printer daemon, scans spooling queues 403/usr/sbin/lpc line printer control program 404/etc/hosts.lpd list of host allowed to use the printers 405.TE 406.DE 407.PP 408The file 409.Pn /etc/printcap 410is a master database describing line 411printers directly attached to a machine and, also, printers 412accessible across a network. The manual page 413.Xr printcap (5) 414describes the format of this database and also 415shows the default values for such things as the directory 416in which spooling is performed. The line printer system handles 417multiple printers, multiple spooling queues, local and remote 418printers, and also printers attached via serial lines that require 419line initialization such as the baud rate. Raster output devices 420such as a Varian or Versatec, and laser printers such as an Imagen, 421are also supported by the line printer system. 422.PP 423Remote spooling via the network is handled with two spooling 424queues, one on the local machine and one on the remote machine. 425When a remote printer job is started with 426.Xr lpr , 427the job is queued locally and a daemon process created to oversee the 428transfer of the job to the remote machine. If the destination 429machine is unreachable, the job will remain queued until it is 430possible to transfer the files to the spooling queue on the 431remote machine. The 432.Xr lpq 433program shows the contents of spool 434queues on both the local and remote machines. 435.PP 436To configure your line printers, consult the printcap manual page 437and the accompanying document, ``4.3BSD Line Printer Spooler Manual'' (SMM:7). 438A call to the 439.Xr lpd 440program should be present in 441.Pn /etc/rc . 442.Sh 2 "Setting up the mail system" 443.PP 444The mail system consists of the following commands: 445.DS 446.TS 447l l. 448/usr/bin/mail UCB mail program, described in \fImail\fP\|(1) 449/usr/sbin/sendmail mail routing program 450/var/spool/mail mail spooling directory 451/var/spool/secretmail secure mail directory 452/usr/bin/xsend secure mail sender 453/usr/bin/xget secure mail receiver 454/etc/aliases mail forwarding information 455/usr/bin/newaliases command to rebuild binary forwarding database 456/usr/bin/biff mail notification enabler 457/usr/libexec/comsat mail notification daemon 458.TE 459.DE 460Mail is normally sent and received using the 461.Xr mail (1) 462command (found in 463.Pn /usr/bin/mail ), 464which provides a front-end to edit the messages sent 465and received, and passes the messages to 466.Xr sendmail (8) 467for routing. 468The routing algorithm uses knowledge of the network name syntax, 469aliasing and forwarding information, and network topology, as 470defined in the configuration file 471.Pn /usr/lib/sendmail.cf , 472to process each piece of mail. 473Local mail is delivered by giving it to the program 474.Pn /usr/libexec/mail.local 475that adds it to the mailboxes in the directory 476.Pn /var/spool/mail/<username> , 477using a locking protocol to avoid problems with simultaneous updates. 478After the mail is delivered, the local mail delivery daemon 479.Pn /usr/libexec/comsat 480is notified, which in turn notifies users who have issued a 481``\fIbiff\fP y'' command that mail has arrived. 482.PP 483Mail queued in the directory 484.Pn /var/spool/mail 485is normally readable only by the recipient. 486To send mail that is secure against perusal 487(except by a code-breaker) you should use the secret mail facility, 488which encrypts the mail. 489.PP 490To set up the mail facility you should read the instructions in the 491file READ_ME in the directory 492.Pn /usr/src/usr.sbin/sendmail 493and then adjust the necessary configuration files. 494You should also set up the file 495.Pn /etc/aliases 496for your installation, creating mail groups as appropriate. 497For more informations see 498``Sendmail Installation and Operation Guide'' (SMM:8) and 499``Sendmail \- An Internetwork Mail Router'' (SMM:9). 500.Sh 3 "Setting up a UUCP connection" 501.LP 502The version of 503.Xr uucp 504included in \*(4B has the following features: 505.IP \(bu 3 506support for many auto call units and dialers 507in addition to the DEC DN11, 508.IP \(bu 3 509breakup of the spooling area into multiple subdirectories, 510.IP \(bu 3 511addition of an 512.Pn L.cmds 513file to control the set 514of commands that may be executed by a remote site, 515.IP \(bu 3 516enhanced ``expect-send'' sequence capabilities when 517logging in to a remote site, 518.IP \(bu 3 519new commands to be used in polling sites and 520obtaining snap shots of 521.Xr uucp 522activity, 523.IP \(bu 3 524additional protocols for different communication media. 525.LP 526This section gives a brief overview of 527.Xr uucp 528and points out the most important steps in its installation. 529.PP 530To connect two UNIX machines with a 531.Xr uucp 532network link using modems, 533one site must have an automatic call unit 534and the other must have a dialup port. 535It is better if both sites have both. 536.PP 537You should first read the paper in the UNIX System Manager's Manual: 538``Uucp Implementation Description'' (SMM:14). 539It describes in detail the file formats and conventions, 540and will give you a little context. 541In addition, 542the document ``setup.tblms'', 543located in the directory 544.Pn /usr/src/usr.bin/uucp/UUAIDS , 545may be of use in tailoring the software to your needs. 546.PP 547The 548.Xr uucp 549support is located in three major directories: 550.Pn /usr/bin, 551.Pn /usr/lib/uucp, 552and 553.Pn /var/spool/uucp . 554User commands are kept in 555.Pn /usr/bin, 556operational commands in 557.Pn /usr/lib/uucp , 558and 559.Pn /var/spool/uucp 560is used as a spooling area. 561The commands in 562.Pn /usr/bin 563are: 564.DS 565.TS 566l l. 567/usr/bin/uucp file-copy command 568/usr/bin/uux remote execution command 569/usr/bin/uusend binary file transfer using mail 570/usr/bin/uuencode binary file encoder (for \fIuusend\fP) 571/usr/bin/uudecode binary file decoder (for \fIuusend\fP) 572/usr/bin/uulog scans session log files 573/usr/bin/uusnap gives a snap-shot of \fIuucp\fP activity 574/usr/bin/uupoll polls remote system until an answer is received 575/usr/bin/uuname prints a list of known uucp hosts 576/usr/bin/uuq gives information about the queue 577.TE 578.DE 579The important files and commands in 580.Pn /usr/lib/uucp 581are: 582.DS 583.TS 584l l. 585/usr/lib/uucp/L-devices list of dialers and hard-wired lines 586/usr/lib/uucp/L-dialcodes dialcode abbreviations 587/usr/lib/uucp/L.aliases hostname aliases 588/usr/lib/uucp/L.cmds commands remote sites may execute 589/usr/lib/uucp/L.sys systems to communicate with, how to connect, and when 590/usr/lib/uucp/SEQF sequence numbering control file 591/usr/lib/uucp/USERFILE remote site pathname access specifications 592/usr/lib/uucp/uucico \fIuucp\fP protocol daemon 593/usr/lib/uucp/uuclean cleans up garbage files in spool area 594/usr/lib/uucp/uuxqt \fIuucp\fP remote execution server 595.TE 596.DE 597while the spooling area contains the following important files and directories: 598.DS 599.TS 600l l. 601/var/spool/uucp/C. directory for command, ``C.'' files 602/var/spool/uucp/D. directory for data, ``D.'', files 603/var/spool/uucp/X. directory for command execution, ``X.'', files 604/var/spool/uucp/D.\fImachine\fP directory for local ``D.'' files 605/var/spool/uucp/D.\fImachine\fPX directory for local ``X.'' files 606/var/spool/uucp/TM. directory for temporary, ``TM.'', files 607/var/spool/uucp/LOGFILE log file of \fIuucp\fP activity 608/var/spool/uucp/SYSLOG log file of \fIuucp\fP file transfers 609.TE 610.DE 611.PP 612To install 613.Xr uucp 614on your system, 615start by selecting a site name 616(shorter than 14 characters). 617A 618.Xr uucp 619account must be created in the password file and a password set up. 620Then, 621create the appropriate spooling directories with mode 755 622and owned by user 623.Xr uucp , 624group \fIdaemon\fP. 625.PP 626If you have an auto-call unit, 627the L.sys, L-dialcodes, and L-devices files should be created. 628The L.sys file should contain 629the phone numbers and login sequences 630required to establish a connection with a 631.Xr uucp 632daemon on another machine. 633For example, our L.sys file looks something like: 634.DS 635adiron Any ACU 1200 out0123456789- ogin-EOT-ogin uucp 636cbosg Never Slave 300 637cbosgd Never Slave 300 638chico Never Slave 1200 out2010123456 639.DE 640The first field is the name of a site, 641the second shows when the machine may be called, 642the third field specifies how the host is connected 643(through an ACU, a hard-wired line, etc.), 644then comes the phone number to use in connecting through an auto-call unit, 645and finally a login sequence. 646The phone number 647may contain common abbreviations that are defined in the L-dialcodes file. 648The device specification should refer to devices 649specified in the L-devices file. 650Listing only ACU causes the 651.Xr uucp 652daemon, 653.Xr uucico , 654to search for any available auto-call unit in L-devices. 655Our L-dialcodes file is of the form: 656.DS 657ucb 2 658out 9% 659.DE 660while our L-devices file is: 661.DS 662ACU cul0 unused 1200 ventel 663.DE 664Refer to the README file in the 665.Xr uucp 666source directory for more information about installation. 667.PP 668As 669.Xr uucp 670operates it creates (and removes) many small 671files in the directories underneath 672.Pn /var/spool/uucp . 673Sometimes files are left undeleted; 674these are most easily purged with the 675.Xr uuclean 676program. 677The log files can grow without bound unless trimmed back; 678.Xr uulog 679maintains these files. 680Many useful aids in maintaining your 681.Xr uucp 682installation are included in a subdirectory UUAIDS beneath 683.Pn /usr/src/usr.bin/uucp . 684Peruse this directory and read the ``setup'' instructions also located there.
|