PageRenderTime 55ms CodeModel.GetById 17ms RepoModel.GetById 0ms app.codeStats 0ms

/share/doc/smm/01.setup/3.t

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