Add a new translation: zh_CN.GB2312/books/handbook (Simplified Chinese).

Submitted by:	delphij
Obtained from:	The FreeBSD Simplified Chinese Project CVS
backups/projects/sgml2xml@41712
Hiroki Sato 20 years ago
parent 3e941311cb
commit 8f1c859fcb
Notes: svn2git 3 years ago
svn path=/head/; revision=22486

@ -20,6 +20,7 @@ SUBDIR+= pt_BR.ISO8859-1
SUBDIR+= ru_RU.KOI8-R
SUBDIR+= sr_YU.ISO8859-2
SUBDIR+= tr_TR.ISO8859-9
SUBDIR+= zh_CN.GB2312
SUBDIR+= zh_TW.Big5
.endif

@ -0,0 +1,9 @@
# Original Revision: 1.7
# $FreeBSD$
SUBDIR = books
#COMPAT_SYMLINK = zh_CN
DOC_PREFIX?= ${.CURDIR}/..
.include "${DOC_PREFIX}/share/mk/doc.project.mk"

@ -0,0 +1,9 @@
# Original Revision: 1.12
# $FreeBSD$
SUBDIR = handbook
ROOT_SYMLINKS= handbook
DOC_PREFIX?= ${.CURDIR}/../..
.include "${DOC_PREFIX}/share/mk/doc.project.mk"

@ -0,0 +1,6 @@
#
# Original Revision: 1.4
# $FreeBSD$
#
DESTDIR?= ${DOCDIR}/zh_CN.GB2312/books/${.CURDIR:T}

@ -0,0 +1,261 @@
#
# $FreeBSD$
#
# Build the FreeBSD Handbook (Chinese).
#
# Original revision: 1.90
# ------------------------------------------------------------------------
#
# Handbook-specific variables
#
# WITH_PGPKEYS The print version of the handbook only prints PGP
# fingerprints by default. If you would like for the
# entire key to be displayed, then set this variable.
# This option has no affect on the HTML formats.
#
# Handbook-specific targets
#
# pgpkeyring This target will read the contents of
# pgpkeys/chapter.sgml and will extract all of
# the pgpkeys to standard out. This output can then
# be redirected into a file and distributed as a
# public keyring of FreeBSD developers that can
# easily be imported into PGP/GPG.
#
# ------------------------------------------------------------------------
.PATH: ${.CURDIR}/../../share/sgml/glossary
MAINTAINER= doc@FreeBSD.org
DOC?= book
FORMATS?= html-split
HAS_INDEX= true
INSTALL_COMPRESSED?= gz
INSTALL_ONLY_COMPRESSED?=
IMAGES_EN = advanced-networking/isdn-bus.eps
IMAGES_EN+= advanced-networking/isdn-twisted-pair.eps
IMAGES_EN+= advanced-networking/natd.eps
IMAGES_EN+= advanced-networking/net-routing.pic
IMAGES_EN+= advanced-networking/static-routes.pic
IMAGES_EN+= install/adduser1.scr
IMAGES_EN+= install/adduser2.scr
IMAGES_EN+= install/adduser3.scr
IMAGES_EN+= install/boot-mgr.scr
IMAGES_EN+= install/console-saver1.scr
IMAGES_EN+= install/console-saver2.scr
IMAGES_EN+= install/console-saver3.scr
IMAGES_EN+= install/console-saver4.scr
IMAGES_EN+= install/desktop.scr
IMAGES_EN+= install/disklabel-auto.scr
IMAGES_EN+= install/disklabel-ed1.scr
IMAGES_EN+= install/disklabel-ed2.scr
IMAGES_EN+= install/disklabel-fs.scr
IMAGES_EN+= install/disklabel-root1.scr
IMAGES_EN+= install/disklabel-root2.scr
IMAGES_EN+= install/disklabel-root3.scr
IMAGES_EN+= install/disk-layout.eps
IMAGES_EN+= install/dist-set.scr
IMAGES_EN+= install/dist-set2.scr
IMAGES_EN+= install/docmenu1.scr
IMAGES_EN+= install/ed0-conf.scr
IMAGES_EN+= install/ed0-conf2.scr
IMAGES_EN+= install/edit-inetd-conf.scr
IMAGES_EN+= install/fdisk-drive1.scr
IMAGES_EN+= install/fdisk-drive2.scr
IMAGES_EN+= install/fdisk-edit1.scr
IMAGES_EN+= install/fdisk-edit2.scr
IMAGES_EN+= install/ftp-anon1.scr
IMAGES_EN+= install/ftp-anon2.scr
IMAGES_EN+= install/hdwrconf.scr
IMAGES_EN+= install/keymap.scr
IMAGES_EN+= install/main1.scr
IMAGES_EN+= install/mainexit.scr
IMAGES_EN+= install/main-std.scr
IMAGES_EN+= install/main-options.scr
IMAGES_EN+= install/main-doc.scr
IMAGES_EN+= install/main-keymap.scr
IMAGES_EN+= install/media.scr
IMAGES_EN+= install/mouse1.scr
IMAGES_EN+= install/mouse2.scr
IMAGES_EN+= install/mouse3.scr
IMAGES_EN+= install/mouse4.scr
IMAGES_EN+= install/mouse5.scr
IMAGES_EN+= install/mouse6.scr
IMAGES_EN+= install/mta-main.scr
IMAGES_EN+= install/net-config-menu1.scr
IMAGES_EN+= install/net-config-menu2.scr
IMAGES_EN+= install/nfs-server-edit.scr
IMAGES_EN+= install/ntp-config.scr
IMAGES_EN+= install/options.scr
IMAGES_EN+= install/pkg-cat.scr
IMAGES_EN+= install/pkg-confirm.scr
IMAGES_EN+= install/pkg-install.scr
IMAGES_EN+= install/pkg-sel.scr
IMAGES_EN+= install/probstart.scr
IMAGES_EN+= install/routed.scr
IMAGES_EN+= install/security.scr
IMAGES_EN+= install/sysinstall-exit.scr
IMAGES_EN+= install/timezone1.scr
IMAGES_EN+= install/timezone2.scr
IMAGES_EN+= install/timezone3.scr
IMAGES_EN+= install/userconfig.scr
IMAGES_EN+= install/userconfig2.scr
IMAGES_EN+= install/xf86setup.scr
IMAGES_EN+= mail/mutt1.scr
IMAGES_EN+= mail/mutt2.scr
IMAGES_EN+= mail/mutt3.scr
IMAGES_EN+= mail/pine1.scr
IMAGES_EN+= mail/pine2.scr
IMAGES_EN+= mail/pine3.scr
IMAGES_EN+= mail/pine4.scr
IMAGES_EN+= mail/pine5.scr
IMAGES_EN+= install/example-dir1.eps
IMAGES_EN+= install/example-dir2.eps
IMAGES_EN+= install/example-dir3.eps
IMAGES_EN+= install/example-dir4.eps
IMAGES_EN+= install/example-dir5.eps
IMAGES_EN+= security/ipsec-network.pic
IMAGES_EN+= security/ipsec-crypt-pkt.pic
IMAGES_EN+= security/ipsec-encap-pkt.pic
IMAGES_EN+= security/ipsec-out-pkt.pic
IMAGES_EN+= vinum/vinum-concat.pic
IMAGES_EN+= vinum/vinum-mirrored-vol.pic
IMAGES_EN+= vinum/vinum-raid10-vol.pic
IMAGES_EN+= vinum/vinum-raid5-org.pic
IMAGES_EN+= vinum/vinum-simple-vol.pic
IMAGES_EN+= vinum/vinum-striped-vol.pic
IMAGES_EN+= vinum/vinum-striped.pic
# Images from the cross-document image library
IMAGES_LIB= callouts/1.png
IMAGES_LIB+= callouts/2.png
IMAGES_LIB+= callouts/3.png
IMAGES_LIB+= callouts/4.png
IMAGES_LIB+= callouts/5.png
IMAGES_LIB+= callouts/6.png
IMAGES_LIB+= callouts/7.png
IMAGES_LIB+= callouts/8.png
IMAGES_LIB+= callouts/9.png
IMAGES_LIB+= callouts/10.png
#
# SRCS lists the individual SGML files that make up the document. Changes
# to any of these files will force a rebuild
#
# SGML content
SRCS+= book.sgml
SRCS+= colophon.sgml
#SRCS+= freebsd-glossary.sgml
SRCS+= advanced-networking/chapter.sgml
SRCS+= basics/chapter.sgml
SRCS+= bibliography/chapter.sgml
SRCS+= boot/chapter.sgml
SRCS+= config/chapter.sgml
SRCS+= cutting-edge/chapter.sgml
SRCS+= desktop/chapter.sgml
SRCS+= disks/chapter.sgml
SRCS+= eresources/chapter.sgml
SRCS+= install/chapter.sgml
SRCS+= introduction/chapter.sgml
SRCS+= kernelconfig/chapter.sgml
SRCS+= l10n/chapter.sgml
SRCS+= linuxemu/chapter.sgml
SRCS+= mac/chapter.sgml
SRCS+= mail/chapter.sgml
SRCS+= mirrors/chapter.sgml
SRCS+= multimedia/chapter.sgml
SRCS+= network-servers/chapter.sgml
SRCS+= pgpkeys/chapter.sgml
SRCS+= ports/chapter.sgml
SRCS+= ppp-and-slip/chapter.sgml
SRCS+= preface/preface.sgml
SRCS+= printing/chapter.sgml
SRCS+= security/chapter.sgml
SRCS+= serialcomms/chapter.sgml
SRCS+= users/chapter.sgml
SRCS+= vinum/chapter.sgml
SRCS+= x11/chapter.sgml
# Entities
SRCS+= chapters.ent
SYMLINKS= ${DESTDIR} index.html handbook.html
# Turn on all the chapters.
CHAPTERS?= ${SRCS:M*chapter.sgml}
SGMLFLAGS+= ${CHAPTERS:S/\/chapter.sgml//:S/^/-i chap./}
#SGMLFLAGS+= -i chap.freebsd-glossary
# XXX The Handbook build currently overflows some internal, hardcoded
# limits in pdftex. Until we split the Handbook up, build the PDF
# version using ps2pdf instead of pdftex.
PS2PDF?= ${PREFIX}/bin/ps2pdf
book.tex-pdf:
${TOUCH} book.tex-pdf
book.pdf: book.ps
${PS2PDF} book.ps book.pdf
pgpkeyring: pgpkeys/chapter.sgml
@${JADE} -V nochunks ${OTHERFLAGS} ${JADEOPTS} -d ${DSLPGP} -t sgml ${MASTERDOC}
DOC_PREFIX?= ${.CURDIR}/../../..
#
# Handbook-specific variables
#
.if defined(WITH_PGPKEYS)
JADEFLAGS+= -V withpgpkeys
.endif
.for p in ftp cvsup
SRCS+= mirrors.sgml.${p}.inc
CLEANFILES+= mirrors.sgml.${p}.inc
CLEANFILES+= mirrors.sgml.${p}.inc.tmp
.endfor
SRCS+= eresources.sgml.www.inc
CLEANFILES+= eresources.sgml.www.inc
CLEANFILES+= eresources.sgml.www.inc.tmp
URL_RELPREFIX?= ../../../..
DOC_PREFIX?= ${.CURDIR}/../../..
.include "${DOC_PREFIX}/share/mk/doc.project.mk"
.for p in ftp cvsup
mirrors.sgml.${p}.inc: ${XML_MIRRORS} ${XSL_MIRRORS}
${XSLTPROC} ${XSLTPROCOPTS} \
-o $@.tmp \
--param 'transtable.xml' "'${XML_TRANSTABLE}'" \
--param 'type' "'$p'" \
--param 'proto' "'$p'" \
--param 'target' "'handbook/mirrors/chapter.sgml'" \
${XSL_MIRRORS} ${XML_MIRRORS}
${SED} -e 's,<\([^ >]*\)\([^>]*\)/>,<\1\2></\1>,;s,</anchor>,,'\
< $@.tmp > $@ || (${RM} -f $@ && false)
${RM} -f $@.tmp
.endfor
eresources.sgml.www.inc: ${XML_MIRRORS} ${XSL_MIRRORS}
${XSLTPROC} ${XSLTPROCOPTS} \
-o $@.tmp \
--param 'transtable.xml' "'${XML_TRANSTABLE}'" \
--param 'type' "'www'" \
--param 'proto' "'http'" \
--param 'target' "'handbook/eresources/chapter.sgml'" \
${XSL_MIRRORS} ${XML_MIRRORS}
${SED} -e 's,<\([^ >]*\)\([^>]*\)/>,<\1\2></\1>,;s,</anchor>,,'\
< $@.tmp > $@ || (${RM} -f $@ && false)
${RM} -f $@.tmp

@ -0,0 +1,16 @@
#
# Build the Handbook with just the content from this chapter.
#
# Original Revision: 1.2
# $FreeBSD$
#
CHAPTERS= advanced-networking/chapter.sgml
VPATH= ..
MASTERDOC= ${.CURDIR}/../${DOC}.${DOCBOOKSUFFIX}
DOC_PREFIX?= ${.CURDIR}/../../../..
.include "../Makefile"

File diff suppressed because it is too large Load Diff

@ -0,0 +1,2 @@
<!DOCTYPE appendix PUBLIC "-//FreeBSD//DTD DocBook V3.1-Based Extension//EN">
<!-- $FreeBSD$ -->

@ -0,0 +1,16 @@
#
# Build the Handbook with just the content from this chapter.
#
# Original Revision: 1.1
# $FreeBSD$
#
CHAPTERS= basics/chapter.sgml
VPATH= ..
MASTERDOC= ${.CURDIR}/../${DOC}.${DOCBOOKSUFFIX}
DOC_PREFIX?= ${.CURDIR}/../../../..
.include "../Makefile"

File diff suppressed because it is too large Load Diff

@ -0,0 +1,16 @@
#
# Build the Handbook with just the content from this chapter.
#
# Original Revision: 1.1
# $FreeBSD$
#
CHAPTERS= bibliography/chapter.sgml
VPATH= ..
MASTERDOC= ${.CURDIR}/../${DOC}.${DOCBOOKSUFFIX}
DOC_PREFIX?= ${.CURDIR}/../../../..
.include "../Makefile"

@ -0,0 +1,634 @@
<!--
The FreeBSD Chinese Documentation Project
Original Revision: 1.67
$FreeBSD$
-->
<appendix id="bibliography">
<title>参考文献</title>
<para>尽管手册页能够提供对于 FreeBSD 操作系统最为权威的参考资料,它们有时却不能告诉我们如何让整个系统很好地运转起来。
因此,一本关于 &unix; 系统管理的好书,以及一份好的用户手册是不可或缺的。</para>
<sect1 id="bibliography-freebsd">
<title>关于 FreeBSD 的专业书籍与杂志</title>
<para><emphasis>非英文的书籍和杂志:</emphasis></para>
<itemizedlist>
<listitem>
<para><ulink
url="http://jdli.tw.FreeBSD.org/publication/book/freebsd2/index.htm">FreeBSD 入门与应用</ulink> (繁体中文)。</para>
</listitem>
<listitem>
<para>FreeBSD 技术内幕(中译本)
<ulink url="http://www.hzbook.com/">机械工业出版社</ulink>。ISBN 7-111-10201-0。
</para>
</listitem>
<listitem>
<para>FreeBSD 使用大全 第一版,
机械工业出版社。ISBN 7-111-07482-3。
</para>
</listitem>
<listitem>
<para>FreeBSD 使用大全 第二版,
机械工业出版社。ISBN 7-111-10286-X。
</para>
</listitem>
<listitem>
<para>FreeBSD Handbook (第二版中译本)
<ulink url="http://www.ptpress.com.cn/">人民邮电出版社</ulink>。ISBN 7-115-10541-3。
</para>
</listitem>
<listitem>
<para>FreeBSD 3.x Internet 高级服务器的架设与管理
<ulink url="http://www.tup.tsinghua.edu.cn/">清华大学出版社</ulink>。ISBN 7-900625-66-6。</para>
</listitem>
<listitem>
<para>FreeBSD & Windows 集成组网实务中国铁道出版社。ISBN 7-113-03845-X。</para>
</listitem>
<listitem>
<para>FreeBSD 网站架设实务中国铁道出版社。ISBN 7-113-03423-3。</para>
</listitem>
<listitem>
<para>FreeBSD for PC 98'ers (日文, 出版商SHUWA System
Co, LTD. ISBN 4-87966-468-5 C3055 P2900E。</para>
</listitem>
<listitem>
<para>FreeBSD (日文, 出版商CUTT. ISBN 4-906391-22-2
C3055 P2400E.</para>
</listitem>
<listitem>
<para><ulink
url="http://www.shoeisha.com/book/Detail.asp?bid=650">Complete Introduction to FreeBSD</ulink> (日文, 出版商:<ulink url="http://www.shoeisha.co.jp/">Shoeisha Co., Ltd</ulink>. ISBN 4-88135-473-6 P3600E.</para>
</listitem>
<listitem>
<para><ulink
url="http://www.ascii.co.jp/pb/book1/shinkan/detail/1322785.html">Personal UNIX Starter Kit FreeBSD</ulink> (日文, 出版商:<ulink url="http://www.ascii.co.jp/">ASCII</ulink>. ISBN 4-7561-1733-3 P3000E.</para>
</listitem>
<listitem>
<para>FreeBSD Handbook (日文译本, 出版商:<ulink
url="http://www.ascii.co.jp/">ASCII</ulink>. ISBN 4-7561-1580-2
P3800E.</para>
</listitem>
<listitem>
<para>FreeBSD mit Methode (德文, 出版商:<ulink url="http://www.cul.de">Computer und
Literatur Verlag</ulink>/Vertrieb Hanser, 1998. ISBN 3-932311-31-0.</para>
</listitem>
<listitem>
<para><ulink
url="http://www.cul.de/freebsd.html">FreeBSD 4 - Installieren, Konfigurieren, Administrieren</ulink>
(德文, 出版商:<ulink url="http://www.cul.de">Computer und Literatur Verlag</ulink>, 2001.
ISBN 3-932311-88-4.</para>
</listitem>
<listitem>
<para><ulink
url="http://www.cul.de/freebsd.html">FreeBSD 5 - Installieren, Konfigurieren, Administrieren</ulink>
(德文), 出版商: <ulink url="http://www.cul.de">Computer und Literatur Verlag</ulink>, 2003.
ISBN 3-936546-06-1.</para>
</listitem>
<listitem>
<para><ulink url="http://www.mitp.de/vmi/mitp/detail/pWert/1343/">
FreeBSD de Luxe</ulink> (德文), 出版商:
<ulink url="http://www.mitp.de">Verlag Modere Industrie</ulink>,
2003. ISBN 3-8266-1343-0.
</para>
</listitem>
<listitem>
<para><ulink
url="http://www.pc.mycom.co.jp/FreeBSD/install-manual.html">FreeBSD Install and Utilization Manual</ulink> (日文), 出版商: <ulink url="http://www.pc.mycom.co.jp/">Mainichi Communications Inc.</ulink>.</para>
</listitem>
<listitem>
<para>Onno W Purbo, Dodi Maryanto, Syahrial Hubbany, Widjil Widodo
<emphasis><ulink url="http://maxwell.itb.ac.id/">
Building Internet Server with
FreeBSD</ulink></emphasis> (印尼文), 出版商: <ulink url="http://www.elexmedia.co.id/">Elex Media Komputindo</ulink>.</para>
</listitem>
</itemizedlist>
<para><emphasis>英文版的书籍和杂志:</emphasis></para>
<itemizedlist>
<listitem>
<para><ulink url="http://www.AbsoluteBSD.com/">Absolute
BSD: The Ultimate Guide to FreeBSD</ulink>, 出版商:
<ulink url="http://www.nostarch.com/">No Starch Press</ulink>, 2002.
ISBN: 1886411743</para>
</listitem>
<listitem>
<para><ulink
url="http://www.freebsdmall.com/cgi-bin/fm/bsdcomp">
The Complete FreeBSD</ulink>, 出版商:
<ulink url="http://www.oreilly.com/">O'Reilly</ulink>, 2003.
ISBN: 0596005164</para>
</listitem>
<listitem>
<para><ulink url="http://www.freebsd-corp-net-guide.com/">The
FreeBSD Corporate Networker's Guide</ulink>, 出版商:
<ulink url="http://www.awl.com/aw/">Addison-Wesley</ulink>, 2000.
ISBN: 0201704811</para>
</listitem>
<listitem>
<para><ulink url="http://andrsn.stanford.edu/FreeBSD/introbook/">
FreeBSD: An Open-Source Operating System for Your Personal
Computer</ulink>, 出版商: The Bit Tree Press, 2001.
ISBN: 0971204500</para>
</listitem>
<listitem>
<para>Teach Yourself FreeBSD in 24 Hours, 出版商:
<ulink url="http://www.samspublishing.com/">Sams</ulink>, 2002.
ISBN: 0672324245</para>
</listitem>
<listitem>
<para>FreeBSD unleashed, 出版商:
<ulink url="http://www.samspublishing.com/">Sams</ulink>, 2002.
ISBN: 0672324563</para>
</listitem>
<listitem>
<para>FreeBSD: The Complete Reference, 出版商:
<ulink url="http://books.mcgraw-hill.com">McGrawHill</ulink>, 2003.
ISBN: 0072224096 </para>
</listitem>
</itemizedlist>
</sect1>
<sect1 id="bibliography-userguides">
<title>用户指南</title>
<itemizedlist>
<listitem>
<para>Computer Systems Research Group, UC Berkeley. <emphasis>4.4BSD
User's Reference Manual</emphasis>. O'Reilly &amp; Associates,
Inc., 1994. ISBN 1-56592-075-9</para>
</listitem>
<listitem>
<para>Computer Systems Research Group, UC Berkeley. <emphasis>4.4BSD
User's Supplementary Documents</emphasis>. O'Reilly &amp;
Associates, Inc., 1994. ISBN 1-56592-076-7</para>
</listitem>
<listitem>
<para><emphasis>UNIX in a Nutshell</emphasis>. O'Reilly &amp;
Associates, Inc., 1990. ISBN 093717520X</para>
</listitem>
<listitem>
<para>Mui, Linda. <emphasis>What You Need To Know When You Can't Find
Your UNIX System Administrator</emphasis>. O'Reilly &amp;
Associates, Inc., 1995. ISBN 1-56592-104-6</para>
</listitem>
<listitem>
<para><ulink url="http://www-wks.acs.ohio-state.edu/">Ohio State
University</ulink> 编写了一份 <ulink
url="http://www-wks.acs.ohio-state.edu/unix_course/unix.html">UNIX
介绍性课程</ulink> ,并提供在线的 HTML 和 PostScript 版本。</para>
</listitem>
<listitem>
<para>这份文档的意大利文 <ulink
url="&url.doc.base;/it_IT.ISO8859-15/books/unix-introduction/index.html">翻译</ulink>
是 FreeBSD Italian Documentation Project 的一部分。</para>
</listitem>
<listitem>
<para><ulink url="http://www.jp.FreeBSD.org/">Jpman Project, Japan
FreeBSD Users Group</ulink>. <ulink
url="http://www.pc.mycom.co.jp/FreeBSD/urm.html">FreeBSD User's
Reference Manual</ulink> (日文译本). <ulink
url="http://www.pc.mycom.co.jp/">Mainichi Communications
Inc.</ulink>, 1998. ISBN4-8399-0088-4 P3800E.</para>
</listitem>
<listitem>
<para><ulink url="http://www.ed.ac.uk/">Edinburgh
University</ulink> has written an <ulink
url="http://unixhelp.ed.ac.uk/">Online Guide</ulink> for
newcomers to the UNIX environment.</para>
</listitem>
</itemizedlist>
</sect1>
<sect1 id="bibliography-adminguides">
<title>管理员指南</title>
<itemizedlist>
<listitem>
<para>Albitz, Paul and Liu, Cricket. <emphasis>DNS and
BIND</emphasis>, 4th Ed. O'Reilly &amp; Associates, Inc., 2001.
ISBN 1-59600-158-4</para>
</listitem>
<listitem>
<para>Computer Systems Research Group, UC Berkeley. <emphasis>4.4BSD
System Manager's Manual</emphasis>. O'Reilly &amp; Associates,
Inc., 1994. ISBN 1-56592-080-5</para>
</listitem>
<listitem>
<para>Costales, Brian, et al. <emphasis>Sendmail</emphasis>, 2nd Ed.
O'Reilly &amp; Associates, Inc., 1997. ISBN 1-56592-222-0</para>
</listitem>
<listitem>
<para>Frisch, &AElig;leen. <emphasis>Essential System
Administration</emphasis>, 2nd Ed. O'Reilly &amp; Associates,
Inc., 1995. ISBN 1-56592-127-5</para>
</listitem>
<listitem>
<para>Hunt, Craig. <emphasis>TCP/IP Network
Administration</emphasis>, 2nd Ed. O'Reilly &amp; Associates, Inc., 1997.
ISBN 1-56592-322-7</para>
</listitem>
<listitem>
<para>Nemeth, Evi. <emphasis>UNIX System Administration
Handbook</emphasis>. 3rd Ed. Prentice Hall, 2000. ISBN
0-13-020601-6</para>
</listitem>
<listitem>
<para>Stern, Hal <emphasis>Managing NFS and NIS</emphasis> O'Reilly
&amp; Associates, Inc., 1991. ISBN 0-937175-75-7</para>
</listitem>
<listitem>
<para><ulink url="http://www.jp.FreeBSD.org/">Jpman Project, Japan
FreeBSD Users Group</ulink>. <ulink
url="http://www.pc.mycom.co.jp/FreeBSD/sam.html">FreeBSD System
Administrator's Manual</ulink> (日文译本). <ulink
url="http://www.pc.mycom.co.jp/">Mainichi Communications
Inc.</ulink>, 1998. ISBN4-8399-0109-0 P3300E.</para>
</listitem>
<listitem>
<para>Dreyfus, Emmanuel. <ulink
url="http://www.eyrolles.com/Informatique/Livre/9782212114638/">Cahiers
de l'Admin: BSD</ulink> 2nd Ed. (in French), Eyrolles, 2004.
ISBN 2-212-11463-X</para>
</listitem>
</itemizedlist>
</sect1>
<sect1 id="bibliography-programmers">
<title>开发指南</title>
<itemizedlist>
<listitem>
<para>Asente, Paul, Converse, Diana, and Swick, Ralph.
<emphasis>X Window System Toolkit</emphasis>. Digital Press,
1998. ISBN 1-55558-178-1</para>
</listitem>
<listitem>
<para>Computer Systems Research Group, UC Berkeley. <emphasis>4.4BSD
Programmer's Reference Manual</emphasis>. O'Reilly &amp;
Associates, Inc., 1994. ISBN 1-56592-078-3</para>
</listitem>
<listitem>
<para>Computer Systems Research Group, UC Berkeley. <emphasis>4.4BSD
Programmer's Supplementary Documents</emphasis>. O'Reilly &amp;
Associates, Inc., 1994. ISBN 1-56592-079-1</para>
</listitem>
<listitem>
<para>Harbison, Samuel P. and Steele, Guy L. Jr. <emphasis>C: A
Reference Manual</emphasis>. 4rd ed. Prentice Hall, 1995.
ISBN 0-13-326224-3</para>
</listitem>
<listitem>
<para>Kernighan, Brian and Dennis M. Ritchie. <emphasis>The C
Programming Language.</emphasis>. PTR Prentice Hall, 1988.
ISBN 0-13-110362-9</para>
</listitem>
<listitem>
<para>Lehey, Greg. <emphasis>Porting UNIX Software</emphasis>.
O'Reilly &amp; Associates, Inc., 1995. ISBN 1-56592-126-7</para>
</listitem>
<listitem>
<para>Plauger, P. J. <emphasis>The Standard C Library</emphasis>.
Prentice Hall, 1992. ISBN 0-13-131509-9</para>
</listitem>
<listitem>
<para>Spinellis, Diomidis. <ulink
url="http://www.spinellis.gr/codereading/"><emphasis>Code
Reading: The Open Source Perspective</emphasis></ulink>.
Addison-Wesley, 2003. ISBN 0-201-79940-5</para>
</listitem>
<listitem>
<para>Stevens, W. Richard. <emphasis>Advanced Programming in the UNIX
Environment</emphasis>. Reading, Mass. : Addison-Wesley, 1992.
ISBN 0-201-56317-7</para>
</listitem>
<listitem>
<para>Stevens, W. Richard. <emphasis>UNIX Network
Programming</emphasis>. 2nd Ed, PTR Prentice Hall, 1998. ISBN
0-13-490012-X</para>
</listitem>
<listitem>
<para>Wells, Bill. <quote>Writing Serial Drivers for UNIX</quote>.
<emphasis>Dr. Dobb's Journal</emphasis>. 19(15), December 1994.
pp68-71, 97-99.</para>
</listitem>
</itemizedlist>
</sect1>
<sect1 id="bibliography-osinternals">
<title>操作系统原理</title>
<itemizedlist>
<listitem>
<para>Andleigh, Prabhat K. <emphasis>UNIX System
Architecture</emphasis>. Prentice-Hall, Inc., 1990. ISBN
0-13-949843-5</para>
</listitem>
<listitem>
<para>Jolitz, William. <quote>Porting UNIX to the 386</quote>.
<emphasis>Dr. Dobb's Journal</emphasis>. 1991年1月 - 1992年6月 </para>
</listitem>
<listitem>
<para>Leffler, Samuel J., Marshall Kirk McKusick, Michael J Karels and
John Quarterman <emphasis>The Design and Implementation of the
4.3BSD UNIX Operating System</emphasis>. Reading, Mass. :
Addison-Wesley, 1989. ISBN 0-201-06196-1</para>
</listitem>
<listitem>
<para>Leffler, Samuel J., Marshall Kirk McKusick, <emphasis>The Design
and Implementation of the 4.3BSD UNIX Operating System: Answer
Book</emphasis>. Reading, Mass. : Addison-Wesley, 1991. ISBN
0-201-54629-9</para>
</listitem>
<listitem>
<para>McKusick, Marshall Kirk, Keith Bostic, Michael J Karels, and
John Quarterman. <emphasis>The Design and Implementation of the
4.4BSD Operating System</emphasis>. Reading, Mass. :
Addison-Wesley, 1996. ISBN 0-201-54979-4</para>
<para>(这本书的第二章的 <ulink
url="&url.books.design-44bsd;/book.html">在线版本</ulink> 是
FreeBSD Documentation Project的一部分, 此外,第九章可以在 <ulink
url="http://www.netapp.com/tech_library/nfsbook.print">
这里</ulink>找到.)</para>
</listitem>
<listitem>
<para>Marshall Kirk McKusick, George V. Neville-Neil<emphasis>The Design
and Implementation of the FreeBSD UNIX Operating System</emphasis>.
Boston, Mass. : Addison-Wesley, 2004. ISBN 0-201-70245-2</para>
</listitem>
<listitem>
<para>Stevens, W. Richard. <emphasis>TCP/IP Illustrated, Volume 1:
The Protocols</emphasis>. Reading, Mass. : Addison-Wesley,
1996. ISBN 0-201-63346-9</para>
</listitem>
<listitem>
<para>Schimmel, Curt. <emphasis>Unix Systems for Modern
Architectures</emphasis>. Reading, Mass. : Addison-Wesley, 1994.
ISBN 0-201-63338-8</para>
</listitem>
<listitem>
<para>Stevens, W. Richard. <emphasis>TCP/IP Illustrated, Volume 3:
TCP for Transactions, HTTP, NNTP and the UNIX Domain
Protocols</emphasis>. Reading, Mass. : Addison-Wesley, 1996.
ISBN 0-201-63495-3</para>
</listitem>
<listitem>
<para>Vahalia, Uresh. <emphasis>UNIX Internals -- The New
Frontiers</emphasis>. Prentice Hall, 1996. ISBN
0-13-101908-2</para>
</listitem>
<listitem>
<para>Wright, Gary R. and W. Richard Stevens. <emphasis>TCP/IP
Illustrated, Volume 2: The Implementation</emphasis>. Reading,
Mass. : Addison-Wesley, 1995. ISBN 0-201-63354-X</para>
</listitem>
</itemizedlist>
</sect1>
<sect1 id="bibliography-security">
<title>信息安全方面的参考文献</title>
<itemizedlist>
<listitem>
<para>Cheswick, William R. and Steven M. Bellovin. <emphasis>Firewalls
and Internet Security: Repelling the Wily Hacker</emphasis>.
Reading, Mass. : Addison-Wesley, 1995. ISBN
0-201-63357-4</para>
</listitem>
<listitem>
<para>Garfinkel, Simson and Gene Spafford.
<emphasis>Practical UNIX &amp; Internet Security</emphasis>.
2nd Ed. O'Reilly &amp; Associates, Inc., 1996. ISBN
1-56592-148-8</para>
</listitem>
<listitem>
<para>Garfinkel, Simson. <emphasis>PGP Pretty Good
Privacy</emphasis> O'Reilly &amp; Associates, Inc., 1995. ISBN
1-56592-098-8</para>
</listitem>
</itemizedlist>
</sect1>
<sect1 id="bibliography-hardware">
<title>硬件参考</title>
<itemizedlist>
<listitem>
<para>Anderson, Don and Tom Shanley. <emphasis>Pentium Processor
System Architecture</emphasis>. 2nd Ed. Reading, Mass. :
Addison-Wesley, 1995. ISBN 0-201-40992-5</para>
</listitem>
<listitem>
<para>Ferraro, Richard F. <emphasis>Programmer's Guide to the EGA,
VGA, and Super VGA Cards</emphasis>. 3rd ed. Reading, Mass. :
Addison-Wesley, 1995. ISBN 0-201-62490-7</para>
</listitem>
<listitem>
<para>Intel 公司在他们的 <ulink
url="http://developer.intel.com/">开发人员网站</ulink>上,
提供了关于他们的 CPU芯片组以及标准的文档。多数是PDF文件.</para>
</listitem>
<listitem>
<para>Shanley, Tom. <emphasis>80486 System Architecture</emphasis>.
3rd ed. Reading, Mass. : Addison-Wesley, 1995. ISBN
0-201-40994-1</para>
</listitem>
<listitem>
<para>Shanley, Tom. <emphasis>ISA System Architecture</emphasis>.
3rd ed. Reading, Mass. : Addison-Wesley, 1995. ISBN
0-201-40996-8</para>
</listitem>
<listitem>
<para>Shanley, Tom. <emphasis>PCI System Architecture</emphasis>.
4th ed. Reading, Mass. : Addison-Wesley, 1999. ISBN
0-201-30974-2</para>
</listitem>
<listitem>
<para>Van Gilluwe, Frank. <emphasis>The Undocumented PC</emphasis>, 2nd Ed.
Reading, Mass: Addison-Wesley Pub. Co., 1996. ISBN
0-201-47950-8</para>
</listitem>
<listitem>
<para>Messmer, Hans-Peter. <emphasis>The Indispensable PC Hardware Book</emphasis>, 4th Ed.
Reading, Mass: Addison-Wesley Pub. Co., 2002. ISBN
0-201-59616-4</para>
</listitem>
</itemizedlist>
</sect1>
<sect1 id="bibliography-history">
<title>&unix; 历史</title>
<itemizedlist>
<listitem>
<para>Lion, John <emphasis>Lion's Commentary on UNIX, 6th Ed. With
Source Code</emphasis>. ITP Media Group, 1996. ISBN
1573980137</para>
</listitem>
<listitem>
<para>Raymond, Eric S. <emphasis>The New Hacker's Dictionary, 3rd
edition</emphasis>. MIT Press, 1996. ISBN
0-262-68092-0. 它也被称作 <ulink
url="http://www.catb.org/~esr/jargon/html/index.html">Jargon
File</ulink></para>
</listitem>
<listitem>
<para>Salus, Peter H. <emphasis>A quarter century of UNIX</emphasis>.
Addison-Wesley Publishing Company, Inc., 1994. ISBN
0-201-54777-5</para>
</listitem>
<listitem>
<para>Simon Garfinkel, Daniel Weise, Steven Strassmann. <emphasis>The
UNIX-HATERS Handbook</emphasis>. IDG Books Worldwide, Inc.,
1994. ISBN 1-56884-203-1</para>
</listitem>
<listitem>
<para>Don Libes, Sandy Ressler <emphasis>Life with UNIX</emphasis>
&mdash; special edition. Prentice-Hall, Inc., 1989. ISBN
0-13-536657-7</para>
</listitem>
<listitem>
<para><emphasis>BSD 族谱</emphasis>.
<ulink url="http://www.FreeBSD.org/cgi/cvsweb.cgi/src/share/misc/bsd-family-tree"></ulink>
或在任何一台较新的 FreeBSD 机器中的 <ulink type="html" url="file://localhost/usr/share/misc/bsd-family-tree"><filename>/usr/share/misc/bsd-family-tree</filename></ulink>
。</para>
</listitem>
<listitem>
<para><emphasis>The BSD Release Announcements collection</emphasis>.
1997. <ulink url="http://www.de.FreeBSD.org/de/ftp/releases/"></ulink></para>
</listitem>
<listitem>
<para><emphasis>Networked Computer Science Technical Reports
Library</emphasis>. <ulink url="http://www.ncstrl.org/"></ulink></para>
</listitem>
<listitem>
<para><emphasis>Old BSD releases from the Computer Systems Research
group (CSRG)</emphasis>.
<ulink url="http://www.mckusick.com/csrg/"></ulink>:
The 4CD set covers all BSD versions from 1BSD to 4.4BSD and
4.4BSD-Lite2 (but not 2.11BSD, unfortunately). As well, the last
disk holds the final sources plus the SCCS files.</para>
</listitem>
</itemizedlist>
</sect1>
<sect1 id="bibliography-journals">
<title>各种期刊</title>
<itemizedlist>
<listitem>
<para><emphasis>The C/C++ Users Journal</emphasis>. R&amp;D
Publications Inc. ISSN 1075-2838</para>
</listitem>
<listitem>
<para><emphasis>Sys Admin &mdash; The Journal for UNIX System
Administrators</emphasis> Miller Freeman, Inc., ISSN
1061-2688</para>
</listitem>
<listitem>
<para><emphasis>freeX &mdash; Das Magazin f&uuml;r Linux - BSD - UNIX</emphasis>
(德文) Computer- und Literaturverlag GmbH, ISSN 1436-7033</para>
</listitem>
</itemizedlist>
</sect1>
</appendix>
<!--
Local Variables:
mode: sgml
sgml-declaration: "../appendix.decl"
sgml-indent-data: t
sgml-omittag: nil
sgml-always-quote-attributes: t
sgml-parent-document: ("../book.sgml" "part" "appendix")
End:
-->

@ -0,0 +1,297 @@
<!--
The FreeBSD Documentation Project
The FreeBSD Chinese (Simplified) Documentation Project
Original Revision: 1.156
$FreeBSD$
-->
<!DOCTYPE BOOK PUBLIC "-//FreeBSD//DTD DocBook V4.1-Based Extension//EN" [
<!ENTITY % books.ent PUBLIC "-//FreeBSD//ENTITIES DocBook FreeBSD Books Entity Set//EN">
%books.ent;
<!ENTITY % chapters SYSTEM "chapters.ent">
%chapters;
<!ENTITY % txtfiles SYSTEM "txtfiles.ent">
%txtfiles;
<!ENTITY % not.published "INCLUDE">
<!ENTITY % chap.introduction "IGNORE">
<!ENTITY % chap.install "IGNORE">
<!ENTITY % chap.basics "IGNORE">
<!ENTITY % chap.ports "IGNORE">
<!ENTITY % chap.config "IGNORE">
<!ENTITY % chap.boot "IGNORE">
<!ENTITY % chap.users "IGNORE">
<!ENTITY % chap.kernelconfig "IGNORE">
<!ENTITY % chap.security "IGNORE">
<!ENTITY % chap.printing "IGNORE">
<!ENTITY % chap.disks "IGNORE">
<!ENTITY % chap.vinum "IGNORE">
<!ENTITY % chap.x11 "IGNORE">
<!ENTITY % chap.l10n "IGNORE">
<!ENTITY % chap.multimedia "IGNORE">
<!ENTITY % chap.desktop "IGNORE">
<!ENTITY % chap.serialcomms "IGNORE">
<!ENTITY % chap.ppp-and-slip "IGNORE">
<!ENTITY % chap.advanced-networking "IGNORE">
<!ENTITY % chap.network-servers "IGNORE">
<!ENTITY % chap.mail "IGNORE">
<!ENTITY % chap.cutting-edge "IGNORE">
<!ENTITY % chap.linuxemu "IGNORE">
<!ENTITY % chap.mirrors "IGNORE">
<!ENTITY % chap.bibliography "IGNORE">
<!ENTITY % chap.eresources "IGNORE">
<!ENTITY % chap.pgpkeys "IGNORE">
<!ENTITY % chap.index "IGNORE">
<!ENTITY % chap.freebsd-glossary "IGNORE">
<!ENTITY % chap.mac "IGNORE">
<!ENTITY % pgpkeys SYSTEM "../../../share/pgpkeys/pgpkeys.ent"> %pgpkeys;
]>
<book>
<bookinfo>
<title>FreeBSD 使用手册</title>
<corpauthor>The FreeBSD Documentation Project</corpauthor>
<corpauthor>FreeBSD 中文化项目</corpauthor>
<pubdate>1999年二月</pubdate>
<copyright>
<year>1995</year>
<year>1996</year>
<year>1997</year>
<year>1998</year>
<year>1999</year>
<year>2000</year>
<year>2001</year>
<year>2002</year>
<year>2003</year>
<year>2004</year>
<holder>The FreeBSD Documentation Project</holder>
</copyright>
&bookinfo.legalnotice;
<legalnotice id="trademarks" role="trademarks">
&tm-attrib.freebsd;
&tm-attrib.3com;
&tm-attrib.3ware;
&tm-attrib.arm;
&tm-attrib.adaptec;
&tm-attrib.adobe;
&tm-attrib.apple;
&tm-attrib.corel;
&tm-attrib.creative;
&tm-attrib.cvsup;
&tm-attrib.heidelberger;
&tm-attrib.ibm;
&tm-attrib.ieee;
&tm-attrib.intel;
&tm-attrib.intuit;
&tm-attrib.linux;
&tm-attrib.lsilogic;
&tm-attrib.m-systems;
&tm-attrib.macromedia;
&tm-attrib.microsoft;
&tm-attrib.netscape;
&tm-attrib.nexthop;
&tm-attrib.opengroup;
&tm-attrib.oracle;
&tm-attrib.powerquest;
&tm-attrib.realnetworks;
&tm-attrib.redhat;
&tm-attrib.sap;
&tm-attrib.sun;
&tm-attrib.symantec;
&tm-attrib.themathworks;
&tm-attrib.thomson;
&tm-attrib.usrobotics;
&tm-attrib.vmware;
&tm-attrib.waterloomaple;
&tm-attrib.wolframresearch;
&tm-attrib.xfree86;
&tm-attrib.xiph;
&tm-attrib.general;
</legalnotice>
<abstract>
<para>欢迎使用 FreeBSD! 本手册适用于安装 <emphasis>FreeBSD &rel2.current;-RELEASE</emphasis>
和 <emphasis>FreeBSD &rel.current;-RELEASE</emphasis> 以及它们的日常使用。
这个手册目前由很多人 <emphasis>持续地</emphasis> 维护。其中的内容需要不断的添加和更新。
如果您有兴趣参加这个项目,请发邮件到 &a.doc;。此文档最新的版本可以从 <ulink
url="http://www.FreeBSD.org/">FreeBSD Web站点</ulink> 上获得。
其他的各种格式和压缩的文档可以从 <ulink
url="ftp://ftp.FreeBSD.org/pub/FreeBSD/doc/">FreeBSD 的 FTP
服务器</ulink>或下列其中的一个<link
linkend="mirrors-ftp">镜像站点</link>下载获得。如果您更希望得到一份印刷版本的手册,可以从
<ulink url="http://www.FreeBSDmall.com/">FreeBSD Mall</ulink> 购买. 您还可以<ulink
url="&url.base;/search/index.html">搜索手册</ulink>。</para>
</abstract>
</bookinfo>
&chap.preface;
<part id="getting-started">
<title>起步</title>
<partintro>
<para>手册的以下章节主要是针对刚开始使用 FreeBSD 的用户及管理员:</para>
<itemizedlist>
<listitem>
<para>FreeBSD 入门。</para>
</listitem>
<listitem>
<para>安装过程向导。</para>
</listitem>
<listitem>
<para>教您 &unix; 基本知识和基本原理。</para>
</listitem>
<listitem>
<para>展示如何在 FreeBSD 上安装大量的第三方应用。</para>
</listitem>
<listitem>
<para>介绍使用 X&unix; 窗口系统,以及为一些生产环境配置桌面环境的细节。</para>
</listitem>
</itemizedlist>
<para>我们尝试用最少的页数来保持前言的索引,以至于可以用最少翻页次数将该手册从头至尾读过。</para>
</partintro>
<![ %chap.introduction; [ &chap.introduction; ]]>
<![ %chap.install; [ &chap.install; ]]>
<![ %chap.basics; [ &chap.basics; ]]>
<![ %chap.ports; [ &chap.ports; ]]>
<![ %chap.x11; [ &chap.x11; ]]>
</part>
<part id="common-tasks">
<title>常见的任务</title>
<partintro>
<para>前面已经介绍了必要的基础知识, 手册的这一部分将讨论 FreeBSD 的一些最常用的功能。
这些章节包括:</para>
<itemizedlist>
<listitem>
<para>向您介绍流行和实用的桌面应用程序:
浏览器、产品工具、文档察看程序,等等。</para>
</listitem>
<listitem>
<para>向您介绍一系列可以在 FreeBSD 上使用的多媒体工具。</para>
</listitem>
<listitem>
<para>介绍构建定制的 FreeBSD 内核以启用附加功能的方法。</para>
</listitem>
<listitem>
<para>详细介绍包括桌面和网络打印机在内的打印系统设置。</para>
</listitem>
<listitem>
<para>向您展示如何在 FreeBSD 上运行 Linux 应用程序。</para>
</listitem>
</itemizedlist>
<para>某些章节希望您首先阅读过其他部分,在这些章的开头部分也会给出类似的提示。</para>
</partintro>
<![ %chap.desktop; [ &chap.desktop; ]]>
<![ %chap.multimedia; [ &chap.multimedia; ]]>
<![ %chap.kernelconfig; [ &chap.kernelconfig; ]]>
<![ %chap.printing; [ &chap.printing; ]]>
<![ %chap.linuxemu; [ &chap.linuxemu; ]]>
</part>
<part id="system-administration">
<title>系统管理</title>
<partintro>
<para>FreeBSD 手册中其余章节的内容都是关于系统管理。每一章节都从描述开始,由浅入深。</para>
<para>这些章节被设计成很多相对完整的部分,如果您需要了解某部分内容,直接阅读这部分内容即可,无需按照顺序,也不用在您使用 FreeBSD 的时候需要先读一遍。</para>
</partintro>
<![ %chap.config; [ &chap.config; ]]>
<![ %chap.boot; [ &chap.boot; ]]>
<![ %chap.users; [ &chap.users; ]]>
<![ %chap.security; [ &chap.security; ]]>
<![ %chap.mac; [ &chap.mac; ]]>
<![ %chap.disks; [ &chap.disks; ]]>
<![ %chap.vinum; [ &chap.vinum; ]]>
<![ %chap.l10n; [ &chap.l10n; ]]>
<![ %chap.cutting-edge; [ &chap.cutting-edge; ]]>
</part>
<part id="network-communication">
<title>网络通讯</title>
<partintro>
<para>FreeBSD 是目前以高性能网络服务为目的而部署范围最广的操作系统之一。
讨论这些话题的章节包括:</para>
<itemizedlist>
<listitem>
<para>串口通讯</para>
</listitem>
<listitem>
<para>PPP 和以太网上的 PPP</para>
</listitem>
<listitem>
<para>电子邮件</para>
</listitem>
<listitem>
<para>运行网络服务</para>
</listitem>
<listitem>
<para>其他高级网络话题</para>
</listitem>
</itemizedlist>
<para>这些章节主要供您在需要时参考。
不需要以特定的顺序来阅读它们, 此外, 您开始在网络中使用 FreeBSD 之前也不必把它们都读完。</para>
</partintro>
<![ %chap.serialcomms; [ &chap.serialcomms; ]]>
<![ %chap.ppp-and-slip; [ &chap.ppp-and-slip; ]]>
<![ %chap.mail; [ &chap.mail; ]]>
<![ %chap.network-servers; [ &chap.network-servers; ]]>
<![ %chap.advanced-networking; [ &chap.advanced-networking; ]]>
</part>
<part id="appendices">
<title>附录</title>
<![ %chap.mirrors; [ &chap.mirrors; ]]>
<![ %chap.bibliography; [ &chap.bibliography; ]]>
<![ %chap.eresources; [ &chap.eresources; ]]>
<![ %chap.pgpkeys; [ &chap.pgpkeys; ]]>
</part>
<![ %chap.freebsd-glossary; [ &bookinfo.freebsd-glossary; ]]>
<![ %chap.index; [ &chap.index; ]]>
&chap.colophon;
</book>
<!--
Local Variables:
mode: sgml
sgml-indent-data: t
sgml-omittag: nil
sgml-always-quote-attributes: t
End:
-->

@ -0,0 +1,16 @@
#
# Build the Handbook with just the content from this chapter.
#
# Original revision: 1.1
# $FreeBSD$
#
CHAPTERS= boot/chapter.sgml
VPATH= ..
MASTERDOC= ${.CURDIR}/../${DOC}.${DOCBOOKSUFFIX}
DOC_PREFIX?= ${.CURDIR}/../../../..
.include "../Makefile"

@ -0,0 +1,694 @@
<!--
The FreeBSD Documentation Project
The FreeBSD Chinese (Simplified) Project
Original Revision: 1.56
$FreeBSD$
-->
<chapter id="boot"> <title>FreeBSD 引导过程</title>
<sect1 id="boot-synopsis"> <title>概述</title>
<indexterm><primary>引导</primary></indexterm>
<para>启动电脑以及加载操作系统的过程被称为<quote>引导过程</quote>
或者简称为<quote>引导</quote>。
FreeBSD 的引导过程给用户自定义启动提供了很大的伸缩性,
您可以选择启动不同的操作系统,或者是同一系统的不同版本及内核。</para>
<para>本章将详细介绍您能在 FreeBSD 引导过程中设置的配置选项。
这包括了引导内核、探测设备并启动 &man.init.8; 等等之前所发生的所有事情。
这些事项一般发生在文本由白变灰时。</para>
<para>读完这章您将会知道:</para>
<itemizedlist>
<listitem>
<para>FreeBSD 引导系统里的各项组件,
以及它们之间的交互方式.</para>
</listitem>
<listitem>
<para>在 FreeBSD 引导时给各组件配置选项以控制引导过程。</para>
</listitem>
<listitem>
<para> &man.device.hints.5;的基本知识。</para>
</listitem>
</itemizedlist>
<note>
<title>只适用于x86 </title>
<para>本章只描述了运行于 Intel x86 体系之上的 FreeBSD 的引导过程。</para>
</note>
</sect1>
<sect1 id="boot-introduction">
<title>引导问题</title>
<para>启动电脑及启动和引导操作系统构成了一个有趣的两难境地。
按照定义在操作系统被启动之前计算机是无法完成任何任务的,包括运行磁盘上的程序。
如果计算机在没有操作系统的情况下不能运行来自于磁盘上的程序而操作系统又是放在磁盘上的,
那操作系统是如何启动的呢?</para>
<para>这个问题在 <citetitle>The Adventures of
Baron Munchausen</citetitle> 这本书中有类似的描述。
一个字符从管道中掉下来,克服重重困难抓住了引导程序,
活了下来。在以前,计算机术语<firstterm>bootstrap</firstterm>
指加载操作系统的机制,简称<quote>booting</quote>。</para>
<para>在 x86 硬件体系中,基本输入/输出系统 (BIOS) 负责加载操作系统,
为了做到这一点BIOS 在磁盘上寻找主引导记录 (MBR),而 MBR
必须在放置的磁盘的特定位置。BIOS 有足够的能力来读入和运行 MBR
且假使地认为 MBR 能完成加载操作系统的剩余任务。</para>
<indexterm>
<primary>BIOS</primary>
<secondary>基本输入/输出系统</secondary>
</indexterm>
<para>如果您只安装了一个操作系统,那么一个标准的 MBR 就足够了。
这个 MBR 先在磁盘上搜索可引导的分区,
然后运行分区上的代码以加载操作系统的其它部分。</para>
<para>如果您在磁盘上安装了多个操作系统那么您可以安装一个不同的
MBR它能显示一张操作系统的列表您能从中选择启动哪个。
FreeBSD 自带了一个这样的 MBR其它的操作系统厂商亦提供可选的
MBR。</para>
<para>启动系统的剩余部分被分为三个阶段。第一阶段由
MBR 执行,它只是使计算机进入特定的状态然后执行第二阶段。
第二阶段稍微干得多一些。第三阶段完成加载操作系统的任务。
工作被分为三个阶段是因为 PC 标准对第一第二阶段执行的程序的大小有所限制。
把这些任务连在一起使得 FreeBSD 可以提供更大伸缩性的加载器 (loader)。</para>
<indexterm><primary>内核</primary></indexterm>
<indexterm><primary><command>init</command></primary></indexterm>
<para>然后内核启动,它开始探测设备并初始化它们。
一旦内核引导进程完成任务,内核将控制权交给用户进程 &man.init.8;
它确认磁盘是否处于可用状态。&man.init.8; 然后开始用户级资源配置:
加载文件系统启动网卡,及粗略地启动所有 FreeBSD
系统加载时经常运行的进程。</para>
</sect1>
<sect1 id="boot-blocks">
<title>MBR 和引导阶段一、二、三</title>
<sect2 id="boot-boot0">
<title>MBR<filename>/boot/boot0</filename></title>
<indexterm><primary>主引导记录 (MBR)</primary></indexterm>
<para> FreeBSD MBR 放置在 <filename>/boot/boot0</filename>。
这是真实 MBR 的一份 <emphasis>复制品</emphasis>,真正的 MBR
必须放在磁盘上 FreeBSD 分区以外的特定部分。</para>
<para><filename>boot0</filename> 是非常简单的,因为在
<abbrev>MBR</abbrev> 里的代码只有 512 字节。
如果您安装了 FreeBSD MBR 且装了多个操作系统,
在引导时您会看到如下的内容:</para>
<example id="boot-boot0-example">
<title><filename>boot0</filename> 截屏</title>
<screen>F1 DOS
F2 FreeBSD
F3 Linux
F4 ??
F5 Drive 1
Default: F2</screen>
</example>
<para>其它操作系统,特别是 &windows;&nbsp;95以用自己的
MBR 覆盖现有 MBR 而著称。如果发生了这种事情,或者您想用
FreeBSD 的 MBR 覆盖现有的 MBR您可以使用以下的命令</para>
<screen>&prompt.root; <userinput>fdisk -B -b /boot/boot0 <replaceable>device</replaceable></userinput></screen>
<para><replaceable>device</replaceable> 是要写入 MBR
的设备名,比如 <devicename>ad0</devicename>
代表第一个 IDE 磁盘,<devicename>ad2</devicename>
代表第二个 IDE 控制器上的第一个 IDE 磁盘,
<devicename>da0</devicename> 代表第一个 SCSI 磁盘,等等。</para>
<para>如果您是 linux 用户,您可能更喜欢使用
<application>LILO</application> 来控制引导过程,您可以编辑
<filename>/etc/lilo.conf</filename> 文件,或者在安装 FreeBSD 过程中选择
<option>Leave The Master Boot Record Untouched</option> 选项。
如果您安装了 FreeBSD 引导管理器,您可以启动 linux 然后更改
<application>LILO</application> 的配置文件
<filename>/etc/lilo.conf</filename>,加入以下的选项:</para>
<programlisting>other=/dev/hdXY
table=/dev/hdb
loader=/boot/chain.b
label=FreeBSD</programlisting>
<para>这样就可以通过
<application>LILO</application> 来引导 FreeBSD 和 linux 了。
在我们的例子中,我们使用
<replaceable>XY</replaceable> 确定驱动器号和分区。
如果您使用的是 <acronym>SCSI</acronym> 驱动器,您需要将
<replaceable>/dev/hdXY</replaceable> 改成 <replaceable>/dev/sdXY</replaceable>
这里再次使用了 <replaceable>XY</replaceable> 的语法。
如果您安装的两个系统在同一驱动器上,<option>loader=/boot/chain.b</option>
选项可以去掉。现在您可以执行 <command>/sbin/lilo -v</command>
使修改生效。</para>
</sect2>
<sect2 id="boot-boot1">
<title>第一阶段,<filename>/boot/boot1</filename>,和第二阶段,
<filename>/boot/boot2</filename></title>
<para>概念上,第一,第二阶段同属于一个程序,处于磁盘的相同区域。但由于空间限制,
它们被分为两部分。可是您总是会一起安装它们。</para>
<para>它们放置在引导分区的引导扇区里。在引导扇区里能找到 <link
linkend="boot-boot0">boot0</link>、<abbrev>MBR</abbrev>
以及其它用于引导系统的程序。<filename>/boot</filename>
目录下的文件是真实文件的拷贝,真实文件放置在 FreeBSD
文件系统之外。</para>
<para><filename>boot1</filename> 非常简单,因为它再多也只能有 512 字节,
只能识别储存着分区信息的 <firstterm>disklabel</firstterm>
及寻找执行 <filename>boot2</filename>。</para>
<para><filename>boot2</filename> 稍微有点加强,能够理解 FreeBSD
的文件系统以便于寻找里面的文件,
能提供选择内核和加载器的简单界面。</para>
<para>因为 <link linkend="boot-loader">loader</link> 有着更强的功能,
提供了一套易于使用的引导配置,<filename>boot2</filename> 一般都执行 loader
但以前它的任务是直接运行内核。</para>
<example id="boot-boot2-example">
<title><filename>boot2</filename> 的屏幕输出</title>
<screen>&gt;&gt; FreeBSD/i386 BOOT
Default: 0:ad(0,a)/kernel
boot:</screen>
</example>
<para>如果您要更改已安装的 <filename>boot1</filename> 和
<filename>boot2</filename>,请使用命令
&man.disklabel.8;。</para>
<screen>&prompt.root; <userinput>disklabel -B <replaceable>diskslice</replaceable></userinput></screen>
<para><replaceable>diskslice</replaceable> 是用于引导的磁盘和分区,
比如 <devicename>ad0s1</devicename>
代表第一个 IDE 磁盘上的第一个分区。</para>
<warning>
<title>dangerously dedicated</title>
<para>如果您在 &man.disklabel.8; 命令中只使用了磁盘名,比如
<devicename>ad0</devicename>,就会破坏磁盘上的所有分区。
这当然不是您所希望的,所以在按下 <keycap>回车</keycap> 之前
一定要对命令进行多次确认。</para>
</warning>
</sect2>
<sect2 id="boot-loader">
<title>第三阶段,<filename>/boot/loader</filename></title>
<indexterm><primary>boot-loader</primary></indexterm>
<para>加载器 (loader) 是三个阶段中的最后阶段,
且是放置在文件系统之中的,一般是文件
<filename>/boot/loader</filename>。</para>
<para>loader 被作为一种友好的配置方式,使用了一组内建且易用的命令集。
这些命令由一个强大的多的解释器支持构建,其本身带有复杂得多的命令集。</para>
<sect3 id="boot-loader-flow">
<title>Loader 程序流程</title>
<para>初始时loader 会探测控制台和磁盘,识别是从哪块盘引导的。
它会根据这些信息设置变量,
启动解释器以接受通过脚本或交互方式传来的用户命令。</para>
<indexterm><primary>loader</primary></indexterm>
<indexterm><primary>loader 配置</primary></indexterm>
<para>loader 然后会读取并运行 <filename>/boot/loader.rc</filename>
默认地读取 <filename>/boot/defaults/loader.conf</filename>
以设置可靠的默认变量,读取 <filename>/boot/loader.conf</filename>
对这些变量作本地修改。<filename>loader.rc</filename>
依据这些变量进行动作,加载任何被选择的模块和内核。</para>
<para>最后默认地loader 会停留 10 秒等待按键,
若没有发生中断,就开始引导内核。如果被中断,用户会得到一个命令行提示符,
在这里用户得更改变量、卸载所有模块、加载模块、最后引导
或重新引导。</para>
</sect3>
<sect3 id="boot-loader-commands">
<title>Loader 内建的命令</title>
<para>这些是最常用的 loader 命令.对所有可用命令的解释请参见
&man.loader.8;。</para>
<variablelist>
<varlistentry>
<term>autoboot<replaceable>seconds</replaceable></term>
<listitem>
<para>在给定的时间内如果没有中断发生就引导内核。它显示一个倒数计时,
默认的时间范围是 10 秒。</para>
</listitem>
</varlistentry>
<varlistentry>
<term>boot
<optional><replaceable>-options</replaceable></optional>
<optional><replaceable>kernelname</replaceable></optional></term>
<listitem>
<para>立即按照给定的选项 (如果有的话) 和内核名
(如果是内核的) 引导内核。</para>
</listitem>
</varlistentry>
<varlistentry>
<term>boot-conf</term>
<listitem>
<para>基于变量对各种模块进行自动配置 (和引导内核时发生的一样)。
您只须记住要先使用 <command>unload</command> 命令,
然后修改一些变量,比如 <envar>kernel</envar>。</para>
</listitem>
</varlistentry>
<varlistentry>
<term>help
<optional><replaceable>topic</replaceable></optional></term>
<listitem>
<para>显示从文件 <filename>/boot/loader.help</filename>
读取的帮助信息。如果给定的主题是 <literal>index</literal>
那么列出来的是所有可用的主题。</para>
</listitem>
</varlistentry>
<varlistentry>
<term>include <replaceable>filename</replaceable>
&hellip;</term>
<listitem>
<para>通过给定的文件名处理文件。文件被读入,然后被一行一行地解释。
任何错误都会立即中止 include 命令。</para>
</listitem>
</varlistentry>
<varlistentry>
<term>load <optional><option>-t</option>
<replaceable>type</replaceable></optional>
<replaceable>filename</replaceable></term>
<listitem>
<para>加载内核、内核模块,或者是给定类型的文件 (通过给定的文件名)。
任何在文件名后面的参数都会被传给文件。</para>
</listitem>
</varlistentry>
<varlistentry>
<term>ls <optional><option>-l</option></optional>
<optional><replaceable>path</replaceable></optional></term>
<listitem>
<para>显示给定路径或者是根目录 (如果路径没有指定) 下面的文件列表。
如果指定了 <option>-l</option> 选项,文件大小也会显示。</para>
</listitem>
</varlistentry>
<varlistentry>
<term>lsdev <optional><option>-v</option></optional></term>
<listitem>
<para>列出所有可以加载模块的设备。
如果指定了<option>-v</option> 选项,会显示出更多的细节。</para>
</listitem>
</varlistentry>
<varlistentry>
<term>lsmod <optional><option>-v</option></optional></term>
<listitem>
<para>显示已被加载的模块。如果指明了 <option>-v</option> 选项,
会显示更多的细节。</para>
</listitem>
</varlistentry>
<varlistentry>
<term>more <replaceable>filename</replaceable></term>
<listitem>
<para>显示指定的文件,每隔 <varname>LINES</varname> 停顿一次。</para>
</listitem>
</varlistentry>
<varlistentry>
<term>reboot</term>
<listitem>
<para>立即重启系统。</para>
</listitem>
</varlistentry>
<varlistentry>
<term>set <replaceable>variable</replaceable></term>
<term>set
<replaceable>variable</replaceable>=<replaceable>value</replaceable></term>
<listitem>
<para>设置 loader 的环境变量。</para>
</listitem>
</varlistentry>
<varlistentry>
<term>unload</term>
<listitem>
<para>移除所有已被加载的模块。</para>
</listitem>
</varlistentry>
</variablelist>
</sect3>
<sect3 id="boot-loader-examples">
<title>Loader 示例</title>
<para>这里有一些实际中 loader 用法的示例</para>
<itemizedlist>
<indexterm><primary>single-user mode</primary></indexterm>
<listitem>
<para>只是简单的引导默认内核,不同的是进入单用户模式:</para>
<screen><userinput>boot -s</userinput></screen>
</listitem>
<listitem>
<para>卸载默认内核和模块,然后加载旧的 (或者其它) 的内核:</para>
<indexterm>
<primary><filename>kernel.old</filename></primary>
</indexterm>
<screen><userinput>unload</userinput>
<userinput>load <replaceable>kernel.old</replaceable></userinput></screen>
<para>您可以使用被称为通用内核的 <filename>kernel.GENERIC</filename>
或者您以前安装的内核 <filename>kernel.old</filename>
(当您升级或配置了您自己的内核等时候)。</para>
<note>
<para>使用以下命令加载常用的模块和另一个内核:</para>
<screen><userinput>unload</userinput>
<userinput>set kernel="<replaceable>kernel.old</replaceable>"</userinput>
<userinput>boot-conf</userinput></screen></note>
</listitem>
<listitem>
<para>加载内核配置脚本:</para>
<screen><userinput>load -t userconfig_script <replaceable>/boot/kernel.conf</replaceable></userinput></screen>
</listitem>
</itemizedlist>
</sect3>
</sect2>
</sect1>
<sect1 id="boot-kernel">
<title>内核在引导时的交互</title>
<indexterm>
<primary>内核</primary>
<secondary>引导交互</secondary>
</indexterm>
<para>一旦内核被 <link
linkend="boot-loader">loader</link> (一般情况下) 或者 <link
linkend="boot-boot1">boot2</link> (越过 loader) 加载,
它将检查引导标志,如果有的话,就会进行必要的动作调整。</para>
<sect2 id="boot-kernel-bootflags">
<indexterm>
<primary>内核</primary>
<secondary>引导标志</secondary>
</indexterm>
<title>内核引导标志</title>
<para>这里是一些常用的引导标志:</para>
<variablelist id="boot-kernel-bootflags-list">
<varlistentry>
<term><option>-a</option></term>
<listitem>
<para>在内核初始化时,询问作为根加载的设备。</para>
</listitem>
</varlistentry>
<varlistentry>
<term><option>-C</option></term>
<listitem>
<para>从 CDROM 引导。</para>
</listitem>
</varlistentry>
<varlistentry>
<term><option>-c</option></term>
<listitem>
<para>运行 UserConfig (引导时的内核配置器)</para>
</listitem>
</varlistentry>
<varlistentry>
<term><option>-s</option></term>
<listitem>
<para>引导进入单用户模式</para>
</listitem>
</varlistentry>
<varlistentry>
<term><option>-v</option></term>
<listitem>
<para>在内核引导过程中显示更有的信息</para>
</listitem>
</varlistentry>
</variablelist>
<note>
<para>还有更多的引导标志,阅读 &man.boot.8;
以获取有关它们的信息。</para></note>
</sect2>
<!-- <sect2 id="boot-kernel-userconfig">
<title>UserConfig: 引导时的内核配置器</title>
<para> </para>
</sect2> -->
</sect1>
<sect1 id="device-hints">
<sect1info>
<authorgroup>
<author>
<firstname>Tom</firstname>
<surname>Rhodes</surname>
<contrib>Contributed by </contrib>
</author>
</authorgroup>
<!-- 18 OCT 2002 -->
</sect1info>
<indexterm>
<primary>device.hints</primary>
</indexterm>
<title>Device Hints</title>
<note><para>这是 FreeBSD&nbsp;5.0 及其以后版本的组件,
不存在于早前的版本中。</para></note>
<para>在初始化系统启动时,&man.loader.8; 会读取
&man.device.hints.5; 文件。这个文件以变量的形式储存着内核引导信息,
有时被称为 <quote>device hints</quote>。
设备驱动程序用<quote>device hints</quote>
对设备进行配置。</para>
<para>Device hints 也可以在 <link linkend="boot-loader">
第三阶段的boot loader</link> 的命令行提示符中指定。变量可以用
<command>set</command> 命令添加,<command>unset</command> 命令删除,
<command>show</command> 命令查看。在文件 <filename>/boot/device.hints</filename>
设置的变量亦可以在这里被覆盖。键入 boot loader
中的变量不是永久性的,在下次启动时就会被忘记。</para>
<para>一旦系统引导成功,&man.kenv.1; 命令可以用来清楚所有的变量。</para>
<para>文件 <filename>/boot/device.hints</filename> 的语法是一行一个变量,
使用<quote>#</quote>作为注释标记。
每行是按照如下方式组织的:</para>
<screen><userinput>hint.driver.unit.keyword="<replaceable>value</replaceable>"</userinput></screen>
<para>第三阶段 boot loader 的语法是:</para>
<screen><userinput>set hint.driver.unit.keyword=<replaceable>value</replaceable></userinput></screen>
<para><literal>driver</literal> 是设备驱动程序名,<literal>unit</literal>
是设备驱动程序单位名,<literal>keyword</literal> 是 hint 关键字。
关键字可以由以下选项组成:</para>
<itemizedlist>
<listitem>
<para><literal>at</literal>:指明设备所绑定的总线</para>
</listitem>
<listitem>
<para><literal>port</literal>:指明所使用 <acronym>I/O</acronym>
的起始地址。</para>
</listitem>
<listitem>
<para><literal>irq</literal>:指明所使用的中断请求号。</para>
</listitem>
<listitem>
<para><literal>drq</literal>:指明 DMA channel 号。</para>
</listitem>
<listitem>
<para><literal>maddr</literal>:指明设备占用的物理内存地址。</para>
</listitem>
<listitem>
<para><literal>flags</literal>:给设备设置各种标志位。</para>
</listitem>
<listitem>
<para><literal>disabled</literal>:如果设成 <literal>1</literal>
设备被禁用。</para>
</listitem>
</itemizedlist>
<para>设备驱动程序能够接受更多的 hints推荐您参看它们的联机手册。参看
&man.device.hints.5;、&man.kenv.1;、&man.loader.conf.5; 和
&man.loader.8; 联机手册以获取更多的信息。</para>
</sect1>
<sect1 id="boot-init">
<indexterm>
<primary><command>init</command></primary>
</indexterm>
<title>Init进程控制及初始化</title>
<para>一旦内核完成引导,它就把控制权交给了用户进程
&man.init.8;,它放置在 <filename>/sbin/init</filename>
或者 <envar>init_path</envar> 变量指定的程序路径中。
这个变量是在 <command>loader</command> 里面设置的。</para>
<sect2 id="boot-autoreboot">
<title>自动重启队列</title>
<para>自动重启队列保证了可用的文件系统是稳定的。
如果不是,且 &man.fsck.8; 不能修复这些错误,
&man.init.8; 会进入<link linkend="boot-singleuser">单用户模式</link>
以便系统管理员直接解决问题。</para>
</sect2>
<sect2 id="boot-singleuser">
<title>单用户模式</title>
<indexterm><primary>单用户模式</primary></indexterm>
<indexterm><primary>控制台</primary></indexterm>
<para>此模式可以通过
<link linkend="boot-autoreboot"> 自动重启队列</link>或者通过带有
<option>-s</option> 选项的用户引导或通过在 <command>loader</command>
里设置 <envar>boot_single</envar> 变量等多种方式来达到。</para>
<para>也可以在多用户模式下调动无 reboot(<option>-r</option>)选项和
halt (<option>-h</option>) 选项的 &man.shutdown.8;
命令来进入单用户模式。</para>
<para>如果系统 <literal>控制台</literal> 在文件
<filename>/etc/ttys</filename> 中被设置为
<literal>不安全(insecure)</literal>
在初始化单用户模式前会出现要求输入 <username>root</username>
密码的命令行提示符。</para>
<example id="boot-insecure-console">
<title>在 <filename>/etc/ttys</filename> 文件中的不安全控制台</title>
<programlisting># name getty type status comments
#
# If console is marked "insecure", then init will ask for the root password # when going to single-user mode.
console none unknown off insecure</programlisting>
</example>
<note>
<para>把控制台设置成 <literal>不安全 (insecure)</literal>
使只知道 <username>root</username> 密码的人才能进入单用户模式,
因为您认为控制台在物理上是不安全的。因此如果您考虑到安全性,
请选择 <literal>不安全 (insecure)</literal>,而非
<literal>安全 (secure)</literal>。</para>
</note>
</sect2>
<sect2 id="boot-multiuser">
<title>多用户模式</title>
<indexterm><primary>多用户模式</primary></indexterm>
<para>如果 &man.init.8; 发现您的文件系统一切正常,又或者用户在<link
linkend="boot-singleuser">单用户模式</link>完成了工作,
系统就会进入多用户模式,开始系统的资源配置。</para>
<sect3 id="boot-rc">
<indexterm><primary>rc 文件</primary></indexterm>
<title>资源配置 (rc)</title>
<para>资源配置分别从文件 <filename>/etc/defaults/rc.conf</filename>、
<filename>/etc/rc.conf</filename> 中读取默认配置和细节配置,
然后加载在文件 <filename>/etc/fstab</filename> 中提及的文件系统、
启动网络服务、启动各种系统守护进程,最后启动本地安装包的启动脚本。</para>
<para>&man.rc.8; 联机手册是关于资源配置的很好的参考。</para>
</sect3>
</sect2>
</sect1>
<sect1 id="boot-shutdown">
<title>shutdown 队列</title>
<indexterm>
<primary><command>shutdown</command></primary>
</indexterm>
<para>由命令 &man.shutdown.8; 的控制,
&man.init.8; 会试着运行 <filename>/etc/rc.shutdown</filename> 脚本,
给所有进程发送 <literal>TERM</literal> 信号,然后给不按时停止的进程发送
<literal>KILL</literal>信号。</para>
<para>在支持电源管理的体系上关闭 FreeBSD 系统的电源,只要简单的使用命令
<command>shutdown -p now</command> 立即关闭电源。使用命令
<command>shutdown -r now</command> 重启 FreeBSD。要执行 &man.shutdown.8;
您必须是 <username>root</username> 用户或 <groupname>operator</groupname> 组的成员。
也可以使用 &man.halt.8; 和 &man.reboot.8; 命令来关闭系统,
请参看它们的联机手册以获得更多的信息。</para>
<note>
<para>电源管理需要支持,在 FreeBSD&nbsp;5.X 中要求内核支持
&man.acpi.4; 或以模块加载,在 FreeBSD&nbsp;4.X 中需要
&man.apm.4; 的支持。</para>
</note>
</sect1>
</chapter>
<!--
Local Variables:
mode: sgml
sgml-declaration: "../chapter.decl"
sgml-indent-data: t
sgml-omittag: nil
sgml-always-quote-attributes: t
sgml-parent-document: ("../book.sgml" "part" "chapter")
End:
-->

@ -0,0 +1,2 @@
<!DOCTYPE chapter PUBLIC "-//FreeBSD//DTD DocBook V4.1-Based Extension//EN">
<!-- $FreeBSD$ -->

@ -0,0 +1,57 @@
<!--
Creates entities for each chapter in the FreeBSD Handbook. Each entity
is named chap.foo, where foo is the value of the id attribute on that
chapter, and corresponds to the name of the directory in which that
chapter's .sgml file is stored.
Chapters should be listed in the order in which they are referenced.
Original revision: 1.28
$FreeBSD$
-->
<!ENTITY chap.preface SYSTEM "preface/preface.sgml">
<!-- Part one -->
<!ENTITY chap.introduction SYSTEM "introduction/chapter.sgml">
<!ENTITY chap.install SYSTEM "install/chapter.sgml">
<!ENTITY chap.basics SYSTEM "basics/chapter.sgml">
<!ENTITY chap.ports SYSTEM "ports/chapter.sgml">
<!ENTITY chap.x11 SYSTEM "x11/chapter.sgml">
<!-- Part two -->
<!ENTITY chap.desktop SYSTEM "desktop/chapter.sgml">
<!ENTITY chap.multimedia SYSTEM "multimedia/chapter.sgml">
<!ENTITY chap.kernelconfig SYSTEM "kernelconfig/chapter.sgml">
<!ENTITY chap.printing SYSTEM "printing/chapter.sgml">
<!ENTITY chap.linuxemu SYSTEM "linuxemu/chapter.sgml">
<!-- Part three -->
<!ENTITY chap.config SYSTEM "config/chapter.sgml">
<!ENTITY chap.boot SYSTEM "boot/chapter.sgml">
<!ENTITY chap.users SYSTEM "users/chapter.sgml">
<!ENTITY chap.security SYSTEM "security/chapter.sgml">
<!ENTITY chap.mac SYSTEM "mac/chapter.sgml">
<!ENTITY chap.disks SYSTEM "disks/chapter.sgml">
<!ENTITY chap.vinum SYSTEM "vinum/chapter.sgml">
<!ENTITY chap.l10n SYSTEM "l10n/chapter.sgml">
<!ENTITY chap.cutting-edge SYSTEM "cutting-edge/chapter.sgml">
<!-- Part four -->
<!ENTITY chap.serialcomms SYSTEM "serialcomms/chapter.sgml">
<!ENTITY chap.ppp-and-slip SYSTEM "ppp-and-slip/chapter.sgml">
<!ENTITY chap.mail SYSTEM "mail/chapter.sgml">
<!ENTITY chap.network-servers SYSTEM "network-servers/chapter.sgml">
<!ENTITY chap.advanced-networking SYSTEM "advanced-networking/chapter.sgml">
<!-- Part five (appendices) -->
<!ENTITY chap.mirrors SYSTEM "mirrors/chapter.sgml">
<!ENTITY chap.mirrors.ftp.inc SYSTEM "mirrors.sgml.ftp.inc">
<!ENTITY chap.mirrors.cvsup.inc SYSTEM "mirrors.sgml.cvsup.inc">
<!ENTITY chap.bibliography SYSTEM "bibliography/chapter.sgml">
<!ENTITY chap.eresources SYSTEM "eresources/chapter.sgml">
<!ENTITY chap.eresources.www.inc SYSTEM "eresources.sgml.www.inc">
<!ENTITY chap.pgpkeys SYSTEM "pgpkeys/chapter.sgml">
<!ENTITY chap.index SYSTEM "index.sgml">
<!ENTITY chap.colophon SYSTEM "colophon.sgml">

@ -0,0 +1,28 @@
<!--
The FreeBSD Documentation Project
The FreeBSD Simplified Chinese Project
Original Revision: 1.8
$FreeBSD$
-->
<colophon id='colophon'>
<para>本书包含了为 <quote>The FreeBSD Documentation Project</quote> 工作的数百名志愿者的工作成果。
这些文字使用符合 DocBook DTD 的 SGML 撰写, 并使用开放源代码的 DSSSL 引擎, <application>Jade</application>
将其转化为许多其他的表现方式。 采用了 Norm Walsh 的 DSSSL 样式表,
并进行了一些追加的定制, 以指引 <application>Jade</application> 产生正确的结果。
Donald Knuth 的 <application>&tex;</application> 排版语言,
以及 Leslie Lamport 的 <application>LaTeX</application> 或 Sebastian
Rahtz 的 <application>JadeTeX</application> 宏集为本文档的印刷版本发挥了至关重要的作用。</para>
</colophon>
<!--
Local Variables:
mode: sgml
sgml-declaration: "chapter.decl"
sgml-indent-data: t
sgml-omittag: nil
sgml-always-quote-attributes: t
sgml-parent-document: ("book.sgml" "part" "chapter")
End:
-->

@ -0,0 +1,16 @@
#
# Build the Handbook with just the content from this chapter.
#
# Original Revision: 1.1
# $FreeBSD$
#
CHAPTERS= config/chapter.sgml
VPATH= ..
MASTERDOC= ${.CURDIR}/../${DOC}.${DOCBOOKSUFFIX}
DOC_PREFIX?= ${.CURDIR}/../../../..
.include "../Makefile"

File diff suppressed because it is too large Load Diff

@ -0,0 +1,16 @@
#
# Build the Handbook with just the content from this chapter.
#
# Original Revision: 1.1
# $FreeBSD$
#
CHAPTERS= cutting-edge/chapter.sgml
VPATH= ..
MASTERDOC= ${.CURDIR}/../${DOC}.${DOCBOOKSUFFIX}
DOC_PREFIX?= ${.CURDIR}/../../../..
.include "../Makefile"

File diff suppressed because it is too large Load Diff

@ -0,0 +1,16 @@
#
# Build the Handbook with just the content from this chapter.
#
# Original Revision: 1.1
# $FreeBSD$
#
CHAPTERS= desktop/chapter.sgml
VPATH= ..
MASTERDOC= ${.CURDIR}/../${DOC}.${DOCBOOKSUFFIX}
DOC_PREFIX?= ${.CURDIR}/../../../..
.include "../Makefile"

File diff suppressed because it is too large Load Diff

@ -0,0 +1,16 @@
#
# Build the Handbook with just the content from this chapter.
#
# Original Revision: 1.1
# $FreeBSD$
#
CHAPTERS= disks/chapter.sgml
VPATH= ..
MASTERDOC= ${.CURDIR}/../${DOC}.${DOCBOOKSUFFIX}
DOC_PREFIX?= ${.CURDIR}/../../../..
.include "../Makefile"

File diff suppressed because it is too large Load Diff

@ -0,0 +1,16 @@
#
# Build the Handbook with just the content from this chapter.
#
# Original Revision: 1.1
# $FreeBSD$
#
CHAPTERS= eresources/chapter.sgml
VPATH= ..
MASTERDOC= ${.CURDIR}/../${DOC}.${DOCBOOKSUFFIX}
DOC_PREFIX?= ${.CURDIR}/../../../..
.include "../Makefile"

File diff suppressed because it is too large Load Diff

@ -0,0 +1,16 @@
#
# Build the Handbook with just the content from this chapter.
#
# Original revision: 1.1
# $FreeBSD$
#
CHAPTERS= install/chapter.sgml
VPATH= ..
MASTERDOC= ${.CURDIR}/../${DOC}.${DOCBOOKSUFFIX}
DOC_PREFIX?= ${.CURDIR}/../../../..
.include "../Makefile"

File diff suppressed because it is too large Load Diff

@ -0,0 +1,16 @@
#
# Build the Handbook with just the content from this chapter.
#
# Original Revision: 1.1
# $FreeBSD$
#
CHAPTERS= introduction/chapter.sgml
VPATH= ..
MASTERDOC= ${.CURDIR}/../${DOC}.${DOCBOOKSUFFIX}
DOC_PREFIX?= ${.CURDIR}/../../../..
.include "../Makefile"

@ -0,0 +1,855 @@
<!--
The FreeBSD Documentation Project
The FreeBSD Simplified Chinese Project
Original Revision: 1.102
$FreeBSD$
-->
<chapter id="introduction">
<chapterinfo>
<authorgroup>
<author>
<firstname>Jim</firstname>
<surname>Mock</surname>
<contrib>Restructured, reorganized, and parts
rewritten by </contrib>
</author>
</authorgroup>
</chapterinfo>
<title>介绍</title>
<sect1 id="introduction-synopsis">
<title>概述</title>
<para>非常感谢您对 FreeBSD 感兴趣!
下面的章节覆盖了 FreeBSD 项目的各个方面,
比如它的历史、目标、开发模式,等等。</para>
<para>阅读完这章,您将了解:</para>
<itemizedlist>
<listitem>
<para>FreeBSD 与其它计算机操作系统的关系。</para>
</listitem>
<listitem>
<para>FreeBSD 项目的历史。</para>
</listitem>
<listitem>
<para>FreeBSD 项目的目标。</para>
</listitem>
<listitem>
<para>FreeBSD 开放源代码开发模式的基础。</para>
</listitem>
<listitem>
<para>当然还有:<quote>FreeBSD</quote> 这个名称的由来。</para>
</listitem>
</itemizedlist>
</sect1>
<sect1 id="nutshell">
<title>欢迎来到 FreeBSD 的世界!</title>
<indexterm><primary>4.4BSD-Lite</primary></indexterm>
<para>FreeBSD 是一个支持
Intel (x86 和 &itanium;)AMD64<trademark>Alpha</trademark>Sun
&ultrasparc; 计算机的基于 4.4BSD-Lite 的操作系统。
到其他体系结构的移植也在进行中。
您也可以阅读 <link linkend="history">FreeBSD 的历史</link>
或者<link linkend="relnotes">最新的发行版本</link>。
如果您有意捐助(代码,
硬件,不记名捐款),请看<ulink
url="&url.articles.contributing;/index.html">为 FreeBSD 做贡献</ulink>这篇文章。</para>
<sect2 id="os-overview">
<title>FreeBSD 能做些什么?</title>
<para>FreeBSD有许多非凡的特性。其中一些是</para>
<itemizedlist>
<indexterm><primary>抢占式多任务</primary></indexterm>
<listitem>
<para><emphasis>抢占式多任务</emphasis>与动态优先级调整确保在应用程序和用户之间平滑公正的分享计算机资源,
即使工作在最大的负载下。</para>
</listitem>
<indexterm><primary>多用户设备</primary></indexterm>
<listitem>
<para><emphasis>多用户设备</emphasis> 使得许多用户能够同时使用同一
FreeBSD 系统做各种事情。
比如,
像打印机和磁带驱动器这样的系统外设可以完全的在系统或者网络上的所有用户之间共享,
可以对用户或者用户组进行个别的资源限制,
以保护临界系统资源不被滥用。</para>
</listitem>
<indexterm><primary>TCP/IP 网络</primary></indexterm>
<listitem>
<para>符合业界标准的强大 <emphasis>TCP/IP 网络</emphasis> 支持,
例如 SLIPPPPNFSDHCP还有 NIS。
这意味着您的 FreeBSD 主机可以很容易的和其他系统互操作,
也可以作为企业的服务器,提供重要的功能,
比如 NFS(远程文件访问)以及 email 服务, 或将您的组织接入
Internet 并提供 WWWFTP路由和防火墙(安全)服务。</para>
</listitem>
<indexterm><primary>内存保护</primary></indexterm>
<listitem>
<para><emphasis>内存保护</emphasis>确保应用程序(或者用户)不会相互干扰。
一个应用程序崩溃不会以任何方式影响其他程序。</para>
</listitem>
<listitem>
<para>FreeBSD 是一个 <emphasis>32 位</emphasis>操作系统
(在 Alpha&itanium;AMD64和 &ultrasparc; 上是<emphasis>64 位</emphasis>)
并且从开始就是如此设计的。</para>
</listitem>
<indexterm>
<primary>X Window 系统</primary>
<seealso>XFree86</seealso>
</indexterm>
<listitem>
<para>业界标准的 <emphasis>X Window 系统</emphasis>
(X11R6)为便宜的常见 VGA 显示卡和监视器提供了一个图形化的用户界面(GUI)
并且完全开放代码。</para>
</listitem>
<indexterm>
<primary>二进制代码兼容性</primary>
<secondary>Linux</secondary>
</indexterm>
<indexterm>
<primary>二进制代码兼容性</primary>
<secondary>SCO</secondary>
</indexterm>
<indexterm>
<primary>二进制代码兼容性</primary>
<secondary>SVR4</secondary>
</indexterm>
<indexterm>
<primary>二进制代码兼容性</primary>
<secondary>BSD/OS</secondary>
</indexterm>
<indexterm>
<primary>二进制代码兼容性</primary>
<secondary>NetBSD</secondary>
</indexterm>
<listitem>
<para>和许多 LinuxSCOSVR4BSDI 和 NetBSD 程序的<emphasis>二进制代码兼容性</emphasis></para>
</listitem>
<listitem>
<para>数以千计的 <emphasis>ready-to-run</emphasis>
应用程序可以从 FreeBSD
<emphasis>ports</emphasis> 和 <emphasis>packages</emphasis>
collection 中找到。您可以顺利的从这里找到,
何用搜索网络?</para>
</listitem>
<listitem>
<para>可以在 Internet 上找到成千上万其它
<emphasis>easy-to-port</emphasis> 的应用程序。
FreeBSD 和大多数流行的商业 &unix; 代码级兼容,
因此大多数应用程序不需要或者只要很少的改动就可以编译。</para>
</listitem>
<indexterm><primary>虚拟内存</primary></indexterm>
<listitem>
<para>页式请求<emphasis>虚拟内存</emphasis>和<quote>集成的
VM/buffer 缓存</quote>设计有效的满足了应用程序巨大的内存需求并依然保持其他用户的交互式响应。</para>
</listitem>
<indexterm>
<primary>对称多处理器(SMP)</primary>
</indexterm>
<listitem>
<para><emphasis>SMP</emphasis> 提供对多处理器的支持。</para>
</listitem>
<indexterm>
<primary>编译器</primary>
<secondary>C</secondary>
</indexterm>
<indexterm>
<primary>编译器</primary>
<secondary>C++</secondary>
</indexterm>
<indexterm>
<primary>编译器</primary>
<secondary>FORTRAN</secondary>
</indexterm>
<listitem>
<para><emphasis>C</emphasis>
<emphasis>C++</emphasis><emphasis>Fortran</emphasis>,和
<emphasis>Perl</emphasis> 开发工具的完整扩充。
许多附加的用于高级研究和开发的程序语言也可以在
ports 和 packages collection 中找到。</para>
</listitem>
<indexterm><primary>源代码</primary></indexterm>
<listitem>
<para>完整的系统<emphasis>源代码</emphasis>意味着您对您环境的最大程度的控制。
当您拥有了一个真正的开放系统时,
为什么还要受困于私有的解决方案,
任商业公司摆布呢?</para>
</listitem>
<listitem>
<para>丰富的<emphasis>在线文档</emphasis>。</para>
</listitem>
<listitem>
<para><emphasis>不仅如此!</emphasis></para>
</listitem>
</itemizedlist>
<indexterm><primary>4.4BSD-Lite</primary></indexterm>
<indexterm>
<primary>计算机系统研究组(CSRG)</primary>
</indexterm>
<indexterm><primary>U.C. Berkeley</primary></indexterm>
<para>FreeBSD 基于加州大学伯克利分校计算机系统研究组(CSRG)发布的 4.4BSD-Lite
继承了 BSD 系统开发的优良传统。
除了 CSRG 优秀的工作之外,
FreeBSD 项目花费了非常多的时间来优化调整系统,
使其在真实负载情况下拥有最好的性能和可靠性。
像许多商业巨人努力的增进 PC 操作系统的特性、性能和可靠性一样,
FreeBSD <emphasis>现在</emphasis> 就已经可以提供了!</para>
<para>FreeBSD 可以提供的应用真的仅局限于您的想象力。
从软件开发到工厂自动化,从存货控制到遥远的人造卫星天线方位控制,
如果商业的 &unix; 产品可以做到,那么就非常有可能您也可以用 FreeBSD 来做!
FreeBSD 也极大地受益于全世界的研究中心和大学开发的数以千计的高质量的应用程序,
这些程序通常只需要很少的花费甚至免费。
商业应用程序也是可用的,并且每天都有大量的出现。</para>
<para>因为 FreeBSD 自身的源代码是完全公开的,
所以对于特定的应用程序或项目,可以对系统进行最大限度的定制。
这对于大多数主流的商业生产商的操作系统来说几乎是不可能的。
以下是当前人们应用 FreeBSD 的某些程序的例子:</para>
<itemizedlist>
<listitem>
<para><emphasis>Internet 服务:</emphasis>FreeBSD 内建的强大的 TCP/IP
网络让它成为各种 Internet 服务的理想平台,比如:</para>
<itemizedlist>
<indexterm><primary>FTP 服务器</primary></indexterm>
<listitem>
<para>FTP 服务器</para>
</listitem>
<indexterm><primary>web 服务器</primary></indexterm>
<listitem>
<para>World Wide Web 服务器(标准的或者安全的
[SSL])</para>
</listitem>
<indexterm><primary>防火墙</primary></indexterm>
<indexterm><primary>IP 伪装</primary></indexterm>
<listitem>
<para>防火墙和 NAT(<quote>IP 伪装</quote>)
网关</para>
</listitem>
<indexterm><primary>电子邮件</primary></indexterm>
<listitem>
<para>电子邮件服务器</para>
</listitem>
<indexterm><primary>USENET</primary></indexterm>
<listitem>
<para>USENET 新闻组和电子布告栏系统</para>
</listitem>
<listitem>
<para>还有许多...</para>
</listitem>
</itemizedlist>
<para>使用 FreeBSD您可以容易的从便宜的
386 类 PC 起步,并随着您的企业成长,一路升级到带有
RAID 存储的四路 Xeon 服务器。</para>
</listitem>
<listitem>
<para><emphasis>教育:</emphasis>您是一名计算机科学或者相关工程领域的学生吗?
学习操作系统,计算机体系结构和网络没有比在 FreeBSD
可提供的体验下动手实践更好的办法了。许多可自由使用的
CAD、数学和图形设计包也使它对于那些主要兴趣是在计算机上完成<emphasis>其他</emphasis>工作的人非常有帮助。</para>
</listitem>
<listitem>
<para><emphasis>研究:</emphasis>有完整的系统源代码,
FreeBSD 对于操作系统研究以及其他计算机科学分支都是一个极好的平台。
FreeBSD 可自由获得的本性,
同样可以使处在不同地方的开发团队在开放的论坛上讨论问题、
交流想法与合作开发成为可能,
且不必担心特别的版权协定或者限制。</para>
</listitem>
<indexterm><primary>路由</primary></indexterm>
<indexterm><primary>DNS 服务器</primary></indexterm>
<listitem>
<para><emphasis>网络:</emphasis>需要一个新的路由器?
一台名称服务器(DNS)?一个隔离您的内部网络的防火墙?
FreeBSD 可以容易的把丢弃在角落不用的 386 或者
486 PC 变成一台完善的带包过滤能力的高级路由器。</para>
</listitem>
<indexterm>
<primary>X Window 系统</primary>
<secondary>XFree86</secondary>
</indexterm>
<indexterm>
<primary>X Window 系统</primary>
<secondary>Accelerated-X</secondary>
</indexterm>
<listitem>
<para><emphasis>X Window 工作站:</emphasis>FreeBSD
是一个便宜的 X 终端解决方案的好的选择,
不管是使用可免费获得的 &xfree86; 服务器还是 <ulink
url="http://www.xig.com">Xi Graphics</ulink>
提供的一个优秀的商业服务器。
不像 X 终端,如果需要的话 FreeBSD 允许许多程序在本地运行,
从而减少中央服务器的负担。
FreeBSD 甚至可以<quote>无盘</quote>启动,
让个人工作站更便宜而且容易管理。</para>
</listitem>
<indexterm><primary>GNU Compiler Collection</primary></indexterm>
<listitem>
<para><emphasis>软件开发:</emphasis>
基本的 FreeBSD 系统带有包括著名的 GNU C/C++
编译器和调试工具在内的一整套开发工具。</para>
</listitem>
</itemizedlist>
<para>FreeBSD 可以通过 CDROM、DVD
以及匿名 FTP 以源代码和二进制方式获得。请查看<xref linkend="mirrors">
了解获取 FreeBSD 的更多细节。</para>
</sect2>
<sect2>
<title>谁在使用 FreeBSD?</title>
<indexterm>
<primary>用户</primary>
<secondary>运行 FreeBSD 的大型站点</secondary>
</indexterm>
<para>FreeBSD 用来支持 Internet 上一些最大的站点,
包括:</para>
<itemizedlist>
<indexterm><primary>Yahoo!</primary></indexterm>
<listitem>
<para><ulink url="http://www.yahoo.com/">Yahoo!</ulink></para>
</listitem>
<indexterm><primary>Apache</primary></indexterm>
<listitem>
<para><ulink url="http://www.apache.org/">Apache</ulink></para>
</listitem>
<indexterm><primary>Blue Mountain Arts</primary></indexterm>
<listitem>
<para><ulink url="http://www.bluemountain.com/">Blue Mountain
Arts</ulink></para>
</listitem>
<indexterm><primary>Pair Networks</primary></indexterm>
<listitem>
<para><ulink url="http://www.pair.com/">Pair
Networks</ulink></para>
</listitem>
<indexterm><primary>Sony Japan</primary></indexterm>
<listitem>
<para><ulink url="http://www.sony.co.jp/">Sony
Japan</ulink></para>
</listitem>
<indexterm><primary>Netcraft</primary></indexterm>
<listitem>
<para><ulink url="http://www.netcraft.com/">Netcraft</ulink>
</para>
</listitem>
<indexterm><primary>Weathernews</primary></indexterm>
<listitem>
<para><ulink url="http://www.wni.com/">Weathernews</ulink>
</para></listitem>
<indexterm><primary>Supervalu</primary></indexterm>
<listitem>
<para><ulink
url="http://www.supervalu.com/">Supervalu</ulink></para>
</listitem>
<indexterm><primary>TELEHOUSE America</primary></indexterm>
<listitem>
<para><ulink url="http://www.telehouse.com/">TELEHOUSE
America</ulink></para>
</listitem>
<indexterm><primary>Sophos Anti-Virus</primary></indexterm>
<listitem>
<para><ulink url="http://www.sophos.com/">Sophos
Anti-Virus</ulink></para>
</listitem>
<indexterm><primary>JMA Wired</primary></indexterm>
<listitem>
<para><ulink
url="http://www.jmawired.com/">JMA Wired</ulink></para>
</listitem>
</itemizedlist>
<para>等等许多。</para>
</sect2>
</sect1>
<sect1 id="history">
<title>关于 FreeBSD 项目</title>
<para>下面的章节提供了项目的一些背景信息,
包括简要的历史、项目目标、以及项目开发模式。</para>
<sect2 id="intro-history">
<sect2info role="firstperson">
<authorgroup>
<author>
<firstname>Jordan</firstname>
<surname>Hubbard</surname>
<contrib>Contributed by </contrib>
</author>
</authorgroup>
</sect2info>
<title>FreeBSD 的简要历史</title>
<indexterm><primary>386BSD Patchkit</primary></indexterm>
<indexterm><primary>Hubbard, Jordan</primary></indexterm>
<indexterm><primary>Williams, Nate</primary></indexterm>
<indexterm><primary>Grimes, Rod</primary></indexterm>
<indexterm>
<primary>FreeBSD 项目</primary>
<secondary>历史</secondary>
</indexterm>
<para>FreeBSD 项目起源于 1993 年早期,
部分作为 <quote>Unofficial 386BSD
Patchkit</quote> 的副产物patchkit 的最后 3 个协调维护人是Nate
WilliamsRod Grimes 和我。</para>
<indexterm><primary>386BSD</primary></indexterm>
<para>我们最初的目标是做出一份 386BSD 的测试版以修正一些
Patchkit 机制无法解决的错误(bug)。
您们中的一些人可能还记得早期的项目名称叫做
<quote>386BSD 0.5</quote> 或者 <quote>386BSD Interim</quote>
就是这个原因。</para>
<indexterm><primary>Jolitz, Bill</primary></indexterm>
<para>386BSD 是 Bill Jolitz 的操作系统,
一直到忍受了激烈的将近一年的忽视。
由于 Patchkit 的急剧膨胀,
使得很难每天都能够消化吸收,
我们一致同意应该做些事情并决定通过提供这个临时的
<quote>cleanup</quote> 版本来帮助 Bill。
然而Bill 却在事先没有指出这个项目应该如何开展下去的情况下,
突然决定退出这个项目,最终这个计划只好被迫停止。</para>
<indexterm><primary>Greenman, David</primary></indexterm>
<indexterm><primary>Walnut Creek CDROM</primary></indexterm>
<para>没过多久,我们认为在没有 Bill 的支持下,项目仍有保留的价值,
因此,我们采用了 David Greenman 的意见,给其命名为
<quote>FreeBSD</quote>。在和当时的几个用户商量后,
我们提出了最初的目标, 而这件事明朗化后,
这个项目就走上了正轨,甚至可能成为现实。
为了增加 FreeBSD 的发行渠道,我抱着试试看的心态,
联系了光盘商 Walnut Creek CDROM
以便那些上网不方便的用户得到 FreeBSD。
Walnut Creek CDROM 不仅支持发行 FreeBSD 光盘版的想法,
还为这个计划提供了所需的计算机和高速网络接入。
在那时,没有 Walnut Creek CDROM 对一个完全未知的项目的空前信任,
FreeBSD 不太可能像它今天这样,影响如此深远,发展如此快速。</para>
<indexterm><primary>4.3BSD-Lite</primary></indexterm>
<indexterm><primary>Net/2</primary></indexterm>
<indexterm><primary>U.C. Berkeley</primary></indexterm>
<indexterm><primary>386BSD</primary></indexterm>
<indexterm><primary>Free Software Foundation</primary></indexterm>
<para>第一个 CDROM (以及在整个互连网范围内发行的) 发行版本是
FreeBSD&nbsp;1.0,于 1993 年 10 月发布。这个版本基于
U.C. Berkeley 的 4.3BSD-Lite(<quote>Net/2</quote>)磁带,
也有许多组件是 386BSD 和自由软件基金会提供的。
对于第一次发行,这算是相当成功了。
在 1994 年 5 月,我们发布了更加成功的 FreeBSD 1.1 版。</para>
<indexterm><primary>Novell</primary></indexterm>
<indexterm><primary>U.C. Berkeley</primary></indexterm>
<indexterm><primary>Net/2</primary></indexterm>
<indexterm><primary>AT&amp;T</primary></indexterm>
<para>然而此后不久,发生了一些意外的情况。
Novell 和 U.C. Berkeley 决定就 Berkeley Net/2
磁带的归属权问题打的那场马拉松式的官司达成和解。
判决的结果是,
U.C. Berkeley 承认 Net/2 很大一部分代码是<quote>侵占来的</quote>
且这些代码归 Novell 公司所拥有。这些代码是 Novell 不久前从
AT&amp;T 买来的。
Berkeley 得到了来自 Novell 的 <quote>祝福</quote>
4.4BSD-Lite 发行后,将不认为是侵权,
且要求现存的 Net/2 的用户更换新版。
这也包括 FreeBSD我们的项目被要求在 1994 年 6 月底停止发行基于
Net/2 的产品。在此协议允许的时间内,
本项目被允许发行最后一版,也就是 FreeBSD&nbsp;1.1.5.1。</para>
<para>于是 FreeBSD 开始艰苦的从全新的而且不完整的 4.4BSD-Lite
中重新整合自己。<quote>Lite</quote> 版本是不完整的,
因为 Berkeley 的 CSRG 已经删除了大量的构建可启动运行的系统所需要的代码
(因为各种各样的版权问题),事实上 4.4 的 Intel port 是非常不完整的。
直到 1994 年 11 月项目才完成这个转换,这个时候才把
FreeBSD&nbsp;2.0 通过网络和 CDROM(在 12 月)发布出来。
尽管系统很多地方还很粗糙,这个版本还是取得了重大的成功,
接下来在 1995 年 6 月发布了更强大和容易安装的 FreeBSD&nbsp;2.0.5
版本。</para>
<para>我们于 1996 年 8 月发布了 FreeBSD&nbsp;2.1.5 版本,
它在 ISP 和商业团体中非常流行。
随后, 2.1-STABLE 分支的另一个版本应运而生,它就是
FreeBSD&nbsp;2.1.7.1,在 1997 年 2 月发布并停止了
2.1-STABLE 的主流开发。现在,它处于维护状态,
仅仅提供安全性的增强和其他严重的错误修补的维护(RELENG_2_1_0)。</para>
<para>FreeBSD&nbsp;2.2 版作为 RELENG_2_2 分支,于 1996 年 11 月从开发主线
(<quote>-CURRENT</quote>)分出来。
它的第一个完整版(2.2.1)于 1997 年 4 月发布出来。
97 年夏秋之间,顺着 2.2 分支的更进一步的版本在开发。
其最后一版(2.2.8)于 1998 年 11 月发布出来。
第一个官方的 3.0 版本出现在 1998 年 10 月,
意味着 2.2 分支结束的开始。</para>
<para>1999 年 1 月 20 日又出现了新的分支,就是
4.0-CURRENT 和 3.X-STABLE 分支。从 3.X-STABLE 起3.1 在
1999 年 2 月 15 日发行3.2 在1999 年 5 月 15 日3.3 在
1999 年 9 月 16 日3.4 在 1999 年 12 月 20 日3.5 在
2000 年 6 月 24 日,接下来几天后发布了很少的修补升级至
3.5.1,加入了对 Kerberos 安全性方面的修补。
这是 3.X 分支最后一个发行版本。</para>
<para>2000 年 3 月 13 日,有了另一个分支,
看到了 4.X-STABLE 分支的曙光,现在,采用了
<quote>current -stable 分支方法</quote>。从那时迄今为止已经有了几个发行版本:
4.0-RELEASE 在 2000 年 3 月发布,
最新的 &rel2.current;-RELEASE 在
&rel2.current.date; 发布。沿着
4.X-stable(RELENG_4)分支还会有几个后续版本,直到 2003 年。</para>
<para>期待已久的 5.0-RELEASE 在 2003 年 1 月 19 日发布。
它是将近三年工作的顶点,这个版本开始了 FreeBSD
对高级多处理器和应用程序线程的支持,并加入了对 &ultrasparc; 和
<literal>ia64</literal> 平台的支持。这个版本接下来就是 2003
年 6 月发布的 5.1 版。除了许多新的特性5.X
版本也包含了许多正在进行的系统结构方面的主要进展。然而,随着这些先进的机制,
带给系统极大数量的新的未经过广泛测试的代码。
因为这个原因5.X
版本被看作是<quote>新技术展示</quote>版本,而 4.X
系列则作为<quote>生产</quote>版本。5.X 会被及时的公布为
stable 并开始着手下一个开发分支6.0-CURRENT。</para>
<para>现在,对 5.X-CURRENT(trunk)分支的长期开发计划仍在继续着。
5.x 的 SNAPshot 版本
CDROM(当然,还有网络)一直作为工作进程在
<ulink url="ftp://current.FreeBSD.org/pub/FreeBSD/snapshots/">
the snapshot server</ulink> 上制作。</para>
</sect2>
<sect2 id="goals">
<sect2info>
<authorgroup>
<author>
<firstname>Jordan</firstname>
<surname>Hubbard</surname>
<contrib>Contributed by </contrib>
</author>
</authorgroup>
</sect2info>
<title>FreeBSD 项目目标</title>
<indexterm>
<primary>FreeBSD Project</primary>
<secondary>goals</secondary>
</indexterm>
<para>FreeBSD 项目的目标是为那些不管出于什么目的,
不需要有任何限制的人提供软件。
我们中的许多人对代码(和计划)都有非常大的投入和研究,
当然也不介意一些资金上的补偿,不管是现在或者将来。
但是,我们确定不准备坚持这么做。
我们认为我们的首要<quote>使命</quote>是为任何人和新来者提供代码,
不管他们出于什么目的。以便代码能得到最大限度的利用,
带给使用者最大的好处。
我认为这是自由软件和我们的狂热支持者的一个最基本的目标。</para>
<indexterm>
<primary>GNU General Public License (GPL)</primary>
</indexterm>
<indexterm>
<primary>GNU Lesser General Public License (LGPL)</primary>
</indexterm>
<indexterm><primary>BSD Copyright</primary></indexterm>
<para>我们源代码树中在 GNU
公共许可证(GPL) 或者 GNU 函数库公共许可证
(LGPL) 下发布的代码带有少许的附加限制,
还好只是强制性的要求开放代码而不是别的。
由于使用 GPL 的软件在商业用途上会增加若干复杂性,
因此,我们宁愿在可以选择的时候对提交的软件使用更宽松的
BSD 版权。</para>
</sect2>
<sect2 id="development">
<sect2info>
<authorgroup>
<author>
<firstname>Satoshi</firstname>
<surname>Asami</surname>
<contrib>撰写者 </contrib>
</author>
</authorgroup>
</sect2info>
<title>FreeBSD 开发模式</title>
<indexterm>
<primary>FreeBSD Project</primary>
<secondary>开发模式</secondary>
</indexterm>
<para>FreeBSD 的开发是一个非常开放且有有伸缩性的过程,
就像从我们的<ulink
url="&url.articles.contributors;/article.html">
贡献者列表</ulink>里看到的,它是完全由来自全世界的数以百计的贡献者发展起来的。
FreeBSD 的开发基础结构允许数以百计的开发者通过互联网协同工作。
我们也经常关注着那些对我们的计划感兴趣的新开发者和新的创意,
那些有兴趣更进一步参与项目的人只需要在
&a.hackers; 联系我们。
&a.announce; 对那些希望了解我们工作所涉及到哪些领域的人也是有用的。</para>
<para>无论是独立地工作或者封闭式的团队工作,
了解FreeBSD计划和它的开发过程都是有益的</para>
<variablelist>
<varlistentry>
<term>CVS 代码库<anchor
id="development-cvs-repository"></term>
<indexterm>
<primary>CVS</primary>
<secondary>代码库</secondary>
</indexterm>
<indexterm>
<primary>并行版本系统</primary>
<see>CVS</see>
</indexterm>
<listitem>
<para>FreeBSD 的中央源代码树是由
<ulink url="http://www.cvshome.org/">CVS</ulink>
(并行版本控制系统)来维护的。CVS 是一个与
FreeBSD 捆绑的可自由获得的源代码控制工具。
主 <ulink url="http://www.FreeBSD.org/cgi/cvsweb.cgi">CVS
代码库</ulink>放置在美国加利福尼亚州圣克拉拉的一台机器上,
它被复制到全世界的大量镜像站上。CVS 中包括了 <link
linkend="current">-CURRENT</link> 和 <link
linkend="stable">-STABLE</link> 树,
它同样可以很容易地复制到您的机器上。
请查阅<link linkend="synching">
同步您的源代码树</link>这一章节来了解更多信息。</para>
</listitem>
</varlistentry>
<varlistentry>
<term>committer 列表<anchor
id="development-committers"></term>
<indexterm><primary>committers</primary></indexterm>
<listitem>
<para><firstterm>committer</firstterm>
是那些对 CVS 树有<emphasis>写</emphasis>权限的人,
他们被授权修改 FreeBSD 的源代码
(术语 <quote>committer</quote>
来自于 &man.cvs.1; 的 <command>commit</command>
命令,这个命令用来把新的修改提交给 CVS
代码库)。提交修正的最好方法是使用 &man.send-pr.1;
命令。如果您发现在系统中出现了一些问题的话,
您也可以通过邮件将它们发送至 &a.committers;。</para>
</listitem>
</varlistentry>
<varlistentry>
<term>FreeBSD 核心团队<anchor id="development-core"></term>
<indexterm><primary>core team</primary></indexterm>
<listitem>
<para>如果把 FreeBSD 项目看作一个公司,那么
<firstterm>FreeBSD 核心团队</firstterm>就相当于董事会。
核心团队的主要任务是提出总体上的发展计划,然后确定一个正确的方向。
邀请那些富有献身精神和可靠的开发者加入到 committer
队伍中来也是核心团队的工作之一,
这些新的成员将作为新核心团队成员和其他人一起继续前进。
当前的核心团队是 2004 年 7 月从 committer
中选举产生的。选举每两年一次。
</para>
<para>一些核心团队的成员还负责特定的责任范围,
也就是说他们必须尽力确保某个子系统能工作正常。
FreeBSD 开发者的完整列表和他们的责任范围,请参见<ulink
url="&url.articles.contributors;/article.html">
贡献者列表</ulink></para>
<note>
<para>核心团队的大部分成员加入 FreeBSD 开发的时候都是志愿的,
并没有从项目中获得任何财政上的资助,
所以<quote>承诺</quote>不应该被理解为<quote>支持保证</quote>。
前面所述<quote>董事会</quote>的类推并不十分准确,
或许更好的说法是,他们是一群愿意放弃他们的生活,
投身于 FreeBSD 项目而非选择其个人更好的生活的人!</para>
</note>
</listitem>
</varlistentry>
<varlistentry>
<term>外围贡献者</term>
<indexterm><primary>contributors</primary></indexterm>
<listitem>
<para>事实上,最大的开发团队正是为我们提供反馈和错误修补的用户自己。
FreeBSD 的非集中式的开发者保持联系的主要方式就是预订
&a.hackers;,很多事情在那里讨论。查看<xref
linkend="eresources">了解众多 FreeBSD 邮件列表的更多信息。</para>
<para><citetitle><ulink
url="&url.articles.contributors;/article.html">
FreeBSD 贡献者列表</ulink></citetitle> 很长并在不断增长,
为什么不加入它来为 FreeBSD 做贡献呢?</para>
<para>提供代码不是为这个计划做贡献的唯一方式;
有一个更完整的需要做的事情的列表,可以参见 <ulink
url="&url.base;/index.html">FreeBSD
项目网站</ulink>。</para>
</listitem>
</varlistentry>
</variablelist>
<para>总的来说,我们的开发模式好像是一组没有拘束的同心圆。
这种集中式的开发模式,主要是考虑到<emphasis>用户</emphasis>的方便,
同时让他们能很容易地维护同一份软件,
而不会把潜在的贡献者排除在外!
我们的目标是提供一个包含有大量具有一致性
<link linkend="ports">应用程序</link>的稳定的操作系统,
以利于用户的安装和使用,&mdash;
这种模式在完成目标的过程中工作得非常有效。</para>
<para>我们对于那些想要加入成为FreeBSD开发者的期待是
具有如同当前其他人一样的投入,来确保持续的成功!</para>
</sect2>
<sect2 id="relnotes">
<title>最新的 FreeBSD 发行版本</title>
<indexterm><primary>NetBSD</primary></indexterm>
<indexterm><primary>OpenBSD</primary></indexterm>
<indexterm><primary>386BSD</primary></indexterm>
<indexterm><primary>Free Software Foundation</primary></indexterm>
<indexterm><primary>U.C. Berkeley</primary></indexterm>
<indexterm>
<primary>Computer Systems Research Group (CSRG)</primary>
</indexterm>
<para>FreeBSD 是一个免费使用且带有完整源代码的基于 4.4BSD-Lite 的系统,
它广泛运行于 Intel &i386;、&i486;、&pentium;、
&pentium;&nbsp;Pro、
&celeron;、
&pentium;&nbsp;II、
&pentium;&nbsp;III、
&pentium;&nbsp;4(或者兼容系统)、
&xeon;、DEC <trademark>Alpha</trademark>
和 Sun &ultrasparc; 的计算机系统上。
它主要以 加州大学伯克利分校 的
CSRG 研究小组的软件为基础,并加入了 NetBSD、OpenBSD、386BSD
以及来自 自由软件基金会 的一些东西。</para>
<para>自从 94 年末我们的 FreeBSD&nbsp;2.0 发行以来,
FreeBSD 的性能,可定制性,稳定性都有了令人注目的提高。
<!-- XXX is the rest of this paragraph still true ? -->
最大的变化是通过 整合虚拟内存/文件系统 中的高速缓存改进的虚拟内存系统,
它不仅提升了性能,而且减少了 FreeBSD 对内存的需要,
使得 5&nbsp;MB 内存成为可接受的最小配置。
其他的改进包括完整的 NIS 客户端和服务器端的支持,
事务 TCP 协议支持,按需拨号的 PPP集成的 DHCP 支持,改进的 SCSI 子系统,
ISDN 的支持ATMFDDI快速 Gigabit 以太网(1000&nbsp;Mbit)支持,
提升了最新的 Adaptec 控制器的支持和修补了很多的错误。</para>
<para>除了最基本的系统软件FreeBSD
还提供了一个拥有成千上万广受欢迎的程序组成的软件的 ports collection。
到本书付印时,已有超过 &os.numports; 个 ports (ports 包括从
http(WWW) 服务器到游戏、程序设计语言、编辑器以及您能想到的几乎所有的东西。
完整的 ports collection 大约需要
&ports.size; 的存储空间。所有的只提供对原始代码的
<quote>修正</quote>。这使得我们能够容易地更新软件,
而且减少了老旧的 1.0 ports collection 对硬盘空间的浪费。
要编译一个 port您只要切换到您想要安装的程序的目录
输入 <command>make
install</command>,然后让系统去做剩下的事情。
您要编译的每一个程序完整的原始代码可以从 CDROM 或本地 FTP
获得,所以您只需要编译您想要软件的足够的磁盘空间。
几乎大多数的软件都提供了事先编译好的
<quote>package</quote> 以方便安装,对于那些不希望从源代码编译他们自己的
ports 的人只要使用一个简单的命令
(<command>pkg_add</command>)就可以安装。
有关 package 和 ports 的更多信息可以在<xref linkend="ports">中找到。</para>
<para>您可以在最近的 FreeBSD 主机的 <filename>/usr/share/doc</filename>
目录下找到许多有用的文件来帮助您安装及使用 FreeBSD。
您也可以用一个 HTML 浏览器来查阅本地安装的手册,
使用下面的 URL</para>
<variablelist>
<varlistentry>
<term>FreeBSD 使用手册</term>
<listitem>
<para><ulink type="html"
url="file://localhost/usr/share/doc/handbook/index.html"><filename>/usr/share/doc/handbook/index.html</filename></ulink></para>
</listitem>
</varlistentry>
<varlistentry>
<term>FreeBSD FAQ</term>
<listitem>
<para><ulink type="html"
url="file://localhost/usr/share/doc/faq/index.html"><filename>/usr/share/doc/faq/index.html</filename></ulink></para>
</listitem>
</varlistentry>
</variablelist>
<para>您也可以查看在 <ulink
url="&url.base;/index.html">http://www.FreeBSD.org/</ulink>
主站的副本(持续更新中)。</para>
</sect2>
</sect1>
</chapter>
<!--
Local Variables:
mode: sgml
sgml-declaration: "../chapter.decl"
sgml-indent-data: t
sgml-omittag: nil
sgml-always-quote-attributes: t
sgml-parent-document: ("../book.sgml" "part" "chapter")
End:
-->

@ -0,0 +1,16 @@
#
# Build the Handbook with just the content from this chapter.
#
# Original revision: 1.1
# $FreeBSD$
#
CHAPTERS= kernelconfig/chapter.sgml
VPATH= ..
MASTERDOC= ${.CURDIR}/../${DOC}.${DOCBOOKSUFFIX}
DOC_PREFIX?= ${.CURDIR}/../../../..
.include "../Makefile"

File diff suppressed because it is too large Load Diff

@ -0,0 +1,16 @@
#
# Build the Handbook with just the content from this chapter.
#
# Original Revision: 1.1
# $FreeBSD$
#
CHAPTERS= l10n/chapter.sgml
VPATH= ..
MASTERDOC= ${.CURDIR}/../${DOC}.${DOCBOOKSUFFIX}
DOC_PREFIX?= ${.CURDIR}/../../../..
.include "../Makefile"

@ -0,0 +1,835 @@
<!--
The FreeBSD Documentation Project
The FreeBSD Chinese Documentation Project
Original Revision: 1.102
$FreeBSD$
-->
<chapter id="l10n">
<chapterinfo>
<authorgroup>
<author>
<firstname>Andrey A.</firstname>
<surname>Chernov</surname>
<contrib>Contributed by </contrib>
</author>
</authorgroup>
<authorgroup>
<author>
<firstname>Michael C.</firstname>
<surname>Wu</surname>
<contrib>Rewritten by </contrib>
</author>
<!-- 30 Nv 2000 -->
</authorgroup>
</chapterinfo>
<title>本地化I18N/L10N使用和设置</title>
<sect1 id="l10n-synopsis">
<title>概述</title>
<para>FreeBSD是一个由分布于全世界的用户和贡献者支持的项目。
这章将讨论FreeBSD的国际化和本地化的问题,允许非英语用户也能使用FreeBSD很好地工作。
在系统和应用水平上主要是通过执行i18N标准来实现的所以这里我们将为读者提供详细的介绍。
</para>
<para>读完这一章,您将了解到:</para>
<itemizedlist>
<listitem><para>不同的语言和地域是如何在现代操作系统上进行编码的。
</para></listitem>
<listitem><para>如何为您的登入shell设置本地化。</para></listitem>
<listitem><para>如何配置您的控制台为非英语语言。
languages.</para></listitem>
<listitem><para>如何使用不同的语言来有效地使用X Windows。</para></listitem>
<listitem><para>在哪里可以找到更多有关开发符合i18N标准的应用程序的信息。</para></listitem>
</itemizedlist>
<para>阅读这章之前,您应当了解:</para>
<itemizedlist>
<listitem><para>怎样安装额外的第三方程序(<xref linkend="ports">)。</para></listitem>
</itemizedlist>
</sect1>
<sect1 id="l10n-basics">
<title>基础知识</title>
<sect2>
<title>什么是I18N/L10N?</title>
<indexterm><primary>国际化</primary></indexterm>
<indexterm><primary>本地化</primary></indexterm>
<para>开发人员把internationalization简写成I18N,中间的数字是前后两个字母间的字母个数。
L10N依据<quote>localization</quote> 使用同样的命名规则。
I18N/L10N方法、协议和应用结合在一起允许用户使用他们自己所选择的语言。</para>
<para>I18N应用程序使用I18N工具来编程。它允许开发人员写一个简单的文件
就可以将显示的菜单和文本翻译成本地语言。我们非常鼓励程序员遵循这种规则。</para>
</sect2>
<sect2>
<title>为什么要使用I18N/L10N?</title>
<para>I18N/L10N标准能够很好地支持您查看、输入或处理非英语语言。</para>
</sect2>
<sect2>
<title>I18N支持哪里语言</title>
<para>I18N和L10N不是FreeBSD特有的。当前它能支持世界上绝大部分主力语言
包括但不限于:中文,德文,日文,朝鲜文,法文,俄文,越南文等等。</para>
</sect2>
</sect1>
<sect1 id="using-localization">
<title>使用本地化语言</title>
<para>I18N不是FreeBSD特有的它是一个规则。我们鼓励您帮助FreeBSD完善这一规则。</para>
<indexterm><primary>locale</primary></indexterm>
<para>本地化设置需要具备三个条件:语言代码 (Language Code)、 国家代码
(Country Code) 和编码(Encoding)。 本地名字可以用下面这些部分来构造:</para>
<programlisting><replaceable>语言代码</replaceable>_<replaceable>国家代码</replaceable>.<replaceable>编码</replaceable></programlisting>
<sect2>
<title>语言和国家代码</title>
<indexterm><primary>语言代码</primary></indexterm>
<indexterm><primary>国家代码</primary></indexterm>
<para>为了用特殊的语言来对FreeBSD系统进行本地化或其他类&unix;系统),
用户必须要知道相应的国家和语言代码(国家代码告诉应用程序使用哪一种语言规范)。
此外WEB浏览器SMTP/POP服务器web服务器等都是以这个为基础的。下面就是一个国家和语言代码的例子:
</para>
<informaltable frame="none">
<tgroup cols="2">
<thead>
<row>
<entry>语言/国家代码</entry>
<entry>描述</entry>
</row>
</thead>
<tbody>
<row>
<entry>en_US</entry>
<entry>美国英语</entry>
</row>
<row>
<entry>ru_RU</entry>
<entry>俄语</entry>
</row>
<row>
<entry>zh_CN</entry>
<entry>简体中文</entry>
</row>
</tbody>
</tgroup>
</informaltable>
</sect2>
<sect2>
<title>编码</title>
<indexterm><primary>编码</primary></indexterm>
<indexterm><primary>ASCII</primary></indexterm>
<para>一些语言不使用 ASCII 编码它们使用8位更宽或多位的字符
更多的信息可以看看&man.multibyte.3; 。
比较老的应用程序可能会无法认出它们,把它们误认为是控制字符。
比较新的应用程序通常会认出8位字符。 根据执行情况,用户可能需要使用更
宽或多位字符支持的标准来重新编译这个应用程序,或者将它正确配置。<ulink
url="&url.base;/ports/index.html">FreeBSD Ports collection</ulink>
已经为每一个语言提供了相应的程序。可以在各自的FreeBSD port中参考一下I18N的文档。</para>
<para>需要特别指出的用户需要看看应用程序的文档以决定如何配置才能正确设置configure/Makefile/compiler。
</para>
<para>记住下面这些:</para>
<itemizedlist>
<listitem>
<para>特定语言的简单C字符集参考&man.multibyte.3;以及ISO-8859-1, ISO-8859-15, KOI8-R, CP437.</para>
</listitem>
<listitem>
<para>宽字节或多字节编码如EUC, Big5。</para>
</listitem>
</itemizedlist>
<para>您可以在<ulink
url="http://www.iana.org/assignments/character-sets">IANA Registry</ulink>检查一下现行的字符集列表。</para>
<note>
<para>FreeBSD 4.5及以后的版本使用X11兼容的本地编码来代替。</para>
</note>
</sect2>
<sect2>
<title>I18N应用程序</title>
<para>在FreeBSD Ports和Package系统里面I18N应用程序已经使用<literal>I18N</literal>
来命名。然而它们不是总支持需要的语言。</para>
</sect2>
<sect2 id="setting-locale">
<title>本地化设置</title>
<para>通常只要在登入shell里面设置<envar>LANG</envar>为本地化,
一般通过设置用户的 <filename>~/.login_conf</filename>
或用户shell的启动文件<filename>~/.profile</filename><filename>~/.bashrc</filename>,
<filename>~/.cshrc</filename>)。没有必要设置
<envar>LC_CTYPE</envar><envar>LC_CTIME</envar>。
更多的信息请参考特定语言的FreeBSD文档。</para>
<para>您应当在您的配置文件中设置下面两个变量:</para>
<itemizedlist>
<indexterm><primary>POSIX</primary></indexterm>
<listitem>
<para><envar>LANG</envar> 为&posix;设置本地化语言功能。</para>
</listitem>
<indexterm><primary>MIME</primary></indexterm>
<listitem>
<para><envar>MM_CHARSET</envar>应用程序的MIME字符集。</para>
</listitem>
</itemizedlist>
<para>这包括用户的shell配置特定的应用配置和X11配置。</para>
<sect3>
<title>设置本地化的方法</title>
<indexterm><primary>本地化</primary></indexterm>
<indexterm><primary>登入分类</primary></indexterm>
<para>有两种方法来设置本地化,接下来都会描述。
第一种 (推荐) 就是在 <link linkend="login-class">登入分类</link>里面指定环境变量。
第二种方法是把环境变量加到shell的<link linkend="startup-file">启动文件</link>里面。
</para>
<sect4 id="login-class">
<title>登入分类方法</title>
<para>这种方法允许把本地化名称和MIME字符集的环境变量赋给可能的shell
而不是加到每个特定shell的启动文件里面。
<link linkend="usr-setup">用户级设置
Level Setup</link> 允许普通用户自己完成这个设置,而<link
linkend="adm-setup">管理员级设置</link>需要超级用户权限。</para>
<sect5 id="usr-setup">
<title>用户级设置</title>
<para>这有一个设置用户根目录文件<filename>.login_conf</filename>的小例子,
它为上述两个变量设置了Latin-1编码。</para>
<programlisting>me:\
:charset=ISO-8859-1:\
:lang=de_DE.ISO8859-1:</programlisting>
<indexterm><primary>繁体中文</primary><secondary>BIG-5编码</secondary></indexterm>
<para>这是一个为<filename>.login_conf</filename>设置繁体中文的BIG-5编码的例子。应该设置下面的大部分变量
因为很多软件都没有为中文,日文和韩文设置正确的本地化变量。</para>
<programlisting>#Users who do not wish to use monetary units or time formats
#of Taiwan can manually change each variable
me:\
:lang=zh_TW.Big5:\
:lc_all=zh_TW.Big:\
:lc_collate=zh_TW.Big5:\
:lc_ctype=zh_TW.Big5:\
:lc_messages=zh_TW.Big5:\
:lc_monetary=zh_TW.Big5:\
:lc_numeric=zh_TW.Big5:\
:lc_time=zh_TW.Big5:\
:charset=big5:\
:xmodifiers="@im=xcin": #Setting the XIM Input Server</programlisting>
<para>更多的信息参考<link linkend="adm-setup">管理员级设置</link>和&man.login.conf.5;</para>
</sect5>
<sect5 id="adm-setup">
<title>管理员级设置</title>
<para>检查用户的登入分类在
<filename>/etc/login.conf</filename>里面是否设置了正确的语言。主要确定下面的几个设置:</para>
<programlisting><replaceable>language_name</replaceable>:<replaceable>accounts_title</replaceable>:\
:charset=<replaceable>MIME_charset</replaceable>:\
:lang=<replaceable>locale_name</replaceable>:\
:tc=default:</programlisting>
<para>再次使用前面的Latin-1编码的例子</para>
<programlisting>german:German Users Accounts:\
:charset=ISO-8859-1:\
:lang=de_DE.ISO8859-1:\
:tc=default:</programlisting>
<bridgehead renderas=sect4>使用&man.vipw.8;改变登入类型。</bridgehead>
<indexterm>
<primary><command>vipw</command></primary>
</indexterm>
<para>使用<command>vipw</command>添加新用户,看起来像下面这样:
</para>
<programlisting>user:password:1111:11:<replaceable>language</replaceable>:0:0:User Name:/home/user:/bin/sh</programlisting>
<bridgehead renderas=sect4>用&man.adduser.8;改变登入类型。</bridgehead>
<indexterm>
<primary><command>adduser</command></primary>
</indexterm>
<indexterm><primary>登入分类</primary></indexterm>
<para>用<command>adduser</command>添加新用户看起来像下面这样:</para>
<itemizedlist>
<listitem>
<para>在<filename>/etc/adduser.conf</filename>里面设置<literal>defaultclass =
<replaceable>语言</replaceable></literal>。应该记住,您必须为使用其它语言的所有用户设置
<literal>缺省</literal>类别。
</para>
</listitem>
<listitem>
<para>每一次使用&man.adduser.8;的时候,一个特定语言的可选择性回答会像下面这样给出:
<screen><prompt>Enter login class: default []: </prompt></screen>
</para>
</listitem>
<listitem>
<para>如果您打算给每一个用户使用另外一种语言,您应该这样:
</para>
<screen>&prompt.root; <userinput>adduser -class <replaceable>language</replaceable></userinput></screen>
</listitem>
</itemizedlist>
<bridgehead renderas=sect4>使用&man.pw.8;改变登入类型。</bridgehead>
<indexterm>
<primary><command>pw</command></primary>
</indexterm>
<para>如果您使用&man.pw.8;来添加新用户,应该这样使用:</para>
<screen>&prompt.root; <userinput>pw useradd <replaceable>user_name</replaceable> -L <replaceable>language</replaceable></userinput></screen>
</sect5>
</sect4>
<sect4 id="startup-file">
<title>Shell启动文件方法</title>
<note>
<para>不推荐使用这种方法因为它需要给每一个可能的shell程序一个不同的启动文件。
应该用<link linkend="login-class">登入分类方法</link>来代替这种方法。
</para>
</note>
<indexterm><primary>MIME</primary></indexterm>
<indexterm><primary>locale</primary></indexterm>
<para>为了设置本地化名称和MIME字符集只要在<filename>/etc/profile</filename>或
<filename>/etc/csh.login</filename>启动文件里面设置这两个变量。下面我们使用德语做例子:
</para>
<para>在<filename>/etc/profile</filename>里面:</para>
<programlisting><envar>LANG=de_DE.ISO8859-1; export LANG</envar>
<envar>MM_CHARSET=ISO-8859-1; export MM_CHARSET</envar></programlisting>
<para>或在<filename>/etc/csh.login</filename>里面:</para>
<programlisting><envar>setenv LANG de_DE.ISO8859-1</envar>
<envar>setenv MM_CHARSET ISO-8859-1</envar></programlisting>
<para>另外,您可以把上面的设置添加到<filename>/usr/share/skel/dot.profile</filename>
(和前面的<filename>/etc/profile</filename>一样),或者<filename>/usr/share/skel/dot.login</filename>
(和前面的<filename>/etc/csh.login</filename>一样)。</para>
<para>对于X11</para>
<para>在<filename>$HOME/.xinitrc</filename>里面:</para>
<programlisting><envar>LANG=de_DE.ISO8859-1; export LANG</envar></programlisting>
<para>或者:</para>
<programlisting><envar>setenv LANG de_DE.ISO8859-1</envar></programlisting>
<para>依赖您的shell(看上面)。</para>
</sect4>
</sect3>
</sect2>
<sect2 id="setting-console">
<title>控制台设置</title>
<para>对于所有的简单C字符集在<filename>/etc/rc.conf</filename>中用正在讨论的语言设置正确的控制台字符:
</para>
<programlisting>font8x16=<replaceable>font_name</replaceable>
font8x14=<replaceable>font_name</replaceable>
font8x8=<replaceable>font_name</replaceable></programlisting>
<para>这儿的<replaceable>font_name</replaceable>来自于<filename>/usr/share/syscons/fonts</filename>目录,
不带<filename>.fnt</filename>后缀。</para>
<indexterm>
<primary><application>sysinstall</application></primary>
</indexterm>
<indexterm><primary>键盘布局</primary></indexterm>
<indexterm><primary>屏幕布局</primary></indexterm>
<para>也可以通过<filename>/stand/sysinstall</filename>来设置键盘布局和屏幕布局。
进入<application>sysinstall</application>,选择<guimenuitem>Configure</guimenuitem>,然后
<guimenuitem>Console</guimenuitem>。您也可以在<filename>/etc/rc.conf</filename>里面添加下面几行:</para>
<programlisting>scrnmap=<replaceable>screenmap_name</replaceable>
keymap=<replaceable>keymap_name</replaceable>
keychange="<replaceable>fkey_number sequence</replaceable>"</programlisting>
<para>这儿的<replaceable>screenmap_name</replaceable>是来自<filename>/usr/share/syscons/scrnmaps</filename>目录,
不带<filename>.scm</filename>后缀。 一个带影射字体的屏幕布局通常被作为一个工作区,
用来在VGA适配器字体矩阵上扩展8位到9位。 如果屏幕字体是使用一个8位的排列要移动这些字母离开这些区域。</para>
<para>
如果您在<filename>/etc/rc.conf</filename>里面启用了<application>moused</application> daemon</para>
<programlisting>moused_enable="YES"</programlisting>
<para>那么需要在下一段检查鼠标指针信息。</para>
<indexterm>
<primary><application>moused</application></primary>
</indexterm>
<para>默认情况下, &man.syscons.4;驱动程序的鼠标指针在字符集中占用0xd0-0xd3的范围。
如果您的语言使用这个范围,您必须把指针范围移出这个范围。
要在5.0以前的FreeBSD版本中启用工作区需要在您的内核中添加下面这行</para>
<programlisting>options SC_MOUSE_CHAR=0x03</programlisting>
<para>对于 FreeBSD 4.4 和以后的版本, 需要在
<filename>/etc/rc.conf</filename> 中加入:</para>
<programlisting>mousechar_start=3</programlisting>
<para>这儿的<replaceable>keymap_name</replaceable>来自于<filename>/usr/share/syscons/keymaps</filename>目录,
不带<filename>.kbd</filename>后缀。如果您不确定该使用哪一种键盘布局,使用&man.kbdmap.1;您可以不重起
来检测您的键盘布局。</para>
<para>因为功能键的范围不能被定义在键盘地图中,所以<literal>keychange</literal>通常需要安排功能键来匹配选择的终端类型。</para>
<para>也可以在<filename>/etc/ttys</filename>为所有<literal>ttyv*</literal>记录设定正确的控制台终端类型。
当前,预定义是这样的:</para>
<informaltable frame="none">
<tgroup cols="2">
<thead>
<row>
<entry>字符集设置</entry>
<entry>终端类型</entry>
</row>
</thead>
<tbody>
<row>
<entry>ISO-8859-1 or ISO-8859-15</entry>
<entry><literal>cons25l1</literal></entry>
</row>
<row>
<entry>ISO-8859-2</entry>
<entry><literal>cons25l2</literal></entry>
</row>
<row>
<entry>ISO-8859-7</entry>
<entry><literal>cons25l7</literal></entry>
</row>
<row>
<entry>KOI8-R</entry>
<entry><literal>cons25r</literal></entry>
</row>
<row>
<entry>KOI8-U</entry>
<entry><literal>cons25u</literal></entry>
</row>
<row>
<entry>CP437 (VGA default)</entry>
<entry><literal>cons25</literal></entry>
</row>
<row>
<entry>US-ASCII</entry>
<entry><literal>cons25w</literal></entry>
</row>
</tbody>
</tgroup>
</informaltable>
<para>对于多字节字符语言,可以您的在
<filename>/usr/ports/<replaceable>language</replaceable></filename>
目录中使用正确的FreeBSD port。一些port以控制台出现
而系统把它作为串行vtty终端因此 必须为 X11
和伪串行控制台准备足够的vtty终端。
下面是在控制台中使用其他语言的应用程序的部分列表:</para>
<informaltable frame="none">
<tgroup cols="2">
<thead>
<row>
<entry>语言</entry>
<entry>特定区域</entry>
</row>
</thead>
<tbody>
<row>
<entry>Traditional Chinese (BIG-5)</entry>
<entry><filename role="package">chinese/big5con</filename></entry>
</row>
<row>
<entry>Japanese</entry>
<entry><filename role="package">japanese/kon2-16dot</filename> or
<filename role="package">japanese/mule-freewnn</filename></entry>
</row>
<row>
<entry>Korean</entry>
<entry><filename role="package">korean/han</filename></entry>
</row>
</tbody>
</tgroup>
</informaltable>
</sect2>
<sect2>
<title>X11设置</title>
<para>虽然X11不是FreeBSD计划的一部分
但我们已经为FreeBSD用户包含了一些信息。
具体细节可以参考
<ulink url="http://www.xfree86.org/">&xfree86;web站点</ulink>
或是您使用的 X11 Server。</para>
<para>在<filename>~/.Xresources</filename>里面您可以适当调整特定应用程序的I18N设置如字体菜单等。</para>
<sect3>
<title>显示字体</title>
<indexterm><primary>X11 True Type字体服务器</primary></indexterm>
<para>安装X11 &truetype; 公共服务器 (<filename role="package">x11-servers/XttXF86srv-common</filename>)
和安装对应语言的&truetype;字体。设置正确的本地信息可以允许您在菜单上看到您所选的语言。
</para>
</sect3>
<sect3>
<title>输入非英语字符</title>
<indexterm><primary>X11输入方法(XIM)</primary></indexterm>
<para>
X11输入方法XIM协议是所有X11客户端的一个新标准。
所有将作为XIM客户端来写的X11应用程序从XIM输入服务器输入。
不同的语言有几种XIM服务器可用。
</para>
</sect3>
</sect2>
<sect2>
<title>打印机设置</title>
<para>一些简单的C字符集通常是用硬编码来编码进打印机的。更宽或多位的字符集需要特定的设置
我们推荐使用<application>apsfilter</application>。您也可以使用特定语言转换器把文档转换为
&postscript;或PDF格式。
</para>
</sect2>
<sect2>
<title>内核和文件系统</title>
<para>FreeBSD快速文件系统(FFS)是纯8位的所以它能使用任何简单的C字符集参考&man.multibyte.3;
但不会有字符集名字会储存在文件系统中。它是不知道任何有关编码规则的。
正式的FFS不支持任何更宽的或多位的字符集形式。
然而一些更宽的或多位的字符集已经通过添加补丁来对FFS进行支持。
他们只是临时性的修正,我们决定不把他们包括在源代码树中。
可以参考相关语言的web站点看看更多信息和修正文件。
</para>
<indexterm><primary>DOS</primary></indexterm>
<indexterm><primary>Unicode</primary></indexterm>
<para>FreeBSD &ms-dos;已经能够配置成用在&ms-dos;上Unicode字符集和可选的FreeBSD文件系统字符集的更多信息
请参考&man.mount.msdos.8;手册页。</para>
</sect2>
</sect1>
<sect1 id="l10n-compiling">
<title>编译I18N程序</title>
<para>许多FreeBSD Ports已经支持I18N了。他们中的一些都用-I18N作标记。
这些和其他很多程序已经内建I18N的支持不需要考虑其他的事项了。
</para>
<indexterm>
<primary><application>MySQL</application></primary>
</indexterm>
<para>然而一些像<application>MySQL</application>这样的应用程序需要重新配置字符集,可在
<filename>Makefile</filename>里面设置,或者直接把参数传递给<application>configure</application>。
</para>
</sect1>
<sect1 id="lang-setup">
<title>本地化FreeBSD</title>
<sect2 id="ru-localize">
<sect2info>
<authorgroup>
<author>
<firstname>Andrey A.</firstname>
<surname>Chernov</surname>
<contrib>Originally contributed by </contrib>
</author>
</authorgroup>
</sect2info>
<title>俄语KOI8-R编码</title>
<indexterm>
<primary>本地化</primary>
<secondary>俄语</secondary>
</indexterm>
<para>关于KOI8-R编码的更多信息请查阅<ulink
url="http://koi8.pp.ru/">KOI8-R参考Russian Net Character Set</ulink>。
</para>
<sect3>
<title>本地设置</title>
<para>把下面的行加入到您的<filename>~/.login_conf</filename>文件:</para>
<programlisting>me:My Account:\
:charset=KOI8-R:\
:lang=ru_RU.KOI8-R:</programlisting>
<para>参看前面的设置<link linkend="setting-locale">本地化</link>的例子。</para>
</sect3>
<sect3>
<title>控制台设置</title>
<itemizedlist>
<listitem>
<para>
对于FreeBSD 5.0以前的版本,添加下面这行到内核配置文件:
</para>
<programlisting>options SC_MOUSE_CHAR=0x03</programlisting>
<para>对于 FreeBSD 4.4 和更高版本把下面一行加到
<filename>/etc/rc.conf</filename></para>
<programlisting>mousechar_start=3</programlisting>
</listitem>
<listitem>
<para>在<filename>/etc/rc.conf</filename>里面使用如下设置:</para>
<programlisting>keymap="ru.koi8-r"
scrnmap="koi8-r2cp866"
font8x16="cp866b-8x16"
font8x14="cp866-8x14"
font8x8="cp866-8x8"</programlisting>
</listitem>
<listitem>
<para>对于<filename>/etc/ttys</filename>里面的<literal>ttyv*</literal>记录,要使用
<literal>cons25r</literal>作为终端类型。</para>
</listitem>
</itemizedlist>
<para>参看前面的设置<link linkend="setting-console">控制台</link>的例子。</para>
</sect3>
<sect3>
<title>打印机设置</title>
<indexterm><primary>打印机</primary></indexterm>
<para>既然绝大多数带俄语字符的打印机遵循CP866的标准
那么需要一个针对KOI8-R到CP866转换的特定输出过滤器。这样的一个过滤器默认的安装在
<filename>/usr/libexec/lpr/ru/koi2alt</filename>。
一个支持俄语的打印机的<filename>/etc/printcap</filename>记录看起来是这样的:
</para>
<programlisting>lp|Russian local line printer:\
:sh:of=/usr/libexec/lpr/ru/koi2alt:\
:lp=/dev/lpt0:sd=/var/spool/output/lpd:lf=/var/log/lpd-errs:</programlisting>
<para>更多信息参考&man.printcap.5;手册页。</para>
</sect3>
<sect3>
<title>&ms-dos;文件系统和俄语文件名</title>
<para>下面的例子是在挂上&ms-dos; 文件系统后,启用对俄语文件名支持的&man.fstab.5;记录:
</para>
<programlisting>/dev/ad0s2 /dos/c msdos rw,-Wkoi2dos,-Lru_RU.KOI8-R 0 0</programlisting>
<para>选项<option>-L</option>是选择本地化,<option>-W</option>是设置字符转换表。
要使用<option>-W</option>选项,必须在 &ms-dos; 之前挂上<filename>/usr</filename>
因为转换表位于<filename>/usr/libdata/msdosfs</filename>。更多的信息参考&man.mount.msdos.8;手册页。
</para>
</sect3>
<sect3>
<title>X11设置</title>
<orderedlist>
<listitem>
<para>先描述<link linkend="setting-locale">没有X的本地化设置</link>
</para>
<note>
<para><anchor id="russian-note">俄语KOI8-R本地化方法可能在低于<application>&xfree86;</application>3.3
不能工作。
<application>&xfree86; 4.X</application>现在在FreeBSD上是缺省的版本。所以这应该不是问题除非您
是使用的老版本。
</para>
</note>
</listitem>
<listitem>
<para>进入<filename role="package">russian/X.language</filename>目录,然后执行如下的命令:
</para>
<screen>&prompt.root; <userinput>make install</userinput></screen>
<para>上面的port安装了KOI8-R字体的最新版本<application>&xfree86; 3.3</application> 已经支持了一些KOI8-R字体但这些更好。
</para>
<para>在您的<filename>/etc/XF86Config</filename> 文件中检查<literal>"Files"</literal>那节。
需要在其他<literal>FontPath</literal> 记录<emphasis>之前</emphasis>加入下面这几行:
</para>
<programlisting>FontPath "/usr/X11R6/lib/X11/fonts/cyrillic/misc"
FontPath "/usr/X11R6/lib/X11/fonts/cyrillic/75dpi"
FontPath "/usr/X11R6/lib/X11/fonts/cyrillic/100dpi"</programlisting>
<para>如果您使用一个高分辨率的显示模式可以交换75 dpi 和100 dpi行。</para>
</listitem>
<listitem>
<para>为了激活俄语<literal>"键盘"</literal>,加下面几行到<filename>XF86Config</filename>文件里面:
</para>
<para>对于<application>&xfree86; 3.X</application>:</para>
<programlisting>XkbLayout "ru"
XkbOptions "grp:caps_toggle"</programlisting>
<para>对于<application>&xfree86; 4.X</application>:</para>
<programlisting>Option "XkbLayout" "ru"
Option "XkbOptions" "grp:caps_toggle"</programlisting>
<para>要确信<literal>XkbDisable</literal> 已经关闭(注释掉)了。</para>
<para>RUS/LAT的切换用<keycap>CapsLock</keycap>。老的<keycap>CapsLock</keycap>功能可以通过
<keycombo action="simul"><keycap>Shift</keycap><keycap>CapsLock</keycap></keycombo>
来模拟只有在LAT模式的时候。</para>
<para>如果您的键盘上有<quote>&windows;</quote>键,
注意在俄语模式中,一些非字母顺序的键会影射错误,可以在<filename>XF86Config</filename>文件中添加下面这行:
</para>
<para>对于<application>&xfree86; 3.X</application>:</para>
<programlisting>XkbVariant "winkeys"</programlisting>
<para>对于<application>&xfree86; 4.X</application>:</para>
<programlisting>Option "XkbVariant" "winkeys"</programlisting>
<note>
<para>俄语的XKB键盘可能不能在老版本的<application>&xfree86;</application>下工作,
更多的信息参考<link linkend="russian-note">上面的注释</link>。俄语XKB键盘也不能很好的工作在
非本地化应用程序下面。早期的非本地化应用程序最低限度应该调用<function>XtSetLanguageProc (NULL, NULL,
NULL);</function>。更多的本地化X11应用程序的信息请参考<ulink
url="http://koi8.pp.ru/xwin.html">
KOI8-R for X Window</ulink>。</para>
</note>
</listitem>
</orderedlist>
</sect3>
</sect2>
<sect2>
<title>设置繁体中文</title>
<indexterm>
<primary>本地化</primary>
<secondary>繁体中文</secondary>
</indexterm>
<para>FreeBSD-Taiwan计划有一个使用很多中文ports的中文化指南在
<ulink url="http://netlab.cse.yzu.edu.tw/~statue/freebsd/zh-tut/"></ulink>。
目前, <literal>FreeBSD 中文化指南</literal> 的维护人员是
沈俊兴 <email>statue@freebsd.sinica.edu.tw</email>。
</para>
<para>沈俊兴 <email>statue@freebsd.sinica.edu.tw</email>
利用 FreeBSD-Taiwan 的 <literal>zh-L10N-tut</literal>建立了
<ulink url="http://netlab.cse.yzu.edu.tw/~statue/cfc/">
Chinese FreeBSD Collection (CFC)</ulink>。 相关的 packages 和脚本等可以在
<ulink url="ftp://freebsd.csie.nctu.edu.tw/pub/taiwan/CFC/"></ulink> 找到。</para>
</sect2>
<sect2>
<title>德语本地化适合所有的ISO 8859-1语言</title>
<indexterm>
<primary>本地化</primary>
<secondary>德语</secondary>
</indexterm>
<para>Slaven Rezic <email>eserte at cs.tu-berlin.de</email>
写了一个在FreeBSD机器下如何使用日尔曼语言的德语指南。
可以在<ulink url="http://www.de.FreeBSD.org/de/umlaute/"></ulink>下找到。</para>
</sect2>
<sect2>
<title>日语和韩语本地化</title>
<indexterm>
<primary>本地化</primary>
<secondary>日语</secondary>
</indexterm>
<indexterm>
<primary>本地化</primary>
<secondary>韩语</secondary>
</indexterm>
<para>日语本地化请参考<ulink url="http://www.jp.FreeBSD.org/"></ulink>,韩语参考
<ulink url="http://www.kr.FreeBSD.org/"></ulink>。</para>
</sect2>
<sect2>
<title>非英语的FreeBSD文档</title>
<para>一些FreeBSD的贡献者已经将部分FreeBSD文档翻译成了其他语言。
可以通过<ulink
url="&url.base;/index.html">主站</ulink> 或者
<filename>/usr/share/doc</filename> 查到。</para>
</sect2>
</sect1>
</chapter>
<!--
Local Variables:
mode: sgml
sgml-declaration: "../chapter.decl"
sgml-indent-data: t
sgml-omittag: nil
sgml-always-quote-attributes: t
sgml-parent-document: ("../book.sgml" "part" "chapter")
End:
-->

@ -0,0 +1,16 @@
#
# Build the Handbook with just the content from this chapter.
#
# Original Revision: 1.1
# $FreeBSD$
#
CHAPTERS= linuxemu/chapter.sgml
VPATH= ..
MASTERDOC= ${.CURDIR}/../${DOC}.${DOCBOOKSUFFIX}
DOC_PREFIX?= ${.CURDIR}/../../../..
.include "../Makefile"

File diff suppressed because it is too large Load Diff

@ -0,0 +1,16 @@
#
# Build the Handbook with just the content from this chapter.
#
# Original Revision: 1.1
# $FreeBSD$
#
CHAPTERS= mac/chapter.sgml
VPATH= ..
MASTERDOC= ${.CURDIR}/../${DOC}.${DOCBOOKSUFFIX}
DOC_PREFIX?= ${.CURDIR}/../../../..
.include "../Makefile"

@ -0,0 +1,119 @@
<!--
The FreeBSD Documentation Project
The FreeBSD Simplified Chinese Project
Skeleton File; Obtained from FreeBSD Handbook-fr
$FreeBSD$
-->
<chapter id="mac">
<title>Mandatory Access Control ** ·­Òë½øÐÐÖÐ **</title>
<sect1 id="mac-synopsis">
<title>Synopsis</title>
<para></para>
</sect1>
<sect1 id="mac-glossary">
<title>Key Terms in this Chapter</title>
<para></para>
</sect1>
<sect1 id="mac-initial">
<title>Explanation of MAC</title>
<para></para>
</sect1>
<sect1 id="mac-understandlabel">
<title>Understanding MAC Labels</title>
<para></para>
</sect1>
<sect1 id="mac-modules">
<title>Module Configuration</title>
<para></para>
</sect1>
<sect1 id="mac-bsdextended">
<title>The MAC bsdextended Module</title>
<para></para>
</sect1>
<sect1 id="mac-ifoff">
<title>The MAC ifoff Module</title>
<para></para>
</sect1>
<sect1 id="mac-portacl">
<title>The MAC portacl Module</title>
<para></para>
</sect1>
<sect1 id="mac-labelingpolicies">
<title>MAC Policies with Labeling Features</title>
<para></para>
</sect1>
<sect1 id="mac-partition">
<title>The MAC partition Module</title>
<para></para>
</sect1>
<sect1 id="mac-mls">
<title>The MAC Multi-Level Security Module</title>
<para></para>
</sect1>
<sect1 id="mac-biba">
<title>The MAC Biba Module</title>
<para></para>
</sect1>
<sect1 id="mac-lomac">
<title>The MAC LOMAC Module</title>
<para></para>
</sect1>
<sect1 id="mac-implementing">
<title>Implementing a Secure Environment with MAC</title>
<para></para>
</sect1>
<sect1 id="MAC-examplehttpd">
<title>Another Example: Using MAC to Constrain a Web Server</title>
<para></para>
</sect1>
<sect1 id="mac-troubleshoot">
<title>Troubleshooting the MAC Framework</title>
<para></para>
</sect1>
</chapter>
<!--
Local Variables:
mode: sgml
sgml-declaration: "../chapter.decl"
sgml-indent-data: t
sgml-omittag: nil
sgml-always-quote-attributes: t
sgml-parent-document: ("../book.sgml" "part" "chapter")
End:
-->

@ -0,0 +1,16 @@
#
# Build the Handbook with just the content from this chapter.
#
# Original Revision: 1.1
# $FreeBSD$
#
CHAPTERS= mail/chapter.sgml
VPATH= ..
MASTERDOC= ${.CURDIR}/../${DOC}.${DOCBOOKSUFFIX}
DOC_PREFIX?= ${.CURDIR}/../../../..
.include "../Makefile"

File diff suppressed because it is too large Load Diff

@ -0,0 +1,16 @@
#
# Build the Handbook with just the content from this chapter.
#
# Original Revision:
# $FreeBSD$
#
CHAPTERS= mirrors/chapter.sgml
VPATH= ..
MASTERDOC= ${.CURDIR}/../${DOC}.${DOCBOOKSUFFIX}
DOC_PREFIX?= ${.CURDIR}/../../../..
.include "../Makefile"

File diff suppressed because it is too large Load Diff

@ -0,0 +1,16 @@
#
# Build the Handbook with just the content from this chapter.
#
# Original Revision: 1.2
# $FreeBSD$
#
CHAPTERS= multimedia/chapter.sgml
VPATH= ..
MASTERDOC= ${.CURDIR}/../${DOC}.${DOCBOOKSUFFIX}
DOC_PREFIX?= ${.CURDIR}/../../../..
.include "../Makefile"

File diff suppressed because it is too large Load Diff

@ -0,0 +1,16 @@
#
# Build the Handbook with just the content from this chapter.
#
# Original Revision: 1.1
# $FreeBSD$
#
CHAPTERS= network-servers/chapter.sgml
VPATH= ..
MASTERDOC= ${.CURDIR}/../${DOC}.${DOCBOOKSUFFIX}
DOC_PREFIX?= ${.CURDIR}/../../../..
.include "../Makefile"

@ -0,0 +1,966 @@
<!--
The FreeBSD Documentation Project
The FreeBSD Simplified Chinese Project
Original Revision: 1.29
$FreeBSD$
-->
<chapter id="network-servers">
<chapterinfo>
<authorgroup>
<author>
<firstname>Murray</firstname>
<surname>Stokely</surname>
<contrib>Reorganized by </contrib>
</author>
</authorgroup>
<!-- 23 July 2004 -->
</chapterinfo>
<title>Network Servers</title>
<sect1 id="network-servers-synopsis">
<title>概要</title>
<para>本章将覆盖某些在 &unix; 系统上常用的网络服务。话题将会涉及
如何安装、配置、测试和维护多种不同类型的网络服务。本章节中将提
供大量配置文件的样例,期望能够对您有所裨益。</para>
<para>在读完本章之后,您将会知道:</para>
<itemizedlist>
<listitem>
<para>如何管理<application>inetd</application>
。</para>
</listitem>
<listitem>
<para>如何设置运行一个网络文件系统。</para>
</listitem>
<listitem>
<para>如何配置一个网络信息服务器以共享用户帐号。</para>
</listitem>
<listitem>
<para>如何通过DHCP自动配置网络。</para>
</listitem>
<listitem>
<para>如何配置一个域名服务器。</para>
</listitem>
<listitem>
<para>如何设置<application>Apache</application> HTTP 服务器。</para>
</listitem>
<listitem>
<para>如何设置文件传输FTP服务器。</para>
</listitem>
<listitem>
<para>如何使用<application>Samba</application>为 &windows;
客户端设置文件和打印服务。</para>
</listitem>
<listitem>
<para>如何同步时间和日期以及如何设置使用NTP协议的时间服务器。</para>
</listitem>
</itemizedlist>
<para>在阅读此章节之前,您应当:</para>
<itemizedlist>
<listitem>
<para>理解有关<filename>/etc/rc</filename>中脚本的基本知识。</para>
</listitem>
<listitem>
<para>熟悉基本网络术语。</para>
</listitem>
<listitem>
<para>懂得如何安装额外的第三方软件(<xref linkend="ports">)。</para>
</listitem>
</itemizedlist>
</sect1>
<sect1 id="network-inetd">
<sect1info>
<authorgroup>
<author>
<firstname>Chern</firstname>
<surname>Lee</surname>
<contrib>Contributed by </contrib>
</author>
</authorgroup>
</sect1info>
<title> <application>inetd</application> <quote>超级服务器</quote></title>
<sect2 id="network-inetd-overview">
<title>总览</title>
<para>&man.inetd.8; 被称为<quote>Internet
Super-Server</quote> 因为它管理几个守护程序的链接。提供网络
服务的程序被称为守护进程。<application>inetd</application>
作为一个为其他服务的管理服务器,当一个被<application>inetd</application>
收到后,它将决定连接将前往哪个程序,然后拉起对应的守护进程,
并将socket转交过去。 比起来将所有守护进程以stand-alone模式
运行,运行单个<application>inetd</application>实例可以降低
系统开销。</para>
<para>一般说来,<application>inetd</application> 被用来拉起
其他守护进程,不过有些细碎的协议被直接接管,比如<application>chargen</application>
<application>auth</application>,和
<application>daytime</application>。</para>
<para>这一部分将通过命令行选项和<filename>/etc/inetd.conf</filename>
文件来介绍配置<application>inetd</application> 的基础知识。</para>
</sect2>
<sect2 id="network-inetd-settings">
<title>设置</title>
<para><application>inetd</application> 通过 <filename>/etc/rc.conf</filename>
系统进行初始化。<literal>inetd_enable</literal> 选项默认被设定为
<literal>NO</literal>,不过可以通过<application>sysinstall</application>打开,
如果选用中等安全的模板。在<filename>/etc/rc.conf</filename>中设定:
<programlisting>inetd_enable="YES"</programlisting> 或
<programlisting>inetd_enable="NO"</programlisting>
可以激活或者禁止<application>inetd</application>在启动时加载。</para>
<para>此外,可以通过<literal>inetd_flags</literal>把不同的
命令行参数传给<application>inetd</application>。</para>
</sect2>
<sect2 id="network-inetd-cmdline">
<title>命令行选项</title>
<para><application>inetd</application> 语法:</para>
<para><option> inetd [-d] [-l] [-w] [-W] [-c maximum] [-C rate] [-a address | hostname]
[-p filename] [-R rate] [configuration file]</option></para>
<variablelist>
<varlistentry>
<term>-d</term>
<listitem>
<para>打开调试选项。</para>
</listitem>
</varlistentry>
<varlistentry>
<term>-l</term>
<listitem>
<para>纪录成功的连接</para>
</listitem>
</varlistentry>
<varlistentry>
<term>-w</term>
<listitem>
<para>为外部服务打开TCP Wrapping默认。</para>
</listitem>
</varlistentry>
<varlistentry>
<term>-W</term>
<listitem>
<para>为<application>inetd</application>的内置服务打开TCP Wrapping (默认)。</para>
</listitem>
</varlistentry>
<varlistentry>
<term>-c maximum</term>
<listitem>
<para>指定单个服务的最大并发访问数量,默认为不限。
也可以在此服务的具体配置里面通过<option>max-child</option>改掉。</para>
</listitem>
</varlistentry>
<varlistentry>
<term>-C rate</term>
<listitem>
<para>指定单个服务一分钟内能被单个IP地址调用的最大次数
默认不限。也可以在此服务的具体配置里面通过<option>max-connections-per-ip-per-minute</option>
改掉。</para>
</listitem>
</varlistentry>
<varlistentry>
<term>-R rate</term>
<listitem>
<para>指定单个服务一分钟内能被调用的最大次数默认为256。
设为0 则允许不限次数调用。</para>
</listitem>
</varlistentry>
<varlistentry>
<term>-a</term>
<listitem>
<para>指定绑定的IP地址。此外可以使用主机名这样系统就
可以根据主机名对应的IPV4或者IPV6来选择绑定地址。通常当
<application>inetd</application> 在 &man.jail.8; 中运行
的时候指定主机名,这种情况下主机名来自 &man.jail.8; 环
境变量</para>
<para>当使用主机名方式时如果IPV4和IPV6都会被绑定到服务
那么,需要在<filename>/etc/inetd.conf</filename>.中为该服务
的每个对应协议添加一条记录。比如一个TCP服务需要两条纪录
一条使用<literal>tcp4</literal>,另一条使用<literal>tcp6</literal>。</para>
</listitem>
</varlistentry>
<varlistentry>
<term>-p</term>
<listitem>
<para>指定用来存放进程ID的文件。</para>
</listitem>
</varlistentry>
</variablelist>
<para>以上选项在<filename>/etc/rc.conf</filename>中将可以
被<literal>inetd_flags</literal>开关传递给<application>inetd</application>。
默认情况下,<literal>inetd_flags</literal> 被置为
<literal>-wW</literal>,也既是对<application>inetd</application>的内置或外部服务打开TCP wrapping.
对于新手,通常不用去动这些参数,就算它们出现在<filename>/etc/rc.conf</filename>里头。</para>
<note>
<para>对<application>inetd</application>而言,所谓外部服务是当
连接请求到来时被调用并接受连接启动于inetd之外的守护进程。
反之,内置服务则是那些<application>inetd</application>自己可
以完全处理的了。</para>
</note>
</sect2>
<sect2 id="network-inetd-conf">
<title><filename>inetd.conf</filename></title>
<para><application>inetd</application>的配置通过
<filename>/etc/inetd.conf</filename>文件进行控制。</para>
<para>当
<filename>/etc/inetd.conf</filename>内容发生改变,可以
对<application>inetd</application>进程发送一个HangUP信号以强制
<application>inetd</application>重新读取配置文件,如下所示:</para>
<example id="network-inetd-hangup">
<title>对 <application>inetd</application>发送HangUP信号</title>
<screen>&prompt.root; <userinput>kill -HUP `cat /var/run/inetd.pid`</userinput></screen>
</example>
<para>配置文件中的每一行都是一个独立服务。如果要注释掉该服务,可以在行首加上
<quote>#</quote>。<filename>/etc/inetd.conf</filename>的格式如下:</para>
<programlisting>service-name
socket-type
protocol
{wait|nowait}[/max-child[/max-connections-per-ip-per-minute]]
user[:group][/login-class]
server-program
server-program-arguments</programlisting>
<para><application>ftpd</application>使用IPv4的例子</para>
<programlisting>ftp stream tcp nowait root /usr/libexec/ftpd ftpd -l</programlisting>
<variablelist>
<varlistentry>
<term>service-name</term>
<listitem>
<para>指明各个服务的服务名。其服务名必须与<filename>/etc/services</filename>中列出的一致。
这将决定<application>inetd</application>会监听哪个port。
一旦有新的服务需要添加,必须先在<filename>/etc/services</filename>里面添加。</para>
</listitem>
</varlistentry>
<varlistentry>
<term>socket-type</term>
<listitem>
<para>可以是<literal>stream</literal>、<literal>dgram</literal>、<literal>raw</literal>或者
<literal>seqpacket</literal>。 <literal>stream</literal>
用在基于连接的TCP 服务;而<literal>dgram</literal>被用于服务用于<acronym>UDP</acronym>传输协议。</para>
</listitem>
</varlistentry>
<varlistentry>
<term>protocol</term>
<listitem>
<para>下列之一:</para>
<informaltable frame="none">
<tgroup cols="2">
<thead>
<row>
<entry>协议</entry>
<entry>说明</entry>
</row>
</thead>
<tbody>
<row>
<entry>tcp tcp4</entry>
<entry>TCP IPv4</entry>
</row>
<row>
<entry>udp udp4</entry>
<entry>UDP IPv4</entry>
</row>
<row>
<entry>tcp6</entry>
<entry>TCP IPv6</entry>
</row>
<row>
<entry>udp6</entry>
<entry>UDP IPv6</entry>
</row>
<row>
<entry>tcp46</entry>
<entry>Both TCP IPv4 and v6</entry>
</row>
<row>
<entry>udp46</entry>
<entry>Both UDP IPv4 and v6</entry>
</row>
</tbody>
</tgroup>
</informaltable>
</listitem>
</varlistentry>
<varlistentry>
<term>{wait|nowait}[/max-child[/max-connections-per-ip-per-minute]]</term>
<listitem>
<para><option>wait|nowait</option> 指明从<application>inetd</application>
里头调用的服务是否可以自己处理socket.
<option>dgram</option>socket类型必须使用<option>wait</option>
而stream socket daemons 由于通常使用多线程方式,应当使用
<option>nowait</option>. <option>wait</option> 通常usually
把多个socket丢给单个服务进程 而<option>nowait</option> 则
会为每个新的socket生成一个子进程。</para>
<para>使用<option>max-child</option>选项可以设定针对服务,
<application>inetd</application>可以派生出来的最大子进程数量。
如果某特定服务需要限定最高10个实例把<literal>/10</literal>
放到<option>nowait</option>后头就可以了。</para>
<para>在<option>max-child</option>之外,还有一个开关可以限制
来自同一个地方,针对某个服务的最大连接数。这个开关就是:
<option>max-connections-per-ip-per-minute</option>。
比如设定该值为10就可以限定单个IP地址去向某服务的连接最大
为每分钟十个。这个对于防止有意或者无意的资源耗尽或者拒绝服
DoS颇有用处。</para>
<para>在这部分,必须选择<option>wait</option>或
<option>nowait</option>。
<option>max-child</option>和
<option>max-connections-per-ip-per-minute</option> 则为可有可无。</para>
<para>一个stream-type多线程的服务如果没有
<option>max-child</option>或者
<option>max-connections-per-ip-per-minute</option>需要,
一般使用: <literal>nowait</literal>。</para>
<para>同样的服务,如果需要限制最大连接数,则如下:
<literal>nowait/10</literal>。</para>
<para>此外如果要限制每分钟单个IP来访连接为20个同时最多
派生10个进程可以如下
<literal>nowait/10/20</literal>。</para>
<para>以上开关都默认被使用在<application>fingerd</application>服务上面,
如下所示:</para>
<programlisting>finger stream tcp nowait/3/10 nobody /usr/libexec/fingerd fingerd -s</programlisting>
</listitem>
</varlistentry>
<varlistentry>
<term>user</term>
<listitem>
<para>该开关指定服务将以什么用户身份运行。一般而言,服务运行身份是
<username>root</username>。基于安全目的,可以看到有些服务以
<username>daemon</username>身份,或者是最小特权的
<username>nobody</username>身份运行。</para>
</listitem>
</varlistentry>
<varlistentry>
<term>server-program</term>
<listitem>
<para>当连接到来时,执行服务程序的全路径。如果服务是由
<application>inetd</application>内置提供的,以<option>internal</option>代替。</para>
</listitem>
</varlistentry>
<varlistentry>
<term>server-program-arguments</term>
<listitem>
<para>当<option>server-program</option>调用到时,该开关
的值通过<literal>argv[0]</literal>通过传递给服务而工作。
如果命令行为:<command>mydaemon -d</command>,则
<literal>mydaemon -d</literal>为<option>server-program-arguments</option>
开关的值。同样的,如果服务是由<application>inetd</application>
内置提供的,这里还是
<option>internal</option>。</para>
</listitem>
</varlistentry>
</variablelist>
</sect2>
<sect2 id="network-inetd-security">
<title>Security</title>
<para>随安装时候选择的安全模式不同,部分<application>inetd</application>的服务
会被设为默认打开。如果没有确实的需要,禁止它们!只要在<filename>/etc/inetd.conf</filename>里头
需要禁止的服务前头加上<quote>#</quote>,然后<link linkend="network-inetd-hangup">
对inetd发送hangup信号</link>。某些服务,比如<application>fingerd</application>
由于对攻击者提供太多信息,可能对任何人都应该禁止。</para>
<para>某些服务在安全上没有考虑,并且有一些连接超时检测设得很长或没有检测机制。
这回允许攻击者慢慢地发送连接,这样可以导致可用资源的消耗。在某些服务上面加上
<option>max-connections-per-ip-per-minute</option>和<option>max-child</option>
的限制似乎不错。</para>
<para>默认情况下TCP wrapping 是打开的。参考
&man.hosts.access.5; 手册,以获得更多关于在各种<application>inetd</application>
调用的服务上设置TCP限制的信息。</para>
</sect2>
<sect2 id="network-inetd-misc">
<title>杂项</title>
<para><application>daytime</application>
<application>time</application>
<application>echo</application>
<application>discard</application>
<application>chargen</application>
<application>auth</application> 都是<application>inetd</application>内置的服务。</para>
<para><application>auth</application>服务提供
identity <application>ident</application>
<application>identd</application>)网络服务,并且某种程度上可配置。</para>
<para>参考 &man.inetd.8; 手册获得更多信息。</para>
</sect2>
</sect1>
<sect1 id="network-nfs">
<sect1info>
<authorgroup>
<author>
<firstname>Tom</firstname>
<surname>Rhodes</surname>
<contrib>Reorganized and enhanced by </contrib>
</author>
</authorgroup>
<authorgroup>
<author>
<firstname>Bill</firstname>
<surname>Swingle</surname>
<contrib>Written by </contrib>
</author>
</authorgroup>
</sect1info>
<title>网络文件系统NFS</title>
<indexterm><primary>NFS</primary></indexterm>
<para>网络文件系统是FreeBSD支持的文件系统中的一种也被称为<acronym role="Network
File System">NFS</acronym>. <acronym role="Network File
System">NFS</acronym>允许一个系统在网络上与它人共享目录和文件。通过使用<acronym
role="Network File System">NFS</acronym>,用户和程序可以象访问本地文件
一样访问远端系统上的文件。</para>
<para>以下是<acronym>NFS</acronym>最显而易见的好处:</para>
<itemizedlist>
<listitem>
<para>本地工作站使用更少的磁盘空间,因为通常的数据可以存放在一
台机器上而且可以通过网络访问到。</para>
</listitem>
<listitem>
<para>用户不必在每个网络上机器里头都有一个home目录。Home目录
可以被放在<acronym>NFS</acronym>服务器上并且在网络上处处可用。
</para>
</listitem>
<listitem>
<para>诸如软驱CDROM和 &iomegazip; 之类的存储设备可以在网络上面被别的机器使用。
这可以减少整个网络上的可移动介质设备的数量。</para>
</listitem>
</itemizedlist>
<sect2>
<title><acronym>NFS</acronym>是如何工作的</title>
<para><acronym>NFS</acronym>至少有两个主要部分:一台服务器和一
台(或者更多)客户机。客户机远程访问存放在服务器上的数据。为了
正常工作,一些进程需要被配置并运行。</para>
<note><para>在 &os; 5.X上面<application>portmap</application>
被<application>rpcbind</application>替换了。而且,在&os; 5.X上面
the user is required to replace every instance of
<application>portmap</application> with
<application>rpcbind</application> in the forthcoming
examples。</para></note>
<para>服务器必须运行以下服务:</para>
<indexterm>
<primary>NFS</primary>
<secondary>server</secondary>
</indexterm>
<indexterm>
<primary>file server </primary>
<secondary>unix clients </secondary>
</indexterm>
<indexterm>
<primary><application>portmap</application></primary>
</indexterm>
<indexterm>
<primary><application>mountd</application></primary>
</indexterm>
<indexterm>
<primary><application>nfsd</application></primary>
</indexterm>
<informaltable frame="none" pgwide="1">
<tgroup cols="2">
<colspec colwidth="1*">
<colspec colwidth="3*">
<thead>
<row>
<entry>服务</entry>
<entry>描述</entry>
</row>
</thead>
<tbody>
<row>
<entry><application>nfsd</application></entry>
<entry><acronym>NFS</acronym>,为来自<acronym>NFS</acronym>客户端的
请求服务。</entry>
</row>
<row>
<entry><application>mountd</application></entry>
<entry><acronym>NFS</acronym>挂载服务,处理&man.nfsd.8;递交过来的请求。</entry>
</row>
<row>
<entry><application>portmap</application></entry>
<entry> portmap服务允许
<acronym>NFS</acronym>客户端查看<acronym>NFS</acronym>服务在用的端口。</entry>
</row>
</tbody>
</tgroup>
</informaltable>
<para>客户端同样运行一些进程,比如
<application>nfsiod</application>。
<application>nfsiod</application>处理来自<acronym>NFS</acronym>的请求。
这是可选的,而且可以提高性能,对于普通和正确的操作来说并不是必须的。
参考&man.nfsiod.8;手册获得更多信息。
</para>
</sect2>
<sect2 id="network-configuring-nfs">
<title>配置<acronym>NFS</acronym></title>
<indexterm>
<primary>NFS</primary>
<secondary>configuration</secondary>
</indexterm>
<para><acronym>NFS</acronym>的配置过程相对简单。这个过程只需要
对<filename>/etc/rc.conf</filename>文件作一些简单修改。</para>
<para>在<acronym>NFS</acronym>服务器这端,确认<filename>/etc/rc.conf</filename>
文件里头以下开关都配上了:</para>
<programlisting>portmap_enable="YES"
nfs_server_enable="YES"
mountd_flags="-r"</programlisting>
<para>只要<acronym>NFS</acronym>服务被置为enable<application>mountd</application>
就能自动运行。</para>
<para>在客户端一侧,确认下面这个开关出现在
<filename>/etc/rc.conf</filename>里头:</para>
<programlisting>nfs_client_enable="YES"</programlisting>
<para><filename>/etc/exports</filename>文件指定了哪个文件系统
<acronym>NFS</acronym>应该输出(有时被称为<quote>共享</quote>)。
<filename>/etc/exports</filename>里面每行指定一个输出的文件系统和
哪些机器可以访问该文件系统。在指定机器访问权限的同时,访问选项
开关也可以被指定。有很多开关可以被用在这个文件里头,不过不会在这
里详细谈。您可以通过阅读&man.exports.5; 手册来发现这些开关。</para>
<para>以下是一些<filename>/etc/exports</filename>的例子:</para>
<indexterm>
<primary>NFS</primary>
<secondary>export examples</secondary>
</indexterm>
<para>紧接着的这个例子说明了如何输出一个文件系统,尽管具体设定和您
的环境以及网络配置有关。作为实例,为了输出<filename>/cdrom</filename>
到三个的例子机器,它们有同样域名(因此他们的域名不大对)或者在您的
<filename>/etc/hosts</filename>文件里头有纪录。<option>-ro</option>
标志将被输出的文件系统置为只读。由于这个标志,远程系统将无法在被输出
的文件系统上写入任何变动。</para>
<programlisting>/cdrom -ro host1 host2 host3</programlisting>
<para>下面的例子可以输出<filename>/home</filename>给三个以IP地址方式表示的主机。
对于在没有配置<acronym>DNS</acronym>服务器的私有网络里头,这很有用。
此外the <filename>/etc/hosts</filename> 文件也可以用以配置主机名;参看 &man.hosts.5; 。
<option>-alldirs</option> 标记允许子目录被作为挂载点。
也就是说,客户端可以根据需要挂载需要的目录。 </para>
<programlisting>/home -alldirs 10.0.0.2 10.0.0.3 10.0.0.4</programlisting>
<para>下面几行输出 <filename>/a</filename> ,以便两个来自不同域的客户端可以访问文件系统。
<option>-maproot=root</option> 标记授权远端系统上的
<username>root</username> 用户在被输出的文件系统上以<username>root</username>身份进行读写。
如果没有特别指定 <literal>-maproot=root</literal> 标记,
则即使用户在远端系统上是 <username>root</username> 身份,
也不能修改被输出文件系统上的文件。 </para>
<programlisting>/a -maproot=root host.example.com box.example.org</programlisting>
<para> 为了能够访问到被输出的文件系统,客户端必须被授权。
请确认客户端在您的 <filename>/etc/exports</filename> 被列出。 </para>
<para>在 <filename>/etc/exports</filename> 里头,每一行里面,输出信息和文件系统一一对应。
一个远程主机每次只能对应一个文件系统。而且只能有一个默认入口。比如,假设
<filename>/usr</filename> 是独立的文件系统。这个 <filename>/etc/exports</filename> 就是无效的:</para>
<programlisting>/usr/src client
/usr/ports client</programlisting>
<para>一个文件系统,<filename>/usr</filename> 有两行指定输出到同一主机,
<hostid>client</hostid>.
解决这一问题的正确的格式是:</para>
<programlisting>/usr/src /usr/ports client</programlisting>
<para>The properties of one filesystem exported to a given host
must all occur on one line. Lines without a client specified
are treated as a single host. This limits how you can export
filesystems, but for most people this is not an issue.</para>
<para>下面是一个有效输出列表的例子,
<filename>/usr</filename> and <filename>/exports</filename>
是本地文件系统:</para>
<programlisting># Export src and ports to client01 and client02, but only
# client01 has root privileges on it
/usr/src /usr/ports -maproot=root client01
/usr/src /usr/ports client02
# The client machines have root and can mount anywhere
# on /exports. Anyone in the world can mount /exports/obj read-only
/exports -alldirs -maproot=root client01 client02
/exports/obj -ro</programlisting>
<para>一旦修改 <filename>/etc/exports</filename> 了之后,
为了让变动生效,您必须重启 <application>mountd</application>。
可以通过对<command>mountd</command> 进程发送HUP信号重启</para>
<screen>&prompt.root; <userinput>kill -HUP `cat /var/run/mountd.pid`</userinput></screen>
<para>另外系统重启动可以让FreeBSD把一切都弄好。尽管如此重启不是必须的。
以 <username>root</username> 身份执行下面的命令可以搞定一切。</para>
<para>在 <acronym>NFS</acronym> 服务器端:</para>
<screen>&prompt.root; <userinput>portmap</userinput>
&prompt.root; <userinput>nfsd -u -t -n 4</userinput>
&prompt.root; <userinput>mountd -r</userinput></screen>
<para>在 <acronym>NFS</acronym> 客户端:</para>
<screen>&prompt.root; <userinput>nfsiod -n 4</userinput></screen>
<para>现在每件事情都应该就绪,以备挂载一个远端文件系统。 在这些例子里头,
服务器名字将是:<hostid>server</hostid> ,而客户端的名字将是: <hostid>client</hostid>。
如果您只打算临时挂载一个远端文件系统或者只是打算作测试配置正确与否,
只要在客户端以 <username>root</username> 身份执行下面的命令:</para>
<indexterm>
<primary>NFS</primary>
<secondary>mounting</secondary>
</indexterm>
<screen>&prompt.root; <userinput>mount server:/home /mnt</userinput></screen>
<para>这条命令会把服务端的 <filename>/home</filename> 目录挂载到客户端的 <filename>/mnt</filename> 上。
如果配置正确,您应该可以进入客户端的 <filename>/mnt</filename> 目录并且看到所有服务端的文件。 </para>
<para>如果您打算让系统每次在重启动的时候都自动挂载远端的文件系统,把那个文件系统加到
<filename>/etc/fstab</filename> 文件里头去。下面是例子:</para>
<programlisting>server:/home /mnt nfs rw 0 0</programlisting>
<para> &man.fstab.5; 手册里有所有可用的开关。</para>
</sect2>
<sect2>
<title>实际应用</title>
<para><acronym>NFS</acronym> 有很多实际应用。下面是比较常见的一些:</para>
<indexterm>
<primary>NFS</primary>
<secondary>uses</secondary>
</indexterm>
<itemizedlist>
<listitem>
<para>多个机器共享一台CDROM或者其他设备。这对于在多台机器中安装软件来说更加便宜跟方便。
</para>
</listitem>
<listitem>
<para>在大型网络中,配置一台中心 <acronym>NFS</acronym> 服务器用来放置所有用户的home目录可能会带来便利。
这些目录能被输出到网络以便用户不管在哪台工作站上登录总能得到相同的home目录。
</para>
</listitem>
<listitem>
<para>几台机器可以有通用的<filename>/usr/ports/distfiles</filename> 目录。
这样的话当您需要在几台机器上安装port时您可以无需在每台设备上下载而快速访问源码。
</para>
</listitem>
</itemizedlist>
</sect2>
<sect2 id="network-amd">
<sect2info>
<authorgroup>
<author>
<firstname>Wylie</firstname>
<surname>Stilwell</surname>
<contrib>Contributed by </contrib>
</author>
</authorgroup>
<authorgroup>
<author>
<firstname>Chern</firstname>
<surname>Lee</surname>
<contrib>Rewritten by </contrib>
</author>
</authorgroup>
</sect2info>
<title>使用 <application>amd</application> 自动挂载 ** 翻译进行中 **</title>
<para></para>
</sect2>
<sect2 id="network-nfs-integration">
<sect2info>
<authorgroup>
<author>
<firstname>John</firstname>
<surname>Lind</surname>
<contrib>Contributed by </contrib>
</author>
</authorgroup>
</sect2info>
<title>Problems Integrating with Other Systems ** 翻译进行中 **</title>
<para></para>
</sect2>
</sect1>
<sect1 id="network-nis">
<sect1info>
<authorgroup>
<author>
<firstname>Bill</firstname>
<surname>Swingle</surname>
<contrib>Written by </contrib>
</author>
</authorgroup>
<authorgroup>
<author>
<firstname>Eric</firstname>
<surname>Ogren</surname>
<contrib>Enhanced by </contrib>
</author>
<author>
<firstname>Udo</firstname>
<surname>Erdelhoff</surname>
</author>
</authorgroup>
</sect1info>
<title>Network Information System (NIS/YP) ** 翻译进行中 **</title>
<sect2 id="network-netgroups">
<sect2info>
<authorgroup>
<author>
<firstname>Udo</firstname>
<surname>Erdelhoff</surname>
<contrib>Contributed by </contrib>
</author>
</authorgroup>
</sect2info>
<title>Using Netgroups ** 翻译进行中 **</title>
<para></para>
</sect2>
<sect2>
<title>Important Things to Remember ** 翻译进行中 **</title>
<para></para>
</sect2>
<sect2 id="network-nis-server-is-client">
<title>NIS Servers That Are Also NIS Clients ** 翻译进行中 **</title>
<para></para>
</sect2>
</sect1>
<sect1 id="network-dhcp">
<sect1info>
<authorgroup>
<author>
<firstname>Greg</firstname>
<surname>Sutter</surname>
<contrib>Written by </contrib>
</author>
</authorgroup>
</sect1info>
<title>Automatic Network Configuration (DHCP) ** 翻译进行中 **</title>
<sect2 id="network-dhcp-server">
<title>Installing and Configuring a DHCP Server ** 翻译进行中 **</title>
<para></para>
</sect2>
</sect1>
<sect1 id="network-dns">
<sect1info>
<authorgroup>
<author>
<firstname>Chern</firstname>
<surname>Lee</surname>
<contrib>Contributed by </contrib>
</author>
</authorgroup>
</sect1info>
<title>Domain Name System (DNS)</title>
<sect2 id="network-named-sandbox">
<title>Running <application>named</application> in a Sandbox ** 翻译进行中 **</title>
<indexterm>
<primary>BIND</primary>
<secondary>running in a sandbox</secondary>
</indexterm>
<para></para>
</sect2>
</sect1>
<sect1 id="network-apache">
<sect1info>
<authorgroup>
<author>
<firstname>Murray</firstname>
<surname>Stokely</surname>
<contrib>Contributed by </contrib>
</author>
</authorgroup>
</sect1info>
<title>Apache HTTP Server ** 翻译进行中 **</title>
<indexterm><primary>web server</primary>
<secondary>setting up</secondary></indexterm>
<indexterm><primary>Apache</primary></indexterm>
<para></para>
</sect1>
<sect1 id="network-samba">
<sect1info>
<authorgroup>
<author>
<firstname>Murray</firstname>
<surname>Stokely</surname>
<contrib>Contributed by </contrib>
</author>
</authorgroup>
</sect1info>
<title>File and Print Services for &microsoft.windows; clients (Samba) ** 翻译进行中 **</title>
<indexterm><primary>Samba server</primary></indexterm>
<indexterm><primary>Microsoft Windows</primary></indexterm>
<indexterm>
<primary>file server</primary>
<secondary>Windows clients</secondary>
</indexterm>
<indexterm>
<primary>print server</primary>
<secondary>Windows clients</secondary>
</indexterm>
<sect2>
<title>Overview ** 翻译进行中 **</title>
<para></para>
</sect2>
</sect1>
<sect1 id="network-ntp">
<sect1info>
<authorgroup>
<author>
<firstname>Tom</firstname>
<surname>Hukins</surname>
<contrib>Contributed by </contrib>
</author>
</authorgroup>
</sect1info>
<title>Clock Synchronization with NTP ** 翻译进行中 **</title>
<para></para>
</sect1>
</chapter>
<!--
Local Variables:
mode: sgml
sgml-declaration: "../chapter.decl"
sgml-indent-data: t
sgml-omittag: nil
sgml-always-quote-attributes: t
sgml-parent-document: ("../book.sgml" "part" "chapter")
End:
-->
<!-- LocalWords: config mnt www -->

@ -0,0 +1,20 @@
#
# Build the Handbook with just the content from this chapter.
#
# Original Revision: 1.3
# $FreeBSD$
#
CHAPTERS= pgpkeys/chapter.sgml
PGPKEYS!= perl -ne 'm/\"([\w-]+.key)\"/ && print "$$1\n"' \
${DOC_PREFIX}/share/pgpkeys/pgpkeys.ent
SRCS+= ${PGPKEYS}
VPATH= ..
MASTERDOC= ${.CURDIR}/../${DOC}.${DOCBOOKSUFFIX}
DOC_PREFIX?= ${.CURDIR}/../../../..
.include "../Makefile"

@ -0,0 +1,873 @@
<!--
The FreeBSD Documentation Project
The FreeBSD Simplified Chinese Project
Original Revision: 1.242
$FreeBSD$
-->
<!--
Do not edit this file except as instructed by the addkey.sh script.
See the README file in doc/share/pgpkeys for instructions.
-->
<appendix id="pgpkeys">
<title>PGP公钥</title>
<indexterm><primary>pgp keys</primary></indexterm>
<para>有些时候,您可能需要校验签名或者发送加密的邮件给官员或者开发者,
这里为了方便您而提供了一些密钥。完整的 <hostid role="domainname">FreeBSD.org</hostid> 用户密钥可以在
<ulink url="&url.base;/doc/pgpkeyring.txt">http://www.FreeBSD.org/doc/pgpkeyring.txt</ulink>
下载。</para>
<sect1 id="pgpkeys-officers">
<title>官员</title>
<sect2 id="pgpkey-security-officer">
<title>&a.security-officer;</title>
&pgpkey.security-officer;
</sect2>
<sect2 id="pgpkey-core-secretary">
<title>&a.core-secretary;</title>
&pgpkey.core-secretary;
</sect2>
</sect1>
<sect1 id="pgpkeys-core">
<title>核心团队成员</title>
<sect2 id="pgpkey-jhb">
<title>&a.jhb;</title>
&pgpkey.jhb;
</sect2>
<sect2 id="pgpkey-kuriyama">
<title>&a.kuriyama;</title>
&pgpkey.kuriyama;
</sect2>
<sect2 id="pgpkey-scottl">
<title>&a.scottl;</title>
&pgpkey.scottl;
</sect2>
<sect2 id="pgpkey-imp">
<title>&a.imp;</title>
&pgpkey.imp;
</sect2>
<sect2 id="pgpkey-wes">
<title>&a.wes;</title>
&pgpkey.wes;
</sect2>
<sect2 id="pgpkey-murray">
<title>&a.murray;</title>
&pgpkey.murray;
</sect2>
<sect2 id="pgpkey-peter">
<title>&a.peter;</title>
&pgpkey.peter;
</sect2>
</sect1>
<sect1 id="pgpkeys-developers">
<title>开发者</title>
<sect2 id="pgpkey-will">
<title>&a.will;</title>
&pgpkey.will;
</sect2>
<sect2 id="pgpkey-mat">
<title>&a.mat;</title>
&pgpkey.mat;
</sect2>
<sect2 id="pgpkey-asami">
<title>&a.asami;</title>
&pgpkey.asami;
</sect2>
<sect2 id="pgpkey-dougb">
<title>&a.dougb;</title>
&pgpkey.dougb;
</sect2>
<sect2 id="pgpkey-tobez">
<title>&a.tobez;</title>
&pgpkey.tobez;
</sect2>
<sect2 id="pgpkey-mbr">
<title>&a.mbr;</title>
&pgpkey.mbr;
</sect2>
<sect2 id="pgpkey-hart">
<title>&a.harti;</title>
&pgpkey.harti;
</sect2>
<sect2 id="pgpkey-obraun">
<title>&a.obraun;</title>
&pgpkey.obraun;
</sect2>
<sect2 id="pgpkey-jmb">
<title>&a.jmb;</title>
&pgpkey.jmb;
</sect2>
<sect2 id="pgpkey-brueffer">
<title>&a.brueffer;</title>
&pgpkey.brueffer;
</sect2>
<sect2 id="pgpkey-markus">
<title>&a.markus;</title>
&pgpkey.markus;
</sect2>
<sect2 id="pgpkey-wilko">
<title>&a.wilko;</title>
&pgpkey.wilko;
</sect2>
<sect2 id="pgpkey-perky">
<title>&a.perky;</title>
&pgpkey.perky;
</sect2>
<sect2 id="pgpkey-jon">
<title>&a.jon;</title>
&pgpkey.jon;
</sect2>
<sect2 id="pgpkey-luoqi">
<title>&a.luoqi;</title>
&pgpkey.luoqi;
</sect2>
<sect2 id="pgpkey-ache">
<title>&a.ache;</title>
&pgpkey.ache;
</sect2>
<sect2 id="pgpkey-seanc">
<title>&a.seanc;</title>
&pgpkey.seanc;
</sect2>
<sect2 id="pgpkey-cjh">
<title>&a.cjh;</title>
&pgpkey.cjh;
</sect2>
<sect2 id="pgpkey-cjc">
<title>&a.cjc;</title>
&pgpkey.cjc;
</sect2>
<sect2 id="pgpkey-marcus">
<title>&a.marcus;</title>
&pgpkey.marcus;
</sect2>
<sect2 id="pgpkey-nik">
<title>&a.nik;</title>
&pgpkey.nik;
</sect2>
<sect2 id="pgpkey-ceri">
<title>&a.ceri;</title>
&pgpkey.ceri;
</sect2>
<sect2 id="pgpkey-brooks">
<title>&a.brooks;</title>
&pgpkey.brooks;
</sect2>
<sect2 id="pgpkey-pjd">
<title>&a.pjd;</title>
&pgpkey.pjd;
</sect2>
<sect2 id="pgpkey-bsd">
<title>&a.bsd;</title>
&pgpkey.bsd;
</sect2>
<sect2 id="pgpkey-danfe">
<title>&a.danfe;</title>
&pgpkey.danfe;
</sect2>
<sect2 id="pgpkey-dd">
<title>&a.dd;</title>
&pgpkey.dd;
</sect2>
<sect2 id="pgpkey-ale">
<title>&a.ale;</title>
&pgpkey.ale;
</sect2>
<sect2 id="pgpkey-peadar">
<title>&a.peadar;</title>
&pgpkey.peadar;
</sect2>
<sect2 id="pgpkey-josef">
<title>&a.josef;</title>
&pgpkey.josef;
</sect2>
<sect2 id="pgpkey-ue">
<title>&a.ue;</title>
&pgpkey.ue;
</sect2>
<sect2 id="pgpkey-ru">
<title>&a.ru;</title>
&pgpkey.ru;
</sect2>
<sect2 id="pgpkey-le">
<title>&a.le;</title>
&pgpkey.le;
</sect2>
<sect2 id="pgpkey-stefanf">
<title>&a.stefanf;</title>
&pgpkey.stefanf;
</sect2>
<sect2 id="pgpkey-jedgar">
<title>&a.jedgar;</title>
&pgpkey.jedgar;
</sect2>
<sect2 id="pgpkey-green">
<title>&a.green;</title>
&pgpkey.green;
</sect2>
<sect2 id="pgpkey-lioux">
<title>&a.lioux;</title>
&pgpkey.lioux;
</sect2>
<sect2 id="pgpkey-fanf">
<title>&a.fanf;</title>
&pgpkey.fanf;
</sect2>
<sect2 id="pgpkey-blackend">
<title>&a.blackend;</title>
&pgpkey.blackend;
</sect2>
<sect2 id="pgpkey-petef">
<title>&a.petef;</title>
&pgpkey.petef;
</sect2>
<sect2 id="pgpkey-billf">
<title>&a.billf;</title>
&pgpkey.billf;
</sect2>
<sect2 id="pgpkey-patrick">
<title>&a.patrick;</title>
&pgpkey.patrick;
</sect2>
<sect2 id="pgpkey-gioria">
<title>&a.gioria;</title>
&pgpkey.gioria;
</sect2>
<sect2 id="pgpkey-jmg">
<title>&a.jmg;</title>
&pgpkey.jmg;
</sect2>
<sect2 id="pgpkey-dannyboy">
<title>&a.dannyboy;</title>
&pgpkey.dannyboy;
</sect2>
<sect2 id="pgpkey-dhartmei">
<title>&a.dhartmei;</title>
&pgpkey.dhartmei;
</sect2>
<sect2 id="pgpkey-jhay">
<title>&a.jhay;</title>
&pgpkey.jhay;
</sect2>
<sect2 id="pgpkey-sheldonh">
<title>&a.sheldonh;</title>
&pgpkey.sheldonh;
</sect2>
<sect2 id="pgpkey-mikeh">
<title>&a.mikeh;</title>
&pgpkey.mikeh;
</sect2>
<sect2 id="pgpkey-ghelmer">
<title>&a.ghelmer;</title>
&pgpkey.ghelmer;
</sect2>
<sect2 id="pgpkey-mux">
<title>&a.mux;</title>
&pgpkey.mux;
</sect2>
<sect2 id="pgpkey-mich">
<title>&a.mich;</title>
&pgpkey.mich;
</sect2>
<sect2 id="pgpkey-foxfair">
<title>&a.foxfair;</title>
&pgpkey.foxfair;
</sect2>
<sect2 id="pgpkey-jkh">
<title>&a.jkh;</title>
&pgpkey.jkh;
</sect2>
<sect2 id="pgpkey-trevor">
<title>&a.trevor;</title>
&pgpkey.trevor;
</sect2>
<sect2 id="pgpkey-phk">
<title>&a.phk;</title>
&pgpkey.phk;
</sect2>
<sect2 id="pgpkey-joe">
<title>&a.joe;</title>
&pgpkey.joe;
</sect2>
<sect2 id="pgpkey-vkashyap">
<title>&a.vkashyap;</title>
&pgpkey.vkashyap;
</sect2>
<sect2 id="pgpkey-kris">
<title>&a.kris;</title>
&pgpkey.kris;
</sect2>
<sect2 id="pgpkey-keramida">
<title>&a.keramida;</title>
&pgpkey.keramida;
</sect2>
<sect2 id="pgpkey-fjoe">
<title>&a.fjoe;</title>
&pgpkey.fjoe;
</sect2>
<sect2 id="pgpkey-andreas">
<title>&a.andreas;</title>
&pgpkey.andreas;
</sect2>
<sect2 id="pgpkey-sergei">
<title>&a.sergei;</title>
&pgpkey.sergei;
</sect2>
<sect2 id="pgpkey-maxim">
<title>&a.maxim;</title>
&pgpkey.maxim;
</sect2>
<sect2 id="pgpkey-jkoshy">
<title>&a.jkoshy;</title>
&pgpkey.jkoshy;
</sect2>
<sect2 id="pgpkey-rik">
<title>&a.rik;</title>
&pgpkey.rik;
</sect2>
<sect2 id="pgpkey-rushani">
<title>&a.rushani;</title>
&pgpkey.rushani;
</sect2>
<sect2 id="pgpkey-clement">
<title>&a.clement;</title>
&pgpkey.clement;
</sect2>
<sect2 id="pgpkey-mlaier">
<title>&a.mlaier;</title>
&pgpkey.mlaier;
</sect2>
<sect2 id="pgpkey-alex">
<title>&a.alex;</title>
&pgpkey.alex;
</sect2>
<sect2 id="pgpkey-erwin">
<title>&a.erwin;</title>
&pgpkey.erwin;
</sect2>
<sect2 id="pgpkey-leeym">
<title>&a.leeym;</title>
&pgpkey.leeym;
</sect2>
<sect2 id="pgpkey-netchild">
<title>&a.netchild;</title>
&pgpkey.netchild;
</sect2>
<sect2 id="pgpkey-lesi">
<title>&a.lesi;</title>
&pgpkey.lesi;
</sect2>
<sect2 id="pgpkey-glewis">
<title>&a.glewis;</title>
&pgpkey.glewis;
</sect2>
<sect2 id="pgpkey-delphij">
<title>&a.delphij;</title>
&pgpkey.delphij;
</sect2>
<sect2 id="pgpkey-ijliao">
<title>&a.ijliao;</title>
&pgpkey.ijliao;
</sect2>
<sect2 id="pgpkey-clive">
<title>&a.clive;</title>
&pgpkey.clive;
</sect2>
<sect2 id="pgpkey-clsung">
<title>&a.clsung;</title>
&pgpkey.clsung;
</sect2>
<sect2 id="pgpkey-arved">
<title>&a.arved;</title>
&pgpkey.arved;
</sect2>
<sect2 id="pgpkey-pav">
<title>&a.pav;</title>
&pgpkey.pav;
</sect2>
<sect2 id="pgpkey-bmah">
<title>&a.bmah;</title>
&pgpkey.bmah;
</sect2>
<sect2 id="pgpkey-mtm">
<title>&a.mtm;</title>
&pgpkey.mtm;
</sect2>
<sect2 id="pgpkey-dwmalone">
<title>&a.dwmalone;</title>
&pgpkey.dwmalone;
</sect2>
<sect2>
<title>&a.kwm;</title>
&pgpkey.kwm;
</sect2>
<sect2 id="pgpkey-matusita">
<title>&a.matusita;</title>
&pgpkey.matusita;
</sect2>
<sect2 id="pgpkey-ken">
<title>&a.ken;</title>
&pgpkey.ken;
</sect2>
<sect2 id="pgpkey-dinoex">
<title>&a.dinoex;</title>
&pgpkey.dinoex;
</sect2>
<sect2 id="pgpkey-sanpei">
<title>&a.sanpei;</title>
&pgpkey.sanpei;
</sect2>
<sect2 id="pgpkey-jim">
<title>&a.jim;</title>
&pgpkey.jim;
</sect2>
<sect2 id="pgpkey-marcel">
<title>&a.marcel;</title>
&pgpkey.marcel;
</sect2>
<sect2 id="pgpkey-marck">
<title>&a.marck;</title>
&pgpkey.marck;
</sect2>
<sect2 id="pgpkey-tmm">
<title>&a.tmm;</title>
&pgpkey.tmm;
</sect2>
<sect2 id="pgpkey-rich">
<title>&a.rich;</title>
&pgpkey.rich;
</sect2>
<sect2 id="pgpkey-knu">
<title>&a.knu;</title>
&pgpkey.knu;
</sect2>
<sect2 id="pgpkey-max">
<title>&a.max;</title>
&pgpkey.max;
</sect2>
<sect2 id="pgpkey-yoichi">
<title>&a.yoichi;</title>
&pgpkey.yoichi;
</sect2>
<sect2 id="pgpkey-bland">
<title>&a.bland;</title>
&pgpkey.bland;
</sect2>
<sect2 id="pgpkey-simon">
<title>&a.simon;</title>
&pgpkey.simon;
</sect2>
<sect2 id="pgpkey-anders">
<title>&a.anders;</title>
&pgpkey.anders;
</sect2>
<sect2 id="pgpkey-obrien">
<title>&a.obrien;</title>
&pgpkey.obrien;
</sect2>
<sect2 id="pgpkey-philip">
<title>&a.philip;</title>
&pgpkey.philip;
</sect2>
<sect2 id="pgpkey-hmp">
<title>&a.hmp;</title>
&pgpkey.hmp;
</sect2>
<sect2 id="pgpkey-mp">
<title>&a.mp;</title>
&pgpkey.mp;
</sect2>
<sect2 id="pgpkey-roam">
<title>&a.roam;</title>
&pgpkey.roam;
</sect2>
<sect2 id="pgpkey-den">
<title>&a.den;</title>
&pgpkey.den;
</sect2>
<sect2 id="pgpkey-pirzyk">
<title>&a.pirzyk;</title>
&pgpkey.pirzyk;
</sect2>
<sect2 id="pgpkey-jdp">
<title>&a.jdp;</title>
&pgpkey.jdp;
</sect2>
<sect2 id="pgpkey-krion">
<title>&a.krion;</title>
&pgpkey.krion;
</sect2>
<sect2 id="pgpkey-markp">
<title>&a.markp;</title>
&pgpkey.markp;
</sect2>
<sect2 id="pgpkey-thomas">
<title>&a.thomas;</title>
&pgpkey.thomas;
</sect2>
<sect2 id="pgpkey-hq">
<title>&a.hq;</title>
&pgpkey.hq;
</sect2>
<sect2 id="pgpkey-dfr">
<title>&a.dfr;</title>
&pgpkey.dfr;
</sect2>
<sect2 id="pgpkey-trhodes">
<title>&a.trhodes;</title>
&pgpkey.trhodes;
</sect2>
<sect2 id="pgpkey-benno">
<title>&a.benno;</title>
&pgpkey.benno;
</sect2>
<sect2 id="pgpkey-paul">
<title>&a.paul;</title>
&pgpkey.paul;
</sect2>
<sect2 id="pgpkey-roberto">
<title>&a.roberto;</title>
&pgpkey.roberto;
</sect2>
<sect2 id="pgpkey-guido">
<title>&a.guido;</title>
&pgpkey.guido;
</sect2>
<sect2 id="pgpkey-niklas">
<title>&a.niklas;</title>
&pgpkey.niklas;
</sect2>
<sect2 id="pgpkey-marks">
<title>&a.marks;</title>
&pgpkey.marks;
</sect2>
<sect2 id="pgpkey-hrs">
<title>&a.hrs;</title>
&pgpkey.hrs;
</sect2>
<sect2 id="pgpkey-wosch">
<title>&a.wosch;</title>
&pgpkey.wosch;
</sect2>
<sect2 id="pgpkey-das">
<title>&a.das;</title>
&pgpkey.das;
</sect2>
<sect2 id="pgpkey-schweikh">
<title>&a.schweikh;</title>
&pgpkey.schweikh;
</sect2>
<sect2 id="pgpkey-gshapiro">
<title>&a.gshapiro;</title>
&pgpkey.gshapiro;
</sect2>
<sect2 id="pgpkey-arun">
<title>&a.arun;</title>
&pgpkey.arun;
</sect2>
<sect2 id="pgpkey-vanilla">
<title>&a.vanilla;</title>
&pgpkey.vanilla;
</sect2>
<sect2 id="pgpkey-cshumway">
<title>&a.cshumway;</title>
&pgpkey.cshumway;
</sect2>
<sect2 id="pgpkey-demon">
<title>&a.demon;</title>
&pgpkey.demon;
</sect2>
<sect2 id="pgpkey-jesper">
<title>&a.jesper;</title>
&pgpkey.jesper;
</sect2>
<sect2 id="pgpkey-scop">
<title>&a.scop;</title>
&pgpkey.scop;
</sect2>
<sect2 id="pgpkey-glebius">
<title>&a.glebius;</title>
&pgpkey.glebius;
</sect2>
<sect2 id="pgpkey-kensmith">
<title>&a.kensmith;</title>
&pgpkey.kensmith;
</sect2>
<sect2 id="pgpkey-ben">
<title>&a.ben;</title>
&pgpkey.ben;
</sect2>
<sect2 id="pgpkey-des">
<title>&a.des;</title>
&pgpkey.des;
</sect2>
<sect2 id="pgpkey-sobomax">
<title>&a.sobomax;</title>
&pgpkey.sobomax;
</sect2>
<sect2 id="pgpkey-dcs">
<title>&a.dcs;</title>
&pgpkey.dcs;
</sect2>
<sect2 id="pgpkey-brian">
<title>&a.brian;</title>
&pgpkey.brian;
</sect2>
<sect2 id="pgpkey-nsouch">
<title>&a.nsouch;</title>
&pgpkey.nsouch;
</sect2>
<sect2 id="pgpkey-ssouhlal">
<title>&a.ssouhlal;</title>
&pgpkey.ssouhlal;
</sect2>
<sect2 id="pgpkey-vs">
<title>&a.vs;</title>
&pgpkey.vs;
</sect2>
<sect2 id="pgpkey-gsutter">
<title>&a.gsutter;</title>
&pgpkey.gsutter;
</sect2>
<sect2 id="pgpkey-metal">
<title>&a.metal;</title>
&pgpkey.metal;
</sect2>
<sect2 id="pgpkey-nyan">
<title>&a.nyan;</title>
&pgpkey.nyan;
</sect2>
<sect2 id="pgpkey-mi">
<title>&a.mi;</title>
&pgpkey.mi;
</sect2>
<sect2 id="pgpkey-gordon">
<title>&a.gordon;</title>
&pgpkey.gordon;
</sect2>
<sect2 id="pgpkey-lth">
<title>&a.lth;</title>
&pgpkey.lth;
</sect2>
<sect2 id="pgpkey-thierry">
<title>&a.thierry;</title>
&pgpkey.thierry;
</sect2>
<sect2 id="pgpkey-viny">
<title>&a.viny;</title>
&pgpkey.viny;
</sect2>
<sect2 id="pgpkey-nectar">
<title>&a.nectar;</title>
&pgpkey.nectar;
</sect2>
<sect2 id="pgpkey-adamw">
<title>&a.adamw;</title>
&pgpkey.adamw;
</sect2>
<sect2 id="pgpkey-nate">
<title>&a.nate;</title>
&pgpkey.nate;
</sect2>
<sect2 id="pgpkey-wollman">
<title>&a.wollman;</title>
&pgpkey.wollman;
</sect2>
<sect2 id="pgpkey-joerg">
<title>&a.joerg;</title>
&pgpkey.joerg;
</sect2>
<sect2 id="pgpkey-bz">
<title>&a.bz;</title>
&pgpkey.bz;
</sect2>
<sect2 id="pgpkey-phantom">
<title>&a.phantom;</title>
&pgpkey.phantom;
</sect2>
</sect1>
</appendix>
<!--
Local Variables:
mode: sgml
sgml-declaration: "../appendix.decl"
sgml-indent-data: t
sgml-omittag: nil
sgml-always-quote-attributes: t
sgml-parent-document: ("../book.sgml" "part" "appendix")
End:
-->

@ -0,0 +1,16 @@
#
# Build the Handbook with just the content from this chapter.
#
# Original revision: 1.1
# $FreeBSD$
#
CHAPTERS= ports/chapter.sgml
VPATH= ..
MASTERDOC= ${.CURDIR}/../${DOC}.${DOCBOOKSUFFIX}
DOC_PREFIX?= ${.CURDIR}/../../../..
.include "../Makefile"

File diff suppressed because it is too large Load Diff

@ -0,0 +1,16 @@
#
# Build the Handbook with just the content from this chapter.
#
# Original Revision: 1.143
# $FreeBSD$
#
CHAPTERS= ppp-and-slip/chapter.sgml
VPATH= ..
MASTERDOC= ${.CURDIR}/../${DOC}.${DOCBOOKSUFFIX}
DOC_PREFIX?= ${.CURDIR}/../../../..
.include "../Makefile"

File diff suppressed because it is too large Load Diff

@ -0,0 +1,522 @@
<!--
The FreeBSD Chinese Documentation Project
Original Revision: 1.25
$FreeBSD$
-->
<preface id="book-preface">
<title>前言</title>
<bridgehead id="preface-audience" renderas=sect1>Intended
Audience</bridgehead>
<para>作为 FreeBSD 的新用户,您将会在本手册第一部分找到 FreeBSD
的安装方法,同时逐渐引入概念和习俗来加强 &unix; 基础。
阅读这部分只需要您有探索的精神和接受新概念的能力。</para>
<para>读完这些之后,手册中很漫长的第二部分是 FreeBSD
中系统管理员感兴趣的所有主题的全面参考。
在阅读这些章节的内容时所需要的背景知识都注释在每一章节的大纲里面,
如果需要,可在阅读前进行预习。</para>
<para>要获得附加的信息来源列表,请查阅 <xref linkend="bibliography">。</para>
<bridgehead id="preface-changes-from2" renderas=sect1>相对于第二版的改动</bridgehead>
<para>您目前看到的这本手册的第三版是 FreeBSD 文档计划的成员历时两年完成的顶峰之作。
第三版包含了如下的的主要变动:</para>
<itemizedlist>
<listitem>
<para><xref linkend="config-tuning"> 配置和优化, 进行了扩充并增加了关于
ACPI 电源和资源管理, cron 系统实用程序,以及更多的内核优化选项的相关内容。</para>
</listitem>
<listitem>
<para><xref linkend="security"> 安全 一章增加了虚拟专用网
(VPNs) 文件访问控制表 (ACLs) 以及安全公告的内容。</para>
</listitem>
<listitem>
<para><xref linkend="mac"> 强制访问控制 (MAC) 是这一版新增的章节。
它解释了什么是 MAC 以及这一机制如何使您的 FreeBSD 系统更安全。</para>
</listitem>
<listitem>
<para><xref linkend="disks"> 存储, 在原有基础上增加了
USB 存储设备, 文件系统快照, 文件系统容限, 基于文件及网络的文件系统,
以及与加密磁盘分区有关的内容。</para>
</listitem>
<listitem>
<para><xref linkend="vinum-vinum">Vinum 是这一版中的新章节。
描述了如何使用这种提供了设备无关的逻辑磁盘、软件 RAID-0,
RAID-1 和 RAID-5 的卷管理系统——Vinum。</para>
</listitem>
<listitem>
<para>在 <xref linkend="ppp-and-slip">PPP 和 SLIP 一章中增加了排除故障的说明。</para>
</listitem>
<listitem>
<para><xref linkend="mail"> 电子邮件 一章中增加了关于如何使用其它的邮件传输代理、
SMTP 认证, UUCP fecthmail
procmail, 以及其它进阶内容。</para>
</listitem>
<listitem>
<para><xref linkend="network-servers">,网络服务, 是新版中全新的一章。
这一章包括了如何架设 Apache HTTP 服务器, FTPd以及用于支持 Microsoft Windows
客户的 Samba。 一些段落来自原先的 <xref
linkend="advanced-networking"> 进阶网络应用 一章。</para>
</listitem>
<listitem>
<para><xref linkend="advanced-networking">,进阶网络应用 一章增加了关于在
FreeBSD 中使用蓝牙设备, 安装无线网络, 以及使用异步传输模式 (ATM)
网络的内容。</para>
</listitem>
<listitem>
<para>增加了一份词汇表, 用以说明整本书中出现的术语。</para>
</listitem>
<listitem>
<para>对于全书中图表进行了进一步的美化工作。</para>
</listitem>
</itemizedlist>
<bridgehead id="preface-changes" renderas=sect1>
相对于第一版的改变</bridgehead>
<para>
本手册的第二版是 FreeBSD 文档计划的成员历时两年完成的顶峰之作。
第二版包含了如下的的主要变动:</para>
<!-- Talk a little about justification and other stylesheet changes? -->
<itemizedlist>
<listitem>
<para>添加了完整的索引。</para>
</listitem>
<listitem>
<para>用图形替换了以前所有用 ASCII 插图。</para>
</listitem>
<listitem>
<para>
每个章节添加了标准大纲,列出了该章所包含的信息和读者所应该了解的知识。</para>
</listitem>
<listitem>
<para>
内容逻辑地分成三个部分:
<quote>起步</quote><quote>系统管理</quote>和<quote>附录</quote>。</para>
</listitem>
<listitem>
<para><xref linkend="install"> (<quote>安装
FreeBSD</quote>) 新版本中使用了抓屏图片,使新用户更容易的领会正文。</para>
</listitem>
<listitem>
<para><xref linkend="basics"> (<quote>&unix;
基础</quote>)扩充了进程、守护进程和信号的附加信息。</para>
</listitem>
<listitem>
<para><xref linkend="ports"> (<quote>安装应用程序</quote>)
扩充了二进制包管理的附加信息。</para>
</listitem>
<listitem>
<para><xref linkend="x11"> (<quote>X Window 系统</quote>)
新版本中着重介绍使用现代桌面技术例如 &xfree86; 4.x 上的
<application>KDE</application> 和 <application>GNOME</application></para>
</listitem>
<listitem>
<para><xref linkend="boot"> (<quote>FreeBSD
启动过程</quote>)对第一版内容进行扩充。</para>
</listitem>
<listitem>
<para><xref linkend="disks"> (<quote>存储</quote>)
由第一版中两个单独的章节<quote>磁盘</quote>和<quote>备份</quote>合并而成。
我们认为这两部分作为一个整体比较容易理解。同时 RAID (包括硬件和软件 RAID)
部分也被添加进来。</para>
</listitem>
<listitem>
<para><xref linkend="serialcomms"> (<quote>串口通信</quote>)
对第一版进行完善,并为 FreeBSD 4.x/5.x 做了更新。</para>
</listitem>
<listitem>
<para><xref linkend="ppp-and-slip"> (<quote>PPP 和
SLIP</quote>) 全部更新。</para>
</listitem>
<listitem>
<para>许多新的内容被添加到 <xref linkend="advanced-networking">
(<quote>高级网络</quote>).</para>
</listitem>
<listitem>
<para><xref linkend="mail"> (<quote>电子邮件</quote>)增加了关于配置
<application>sendmail</application> 的信息。</para>
</listitem>
<listitem>
<para><xref linkend="linuxemu">(<quote>&linux; 兼容性</quote>)
增加了关于安装 <application>&oracle;</application> 和
<application>&sap.r3;</application> 的信息。</para>
</listitem>
<listitem>
<para>
第二版中也涵盖了下列主题:</para>
<itemizedlist>
<listitem>
<para>配置和调整(<xref linkend="config-tuning">)。</para>
</listitem>
<listitem>
<para>多媒体(<xref linkend="multimedia">)</para>
</listitem>
</itemizedlist>
</listitem>
</itemizedlist>
<bridgehead id="preface-overview" renderas=sect1>本手册的组织</bridgehead>
<para>这本手册分成了三个逻辑清晰的部分。第一部分
<emphasis>起步</emphasis> 涵盖了 FreeBSD 的安装和基本使用方法。
读者可根据自己的情况按顺序或者跳过一些熟悉的主题来阅读。第二部分
<emphasis>常用操作</emphasis> 涵盖了 FreeBSD 常用的功能,
这部分可以不按顺序阅读。每个部分由一个简明的大纲开始,
这个大纲描述本章节涵盖的内容和读者应该已经知道的知识。
这主要是让读者可以更好的选择感兴趣的章节阅读。第三部分
<emphasis>系统管理</emphasis> 涵盖了 FreeBSD 高级用户所感兴趣的广泛的话题。
第四部分 <emphasis>网络通讯</emphasis> 包括了网络和服务的话题,
而第五部分则是资源信息的附录。</para>
<variablelist>
<!-- Part I - Introduction -->
<varlistentry>
<term><emphasis><xref linkend="introduction"> 介绍</emphasis></term>
<listitem>
<para>向新用户介绍 FreeBSD。它描述了 FreeBSD 计划的历史、目标和开发模式。</para>
</listitem>
</varlistentry>
<varlistentry>
<term><emphasis><xref linkend="install">,安装</emphasis></term>
<listitem>
<para>
本章将会带领用户完成安装过程。一些高级安装主题,
例如如何通过串行控制台安装,也涵盖在内。</para>
</listitem>
</varlistentry>
<varlistentry>
<term><emphasis><xref linkend="basics">&unix; 基础</emphasis></term>
<listitem>
<para>本章涵盖了 FreeBSD 操作系统基础命令和功能。
如果熟悉 &linux; 或者其他类 &unix; 操作系统,则可以跳过这章。</para>
</listitem>
</varlistentry>
<varlistentry>
<term><emphasis><xref linkend="ports">,安装应用程序</emphasis></term>
<listitem>
<para>
本章涵盖如何用 FreeBSD 的 <quote>Ports Collection</quote>
和标准二进制软件包来安装第三方软件。</para>
</listitem>
</varlistentry>
<varlistentry>
<term><emphasis><xref linkend="x11">X Window 系统</emphasis></term>
<listitem>
<para>本章概要的描述了 X Window 系统并详细地介绍了如何在
FreeBSD 上使用 <application>&xfree86;</application>
也描述了通用的桌面环境,例如 <application>KDE</application>
和 <application>GNOME</application>。</para>
</listitem>
</varlistentry>
<!-- Part II Common Tasks -->
<varlistentry>
<term><emphasis><xref linkend="desktop">,桌面应用</emphasis></term>
<listitem>
<para>列出了一些常用的桌面应用程序,比如 web 浏览器和办公套件,
描述了在 FreeBSD 上如何安装它们。</para>
</listitem>
</varlistentry>
<varlistentry>
<term><emphasis><xref linkend="multimedia">,多媒体</emphasis></term>
<listitem>
<para>展示了如何为您的系统设置声卡和视频回放支持。
也描述了一些简单的音频和视频应用程序。</para>
</listitem>
</varlistentry>
<varlistentry>
<term><emphasis><xref linkend="kernelconfig">,配置 FreeBSD
内核</emphasis></term>
<listitem>
<para>解释了为什么需要配置一个新内核并提供了配置、
编译、安装自定义内核的详细说明。</para>
</listitem>
</varlistentry>
<varlistentry>
<term><emphasis><xref linkend="printing">,打印</emphasis></term>
<listitem>
<para>描绘了 FreeBSD 上打印机管理,
包括横幅页、打印统计,还有初始的设置。</para>
</listitem>
</varlistentry>
<varlistentry>
<term><emphasis><xref linkend="linuxemu">&linux; 二进制兼容</emphasis></term>
<listitem>
<para>描述了 FreeBSD 的 &linux; 兼容特性。
也提供了许多流行的 &linux; 应用程序的详细的安装说明,
比如 <application>&oracle;</application>、<application>&sap.r3;</application>,还有
<application>&mathematica;</application>。</para>
</listitem>
</varlistentry>
<!-- Part III - System Administration -->
<varlistentry>
<term><emphasis><xref linkend="config-tuning">,配置和调整</emphasis></term>
<listitem>
<para>本章描述了管理员调整 FreeBSD 系统以优化性能时可能用到的一些参数。
也描述了 FreeBSD 中的各种配置文件以及它们所在的位置。</para>
</listitem>
</varlistentry>
<varlistentry>
<term><emphasis><xref linkend="boot">,启动过程</emphasis></term>
<listitem>
<para>本章描述 FreeBSD 的启动过程并且解释了如何用配置选项来控制这个过程。</para>
</listitem>
</varlistentry>
<varlistentry>
<term><emphasis><xref linkend="users">,用户和基本帐号管理</emphasis></term>
<listitem>
<para>本章描述了如何创建和操作用户帐号,
同样也论述了设置用户资源限制和其他账号管理任务的方法。</para>
</listitem>
</varlistentry>
<varlistentry>
<term><emphasis><xref linkend="security">, 安全</emphasis></term>
<listitem>
<para>
本章描述为保证 FreeBSD 系统安全可以用到的不同工具,包括
KerberosIPsecOpenSSH 和网络防火墙。</para>
</listitem>
</varlistentry>
<varlistentry>
<term><emphasis><xref linkend="mac">, 强制访问控制</emphasis></term>
<listitem>
<para>解释了何谓强制访问控制 (MAC) 以及如何利用这一机制来加强
FreeBSD 系统的安全。</para>
</listitem>
</varlistentry>
<varlistentry>
<term><emphasis><xref linkend="disks">,存储</emphasis></term>
<listitem>
<para>本章描述了怎样用 FreeBSD 来管理存储介质和文件系统包括物理磁盘、RAID
阵列、光学和磁带媒体、后备存储磁盘以及网络文件系统。</para>
</listitem>
</varlistentry>
<varlistentry>
<term><emphasis><xref linkend="vinum-vinum">Vinum</emphasis></term>
<listitem>
<para>本章描述了怎样使用逻辑卷管理器 Vinum。它提供了设备无关的逻辑磁盘和软件
RAID-0、RAID-1 以及 RAID-5。</para>
</listitem>
</varlistentry>
<varlistentry>
<term><emphasis><xref linkend="l10n">,本地化</emphasis></term>
<listitem>
<para>本章描述了如何在 FreeBSD 上使用非英语语言。它涵盖了系统和应用程序级的本地化。</para>
</listitem>
</varlistentry>
<varlistentry>
<term><emphasis><xref linkend="cutting-edge">, 最前沿</emphasis></term>
<listitem>
<para>介绍了 FreeBSD-STABLE、
FreeBSD-CURRENT 以及 FreeBSD 发行版本之间的差异。
描述了一般用户如何紧跟开发过程并从中受益。</para>
</listitem>
</varlistentry>
<!-- Part IV - Network Communications -->
<varlistentry>
<term><emphasis><xref linkend="serialcomms">,串行通信</emphasis></term>
<listitem>
<para>本章解释了如何连接终端和调制解调器到 FreeBSD 系统,包括拨入和拨出连接。</para>
</listitem>
</varlistentry>
<varlistentry>
<term><emphasis><xref linkend="ppp-and-slip">PPP 和 SLIP</emphasis></term>
<listitem>
<para>本章描述了如何用 FreeBSD 通过使用 PPPSLIP 或者基于以太网的
PPP(PPPoE)来连接远程系统。</para>
</listitem>
</varlistentry>
<varlistentry>
<term><emphasis><xref linkend="mail">, 电子邮件</emphasis></term>
<listitem>
<para>本章解释了一个 email 服务器的不同组成部分并且简单讨论了关于最流行的
mail 服务器软件 <application>sendmail</application> 的配置。</para>
</listitem>
</varlistentry>
<varlistentry>
<term><emphasis><xref linkend="network-servers">, 网络服务</emphasis></term>
<listitem>
<para>提供了详细的指引和示范配置文件以说明如何将一台 FreeBSD 机器作为网络文件系统服务器,
域名服务器, 网络信息服务器或时间同步服务器来使用的方法。</para>
</listitem>
</varlistentry>
<varlistentry>
<term><emphasis><xref linkend="advanced-networking">, 高级网络应用</emphasis></term>
<listitem>
<para>描述了许多关于网络的主题,包括如何在您的局域网中共享
Internet 连接, 高级路由话题, 无线网络, 蓝牙, ATM IPv6以及许多高级话题。</para>
</listitem>
</varlistentry>
<!-- Part V - Appendices -->
<varlistentry>
<term><emphasis><xref linkend="mirrors">,获取 FreeBSD </emphasis></term>
<listitem>
<para>列出了获得 FreeBSD 安装 CDROM 或 DVDROM 的不同资源,也提供了允许您自由下载
FreeBSD 的不同 Internet 站点。</para>
</listitem>
</varlistentry>
<varlistentry>
<term><emphasis><xref linkend="bibliography">,参考书目</emphasis></term>
<listitem>
<para>由于本手册触及到了很多不同的主题,因而可能引发您想要获取更多详细的讲解。
参考书目列出了很多写作这本书时参考的好书。</para>
</listitem>
</varlistentry>
<varlistentry>
<term><emphasis><xref linkend="eresources">Internet 上的资源</emphasis></term>
<listitem>
<para>讲述了很多对 FreeBSD 用户有用的能够提出问题并进行技术交流的关于
FreeBSD 的论坛。</para>
</listitem>
</varlistentry>
<varlistentry>
<term><emphasis><xref linkend="pgpkeys">PGP 秘钥</emphasis></term>
<listitem>
<para>列出了一些 FreeBSD 开发者的 PGP 签名。</para>
</listitem>
</varlistentry>
</variablelist>
<bridgehead id="preface-conv" renderas=sect1>本书中使用的一些约定</bridgehead>
<para>为了使本书保持一致性和易读性特做了以下约定:</para>
<bridgehead id="preface-conv-typographic" renderas=sect2>排版约定</bridgehead>
<variablelist>
<varlistentry>
<term><emphasis>斜体</emphasis></term>
<listitem>
<para><emphasis>斜体</emphasis> 字用来表示文件名、URLs、强调文字和术语的主流用法。</para>
</listitem>
</varlistentry>
<varlistentry>
<term><varname>反白</varname></term>
<listitem>
<para><varname>反白</varname> 字用来表示错误信息、命令、环境变量、port
的名字、主机名、用户名、组名、设备名以及变量和代码片断。</para>
</listitem>
</varlistentry>
<varlistentry>
<term><application>粗体</application></term>
<listitem>
<para><application>粗体</application> 字用来表示应用程序、命令和关键字。</para>
</listitem>
</varlistentry>
</variablelist>
<!-- Var list -->
<bridgehead id="preface-conv-commands"
renderas=sect2>用户输入</bridgehead>
<para>
按键用<keycap>粗体</keycap>来突出于其他文本。
组合键意味着字用‘<literal>+</literal>’连接时,同时的按下它们,例如:</para>
<para>
<keycombo action="simul">
<keycap>Ctrl</keycap>
<keycap>Alt</keycap>
<keycap>Del</keycap>
</keycombo>
</para>
<para>表示您应该同时按下 <keycap>Ctrl</keycap>
<keycap>Alt</keycap> 和 <keycap>Del</keycap> 键。</para>
<para>按顺序依次键入的关键字通常是用逗号隔开,例如:</para>
<para>
<keycombo action="simul">
<keycap>Ctrl</keycap>
<keycap>X</keycap>
</keycombo>,
<keycombo action="simul">
<keycap>Ctrl</keycap>
<keycap>S</keycap>
</keycombo>
</para>
<para>这意味着用户应该同时按<keycap>Ctrl</keycap> 和
<keycap>X</keycap>,然后同时按 <keycap>Ctrl</keycap>
和 <keycap>S</keycap>。</para>
<!-- How to type in key stokes, etc.. -->
<bridgehead id="preface-conv-examples"
renderas=sect2>示例</bridgehead>
<para>以 <devicename>E:\&gt;</devicename> 开头的例子代表一个
&ms-dos; 命令。除非另有说明,这些命令都可以在一个现代的
&microsoft.windows; <quote>命令行</quote>窗口环境被执行。</para>
<screen><prompt>E:\&gt;</prompt> <userinput>tools\fdimage floppies\kern.flp A:</userinput></screen>
<para>以 &prompt.root; 开头的例子代表必须以 FreeBSD
超级用户身份执行的命令。您可以用 <username>root</username>
身份登录来输入这些命令,或者以普通账号登录然后用 &man.su.1;
来获得超级用户权限。</para>
<screen>&prompt.root; <userinput>dd if=kern.flp of=/dev/fd0</userinput></screen>
<para>以 &prompt.user; 开头的例子代表命令应该被普通账号执行。
除非另有说明C-shell 语法来设置环境变量和其他 shell 命令。</para>
<screen>&prompt.user; <userinput>top</userinput></screen>
<bridgehead id="preface-acknowledgements"
renderas=sect1>致谢</bridgehead>
<para>您所看到的这本书是全球几百人努力的结果。
无论他们只是纠正一些错误或提交完整的章节,所有的贡献都是非常有用的。</para>
<para>
一些公司通过提供资金让作者专注于文档开发、提供出版资金等等方式来支持文档开发。
其中BSDi (后并入<ulink url="http://www.windriver.com">Wind River Systems</ulink>)
资助 FreeBSD 文档计划成员来专职改善这本书直到 2000 年三月第一个印刷版
(ISBN 1-57176-241-8) 的出版。Wind River Systems
同时资助其他作者来对输出结构做很多改进和给文章添加一些附加章节。
这项工作结束于 2001 年 11 月印刷第二版 (ISBN 1-57176-303-1)。在 2003-2004 两年中,<ulink
url="http://www.freebsdmall.com">FreeBSD Mall</ulink>
向为改进这本手册以使其第三版印刷版本能够出版的志愿者支付了报酬。</para>
</preface>
<!--
Local Variables:
mode: sgml
sgml-declaration: "../chapter.decl"
sgml-indent-data: t
sgml-omittag: nil
sgml-always-quote-attributes: t
sgml-parent-document: ("../book.sgml" "book" "preface")
End:
-->

@ -0,0 +1,16 @@
#
# Build the Handbook with just the content from this chapter.
#
# Original Revision: 1.1
# $FreeBSD$
#
CHAPTERS= printing/chapter.sgml
VPATH= ..
MASTERDOC= ${.CURDIR}/../${DOC}.${DOCBOOKSUFFIX}
DOC_PREFIX?= ${.CURDIR}/../../../..
.include "../Makefile"

File diff suppressed because it is too large Load Diff

@ -0,0 +1,16 @@
#
# Build the Handbook with just the content from this chapter.
#
# Original Revision: 1.1
# $FreeBSD$
#
CHAPTERS= security/chapter.sgml
VPATH= ..
MASTERDOC= ${.CURDIR}/../${DOC}.${DOCBOOKSUFFIX}
DOC_PREFIX?= ${.CURDIR}/../../../..
.include "../Makefile"

File diff suppressed because it is too large Load Diff

@ -0,0 +1,16 @@
#
# Build the Handbook with just the content from this chapter.
#
# Original Revision: 1.1
# $FreeBSD$
#
CHAPTERS= serialcomms/chapter.sgml
VPATH= ..
MASTERDOC= ${.CURDIR}/../${DOC}.${DOCBOOKSUFFIX}
DOC_PREFIX?= ${.CURDIR}/../../../..
.include "../Makefile"

File diff suppressed because it is too large Load Diff

@ -0,0 +1,72 @@
<!--
Creates entities for each .txt screenshot that is included in the
Handbook.
Each entity is named txt.dir.foo, where dir is the directory in
which it is stored, and foo is its filename, without the '.txt'
extension.
Entities should be listed in alphabetical order.
Original Revision: 1.2
$FreeBSD$
-->
<!ENTITY txt.install.adduser1 SYSTEM "install/adduser1.txt">
<!ENTITY txt.install.adduser2 SYSTEM "install/adduser2.txt">
<!ENTITY txt.install.adduser3 SYSTEM "install/adduser3.txt">
<!ENTITY txt.install.boot-mgr SYSTEM "install/boot-mgr.txt">
<!ENTITY txt.install.console-saver1 SYSTEM "install/console-saver1.txt">
<!ENTITY txt.install.console-saver2 SYSTEM "install/console-saver2.txt">
<!ENTITY txt.install.console-saver3 SYSTEM "install/console-saver3.txt">
<!ENTITY txt.install.console-saver4 SYSTEM "install/console-saver4.txt">
<!ENTITY txt.install.desktop SYSTEM "install/desktop.txt">
<!ENTITY txt.install.disklabel-auto SYSTEM "install/disklabel-auto.txt">
<!ENTITY txt.install.disklabel-ed1 SYSTEM "install/disklabel-ed1.txt">
<!ENTITY txt.install.disklabel-ed2 SYSTEM "install/disklabel-ed2.txt">
<!ENTITY txt.install.disklabel-fs SYSTEM "install/disklabel-fs.txt">
<!ENTITY txt.install.disklabel-root1 SYSTEM "install/disklabel-root1.txt">
<!ENTITY txt.install.disklabel-root2 SYSTEM "install/disklabel-root2.txt">
<!ENTITY txt.install.disklabel-root3 SYSTEM "install/disklabel-root3.txt">
<!ENTITY txt.install.dist-set SYSTEM "install/dist-set.txt">
<!ENTITY txt.install.dist-set2 SYSTEM "install/dist-set2.txt">
<!ENTITY txt.install.docmenu1 SYSTEM "install/docmenu1.txt">
<!ENTITY txt.install.ed0-conf SYSTEM "install/ed0-conf.txt">
<!ENTITY txt.install.ed0-conf2 SYSTEM "install/ed0-conf2.txt">
<!ENTITY txt.install.edit-inetd-conf SYSTEM "install/edit-inetd-conf.txt">
<!ENTITY txt.install.fdisk-drive1 SYSTEM "install/fdisk-drive1.txt">
<!ENTITY txt.install.fdisk-drive2 SYSTEM "install/fdisk-drive2.txt">
<!ENTITY txt.install.fdisk-edit1 SYSTEM "install/fdisk-edit1.txt">
<!ENTITY txt.install.fdisk-edit2 SYSTEM "install/fdisk-edit2.txt">
<!ENTITY txt.install.ftp-anon1 SYSTEM "install/ftp-anon1.txt">
<!ENTITY txt.install.ftp-anon2 SYSTEM "install/ftp-anon2.txt">
<!ENTITY txt.install.hdwrconf SYSTEM "install/hdwrconf.txt">
<!ENTITY txt.install.keymap SYSTEM "install/keymap.txt">
<!ENTITY txt.install.main-doc SYSTEM "install/main-doc.txt">
<!ENTITY txt.install.main-keymap SYSTEM "install/main-keymap.txt">
<!ENTITY txt.install.main-options SYSTEM "install/main-options.txt">
<!ENTITY txt.install.main-std SYSTEM "install/main-std.txt">
<!ENTITY txt.install.main1 SYSTEM "install/main1.txt">
<!ENTITY txt.install.mainexit SYSTEM "install/mainexit.txt">
<!ENTITY txt.install.media SYSTEM "install/media.txt">
<!ENTITY txt.install.mouse1 SYSTEM "install/mouse1.txt">
<!ENTITY txt.install.mouse2 SYSTEM "install/mouse2.txt">
<!ENTITY txt.install.mouse3 SYSTEM "install/mouse3.txt">
<!ENTITY txt.install.mouse4 SYSTEM "install/mouse4.txt">
<!ENTITY txt.install.mouse5 SYSTEM "install/mouse5.txt">
<!ENTITY txt.install.mouse6 SYSTEM "install/mouse6.txt">
<!ENTITY txt.install.nfs-server-edit SYSTEM "install/nfs-server-edit.txt">
<!ENTITY txt.install.options SYSTEM "install/options.txt">
<!ENTITY txt.install.pkg-cat SYSTEM "install/pkg-cat.txt">
<!ENTITY txt.install.pkg-confirm SYSTEM "install/pkg-confirm.txt">
<!ENTITY txt.install.pkg-install SYSTEM "install/pkg-install.txt">
<!ENTITY txt.install.pkg-sel SYSTEM "install/pkg-sel.txt">
<!ENTITY txt.install.probstart SYSTEM "install/probstart.txt">
<!ENTITY txt.install.security SYSTEM "install/security.txt">
<!ENTITY txt.install.sysinstall-exit SYSTEM "install/sysinstall-exit.txt">
<!ENTITY txt.install.timezone1 SYSTEM "install/timezone1.txt">
<!ENTITY txt.install.timezone2 SYSTEM "install/timezone2.txt">
<!ENTITY txt.install.timezone3 SYSTEM "install/timezone3.txt">
<!ENTITY txt.install.userconfig SYSTEM "../../../share/images/books/handbook/install/userconfig.txt">
<!ENTITY txt.install.userconfig2 SYSTEM "../../../share/images/books/handbook/install/userconfig2.txt">
<!ENTITY txt.install.xf86setup SYSTEM "install/xf86setup.txt">

@ -0,0 +1,16 @@
#
# Build the Handbook with just the content from this chapter.
#
# Original Revision: 1.1
# $FreeBSD$
#
CHAPTERS= users/chapter.sgml
VPATH= ..
MASTERDOC= ${.CURDIR}/../${DOC}.${DOCBOOKSUFFIX}
DOC_PREFIX?= ${.CURDIR}/../../../..
.include "../Makefile"

@ -0,0 +1,973 @@
<!--
The FreeBSD Chinese Documentation Project
Original Revision: 1.47
$FreeBSD$
-->
<chapter id="users">
<chapterinfo>
<authorgroup>
<author>
<firstname>Neil</firstname>
<surname>Blakey-Milner</surname>
<contrib>Contributed by </contrib>
</author>
</authorgroup>
<!-- Feb 2000 -->
</chapterinfo>
<title>用户和基本的帐户管理</title>
<sect1 id="users-synopsis">
<title>概述</title>
<para>FreeBSD允许多个用户同时使用计算机. 当然,这些用户中不是很多人同时坐在同一台计算机前.
<footnote>
<para>Well, 除非您连接多个终端设备,这种情况我们在<xref linkend="serialcomms">讨论.</para>
</footnote>,而是其他用户可以通过网络来使用同一台计算机以完成他们的工作.要使用系统,每个人都应该有一个帐户.</para>
<para>读完这章,您将了解到:</para>
<itemizedlist>
<listitem>
<para>在一个FreeBSD系统上不同用户帐户之间的区别.</para>
</listitem>
<listitem>
<para>如何添加用户帐户.</para>
</listitem>
<listitem>
<para>如何删除用户帐户.</para>
</listitem>
<listitem>
<para>如何改变帐户细节如用户的全名或首选的shell.</para>
</listitem>
<listitem>
<para>如何在每个帐户基础上设置限制来控制像内存CPU时钟这样的资源.</para>
</listitem>
<listitem>
<para>如何使用组来使帐户管理更容易.</para>
</listitem>
</itemizedlist>
<para>在阅读这章之前,您应当了解:</para>
<itemizedlist>
<listitem>
<para>了解&unix;和FreeBSD的基础知识 (<xref
linkend="basics">).</para>
</listitem>
</itemizedlist>
</sect1>
<sect1 id="users-introduction">
<title>介绍</title>
<para>所有访问系统的用户都是通过帐户完成的所以用户和帐户管理是FreeBSD系统不可或缺的重要部分.</para>
<para>每个FreeBSD系统的帐户都有一些和它相对应的信息去验证它.</para>
<variablelist>
<varlistentry>
<term>用户名</term>
<listitem>
<para>用户名在<prompt>login:</prompt> 提示符的后面键入。
用户名对于一台计算机来讲是唯一的;
您不可以使用两个相同的用户名来登录。
有很多用来创建正确用户名的规则, 具体请参考 &man.passwd.5;
您使用的用户名通常需要8个或更少的小写字母。</para>
</listitem>
</varlistentry>
<varlistentry>
<term>口令</term>
<listitem>
<para>每个帐户都有一个口令与它对应。
口令可以是空的, 这样不需要口令就可以访问系统。
这通常不是一个好主意; 每个帐户都应该有口令。</para>
</listitem>
</varlistentry>
<varlistentry>
<term>用户 ID (UID)</term>
<listitem>
<para>UID是系统用来识别用户的数字传统上它的范围是0到65536之间<footnote id="users-largeuidgid">
<para>可以使用的 UID/GID 的最大值是
4294967295 但这可能会给采用上述假定的软件造成严重的问题。</para>
</footnote>,用以唯一地标识用户。
FreeBSD在内部使用UID来识别用户 &mdash; 在工作以前。
任何允许您指定一个用户名的 FreeBSD 命令都会把它转换成UID。
这意味着您可以用不同的用户名使用多个帐户, 但它们的UID是一样的。
FreeBSD 会把这些帐户认定是同一个用户。</para>
</listitem>
</varlistentry>
<varlistentry>
<term>组ID (GID)</term>
<listitem>
<para>GID是用来识别用户所在的组的 传统上范围在0到65536之间<footnoteref linkend="users-largeuidgid">的数字。
组是一种基于用户GID而不是它们的UID的用来控制用户访问资源的机制。 这可以减少一些配置文件的大小。
一个用户也可以属于多个组。</para>
</listitem>
</varlistentry>
<varlistentry>
<term>登录类</term>
<listitem>
<para>登录类是对组机制的扩展,当把系统分配给不同用户时,它提供了额外的灵活性.</para>
</listitem>
</varlistentry>
<varlistentry>
<term>口令的定期更改</term>
<listitem>
<para>默认情况下, FreeBSD 并不强制用户去改变他们的口令。
您可以以用户为单位强制要求一些或所有的用户定期改变他们的口令。</para>
</listitem>
</varlistentry>
<varlistentry>
<term>帐户的到期时间</term>
<listitem>
<para>默认情况下 FreeBSD 不会自动完成帐户过期操作。
如果您正在创建帐户, 您应该知道一个帐户的有效使用期限。
例如, 在学校里您会为每个学生建立一个帐户,
您可以指定它们何时过期。
帐户过期后, 虽然帐户的目录和文件仍然存在,
但帐户已经不能继续使用了。</para>
</listitem>
</varlistentry>
<varlistentry>
<term>用户的全名</term>
<listitem>
<para>用户名可以唯一地识别FreeBSD的帐户
但它不会反映用户的全名。 这些信息可能与帐户是相关的。</para>
</listitem>
</varlistentry>
<varlistentry>
<term>主目录</term>
<listitem>
<para>主目录是用户用来启动的目录的完全路径。
一个通常的规则是把所有用户的主目录都放在
<filename>/home/<replaceable>username</replaceable></filename>
下,或者
<filename>/usr/home/<replaceable>username</replaceable></filename>
下。 用户将把他们的个人文件放在自己的主目录下,
他们可以在那里创建任何目录.</para>
</listitem>
</varlistentry>
<varlistentry>
<term>用户 shell</term>
<listitem>
<para>Shell提供了用户用来操作系统的默认环境。 有很多不同的shell
有经验的用户会根据他们的经验来选择自己喜好的shell。</para>
</listitem>
</varlistentry>
</variablelist>
<para>有三种类型的帐户: <link
linkend="users-superuser">超级用户</link> <link
linkend="users-system">系统用户</link> 以及 <link
linkend="users-user">普通用户</link>。
超级用户帐户通常叫做 <username>root</username>
可以没有限制地管理系统。 系统用户运行服务。
最后, 普通用户给那些登录系统以及阅读邮件的人使用。</para>
</sect1>
<sect1 id="users-superuser">
<title>超级用户帐户</title>
<indexterm>
<primary>帐户</primary>
<secondary>超级用户 (root)</secondary>
</indexterm>
<para>超级用户帐户,
通常叫做 <username>root</username>
可以重新配置和管理系统, 在收发邮件, 系统检查或编程这样的日常工作中,
尽量不要使用root权限。</para>
<para>这是因为不象普通用户帐户, 超级用户能够无限制地操作系统,
超级用户帐户的滥用可能会引起无法想象的灾难。
普通的用户帐户不会由于出错而破坏系统, 所以要尽可能的使用普通帐户,
除非您需要额外的特权。</para>
<para>在使用超级用户命令时要再三检查,
因为一个额外的空格或缺少某个字符的命令都可能会引起数据丢失。</para>
<para>所以, 在阅读完这章后您第一件要做的事就是,
在平时使用的时候, 创建一个没有特权的用户帐户。
无论您使用的是单用户还是多用户系统这样的申请都是相同的。 在这章的后面,
我们将讨论如何创建一个额外的帐户和如何在普通用户和超级用户之间进行切换。</para>
</sect1>
<sect1 id="users-system">
<title>系统帐户</title>
<indexterm>
<primary>帐户</primary>
<secondary>系统</secondary>
</indexterm>
<para>系统用户是那些要使用诸如DNS、 邮件, web等服务的用户。
使用帐户的原因就是安全; 如果所有的用户都由超级用户来运行,
那它们就可以不受约束地做任何事情。</para>
<indexterm>
<primary>帐户</primary>
<secondary><username>daemon</username></secondary>
</indexterm>
<indexterm>
<primary>帐户</primary>
<secondary><username>operator</username></secondary>
</indexterm>
<para>系统帐户可以是<username>daemon</username>,
<username>operator</username>、 <username>bind</username>
(供域名服务使用),和<username>news</username>。 系统管理员经常创建
<username>httpd</username> 来运行 web 服务器。</para>
<indexterm>
<primary>帐户</primary>
<secondary><username>nobody</username></secondary>
</indexterm>
<para><username>nobody</username> 是普通的没有特权的系统用户。
然而, 大多数与用户联系很密切的服务是使用
<username>nobody</username>的, 记的这点非常重要,
这样可能使用户变的非常有特权。</para>
</sect1>
<sect1 id="users-user">
<title>用户帐户</title>
<indexterm>
<primary>帐户</primary>
<secondary>用户</secondary>
</indexterm>
<para>用户帐户是让真实的用户访问系统的主要方式,
这些帐户把用户和环境隔离, 能阻止用户损坏系统和其他用户,
在不影响其他用户的情况之下定制自己的环境。</para>
<para>任何人访问您的系统必须要有他们自己唯一的帐户。
这可以让您找到谁做了什么事,
并且阻止人们破坏其他用户的设置和阅读其他人的邮件等等。</para>
<para>每个用户能够设置他们自己的环境, 以利于他们通过改变shell
编辑器, 键盘绑定和语言等适应并且更好的使用这个系统。</para>
</sect1>
<sect1 id="users-modifying">
<title>修改帐户</title>
<indexterm>
<primary>帐户</primary>
<secondary>修改</secondary>
</indexterm>
<para>在&unix; 的处理用户帐户的环境中有很多不同的命令可用.
最普通的命令如下, 接下来是详细使用它们的例子。</para>
<informaltable frame="none">
<tgroup cols="2">
<colspec colwidth="1*">
<colspec colwidth="2*">
<thead>
<row>
<entry>命令</entry>
<entry>摘要</entry>
</row>
</thead>
<tbody>
<row>
<entry>&man.adduser.8;</entry>
<entry>在命令行添加新用户.</entry>
</row>
<row>
<entry>&man.rmuser.8;</entry>
<entry>在命令行删除用户.</entry>
</row>
<row>
<entry>&man.chpass.1;</entry>
<entry>一个灵活的用于修改用户数据库信息的工具.</entry>
</row>
<row>
<entry>&man.passwd.1;</entry>
<entry>一个用于修改用户口令的简单的命令行工具.</entry>
</row>
<row>
<entry>&man.pw.8;</entry>
<entry>一个强大灵活修改用户帐户的工具.</entry>
</row>
</tbody>
</tgroup>
</informaltable>
<sect2 id="users-adduser">
<title><command>添加用户</command></title>
<indexterm>
<primary>帐户</primary>
<secondary>添加</secondary>
</indexterm>
<indexterm>
<primary><command>添加用户</command></primary>
</indexterm>
<indexterm>
<primary><filename class=directory>/usr/share/skel</filename></primary>
</indexterm>
<indexterm><primary>skeleton directory</primary></indexterm>
<para>&man.adduser.8; 是一个简单的添加新用户的命令. 它为用户创建
<filename>passwd</filename> 和 <filename>group</filename>
文件。 它也为新用户创建一个主目录, 它拷贝一个默认的配置文件
(<quote>dotfiles</quote>) 从 <filename>/usr/share/skel</filename>
这个目录, 然后给新用户发送一封带欢迎信息的邮件。</para>
<para>在&os;&nbsp;5.0版本, &man.adduser.8;命令从Perl脚本改写为shell脚本
起包装&man.pw.8;的作用, 所以它的用法在 &os;&nbsp;4.X
上和 &os;&nbsp;5.X 上略有不同。</para>
<para>建立初始化配置文件, 使用
<command>adduser -s -config_create</command>.
<footnote>
<para>选项<option>-s</option>&man.adduser.8;
是。 当我们想要改变默认设置可以使用<option>-v</option>选项</para>
</footnote>
接下来, 我们配置 &man.adduser.8; 的默认设置,
并建立第一个普通用户帐户, 因为将
<username>root</username> 用于日常使用会带来很多潜在问题。</para>
<example>
<title>配置 <command>adduser</command> 和添加一个新用户,在&os;&nbsp;4.X版本</title>
<screen>&prompt.root; <userinput>adduser -v</userinput> Use option ``-silent'' if you don't want to see all warnings and questions.
Check /etc/shells
Check /etc/master.passwd
Check /etc/group
Enter your default shell: csh date no sh tcsh zsh [sh]: <userinput>zsh</userinput> Your default shell is: zsh -&gt; /usr/local/bin/zsh Enter your default HOME partition: [/home]:
Copy dotfiles from: /usr/share/skel no [/usr/share/skel]:
Send message from file: /etc/adduser.message no
[/etc/adduser.message]: <userinput>no</userinput> Do not send message Use passwords (y/n) [y]: <userinput>y</userinput>
Write your changes to /etc/adduser.conf? (y/n) [n]: <userinput>y</userinput>
Ok, let's go.
Don't worry about mistakes. I will give you the chance later to correct any input.
Enter username [a-z0-9_-]: <userinput>jru</userinput> Enter full name []: <userinput>J. Random User</userinput> Enter shell csh date no sh tcsh zsh [zsh]:
Enter home directory (full path) [/home/jru]:
Uid [1001]:
Enter login class: default []:
Login group jru [jru]:
Login group is ``jru''. Invite jru into other groups: guest no
[no]: <userinput>wheel</userinput>
Enter password []:
Enter password again []:
Name: jru
Password: ****
Fullname: J. Random User
Uid: 1001
Gid: 1001 (jru)
Class:
Groups: jru wheel
HOME: /home/jru
Shell: /usr/local/bin/zsh
OK? (y/n) [y]: <userinput>y</userinput>
Added user ``jru''
Copy files from /usr/share/skel to /home/jru Add another user? (y/n) [y]: <userinput>n</userinput> Goodbye!
&prompt.root;</screen>
</example>
<para>总体而言, 我们把默认的shell设置成
<application>zsh</application> (一个可以在 Ports Collection 找到的
shell) 关闭欢迎邮件。 然后保存配置,
接着创建一个名为 <username>jru</username>的帐户,
并且确信 <username>jru</username> 在
<username>wheel</username> 组里 (这样它就能够通过 &man.su.1;
转变为 <username>root</username>。)</para>
<note>
<para>口令不会被回显, 也不会用星号来显示。
两次输入的口令必须一致。
</para>
</note>
<note>
<para>从现在起, 使用 &man.adduser.8; 不再需要改变默认设置。
如果您要求改变默认设置, 先退出程序,
然后使用 <option>-s</option> 选项。</para>
</note>
<example>
<title>添加一个新用户在&os;&nbsp;5.X版本</title>
<screen>&prompt.root; <userinput>adduser</userinput>
Username: <userinput>jru</userinput>
Full name: <userinput>J. Random User</userinput> Uid (Leave empty for default):
Login group [jru]:
Login group is jru. Invite jru into other groups? []: <userinput>wheel</userinput> Login class [default]:
Shell (sh csh tcsh zsh nologin) [sh]: <userinput>zsh</userinput> Home directory [/home/jru]:
Use password-based authentication? [yes]:
Use an empty password? (yes/no) [no]:
Use a random password? (yes/no) [no]:
Enter password:
Enter password again:
Lock out the account after creation? [no]:
Username : jru
Password : ****
Full Name : J. Random User
Uid : 1001
Class :
Groups : jru wheel
Home : /home/jru
Shell : /usr/local/bin/zsh
Locked : no
OK? (yes/no): <userinput>yes</userinput>
adduser: INFO: Successfully added (jru) to the user database.
Add another user? (yes/no): <userinput>no</userinput> Goodbye!
&prompt.root;</screen>
</example>
</sect2>
<sect2 id="users-rmuser">
<title><command>删除用户</command></title>
<indexterm><primary><command>rmuser</command></primary></indexterm>
<indexterm>
<primary>帐户</primary>
<secondary>删除</secondary>
</indexterm>
<para>您可以使用&man.rmuser.8; 从系统中完全删除一个用户.
&man.rmuser.8; 执行如下步骤:</para>
<procedure>
<step>
<para>删除用户的 &man.crontab.1; 记录 (如果有的话).</para>
</step>
<step>
<para>删除属于用户的&man.at.1; 工作.</para>
</step>
<step>
<para>杀掉属于用户的所有进程.</para>
</step>
<step>
<para>删除本地口令文件中的用户.</para>
</step>
<step>
<para>删除用户的主目录 (如果他有自己的主目录).</para>
</step>
<step>
<para>删除来自 <filename>/var/mail</filename>属于用户的邮件.</para>
</step>
<step>
<para>删除所有诸如 <filename>/tmp</filename>的临时文件存储区中的文件.</para>
</step>
<step>
<para>最后, 删除 <filename>/etc/group</filename>中所有属于组的该用户名.
<note>
<para>如果一个组变成空,而组名和用户名一样,组将被删除.
&man.adduser.8;命令建立每个用户唯一的组.</para>
</note>
</para>
</step>
</procedure>
<para>&man.rmuser.8; 不能用来删除超级用户的帐户, 因为那样做是对系统极大的破坏.</para>
<para>默认情况下, 使用交互模式, 这样能够让您清楚的知道您在做什么.</para>
<example>
<title><command>删除用户</command> 交互模式下的帐户删除</title>
<screen>&prompt.root; <userinput>rmuser jru</userinput> Matching password entry:
jru:*:1001:1001::0:0:J. Random User:/home/jru:/usr/local/bin/zsh Is this the entry you wish to remove? <userinput>y</userinput> Remove user's home directory (/home/jru)? <userinput>y</userinput> Updating password file, updating databases, done.
Updating group file: trusted (removing group jru -- personal group is empty) done.
Removing user's incoming mail file /var/mail/jru: done.
Removing files belonging to jru from /tmp: done.
Removing files belonging to jru from /var/tmp: done.
Removing files belonging to jru from /var/tmp/vi.recover: done.
&prompt.root;</screen>
</example>
</sect2>
<sect2 id="users-chpass">
<title><command>chpass</command></title>
<indexterm><primary><command>chpass</command></primary></indexterm>
<para>&man.chpass.1; 可以改变用户的口令, shells, 和包括个人信息在内的数据库信息.</para>
<para>只有系统管理员, 既超级用户, 才可以用&man.chpass.1;改变其他用户口令和信息.</para>
<para>除了可选择的用户名,
不需要任何选项, &man.chpass.1; 将显示一个包含用户信息的编辑器. 可以试图改变用户在数据库中的信息.</para>
<note>
<para>在 &os;&nbsp;5.X版本, 编辑退出后,您应该索要您的口令,如果您不是超级用户的话.</para>
</note>
<example>
<title>以超级用户交互执行 <command>chpass</command> 命令</title>
<screen>#Changing user database information for jru.
Login: jru
Password: *
Uid [#]: 1001
Gid [# or name]: 1001
Change [month day year]:
Expire [month day year]:
Class:
Home directory: /home/jru
Shell: /usr/local/bin/zsh
Full Name: J. Random User
Office Location:
Office Phone:
Home Phone:
Other information:</screen>
</example>
<para>普通用户只能改变他们自己很少的一部分信息.</para>
<example>
<title>以普通用户交互执行 <command>chpass</command> 命令</title>
<screen>#Changing user database information for jru.
Shell: /usr/local/bin/zsh
Full Name: J. Random User
Office Location:
Office Phone:
Home Phone:
Other information:</screen>
</example>
<note>
<para>&man.chfn.1; 和 &man.chsh.1; 只是到 &man.chpass.1; 的符号连接,
类似地,
&man.ypchpass.1;, &man.ypchfn.1;
以及 &man.ypchsh.1; 也是这样。
NIS 是自动支持的,
不一定要在命令前指定 <literal>yp</literal>。
如果这让您有点不太明白, 不必担心,
NIS 将在 <xref linkend="advanced-networking"> 介绍。</para>
</note>
</sect2>
<sect2 id="users-passwd">
<title><command>passwd命令</command></title>
<indexterm><primary><command>passwd命令</command></primary></indexterm>
<indexterm>
<primary>帐户</primary>
<secondary>改变口令</secondary>
</indexterm>
<para>&man.passwd.1; 是改变您自己作为一个普通用户口令或者作为超级用户口令常用的方法.</para>
<note>
<para>用户改变口令前必须键入原来的口令, 防止用户离开终端时非授权的用户进入改变合法用户的口令。</para>
</note>
<example>
<title>改变您的口令</title>
<screen>&prompt.user; <userinput>passwd</userinput> Changing local password for jru.
Old password:
New password:
Retype new password:
passwd: updating the database...
passwd: done</screen>
</example>
<example>
<title>改变其他用户的口令同超级用户的一样</title>
<screen>&prompt.root; <userinput>passwd jru</userinput> Changing local password for jru.
New password:
Retype new password:
passwd: updating the database...
passwd: done</screen>
</example>
<note>
<para>就象 &man.chpass.1;一样,
&man.yppasswd.1; 只是一个到
&man.passwd.1;的连接, 所以NIS用任何一个命令都可以正常工作.</para>
</note>
</sect2>
<sect2 id="users-pw">
<title><command>pw命令</command></title>
<indexterm><primary><command>pw命令</command></primary></indexterm>
<para>&man.pw.8; 是一个用来创建、删除、修改、显示用户和组的命令行工具。
它还有系统用户和组文件编辑器的功能。 &man.pw.8;
有一个非常强大的命令行选项设置,
但新用户可能会觉得它比这里讲的其它命令要复杂很多。</para>
</sect2>
</sect1>
<sect1 id="users-limiting">
<title>限制用户使用系统资源</title>
<indexterm><primary>限制用户使用系统资源</primary></indexterm>
<indexterm>
<primary>帐户</primary>
<secondary>限制</secondary>
</indexterm>
<para>如果您有一些用户, 并想要对他们所使用的系统资源加以限制,
FreeBSD 提供了一些系统管理员限制用户访问系统资源的方法。
这些限制通常被分为两种: 磁盘配额, 以及其它资源限制。</para>
<indexterm><primary>配额</primary></indexterm>
<indexterm>
<primary>限制用户使用系统资源</primary>
<secondary>配额</secondary>
</indexterm>
<indexterm><primary>磁盘配额</primary></indexterm>
<para>磁盘配额限制用户对磁盘的使用,
而且它还提供一种快速检查用户使用磁盘数量而不需要时刻计算的方法。
配额将在 <xref
linkend="quotas">讨论.</para>
<para>其它资源限制包括CPU、 内存以及用户可能会使用的其它资源。
这些是通过对登录进行分类完成的, 下面将做讨论。</para>
<indexterm>
<primary><filename>/etc/login.conf</filename></primary>
</indexterm>
<para>登录的类由 <filename>/etc/login.conf</filename> 文件定义。
比较精确的描述超出了本章的范围, 但 &man.login.conf.5;
联机手册会有比较详细的描述。 可以说每个用户都分配到一个登录类
(默认是 <literal>defalut</literal>)
每个登录类都有一套和它相对应的功能。 登录功能是
<literal><replaceable>名字</replaceable>=<replaceable>值</replaceable></literal>
这样的一对值, 其中<replaceable>名字</replaceable>
是一个众所周知的标识符, <replaceable>值</replaceable>
是一个根据名字经过处理得到的任意字符串。 设置登录类和功能相当简单,
在 &man.login.conf.5; 联机手册会有比较详细的描述。</para>
<note>
<para>系统并不直接读取
<filename>/etc/login.conf</filename> 中的配置,
相反, 它读取数据库文件
<filename>/etc/login.conf.db</filename>。
为了从 <filename>/etc/login.conf</filename> 生成
<filename>/etc/login.conf.db</filename>
需要执行下面的命令:</para>
<screen>&prompt.root; <userinput>cap_mkdb /etc/login.conf</userinput></screen>
</note>
<para>资源限制与普通登录限制是有区别的。
首先, 对于每种限制, 有软限制 (比较常见) 和硬限制之分。
一个软限制可能被用户调整过, 但不会超过硬限制。
越往后可能越低, 但不会升高。 其次,
绝大多数资源限制会分配特定用户的每个进程, 而不是该用户的全部进程。
注意, 这些区别是资源限制的特殊操作所规定的,
不是登录功能框架的完成 (也就是说, 他们<emphasis>实际上</emphasis>
不是一个登录功能的特例)。</para>
<para>不再罗嗦了, 下面是绝大多数资源限制的例子
(您可以在 &man.login.conf.5; 找到其它与登录功能相关的内容)。</para>
<variablelist>
<varlistentry>
<term><literal>coredumpsize</literal></term>
<listitem>
<indexterm><primary>coredumpsize</primary></indexterm>
<indexterm>
<primary>限制用户使用系统资源</primary>
<secondary>coredumpsize</secondary>
</indexterm>
<para>很明显, 由程序产生的核心文件大小的限制在磁盘使用上是属于其它限制的
(例如, <literal>文件大小</literal> 磁盘配额)。
不过, 由于用户自己无法产生核心文件, 而且通常并不删除它们,
设置这个可以尽量避免由于一个大型应用程序的崩溃所造成的大量磁盘空间的浪费。
(例如, <application>emacs</application>) 崩溃。</para>
</listitem>
</varlistentry>
<varlistentry>
<term><literal>cputime</literal></term>
<listitem>
<indexterm><primary>cputime</primary></indexterm>
<indexterm>
<primary>限制用户使用系统资源</primary>
<secondary>cputime</secondary>
</indexterm>
<para>这是一个用户程序所能消耗掉的最大CPU时钟数量. 一些不理想的进程会被内核杀掉.
<note>
<para>这是一个有关CPU消耗的<emphasis>时钟</emphasis>
限制, 不是&man.top.1; 和 &man.ps.1;
命令时屏幕上显示的CPU消耗的百分比。 在写此说明时,
后者的限制是是不太可能和没有价值的: 编译器 &mdash;
编译一个可能是合法的工作 &mdash; 可以在某一时刻轻易的用掉
100% 的 CPU。</para>
</note>
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><literal>filesize</literal></term>
<listitem>
<indexterm><primary>filesize</primary></indexterm>
<indexterm>
<primary>限制用户使用系统资源</primary>
<secondary>filesize</secondary>
</indexterm>
<para>这是用户可以处理一个文件的最大值。
不象 <link linkend="quotas">磁盘配额</link>
这个限制是对单个文件强制执行的,
不是用户自己的所有文件。</para>
</listitem>
</varlistentry>
<varlistentry>
<term><literal>maxproc</literal></term>
<listitem>
<indexterm><primary>maxproc</primary></indexterm>
<indexterm>
<primary>限制用户使用系统资源</primary>
<secondary>maxproc</secondary>
</indexterm>
<para>这是一个用户可以运行的最大进程数。
这包括前台和后台进程。 很明显, 这不可能比系统指定
<varname>kern.maxproc</varname> &man.sysctl.8;
的限制要大。 同时也要注意, 设置的过小会妨碍用户的处理能力:
可能需要多次登录或执行多个管道。 一些任务,
例如编译一些大的程序, 也可能会产生很多进程
(例如, &man.make.1; &man.cc.1; 以及其它一些预处理程序)。</para>
</listitem>
</varlistentry>
<varlistentry>
<term><literal>memorylocked</literal></term>
<listitem>
<indexterm><primary>memorylocked</primary></indexterm>
<indexterm>
<primary>限制用户使用系统资源</primary>
<secondary>memorylocked</secondary>
</indexterm>
<para>这是一个进程可能会被锁定到主存中的最大内存数量 (参见
&man.mlock.2;)。 大型程序,
例如像 &man.amd.8; 在遇到问题时,
它们得到的巨大交换量无法传递给系统进行处理。</para>
</listitem>
</varlistentry>
<varlistentry>
<term><literal>memoryuse</literal></term>
<listitem>
<indexterm><primary>memoryuse</primary></indexterm>
<indexterm>
<primary>限制用户使用系统资源</primary>
<secondary>memoryuse</secondary>
</indexterm>
<para>这是在给定时间内一个进程可能消耗的最大内存数量。
它包括核心内存和交换内存。
在限制内存消耗方面, 这不是一个完全的限制,但它是一个好的开始。</para>
</listitem>
</varlistentry>
<varlistentry>
<term><literal>openfiles</literal></term>
<listitem>
<indexterm><primary>openfiles</primary></indexterm>
<indexterm>
<primary>限制用户使用系统资源</primary>
<secondary>openfiles</secondary>
</indexterm>
<para>这是一个进程可以打开的最大文件数。 在FreeBSD中
文件可以被表现为套接字和IPC通道 注意不要把这个数设置的太小。
系统级的限制是由 <varname>kern.maxfiles</varname>
定义的, 详情参见 &man.sysctl.8;。</para>
</listitem>
</varlistentry>
<varlistentry>
<term><literal>sbsize</literal></term>
<listitem>
<indexterm><primary>sbsize</primary></indexterm>
<indexterm>
<primary>限制用户使用系统资源</primary>
<secondary>sbsize</secondary>
</indexterm>
<para>这是网络内存数量的限制,
这主要是针对通过创建许多套接字的老式 DoS 攻击的,
但也可以用来限制网络通信。</para>
</listitem>
</varlistentry>
<varlistentry>
<term><literal>stacksize</literal></term>
<listitem>
<indexterm><primary>stacksize</primary></indexterm>
<indexterm>
<primary>限制用户使用系统资源</primary>
<secondary>stacksize</secondary>
</indexterm>
<para>这是一个进程堆栈可能达到的最大值。
它不能单独的限制一个程序可能使用的内存数量;
所以, 需要与其它的限制手段配合使用。</para>
</listitem>
</varlistentry>
</variablelist>
<para>在设置资源限制时, 有一些其他的事需要注意。
下面是一些通常的技巧、 建议和注意事项。</para>
<itemizedlist>
<listitem>
<para>系统启动的进程<filename>/etc/rc</filename>会被指派给
<literal>守护程序</literal> 的登录类.</para>
</listitem>
<listitem>
<para>虽然 <filename>/etc/login.conf</filename>
文件是一个对绝大多数限制做合理配置的资源文件,
但只有您也就是系统管理员,才知道什么最适合您的系统。
设置的太高可能会因为过于开放而造成系统的被人滥用,
设置的过低则会降低效率。</para>
</listitem>
<listitem>
<para>使用 X Window 的用户可能要比其他用户使用更多的资源。
因为X11本身就使用很多资源 而且它鼓励用户同时运行更多的程序。</para>
</listitem>
<listitem>
<para>要记得许多限制会被用于单个进程, 不是用户的所有进程。
例如, 将 <varname>openfiles</varname> 设置为 50
意味着每个用户进程最高只能打开 50 个文件。 然而,
用户可以打开的文件的总的大小是根据
<literal>maxproc</literal>
值逐步增加的
<literal>openfiles</literal> 值。
同样的规则也适用于内存相关的限制。</para>
</listitem>
</itemizedlist>
<para>有关资源限制,登录类的更深入信息可以查看相关联机手册:
&man.cap.mkdb.1;, &man.getrlimit.2;, &man.login.conf.5;.</para>
</sect1>
<sect1 id="users-personalizing">
<title>个性化用户设置</title>
<para>本地化是由系统管理员或用户设置的的一个环境,
它可以用来调整不同的语言、 字符设置、 时钟时区等等。
这将在 <link linkend="l10n">本地化</link> 一章做详细讨论。</para>
</sect1>
<sect1 id="users-groups">
<title>组</title>
<indexterm><primary>组</primary></indexterm>
<indexterm>
<primary><filename>/etc/groups</filename></primary>
</indexterm>
<indexterm>
<primary>帐户</primary>
<secondary>组</secondary>
</indexterm>
<para>组简单的讲就是一个用户列表. 组通过组名和GID (组 ID) 来识别。
在 FreeBSD (以及绝大多数其他 &unix; 系统) 中,
内核用以决定一个进程是能够完成一项动作的两个因素是它所属的用户 ID
和组 ID。 与用户 ID 不同, 每个进程都有一个和它相关联的组的列表。
您可能听说过用户或进程的 <quote>组 ID</quote>
大多数情况下, 这表示列表中的第一个组。</para>
<para>与组ID对应的组名在<filename>/etc/group</filename>中。
这是一个由冒号来界定的文本文件。 第一部分是组名,
第二部分是加密后的口令, 第三部分是组ID
第四部分是以逗号相隔的成员列表。 它可以用手工方式进行编辑
(当然, 如果您能保证不出语法错误的话!)。
对于更完整的语法描述, 参见 &man.group.5; 联机手册.</para>
<para>假如您想要手工编辑<filename>/etc/group</filename>
您可以使用 &man.pw.8; 添加和编辑组。 例如,
要添加一个叫 <groupname>teamtwo</groupname> 的组,
确定它存在:</para>
<example>
<title>使用&man.pw.8;添加一个组</title>
<screen>&prompt.root; <userinput>pw groupadd teamtwo</userinput> &prompt.root; <userinput>pw groupshow teamtwo</userinput> teamtwo:*:1100:</screen>
</example>
<para>上面的数字 <literal>1100</literal> 是组
<groupname>teamtwo</groupname> 的组 ID。
目前, <groupname>teamtwo</groupname> 还没有成员,
因此也就没有多大用处。
接下来, 把 <username>jru</username> 加入到
<groupname>teamtwo</groupname> 组。</para>
<example>
<title>使用 &man.pw.8; 在组中添加用户</title>
<screen>&prompt.root; <userinput>pw groupmod teamtwo -M jru</userinput> &prompt.root; <userinput>pw groupshow teamtwo</userinput> teamtwo:*:1100:jru</screen>
</example>
<para><option>-M</option> 所需的参数是一个用逗号分隔的组中用户成员的列表。
在前面我们已经每个用户在口令文件中也包含了一个组。
之后用户被自动地添加到组列表里; 当我们使用
<option>groupshow</option> 命令时 &man.pw.8; 用户列表不被显示出来。
但当通过 &man.id.1; 或者类似工具查看时,
就会看到用户列表。 换言之, &man.pw.8; 命令只能读取
<filename>/etc/group</filename> 文件; 它从不尝试从
<filename>/etc/passwd</filename> 文件读取更多信息。</para>
<example>
<title>使用&man.id.1;来决定组成员</title>
<screen>&prompt.user; <userinput>id jru</userinput>
uid=1001(jru) gid=1001(jru) groups=1001(jru), 1100(teamtwo)</screen>
</example>
<para>正如您所看到的, <username>jru</username> 是组 <groupname>jru</groupname> 和组
<groupname>teamtwo</groupname>的成员.</para>
<para>有关&man.pw.8;的更多信息, 请参看其它联机手册。
更多的关于 <filename>/etc/group</filename> 文件格式的信息,
请参考 &man.group.5; 联机手册。</para>
</sect1>
</chapter>
<!--
Local Variables:
mode: sgml
sgml-declaration: "../chapter.decl"
sgml-indent-data: t
sgml-omittag: nil
sgml-always-quote-attributes: t
sgml-parent-document: ("../book.sgml" "part" "chapter")
End:
-->

@ -0,0 +1,16 @@
#
# Build the Handbook with just the content from this chapter.
#
# Original Revision: 1.1
# $FreeBSD$
#
CHAPTERS= vinum/chapter.sgml
VPATH= ..
MASTERDOC= ${.CURDIR}/../${DOC}.${DOCBOOKSUFFIX}
DOC_PREFIX?= ${.CURDIR}/../../../..
.include "../Makefile"

@ -0,0 +1,609 @@
<!--
The Vinum Volume Manager
By Greg Lehey (grog at lemis dot com)
Added to the Handbook by Hiten Pandya <hiten@FreeBSD.org>
and Tom Rhodes <trhodes@FreeBSD.org>
For the FreeBSD Documentation Project
The FreeBSD Simplified Chinese Project
Original Revision: 1.32
$FreeBSD$
-->
<chapter id="vinum-vinum">
<chapterinfo>
<authorgroup>
<author>
<firstname>Greg</firstname>
<surname>Lehey</surname>
<contrib>Originally written by </contrib>
</author>
</authorgroup>
</chapterinfo>
<title>Vinum 卷管理程序</title>
<sect1 id="vinum-synopsis">
<title>概述</title>
<para>无论您有什么样的磁盘,总会有一些潜在问题:</para>
<itemizedlist>
<listitem>
<para>它们可能容量太小。</para>
</listitem>
<listitem>
<para>它们可能速度太慢。</para>
</listitem>
<listitem>
<para>它们可能也太不可靠。</para>
</listitem>
</itemizedlist>
<para>一些用户采取一些技术来保护他们免与受到这些问题的影响,
例如使用多个, 有些时候甚至是冗余的, 磁盘。</para>
<para>除了支持许多种不同的硬件 RAID 控制器之外,
FreeBSD 的基本系统中包括了 Vinum 卷管理器, 它是一个用以实现磁盘驱动器的块设备。</para>
<para>Vinum 提供了比传统磁盘存储更好的灵活性、性能和可靠性,
它还实现了 RAID-0, RAID-1, 以及 RAID-5
并可以单独和组合使用。</para>
<para>这一章对传统磁盘存储的潜在问题进行了简要说明,并介绍了 Vinum 卷管理器。</para>
</sect1>
<sect1 id="vinum-intro">
<title>磁盘容量太小</title>
<indexterm><primary>Vinum</primary></indexterm>
<indexterm><primary>RAID</primary>
<secondary>Software</secondary></indexterm>
<para><emphasis>Vinum</emphasis> 是一个所谓的 <emphasis>卷管
理工具</emphasis>, 是能够解决这三个问题的虚拟磁盘驱动程序。
让我们来仔细地看看这些问题。已经有针对这些问题的很多方法被提出和实现了:
</para>
<para>磁盘越大,存储的数据也就越多。您经常会发现您需要
一个比您可使用的磁盘大得多的文件系统。 无可否认,这个问题
已经没有十年前那样严峻了,但它仍然存在。通过创建一个在许多
磁盘上存储数据的抽象设备,一些系统可以解决这个问题。</para>
</sect1>
<sect1 id="vinum-access-bottlenecks">
<title>访问瓶颈</title>
<para>现代系统经常需要用一个高度并发的方式来访问数据。
例如巨大的FTP 或HTTP 服务器可以支持数以千计的并发会话,
可以有多个连到外部世界的100&nbsp;Mbit/s ,
这远远地超过了绝大多数磁盘的数据传输速率。</para>
<para>当前的磁盘驱动器最高可以以70&nbsp;MB/s的速度传输数据,
但这个值在一个有许多不受约束的进程访问一个驱动器的环境中变得并不重要,
它们可能只完成了这些值的一小部分。这样一种情况下,从磁盘子
系统的角度来看问题就更加有趣:重要的参数是在子系统上的负
荷,换句话说是传输占用了驱动器多少时间。</para>
<para>在任何磁盘传输中, 驱动器必须先寻道, 等待磁头访问第一个扇区,
然后执行传输. 这些动作看起来可能很细小:
我们不会感有任何中断。
</para>
<para><anchor id="vinum-latency"> 假设传输10&nbsp;kB数据
: 现在的高性能磁盘平均寻道时间是3.5ms。
最快的驱动器可以旋转在15,000 rpm, 所以平均寻址时间为2ms.
在70&nbsp;MB/s的速度传输时, 数据的传输时间大约150&nbsp;&mu;s,
几乎无法和寻址时间相比. 在这样一种情况下, 高效的传输也会降低到
1&nbsp;MB/s 显然传输的快慢依赖与所传输数据的大小。
</para>
<para>对于这个瓶颈的一般和明显的解决方法是采用
<quote>多个磁盘</quote>:而不是只使用一个大磁盘,
它使用几个比较小的磁盘联合起来形成一个大的磁盘.
每个磁盘都可以独立地进行传输数据,所以通过使用多个磁盘
大大提高了数据吞吐量。
</para>
<para>当然,所要求的吞吐量的提高要比磁盘的数量小得多。
尽管每个驱动器并行传输数据,但没有办法确保请求能够平均
分配到每个驱动器上。不可避免一个驱动器的负载可能比另一个要高得多。
</para>
<indexterm>
<primary>磁盘的串连</primary>
</indexterm>
<indexterm>
<primary>Vinum</primary>
<secondary>串连</secondary>
</indexterm>
<para>磁盘的负载平衡很大程度依赖于驱动器上数据的共享方式.
在下面的讨论中, 将磁盘存储想象成一个巨大的数据扇区,像一本书的页
那样用编号来设定地址. 最明显的方法是把虚拟磁盘分成许多连续的扇区组,
每个扇区大小就是独立的磁盘大小,用这种方法来存储数据,
就像把一本厚厚的书分成很多小的章节。
这个方法叫做
<emphasis>串联</emphasis> 它有一个优点就是磁盘不需要
有任何特定的大小关系。
当访问到的虚拟磁盘根据它的地址空间来分布的时候,它能工作得
很好。当访问集中在一个比较小的区域的时候,性能的提高没有显著的改进。
<xref linkend="vinum-concat">
举例说明了用串联组织的方式来分配存储单元的顺序。
</para>
<para>
<figure id="vinum-concat">
<title>串联组织</title>
<graphic fileref="vinum/vinum-concat">
</figure>
</para>
<indexterm>
<primary>disk striping</primary>
</indexterm>
<indexterm>
<primary>Vinum</primary>
<secondary>striping</secondary>
</indexterm>
<para>另外一种影射方法是把地址空间分布在比较小的容量相同的磁盘上,
从而能够在不同的设备上存储它们。例如前256 个扇区可能存储在第一
个磁盘上接着的256 个扇区存储在另一个磁盘上等等。 写满最后一个磁
盘后,进程会重复以前的工作,直到所有的磁盘被写满。这个影射叫做
<emphasis>分段(striping)</emphasis> 或者 <acronym>RAID-0</acronym>
<footnote>
<indexterm><primary>RAID</primary></indexterm>
<para><acronym>RAID</acronym> 代表<emphasis>廉价磁盘容错(Redundant
Array of Inexpensive Disks)</emphasis> 提供各种容错机制,
但后面这个术语可能会有些让人误解:它不提供冗余功能。</para> </footnote>.
分段要求很精确地寻址,通过多个磁盘进行数据传输的时候,它
可能会引起额外的I/O 负载,但它也可能提供更多的连续负载。
<xref linkend="vinum-striped"> 显示了用分段形式分配的存储单元的顺序。
</para>
<para>
<figure id="vinum-striped">
<title>分段组织</title>
<graphic fileref="vinum/vinum-striped">
</figure>
</para>
</sect1>
<sect1 id="vinum-data-integrity">
<title>数据的完整性</title>
<para>T当前磁盘的最后一个问题是它们不太可靠。虽然磁盘驱动器
的可靠性在过去几年有了很大的提高,它们仍然是会损坏的服务器的
最核心组件。当它们发生故障的时候, 结果可能是灾难性的:
替换一个坏的磁盘驱动器,然后恢复数据可能要花费几天时间。
</para>
<indexterm>
<primary>disk mirroring</primary>
</indexterm>
<indexterm>
<primary>Vinum</primary>
<secondary>mirroring</secondary>
</indexterm>
<indexterm>
<primary>RAID-1</primary>
</indexterm>
<para>解决这个问题的传统方法是建立镜象
<emphasis>镜象</emphasis>, 在不同的物理硬件上对数据做两个拷贝。
由于<acronym>RAID</acronym> 的出现levels, 所以这个技术也被叫做
<acronym>第一级RAID</acronym> 或者
<acronym>RAID-1</acronym>. 任何写到卷的数据也会被写到镜象上,所
以可以从任何一个拷贝读取数据,如果其中有一个失败了,数据就可以
在其他驱动器上访问到。</para>
<para>镜象有两个问题:</para>
<itemizedlist>
<listitem>
<para>价格. 它需要两倍的存储容量。</para>
</listitem>
<listitem>
<para>性能影响。 写入操作必须在两个驱动器上执行,所以它们
花费两倍的带宽。读取数据并不会影响性能:看起来它们会更快。</para>
</listitem>
</itemizedlist>
<para><indexterm><primary>RAID-5</primary></indexterm>一个
可选的方案采用 <emphasis>parity</emphasis>,
其实现了 <acronym>RAID</acronym> 2, 3, 4 和
5. 当然, <acronym>RAID-5</acronym> 是最有趣的。
As implemented in Vinum, it is a variant on a
striped organization which dedicates one block of each stripe
to parity of the other blocks. As implemented by Vinum, a
<acronym>RAID-5</acronym> plex is similar to a striped plex,
except that it implements <acronym>RAID-5</acronym> by
including a parity block in each stripe. As required by
<acronym>RAID-5</acronym>, the location of this parity block
changes from one stripe to the next. The numbers in the data
blocks indicate the relative block numbers.</para>
<para>
<figure id="vinum-raid5-org">
<title>RAID-5 Organization ** 翻译进行中 **</title>
<graphic fileref="vinum/vinum-raid5-org">
</figure>
</para>
<!-- WIP -->
<para>本节尚未翻译</para>
</sect1>
<sect1 id="vinum-objects">
<title>Vinum 目标</title>
<para>为了解决这些问题Vinum 提出了一个四层的目标结构:</para>
<itemizedlist>
<listitem>
<para>T最显著的目标是虚拟磁盘, 叫做
<emphasis>卷(volume)</emphasis>. 卷本质上与一个UNIX 磁盘
驱动器有同样的属性,虽然它们是有些不太一样。它们没有大小的限制。
</para>
</listitem>
<listitem>
<para>卷下面是 <emphasis>plexes</emphasis>,
每一个表示卷的所有地址空间。在层次结构中的这个水平能够提供
冗余功能。可以把plex 想象成用一个镜象排列的方式组织起来的
独立磁盘,每个都包含同样的数据。</para>
</listitem>
<listitem>
<para>由于Vinum 存在于UNIX 磁盘存储框架中,所以它也可能
使用UNIX 分区作为多个磁盘plex 的组成部分,
但事实上这并不可靠:UNIX 磁盘只能有有限数量的分区。
取而代之Vinum 把一个简单的UNIX 分区 (the <emphasis>drive</emphasis>)
分解成叫做<emphasis>subdisks</emphasis>的相邻区域, 它可以使用这个
来为plex 建立块。</para>
</listitem>
<listitem>
<para>Subdisks 位于 Vinum <emphasis>驱动器上</emphasis>,
当前的UNIX 分区。Vinum 驱动器可以包含很多的subdisks。
除了驱动器开始的一小块区域用来存储配置和描述信息以外,整个
驱动器都可以用于存储数据。</para>
</listitem>
</itemizedlist>
<para>下面的章节描述了这些目标提供了Vinum 所要求的功能的方法。</para>
<sect2>
<title>卷的大小要求</title>
<para>在Vinum的配置中Plex可以把多个subdisk 分布在所有的驱动上。
结果, 每个独立的驱动器的大小都不会限制plex 的大小,从而不会限制卷的大小
</para>
</sect2>
<sect2>
<title>多余的数据存储</title>
<para>Vinum 通过给一个卷连上多个plex 来完成镜象的功能。
每个plex 是一个在一个卷中的数据的描述。一个卷可以包含一个
到八个plex。</para>
<para>Although虽然一个plex 描述了一个卷的所有数据,,
但可能描述的部分被物理地丢失了。可能是设计的问题
没有为plex 部分定义一个subdisk也可能是意外的故障
由于驱动器的故障导致。只要至少有一个plex 能够为
卷的完全地址范围提供数据,卷就能够正常工作。
</para>
</sect2>
<sect2>
<title>性能问题</title>
<para>Vinum 在plex 水平既执行串联也执行分段:</para>
<itemizedlist>
<listitem>
<para>一个<emphasis>串连的plex</emphasis>轮流使用
每个subdisk 的地址空间。</para>
</listitem>
<listitem>
<para>一个 <emphasis>分段的plex</emphasis> 在每个subdisk 上
划分数据. Subdisk 必须是大小一样的为了从一个连接的plex 中
区分开它必须至少有两个subdisk。 </para>
</listitem>
</itemizedlist>
</sect2>
<sect2>
<title>哪种plex 组织更有效?</title>
<para>FreeBSD &rel.current提供的Vinum 版本能实现两种plex:</para>
<itemizedlist>
<listitem>
<para>串联的plex 更加灵活它们可以包含任何数量的subdisk
subdisk 也可能有不同的长度。Plex 可以通过添加额外的subdisk
来得到扩展。 它们需要更少的
<acronym>CPU</acronym> 时钟相对分段plexes, 尽管
<acronym>CPU</acronym> 上的负载差异是不可测量的。
另一方面,它们的负载可能不平衡,一个磁盘可能负载很重,
而其他的可能很空闲。</para>
</listitem>
<listitem>
<para>分段(<acronym>RAID-0</acronym>) plexes 的最大优点是
它们减少了负载不平衡的情况: 通过选择一个最合适大小的分段
(大约是256&nbsp;kB), 您甚至可以在各个组成的驱动器上降低负载
. 这种方法的缺点是在subdisk 上受到非常复杂的编码限制
: 它们必须是同样大小, 通过添加新的subdisk 来扩展一个plex
是非常复杂的,以至Vinum 当前没有实现它. Vinum 利用一个额外
代价不高的限制一个分段的plex 必须有至少两个subdisk
因为否则的话它是无法从一个连接的plex 进行区分的。</para>
</listitem>
</itemizedlist>
<para><xref linkend="vinum-comparison"> 总结一下每个plex 组织
的优点和缺点.</para>
<table id="vinum-comparison" frame="none">
<title>Vinum Plex组织图</title>
<tgroup cols="5">
<thead>
<row>
<entry>Plex 类型</entry>
<entry>最少subdisks</entry>
<entry>可否添加subdisks</entry>
<entry>必须相同大小</entry>
<entry>应用</entry>
</row>
</thead>
<tbody>
<row>
<entry>串联 </entry>
<entry>1</entry>
<entry>可以</entry>
<entry>不可以</entry>
<entry>带有很大弹性和适中性能的大数据量存储。
</entry>
</row>
<row>
<entry>分段</entry>
<entry>2</entry>
<entry>不可以</entry>
<entry>可以</entry>
<entry>大量并发访问时,具有较高性能。</entry>
</row>
</tbody>
</tgroup>
</table>
</sect2>
</sect1>
<sect1 id="vinum-examples">
<title>一些例子</title>
<para>Vinum 维护着一个描述以一个独立系统为目标
<emphasis>配置数据库</emphasis>的。最初,用户通过&man.vinum.8;
工具的帮助从一个或多个配置文件创建配置数据库。Vinum 在它的控制
下在每个磁盘(Vinum 叫 <emphasis>device</emphasis>) 上存储一个
它的配置数据库的拷贝。这个数据库在每个状态变化的时候被升级,
以便能精确地回复每个Vinum 目标的状态。
</para>
<sect2>
<title>配置文件</title>
<para>配置文件描述了独立的 Vinum.一个简单卷的定义可能是这样的:</para>
<programlisting>
drive a device /dev/da3h
volume myvol
plex org concat
sd length 512m drive a</programlisting>
<para>这个文件描述了四个Vinum 目标:</para>
<itemizedlist>
<listitem>
<para><emphasis>drive</emphasis> 行描述了一个磁盘分区(驱动器)
和与下面的硬件相关的它的位置。它给出了一个符号名
<emphasis>a</emphasis>. 这个与设备名称分开的符号名允许
磁盘从一个位置移动到另一个位置而不会搞混。
</para>
</listitem>
<listitem>
<para> <emphasis>volume</emphasis> 行描述了一个卷。
唯一的必须属性是名称,在这个例子中是
<emphasis>myvol</emphasis>.</para>
</listitem>
<listitem>
<para><emphasis>plex</emphasis> 行定义了一个plex。
唯一需要的参数是组织,在这个例子中是
<emphasis>concat</emphasis>. 没有名称是必然的:
系统自动通过添加suffix
<emphasis>.p</emphasis><emphasis>x</emphasis>px
来从卷名称产生一个名字,这里的<emphasis>x</emphasis>
是在卷中的plex 的编号。而这个plex 将被
叫做<emphasis>myvol.p0</emphasis>。</para>
</listitem>
<listitem>
<para> <emphasis>sd</emphasis> 行描述了一个subdisk。
最小的说明是存储subdisk 的驱动器名称和subdisk 的长度。
对于plex没有名称也是必然的系统自动通过添加
suffix <emphasis>.s</emphasis><emphasis>x</emphasis>
来分配源自plex 的名称,这里 <emphasis>x</emphasis>是plex 中subdisk 的编号。
Vinum 给这个subdisk 命名为<emphasis>myvol.p0.s0</emphasis>。</para>
</listitem>
</itemizedlist>
<para>处理完这个文件后, &man.vinum.8会产生下面的输出:</para>
<programlisting width="97">
&prompt.root; vinum -&gt; <userinput>create config1</userinput>
Configuration summary
Drives: 1 (4 configured)
Volumes: 1 (4 configured)
Plexes: 1 (8 configured)
Subdisks: 1 (16 configured)
D a State: up Device /dev/da3h Avail: 2061/2573 MB (80%)
V myvol State: up Plexes: 1 Size: 512 MB
P myvol.p0 C State: up Subdisks: 1 Size: 512 MB
S myvol.p0.s0 State: up PO: 0 B Size: 512 MB</programlisting>
<para>这个输出显示了&man.vinum.8简要的列表格式。
图<xref linkend="vinum-simple-vol">中它用图形来表示这一点。</para>
<para>
<figure id="vinum-simple-vol">
<title>一个简单的Vinum 卷</title>
<graphic fileref="vinum/vinum-simple-vol">
</figure>
</para>
<para>下面这个图显示了一个由按顺序排列的subdisk 组成的plex。
在这个小小的例子中卷包含一个plexplex 包含一个subdisk。
</para>
<para>这个特殊的卷与一个传统的磁盘分区没有什么特别的优势。
下面的章节会描述到几个非常有趣的配置方法。
This particular volume has no specific advantage over a
conventional disk partition. It contains a single plex, so it
is not redundant. The plex contains a single subdisk, so
there is no difference in storage allocation from a
conventional disk partition. The following sections
illustrate various more interesting configuration
methods.</para>
</sect2>
<sect2>
<title>增强的可靠性:镜象 ** 翻译进行中 **</title>
<para></para>
</sect2>
<sect2>
<title>Optimizing Performance ** 翻译进行中 **</title>
<para></para>
</sect2>
<sect2>
<title>Resilience and Performance ** 翻译进行中 **</title>
<para><anchor id="vinum-resilience"></para>
<para>
<figure id="vinum-raid10-vol">
<title>A Mirrored, Striped Vinum Volume</title>
<graphic fileref="vinum/vinum-raid10-vol">
</figure>
</para>
</sect2>
</sect1>
<sect1 id="vinum-object-naming">
<title>Object Naming ** 翻译进行中 **</title>
<para></para>
<sect2>
<title>Creating File Systems ** 翻译进行中 **</title>
<para></para>
</sect2>
</sect1>
<sect1 id="vinum-config">
<title>Configuring Vinum ** 翻译进行中 **</title>
<para></para>
<sect2>
<title>Startup ** 翻译进行中 **</title>
<para></para>
<sect3 id="vinum-rc-startup">
<title>Automatic Startup ** 翻译进行中 **</title>
<para></para>
</sect3>
</sect2>
</sect1>
<sect1 id="vinum-root">
<title>Using Vinum for the Root Filesystem ** 翻译进行中 **</title>
<para></para>
<sect2>
<title>Starting up Vinum Early Enough for the Root
Filesystem ** 翻译进行中 **</title>
<para></para>
</sect2>
<sect2>
<title>Making a Vinum-based Root Volume Accessible to the
Bootstrap ** 翻译进行中 **</title>
<para></para>
</sect2>
<sect2>
<title>Example of a Vinum-based Root Setup ** 翻译进行中 **</title>
<para></para>
</sect2>
<sect2>
<title>Troubleshooting ** 翻译进行中 **</title>
<sect3>
<title>System Bootstrap Loads, but System Does Not Boot</title>
<para></para>
</sect3>
<sect3>
<title>Only Primary Bootstrap Loads ** 翻译进行中 **</title>
<para></para>
</sect3>
<sect3 id="vinum-root-panic">
<title>Nothing Boots, the Bootstrap
Panics ** 翻译进行中 **</title>
<para></para>
</sect3>
</sect2>
<sect2 id="vinum-root-4x">
<title>Differences for FreeBSD 4.X ** 翻译进行中 **</title>
<para></para>
</sect2>
</sect1>
</chapter>

@ -0,0 +1,16 @@
#
# Build the Handbook with just the content from this chapter.
#
# Original Revision: 1.1
# $FreeBSD$
#
CHAPTERS= x11/chapter.sgml
VPATH= ..
MASTERDOC= ${.CURDIR}/../${DOC}.${DOCBOOKSUFFIX}
DOC_PREFIX?= ${.CURDIR}/../../../..
.include "../Makefile"

File diff suppressed because it is too large Load Diff

@ -30,6 +30,8 @@
<!ENTITY a.davidxu "ÐìÒÝ·æ <email>davidxu@FreeBSD.org</email>">
<!ENTITY a.delphij "쟀則 <email>delphij@FreeBSD.org</email>">
<!ENTITY a.foxfair "ºúÍ¥ºÀ <email>foxfair@FreeBSD.org</email>">
<!ENTITY a.hsu "ÐìÃô½Ü <email>hsu@FreeBSD.org</email>">
@ -42,6 +44,8 @@
<!ENTITY a.leeym "ÀîÑåÃ÷ <email>leeym@FreeBSD.org</email>">
<!ENTITY a.pat "쟀暾씰 <email>pat@FreeBSD.org</email>">
<!ENTITY a.vanilla "ÐìÈýÌ© <email>vanilla@FreeBSD.org</email>">
@ -56,4 +60,10 @@
<!ENTITY a.cn.delphij "ÀîöÎ <email>delphij@FreeBSD.org.cn</email>">
<!ENTITY a.cn.gavin "컫접낚 <email>gavin@FreeBSD.org.cn</email>">
<!ENTITY a.cn.ld "À <email>ld@FreeBSD.org.cn</email>">
<!ENTITY a.cn.wjf "侊에룟 <email>wjf@FreeBSD.org.cn</email>">
<!ENTITY a.cn.yarshure "왝卷꺼 <email>yarshure@FreeBSD.org.cn</email>">

Loading…
Cancel
Save