]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - share/doc/smm/01.setup/3.t
Remove $FreeBSD$: two-line nroff pattern
[FreeBSD/FreeBSD.git] / share / doc / smm / 01.setup / 3.t
1 .\" Copyright (c) 1980, 1986, 1988, 1993
2 .\"      The Regents of the University of California.  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. Neither the name of the University nor the names of its contributors
13 .\"    may be used to endorse or promote products derived from this software
14 .\"    without specific prior written permission.
15 .\"
16 .\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
17 .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18 .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
19 .\" ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
20 .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
21 .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
22 .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
23 .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
24 .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
25 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
26 .\" SUCH DAMAGE.
27 .\"     @(#)3.t 8.1 (Berkeley) 7/27/93
28 .\"
29 .ds lq ``
30 .ds rq ''
31 .ds RH "Upgrading a \*(Ps System
32 .ds CF \*(Dy
33 .Sh 1 "Upgrading a \*(Ps system"
34 .PP
35 This section describes the procedure for upgrading a \*(Ps
36 system to \*(4B.  This procedure may vary according to the version of
37 the system running before conversion.
38 If you are converting from a
39 System V system, some of this section will still apply (in particular,
40 the filesystem conversion).  However, many of the system configuration
41 files are different, and the executable file formats are completely
42 incompatible.
43 .PP
44 In particular be wary when using this information to upgrade
45 a \*(Ps HP300 system.
46 There are at least four different versions of ``\*(Ps'' out there:
47 .IP 1)
48 HPBSD 1.x from Utah.
49 .br
50 This was the original version of \*(Ps for HP300s from which the
51 other variants (and \*(4B) are derived.
52 It is largely a \*(Ps system with Sun's NFS 3.0 filesystem code and
53 some \*(Ps-Tahoe features (e.g. networking code).
54 Since the filesystem code is 4.2/4.3 vintage and the filesystem
55 hierarchy is largely \*(Ps, most of this section should apply.
56 .IP 2)
57 MORE/bsd from Mt. Xinu.
58 .br
59 This is a \*(Ps-Tahoe vintage system with Sun's NFS 4.0 filesystem code
60 upgraded with Tahoe UFS features.
61 The instructions for \*(Ps-Tahoe should largely apply.
62 .IP 3)
63 \*(Ps-Reno from CSRG.
64 .br
65 At least one site bootstrapped HP300 support from the Reno distribution.
66 The Reno filesystem code was somewhere between \*(Ps and \*(4B: the VFS switch
67 had been added but many of the UFS features (e.g. ``inline'' symlinks)
68 were missing.
69 The filesystem hierarchy reorganization first appeared in this release.
70 Be extremely careful following these instructions if you are
71 upgrading from the Reno distribution.
72 .IP 4)
73 HPBSD 2.0 from Utah.
74 .br
75 As if things were not bad enough already,
76 this release has the \*(4B filesystem and networking code
77 as well as some utilities, but still has a \*(Ps hierarchy.
78 No filesystem conversions are necessary for this upgrade,
79 but files will still need to be moved around.
80 .Sh 2 "Installation overview"
81 .PP
82 If you are running \*(Ps, upgrading your system
83 involves replacing your kernel and system utilities.
84 In general, there are three possible ways to install a new \*(Bs distribution:
85 (1) boot directly from the distribution tape, use it to load new binaries
86 onto empty disks, and then merge or restore any existing configuration files
87 and filesystems;
88 (2) use an existing \*(Ps or later system to extract the root and
89 .Pn /usr
90 filesystems from the distribution tape,
91 boot from the new system, then merge or restore existing
92 configuration files and filesystems; or
93 (3) extract the sources from the distribution tape onto an existing system,
94 and use that system to cross-compile and install \*(4B.
95 For this release, the second alternative is strongly advised,
96 with the third alternative reserved as a last resort.
97 In general, older binaries will continue to run under \*(4B,
98 but there are many exceptions that are on the critical path
99 for getting the system running.
100 Ideally, the new system binaries (root and
101 .Pn /usr
102 filesystems) should be installed on spare disk partitions,
103 then site-specific files should be merged into them.
104 Once the new system is up and fully merged, the previous root and
105 .Pn /usr
106 filesystems can be reused.
107 Other existing filesystems can be retained and used,
108 except that (as usual) the new
109 .Xr fsck
110 should be run before they are mounted.
111 .PP
112 It is \fBSTRONGLY\fP advised that you make full dumps of each filesystem
113 before beginning, especially any that you intend to modify in place
114 during the merge.
115 It is also desirable to run filesystem checks
116 of all filesystems to be converted to \*(4B before shutting down.
117 This is an excellent time to review your disk configuration
118 for possible tuning of the layout.
119 Most systems will need to provide a new filesystem for system use
120 mounted on
121 .Pn /var
122 (see below).
123 However, the
124 .Pn /tmp
125 filesystem can be an MFS virtual-memory-resident filesystem,
126 potentially freeing an existing disk partition.
127 (Additional swap space may be desirable as a consequence.)
128 See
129 .Xr mount_mfs (8).
130 .PP
131 The recommended installation procedure includes the following steps.
132 The order of these steps will probably vary according to local needs.
133 .IP \(bu
134 Extract root and
135 .Pn /usr
136 filesystems from the distribution tapes.
137 .IP \(bu
138 Extract kernel and/or user-level sources from the distribution tape
139 if space permits.
140 This can serve as the backup documentation as needed.
141 .IP \(bu
142 Configure and boot a kernel for the local system.
143 This can be delayed if the generic kernel from the distribution
144 supports enough hardware to proceed.
145 .IP \(bu
146 Build a skeletal
147 .Pn /var
148 filesystem (see
149 .Xr mtree (8)).
150 .IP \(bu
151 Merge site-dependent configuration files from
152 .Pn /etc
153 and
154 .Pn /usr/lib
155 into the new
156 .Pn /etc
157 directory.
158 Note that many file formats and contents have changed; see section 3.4
159 of this document.
160 .IP \(bu
161 Copy or merge files from
162 .Pn /usr/adm ,
163 .Pn /usr/spool ,
164 .Pn /usr/preserve ,
165 .Pn /usr/lib ,
166 and other locations into
167 .Pn /var .
168 .IP \(bu
169 Merge local macros, dictionaries, etc. into
170 .Pn /usr/share .
171 .IP \(bu
172 Merge and update local software to reflect the system changes.
173 .IP \(bu
174 Take off the rest of the morning, you've earned it!
175 .PP
176 Section 3.2 lists the files to be saved as part of the conversion process.
177 Section 3.3 describes the bootstrap process.
178 Section 3.4 discusses the merger of the saved files back into the new system.
179 Section 3.5 gives an overview of the major
180 bug fixes and changes between \*(Ps and \*(4B.
181 Section 3.6 provides general hints on possible problems to be
182 aware of when converting from \*(Ps to \*(4B.
183 .Sh 2 "Files to save"
184 .PP
185 The following list enumerates the standard set of files you will want to
186 save and suggests directories in which site-specific files should be present.
187 This list will likely be augmented with non-standard files you
188 have added to your system.
189 If you do not have enough space to create parallel
190 filesystems, you should create a
191 .Xr tar
192 image of the following files before the new filesystems are created.
193 The rest of this subsection describes where theses files
194 have moved and how they have changed.
195 .TS
196 lfC c l.
197 /.cshrc \(dg    root csh startup script (moves to \f(CW/root/.cshrc\fP)
198 /.login \(dg    root csh login script (moves to \f(CW/root/.login\fP)
199 /.profile       \(dg    root sh startup script (moves to \f(CW/root/.profile\fP)
200 /.rhosts        \(dg    for trusted machines and users (moves to \f(CW/root/.rhosts\fP)
201 /etc/disktab    \(dd    in case you changed disk partition sizes
202 /etc/fstab      *       disk configuration data
203 /etc/ftpusers   \(dg    for local additions
204 /etc/gettytab   \(dd    getty database
205 /etc/group      *       group data base
206 /etc/hosts      \(dg    for local host information
207 /etc/hosts.equiv        \(dg    for local host equivalence information
208 /etc/hosts.lpd  \(dg    printer access file
209 /etc/inetd.conf *       Internet services configuration data
210 /etc/named*     \(dg    named configuration files
211 /etc/netstart   \(dg    network initialization
212 /etc/networks   \(dg    for local network information
213 /etc/passwd     *       user data base
214 /etc/printcap   *       line printer database
215 /etc/protocols  \(dd    in case you added any local protocols
216 /etc/rc *       for any local additions
217 /etc/rc.local   *       site specific system startup commands
218 /etc/remote     \(dg    auto-dialer configuration
219 /etc/services   \(dd    for local additions
220 /etc/shells     \(dd    list of valid shells
221 /etc/syslog.conf        *       system logger configuration
222 /etc/securettys *       merged into ttys
223 /etc/ttys       *       terminal line configuration data
224 /etc/ttytype    *       merged into ttys
225 /etc/termcap    \(dd    for any local entries that may have been added
226 /lib    \(dd    for any locally developed language processors
227 /usr/dict/*     \(dd    for local additions to words and papers
228 /usr/include/*  \(dd    for local additions
229 /usr/lib/aliases        *       mail forwarding data base (moves to \f(CW/etc/aliases\fP)
230 /usr/lib/crontab        *       cron daemon data base (moves to \f(CW/etc/crontab\fP)
231 /usr/lib/crontab.local  *       local cron daemon data base (moves to \f(CW/etc/crontab.local\fP)
232 /usr/lib/lib*.a \(dg    for local libraries
233 /usr/lib/mail.rc        \(dg    system-wide mail(1) initialization (moves to \f(CW/etc/mail.rc\fP)
234 /usr/lib/sendmail.cf    *       sendmail configuration (moves to \f(CW/etc/sendmail.cf\fP)
235 /usr/lib/tmac/* \(dd    for locally developed troff/nroff macros (moves to \f(CW/usr/share/tmac/*\fP)
236 /usr/lib/uucp/* \(dg    for local uucp configuration files
237 /usr/man/manl   *       for manual pages for locally developed programs (moves to \f(CW/usr/local/man\fP)
238 /usr/spool/*    \(dg    for current mail, news, uucp files, etc. (moves to \f(CW/var/spool\fP)
239 /usr/src/local  \(dg    for source for locally developed programs
240 /sys/conf/HOST  \(dg    configuration file for your machine (moves to \f(CW/sys/<arch>/conf\fP)
241 /sys/conf/files.HOST    \(dg    list of special files in your kernel (moves to \f(CW/sys/<arch>/conf\fP)
242 /*/quotas       *       filesystem quota files (moves to \f(CW/*/quotas.user\fP)
243 .TE
244 .DS
245 \(dg\|Files that can be used from \*(Ps without change.
246 \(dd\|Files that need local changes merged into \*(4B files.
247 *\|Files that require special work to merge and are discussed in section 3.4.
248 .DE
249 .Sh 2 "Installing \*(4B"
250 .PP
251 The next step is to build a working \*(4B system.
252 This can be done by following the steps in section 2 of
253 this document for extracting the root and
254 .Pn /usr
255 filesystems from the distribution tape onto unused disk partitions.
256 For the SPARC, the root filesystem dump on the tape could also be
257 extracted directly.
258 For the HP300 and DECstation, the raw disk image can be copied
259 into an unused partition and this partition can then be dumped
260 to create an image that can be restored.
261 The exact procedure chosen will depend on the disk configuration
262 and the number of suitable disk partitions that may be used.
263 It is also desirable to run filesystem checks
264 of all filesystems to be converted to \*(4B before shutting down.
265 In any case, this is an excellent time to review your disk configuration
266 for possible tuning of the layout.
267 Section 2.5 and
268 .Xr config (8)
269 are required reading.
270 .LP
271 The filesystem in \*(4B has been reorganized in an effort to
272 meet several goals:
273 .IP 1)
274 The root filesystem should be small.
275 .IP 2)
276 There should be a per-architecture centrally-shareable read-only
277 .Pn /usr
278 filesystem.
279 .IP 3)
280 Variable per-machine directories should be concentrated below
281 a single mount point named
282 .Pn /var .
283 .IP 4)
284 Site-wide machine independent shareable text files should be separated
285 from architecture specific binary files and should be concentrated below
286 a single mount point named
287 .Pn /usr/share .
288 .LP
289 These goals are realized with the following general layouts.
290 The reorganized root filesystem has the following directories:
291 .TS
292 lfC l.
293 /etc    (config files)
294 /bin    (user binaries needed when single-user)
295 /sbin   (root binaries needed when single-user)
296 /local  (locally added binaries used only by this machine)
297 /tmp    (mount point for memory based filesystem)
298 /dev    (local devices)
299 /home   (mount point for AMD)
300 /var    (mount point for per-machine variable directories)
301 /usr    (mount point for multiuser binaries and files)
302 .TE
303 .LP
304 The reorganized
305 .Pn /usr
306 filesystem has the following directories:
307 .TS
308 lfC l.
309 /usr/bin        (user binaries)
310 /usr/contrib    (software contributed to \*(4B)
311 /usr/games      (binaries for games, score files in \f(CW/var\fP)
312 /usr/include    (standard include files)
313 /usr/lib        (lib*.a from old \f(CW/usr/lib\fP)
314 /usr/libdata    (databases from old \f(CW/usr/lib\fP)
315 /usr/libexec    (executables from old \f(CW/usr/lib\fP)
316 /usr/local      (locally added binaries used site-wide)
317 /usr/old        (deprecated binaries)
318 /usr/sbin       (root binaries)
319 /usr/share      (mount point for site-wide shared text)
320 /usr/src        (mount point for sources)
321 .TE
322 .LP
323 The reorganized
324 .Pn /usr/share
325 filesystem has the following directories:
326 .TS
327 lfC l.
328 /usr/share/calendar     (various useful calendar files)
329 /usr/share/dict (dictionaries)
330 /usr/share/doc  (\*(4B manual sources)
331 /usr/share/games        (games text files)
332 /usr/share/groff_font   (groff font information)
333 /usr/share/man  (typeset manual pages)
334 /usr/share/misc (dumping ground for random text files)
335 /usr/share/mk   (templates for \*(4B makefiles)
336 /usr/share/skel (template user home directory files)
337 /usr/share/tmac (various groff macro packages)
338 /usr/share/zoneinfo     (information on time zones)
339 .TE
340 .LP
341 The reorganized
342 .Pn /var
343 filesystem has the following directories:
344 .TS
345 lfC l.
346 /var/account    (accounting files, formerly \f(CW/usr/adm\fP)
347 /var/at (\fIat\fP\|(1) spooling area)
348 /var/backups    (backups of system files)
349 /var/crash      (crash dumps)
350 /var/db (system-wide databases, e.g. tags)
351 /var/games      (score files)
352 /var/log        (log files)
353 /var/mail       (users mail)
354 /var/obj        (hierarchy to build \f(CW/usr/src\fP)
355 /var/preserve   (preserve area for vi)
356 /var/quotas     (directory to store quota files)
357 /var/run        (directory to store *.pid files)
358 /var/rwho       (rwho databases)
359 /var/spool/ftp  (home directory for anonymous ftp)
360 /var/spool/mqueue       (sendmail spooling directory)
361 /var/spool/news (news spooling area)
362 /var/spool/output       (printer spooling area)
363 /var/spool/uucp (uucp spooling area)
364 /var/tmp        (disk-based temporary directory)
365 /var/users      (root of per-machine user home directories)
366 .TE
367 .PP
368 The \*(4B bootstrap routines pass the identity of the boot device
369 through to the kernel.
370 The kernel then uses that device as its root filesystem.
371 Thus, for example, if you boot from
372 .Pn /dev/\*(Dk1a ,
373 the kernel will use
374 .Pn \*(Dk1a
375 as its root filesystem. If
376 .Pn /dev/\*(Dk1b
377 is configured as a swap partition,
378 it will be used as the initial swap area,
379 otherwise the normal primary swap area (\c
380 .Pn /dev/\*(Dk0b )
381 will be used.
382 The \*(4B bootstrap is backward compatible with \*(Ps,
383 so you can replace your old bootstrap if you use it
384 to boot your first \*(4B kernel.
385 However, the \*(Ps bootstrap cannot access \*(4B filesystems,
386 so if you plan to convert your filesystems to \*(4B,
387 you must install a new bootstrap \fIbefore\fP doing the conversion.
388 Note that SPARC users cannot build a \*(4B compatible version
389 of the bootstrap, so must \fInot\fP convert their root filesystem
390 to the new \*(4B format.
391 .PP
392 Once you have extracted the \*(4B system and booted from it,
393 you will have to build a kernel customized for your configuration.
394 If you have any local device drivers,
395 they will have to be incorporated into the new kernel.
396 See section 4.1.3 and ``Building 4.3BSD UNIX Systems with Config'' (SMM:2).
397 .PP
398 If converting from \*(Ps, your old filesystems should be converted.
399 If you've modified the partition
400 sizes from the original \*(Ps ones, and are not already using the
401 \*(4B disk labels, you will have to modify the default disk partition
402 tables in the kernel.  Make the necessary table changes and boot
403 your custom kernel \fBBEFORE\fP trying to access any of your old
404 filesystems!  After doing this, if necessary, the remaining filesystems
405 may be converted in place by running the \*(4B version of
406 .Xr fsck (8)
407 on each filesystem and allowing it to make the necessary corrections.
408 The new version of
409 .Xr fsck
410 is more strict about the size of directories than
411 the version supplied with \*(Ps.
412 Thus the first time that it is run on a \*(Ps filesystem,
413 it will produce messages of the form:
414 .DS
415 \fBDIRECTORY ...: LENGTH\fP xx \fBNOT MULTIPLE OF 512 (ADJUSTED)\fP
416 .DE
417 Length ``xx'' will be the size of the directory;
418 it will be expanded to the next multiple of 512 bytes.
419 The new
420 .Xr fsck
421 will also set default \fIinterleave\fP and
422 \fInpsect\fP (number of physical sectors per track) values on older
423 filesystems, in which these fields were unused spares; this correction
424 will produce messages of the form:
425 .DS
426 \fBIMPOSSIBLE INTERLEAVE=0 IN SUPERBLOCK (SET TO DEFAULT)\fP\**
427 \fBIMPOSSIBLE NPSECT=0 IN SUPERBLOCK (SET TO DEFAULT)\fP
428 .DE
429 .FS
430 The defaults are to set \fIinterleave\fP to 1 and
431 \fInpsect\fP to \fInsect\fP.
432 This is correct on most drives;
433 it affects only performance (usually virtually unmeasurably).
434 .FE
435 Filesystems that have had their interleave and npsect values
436 set will be diagnosed by the old
437 .Xr fsck
438 as having a bad superblock; the old
439 .Xr fsck
440 will run only if given an alternate superblock
441 (\fIfsck \-b32\fP),
442 in which case it will re-zero these fields.
443 The \*(4B kernel will internally set these fields to their defaults
444 if fsck has not done so; again, the \fI\-b32\fP option may be
445 necessary for running the old
446 .Xr fsck .
447 .PP
448 In addition, \*(4B removes several limits on filesystem sizes
449 that were present in \*(Ps.
450 The limited filesystems
451 continue to work in \*(4B, but should be converted
452 as soon as it is convenient
453 by running
454 .Xr fsck
455 with the \fI\-c 2\fP option.
456 The sequence \fIfsck \-p \-c 2\fP will update them all,
457 fix the interleave and npsect fields,
458 fix any incorrect directory lengths,
459 expand maximum uid's and gid's to 32-bits,
460 place symbolic links less than 60 bytes into their inode,
461 and fill in directory type fields all at once.
462 The new filesystem formats are incompatible with older systems.
463 If you wish to continue using these filesystems with the older
464 systems you should make only the compatible changes using
465 \fIfsck \-c 1\fP.
466 .Sh 2 "Merging your files from \*(Ps into \*(4B"
467 .PP
468 When your system is booting reliably and you have the \*(4B root and
469 .Pn /usr
470 filesystems fully installed you will be ready
471 to continue with the next step in the conversion process,
472 merging your old files into the new system.
473 .PP
474 If you saved the files on a
475 .Xr tar
476 tape, extract them into a scratch directory, say
477 .Pn /usr/convert :
478 .DS
479 \fB#\fP \fImkdir /usr/convert\fP
480 \fB#\fP \fIcd /usr/convert\fP
481 \fB#\fP \fItar xp\fP
482 .DE
483 .PP
484 The data files marked in the previous table with a dagger (\(dg)
485 may be used without change from the previous system.
486 Those data files marked with a double dagger (\(dd) have syntax
487 changes or substantial enhancements.
488 You should start with the \*(4B version and carefully
489 integrate any local changes into the new file.
490 Usually these local changes can be incorporated
491 without conflict into the new file;
492 some exceptions are noted below.
493 The files marked with an asterisk (*) require
494 particular attention and are discussed below.
495 .PP
496 As described in section 3.3,
497 the most immediately obvious change in \*(4B is the reorganization
498 of the system filesystems.
499 Users of certain recent vendor releases have seen this general organization,
500 although \*(4B takes the reorganization a bit further.
501 The directories most affected are
502 .Pn /etc ,
503 that now contains only system configuration files;
504 .Pn /var ,
505 a new filesystem containing per-system spool and log files; and
506 .Pn /usr/share,
507 that contains most of the text files shareable across architectures
508 such as documentation and macros.
509 System administration programs formerly in
510 .Pn /etc
511 are now found in
512 .Pn /sbin
513 and
514 .Pn /usr/sbin .
515 Various programs and data files formerly in
516 .Pn /usr/lib
517 are now found in
518 .Pn /usr/libexec
519 and
520 .Pn /usr/libdata ,
521 respectively.
522 Administrative files formerly in
523 .Pn /usr/adm
524 are in
525 .Pn /var/account
526 and, similarly, log files are now in
527 .Pn /var/log .
528 The directory
529 .Pn /usr/ucb
530 has been merged into
531 .Pn /usr/bin ,
532 and the sources for programs in
533 .Pn /usr/bin
534 are in
535 .Pn /usr/src/usr.bin .
536 Other source directories parallel the destination directories;
537 .Pn /usr/src/etc
538 has been greatly expanded, and
539 .Pn /usr/src/share
540 is new.
541 The source for the manual pages, in general, are with the source
542 code for the applications they document.
543 Manual pages not closely corresponding to an application program
544 are found in
545 .Pn /usr/src/share/man .
546 The locations of all man pages is listed in
547 .Pn /usr/src/share/man/man0/man[1-8] .
548 The manual page
549 .Xr hier (7)
550 has been updated and made more detailed;
551 it is included in the printed documentation.
552 You should review it to familiarize yourself with the new layout.
553 .PP
554 A new utility,
555 .Xr mtree (8),
556 is provided to build and check filesystem hierarchies
557 with the proper contents, owners and permissions.
558 Scripts are provided in
559 .Pn /etc/mtree
560 (and
561 .Pn /usr/src/etc/mtree )
562 for the root,
563 .Pn /usr
564 and
565 .Pn /var
566 filesystems.
567 Once a filesystem has been made for
568 .Pn /var ,
569 .Xr mtree
570 can be used to create a directory hierarchy there
571 or you can simply use tar to extract the prototype from
572 the second file of the distribution tape.
573 .Sh 3 "Changes in the \f(CW/etc\fP directory"
574 .PP
575 The
576 .Pn /etc
577 directory now contains nearly all the host-specific configuration
578 files.
579 Note that some file formats have changed,
580 and those configuration files containing pathnames are nearly all affected
581 by the reorganization.
582 See the examples provided in
583 .Pn /etc
584 (installed from
585 .Pn /usr/src/etc )
586 as a guide.
587 The following table lists some of the local configuration files
588 whose locations and/or contents have changed.
589 .TS
590 l l l
591 lfC lfC l.
592 \*(Ps and Earlier       \*(4B   Comments
593 _       _       _
594 /etc/fstab      /etc/fstab      new format; see below
595 /etc/inetd.conf /etc/inetd.conf pathnames of executables changed
596 /etc/printcap   /etc/printcap   pathnames changed
597 /etc/syslog.conf        /etc/syslog.conf        pathnames of log files changed
598 /etc/ttys       /etc/ttys       pathnames of executables changed
599 /etc/passwd     /etc/master.passwd      new format; see below
600 /usr/lib/sendmail.cf    /etc/sendmail.cf        changed pathnames
601 /usr/lib/aliases        /etc/aliases    may contain changed pathnames
602 /etc/*.pid      /var/run/*.pid
603
604 .T&
605 l l l
606 lfC lfC l.
607 New in \*(Ps-Tahoe      \*(4B   Comments
608 _       _       _
609 /usr/games/dm.config    /etc/dm.conf    configuration for games (see \fIdm\fP\|(8))
610 /etc/zoneinfo/localtime /etc/localtime  timezone configuration
611 /etc/zoneinfo   /usr/share/zoneinfo     timezone configuration
612 .TE
613 .ne 1.5i
614 .TS
615 l l l
616 lfC lfC l.
617         New in \*(4B    Comments
618 _       _       _
619         /etc/aliases.db database version of the aliases file
620         /etc/amd-home   location database of home directories
621         /etc/amd-vol    location database of exported filesystems
622         /etc/changelist \f(CW/etc/security\fP files to back up
623         /etc/csh.cshrc  system-wide csh(1) initialization file
624         /etc/csh.login  system-wide csh(1) login file
625         /etc/csh.logout system-wide csh(1) logout file
626         /etc/disklabels directory for saving disklabels
627         /etc/exports    NFS list of export permissions
628         /etc/ftpwelcome message displayed for ftp users; see ftpd(8)
629         /etc/man.conf   lists directories searched by \fIman\fP\|(1)
630         /etc/mtree      directory for local mtree files; see mtree(8)
631         /etc/netgroup   NFS group list used in \f(CW/etc/exports\fP
632         /etc/pwd.db     non-secure hashed user data base file
633         /etc/spwd.db    secure hashed user data base file
634         /etc/security   daily system security checker
635 .TE
636 .PP
637 System security changes require adding several new ``well-known'' groups to
638 .Pn /etc/group .
639 The groups that are needed by the system as distributed are:
640 .TS
641 l n l.
642 name    number  purpose
643 _
644 wheel   0       users allowed superuser privilege
645 daemon  1       processes that need less than wheel privilege
646 kmem    2       read access to kernel memory
647 sys     3       access to kernel sources
648 tty     4       access to terminals
649 operator        5       read access to raw disks
650 bin     7       group for system binaries
651 news    8       group for news
652 wsrc    9       write access to sources
653 games   13      access to games
654 staff   20      system staff
655 guest   31      system guests
656 nobody  39      the least privileged group
657 utmp    45      access to utmp files
658 dialer  117     access to remote ports and dialers
659 .TE
660 Only users in the ``wheel'' group are permitted to
661 .Xr su
662 to ``root''.
663 Most programs that manage directories in
664 .Pn /var/spool
665 now run set-group-id to ``daemon'' so that users cannot
666 directly access the files in the spool directories.
667 The special files that access kernel memory,
668 .Pn /dev/kmem
669 and
670 .Pn /dev/mem ,
671 are made readable only by group ``kmem''.
672 Standard system programs that require this access are
673 made set-group-id to that group.
674 The group ``sys'' is intended to control access to kernel sources,
675 and other sources belong to group ``wsrc.''
676 Rather than make user terminals writable by all users,
677 they are now placed in group ``tty'' and made only group writable.
678 Programs that should legitimately have access to write on user terminals
679 such as
680 .Xr talkd
681 and
682 .Xr write
683 now run set-group-id to ``tty''.
684 The ``operator'' group controls access to disks.
685 By default, disks are readable by group ``operator'',
686 so that programs such as
687 .Xr dump
688 can access the filesystem information without being set-user-id to ``root''.
689 The
690 .Xr shutdown (8)
691 program is executable only by group operator
692 and is setuid to root so that members of group operator may shut down
693 the system without root access.
694 .PP
695 The ownership and modes of some directories have changed.
696 The
697 .Xr at
698 programs now run set-user-id ``root'' instead of ``daemon.''
699 Also, the uucp directory no longer needs to be publicly writable,
700 as
701 .Xr tip
702 reverts to privileged status to remove its lock files.
703 After copying your version of
704 .Pn /var/spool ,
705 you should do:
706 .DS
707 \fB#\fP \fIchown \-R root /var/spool/at\fP
708 \fB#\fP \fIchown \-R uucp:daemon /var/spool/uucp\fP
709 \fB#\fP \fIchmod \-R o\-w /var/spool/uucp\fP
710 .DE
711 .PP
712 The format of the cron table,
713 .Pn /etc/crontab ,
714 has been changed to specify the user-id that should be used to run a process.
715 The userid ``nobody'' is frequently useful for non-privileged programs.
716 Local changes are now put in a separate file,
717 .Pn /etc/crontab.local .
718 .PP
719 Some of the commands previously in
720 .Pn /etc/rc.local
721 have been moved to
722 .Pn /etc/rc ;
723 several new functions are now handled by
724 .Pn /etc/rc ,
725 .Pn /etc/netstart
726 and
727 .Pn /etc/rc.local .
728 You should look closely at the prototype version of these files
729 and read the manual pages for the commands contained in it
730 before trying to merge your local copy.
731 Note in particular that
732 .Xr ifconfig
733 has had many changes,
734 and that host names are now fully specified as domain-style names
735 (e.g., vangogh.CS.Berkeley.EDU) for the benefit of the name server.
736 .PP
737 Some of the commands previously in
738 .Pn /etc/daily
739 have been moved to
740 .Pn /etc/security ,
741 and several new functions have been added to
742 .Pn /etc/security
743 to do nightly security checks on the system.
744 The script
745 .Pn /etc/daily
746 runs
747 .Pn /etc/security
748 each night, and mails the output to the super-user.
749 Some of the checks done by
750 .Pn /etc/security
751 are:
752 .DS
753 \(bu Syntax errors in the password and group files.
754 \(bu Duplicate user and group names and id's.
755 \(bu Dangerous search paths and umask values for the superuser.
756 \(bu Dangerous values in various initialization files.
757 \(bu Dangerous .rhosts files.
758 \(bu Dangerous directory and file ownership or permissions.
759 \(bu Globally exported filesystems.
760 \(bu Dangerous owners or permissions for special devices.
761 .DE
762 In addition, it reports any changes to setuid and setgid files, special
763 devices, or the files in
764 .Pn /etc/changelist
765 since the last run of
766 .Pn /etc/security .
767 Backup copies of the files are saved in
768 .Pn /var/backups .
769 Finally, the system binaries are checksummed and their permissions
770 validated against the
771 .Xr mtree (8)
772 specifications in
773 .Pn /etc/mtree .
774 .PP
775 The C-library and system binaries on the distribution tape
776 are compiled with new versions of
777 .Xr gethostbyname
778 and
779 .Xr gethostbyaddr
780 that use the name server,
781 .Xr named (8).
782 If you have only a small network and are not connected
783 to a large network, you can use the distributed library routines without
784 any problems; they use a linear scan of the host table
785 .Pn /etc/hosts
786 if the name server is not running.
787 If you are on the Internet or have a large local network,
788 it is recommend that you set up
789 and use the name server.
790 For instructions on how to set up the necessary configuration files,
791 refer to ``Name Server Operations Guide for BIND'' (SMM:10).
792 Several programs rely on the host name returned by
793 .Xr gethostname
794 to determine the local domain name.
795 .PP
796 If you are using the name server, your
797 .Xr sendmail
798 configuration file will need some updates to accommodate it.
799 See the ``Sendmail Installation and Operation Guide'' (SMM:8) and
800 the sample
801 .Xr sendmail
802 configuration files in
803 .Pn /usr/src/usr.sbin/sendmail/cf .
804 The aliases file,
805 .Pn /etc/aliases
806 has also been changed to add certain well-known addresses.
807 .Sh 3 "Shadow password files"
808 .PP
809 The password file format adds change and expiration fields
810 and its location has changed to protect
811 the encrypted passwords stored there.
812 The actual password file is now stored in
813 .Pn /etc/master.passwd .
814 The hashed dbm password files do not contain encrypted passwords,
815 but contain the file offset to the entry with the password in
816 .Pn /etc/master.passwd
817 (that is readable only by root).
818 Thus, the
819 .Fn getpwnam
820 and
821 .Fn getpwuid
822 functions will no longer return an encrypted password string to non-root
823 callers.
824 An old-style passwd file is created in
825 .Pn /etc/passwd
826 by the
827 .Xr vipw (8)
828 and
829 .Xr pwd_mkdb (8)
830 programs.
831 See also
832 .Xr passwd (5).
833 .PP
834 Several new users have also been added to the group of ``well-known'' users in
835 .Pn /etc/passwd .
836 The current list is:
837 .DS
838 .TS
839 l c.
840 name    number
841 _
842 root    0
843 daemon  1
844 operator        2
845 bin     3
846 games   7
847 uucp    66
848 nobody  32767
849 .TE
850 .DE
851 The ``daemon'' user is used for daemon processes that
852 do not need root privileges.
853 The ``operator'' user-id is used as an account for dumpers
854 so that they can log in without having the root password.
855 By placing them in the ``operator'' group,
856 they can get read access to the disks.
857 The ``uucp'' login has existed long before \*(4B,
858 and is noted here just to provide a common user-id.
859 The password entry ``nobody'' has been added to specify
860 the user with least privilege.  The ``games'' user is a pseudo-user
861 that controls access to game programs.
862 .PP
863 After installing your updated password file, you must run
864 .Xr pwd_mkdb (8)
865 to create the password database.
866 Note that
867 .Xr pwd_mkdb (8)
868 is run whenever
869 .Xr vipw (8)
870 is run.
871 .Sh 3 "The \f(CW/var\fP filesystem"
872 .PP
873 The spooling directories saved on tape may be restored in their
874 eventual resting places without too much concern.  Be sure to
875 use the `\-p' option to
876 .Xr tar (1)
877 so that files are recreated with the same file modes.
878 The following commands provide a guide for copying spool and log files from
879 an existing system into a new
880 .Pn /var
881 filesystem.
882 At least the following directories should already exist on
883 .Pn /var :
884 .Pn output ,
885 .Pn log ,
886 .Pn backups
887 and
888 .Pn db .
889 .LP
890 .DS
891 .ft CW
892 SRC=/oldroot/usr
893
894 cd $SRC; tar cf - msgs preserve | (cd /var && tar xpf -)
895 .DE
896 .DS
897 .ft CW
898 # copy $SRC/spool to /var
899 cd $SRC/spool
900 tar cf - at mail rwho | (cd /var && tar xpf -)
901 tar cf - ftp mqueue news secretmail uucp uucppublic | \e
902         (cd /var/spool && tar xpf -)
903 .DE
904 .DS
905 .ft CW
906 # everything else in spool is probably a printer area
907 mkdir .save
908 mv at ftp mail mqueue rwho secretmail uucp uucppublic .save
909 tar cf - * | (cd /var/spool/output && tar xpf -)
910 mv .save/* .
911 rmdir .save
912 .DE
913 .DS
914 .ft CW
915 cd /var/spool/mqueue
916 mv syslog.7 /var/log/maillog.7
917 mv syslog.6 /var/log/maillog.6
918 mv syslog.5 /var/log/maillog.5
919 mv syslog.4 /var/log/maillog.4
920 mv syslog.3 /var/log/maillog.3
921 mv syslog.2 /var/log/maillog.2
922 mv syslog.1 /var/log/maillog.1
923 mv syslog.0 /var/log/maillog.0
924 mv syslog /var/log/maillog
925 .DE
926 .DS
927 .ft CW
928 # move $SRC/adm to /var
929 cd $SRC/adm
930 tar cf - . | (cd /var/account && tar  xpf -)
931 cd /var/account
932 rm -f msgbuf
933 mv messages messages.[0-9] ../log
934 mv wtmp wtmp.[0-9] ../log
935 mv lastlog ../log
936 .DE
937 .Sh 2 "Bug fixes and changes between \*(Ps and \*(4B"
938 .PP
939 The major new facilities available in the \*(4B release are
940 a new virtual memory system,
941 the addition of ISO/OSI networking support,
942 a new virtual filesystem interface supporting filesystem stacking,
943 a freely redistributable implementation of NFS,
944 a log-structured filesystem,
945 enhancement of the local filesystems to support
946 files and filesystems that are up to 2^63 bytes in size,
947 enhanced security and system management support,
948 and the conversion to and addition of the IEEE Std1003.1 (``POSIX'')
949 facilities and many of the IEEE Std1003.2 facilities.
950 In addition, many new utilities and additions to the C
951 library are present as well.
952 The kernel sources have been reorganized to collect all machine-dependent
953 files for each architecture under one directory,
954 and most of the machine-independent code is now free of code
955 conditional on specific machines.
956 The user structure and process structure have been reorganized
957 to eliminate the statically-mapped user structure and to make most
958 of the process resources shareable by multiple processes.
959 The system and include files have been converted to be compatible
960 with ANSI C, including function prototypes for most of the exported
961 functions.
962 There are numerous other changes throughout the system.
963 .Sh 3 "Changes to the kernel"
964 .PP
965 This release includes several important structural kernel changes.
966 The kernel uses a new internal system call convention;
967 the use of global (``u-dot'') variables for parameters and error returns
968 has been eliminated,
969 and interrupted system calls no longer abort using non-local goto's (longjmp's).
970 A new sleep interface separates signal handling from scheduling priority,
971 returning characteristic errors to abort or restart the current system call.
972 This sleep call also passes a string describing the process state,
973 that is used by the ps(1) program.
974 The old sleep interface can be used only for non-interruptible sleeps.
975 The sleep interface (\fItsleep\fP) can be used at any priority,
976 but is only interruptible if the PCATCH flag is set.
977 When interrupted, \fItsleep\fP returns EINTR or ERESTART.
978 .PP
979 Many data structures that were previously statically allocated
980 are now allocated dynamically.
981 These structures include mount entries, file entries,
982 user open file descriptors, the process entries, the vnode table,
983 the name cache, and the quota structures.
984 .PP
985 To protect against indiscriminate reading or writing of kernel
986 memory, all writing and most reading of kernel data structures
987 must be done using a new ``sysctl'' interface.
988 The information to be accessed is described through an extensible
989 ``Management Information Base'' (MIB) style name,
990 described as a dotted set of components.
991 A new utility,
992 .Xr sysctl (8),
993 retrieves kernel state and allows processes with appropriate
994 privilege to set kernel state.
995 .Sh 3 "Security"
996 .PP
997 The kernel runs with four different levels of security.
998 Any superuser process can raise the security level, but only
999 .Fn init (8)
1000 can lower it.
1001 Security levels are defined as follows:
1002 .IP \-1
1003 Permanently insecure mode \- always run system in level 0 mode.
1004 .IP "  0"
1005 Insecure mode \- immutable and append-only flags may be turned off.
1006 All devices may be read or written subject to their permissions.
1007 .IP "  1"
1008 Secure mode \- immutable and append-only flags may not be cleared;
1009 disks for mounted filesystems,
1010 .Pn /dev/mem ,
1011 and
1012 .Pn /dev/kmem
1013 are read-only.
1014 .IP "  2"
1015 Highly secure mode \- same as secure mode, plus disks are always
1016 read-only whether mounted or not.
1017 This level precludes tampering with filesystems by unmounting them,
1018 but also inhibits running
1019 .Xr newfs (8)
1020 while the system is multi-user.
1021 See
1022 .Xr chflags (1)
1023 and the \-\fBo\fP option to
1024 .Xr ls (1)
1025 for information on setting and displaying the immutable and append-only
1026 flags.
1027 .PP
1028 Normally, the system runs in level 0 mode while single user
1029 and in level 1 mode while multiuser.
1030 If the level 2 mode is desired while running multiuser,
1031 it can be set in the startup script
1032 .Pn /etc/rc
1033 using
1034 .Xr sysctl (1).
1035 If it is desired to run the system in level 0 mode while multiuser,
1036 the administrator must build a kernel with the variable
1037 .Li securelevel
1038 in the kernel source file
1039 .Pn /sys/kern/kern_sysctl.c
1040 initialized to \-1.
1041 .Sh 4 "Virtual memory changes"
1042 .PP
1043 The new virtual memory implementation is derived from the Mach
1044 operating system developed at Carnegie-Mellon,
1045 and was ported to the BSD kernel at the University of Utah.
1046 It is based on the 2.0 release of Mach
1047 (with some bug fixes from the 2.5 and 3.0 releases)
1048 and retains many of its essential features such as
1049 the separation of the machine dependent and independent layers
1050 (the ``pmap'' interface),
1051 efficient memory utilization using copy-on-write
1052 and other lazy-evaluation techniques,
1053 and support for large, sparse address spaces.
1054 It does not include the ``external pager'' interface instead using
1055 a primitive internal pager interface.
1056 The Mach virtual memory system call interface has been replaced with the
1057 ``mmap''-based interface described in the ``Berkeley Software
1058 Architecture Manual'' (see UNIX Programmer's Manual,
1059 Supplementary Documents, PSD:5).
1060 The interface is similar to the interfaces shipped
1061 by several commercial vendors such as Sun, USL, and Convex Computer Corp.
1062 The integration of the new virtual memory is functionally complete,
1063 but still has serious performance problems under heavy memory load.
1064 The internal kernel interfaces have not yet been completed
1065 and the memory pool and buffer cache have not been merged.
1066 Some additional caveats:
1067 .IP \(bu
1068 Since the code is based on the 2.0 release of Mach,
1069 bugs and misfeatures of the BSD version should not be considered
1070 short-comings of the current Mach virtual memory system.
1071 .IP \(bu
1072 Because of the disjoint virtual memory (page) and IO (buffer) caches,
1073 it is possible to see inconsistencies if using both the mmap and
1074 read/write interfaces on the same file simultaneously.
1075 .IP \(bu
1076 Swap space is allocated on-demand rather than up front and no
1077 allocation checks are performed so it is possible to over-commit
1078 memory and eventually deadlock.
1079 .IP \(bu
1080 The semantics of the
1081 .Xr vfork (2)
1082 system call are slightly different.
1083 The synchronization between parent and child is preserved,
1084 but the memory sharing aspect is not.
1085 In practice this has been enough for backward compatibility,
1086 but newer code should just use
1087 .Xr fork (2).
1088 .Sh 4 "Networking additions and changes"
1089 .PP
1090 The ISO/OSI Networking consists of a kernel implementation of
1091 transport class 4 (TP-4),
1092 connectionless networking protocol (CLNP),
1093 and 802.3-based link-level support (hardware-compatible with Ethernet\**).
1094 .FS
1095 Ethernet is a trademark of the Xerox Corporation.
1096 .FE
1097 We also include support for ISO Connection-Oriented Network Service,
1098 X.25, TP-0.
1099 The session and presentation layers are provided outside
1100 the kernel using the ISO Development Environment by Marshall Rose,
1101 that is available via anonymous FTP
1102 (but is not included on the distribution tape).
1103 Included in this development environment are file
1104 transfer and management (FTAM), virtual terminals (VT),
1105 a directory services implementation (X.500),
1106 and miscellaneous other utilities.
1107 .PP
1108 Kernel support for the ISO OSI protocols is enabled with the ISO option
1109 in the kernel configuration file.
1110 The
1111 .Xr iso (4)
1112 manual page describes the protocols and addressing;
1113 see also
1114 .Xr clnp (4),
1115 .Xr tp (4)
1116 and
1117 .Xr cltp (4).
1118 The OSI equivalent to ARP is ESIS (End System to Intermediate System Routing
1119 Protocol); running this protocol is mandatory, however one can manually add
1120 translations for machines that do not participate by use of the
1121 .Xr route (8)
1122 command.
1123 Additional information is provided in the manual page describing
1124 .Xr esis (4).
1125 .PP
1126 The command
1127 .Xr route (8)
1128 has a new syntax and several new capabilities:
1129 it can install routes with a specified destination and mask,
1130 and can change route characteristics such as hop count, packet size
1131 and window size.
1132 .PP
1133 Several important enhancements have been added to the TCP/IP
1134 protocols including TCP header prediction and
1135 serial line IP (SLIP) with header compression.
1136 The routing implementation has been completely rewritten
1137 to use a hierarchical routing tree with a mask per route
1138 to support the arbitrary levels of routing found in the ISO protocols.
1139 The routing table also stores and caches route characteristics
1140 to speed the adaptation of the throughput and congestion avoidance
1141 algorithms.
1142 .PP
1143 The format of the
1144 .I sockaddr
1145 structure (the structure used to describe a generic network address with an
1146 address family and family-specific data)
1147 has changed from previous releases,
1148 as have the address family-specific versions of this structure.
1149 The
1150 .I sa_family
1151 family field has been split into a length,
1152 .Pn sa_len ,
1153 and a family,
1154 .Pn sa_family .
1155 System calls that pass a
1156 .I sockaddr
1157 structure into the kernel (e.g.
1158 .Fn sendto
1159 and
1160 .Fn connect )
1161 have a separate parameter that specifies the
1162 .I sockaddr
1163 length, and thus it is not necessary to fill in the
1164 .I sa_len
1165 field for those system calls.
1166 System calls that pass a
1167 .I sockaddr
1168 structure back from the kernel (e.g.
1169 .Fn recvfrom
1170 and
1171 .Fn accept )
1172 receive a completely filled-in
1173 .I sockaddr
1174 structure, thus the length field is valid.
1175 Because this would not work for old binaries,
1176 the new library uses a different system call number.
1177 Thus, most networking programs compiled under \*(4B are incompatible
1178 with older systems.
1179 .PP
1180 Although this change is mostly source and binary compatible
1181 with old programs, there are three exceptions.
1182 Programs with statically initialized
1183 .I sockaddr
1184 structures
1185 (usually the Internet form, a
1186 .I sockaddr_in )
1187 are not compatible.
1188 Generally, such programs should be changed to fill in the structure
1189 at run time, as C allows no way to initialize a structure without
1190 assuming the order and number of fields.
1191 Also, programs with use structures to describe a network packet format
1192 that contain embedded
1193 .I sockaddr
1194 structures also require change; a definition of an
1195 .I osockaddr
1196 structure is provided for this purpose.
1197 Finally, programs that use the
1198 .Sm SIOCGIFCONF
1199 ioctl to get a complete list of interface addresses
1200 need to check the
1201 .I sa_len
1202 field when iterating through the array of addresses returned,
1203 as not all the structures returned have the same length
1204 (this variance in length is nearly guaranteed by the presence of link-layer
1205 address structures).
1206 .Sh 4 "Additions and changes to filesystems"
1207 .PP
1208 The \*(4B distribution contains most of the interfaces
1209 specified in the IEEE Std1003.1 system interface standard.
1210 Filesystem additions include IEEE Std1003.1 FIFOs,
1211 byte-range file locking, and saved user and group identifiers.
1212 .PP
1213 A new virtual filesystem interface has been added to the
1214 kernel to support multiple filesystems.
1215 In comparison with other interfaces,
1216 the Berkeley interface has been structured for more efficient support
1217 of filesystems that maintain state (such as the local filesystem).
1218 The interface has been extended with support for stackable
1219 filesystems done at UCLA.
1220 These extensions allow for filesystems to be layered on top of each
1221 other and allow new vnode operations to be added without requiring
1222 changes to existing filesystem implementations.
1223 For example,
1224 the umap filesystem (see
1225 .Xr mount_umap (8))
1226 is used to mount a sub-tree of an existing filesystem
1227 that uses a different set of uids and gids than the local system.
1228 Such a filesystem could be mounted from a remote site via NFS or it
1229 could be a filesystem on removable media brought from some foreign
1230 location that uses a different password file.
1231 .PP
1232 Other new filesystems that may be stacked include the loopback filesystem
1233 .Xr mount_lofs (8),
1234 and the kernel filesystem
1235 .Xr mount_kernfs (8).
1236 .PP
1237 The buffer cache in the kernel is now organized as a file block cache
1238 rather than a device block cache.
1239 As a consequence, cached blocks from a file
1240 and from the corresponding block device would no longer be kept consistent.
1241 The block device thus has little remaining value.
1242 Three changes have been made for these reasons:
1243 .IP 1)
1244 block devices may not be opened while they are mounted,
1245 and may not be mounted while open, so that the two versions of cached
1246 file blocks cannot be created,
1247 .IP 2)
1248 filesystem checks of the root now use the raw device
1249 to access the root filesystem, and
1250 .IP 3)
1251 the root filesystem is initially mounted read-only
1252 so that nothing can be written back to disk during or after change to
1253 the raw filesystem by
1254 .Xr fsck .
1255 .LP
1256 The root filesystem may be made writable while in single-user mode
1257 with the command:
1258 .DS
1259 .ft CW
1260 mount \-uw /
1261 .DE
1262 The mount command has an option to update the flags on a mounted filesystem,
1263 including the ability to upgrade a filesystem from read-only to read-write
1264 or downgrade it from read-write to read-only.
1265 .PP
1266 In addition to the local ``fast filesystem'',
1267 we have added an implementation of the network filesystem (NFS)
1268 that fully interoperates with the NFS shipped by Sun and its licensees.
1269 Because our NFS implementation was implemented
1270 by Rick Macklem of the University of Guelph
1271 using only the publicly available NFS specification,
1272 it does not require a license from Sun to use in source or binary form.
1273 By default it runs over UDP to be compatible with Sun's implementation.
1274 However, it can be configured on a per-mount basis to run over TCP.
1275 Using TCP allows it to be used quickly and efficiently through
1276 gateways and over long-haul networks.
1277 Using an extended protocol, it supports Leases to allow a limited
1278 callback mechanism that greatly reduces the network traffic necessary
1279 to maintain cache consistency between the server and its clients.
1280 Its use will be familiar to users of other implementations of NFS.
1281 See the manual pages
1282 .Xr mount (8),
1283 .Xr mountd (8),
1284 .Xr fstab (5),
1285 .Xr exports (5),
1286 .Xr netgroup (5),
1287 .Xr nfsd (8),
1288 .Xr nfsiod (8),
1289 and
1290 .Xr nfssvc (8).
1291 and the document ``The 4.4BSD NFS Implementation'' (SMM:6)
1292 for further information.
1293 The format of
1294 .Pn /etc/fstab
1295 has changed from previous \*(Bs releases
1296 to a blank-separated format to allow colons in pathnames.
1297 .PP
1298 A new local filesystem, the log-structured filesystem (LFS),
1299 has been added to the system.
1300 It provides near disk-speed output and fast crash recovery.
1301 This work is based, in part, on the LFS filesystem created
1302 for the Sprite operating system at Berkeley.
1303 While the kernel implementation is almost complete,
1304 only some of the utilities to support the
1305 filesystem have been written,
1306 so we do not recommend it for production use.
1307 See
1308 .Xr newlfs (8),
1309 .Xr mount_lfs (8)
1310 and
1311 .Xr lfs_cleanerd (8)
1312 for more information.
1313 For an in-depth description of the implementation and performance
1314 characteristics of log-structured filesystems in general,
1315 and this one in particular, see Dr. Margo Seltzer's doctoral thesis,
1316 available from the University of California Computer Science Department.
1317 .PP
1318 We have also added a memory-based filesystem that runs in
1319 pageable memory, allowing large temporary filesystems without
1320 requiring dedicated physical memory.
1321 .PP
1322 The local ``fast filesystem'' has been enhanced to do
1323 clustering that allows large pieces of files to be
1324 allocated contiguously resulting in near doubling
1325 of filesystem throughput.
1326 The filesystem interface has been extended to allow
1327 files and filesystems to grow to 2^63 bytes in size.
1328 The quota system has been rewritten to support both
1329 user and group quotas (simultaneously if desired).
1330 Quota expiration is based on time rather than
1331 the previous metric of number of logins over quota.
1332 This change makes quotas more useful on fileservers
1333 onto which users seldom login.
1334 .PP
1335 The system security has been greatly enhanced by the
1336 addition of additional file flags that permit a file to be
1337 marked as immutable or append only.
1338 Once set, these flags can only be cleared by the super-user
1339 when the system is running in insecure mode (normally, single-user).
1340 In addition to the immutable and append-only flags,
1341 the filesystem supports a new user-settable flag ``nodump''.
1342 (File flags are set using the
1343 .Xr chflags (1)
1344 utility.)
1345 When set on a file,
1346 .Xr dump (8)
1347 will omit the file from incremental backups
1348 but retain them on full backups.
1349 See the ``-h'' flag to
1350 .Xr dump (8)
1351 for details on how to change this default.
1352 The ``nodump'' flag is usually set on core dumps,
1353 system crash dumps, and object files generated by the compiler.
1354 Note that the flag is not preserved when files are copied
1355 so that installing an object file will cause it to be preserved.
1356 .PP
1357 The filesystem format used in \*(4B has several additions.
1358 Directory entries have an additional field,
1359 .Pn d_type ,
1360 that identifies the type of the entry
1361 (normally found in the
1362 .Pn st_mode
1363 field of the
1364 .Pn stat
1365 structure).
1366 This field is particularly useful for identifying
1367 directories without the need to use
1368 .Xr stat (2).
1369 .PP
1370 Short (less than sixty byte) symbolic links are now stored
1371 in the inode itself rather than in a separate data block.
1372 This saves disk space and makes access of symbolic links faster.
1373 Short symbolic links are not given a special type,
1374 so a user-level application is unaware of their special treatment.
1375 Unlike pre-\*(4B systems, symbolic links do
1376 not have an owner, group, access mode, times, etc.
1377 Instead, these attributes are taken from the directory that contains the link.
1378 The only attributes returned from an
1379 .Xr lstat (2)
1380 that refer to the symbolic link itself are the file type (S_IFLNK),
1381 size, blocks, and link count (always 1).
1382 .PP
1383 An implementation of an auto-mounter daemon,
1384 .Xr amd ,
1385 was contributed by Jan-Simon Pendry of the
1386 Imperial College of Science, Technology & Medicine.
1387 See the document ``AMD \- The 4.4BSD Automounter'' (SMM:13)
1388 for further information.
1389 .PP
1390 The directory
1391 .Pn /dev/fd
1392 contains special files
1393 .Pn 0
1394 through
1395 .Pn 63
1396 that, when opened, duplicate the corresponding file descriptor.
1397 The names
1398 .Pn /dev/stdin ,
1399 .Pn /dev/stdout
1400 and
1401 .Pn /dev/stderr
1402 refer to file descriptors 0, 1 and 2.
1403 See
1404 .Xr fd (4)
1405 and
1406 .Xr mount_fdesc (8)
1407 for more information.
1408 .Sh 4 "POSIX terminal driver changes"
1409 .PP
1410 The \*(4B system uses the IEEE P1003.1 (POSIX.1) terminal interface
1411 rather than the previous \*(Bs terminal interface.
1412 The terminal driver is similar to the System V terminal driver
1413 with the addition of the necessary extensions to get the
1414 functionality previously available in the \*(Ps terminal driver.
1415 Both the old
1416 .Xr ioctl
1417 calls and old options to
1418 .Xr stty (1)
1419 are emulated.
1420 This emulation is expected to be unavailable in many vendors releases,
1421 so conversion to the new interface is encouraged.
1422 .PP
1423 \*(4B also adds the IEEE Std1003.1 job control interface,
1424 that is similar to the \*(Ps job control interface,
1425 but adds a security model that was missing in the
1426 \*(Ps job control implementation.
1427 A new system call,
1428 .Fn setsid ,
1429 creates a job-control session consisting of a single process
1430 group with one member, the caller, that becomes a session leader.
1431 Only a session leader may acquire a controlling terminal.
1432 This is done explicitly via a
1433 .Sm TIOCSCTTY
1434 .Fn ioctl
1435 call, not implicitly by an
1436 .Fn open
1437 call.
1438 The call fails if the terminal is in use.
1439 Programs that allocate controlling terminals (or pseudo-terminals)
1440 require change to work in this environment.
1441 The versions of
1442 .Xr xterm
1443 provided in the X11R5 release includes the necessary changes.
1444 New library routines are available for allocating and initializing
1445 pseudo-terminals and other terminals as controlling terminal; see
1446 .Pn /usr/src/lib/libutil/pty.c
1447 and
1448 .Pn /usr/src/lib/libutil/login_tty.c .
1449 .PP
1450 The POSIX job control model formalizes the previous conventions
1451 used in setting up a process group.
1452 Unfortunately, this requires that changes be made in a defined order
1453 and with some synchronization that were not necessary in the past.
1454 Older job control shells (csh, ksh) will generally not operate correctly
1455 with the new system.
1456 .PP
1457 Most of the other kernel interfaces have been changed to correspond
1458 with the POSIX.1 interface, although that work is not complete.
1459 See the relevant manual pages and the IEEE POSIX standard.
1460 .Sh 4 "Native operating system compatibility"
1461 .PP
1462 Both the HP300 and SPARC ports feature the ability to run binaries
1463 built for the native operating system (HP-UX or SunOS) by emulating
1464 their system calls.
1465 Building an HP300 kernel with the HPUXCOMPAT and COMPAT_OHPUX options
1466 or a SPARC kernel with the COMPAT_SUNOS option will enable this feature
1467 (on by default in the generic kernel provided in the root filesystem image).
1468 Though this native operating system compatibility was provided by the
1469 developers as needed for their purposes and is by no means complete,
1470 it is complete enough to run several non-trivial applications including
1471 those that require HP-UX or SunOS shared libraries.
1472 For example, the vendor supplied X11 server and windowing environment
1473 can be used on both the HP300 and SPARC.
1474 .PP
1475 It is important to remember that merely copying over a native binary
1476 and executing it (or executing it directly across NFS) does not imply
1477 that it will run.
1478 All but the most trivial of applications are likely to require access
1479 to auxiliary files that do not exist under \*(4B (e.g.
1480 .Pn /etc/ld.so.cache )
1481 or have a slightly different format (e.g.
1482 .Pn /etc/passwd ).
1483 However, by using system call tracing and
1484 through creative use of symlinks,
1485 many problems can be tracked down and corrected.
1486 .PP
1487 The DECstation port also has code for ULTRIX emulation
1488 (kernel option ULTRIXCOMPAT, not compiled into the generic kernel)
1489 but it was used primarily for initially bootstrapping the port and
1490 has not been used since.
1491 Hence, some work may be required to make it generally useful.
1492 .Sh 3 "Changes to the utilities"
1493 .PP
1494 We have been tracking the IEEE Std1003.2 shell and utility work
1495 and have included prototypes of many of the proposed utilities
1496 based on draft 12 of the POSIX.2 Shell and Utilities document.
1497 Because most of the traditional utilities have been replaced
1498 with implementations conformant to the POSIX standards,
1499 you should realize that the utility software may not be as stable,
1500 reliable or well documented as in traditional Berkeley releases.
1501 In particular, almost the entire manual suite has been rewritten to
1502 reflect the POSIX defined interfaces, and in some instances
1503 it does not correctly reflect the current state of the software.
1504 It is also worth noting that, in rewriting this software, we have generally
1505 been rewarded with significant performance improvements.
1506 Most of the libraries and header files have been converted
1507 to be compliant with ANSI C.
1508 The shipped compiler (gcc) is a superset of ANSI C,
1509 but supports traditional C as a command-line option.
1510 The system libraries and utilities all compile
1511 with either ANSI or traditional C.
1512 .Sh 4 "Make and Makefiles"
1513 .PP
1514 This release uses a completely new version of the
1515 .Xr make
1516 program derived from the
1517 .Xr pmake
1518 program developed by the Sprite project at Berkeley.
1519 It supports existing makefiles, although certain incorrect makefiles
1520 may fail.
1521 The makefiles for the \*(4B sources make extensive use of the new
1522 facilities, especially conditionals and file inclusion, and are thus
1523 completely incompatible with older versions of
1524 .Xr make
1525 (but nearly all the makefiles are now trivial!).
1526 The standard include files for
1527 .Xr make
1528 are in
1529 .Pn /usr/share/mk .
1530 There is a
1531 .Pn bsd.README
1532 file in
1533 .Pn /usr/src/share/mk .
1534 .PP
1535 Another global change supported by the new
1536 .Xr make
1537 is designed to allow multiple architectures to share a copy of the sources.
1538 If a subdirectory named
1539 .Pn obj
1540 is present in the current directory,
1541 .Xr make
1542 descends into that directory and creates all object and other files there.
1543 We use this by building a directory hierarchy in
1544 .Pn /var/obj
1545 that parallels
1546 .Pn /usr/src .
1547 We then create the
1548 .Pn obj
1549 subdirectories in
1550 .Pn /usr/src
1551 as symbolic links to the corresponding directories in
1552 .Pn /var/obj .
1553 (This step is automated.
1554 The command ``make obj'' in
1555 .Pn /usr/src
1556 builds both the local symlink and the shadow directory,
1557 using
1558 .Pn /usr/obj ,
1559 that may be a symbolic link, as the root of the shadow tree.
1560 The use of
1561 .Pn /usr/obj
1562 is for historic reasons only, and the system make configuration files in
1563 .Pn /usr/share/mk
1564 can trivially be modified to use
1565 .Pn /var/obj
1566 instead.)
1567 We have one
1568 .Pn /var/obj
1569 hierarchy on the local system, and another on each
1570 system that shares the source filesystem.
1571 All the sources in
1572 .Pn /usr/src
1573 except for
1574 .Pn /usr/src/contrib
1575 and portions of
1576 .Pn /usr/src/old
1577 have been converted to use the new make and
1578 .Pn obj
1579 subdirectories;
1580 this change allows compilation for multiple
1581 architectures from the same source tree
1582 (that may be mounted read-only).
1583 .Sh 4 "Kerberos"
1584 .PP
1585 The Kerberos authentication system designed by MIT (version 5)
1586 is included in this release.
1587 See
1588 .Xr kerberos (8)
1589 for a general introduction.
1590 Pluggable Authentication Modules (PAM) can use Kerberos
1591 at the system administrator's discretion.
1592 If it is configured,
1593 apps such as 
1594 .Xr login (1),
1595 .Xr passwd (1),
1596 .Xr ftp (1)
1597 and
1598 .Xr ssh (1)
1599 can use it automatically.
1600 The file
1601 Each system needs the file
1602 .Pn /etc/krb5.conf
1603 to set its realm and local servers,
1604 and a private key stored in
1605 .Pn /etc/krb5.keytab
1606 (see
1607 .Xr ktutil (8)).
1608 The Kerberos server should be set up on a single,
1609 physically secure,
1610 server machine.
1611 Users and hosts may be added and modified with
1612 .Xr kadmin (8).
1613 .PP
1614 Note that the password-changing program
1615 .Xr passwd (1)
1616 can change the Kerberos password,
1617 if configured by the administrator using PAM.
1618 The
1619 .Li \-l
1620 option to
1621 .Xr passwd (1)
1622 changes the ``local'' password if one exists.
1623 .Sh 4 "Timezone support"
1624 .PP
1625 The timezone conversion code in the C library uses data files installed in
1626 .Pn /usr/share/zoneinfo
1627 to convert from ``GMT'' to various timezones.  The data file for the default
1628 timezone for the system should be copied to
1629 .Pn /etc/localtime .
1630 Other timezones can be selected by setting the TZ environment variable.
1631 .PP
1632 The data files initially installed in
1633 .Pn /usr/share/zoneinfo
1634 include corrections for leap seconds since the beginning of 1970.
1635 Thus, they assume that the
1636 kernel will increment the time at a constant rate during a leap second;
1637 that is, time just keeps on ticking.  The conversion routines will then
1638 name a leap second 23:59:60.  For purists, this effectively means that
1639 the kernel maintains TAI (International Atomic Time) rather than UTC
1640 (Coordinated Universal Time, aka GMT).
1641 .PP
1642 For systems that run current NTP (Network Time Protocol) implementations
1643 or that wish to conform to the letter of the POSIX.1 law, it is possible
1644 to rebuild the timezone data files so that leap seconds are not counted.
1645 (NTP causes the time to jump over a leap second, and POSIX effectively
1646 requires the clock to be reset by hand when a leap second occurs.
1647 In this mode, the kernel effectively runs UTC rather than TAI.)
1648 .PP
1649 The data files without leap second information
1650 are constructed from the source directory,
1651 .Pn /usr/src/share/zoneinfo .
1652 Change the variable REDO in Makefile
1653 from ``right'' to ``posix'', and then do
1654 .DS
1655 make obj        (if necessary)
1656 make
1657 make install
1658 .DE
1659 .PP
1660 You will then need to copy the correct default zone file to
1661 .Pn /etc/localtime ,
1662 as the old one would still have used leap seconds, and because the Makefile
1663 installs a default
1664 .Pn /etc/localtime
1665 each time ``make install'' is done.
1666 .PP
1667 It is possible to install both sets of timezone data files.  This results
1668 in subdirectories
1669 .Pn /usr/share/zoneinfo/right
1670 and
1671 .Pn /usr/share/zoneinfo/posix .
1672 Each contain a complete set of zone files.
1673 See
1674 .Pn /usr/src/share/zoneinfo/Makefile
1675 for details.
1676 .Sh 4 "Additions and changes to the libraries"
1677 .PP
1678 Notable additions to the libraries include functions to traverse a
1679 filesystem hierarchy, database interfaces to btree and hashing functions,
1680 a new, faster implementation of stdio and a radix and merge sort
1681 functions.
1682 .PP
1683 The
1684 .Xr fts (3)
1685 functions will do either physical or logical traversal of
1686 a file hierarchy as well as handle essentially infinite depth
1687 filesystems and filesystems with cycles.
1688 All the utilities in \*(4B which traverse file hierarchies
1689 have been converted to use
1690 .Xr fts (3).
1691 The conversion has always resulted in a significant performance
1692 gain, often of four or five to one in system time.
1693 .PP
1694 The
1695 .Xr dbopen (3)
1696 functions are intended to be a family of database access methods.
1697 Currently, they consist of
1698 .Xr hash (3),
1699 an extensible, dynamic hashing scheme,
1700 .Xr btree (3),
1701 a sorted, balanced tree structure (B+tree's), and
1702 .Xr recno (3),
1703 a flat-file interface for fixed or variable length records
1704 referenced by logical record number.
1705 Each of the access methods stores associated key/data pairs and
1706 uses the same record oriented interface for access.
1707 .PP
1708 The
1709 .Xr qsort (3)
1710 function has been rewritten for additional performance.
1711 In addition, three new types of sorting functions,
1712 .Xr heapsort (3),
1713 .Xr mergesort (3)
1714 and
1715 .Xr radixsort (3)
1716 have been added to the system.
1717 The
1718 .Xr mergesort
1719 function is optimized for data with pre-existing order,
1720 in which case it usually significantly outperforms
1721 .Xr qsort .
1722 The
1723 .Xr radixsort (3)
1724 functions are variants of most-significant-byte radix sorting.
1725 They take time linear to the number of bytes to be
1726 sorted, usually significantly outperforming
1727 .Xr qsort
1728 on data that can be sorted in this fashion.
1729 An implementation of the POSIX 1003.2 standard
1730 .Xr sort (1),
1731 based on
1732 .Xr radixsort ,
1733 is included in
1734 .Pn /usr/src/contrib/sort .
1735 .PP
1736 Some additional comments about the \*(4B C library:
1737 .IP \(bu
1738 The floating point support in the C library has been replaced
1739 and is now accurate.
1740 .IP \(bu
1741 The C functions specified by both ANSI C, POSIX 1003.1 and
1742 1003.2 are now part of the C library.
1743 This includes support for file name matching, shell globbing
1744 and both basic and extended regular expressions.
1745 .IP \(bu
1746 ANSI C multibyte and wide character support has been integrated.
1747 The rune functionality from the Bell Labs' Plan 9 system is provided
1748 as well.
1749 .IP \(bu
1750 The
1751 .Xr termcap (3)
1752 functions have been generalized and replaced with a general
1753 purpose interface named
1754 .Xr getcap (3).
1755 .IP \(bu
1756 The
1757 .Xr stdio (3)
1758 routines have been replaced, and are usually much faster.
1759 In addition, the
1760 .Xr funopen (3)
1761 interface permits applications to provide their own I/O stream
1762 function support.
1763 .PP
1764 The
1765 .Xr curses (3)
1766 library has been largely rewritten.
1767 Important additional features include support for scrolling and
1768 .Xr termios (3).
1769 .PP
1770 An application front-end editing library, named libedit, has been
1771 added to the system.
1772 .PP
1773 A superset implementation of the SunOS kernel memory interface library,
1774 libkvm, has been integrated into the system.
1775 .PP
1776 .Sh 4 "Additions and changes to other utilities"
1777 .PP
1778 There are many new utilities, offering many new capabilities,
1779 in \*(4B.
1780 Skimming through the section 1 and section 8 manual pages is sure
1781 to be useful.
1782 The additions to the utility suite include greatly enhanced versions of
1783 programs that display system status information, implementations of
1784 various traditional tools described in the IEEE Std1003.2 standard,
1785 new tools not previous available on Berkeley UNIX systems,
1786 and many others.
1787 Also, with only a very few exceptions, all the utilities from
1788 \*(Ps that included proprietary source code have been replaced,
1789 and their \*(4B counterparts are freely redistributable.
1790 Normally, this replacement resulted in significant performance
1791 improvements and the increase of the limits imposed on data by
1792 the utility as well.
1793 .PP
1794 A summary of specific additions and changes are as follows:
1795 .TS
1796 lfC l.
1797 amd     An auto-mounter implementation.
1798 ar      Replacement of the historic archive format with a new one.
1799 awk     Replaced by gawk; see /usr/src/old/awk for the historic version.
1800 bdes    Utility implementing DES modes of operation described in FIPS PUB 81.
1801 calendar        Addition of an interface for system calendars.
1802 cap_mkdb        Utility for building hashed versions of termcap style databases.
1803 cc      Replacement of pcc with gcc suite.
1804 chflags A utility for setting the per-file user and system flags.
1805 chfn    An editor based replacement for changing user information.
1806 chpass  An editor based replacement for changing user information.
1807 chsh    An editor based replacement for changing user information.
1808 cksum   The POSIX 1003.2 checksum utility; compatible with sum.
1809 column  A columnar text formatting utility.
1810 cp      POSIX 1003.2 compatible, able to copy special files.
1811 csh     Freely redistributable and 8-bit clean.
1812 date    User specified formats added.
1813 dd      New EBCDIC conversion tables, major performance improvements.
1814 dev_mkdb        Hashed interface to devices.
1815 dm      Dungeon master.
1816 find    Several new options and primaries, major performance improvements.
1817 fstat   Utility displaying information on files open on the system.
1818 ftpd    Connection logging added.
1819 hexdump A binary dump utility, superseding od.
1820 id      The POSIX 1003.2 user identification utility.
1821 inetd   Tcpmux added.
1822 jot     A text formatting utility.
1823 kdump   A system-call tracing facility.
1824 ktrace  A system-call tracing facility.
1825 kvm_mkdb        Hashed interface to the kernel name list.
1826 lam     A text formatting utility.
1827 lex     A new, freely redistributable, significantly faster version.
1828 locate  A database of the system files, by name, constructed weekly.
1829 logname The POSIX 1003.2 user identification utility.
1830 mail.local      New local mail delivery agent, replacing mail.
1831 make    Replaced with a new, more powerful make, supporting include files.
1832 man     Added support for man page location configuration.
1833 mkdep   A new utility for generating make dependency lists.
1834 mkfifo  The POSIX 1003.2 FIFO creation utility.
1835 mtree   A new utility for mapping file hierarchies to a file.
1836 nfsstat An NFS statistics utility.
1837 nvi     A freely redistributable replacement for the ex/vi editors.
1838 pax     The POSIX 1003.2 replacement for cpio and tar.
1839 printf  The POSIX 1003.2 replacement for echo.
1840 roff    Replaced by groff; see /usr/src/old/roff for the historic versions.
1841 rs      New utility for text formatting.
1842 shar    An archive building utility.
1843 sysctl  MIB-style interface to system state.
1844 tcopy   Fast tape-to-tape copying and verification.
1845 touch   Time and file reference specifications.
1846 tput    The POSIX 1003.2 terminal display utility.
1847 tr      Addition of character classes.
1848 uname   The POSIX 1003.2 system identification utility.
1849 vis     A filter for converting and displaying non-printable characters.
1850 xargs   The POSIX 1003.2 argument list constructor utility.
1851 yacc    A new, freely redistributable, significantly faster version.
1852 .TE
1853 .PP
1854 The new versions of
1855 .Xr lex (1)
1856 (``flex'') and
1857 .Xr yacc (1)
1858 (``zoo'') should be installed early on if attempting to
1859 cross-compile \*(4B on another system.
1860 Note that the new
1861 .Xr lex
1862 program is not completely backward compatible with historic versions of
1863 .Xr lex ,
1864 although it is believed that all documented features are supported.
1865 .PP
1866 The
1867 .Xr find
1868 utility has two new options that are important to be aware of if you
1869 intend to use NFS.
1870 The ``fstype'' and ``prune'' options can be used together to prevent
1871 find from crossing NFS mount points.
1872 See
1873 .Pn /etc/daily
1874 for an example of their use.
1875 .Sh 2 "Hints on converting from \*(Ps to \*(4B"
1876 .PP
1877 This section summarizes changes between
1878 \*(Ps and \*(4B that are likely to
1879 cause difficulty in doing the conversion.
1880 It does not include changes in the network;
1881 see section 5 for information on setting up the network.
1882 .PP
1883 Since the stat st_size field is now 64-bits instead of 32,
1884 doing something like:
1885 .DS
1886 .ft CW
1887 foo(st.st_size);
1888 .DE
1889 and then (improperly) defining foo with an ``int'' or ``long'' parameter:
1890 .DS
1891 .ft CW
1892 foo(size)
1893         int size;
1894 {
1895         ...
1896 }
1897 .DE
1898 will fail miserably (well, it might work on a little endian machine).
1899 This problem showed up in
1900 .Xr emacs (1)
1901 as well as several other programs.
1902 A related problem is improperly casting (or failing to cast)
1903 the second argument to
1904 .Xr lseek (2),
1905 .Xr truncate (2),
1906 or
1907 .Xr ftruncate (2)
1908 ala:
1909 .DS
1910 .ft CW
1911 lseek(fd, (long)off, 0);
1912 .DE
1913 or
1914 .DS
1915 .ft CW
1916 lseek(fd, 0, 0);
1917 .DE
1918 The best solution is to include
1919 .Pn <unistd.h>
1920 which has prototypes that catch these types of errors.
1921 .PP
1922 Determining the ``namelen'' parameter for a
1923 .Xr connect (2)
1924 call on a unix domain socket should use the ``SUN_LEN'' macro from
1925 .Pn <sys/un.h> .
1926 One old way that was used:
1927 .DS
1928 .ft CW
1929 addrlen = strlen(unaddr.sun_path) + sizeof(unaddr.sun_family);
1930 .DE
1931 no longer works as there is an additional
1932 .Pn sun_len
1933 field.
1934 .PP
1935 The kernel's limit on the number of open files has been
1936 increased from 20 to 64.
1937 It is now possible to change this limit almost arbitrarily.
1938 The standard I/O library
1939 autoconfigures to the kernel limit.
1940 Note that file (``_iob'') entries may be allocated by
1941 .Xr malloc
1942 from
1943 .Xr fopen ;
1944 this allocation has been known to cause problems with programs
1945 that use their own memory allocators.
1946 Memory allocation does not occur until after 20 files have been opened
1947 by the standard I/O library.
1948 .PP
1949 .Xr Select
1950 can be used with more than 32 descriptors
1951 by using arrays of \fBint\fPs for the bit fields rather than single \fBint\fPs.
1952 Programs that used
1953 .Xr getdtablesize
1954 as their first argument to
1955 .Xr select
1956 will no longer work correctly.
1957 Usually the program can be modified to correctly specify the number
1958 of bits in an \fBint\fP.
1959 Alternatively the program can be modified to use an array of \fBint\fPs.
1960 There are a set of macros available in
1961 .Pn <sys/types.h>
1962 to simplify this.
1963 See
1964 .Xr select (2).
1965 .PP
1966 Old core files will not be intelligible by the current debuggers
1967 because of numerous changes to the user structure
1968 and because the kernel stack has been enlarged.
1969 The
1970 .Xr a.out
1971 header that was in the user structure is no longer present.
1972 Locally-written debuggers that try to check the magic number
1973 will need to be changed.
1974 .PP
1975 Files may not be deleted from directories having the ``sticky'' (ISVTX) bit
1976 set in their modes
1977 except by the owner of the file or of the directory, or by the superuser.
1978 This is primarily to protect users' files in publicly-writable directories
1979 such as
1980 .Pn /tmp
1981 and
1982 .Pn /var/tmp .
1983 All publicly-writable directories should have their ``sticky'' bits set
1984 with ``chmod +t.''
1985 .PP
1986 The following two sections contain additional notes about
1987 changes in \*(4B that affect the installation of local files;
1988 be sure to read them as well.