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