|
|
1.1 root 1: .\" Copyright (c) 1980, 1986, 1988 Regents of the University of California.
2: .\" All rights reserved.
3: .\"
4: .\" Redistribution and use in source and binary forms are permitted
5: .\" provided that the above copyright notice and this paragraph are
6: .\" duplicated in all such forms and that any documentation,
7: .\" advertising materials, and other materials related to such
8: .\" distribution and use acknowledge that the software was developed
9: .\" by the University of California, Berkeley. The name of the
10: .\" University may not be used to endorse or promote products derived
11: .\" from this software without specific prior written permission.
12: .\" THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
13: .\" IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
14: .\" WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
15: .\"
16: .\" @(#)6.t 6.4 (Berkeley) 3/7/89
17: .\"
18: .de IR
19: \fI\\$1\fP\|\\$2
20: ..
21: .ds LH "Installing/Operating \*(4B
22: .nr H1 6
23: .nr H2 0
24: .ds RH "System Operation
25: .ds CF \*(DY
26: .bp
27: .LG
28: .B
29: .ce
30: 6. SYSTEM OPERATION
31: .sp 2
32: .R
33: .NL
34: .PP
35: This section describes procedures used to operate a \*(4B UNIX system.
36: Procedures described here are used periodically, to reboot the system,
37: analyze error messages from devices, do disk backups, monitor
38: system performance, recompile system software and control local changes.
39: .NH 2
40: Bootstrap and shutdown procedures
41: .PP
42: In a normal reboot, the system checks the disks and comes up multi-user
43: without intervention at the console.
44: Such a reboot
45: can be stopped (after it prints the date) with a ^C (interrupt).
46: This will leave the system in single-user mode, with only the console
47: terminal active.
48: It is also possible to allow the filesystem checks to complete
49: and then to return to single-user mode by signaling \fIfsck\fP(8)
50: with a QUIT signal (^\\).
51: .if \n(Th \{\
52: .PP
53: If booting from the console command level is needed, then the command
54: .DS
55: \fB#>\fP\|fb
56: .DE
57: will boot from the default device.
58: .PP
59: You can boot a system up single user by doing
60: .DS
61: \fB#>\fP\fI\|p23 2.\fP\fB#>\fP\fIy.\fP\fB#>\fP\fI\|fb\fP
62: .DE
63: .PP
64: Other possibilities are:
65: .DS
66: \fB#>\fP\fI\|p23 3.\fP\fB#>\fP\fIy.\fP\fB#>\fP\fI\|fb\fP
67: .DE
68: to do a full bootstrap, or
69: .DS
70: \fB#>\fP\fI\|p23 3.\fP\fB#>\fP\fIy.\fP\fB#>\fP\fI\|fr /boot\fP
71: .DE
72: to run the bootstrap without performing self-tests and
73: reloading microcode; it can be used after a full bootstrap has been done
74: once.
75: .\}
76: .if \n(Vx \{\
77: .PP
78: If booting from the console command level is needed, then the command
79: .DS
80: \fB>>>\fP\fIB\fP
81: .DE
82: will boot from the default device.
83: On an 8600, 8200, 11/780, or 11/730 the default device is
84: determined by a ``DEPOSIT''
85: command stored on the console boot device in the file ``DEFBOO.CMD''
86: (``DEFBOO.COM'' on an 8600);
87: on an 11/750 the default device is determined by the setting of a switch
88: on the front panel.
89: .PP
90: You can boot a system up single user
91: on an 8600, 780, or 730 by doing
92: .DS
93: \fB>>>\fP\fIB xxS\fP
94: .DE
95: where \fIxx\fP is one of HP, HK, UP, RA, or RB.
96: The corresponding command on an 11/750 is
97: .DS
98: \fB>>>\fP\fIB/2\fP
99: .DE
100: On an 8200, use
101: .DS
102: \fB>>>\fP\fIB/R5:800\fP
103: (node and memory test values)
104: \fBBOOT58>\fP \fI@\fPXX\fISBOO.CMD\fP
105: .DE
106: .PP
107: For second vendor storage modules on the
108: UNIBUS or MASSBUS of an 11/750 you will need to
109: have a boot prom. Most vendors will sell you
110: such proms for their controllers; contact your vendor
111: if you don't have one.
112: .PP
113: Other possibilities are:
114: .DS
115: \fB>>>\fP\fIB ANY\fP
116: .DE
117: or, on an 8200,
118: .DS
119: \fB>>>\fP\fIB/R5:800\fP
120: \fBBOOT58>\fP\[email protected]\fP
121: .DE
122: or, on an 11/750
123: .DS
124: \fB>>>\fP\fIB/3\fP
125: .DE
126: .\}
127: These commands boot and ask for the name of the system to be booted.
128: They can be used after building a new test system to give the
129: boot program the name of the test version of the system.*
130: .FS
131: * Additional bootflags are used when a system is configured with
132: the kernel debugger; consult \fIkdb\fP(4) for details.
133: .FE
134: .PP
135: To bring the system up to a multi-user configuration from the single-user
136: status,
137: all you have to do is hit ^D on the console. The system
138: will then execute /etc/rc,
139: a multi-user restart script (and /etc/rc.local),
140: and come up on the terminals listed as
141: active in the file /etc/ttys.
142: See
143: \fIinit\fP\|(8)
144: and
145: \fIttys\fP\|(5) for more details.
146: Note, however, that this does not cause a file system check to be performed.
147: Unless the system was taken down cleanly, you should run
148: ``fsck \-p'' or force a reboot with
149: \fIreboot\fP\|(8)
150: to have the disks checked.
151: .PP
152: To take the system down to a single user state you can use
153: .DS
154: \fB#\fP \fIkill 1\fP
155: .DE
156: or use the
157: \fIshutdown\fP\|(8)
158: command (which is much more polite, if there are other users logged in)
159: when you are running multi-user.
160: Either command will kill all processes and give you a shell on the console,
161: as if you had just booted. File systems remain mounted after the
162: system is taken single-user. If you wish to come up multi-user again, you
163: should do this by:
164: .DS
165: \fB#\fP \fIcd /\fP
166: \fB#\fP \fI/etc/umount -a\fP
167: \fB#\fP \fI^D\fP
168: .DE
169: .PP
170: Each system shutdown, crash, processor halt and reboot
171: is recorded in the system log
172: with its cause.
173: .NH 2
174: Device errors and diagnostics
175: .PP
176: When serious errors occur on peripherals or in the system, the system
177: prints a warning diagnostic on the console.
178: These messages are collected
179: by the system error logging process
180: .IR syslogd (8)
181: and written into a system error log file
182: \fI/usr/adm/messages\fP.
183: Less serious errors are sent directly to \fIsyslogd\fP,
184: which may log them on the console.
185: The error priorities that are logged and the locations to which they are logged
186: are controlled by \fI/etc/syslog.conf\fP. See
187: .IR syslogd (8)
188: for further details.
189: .PP
190: Error messages printed by the devices in the system are described with the
191: drivers for the devices in section 4 of the programmer's manual.
192: If errors occur suggesting hardware problems, you should contact
193: your hardware support group or field service. It is a good idea to
194: examine the error log file regularly
195: (e.g. with the command \fItail \-r /usr/adm/messages\fP).
196: .NH 2
197: File system checks, backups and disaster recovery
198: .PP
199: Periodically (say every week or so in the absence of any problems)
200: and always (usually automatically) after a crash,
201: all the file systems should be checked for consistency
202: by
203: \fIfsck\fP\|(1).
204: The procedures of
205: \fIreboot\fP\|(8)
206: should be used to get the system to a state where a file system
207: check can be performed manually or automatically.
208: .PP
209: Dumping of the file systems should be done regularly,
210: since once the system is going it is easy to
211: become complacent.
212: Complete and incremental dumps are easily done with
213: \fIdump\fP\|(8).
214: You should arrange to do a towers-of-hanoi dump sequence; we tune
215: ours so that almost all files are dumped on two tapes and kept for at
216: least a week in most every case. We take full dumps every month (and keep
217: these indefinitely).
218: Operators can execute ``dump w'' at login that will tell them what needs
219: to be dumped
220: (based on the /etc/fstab
221: information).
222: Be sure to create a group
223: .B operator
224: in the file /etc/group
225: so that dump can notify logged-in operators when it needs help.
226: .PP
227: More precisely, we have three sets of dump tapes: 10 daily tapes,
228: 5 weekly sets of 2 tapes, and fresh sets of three tapes monthly.
229: We do daily dumps circularly on the daily tapes with sequence
230: `3 2 5 4 7 6 9 8 9 9 9 ...'.
231: Each weekly is a level 1 and the daily dump sequence level
232: restarts after each weekly dump.
233: Full dumps are level 0 and the daily sequence restarts after each full dump
234: also.
235: .PP
236: Thus a typical dump sequence would be:
237: .br
238: .ne 6
239: .KS
240: .TS
241: center;
242: c c c c c
243: n n n l l.
244: tape name level number date opr size
245: _
246: FULL 0 Nov 24, 1979 jkf 137K
247: D1 3 Nov 28, 1979 jkf 29K
248: D2 2 Nov 29, 1979 rrh 34K
249: D3 5 Nov 30, 1979 rrh 19K
250: D4 4 Dec 1, 1979 rrh 22K
251: W1 1 Dec 2, 1979 etc 40K
252: D5 3 Dec 4, 1979 rrh 15K
253: D6 2 Dec 5, 1979 jkf 25K
254: D7 5 Dec 6, 1979 jkf 15K
255: D8 4 Dec 7, 1979 rrh 19K
256: W2 1 Dec 9, 1979 etc 118K
257: D9 3 Dec 11, 1979 rrh 15K
258: D10 2 Dec 12, 1979 rrh 26K
259: D1 5 Dec 15, 1979 rrh 14K
260: W3 1 Dec 17, 1979 etc 71K
261: D2 3 Dec 18, 1979 etc 13K
262: FULL 0 Dec 22, 1979 etc 135K
263: .TE
264: .KE
265: We do weekly dumps often enough that daily dumps always fit on one tape.
266: .PP
267: Dumping of files by name is best done by
268: \fItar\fP\|(1)
269: but the amount of data that can be moved in this way is limited
270: to a single tape.
271: Finally if there are enough drives entire
272: disks can be copied with
273: \fIdd\fP\|(1)
274: using the raw special files and an appropriate
275: blocking factor; the number of sectors per track is usually
276: a good value to use, consult \fI/etc/disktab\fP.
277: .PP
278: It is desirable that full dumps of the root file system be
279: made regularly.
280: This is especially true when only one disk is available.
281: Then, if the
282: root file system is damaged by a hardware or software failure, you
283: can rebuild a workable disk doing a restore in the
284: same way that the initial root file system was created.
285: .PP
286: Exhaustion of user-file space is certain to occur
287: now and then; disk quotas may be imposed, or if you
288: prefer a less fascist approach, try using the programs
289: \fIdu\fP\|(1),
290: \fIdf\fP\|(1), and
291: \fIquot\fP\|(8),
292: combined with threatening
293: messages of the day, and personal letters.
294: .NH 2
295: Moving file system data
296: .PP
297: If you have the resources,
298: the best way to move a file system
299: is to dump it to a spare disk partition, or magtape, using
300: \fIdump\fP\|(8), use \fInewfs\fP\|(8) to create the new file system,
301: and restore the file system using \fIrestore\fP\|(8).
302: Filesystems may also be moved by piping the output of \fIdump\fP
303: to \fIrestore\fP.
304: The \fIrestore\fP program uses an ``in-place'' algorithm that
305: allows file system dumps to be restored without concern for the
306: original size of the file system. Further, portions of a
307: file system may be selectively restored using a method similar
308: to the tape archive program.
309: .PP
310: If you have to merge a file system into another, existing one,
311: the best bet is to
312: use \fItar\fP\|(1).
313: If you must shrink a file system, the best bet is to dump
314: the original and restore it onto the new file system.
315: If you
316: are playing with the root file system and only have one drive,
317: the procedure is more complicated.
318: If the only drive is a Winchester disk, this procedure may not be used
319: without overwriting the existing root or another partition.
320: What you do is the following:
321: .IP 1.
322: GET A SECOND PACK, OR USE ANOTHER DISK DRIVE!!!!
323: .IP 2.
324: Dump the root file system to tape using
325: \fIdump\fP\|(8).
326: .IP 3.
327: Bring the system down.
328: .IP 4.
329: Mount the new pack in the correct disk drive, if
330: using removable media.
331: .IP 5.
332: Load the distribution tape and install the new
333: root file system as you did when first installing the system.
334: Boot normally
335: using the newly created disk file system.
336: .PP
337: Note that if you change the disk partition tables or add new disk
338: drivers they should also be added to the standalone system in
339: \fI/sys/\*(mCstand\fP,
340: and the default disk partition tables in \fI/etc/disktab\fP
341: should be modified.
342: .NH 2
343: Monitoring System Performance
344: .PP
345: The
346: .I systat
347: program provided with the system is designed to be an aid to monitoring
348: systemwide activity. The default ``pigs'' mode shows a dynamic ``ps''.
349: By running in the ``vmstat'' mode
350: when the system is active you can judge the system activity in several
351: dimensions: job distribution, virtual memory load, paging and swapping
352: activity, device interrupts, and disk and cpu utilization.
353: Ideally, there should be few blocked (b) jobs,
354: there should be little paging or swapping activity, there should
355: be available bandwidth on the disk devices (most single arms peak
356: out at 20-30 tps in practice), and the user cpu utilization (us) should
357: be high (above 50%).
358: .PP
359: If the system is busy, then the count of active jobs may be large,
360: and several of these jobs may often be blocked (b). If the virtual
361: memory is active, then the paging demon will be running (sr will
362: be non-zero). It is healthy for the paging demon to free pages when
363: the virtual memory gets active; it is triggered by the amount of free
364: memory dropping below a threshold and increases its pace as free memory
365: goes to zero.
366: .PP
367: If you run in the ``vmstat'' mode
368: when the system is busy, you can find
369: imbalances by noting abnormal job distributions. If many
370: processes are blocked (b), then the disk subsystem
371: is overloaded or imbalanced. If you have several non-dma
372: devices or open teletype lines that are ``ringing'', or user programs
373: that are doing high-speed non-buffered input/output, then the system
374: time may go high (60-70% or higher).
375: It is often possible to pin down the cause of high system time by
376: looking to see if there is excessive context switching (cs), interrupt
377: activity (in) and per-device interrupt counts,
378: or system call activity (sy). Cumulatively on one of
379: our large machines we average about 60-100 context switches and interrupts
380: per second and about 70-120 system calls per second.
381: .PP
382: If the system is heavily loaded, or if you have little memory
383: for your load (2M is little in most any case), then the system
384: may be forced to swap. This is likely to be accompanied by a noticeable
385: reduction in system performance and pregnant pauses when interactive
386: jobs such as editors swap out.
387: If you expect to be in a memory-poor environment
388: for an extended period you might consider administratively
389: limiting system load.
390: .NH 2
391: Recompiling and reinstalling system software
392: .PP
393: It is easy to regenerate the system, and it is a good
394: idea to try rebuilding pieces of the system to build confidence
395: in the procedures.
396: The system consists of two major parts:
397: the kernel itself (/sys) and the user programs
398: (/usr/src and subdirectories).
399: The major part of this is /usr/src.
400: .PP
401: The three major libraries are the C library in /usr/src/lib/libc
402: and the \s-2FORTRAN\s0 libraries /usr/src/usr.lib/libI77 and
403: /usr/src/usr.lib/libF77. In each
404: case the library is remade by changing into the corresponding directory
405: and doing
406: .DS
407: \fB#\fP \fImake\fP
408: .DE
409: and then installed by
410: .DS
411: \fB#\fP \fImake install\fP
412: .DE
413: Similar to the system,
414: .DS
415: \fB#\fP \fImake clean\fP
416: .DE
417: cleans up.
418: .PP
419: The source for all other libraries is kept in subdirectories of
420: /usr/src/usr.lib; each has a makefile and can be recompiled by the above
421: recipe.
422: .PP
423: If you look at /usr/src/Makefile, you will see that
424: you can recompile the entire system source with one command.
425: To recompile a specific program, find
426: out where the source resides with the \fIwhereis\fP\|(1)
427: command, then change to that directory and remake it
428: with the Makefile present in the directory.
429: For instance, to recompile ``date'',
430: all one has to do is
431: .DS
432: \fB#\fP \fIwhereis date\fP
433: \fBdate: /usr/src/bin/date.c /bin/date\fP
434: \fB#\fP \fIcd /usr/src/bin\fP
435: \fB#\fP \fImake date\fP
436: .DE
437: this will create an unstripped version of the binary of ``date''
438: in the current directory. To install the binary image, use the
439: install command as in
440: .DS
441: \fB#\fP \fIinstall \-s date -o bin -g bin -m 755 /bin/date\fP
442: .DE
443: The \-s option will insure the installed version of date has
444: its symbol table stripped. The install command should be used
445: instead of mv or cp as it understands how to install programs
446: even when the program is currently in use.
447: .PP
448: If you wish to recompile and install all programs in a particular
449: target area you can override the default target by doing:
450: .DS
451: \fB#\fP \fImake\fP
452: \fB#\fP \fImake DESTDIR=\fPpathname \fIinstall\fP
453: .DE
454: .PP
455: To regenerate all the system source you can do
456: .DS
457: \fB#\fP \fIcd /usr/src\fP
458: \fB#\fP \fImake clean; make depend; make\fP
459: .DE
460: .PP
461: If you modify the C library, say to change a system call,
462: and want to rebuild and install everything from scratch you
463: have to be a little careful.
464: You must insure that the libraries are installed before the
465: remainder of the source, otherwise the loaded images will not
466: contain the new routine from the library. The following
467: sequence will accomplish this.
468: .DS
469: \fB#\fP \fIcd /usr/src\fP
470: \fB#\fP \fImake clean\fP
471: \fB#\fP \fImake depend\fP
472: \fB#\fP \fImake build\fP
473: \fB#\fP \fImake installsrc\fP
474: .DE
475: The \fImake clean\fP removes any existing binary or object files in the source
476: trees to insure that everything will be recompiled and reloaded. The \fImake
477: depend\fP recreates all of the dependencies. See \fImkdep\fP(1) for
478: further details. The \fImake build\fP compiles and installs the libraries
479: and compilers, then recompiles the libraries and compilers and the remainder
480: of the sources. The \fImake installsrc\fP installs all of the commands not
481: installed as part of the \fImake build\fP.
482: .if \n(Th \{\
483: This will take approximately 10
484: hours on a reasonably configured Tahoe.
485: .\}
486: .NH 2
487: Making local modifications
488: .PP
489: Locally written commands that aren't distributed are kept in /usr/src/local
490: and their binaries are kept in /usr/local. This allows /usr/bin, /usr/ucb,
491: and /bin to correspond to the distribution tape (and to the manuals that
492: people can buy). People using local commands should be made aware that
493: they aren't in the base manual. Manual pages for local commands should be
494: installed in /usr/src/local/man and installed in /usr/local/man/cat[1-8].
495: The \fIman\fP(1) command automatically finds manual pages placed in
496: /usr/local/man/cat[1-8] to facilitate this practice.
497: .NH 2
498: Accounting
499: .PP
500: UNIX optionally records two kinds of accounting information:
501: connect time accounting and process resource accounting. The connect
502: time accounting information is stored in the file \fI/usr/adm/wtmp\fP, which
503: is summarized by the program
504: .IR ac (8).
505: The process time accounting information is stored in the file
506: \fI/usr/adm/acct\fP after it is enabled by
507: .IR accton (8),
508: and is analyzed and summarized by the program
509: .IR sa (8).
510: .PP
511: If you need to recharge for computing time, you can develop
512: procedures based on the information provided by these commands.
513: A convenient way to do this is to give commands to the clock daemon
514: .I /etc/cron
515: to be executed every day at a specified time. This is done by adding
516: lines to \fI/usr/adm/crontab\fP; see
517: .IR cron (8)
518: for details.
519: .NH 2
520: Resource control
521: .PP
522: Resource control in the current version of UNIX is more
523: elaborate than in most UNIX systems. The disk quota
524: facilities developed at the University of Melbourne have
525: been incorporated in the system and allow control over the
526: number of files and amount of disk space each user may use
527: on each file system. In addition, the resources consumed
528: by any single process can be limited by the mechanisms of
529: \fIsetrlimit\fP\|(2). As distributed, the latter mechanism
530: is voluntary, though sites may choose to modify the login
531: mechanism to impose limits not covered with disk quotas.
532: .PP
533: To use the disk quota facilities, the system must be
534: configured with ``options QUOTA''. File systems may then
535: be placed under the quota mechanism by creating a null file
536: .I quotas
537: at the root of the file system, running
538: .IR quotacheck (8),
539: and modifying \fI/etc/fstab\fP to show that the file system is read-write
540: with disk quotas (an ``rq'' type field). The
541: .IR quotaon (8)
542: program may then be run to enable quotas.
543: .PP
544: Individual quotas are applied by using the quota editor
545: .IR edquota (8).
546: Users may view their quotas (but not those of other users) with the
547: .IR quota (1)
548: program. The
549: .IR repquota (8)
550: program may be used to summarize the quotas and current
551: space usage on a particular file system or file systems.
552: .PP
553: Quotas are enforced with
554: .I soft
555: and
556: .I hard
557: limits. When a user first reaches a soft limit on a resource, a
558: message is generated on his/her terminal. If the user fails to
559: lower the resource usage below the soft limit the next time
560: they log in to the system the
561: .I login
562: program will generate a warning about excessive usage. Should
563: three login sessions go by with the soft limit breached the
564: system then treats the soft limit as a
565: .I hard
566: limit and disallows any allocations until enough space is
567: reclaimed to bring the user back below the soft limit. Hard
568: limits are enforced strictly resulting in errors when a user
569: tries to create or write a file. Each time a hard limit is
570: exceeded the system will generate a message on the user's
571: terminal.
572: .PP
573: Consult the auxiliary document, ``Disc Quotas in a UNIX Environment''
574: and the appropriate manual entries for more information.
575: .NH 2
576: Network troubleshooting
577: .PP
578: If you have anything more than a trivial network configuration,
579: from time to time you are bound to run into problems. Before
580: blaming the software, first check your network connections. On
581: networks such as the Ethernet a
582: loose cable tap or misplaced power cable can result in severely
583: deteriorated service. The \fInetstat\fP\|(1) program may be of
584: aid in tracking down hardware malfunctions. In particular, look
585: at the \fB\-i\fP and \fB\-s\fP options in the manual page.
586: .PP
587: Should you believe a communication protocol problem exists,
588: consult the protocol specifications and attempt to isolate the
589: problem in a packet trace. The SO_DEBUG option may be supplied
590: before establishing a connection on a socket, in which case the
591: system will trace all traffic and internal actions (such as timers
592: expiring) in a circular trace buffer. This buffer may then
593: be printed out with the \fItrpt\fP\|(8C) program. Most of the
594: servers distributed with the system accept a \fB\-d\fP option forcing
595: all sockets to be created with debugging turned on. Consult the
596: appropriate manual pages for more information.
597: .NH 2
598: Files that need periodic attention
599: .PP
600: We conclude the discussion of system operations by listing
601: the files that require periodic attention or are system specific:
602: .de BP
603: .IP \fB\\$1\fP
604: .br
605: ..
606: .TS
607: center;
608: lb a.
609: /etc/fstab how disk partitions are used
610: /etc/disktab default disk partition sizes/labels
611: /etc/printcap printer data base
612: /etc/gettytab terminal type definitions
613: /etc/remote names and phone numbers of remote machines for \fItip\fP(1)
614: /etc/group group memberships
615: /etc/motd message of the day
616: /etc/passwd password file; each account has a line
617: /etc/rc.local local system restart script; runs reboot; starts daemons
618: /etc/inetd.conf local internet servers
619: /etc/hosts host name data base
620: /etc/networks network name data base
621: /etc/services network services data base
622: /etc/hosts.equiv hosts under same administrative control
623: /etc/syslog.conf error log configuration for \fIsyslogd\fP\|(8)
624: /etc/ttys enables/disables ports
625: /usr/lib/crontab commands that are run periodically
626: /usr/lib/aliases mail forwarding and distribution groups
627: /usr/adm/acct raw process account data
628: /usr/adm/messages system error log
629: /usr/adm/wtmp login session accounting
630: .TE
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.