MFen:
Makefile 1.111 -> 1.112 advanced-networking/chapter.sgml 1.415 -> 1.419 basics/chapter.sgml 1.154 -> 1.156 book.sgml 1.173 -> 1.174 boot/chapter.sgml 1.65 -> 1.68 chapters.ent 1.38 -> 1.39 cutting-edge/chapter.sgml 1.231 -> 1.233 desktop/chapter.sgml 1.78 -> 1.85 disks/chapter.sgml 1.288 -> 1.290 dtrace/chapter.sgml 1.5 -> 1.7 eresources/chapter.sgml 1.195 -> 1.196 filesystems/chapter.sgml 1.4 -> 1.5 firewalls/chapter.sgml 1.85 -> 1.86 geom/chapter.sgml 1.43 -> 1.47 install/chapter.sgml 1.390 -> 1.392 introduction/chapter.sgml 1.126 -> 1.130 kernelconfig/chapter.sgml 1.186 -> 1.190 l10n/chapter.sgml 1.124 -> 1.126 mac/chapter.sgml 1.73 -> 1.74 mirrors/chapter.sgml 1.451 -> 1.455 network-servers/chapter.sgml 1.109 -> 1.113 ports/chapter.sgml 1.284 -> 1.286 preface/preface.sgml 1.41 -> 1.46 serialcomms/chapter.sgml 1.130 -> 1.133 updating/chapter.sgml 1.1 -> 1.2 vinum/chapter.sgml 1.45 -> 1.46 Obtained from: The FreeBSD Simplified Chinese Project
This commit is contained in:
parent
21b4554a6a
commit
42f55cdc02
Notes:
svn2git
2020-12-08 03:00:23 +00:00
svn path=/head/; revision=33598
26 changed files with 1367 additions and 804 deletions
zh_CN.GB2312/books/handbook
Makefile
advanced-networking
basics
book.sgmlboot
chapters.entcutting-edge
desktop
disks
dtrace
eresources
filesystems
firewalls
geom
install
introduction
kernelconfig
l10n
mac
mirrors
network-servers
ports
preface
serialcomms
updating
vinum
|
@ -3,7 +3,7 @@
|
|||
#
|
||||
# Build the FreeBSD Handbook (Simplified Chinese).
|
||||
#
|
||||
# Original revision: 1.111
|
||||
# Original revision: 1.112
|
||||
|
||||
# ------------------------------------------------------------------------
|
||||
#
|
||||
|
@ -238,7 +238,6 @@ SRCS+= preface/preface.sgml
|
|||
SRCS+= printing/chapter.sgml
|
||||
SRCS+= security/chapter.sgml
|
||||
SRCS+= serialcomms/chapter.sgml
|
||||
SRCS+= updating/chapter.sgml
|
||||
SRCS+= users/chapter.sgml
|
||||
SRCS+= vinum/chapter.sgml
|
||||
SRCS+= virtualization/chapter.sgml
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
The FreeBSD Documentation Project
|
||||
The FreeBSD Chinese Documentation Project
|
||||
|
||||
Original revision: 1.415
|
||||
Original revision: 1.419
|
||||
$FreeBSD$
|
||||
-->
|
||||
|
||||
|
@ -370,8 +370,9 @@ host2.example.com link#1 UC 0 0
|
|||
&man.route.8; 联机手册。</para>
|
||||
</sect2>
|
||||
|
||||
<sect2>
|
||||
<sect2 id="network-dual-homed-hosts">
|
||||
<title>重宿主机(Dual Homed Hosts)</title>
|
||||
|
||||
<indexterm><primary>重宿 主机</primary></indexterm>
|
||||
<para>还有一种其它的类型的配置是我们要提及的,
|
||||
这就是一个主机处于两个不同的网络。技术上,任何作为网关
|
||||
|
@ -410,6 +411,9 @@ host2.example.com link#1 UC 0 0
|
|||
设置成 <literal>1</literal>。如果您要临时地停止路由,
|
||||
您可以把它重设为 <literal>0</literal>。</para>
|
||||
|
||||
<indexterm><primary>BGP</primary></indexterm>
|
||||
<indexterm><primary>RIP</primary></indexterm>
|
||||
<indexterm><primary>OSPF</primary></indexterm>
|
||||
<para>新的路由器需要有路由才知道将数据传向何处。
|
||||
如果网络够简单,您可以使用静态路由。FreeBSD
|
||||
也自带一个标准的BSD路由选择守护进程 &man.routed.8;,
|
||||
|
@ -418,13 +422,9 @@ host2.example.com link#1 UC 0 0
|
|||
<filename role="package">net/zebra</filename> 包中得到。
|
||||
像 <application>&gated;</application>
|
||||
一样的商业产品也提供了更复杂的网络路由解决方案。</para>
|
||||
|
||||
<indexterm><primary>BGP</primary></indexterm>
|
||||
<indexterm><primary>RIP</primary></indexterm>
|
||||
<indexterm><primary>OSPF</primary></indexterm>
|
||||
</sect2>
|
||||
|
||||
<sect2>
|
||||
<sect2 id="network-static-routes">
|
||||
<sect2info>
|
||||
<authorgroup>
|
||||
<author>
|
||||
|
@ -563,7 +563,7 @@ route_net2="-net 192.168.1.0/24 192.168.1.1"</programlisting>
|
|||
</sect3>
|
||||
</sect2>
|
||||
|
||||
<sect2>
|
||||
<sect2 id="network-routing-propagation">
|
||||
<title>路由传播</title>
|
||||
<indexterm><primary>路由 传播</primary></indexterm>
|
||||
<para>我们已经讨论了如何定义通向外界的路由,
|
||||
|
@ -592,7 +592,7 @@ route_net2="-net 192.168.1.0/24 192.168.1.1"</programlisting>
|
|||
(以及进入的路径)。这就是路由传播。</para>
|
||||
</sect2>
|
||||
|
||||
<sect2>
|
||||
<sect2 id="network-routing-troubleshooting">
|
||||
<title>问题解答</title>
|
||||
<indexterm>
|
||||
<primary><command>traceroute</command></primary>
|
||||
|
@ -609,7 +609,7 @@ route_net2="-net 192.168.1.0/24 192.168.1.1"</programlisting>
|
|||
<para>想了解更多的信息,查看 &man.traceroute.8; 的手册。</para>
|
||||
</sect2>
|
||||
|
||||
<sect2>
|
||||
<sect2 id="network-routing-multicast">
|
||||
<title>多播路由</title>
|
||||
<indexterm>
|
||||
<primary>多播路由</primary>
|
||||
|
@ -3276,7 +3276,7 @@ Fa0/2 SA 32768 0005.5d71.8db8 29s 0x146 0x4 0x3D</screen
|
|||
|
||||
<para><application>ISC DHCP 3.0</application>
|
||||
并不属于基本系统。首先您需要安装
|
||||
<filename role="package">net/isc-dhcp3-server</filename>
|
||||
<filename role="package">net/isc-dhcp30-server</filename>
|
||||
port 或相应的<quote>包</quote>。</para>
|
||||
|
||||
<para>一旦安装了 <application>ISC DHCP</application>,
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
The FreeBSD Documentation Project
|
||||
The FreeBSD Simplified Chinese Project
|
||||
|
||||
Original Revision: 1.154
|
||||
Original Revision: 1.156
|
||||
$FreeBSD$
|
||||
-->
|
||||
|
||||
|
@ -690,12 +690,12 @@ root 5211 0.0 0.2 3620 1724 2 I+ 2:09AM 0:00.01 passwd</screen>
|
|||
可以在权限数值前面增加数字二 (2) 来运行 <command>chmod</command> 命令,
|
||||
如下面的例子所示:</para>
|
||||
|
||||
<screen>&prompt.root; <userinput>chmod 2755 suidexample.sh</userinput></screen>
|
||||
<screen>&prompt.root; <userinput>chmod 2755 sgidexample.sh</userinput></screen>
|
||||
|
||||
<para>可以用与前面类似的方法来检视新设定的生效情况, 在组权限的地方的
|
||||
<literal>s</literal> 表示这一配置已经生效:<para>
|
||||
|
||||
<screen>-rwxr-sr-x 1 trhodes trhodes 44 Aug 31 01:49 suidexample.sh</screen>
|
||||
<screen>-rwxr-sr-x 1 trhodes trhodes 44 Aug 31 01:49 sgidexample.sh</screen>
|
||||
|
||||
<note>
|
||||
<para>在这些例子中, 尽管 shell 脚本也属于可执行文件的一种,
|
||||
|
@ -2235,6 +2235,11 @@ Swap: 256M Total, 38M Used, 217M Free, 15% Inuse
|
|||
学习如<application>vim</application> 或 <application>emacs</application>
|
||||
这些有强大功能的编辑器用法,
|
||||
在长时间工作里会帮您节省不少的时间。</para>
|
||||
|
||||
<para>很多需要修改文件或打字输入的应用程序都会自动打开一个文本编辑器。
|
||||
更改默认使用的编辑器, 请设置 <envar>EDITOR</envar>
|
||||
环境变量。 参阅 <link linkend="shells">shells</link>
|
||||
以获取更多详细信息。</para>
|
||||
</sect1>
|
||||
|
||||
<sect1 id="basics-devices">
|
||||
|
|
|
@ -2,9 +2,8 @@
|
|||
The FreeBSD Documentation Project
|
||||
The FreeBSD Simplified Chinese Documentation Project
|
||||
|
||||
Original Revision: 1.173
|
||||
Original Revision: 1.174
|
||||
$FreeBSD$
|
||||
>>>>>>> 1.173
|
||||
-->
|
||||
|
||||
<!DOCTYPE BOOK PUBLIC "-//FreeBSD//DTD DocBook V4.1-Based Extension//EN" [
|
||||
|
@ -53,7 +52,6 @@
|
|||
<!ENTITY % chap.audit "IGNORE">
|
||||
<!ENTITY % chap.filesystems "IGNORE">
|
||||
<!ENTITY % chap.dtrace "IGNORE">
|
||||
<!ENTITY % chap.updating "IGNORE">
|
||||
|
||||
<!ENTITY % pgpkeys SYSTEM "../../../share/pgpkeys/pgpkeys.ent"> %pgpkeys;
|
||||
]>
|
||||
|
@ -307,7 +305,6 @@
|
|||
不需要以特定的顺序来阅读它们, 此外, 您开始在网络中使用 FreeBSD 之前也不必把它们都读完。</para>
|
||||
</partintro>
|
||||
|
||||
<![ %chap.updating; [ &chap.updating; ]]>
|
||||
<![ %chap.serialcomms; [ &chap.serialcomms; ]]>
|
||||
<![ %chap.ppp-and-slip; [ &chap.ppp-and-slip; ]]>
|
||||
<![ %chap.mail; [ &chap.mail; ]]>
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
The FreeBSD Documentation Project
|
||||
The FreeBSD Chinese (Simplified) Project
|
||||
|
||||
Original Revision: 1.65
|
||||
Original Revision: 1.68
|
||||
$FreeBSD$
|
||||
-->
|
||||
|
||||
|
@ -440,6 +440,160 @@ boot:</screen>
|
|||
</listitem>
|
||||
</itemizedlist>
|
||||
</sect3>
|
||||
|
||||
<sect3 id="boot-splash">
|
||||
<sect3info>
|
||||
<authorgroup>
|
||||
<author>
|
||||
<firstname>Joseph J.</firstname>
|
||||
<surname>Barbish</surname>
|
||||
<contrib>Contributed by </contrib>
|
||||
</author>
|
||||
</authorgroup>
|
||||
</sect3info>
|
||||
|
||||
<title>启动时的 Splash 图像</title>
|
||||
|
||||
<para>在启动时出现的 splash 图像比起原本的启动信息更加可视话。
|
||||
这个图像将被始终显示在屏幕上直到出现控制台的登录提示或者
|
||||
X 显示管理器提供了登录画面。</para>
|
||||
|
||||
<para>在 &os; 系统中有两个基本的环境。
|
||||
第一个是默认传统的控制台命令行环境。 在系统启动之后,
|
||||
会在控制台上出现一个登录提示。 第二个环境是 X11
|
||||
桌面图形环境。 在安装了 <link linkend="x-install">X11</link>
|
||||
和一种图形 <link linkend="x11-wm">桌面环境</link>,
|
||||
比如 <application>GNOME</application>,
|
||||
<application>KDE</application>, 或者
|
||||
<application>XFce</application>,
|
||||
X11 桌面可以用 <command>startx</command> 命令运行。</para>
|
||||
|
||||
<para>比起传统基于字符的登录提示,有些用户可能更喜欢 X11
|
||||
图形化的登录界面。 图形化的登录管理器像
|
||||
&xorg; 的 <application>XDM</application>,
|
||||
<application>GNOME</application> 的 <application>gdm</application>,
|
||||
<application>KDE</application> 的 <application>kdm</application>
|
||||
(还有其他 Port Collection 中的)
|
||||
基本上都提供了一个图形化的登录界面代替控制台上的登录提示符。
|
||||
在成功登录之后, 它们展现给用户一个图形化的桌面。</para>
|
||||
|
||||
<para>在命令行环境, splash
|
||||
图像将在显示登录提示符之前隐藏所有启动时的监测与任务启动的消息。
|
||||
在 X11 环境, 用户将会获得一个视觉上更加清爽启动体验,
|
||||
类似于某些像 (µsoft; &windows; 或者非 &unix; 类型的系统)
|
||||
用户所希望体验到的。</para>
|
||||
|
||||
<sect4 id="boot-splash-function">
|
||||
<title>Splash 图像功能</title>
|
||||
|
||||
<para>目前的 splash 图像的功能仅限于支持 256 色的位图
|
||||
(<filename>.bmp</filename>) 或者 ZSoft
|
||||
<acronym>PCX</acronym> (<filename>.pcx</filename>) 文件。
|
||||
此外, splash 图像文件的分辨率必须是 320x200 像素或者更少,
|
||||
才够能在标准 VGA 适配器上使用。</para>
|
||||
|
||||
<para>要使用尺寸更大的图像, 达到最大分辨率 1024x768 像素,
|
||||
则需开启 &os; 的 <acronym>VESA</acronym> 支持。
|
||||
这可以通过在系统启动时加载 <acronym>VESA</acronym> 模块完成,
|
||||
或者在内核配置文件中加入 <literal>VESA</literal> 选项并编译
|
||||
(参阅 <xref linkend="kernelconfig">)。 <acronym>VESA</acronym>
|
||||
支持给予了用户显示覆盖整个显示器的启动画面能力。</para>
|
||||
|
||||
<para>在启动的时候 splash 图像就会被显示在屏幕上,
|
||||
它可以在任何时候都按任意键关闭。</para>
|
||||
|
||||
<para>Splash 图像同样也会是 X11 之外默认的屏幕保护。
|
||||
在一段时间的闲置后,屏幕便会转为周期性的变换显示 splash 图像,
|
||||
从明亮至暗淡, 周而复始。 默认的 splash 图像 (屏幕保护)
|
||||
可由 <filename>/etc/rc.conf</filename> 中的
|
||||
<literal>saver=</literal> 选项控制。
|
||||
<literal>saver=</literal> 选项有一些内置的屏幕保护可供选择,
|
||||
完整的列表可以再 &man.splash.4; 手册页中找到。
|
||||
默认的屏幕保护被称为 <quote>warp</quote>。
|
||||
请注意在 <filename>/etc/rc.conf</filename> 中所指定
|
||||
<literal>saver=</literal> 选项仅限应用于虚拟控制台。
|
||||
对于 X11 图形化的登录管理器无效。</para>
|
||||
|
||||
<para>一些有关启动引导器的信息,
|
||||
包括启动选项菜单和一个定时倒数提示符都会在启动是显示,
|
||||
即是开启了 splash 图像功能。</para>
|
||||
|
||||
<para>splash 图像文件样本可以从
|
||||
<ulink url="http://www.bladwin.cx/splash/"></ulink> 下载。
|
||||
安装了 <filename role="package">sysutils/bsd-splash-changer</filename>
|
||||
port 之后, 每次启动的时候便能从集合中随机选择
|
||||
slash 图像。</para>
|
||||
|
||||
</sect4>
|
||||
|
||||
<sect4 id="boot-splash-enable">
|
||||
<title>开启 Splash 图像功能</title>
|
||||
|
||||
<para>Splash 图像 (<filename>.bmp</filename>) 或者
|
||||
(<filename>.pcx</filename>) 文件必须放置在 root 分区上,
|
||||
比如 <filename class="directory">/boot</filename> 目录。</para>
|
||||
|
||||
<para>对于默认的显示分辨率 (256 色,320x200 像素或更少)
|
||||
编辑 <filename>/boot/lodaer.conf</filename>,
|
||||
添加如下的设置:</para>
|
||||
|
||||
<programlisting>splash_bmp_load="YES"
|
||||
bitmap_load="YES"
|
||||
bitmap_name="<replaceable>/boot/splash.bmp</replaceable>"</programlisting>
|
||||
|
||||
<para>对于更高的分辨率,最大至 1024x768 像素,
|
||||
编辑 <filename>/boot/lodaer.conf</filename>,
|
||||
添加如下的设置:</para>
|
||||
|
||||
<programlisting>vesa_load="YES"
|
||||
splash_bmp_load="YES"
|
||||
bitmap_load="YES"
|
||||
bitmap_name="<replaceable>/boot/splash.bmp</replaceable>"</programlisting>
|
||||
|
||||
<para>以上这些设置假设
|
||||
<filename><replaceable>/boot/splash.bmp</replaceable></filename>
|
||||
为需要被使用的 splash 图像。 当需要使用 <acronym>PCX</acronym>
|
||||
文件的时候, 添加入下列设置, 根据分辨率的高低添加
|
||||
<literal>vesa_load="YES"</literal>。</para>
|
||||
<programlisting>splash_pcx_load="YES"
|
||||
bitmap_load="YES"
|
||||
bitmap_name="<replaceable>/boot/splash.pcx</replaceable>"</programlisting>
|
||||
|
||||
<para>文件名并不限于以上例子中的 <quote>splash</quote>。
|
||||
它可以是任何名称,只要是 <acronym>BMP</acronym> 或者
|
||||
<acronym>PCX</acronym> 类型的文件, 比如
|
||||
<filename><replaceable>splash_640x400</replaceable>.bmp</filename>
|
||||
或者
|
||||
<filename><replaceable>blue_wave</replaceable>.pcx</filename>.</para>
|
||||
|
||||
<para>一些有趣的 <filename>loader.conf</filename> 选项:</para>
|
||||
|
||||
<variablelist>
|
||||
<varlistentry>
|
||||
<term><literal>beastie_disable="YES"</literal></term>
|
||||
|
||||
<listitem>
|
||||
<para>这将关闭显示启动选项菜单,
|
||||
但是倒数记时仍然会出现。 即是在启动菜单选项被禁用的时候,
|
||||
在倒数记时段键入相应的启动选项仍然有效。</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term><literal>loader_logo="beastie"</literal></term>
|
||||
|
||||
<listitem>
|
||||
<para>这将替换启动选项菜单右侧默认显示的
|
||||
<quote>&os;</quote> 为彩色的小魔鬼标志,
|
||||
就像以往的发行版那样。</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
</variablelist>
|
||||
|
||||
<para>请参阅 &man.splash.4;, &man.loader.conf.5; 和
|
||||
&man.vga.4; 手册页获取更多详细信息。</para>
|
||||
</sect4>
|
||||
</sect3>
|
||||
</sect2>
|
||||
</sect1>
|
||||
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
|
||||
Chapters should be listed in the order in which they are referenced.
|
||||
|
||||
Original revision: 1.38
|
||||
Original revision: 1.39
|
||||
$FreeBSD$
|
||||
-->
|
||||
|
||||
|
@ -44,7 +44,6 @@
|
|||
<!ENTITY chap.dtrace SYSTEM "dtrace/chapter.sgml">
|
||||
|
||||
<!-- Part four -->
|
||||
<!ENTITY chap.updating SYSTEM "updating/chapter.sgml">
|
||||
<!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">
|
||||
|
|
|
@ -2,11 +2,11 @@
|
|||
The FreeBSD Documentation Project
|
||||
The FreeBSD Simplified Chinese Project
|
||||
|
||||
Original Revision: 1.231
|
||||
Original Revision: 1.233
|
||||
$FreeBSD$
|
||||
-->
|
||||
|
||||
<chapter id="cutting-edge">
|
||||
<chapter id="updating-upgrading">
|
||||
<chapterinfo>
|
||||
<authorgroup>
|
||||
<author>
|
||||
|
@ -51,29 +51,48 @@
|
|||
<!-- with feedback from various others -->
|
||||
</chapterinfo>
|
||||
|
||||
<title>最前沿</title>
|
||||
<title>更新与升级 &os;</title>
|
||||
|
||||
<sect1 id="cutting-edge-synopsis">
|
||||
<sect1 id="updating-upgrading-synopsis">
|
||||
<title>概述</title>
|
||||
|
||||
<para>&os; 在两个发行版之间都有着持续的发展。
|
||||
对于喜欢冒险的人来说,有几种机制让您的系统与最新的发展保持同步。
|
||||
警告—冒险并不适合每一个人!
|
||||
本章将有助于您决定是紧跟最新发展还是坚持发行版。</para>
|
||||
<para>&os; 在发行版之间始终是持续开发的。 一些人喜欢使用官方发行的版本,
|
||||
另一些喜欢与最新的开发保持同步。 然而,
|
||||
即使是官方的发行版本也常常需要安全补丁和重大修正方面的更新。
|
||||
不论你使用了何种版本, &os; 都提供了所有更新系统所需的工具,
|
||||
让你轻松的在不同版本间升级。
|
||||
这一章节将帮助你决定是跟踪开发系统还是坚持使用某个发行的版本。
|
||||
同时还列出了一些保持系统更新所需的基本工具。</para>
|
||||
|
||||
<para>读了本章后,您将了解到:</para>
|
||||
|
||||
<itemizedlist>
|
||||
<listitem><para>&os.stable; 和 &os.current;两个开发分支的不同点。</para>
|
||||
</listitem>
|
||||
<listitem><para>怎样使用<application>CVSup</application>,
|
||||
<application>CVS</application>或
|
||||
<application>CTM</application>保持您的系统更新。</para>
|
||||
</listitem>
|
||||
<listitem><para>如何使用 <command>make buildworld</command>
|
||||
等命令来重新编译和安装基本系统。</para>
|
||||
<listitem>
|
||||
<para>使用哪些工具来更新系统与 Ports Collection。</para>
|
||||
</listitem>
|
||||
|
||||
<listitem>
|
||||
<para>如何使用
|
||||
<application>freebsd-update</application>,
|
||||
<application>CVSup</application>,
|
||||
<application>CVS</application>, or
|
||||
<application>CTM</application>
|
||||
让你的系统保持更新。</para>
|
||||
</listitem>
|
||||
|
||||
<listitem>
|
||||
<para>如何比较已安装的系统与原来已知拷贝的状态。</para>
|
||||
</listitem>
|
||||
|
||||
<listitem>
|
||||
<para>两个开发分支 &os.stable; 和 &os.current;
|
||||
的区别。</para>
|
||||
</listitem>
|
||||
|
||||
<listitem>
|
||||
<para>如何通过 <command>make buildworld</command>
|
||||
重新编译安装整个基本系统(等等)。</para>
|
||||
</listitem>
|
||||
</itemizedlist>
|
||||
|
||||
<para>在读本章这前,您应该了解的:</para>
|
||||
|
@ -98,14 +117,428 @@
|
|||
</note>
|
||||
</sect1>
|
||||
|
||||
<sect1 id="current-stable">
|
||||
<title>&os.current; 和 &os.stable; 的对比</title>
|
||||
<indexterm><primary>CURRENT</primary></indexterm>
|
||||
<indexterm><primary>STABLE</primary></indexterm>
|
||||
<sect1 id="updating-upgrading-freebsdupdate">
|
||||
<sect1info>
|
||||
<authorgroup>
|
||||
<author>
|
||||
<firstname>Tom</firstname>
|
||||
<surname>Rhodes</surname>
|
||||
<contrib>Written by </contrib>
|
||||
</author>
|
||||
</authorgroup>
|
||||
<authorgroup>
|
||||
<author>
|
||||
<firstname>Colin</firstname>
|
||||
<surname>Percival</surname>
|
||||
<contrib>Based on notes provided by </contrib>
|
||||
</author>
|
||||
</authorgroup>
|
||||
</sect1info>
|
||||
<title>FreeBSD 更新</title>
|
||||
|
||||
<para>FreeBSD有两个开发分支:&os.current; 和 &os.stable;。
|
||||
这部分将对它们都做些说明, 并介绍您的系统如何与各自的树一同保持最新。
|
||||
我们将首先讨论 &os.current;, 随后讨论 &os.stable;。</para>
|
||||
<indexterm><primary>Updating and Upgrading</primary></indexterm>
|
||||
<indexterm>
|
||||
<primary>freebsd-update</primary>
|
||||
<see>updating-upgrading</see>
|
||||
</indexterm>
|
||||
|
||||
<para>打安全补丁是对于维护计算机软件的一个重要部分,
|
||||
特别是对于操作系统。对于 &os; 来说,
|
||||
很长的一段时间以来这都不是一件容易的事情。
|
||||
补丁打在源代码上,代码需要被重新编译为二进制,
|
||||
然后再重新安装编译后的程序。</para>
|
||||
|
||||
<para>&os; 引入了 <command>freebsd-update</command>
|
||||
工具之后这便不再是问题了。这个工具提供了 2 种功能。
|
||||
第一,它可以把二进制的安全和勘误更新直接应用于 &os;
|
||||
的基本系统,而不需要重新编译和安装。第二,
|
||||
这个工具还支持主要跟次要的发行版的升级。</para>
|
||||
|
||||
<note>
|
||||
<para>由安全小组支持的各种体系结构和发行版都可使用二进制更新。
|
||||
然而有些特性,比如升级 &os; 操作系统需要最近的 &man.freebsd-update.8;
|
||||
和 &os; 6.3。在升级到一个新的发行版本之前,
|
||||
应先阅读一下当前发行版的声明,
|
||||
因为他们可能包含有关于你期望升级版本的重要消息。
|
||||
这些发行声明可以通过以下链接查阅:
|
||||
<ulink url="http://www.FreeBSD.org/releases/"></ulink>。</para>
|
||||
</note>
|
||||
|
||||
<para>如果 <command>crontab</command> 中存在有用到
|
||||
<command>freebsd-update</command> 特性的部分,
|
||||
那么这些在开始以下操作前必须先被禁止。</para>
|
||||
|
||||
<sect2>
|
||||
<title>配置文件</title>
|
||||
|
||||
<para>有些用户可能希望调整配置文件来更好的控制升级过程。
|
||||
可用参数的文档非常齐全,
|
||||
但下面的这些可能需要进一步的解释:</para>
|
||||
|
||||
<programlisting># Components of the base system which should be kept updated.
|
||||
Components src world kernel</programlisting>
|
||||
|
||||
<para>这个参数是控制 &os; 的哪一部分将被保持更新。
|
||||
默认的是更新源代码,整个基本系统还有内核。
|
||||
这些部件跟安装时的那些相同,举例来说,
|
||||
在这里加入 “world/games” 就会允许打入游戏相关的补丁。
|
||||
使用 “src/bin” 则是允许更新
|
||||
<filename class="directory">src/bin</filename>
|
||||
目录中的源代码。</para>
|
||||
|
||||
<para>最好的选择是把这个选项保留为默认值,
|
||||
因为如果要修改它去包含一些指定的选项,
|
||||
就需要用户列出每一个想要更新的项目。
|
||||
这可能会引起可怕的后果,
|
||||
因为部分的源代码和二进制程序得不到同步。</para>
|
||||
|
||||
<programlisting># Paths which start with anything matching an entry in an IgnorePaths
|
||||
# statement will be ignored.
|
||||
IgnorePaths</programlisting>
|
||||
|
||||
<para>添加路径,比如
|
||||
<filename class="directory">/bin</filename> 或者
|
||||
<filename class="directory">/sbin</filename>
|
||||
让这些指定的目录在更新过程中不被修改。
|
||||
这个选项能够防止本地的修改被
|
||||
<command>freebsd-update</command> 覆盖。</para>
|
||||
|
||||
<programlisting># Paths which start with anything matching an entry in an UpdateIfUnmodified
|
||||
# statement will only be updated if the contents of the file have not been
|
||||
# modified by the user (unless changes are merged; see below).
|
||||
UpdateIfUnmodified /etc/ /var/ /root/ /.cshrc /.profile</programlisting>
|
||||
|
||||
<para>更新指定目录中的未被修改的配置文件。
|
||||
用户的任何修改都会使这些文件的自动更新失效。
|
||||
还有另外一个选项,
|
||||
<literal>KeepModifiedMetadata</literal>,
|
||||
这个能让 <command>freebsd-update</command>
|
||||
在合并时保存修改。</para>
|
||||
|
||||
<programlisting># When upgrading to a new &os; release, files which match MergeChanges
|
||||
# will have any local changes merged into the version from the new release.
|
||||
MergeChanges /etc/ /var/named/etc/</programlisting>
|
||||
|
||||
<para>一个 <command>freebsd-update</command>
|
||||
应该尝试合并的配置文件的列表。文件合并的过程是
|
||||
一系列的 &man.diff.1; 补丁类似于更少选项的 &man.mergemaster.8;
|
||||
合并的选项是接受,打开一个文本编辑器,或者
|
||||
<command>freebsd-update</command> 会被中止。
|
||||
在不能确定的时候,请先备份 <filename class="directory">/etc</filename>
|
||||
然后接受合并。更多关于 <command>mergemaster</command>
|
||||
的信息请参阅 <xref linkend="mergemaster">。</para>
|
||||
|
||||
<programlisting># Directory in which to store downloaded updates and temporary
|
||||
# files used by &os; Update.
|
||||
# WorkDir /var/db/freebsd-update</programlisting>
|
||||
|
||||
<para>这个目录是放置所有补丁和临时文件的。
|
||||
用户做一个版本升级的话,请确认此处至少有 1 GB
|
||||
的可用磁盘空间。</para>
|
||||
|
||||
<programlisting># When upgrading between releases, should the list of Components be
|
||||
# read strictly (StrictComponents yes) or merely as a list of components
|
||||
# which *might* be installed of which &os; Update should figure out
|
||||
# which actually are installed and upgrade those (StrictComponents no)?
|
||||
# StrictComponents no</programlisting>
|
||||
|
||||
<para>当设置成 <literal>yes</literal> 时,
|
||||
<command>freebsd-udpate</command> 将假设这个
|
||||
<literal>Components</literal> 列表时完整的,
|
||||
并且对此列表以外的项目不会修改。实际上就是
|
||||
<command>freebsd-update</command> 会尝试更新
|
||||
<literal>Componets</literal>
|
||||
列表里的每一个文件。</para>
|
||||
</sect2>
|
||||
|
||||
<sect2>
|
||||
<title>安全补丁</title>
|
||||
|
||||
<para>安全补丁存储在远程的机器上,
|
||||
可以使用如下的命令下载并安装:</para>
|
||||
|
||||
<screen>&prompt.root; <userinput>freebsd-update fetch</userinput>
|
||||
&prompt.root; <userinput>freebsd-update install</userinput></screen>
|
||||
|
||||
<para>如果给内核打了补丁,那么系统需要重新启动。
|
||||
如果一切都进展顺利,系统就应该被打好了补丁而且
|
||||
<command>freebsd-update</command> 可由夜间
|
||||
&man.cron.8; 执行。在 <filename>/etc/crontab</filename>
|
||||
中加入以下条目足以完成这项任务:</para>
|
||||
|
||||
<programlisting>@daily root freebsd-update cron</programlisting>
|
||||
|
||||
<para>这条记录是说明每天运行一次
|
||||
<command>freebsd-update</command>。用这种方法,
|
||||
使用了 <option>cron</option> 参数,
|
||||
<command>freebsd-update</command> 仅检查是否存在更新。
|
||||
如果有了新的补丁,就会自动下载到本地的磁盘,
|
||||
但不会自动给系统打上。<username>root</username>
|
||||
会收到一封电子邮件告知需手动安装补丁。</para>
|
||||
|
||||
<para>如果出现了错误,可以使用下面的
|
||||
<command>freebsd-update</command>
|
||||
命令回退到上一次的修改:</para>
|
||||
|
||||
<screen>&prompt.root; <userinput>freebsd-update rollback</userinput></screen>
|
||||
|
||||
<para>完成以后如果内核或任何的内核模块被修改的话,
|
||||
就需要重新启动系统。这将使 &os;
|
||||
装载新的二进制程序进内存。</para>
|
||||
|
||||
<note>
|
||||
<para><command>freebsd-update</command> 只能应用于
|
||||
<filename>GENERIC</filename> 内核。如果对
|
||||
<filename>GENERIC</filename>
|
||||
做了任何修改或者安装了一个自行编译的内核,
|
||||
<command>freebsd-update</command>
|
||||
就无法完成升级 — 如前一个范例那样失败后
|
||||
产生一条错误信息。</para>
|
||||
</note>
|
||||
</sect2>
|
||||
|
||||
<sect2>
|
||||
<title>重大和次要的更新</title>
|
||||
|
||||
<para>这个过程会删除旧的目标文件和库,
|
||||
这将使大部分的第三方应用程序无法删除。
|
||||
建议将所有安装的 ports 先删除然后重新安装,或者稍后使用
|
||||
<filename role="package">ports-mgmt/portupgrade</filename>
|
||||
工具升级。 大多数用户将会使用如下命令尝试编译:</para>
|
||||
|
||||
<screen>&prompt.root; <userinput>portupgrade -af</userinput></screen>
|
||||
|
||||
<para>这将确保所有的东西都会被正确的重新安装。
|
||||
请注意环境变量 <makevar>BATCH</makevar> 设置成
|
||||
<literal>yes</literal> 的话将在整个过程中对所有询问回答
|
||||
<literal>yes</literal>,这会帮助在编译过程中免去人工的介入。</para>
|
||||
|
||||
<para>重大和次要的更新可以由
|
||||
<command>freebsd-update</command> 命令后指定一个发行版本来执行,
|
||||
举例来说,下面的命令将帮助你升级到 &os; 6.3:</para>
|
||||
|
||||
<screen>&prompt.root; <userinput>freebsd-update -r 6.3-RELEASE upgrade</userinput></screen>
|
||||
|
||||
<para>在这个命令被执行后,<command>freebsd-update</command>
|
||||
将会先解析配置文件和评估当前的系统以获得更新系统所需的必要信息。
|
||||
然后便会显示出一个包含了已检测到与未检测到的组件列表。
|
||||
例如:</para>
|
||||
|
||||
<screen>Looking up update.FreeBSD.org mirrors... 1 mirrors found.
|
||||
Fetching metadata signature for 6.3-BETA1 from update1.FreeBSD.org... done.
|
||||
Fetching metadata index... done.
|
||||
Inspecting system... done.
|
||||
|
||||
The following components of FreeBSD seem to be installed:
|
||||
kernel/smp src/base src/bin src/contrib src/crypto src/etc src/games
|
||||
src/gnu src/include src/krb5 src/lib src/libexec src/release src/rescue
|
||||
src/sbin src/secure src/share src/sys src/tools src/ubin src/usbin
|
||||
world/base world/info world/lib32 world/manpages
|
||||
|
||||
The following components of FreeBSD do not seem to be installed:
|
||||
kernel/generic world/catpages world/dict world/doc world/games
|
||||
world/proflibs
|
||||
|
||||
Does this look reasonable (y/n)? y</screen>
|
||||
|
||||
<para>此时,<command>freebsd-update</command>
|
||||
将会尝试下载所有升级所需的文件。在某些情况下,
|
||||
用户可能被问及需安装些什么和如何进行之类的问题。<para>
|
||||
|
||||
<para>下载完所有的补丁之后,它们很快就会被打上。
|
||||
这个过程可能会持续一段时间,取决与机器的速度和当前的负载情况。
|
||||
配置文件将会被合并 — 这一部分需要用户的参与,
|
||||
因为文件可能被合并或者屏幕上弹出了一个文本编辑器用来手工合并。
|
||||
在处理过程中,每一个成功的合并都会给用户显示出来。
|
||||
失败或者被忽略的合并则会引起合并程序的中止。
|
||||
用户可能想要备份一下 <filename class="directory">/etc</filename>
|
||||
之后手工合并重要的文件,比如
|
||||
<filename>master.passwd</filename> 或
|
||||
<filename>group</filename>。</para>
|
||||
|
||||
<note>
|
||||
<para>系统至此还没有被修改,所有的补丁和合并都在另外一个目录中进行。
|
||||
当所有的补丁都被成功的打上了以后,所有的配置文件都被合并后,
|
||||
我们就已经完成了整个升级过程中最困难的部分,
|
||||
下面就需要用户来安装这些变更了。</para>
|
||||
</note>
|
||||
|
||||
<para>一旦这个步骤完成后,使用如下的命令将升级后的文件安装到磁盘上。</para>
|
||||
|
||||
<screen>&prompt.root; <userinput>freebsd-update install</userinput></screen>
|
||||
|
||||
<para>内核与内核模块会先被打上补丁。此时机器必须要重新启动。
|
||||
使用下面的命令重启机器,这样新的内核将载入内存:</para>
|
||||
|
||||
<screen>&prompt.root; <userinput>shutdown -r now</userinput></screen>
|
||||
|
||||
<para>在系统重新上线后,需要再次运行 <command>freebsd-update</command>。
|
||||
升级的状态被保存着,这样 <command>freebsd-update</command>
|
||||
就无需重头开始,但是会删除所有旧的共享库和目标文件。
|
||||
执行如下命令继续这个阶段的升级:</para>
|
||||
|
||||
<screen>&prompt.root; <userinput>freebsd-update install</userinput></screen>
|
||||
|
||||
<note>
|
||||
<para>取决与是否有库的版本更新,通常只有 2 个而不是
|
||||
3 个安装阶段。</para>
|
||||
</note>
|
||||
|
||||
<para>现在需要重新编译和安装第三方软件。
|
||||
这么做的原因是某些已安装的软件可能依赖于在升级过程中已删除的库。
|
||||
可使用 <filename role="package">ports-mgmt/portupgrade</filename>
|
||||
自动化这个步骤,以如下的命令开始:</para>
|
||||
|
||||
<screen>&prompt.root; <userinput>portupgrade -f ruby</userinput>
|
||||
&prompt.root; <userinput>rm /var/db/pkg/pkgdb.db</userinput>
|
||||
&prompt.root; <userinput>portupgrade -f ruby18-bdb</userinput>
|
||||
&prompt.root; <userinput>rm /var/db/pkg/pkgdb.db /usr/ports/INDEX-*.db</userinput>
|
||||
&prompt.root; <userinput>portupgrade -af</userinput></screen>
|
||||
|
||||
<para>一旦这个完成了以后,再最后一次运行
|
||||
<command>freebsd-update</command> 来结束升级过程。
|
||||
执行如下命令处理升级中的所有细节:</para>
|
||||
|
||||
<screen>&prompt.root; <userinput>freebsd-update install</userinput></screen>
|
||||
|
||||
<para>重新启动机器进入新版本的 &os; 升级过程至此就完成了。</para>
|
||||
</sect2>
|
||||
|
||||
<sect2>
|
||||
<title>系统状态对照</title>
|
||||
|
||||
<para><command>freebsd-update</command>
|
||||
工具也可被用来对着一个已知完好的 &os; 拷贝测试当前的版本。
|
||||
这个选项评估当前的系统工具,库和配置文件。
|
||||
使用以下的命令开始对照:</para>
|
||||
|
||||
<screen>&prompt.root; <userinput>freebsd-update IDS >> outfile.ids</userinput></screen>
|
||||
|
||||
<warning>
|
||||
<para>这个命令的名称是 <acronym>IDS</acronym>,
|
||||
它并不是一个像
|
||||
<filename role="package">security/snort</filename>
|
||||
这样的入侵检测系统的替代品。因为
|
||||
<command>freebsd-update</command> 在磁盘上存储数据,
|
||||
很显然它们有被篡改的可能。
|
||||
当然也可以使用一些方法来降低被篡改的可能性,比如设置
|
||||
<varname>kern.securelevel</varname> 和不使用时把
|
||||
<command>freebsd-update</command>
|
||||
数据放在只读文件系统上,例如 <acronym>DVD</acronym> 或
|
||||
安全存放的外置 <acronym>USB</acronym> 磁盘上。
|
||||
</warning>
|
||||
|
||||
<para>现在系统将会被检查,生成一份包含了文件和它们的 &man.sha256.1;
|
||||
哈希值的清单,已知发行版中的值与当前系统中安装的值将会被打印到屏幕上。
|
||||
这就是为什么输出被送到了 <filename>outfile.ids</filename> 文件。
|
||||
它滚动的太块无法用肉眼对照,而且会很快填满控制台的缓冲区。</para>
|
||||
|
||||
<para>这个文件中有非常长的行,但输出的格式很容易分析。
|
||||
举例来说,要获得一份与发行版中不同哈希值的文件列表,
|
||||
已可使用如下的命令:</para>
|
||||
|
||||
<screen>&prompt.root; <userinput>cat outfile.ids | awk '{ print $1 }' | more</userinput>
|
||||
/etc/master.passwd
|
||||
/etc/motd
|
||||
/etc/passwd
|
||||
/etc/pf.conf</screen>
|
||||
|
||||
<para>这份输出时删节缩短后的,其实是有更多的文件。
|
||||
其中有些文件并非人为修改,比如
|
||||
<filename>/etc/passwd</filename>
|
||||
被修改是因为添加了用户进系统。在某些情况下,
|
||||
还有另外的一些文件,诸如内核模块与
|
||||
<command>freebsd-update</command> 的不同是因为它们被更新过了。
|
||||
为了指定的文件或目录排除在外,把它们加到
|
||||
<filename>/etc/freebsd-update.conf</filename> 的
|
||||
<literal>IDSIgnorePaths</literal> 选项中。</para>
|
||||
|
||||
<para>除了前面讨论过的部分之外,
|
||||
这也能被当作是对升级方法的详细补充。</para>
|
||||
</sect2>
|
||||
</sect1>
|
||||
|
||||
<sect1 id="updating-upgrading-portsnap">
|
||||
<sect1info>
|
||||
<authorgroup>
|
||||
<author>
|
||||
<firstname>Tom</firstname>
|
||||
<surname>Rhodes</surname>
|
||||
<contrib>Written by </contrib>
|
||||
</author>
|
||||
</authorgroup>
|
||||
<authorgroup>
|
||||
<author>
|
||||
<firstname>Colin</firstname>
|
||||
<surname>Percival</surname>
|
||||
<contrib>Based on notes provided by </contrib>
|
||||
</author>
|
||||
</authorgroup>
|
||||
</sect1info>
|
||||
<title>Portsnap: 一个 Ports Collection 更新工具</title>
|
||||
|
||||
<indexterm><primary>Updating and Upgrading</primary></indexterm>
|
||||
<indexterm>
|
||||
<primary>Portsnap</primary>
|
||||
<see>Updating and Upgrading</see>
|
||||
</indexterm>
|
||||
|
||||
<para>&os; 基本系统也包括了一个更新 Ports Collection 的工具:
|
||||
&man.portsnap.8;。在运行之后,它会连上一个远程网站,
|
||||
校验安全密钥,然后下载一份 Ports Collection 的拷贝。
|
||||
密钥是用来校验所有下载文件的完整性,确保它们在传输是未被修改。
|
||||
使用以下的命令下载最新的 Ports Collection:</para>
|
||||
|
||||
<screen>&prompt.root; <userinput>portsnap fetch</userinput>
|
||||
Looking up portsnap.FreeBSD.org mirrors... 3 mirrors found.
|
||||
Fetching snapshot tag from portsnap1.FreeBSD.org... done.
|
||||
Fetching snapshot metadata... done.
|
||||
Updating from Wed Aug 6 18:00:22 EDT 2008 to Sat Aug 30 20:24:11 EDT 2008.
|
||||
Fetching 3 metadata patches.. done.
|
||||
Applying metadata patches... done.
|
||||
Fetching 3 metadata files... done.
|
||||
Fetching 90 patches.....10....20....30....40....50....60....70....80....90. done.
|
||||
Applying patches... done.
|
||||
Fetching 133 new ports or files... done.</screen>
|
||||
|
||||
<para>这个例子展示的是 &man.portsnap.8;
|
||||
发现并校验了几个用于当前 ports 的补丁。这还表明以前运行过,
|
||||
如果是第一次运行的话,那么仅仅只会下载 Ports Collection。</para>
|
||||
|
||||
<para>在 &man.portsnap.8; 成功完成一次
|
||||
<command>fetch</command> 操作后,而且本地系统上的 Ports Collection
|
||||
和随之而来的补丁通过校验以后。键入以下命令安装更新文件:</para>
|
||||
|
||||
<screen>&prompt.root; <userinput>portsnap extract</userinput>
|
||||
/usr/ports/.cvsignore
|
||||
/usr/ports/CHANGES
|
||||
/usr/ports/COPYRIGHT
|
||||
/usr/ports/GIDs
|
||||
/usr/ports/KNOBS
|
||||
/usr/ports/LEGAL
|
||||
/usr/ports/MOVED
|
||||
/usr/ports/Makefile
|
||||
/usr/ports/Mk/bsd.apache.mk
|
||||
/usr/ports/Mk/bsd.autotools.mk
|
||||
/usr/ports/Mk/bsd.cmake.mk
|
||||
<replaceable>...</replaceable></screen>
|
||||
|
||||
<para>至此更新就完成了,然后便可以使用更新后的
|
||||
Ports Collection 来安装或升级应用程序。</para>
|
||||
|
||||
<para>可以使用如下的命令让这个过程连续的运行:</para>
|
||||
|
||||
<screen>&prompt.root; <userinput>portsnap fetch update</userinput></screen>
|
||||
</sect1>
|
||||
|
||||
<sect1 id="current-stable">
|
||||
<title>追踪开发分支/title>
|
||||
<indexterm><primary>-CURRENT</primary></indexterm>
|
||||
<indexterm><primary>-STABLE</primary></indexterm>
|
||||
|
||||
<para>FreeBSD 有两个开发分支: &os.current; 和 &os.stable;。
|
||||
这一章节将对每个分支作相应介绍与如何保持你的系统更新。
|
||||
我们将先介绍 &os.current; 然后是 &os.stable;。</para>
|
||||
|
||||
<sect2 id="current">
|
||||
<title>使用最新的 &os; CURRENT</title>
|
||||
|
@ -773,7 +1206,7 @@
|
|||
&prompt.root; <userinput>rm -rf *</userinput></screen>
|
||||
</sect2>
|
||||
|
||||
<sect2 id="cutting-edge-compilebase">
|
||||
<sect2 id="updating-upgrading-compilebase">
|
||||
<title>重新编译基本系统</title>
|
||||
|
||||
<sect3>
|
||||
|
@ -1083,7 +1516,7 @@ Script done, …</screen>
|
|||
<filename>/etc</filename> 有的,而 <filename>/usr/src/etc</filename> 里边没有。</para>
|
||||
|
||||
<para>如果您使用 &man.mergemaster.8; (作为推荐),您可以向前跳到
|
||||
<link linkend="cutting-edge-rebooting">下一节</link>。</para>
|
||||
<link linkend="updating-upgrading-rebooting">下一节</link>。</para>
|
||||
|
||||
<para>手工做最简单的方式是安装这些文件到一个新的目录,完成后再来查找不同处。</para>
|
||||
|
||||
|
@ -1209,7 +1642,7 @@ Script done, …</screen>
|
|||
</sect3>
|
||||
</sect2>
|
||||
|
||||
<sect2 id="cutting-edge-rebooting">
|
||||
<sect2 id="updating-upgrading-rebooting">
|
||||
<title>重启</title>
|
||||
|
||||
<para>现在完成了。在您检查所有内容都放置正确后,
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
The FreeBSD Documentation Project
|
||||
The FreeBSD Chinese Project
|
||||
|
||||
Original Revision: 1.78
|
||||
Original Revision: 1.85
|
||||
$FreeBSD$
|
||||
-->
|
||||
|
||||
|
@ -45,9 +45,8 @@
|
|||
|
||||
<itemizedlist>
|
||||
<listitem>
|
||||
<para>浏览器 (例如 <application>Mozilla</application>、
|
||||
<para>浏览器 (例如 <application>Firefox</application>、
|
||||
<application>Opera</application>、
|
||||
<application>Firefox</application>、
|
||||
<application>Konqueror</application>)</para>
|
||||
</listitem>
|
||||
|
||||
|
@ -128,9 +127,9 @@
|
|||
|
||||
<tbody>
|
||||
<row>
|
||||
<entry><application>Mozilla</application></entry>
|
||||
<entry>多</entry>
|
||||
<entry>大量时间和空间</entry>
|
||||
<entry><application>Firefox</application></entry>
|
||||
<entry>中等</entry>
|
||||
<entry>长</entry>
|
||||
<entry><application>Gtk+</application></entry>
|
||||
</row>
|
||||
|
||||
|
@ -159,85 +158,46 @@
|
|||
</tgroup>
|
||||
</informaltable>
|
||||
|
||||
<sect2>
|
||||
<title>Mozilla</title>
|
||||
<indexterm>
|
||||
<primary><application>Mozilla</application></primary>
|
||||
</indexterm>
|
||||
|
||||
<para><application>Mozilla</application> 是一个完全移植到 FreeBSD
|
||||
上的现代化的、 稳定的浏览器。 它拥有非常合乎标准的 HTML 支持,
|
||||
它也能处理邮件和阅读新闻组。
|
||||
假如您打算做一个自己的主页的话,它甚至提供一个 HTML 编辑器。
|
||||
<application>&netscape;</application> 的使用者可能觉得它和
|
||||
<application>Communicator</application> 非常相似,
|
||||
两者有些部分实际上是相通的。</para>
|
||||
|
||||
<para>在 CPU 速度低于 233MHz 或者内存少于 64MB
|
||||
的老式电脑上,<application>Mozilla</application>
|
||||
会占用相当多资源而难以使用。您也许可以试试
|
||||
<application>Opera</application> 浏览器,本章稍后将会介绍它。</para>
|
||||
|
||||
<para>也许基于某种原因,您不能或者不想编译
|
||||
<application>Mozilla</application>,FreeBSD GNOME 团队已经为您制作好了
|
||||
package。只需要通过网络安装它:</para>
|
||||
|
||||
<screen>&prompt.root; <userinput>pkg_add -r mozilla</userinput></screen>
|
||||
|
||||
<para>如果没 package 可用,而您又有足够的时间和磁盘空间,您可以获取
|
||||
<application>Mozilla</application> 的源码来编译并安装它到您的系统上。
|
||||
执行以下指令既可:</para>
|
||||
|
||||
<screen>&prompt.root; <userinput>cd /usr/ports/www/mozilla</userinput>
|
||||
&prompt.root; <userinput>make install clean</userinput></screen>
|
||||
|
||||
<para><application>Mozilla</application> 需要 <username>root</username>
|
||||
权限执行 chrom 注册来确定正确的初始化。另外,
|
||||
如果您想要一些额外的插件比如象 mouse gestures,您也必须以
|
||||
<username>root</username> 权限执行 <application>Mozilla</application>
|
||||
以便正确的安装。</para>
|
||||
|
||||
<para>一旦您完成了 <application>Mozilla</application> 安装,您就再也不需要
|
||||
<username>root</username> 权限了。您可以用如下方式执行
|
||||
<application>Mozilla</application>:</para>
|
||||
|
||||
<screen>&prompt.user; <userinput>mozilla</userinput></screen>
|
||||
|
||||
<para>也可以用如下方式直接运行电子邮件和新闻阅读器:</para>
|
||||
|
||||
<screen>&prompt.user; <userinput>mozilla -mail</userinput></screen>
|
||||
</sect2>
|
||||
|
||||
<sect2>
|
||||
<title>Firefox</title>
|
||||
<indexterm>
|
||||
<primary><application>Firefox</application></primary>
|
||||
</indexterm>
|
||||
|
||||
<para><application>Firefox</application> 是基于 <application>Mozilla</application>
|
||||
代码系的下一代浏览器。 <application>Mozilla</application>
|
||||
是一个完整的应用程序套件, 包含了浏览器、 邮件客户端、
|
||||
聊天客户端等等。 而 <application>Firefox</application>
|
||||
则只是一个浏览器, 这使得它体积更小并且执行速度更快。</para>
|
||||
<para><application>Firefox</application> 是一个现代, 自由,
|
||||
开放源代码稳定的浏览器, 并完全移植到了 &os; 上:
|
||||
它的特性包括有一个非常标准的 HTML 显示引擎,
|
||||
标签式浏览, 弹出窗口阻止, 扩展插件, 改进的安全性, 等等。
|
||||
<application>Firefox</application> 是基于
|
||||
<application>Mozilla</application> 的代码。</para>
|
||||
|
||||
<para>您可以通过输入下面的命令来安装预编译的包:</para>
|
||||
|
||||
<screen>&prompt.root; <userinput>pkg_add -r firefox</userinput></screen>
|
||||
|
||||
<para>如果您喜欢从源代码编译, 则可以使用 Ports
|
||||
套件来完成这项工作:</para>
|
||||
<para>这将会安装 <application>Firefox</application> 2.X,
|
||||
如果你希望运行 <application>Firefox</application> 3.X,
|
||||
则执行如下的命令:</para>
|
||||
|
||||
<screen>&prompt.root; <userinput>pkg_add -r firefox3</userinput></screen>
|
||||
|
||||
<para>如果你希望从源代码编译的话,
|
||||
可以通过 Ports Collection 安装:</para>
|
||||
|
||||
<screen>&prompt.root; <userinput>cd /usr/ports/www/firefox</userinput>
|
||||
&prompt.root; <userinput>make install clean</userinput></screen>
|
||||
|
||||
<para>For <application>Firefox</application> 3.X, in the
|
||||
previous command replace <literal>firefox</literal> with
|
||||
<literal>firefox3</literal>.</para>
|
||||
</sect2>
|
||||
|
||||
<sect2 id="moz-java-plugin">
|
||||
<title>Firefox、 Mozilla 与 &java; 插件</title>
|
||||
<title>Firefox 与 &java; 插件</title>
|
||||
|
||||
<note>
|
||||
<para>在这一节和下一节中,
|
||||
我们均假定您已经安装了 <application>Firefox</application> 或
|
||||
<application>Mozilla</application>。</para>
|
||||
我们均假定您已经安装了 <application>Firefox</application>。</para>
|
||||
</note>
|
||||
|
||||
<para>&os; 基金会拥有来自 Sun Microsystems 的关于发布针对 &os;
|
||||
|
@ -247,9 +207,8 @@
|
|||
url="http://www.freebsdfoundation.org/downloads/java.shtml">&os;
|
||||
基金会</ulink> 网站上找到。</para>
|
||||
|
||||
<para>要为 <application>Firefox</application> 或
|
||||
<application>Mozilla</application> 添加 &java; 支持,
|
||||
您必须首先安装 <filename
|
||||
<para>要为 <application>Firefox</application>
|
||||
添加 &java; 支持,您必须首先安装 <filename
|
||||
role="package">java/javavmwrapper</filename> port。
|
||||
接下来, 从 <ulink
|
||||
url="http://www.freebsdfoundation.org/downloads/java.shtml"></ulink>
|
||||
|
@ -272,29 +231,71 @@
|
|||
|
||||
<sect2 id="moz-flash-plugin">
|
||||
|
||||
<title>Firefox、 Mozilla 与 ¯omedia; &flash; 插件</title>
|
||||
<title>Firefox 与 ¯omedia; &flash; 插件</title>
|
||||
<indexterm>
|
||||
<primary>Flash</primary>
|
||||
</indexterm>
|
||||
|
||||
<para>¯omedia; &flash; 插件并没有直接提供其 &os; 版本。 不过,
|
||||
我们有一个软件层 (wrapper) 可以用来运行 Linux 版本的插件。
|
||||
这个 wrapper 也支持 &adobe; &acrobat;、
|
||||
RealPlayer 和很多其他插件。</para>
|
||||
|
||||
<warning>
|
||||
<para>以下的章节涵盖了在近期 -STABLE 分支, &os; 7.1-RELEASE
|
||||
及以上的版本安装 &flash; 9.X。 如果你正在使用一个旧版本的 &os;
|
||||
或者遇到了问题, 你应该安装
|
||||
<filename role="package">www/linux-flashplugin7</filename>
|
||||
并跳过 &man.linprocfs.5; 的部分。</para>
|
||||
</warning>
|
||||
|
||||
<para>应安装 <filename role="package">www/nspluginwrapper</filename>
|
||||
port, 这个 port 需要依赖一个很大的 port
|
||||
<filename role="package">emulators/linux_base</filename>。</para>
|
||||
|
||||
<para>下一步是安装 <filename
|
||||
role="package">www/linux-flashplugin7</filename> port。
|
||||
role="package">www/linux-flashplugin9</filename> port。
|
||||
一旦装好了这个插件,需要用户运行一下
|
||||
<command>nspluginwrapper</command> 命令:</para>
|
||||
|
||||
<screen>&prompt.user; <userinput>nspluginwrapper -v -a -i</userinput></screen>
|
||||
|
||||
<para>如果希望播放 &flash; 动画的话,&linux; 的进程文件系统,
|
||||
&man.linprocfs.5; 必须挂载于
|
||||
<filename class="directory">/usr/compat/linux/proc</filename>。
|
||||
可以通过以下的命令实现:</para>
|
||||
|
||||
<screen>&prompt.user; <userinput>mount -t linprocfs linproc /usr/compat/linux/proc</userinput></screen>
|
||||
|
||||
<para>这也可以在机器启动时自动挂载, 把以下这行加入
|
||||
<filename>/etc/fstab</filename>:</para>
|
||||
|
||||
<programlisting>linproc /usr/compat/linux/proc linprocfs rw 0 0</programlisting>
|
||||
|
||||
<para>然后就可以打开浏览器, 并在地址栏中输入
|
||||
<literal>about:plugins</literal> 然后按下
|
||||
<keycap>Enter</keycap>。 这将显示目前可用的插件列表。</para>
|
||||
</sect2>
|
||||
|
||||
<sect2 id="moz-swfdec-flash-plugin">
|
||||
<title>Firefox and Swfdec &flash; Plugin</title>
|
||||
|
||||
<para>Swfdec 是一个用以解码和渲染 &flash; 动画的库。
|
||||
Swfdec-Mozilla 是一个使用了 Swfdec 库让 <application>Firefox</application>
|
||||
能播放 SWF 文件的插件。它目前仍处于开发状态。</para>
|
||||
|
||||
<para>如果你不能或者不想编译安装,可以通过网络安装二进制包:</para>
|
||||
|
||||
<screen>&prompt.root; <userinput>pkg_add -r swfdec-plugin</userinput></screen>
|
||||
|
||||
<para>如果二进制包还不可用,你可以通过 Ports Collection 编译安装:</para>
|
||||
|
||||
<screen>&prompt.root; <userinput>cd /usr/ports/www/swfdec-plugin</userinput>
|
||||
&prompt.root; <userinput>make install clean</userinput></screen>
|
||||
|
||||
<para>然后重启你的浏览器使得这个插件生效。</para>
|
||||
</sect2>
|
||||
|
||||
<sect2>
|
||||
<title>Opera</title>
|
||||
<indexterm>
|
||||
|
@ -939,12 +940,6 @@
|
|||
</thead>
|
||||
|
||||
<tbody>
|
||||
<row>
|
||||
<entry><application>Mozilla</application></entry>
|
||||
<entry><literal>mozilla</literal></entry>
|
||||
<entry><filename role="package">www/mozilla</filename></entry>
|
||||
</row>
|
||||
|
||||
<row>
|
||||
<entry><application>Opera</application></entry>
|
||||
<entry><literal>opera</literal></entry>
|
||||
|
@ -1022,6 +1017,13 @@
|
|||
<entry><literal>abacus</literal></entry>
|
||||
<entry><filename role="package">deskutils/abacus</filename></entry>
|
||||
</row>
|
||||
|
||||
<row>
|
||||
<entry><application>KMyMoney</application></entry>
|
||||
<entry><literal>kmymoney2</literal></entry>
|
||||
<entry><filename role="package">finance/kmymoney2</filename></entry>
|
||||
</row>
|
||||
|
||||
</tbody>
|
||||
</tgroup>
|
||||
</informaltable>
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
The FreeBSD Documentation Project
|
||||
The FreeBSD Simplified Chinese Project
|
||||
|
||||
Original Revision: 1.288
|
||||
Original Revision: 1.290
|
||||
$FreeBSD$
|
||||
-->
|
||||
|
||||
|
@ -2112,28 +2112,33 @@ sa0(ncr1:4:0): Logical unit is in process of becoming ready</screen>
|
|||
<indexterm><primary><command>restore</command></primary></indexterm>
|
||||
|
||||
<para><command>dump</command> 和 <command>restore</command> 是 &unix;
|
||||
传统的备份程序。它以 block 而不是以文件为单位来备份数据、链接或目录。
|
||||
<command>dump</command> 备份的是设备上的整个文件系统,不能只备份一
|
||||
一个文件系统的部分或是用到两个以上文件系统的目录树。
|
||||
<command>dump</command> 不会写文件和目录到磁带机,而是写入包含文件
|
||||
和目录的原始数据块。</para>
|
||||
传统的备份程序。 它以 block 而不是以文件为单位来备份数据、链接或目录。
|
||||
<command>dump</command> 备份的是设备上的整个文件系统,
|
||||
不能只备份一个文件系统的部分或是用到两个以上文件系统的目录树。
|
||||
与其他备份软件不同的是,
|
||||
<command>dump</command> 不会写文件和目录到磁带机, 而是写入包含文件
|
||||
和目录的原始数据块。 当需要恢复数据的时候,<command>restore</command>
|
||||
默认在 <filename>/tmp/</filename> 下保存临时数据 —
|
||||
如果你正在操作的恢复盘只有比较小的 <filename>/tmp</filename>
|
||||
的话, 你可能需要把环境变量 <envar>TMPDIR</envar>
|
||||
设置到一个有更多空间的目录, 使得此过程更容易成功。</para>
|
||||
|
||||
<note><para>如果在您的 root 目录使用 <command>dump</command> ,将不需要
|
||||
备份 <filename>/home</filename>、<filename>/usr</filename> 或其他目录,
|
||||
<note><para>如果在您的 root 目录使用 <command>dump</command>,
|
||||
将不需要备份 <filename>/home</filename>、<filename>/usr</filename> 或其他目录,
|
||||
因为这些是典型的其他文件系统或符号连接到那些文件系统的加载点。</para></note>
|
||||
|
||||
<para><command>dump</command> 是最早出现于 AT&T UNIX 的 Version 6 (约 1975)。
|
||||
默认的参数适用于 9-track 磁带(6250 bpi),所以如果要用高密度的磁带(最高可达
|
||||
62,182 ftpi),就不能用默认的参数,而要另外指定参数。这些默认值必须在命令行被
|
||||
修改以更好地利用当前磁带机的功能。</para>
|
||||
默认的参数适用于 9-track 磁带(6250 bpi), 所以如果要用高密度的磁带(最高可达
|
||||
62,182 ftpi), 就不能用默认的参数, 而要另外指定参数。
|
||||
这些默认值必须在命令行被修改以更好地利用当前磁带机的功能。</para>
|
||||
|
||||
<indexterm><primary><filename>.rhosts</filename></primary></indexterm>
|
||||
<para><command>rdump</command> 和 <command>rrestore</command> 可以通过网络在另一
|
||||
台计算机的磁带机上备份数据。这两个程序都是依靠 &man.rcmd.3; 和
|
||||
&man.ruserok.3; 来访问远程的磁带机。因此,运行备份的用户必须要有远程
|
||||
主机的 <filename>.rhosts</filename> 访问权。<command>rdump</command> 和
|
||||
<command>rrestore</command> 的参数必须适用于远程主机(例如,当您从 FreeBSD 连到
|
||||
一台 SUN 工作站 knomodo 去使用磁带机时,使用:</para>
|
||||
<para><command>rdump</command> 和 <command>rrestore</command>
|
||||
可以通过网络在另一台计算机的磁带机上备份数据。
|
||||
这两个程序都是依靠 &man.rcmd.3; 和 &man.ruserok.3; 来访问远程的磁带机。
|
||||
因此,运行备份的用户必须要有远程主机的 <filename>.rhosts</filename> 访问权。
|
||||
<command>rdump</command> 和 <command>rrestore</command> 的参数必须适用于远程主机
|
||||
例如,当您从 FreeBSD 连到一台 SUN 工作站 knomodo 去使用磁带机时,使用:</para>
|
||||
|
||||
<screen>&prompt.root; <userinput>/sbin/rdump 0dsbfu 54000 13000 126 komodo:/dev/nsa8 /dev/da0a 2>&1</userinput></screen>
|
||||
|
||||
|
|
|
@ -8,7 +8,7 @@ that might make this chapter too large.
|
|||
|
||||
<!--
|
||||
The FreeBSD Documentation Project
|
||||
Original Revision: 1.5
|
||||
Original Revision: 1.7
|
||||
$FreeBSD$
|
||||
-->
|
||||
|
||||
|
@ -23,40 +23,40 @@ that might make this chapter too large.
|
|||
</authorgroup>
|
||||
</chapterinfo>
|
||||
|
||||
<title>DTrace</title>
|
||||
<title>&dtrace;</title>
|
||||
|
||||
<sect1 id="dtrace-synopsis">
|
||||
<title>概述</title>
|
||||
|
||||
<indexterm><primary>DTrace</primary></indexterm>
|
||||
<indexterm><primary>&dtrace;</primary></indexterm>
|
||||
<indexterm>
|
||||
<primary>DTrace support</primary>
|
||||
<see>DTrace</see>
|
||||
<primary>&dtrace; support</primary>
|
||||
<see>&dtrace;</see>
|
||||
</indexterm>
|
||||
|
||||
<para>DTrace,也称为动态跟踪,是由 &sun;
|
||||
<para>&dtrace;,也称为动态跟踪,是由 &sun;
|
||||
开发的一个用来在生产和试验性生产系统上找出系统瓶颈的工具。
|
||||
在任何情况下它都不是一个调试工具,
|
||||
而是一个实时系统分析寻找出性能及其他问题的工具。</para>
|
||||
|
||||
<para>DTrace 是个特别好的分析工具,带有大量的帮助诊断系统问题的特性。
|
||||
<para>&dtrace; 是个特别好的分析工具,带有大量的帮助诊断系统问题的特性。
|
||||
还可以使用预先写好的脚本利用它的功能。
|
||||
用户也可以通过使用 DTrace D 语言创建他们自己定制的分析工具,
|
||||
用户也可以通过使用 &dtrace; D 语言创建他们自己定制的分析工具,
|
||||
以满足特定的需求。</para>
|
||||
|
||||
<para>在阅读了这一章节之后,你将了解:</para>
|
||||
|
||||
<itemizedlist>
|
||||
<listitem>
|
||||
<para>DTrace 是什么,它提供了些哪些特性。</para>
|
||||
<para>&dtrace; 是什么,它提供了些哪些特性。</para>
|
||||
</listitem>
|
||||
|
||||
<listitem>
|
||||
<para>DTrace 在 &solaris; 与 &os; 上的实现的差别。</para>
|
||||
<para>&dtrace; 在 &solaris; 与 &os; 上的实现的差别。</para>
|
||||
</listitem>
|
||||
|
||||
<listitem>
|
||||
<para>如何在 &os; 上开启和使用 DTrace。</para>
|
||||
<para>如何在 &os; 上开启和使用 &dtrace;。</para>
|
||||
</listitem>
|
||||
</itemizedlist>
|
||||
|
||||
|
@ -80,7 +80,7 @@ that might make this chapter too large.
|
|||
|
||||
<listitem>
|
||||
<para>了解如何获取和重新编译 &os; 源代码
|
||||
(<xref linkend="cutting-edge">)。</para>
|
||||
(<xref linkend="updating-upgrading">)。</para>
|
||||
</listitem>
|
||||
</itemizedlist>
|
||||
|
||||
|
@ -98,10 +98,10 @@ that might make this chapter too large.
|
|||
<sect1 id="dtrace-implementation">
|
||||
<title>实现上的差异</title>
|
||||
|
||||
<para>虽然 &os; 上的 DTrace 与 &solaris; 上的非常相似,
|
||||
<para>虽然 &os; 上的 &dtrace; 与 &solaris; 上的非常相似,
|
||||
在继续深入之前我们需要说明一下存在的差异。
|
||||
用户首先会注意到的便是 &os; 上的 DTrace 需要明确的被启用。
|
||||
DTrace 相关的内核选项和模块必须开启后才能正常工作。
|
||||
用户首先会注意到的便是 &os; 上的 &dtrace; 需要明确的被启用。
|
||||
&dtrace; 相关的内核选项和模块必须开启后才能正常工作。
|
||||
稍后我们会作详细介绍。</para>
|
||||
|
||||
<para>有一个 <literal>DDB_CTF</literal>
|
||||
|
@ -124,13 +124,13 @@ that might make this chapter too large.
|
|||
可以让你根据类型追踪 &os; 内核中的
|
||||
<function>malloc()</function>。</para>
|
||||
|
||||
<para>只有 <username>root</username> 可以使用 &os; 上的 DTrace。
|
||||
<para>只有 <username>root</username> 可以使用 &os; 上的 &dtrace;。
|
||||
这是由系统安全上的差异造成的,&solaris; 提供了一些 &os;
|
||||
上还为实现的低层的安全检查。同样,
|
||||
<devicename>/dev/dtrace/dtrace</devicename> 也被严格的限制为仅供
|
||||
<username>root</username> 用户访问。</para>
|
||||
|
||||
<para>最后,DTrace 为 &sun; <acronym>CDDL</acronym>
|
||||
<para>最后,&dtrace; 为 &sun; <acronym>CDDL</acronym>
|
||||
许可下发布的软件。随 &os; 发行的
|
||||
<literal>Common Development and Distribution License</literal>
|
||||
可以在查阅
|
||||
|
@ -139,15 +139,15 @@ that might make this chapter too large.
|
|||
<ulink url="http://www.opensolaris.org/os/licensing"></ulink>
|
||||
查看在线版本。</para>
|
||||
|
||||
<para>这个许可表示带有 DTrace 选项的 &os; 内核仍为
|
||||
<para>这个许可表示带有 &dtrace; 选项的 &os; 内核仍为
|
||||
<acronym>BSD</acronym> 许可;然而以二进制发布模块,
|
||||
或者加载二进制模块则需遵守 <acronym>CDDL</acronym>。</para>
|
||||
</sect1>
|
||||
|
||||
<sect1 id="dtrace-enable">
|
||||
<title>启用 DTrace 支持</title>
|
||||
<title>启用 &dtrace; 支持</title>
|
||||
|
||||
<para>在内核配置文件中加入以下几行来开启对 DTrace 的支持:</para>
|
||||
<para>在内核配置文件中加入以下几行来开启对 &dtrace; 的支持:</para>
|
||||
|
||||
<programlisting>options KDTRACE_HOOKS
|
||||
options DDB_CTF</programlisting>
|
||||
|
@ -158,7 +158,7 @@ options DDB_CTF</programlisting>
|
|||
<programlisting>options KDTRACE_FRAME</programlisting>
|
||||
|
||||
<para>此选项提供了对 <acronym>FBT</acronym> 特性的支持。
|
||||
DTrace 可以在没有此选项的情况下正常工作,
|
||||
&dtrace; 可以在没有此选项的情况下正常工作,
|
||||
但是函数边界跟踪便会有所限制。</para>
|
||||
</note>
|
||||
|
||||
|
@ -186,7 +186,7 @@ options DDB_CTF</programlisting>
|
|||
<para>系统需要重新启动。</para>
|
||||
|
||||
<para>在重新启动和新内核载入内存之后,需要添加 Korn shell
|
||||
的支持。因为 DTrace 工具包有一些工具是由 <command>ksh</command>
|
||||
的支持。因为 &dtrace; 工具包有一些工具是由 <command>ksh</command>
|
||||
写的。安装 <filename role="package">shells/ksh93</filename>。
|
||||
同样也可以通过 <filename role="package">shells/pdksh</filename>
|
||||
或者 <filename role="package">shells/mksh</filename>
|
||||
|
@ -199,23 +199,23 @@ options DDB_CTF</programlisting>
|
|||
</sect1>
|
||||
|
||||
<sect1 id="dtrace-using">
|
||||
<title>使用 DTrace</title>
|
||||
<title>使用 &dtrace;</title>
|
||||
|
||||
<para>在使用 DTrace 的功能之前,DTrace 设备必须存在。
|
||||
<para>在使用 &dtrace; 的功能之前,&dtrace; 设备必须存在。
|
||||
使用如下的命令装载此设备:</para>
|
||||
|
||||
<screen>&prompt.root; <userinput>kldload dtraceall</userinput></screen>
|
||||
|
||||
<para>DTrace 支持现在应该可以使用了。
|
||||
<para>&dtrace; 支持现在应该可以使用了。
|
||||
管理员现在可以使用如下的命令查看所有的探测器:</para>
|
||||
|
||||
<screen>&prompt.root; <userinput>dtrace -l | more</userinput></screen>
|
||||
|
||||
<para>所有的输出都传递给 <command>more</command> 工具,
|
||||
因为它们会很快超出屏幕的显示区域。此时,DTrace
|
||||
因为它们会很快超出屏幕的显示区域。此时,&dtrace;
|
||||
应该被认为是能够正常工作的了。现在是该考察工具包的时候了。</para>
|
||||
|
||||
<para>工具包是实现写好的一堆脚本,与 DTrace 一起运行来收集系统信息。
|
||||
<para>工具包是实现写好的一堆脚本,与 &dtrace; 一起运行来收集系统信息。
|
||||
有脚本用来检查已打开的文件,内存,<acronym>CPU</acronym>
|
||||
使用率和许多东西。使用如下的命令解开脚本:</para>
|
||||
|
||||
|
@ -234,13 +234,13 @@ options DDB_CTF</programlisting>
|
|||
<filename>/usr/local/bin/perl</filename>。</para>
|
||||
|
||||
<important>
|
||||
<para>此刻还需谨慎提醒一下读者 &os; 的 DTrace 支持仍是
|
||||
<para>此刻还需谨慎提醒一下读者 &os; 的 &dtrace; 支持仍是
|
||||
<emphasis>不完整的</emphasis> 和 <emphasis>试验性</emphasis> 的。
|
||||
这些脚本中的大多数都无法运行,因为它们过于针对 &solaris;
|
||||
或者使用了目前还不支持的探测器。</para>
|
||||
</important>
|
||||
|
||||
<para>在撰写这篇文章的时候,DTrace 工具包中只有两个脚本在
|
||||
<para>在撰写这篇文章的时候,&dtrace; 工具包中只有两个脚本在
|
||||
&os; 上是完全支持的:
|
||||
<filename>hotkernel</filename> 和 <filename>procsystime</filename>
|
||||
脚本。这两个脚本便是我们下一部分将要探讨的:</para>
|
||||
|
@ -355,7 +355,7 @@ Elapsed Times for processes csh,
|
|||
<sect1 id="dtrace-language">
|
||||
<title>D 语言</title>
|
||||
|
||||
<para>DTrace 工具包包括了很多由 DTrace 特殊语言写成的脚本。
|
||||
<para>&dtrace; 工具包包括了很多由 &dtrace; 特殊语言写成的脚本。
|
||||
在 &sun; 的文档中称这类语言为 <quote>D 语言</quote>,
|
||||
它与 C++ 非常类似。对此语言更深入的讨论则超出了这篇文章的范围。
|
||||
更多相关的讨论可以在
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
The FreeBSD Documentation Project
|
||||
The FreeBSD Simplified Chinese Project
|
||||
|
||||
Original Revision: 1.195
|
||||
Original Revision: 1.196
|
||||
$FreeBSD$
|
||||
-->
|
||||
|
||||
|
@ -11,7 +11,8 @@
|
|||
|
||||
<para>发展迅猛的FreeBSD使得现有的印刷、平面媒体跟不上它的发展进度!
|
||||
而电子版的也许是最好的,通常是唯一一个可以跟上最新发展方向的。FreeBSD来自于志愿者的成果,
|
||||
用户社区通常也扮演着是“技术支持部门”的角色。通过电子邮件和USENET新闻组可以很快的找到他们。</para>
|
||||
用户社区通常也扮演着是“技术支持部门”的角色。通过电子邮, Web 论坛件和 USENET
|
||||
新闻组可以很快的找到他们。</para>
|
||||
|
||||
<para>以下列出了尽量多的联系FreeBSD用户社区的方式。如果您发现有其他的资源没有被包括在这儿,
|
||||
请告诉&a.doc;,以便将它们加入到这里。</para>
|
||||
|
@ -19,11 +20,9 @@
|
|||
<sect1 id="eresources-mail">
|
||||
<title>邮件列表</title>
|
||||
|
||||
<para>虽然大部分的FreeBSD开发人员都会阅读USENET,
|
||||
如果您只将问题发表在 <literal>comp.unix.bsd.freebsd.*</literal> 其中之一的讨论组上,
|
||||
我们也不能保证我们永远可以及时了解您的问题。如果您将问题发到适当的邮件列表上,
|
||||
您不但可以同时让FreeBSD研发人员和其他的读者看到,
|
||||
通常也可以得到一个较好的(至少会比较快)的回应。</para>
|
||||
<para>邮件列表通常是提问或是发起有关 FreeBSD
|
||||
某一方面的专项技术讨论最直接的途径。 有多种针对于不同 FreeBSD 话题的邮件列表。
|
||||
把你的问题发送到最合适的邮件列表通常能获得更加快速准确的回复。</para>
|
||||
|
||||
<para>本文的最后给出了各个不同的邮件列表的使用规则。
|
||||
<emphasis>在订阅其中任何一个列表之前,请先阅读使用条文</emphasis>。
|
||||
|
@ -46,7 +45,10 @@
|
|||
|
||||
<para>全部的邮件列表记录都可以在<ulink url="&url.base;/search/index.html">FreeBSD World
|
||||
Wide Web服务器</ulink>上找到。此服务器提供了很棒的关键词搜寻功能,可让您找到FAQ的解答。
|
||||
而在邮件列表上提问之前,请先搜寻是否已有答案。</para>
|
||||
而在邮件列表上提问之前,请先搜寻是否已有答案。
|
||||
请注意这意味着所有发往 FreeBSD 邮件列表的消息都会被永久归档保存。
|
||||
当涉及到隐私保护的话,
|
||||
可以考虑使用一个可使用后丢弃的电子邮件地址并只发送公开的信息。</para>
|
||||
|
||||
<sect2 id="eresources-summary">
|
||||
<title>列表摘要</title>
|
||||
|
@ -1699,7 +1701,32 @@
|
|||
<sect1 id="eresources-web">
|
||||
<title>World Wide Web服务器</title>
|
||||
|
||||
&chap.eresources.www.inc;
|
||||
<sect2 id="eresources-web-social">
|
||||
<title>论坛, 部落格, 社会性网络</title>
|
||||
|
||||
<itemizedlist>
|
||||
<listitem><para><ulink url="http://forums.freebsd.org/">The
|
||||
FreeBSD Forums</ulink> 提供了一个基于 web 的论坛用以讨论
|
||||
FreeBSD 相关问题与技术。</para></listitem>
|
||||
|
||||
<listitem><para><ulink
|
||||
url="http://planet.freebsdish.org/">Planet FreeBSD</ulink>
|
||||
提供了众多由 FreeBSD 开发者部落格摘要的集合。
|
||||
很多的开发者都在上面发表有关他们工作简要的笔记,
|
||||
新的补丁和工作进度。</para></listitem>
|
||||
|
||||
<listitem><para>The <ulink
|
||||
url="http://www.youtube.com/bsdconferences">BSDConferences
|
||||
YouTube Channel</ulink> 提供了一组世界各地 BSD
|
||||
峰会的高质量视频。 这个是一个不错的观看重要开发者展示最新
|
||||
FreeBSD 有关成果的方法。</para></listitem>
|
||||
</itemizedlist>
|
||||
</sect2>
|
||||
|
||||
<sect2 id="eresources-web-mirrors">
|
||||
<title>Official Mirrors</title>
|
||||
&chap.eresources.www.inc;
|
||||
</sect2>
|
||||
</sect1>
|
||||
|
||||
<sect1 id="eresources-email">
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<!--
|
||||
The FreeBSD Documentation Project
|
||||
Original Revision: 1.4
|
||||
Original Revision: 1.5
|
||||
$FreeBSD$
|
||||
-->
|
||||
|
||||
|
@ -157,7 +157,7 @@
|
|||
<filename>/boot/loader.conf</filename>
|
||||
中加入如下的参数并且重启后通过了测试。</para>
|
||||
|
||||
<programlisting>vm.kmem_slze="330M"
|
||||
<programlisting>vm.kmem_size="330M"
|
||||
vm.kmem_size_max="330M"
|
||||
vfs.zfs.arc_max="40M"
|
||||
vfs.zfs.vdev.cache.size="5M"</programlisting>
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
The FreeBSD Documentation Project
|
||||
The FreeBSD Simplified Chinese Project
|
||||
|
||||
Original Revision: 1.85
|
||||
Original Revision: 1.86
|
||||
$FreeBSD$
|
||||
-->
|
||||
|
||||
|
@ -1886,17 +1886,14 @@ pass in quick on rl0 proto tcp from any to any port = 20 flags S keep state</pro
|
|||
<secondary>IPFW</secondary>
|
||||
</indexterm>
|
||||
|
||||
<note>
|
||||
<para>这一节的内容正在撰写中。 其内容可能不总是十分准确。</para>
|
||||
</note>
|
||||
|
||||
<para>IPFIREWALL (IPFW) 是一个由 &os; 发起的防火墙应用软件,
|
||||
它由 &os; 的志愿者成员编写和维护。
|
||||
它使用了传统的无状态规则和规则编写方式,
|
||||
以期达到简单状态逻辑所期望的目标。</para>
|
||||
|
||||
<para>标准的 &os; 安装中, IPFW 所给出的规则集样例 (可以在
|
||||
<filename>/etc/rc.firewall</filename> 中找到) 非常简单,
|
||||
<filename>/etc/rc.firewall</filename> 和
|
||||
<filename>/etc/rc.firewall6</filename> 中找到) 非常简单,
|
||||
建议不要不加修改地直接使用。 该样例中没有使用状态过滤,
|
||||
而该功能在大部分的配置中都是非常有用的,
|
||||
因此这一节并不以系统自带的样例作为基础。</para>
|
||||
|
@ -1914,7 +1911,8 @@ pass in quick on rl0 proto tcp from any to any port = 20 flags S keep state</pro
|
|||
及其集成的数据包记帐工具、 日志工具、 用以触发
|
||||
<acronym>NAT</acronym> 工具的 'divert' (转发) 规则、
|
||||
高级特殊用途工具、 dummynet 流量整形机制,
|
||||
'fwd rule' 转发工具, 桥接工具, 以及 ipstealth 工具。</para>
|
||||
'fwd rule' 转发工具, 桥接工具, 以及 ipstealth 工具。
|
||||
IPFW 支持 IPv4 和 IPv6。</para>
|
||||
|
||||
<sect2 id="firewalls-ipfw-enable">
|
||||
<title>启用 IPFW</title>
|
||||
|
@ -2004,15 +2002,6 @@ net.inet.ip.fw.verbose_limit=5</programlisting>
|
|||
<para>这个选项默认地允许所有的包通过防火墙,
|
||||
如果您是第一次配置防火墙, 使用这个选项将是一个不错的主意。</para>
|
||||
|
||||
<programlisting>options IPV6FIREWALL
|
||||
options IPV6FIREWALL_VERBOSE
|
||||
options IPV6FIREWALL_VERBOSE_LIMIT
|
||||
options IPV6FIREWALL_DEFAULT_TO_ACCEPT</programlisting>
|
||||
|
||||
<para>这些选项与 IPv4 的对应选项功能一样, 它们是针对 IPv6
|
||||
的。 如果不使用 IPv6, 则不带任何规则的 IPV6FIREWALL
|
||||
将阻止所有的 IPv6 包。</para>
|
||||
|
||||
<indexterm>
|
||||
<primary>内核选项</primary>
|
||||
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
The FreeBSD Documentation Project
|
||||
The FreeBSD Simplified Chinese Project
|
||||
|
||||
Original Revision: 1.43
|
||||
Original Revision: 1.47
|
||||
$FreeBSD$
|
||||
-->
|
||||
|
||||
|
@ -138,7 +138,7 @@
|
|||
<procedure>
|
||||
<title>在未格式化的 ATA 磁盘上建立条带</title>
|
||||
|
||||
<step><para>加载 <filename>geom_stripe</filename>
|
||||
<step><para>加载 <filename>geom_stripe.ko</filename>
|
||||
模块:</para>
|
||||
|
||||
<screen>&prompt.root; <userinput>kldload geom_stripe</userinput></screen>
|
||||
|
@ -157,13 +157,11 @@
|
|||
<filename>/dev/ad2</filename> 和
|
||||
<filename>/dev/ad3</filename> 做成一个条带设备:</para>
|
||||
|
||||
<screen>&prompt.root; <userinput>gstripe label -v st0 /dev/ad2 /dev/ad3</userinput></screen>
|
||||
<screen>&prompt.root; <userinput>gstripe label -v st0 /dev/ad2 /dev/ad3</userinput>
|
||||
Metadata value stored on /dev/ad2.
|
||||
Metadata value stored on /dev/ad3.
|
||||
Done.</screen>
|
||||
|
||||
<!--
|
||||
<para>A message should be returned explaining that meta data has
|
||||
been stored on the devices.
|
||||
XXX: What message? Put it inside the screen output above.
|
||||
-->
|
||||
</step>
|
||||
|
||||
<step><para>接着需要写标准的 label, 也就是通常所说的分区表到新卷上,
|
||||
|
@ -194,12 +192,15 @@ XXX: What message? Put it inside the screen output above.
|
|||
|
||||
<para>要在启动过程中自动挂接这个条带上的文件系统,
|
||||
需要把关于卷的信息放到
|
||||
<filename>/etc/fstab</filename> 文件中:</para>
|
||||
<filename>/etc/fstab</filename> 文件中。为达到此目的,
|
||||
需要创建一个叫 <filename class="directory">stripe</filename>
|
||||
永久的挂载点:</para>
|
||||
|
||||
<screen>&prompt.root; <userinput>echo "/dev/stripe/st0a /mnt ufs rw 2 2" \</userinput>
|
||||
<screen>&prompt.root; <userinput>mkdir /stripe</userinput>
|
||||
&prompt.root; <userinput>echo "/dev/stripe/st0a /stripe ufs rw 2 2" \</userinput>
|
||||
<userinput>>> /etc/fstab</userinput></screen>
|
||||
|
||||
<para>此外, <filename>geom_stripe</filename> 模块也必须通过在
|
||||
<para>此外, <filename>geom_stripe.ko</filename> 模块也必须通过在
|
||||
<filename>/boot/loader.conf</filename> 中增加下述设置,
|
||||
以便在系统初始化过程中自动加载。</para>
|
||||
|
||||
|
@ -247,6 +248,12 @@ XXX: What message? Put it inside the screen output above.
|
|||
也就是用下面的命令来创建
|
||||
<filename class="devicefile">/dev/mirror/gm</filename> 设备:</para>
|
||||
|
||||
<warning>
|
||||
<para>如果有数据被存放在磁盘最后的扇区,
|
||||
并在启动设备上创建镜像的话可能导致数据丢失。
|
||||
在新安装 &os; 之后立即创建镜像可以减低此风险。</para>
|
||||
</warning>
|
||||
|
||||
<screen>&prompt.root; <userinput>gmirror label -vb round-robin gm0 /dev/da0</userinput></screen>
|
||||
|
||||
<para>系统应给出下面的回应:</para>
|
||||
|
@ -272,17 +279,21 @@ Done.</screen>
|
|||
|
||||
<para>编辑 <filename>/etc/fstab</filename> 文件,
|
||||
将其中先前的 <devicename>da0</devicename> 改为新的镜像设备
|
||||
<devicename>gm0</devicename>。 以 <username>root</username> 用户身份编辑
|
||||
<filename>/etc/fstab</filename>:</para>
|
||||
<devicename>gm0</devicename>。</para>
|
||||
|
||||
<screen>&prompt.root; <userinput>vi /etc/fstab</userinput></screen>
|
||||
<note>
|
||||
<para>如果 &man.vi.1; 是你喜欢的编辑器,
|
||||
以下则是完成此项任务的一个简便方法:</para>
|
||||
|
||||
<para>在 &man.vi.1; 中备份现有的
|
||||
<filename>fstab</filename> 内容, 具体操作是
|
||||
<userinput>:w /etc/fstab.bak</userinput>。 接着,
|
||||
把所有旧的 <devicename>da0</devicename> 替换成 <devicename>gm0</devicename>,
|
||||
也就是输入命令
|
||||
<userinput>:%s/da/mirror\/gm/g</userinput>。<para>
|
||||
<screen>&prompt.root; <userinput>vi /etc/fstab</userinput></screen>
|
||||
|
||||
<para>在 &man.vi.1; 中备份现有的
|
||||
<filename>fstab</filename> 内容, 具体操作是
|
||||
<userinput>:w /etc/fstab.bak</userinput>。 接着,
|
||||
把所有旧的 <devicename>da0</devicename> 替换成 <devicename>gm0</devicename>,
|
||||
也就是输入命令
|
||||
<userinput>:%s/da/mirror\/gm/g</userinput>。</para>
|
||||
</note>
|
||||
|
||||
<para>修改完后的 <filename>fstab</filename> 文件应该是下面的样子。
|
||||
磁盘驱动器是 <acronym>SCSI</acronym> 或 <acronym>ATA</acronym>
|
||||
|
@ -290,10 +301,12 @@ Done.</screen>
|
|||
<devicename>gm</devicename>。</para>
|
||||
|
||||
<programlisting># Device Mountpoint FStype Options Dump Pass#
|
||||
/dev/mirror/gm0s2b none swap sw 0 0
|
||||
/dev/mirror/gm0s2a / ufs rw 1 1
|
||||
#/dev/mirror/gm0s2d /store ufs rw 2 2
|
||||
/dev/mirror/gm0s2e /usr ufs rw 2 2
|
||||
/dev/mirror/gm0s1b none swap sw 0 0
|
||||
/dev/mirror/gm0s1a / ufs rw 1 1
|
||||
/dev/mirror/gm0s1d /usr ufs rw 0 0
|
||||
/dev/mirror/gm0s1f /home ufs rw 2 2
|
||||
#/dev/mirror/gm0s2d /store ufs rw 2 2
|
||||
/dev/mirror/gm0s1e /var ufs rw 2 2
|
||||
/dev/acd0 /cdrom cd9660 ro,noauto 0 0</programlisting>
|
||||
|
||||
<para>重启系统:</para>
|
||||
|
@ -354,7 +367,8 @@ mountroot></programlisting>
|
|||
OK? <userinput>boot</userinput></screen>
|
||||
|
||||
<para>如果这样做能解决问题, 则说明由于某种原因模块没有被正确加载。
|
||||
可以通过在内核配置文件中加入:</para>
|
||||
检查 <filename>/boot/loader.conf</filename> 中相关条目是否正确。
|
||||
如果问题仍然存在,可以在内核配置文件中加入:</para>
|
||||
|
||||
<programlisting>options GEOM_MIRROR</programlisting>
|
||||
|
||||
|
@ -475,25 +489,28 @@ ggate0
|
|||
<title>标签类型和使用示范</title>
|
||||
|
||||
<para>有两种类型的标签, 一种是普通标签, 另一种是文件系统标签。
|
||||
两者的差异体现在是否能够自动检测, 以及是否在重启后保持。 这些标签会放到
|
||||
<filename class="directory">/dev</filename> 中的特殊目录中,
|
||||
这些目录的名字取决于文件系统类型。 例如,
|
||||
标签可以是永久性的或暂时性的。永久性的标签可以通过
|
||||
&man.tunefs.8; 或 &man.newfs.8; 命令创键。根据文件系统的类型,
|
||||
它们将在 <filename class="directory">/dev</filename>
|
||||
下的一个子目录中被创建。例如,
|
||||
<acronym>UFS</acronym>2 文件系统的标签会创建到
|
||||
<filename class="directory">/dev/ufs</filename>
|
||||
目录中。</para>
|
||||
目录中。永久性的标签还可以使用 <command>glabel label</command>
|
||||
创建。它们不再是文件系统特定的,而是会在
|
||||
<filename class="directory">/dev/label</filename>
|
||||
目录中被创建。</para>
|
||||
|
||||
<para>普通标签在系统下次重启时会消失, 这些标签会创建到
|
||||
<para>暂时性的标签在系统下次重启时会消失, 这些标签会创建到
|
||||
<filename class="directory">/dev/label</filename> 目录中,
|
||||
很适合测试之用。</para>
|
||||
很适合测试之用。可以使用 <command>glabel create</command>
|
||||
创建暂时性的标签。请参阅 &man.glabel.8;
|
||||
手册页以获取更多详细信息。</para>
|
||||
|
||||
<!-- XXXTR: How do you create a file system label without running newfs
|
||||
or when there is no newfs (e.g.: cd9660)? -->
|
||||
|
||||
<para>永久性标签可以使用
|
||||
<command>tunefs</command> 或 <command>newfs</command>
|
||||
工具来创建。 要为
|
||||
<acronym>UFS</acronym>2 文件系统创建标签, 而不破坏其上的数据,
|
||||
可以使用下面的命令:</para>
|
||||
<para>要为一个 <acronym>UFS</acronym>2 文件系统创建永久性标签,
|
||||
而不破坏其上的数据,可以使用下面的命令:</para>
|
||||
|
||||
<screen>&prompt.root; <userinput>tunefs -L <replaceable>home</replaceable> <replaceable>/dev/da3</replaceable></userinput></screen>
|
||||
|
||||
|
@ -528,6 +545,60 @@ ggate0
|
|||
<para>下列命令可以清除标签:</para>
|
||||
|
||||
<screen>&prompt.root; <userinput>glabel destroy home</userinput></screen>
|
||||
|
||||
<para>以下的例子展示了如何为一个启动磁盘打上标签。</para>
|
||||
|
||||
<example>
|
||||
<title>为启动磁盘打上标签</title>
|
||||
|
||||
<para>为启动磁盘打上永久性标签, 系统应该能够正常启动,
|
||||
即使磁盘被移动到了另外一个控制器或者转移到了一个不同的系统上。
|
||||
此例中我们假设使用了一个 <acronym>ATA</acronym> 磁盘,
|
||||
当前这个设备被系统识别为 <devicename>ad0</devicename>。
|
||||
还假设使用了标准的 &os; 分区划分方案,
|
||||
<filename class="directory">/</filename>,
|
||||
<filename class="directory">/var</filename>,
|
||||
<filename class="directory">/usr</filename> 和
|
||||
<filename class="directory">/tmp</filename> 文件系统,
|
||||
还有一个 swap 分区。</para>
|
||||
|
||||
<para>重启系统,在 &man.loader.8; 提示符下键入
|
||||
<keycap>4</keycap> 启动到单用户模式。
|
||||
然后输入以下的命令:</para>
|
||||
|
||||
<screen>&prompt.root; <userinput>glabel label rootfs /dev/ad0s1a</userinput>
|
||||
GEOM_LABEL: Label for provider /dev/ad0s1a is label/rootfs
|
||||
&prompt.root; <userinput>glabel label var /dev/ad0s1d</userinput>
|
||||
GEOM_LABEL: Label for provider /dev/ad0s1d is label/var
|
||||
&prompt.root; <userinput>glabel label usr /dev/ad0s1f</userinput>
|
||||
GEOM_LABEL: Label for provider /dev/ad0s1f is label/usr
|
||||
&prompt.root; <userinput>glabel label tmp /dev/ad0s1e</userinput>
|
||||
GEOM_LABEL: Label for provider /dev/ad0s1e is label/tmp
|
||||
&prompt.root; <userinput>glabel label swap /dev/ad0s1b</userinput>
|
||||
GEOM_LABEL: Label for provider /dev/ad0s1b is label/swap
|
||||
&prompt.root; <userinput>exit</userinput></screen>
|
||||
|
||||
<para>系统加继续启动进入多用户模式。 在启动完毕后, 编辑
|
||||
<filename>/etc/fstab</filename> 用各自的标签替换下常规的设备名。
|
||||
最终 <filename>/etc/fstab</filename> 看起来差不多是这样的:</para>
|
||||
|
||||
<programlisting># Device Mountpoint FStype Options Dump Pass#
|
||||
/dev/label/swap none swap sw 0 0
|
||||
/dev/label/rootfs / ufs rw 1 1
|
||||
/dev/label/tmp /tmp ufs rw 2 2
|
||||
/dev/label/usr /usr ufs rw 2 2
|
||||
/dev/label/var /var ufs rw 2 2</programlisting>
|
||||
|
||||
<para>现在可以重启系统了。 如果一切顺利的话,
|
||||
系统可以正常启动并且 <command>mount</command> 命令显示:</para>
|
||||
|
||||
<screen>&prompt.root; <userinput>mount</userinput>
|
||||
/dev/label/rootfs on / (ufs, local)
|
||||
devfs on /dev (devfs, local)
|
||||
/dev/label/tmp on /tmp (ufs, local, soft-updates)
|
||||
/dev/label/usr on /usr (ufs, local, soft-updates)
|
||||
/dev/label/var on /var (ufs, local, soft-updates)</screen>
|
||||
</example>
|
||||
</sect2>
|
||||
</sect1>
|
||||
|
||||
|
@ -551,8 +622,9 @@ ggate0
|
|||
以避免文件系统出现不一致的问题。</para>
|
||||
|
||||
<para>这种方法是另一种阻止文件系统丢失数据并发生不一致的方法。 与 Soft Updates
|
||||
追踪并确保元数据更新顺序这种方法不同, 它会实际地将日志保存到磁盘最后的扇区,
|
||||
或另外一块磁盘上。</para>
|
||||
追踪并确保元数据更新顺序这种方法不同,
|
||||
它会实际地将日志保存到指定为此项任务保留的磁盘空间上,
|
||||
在某些情况下可全部存放到另外一块磁盘上。</para>
|
||||
|
||||
<para>与其他文件系统的日志实现不同,
|
||||
<command>gjournal</command> 采用的是基于块, 而不是作为文件系统的一部分的方式 -
|
||||
|
@ -564,6 +636,17 @@ ggate0
|
|||
|
||||
<programlisting>options UFS_GJOURNAL</programlisting>
|
||||
|
||||
<para>如果使用日志的卷需要在启动的时候被挂载, 还需加载
|
||||
<filename>geom_journal.ko</filename> 内核模块,
|
||||
将以下着行加入 <filename>/boot/loader.conf</filename>:</para>
|
||||
|
||||
<programlisting>geom_journal_load="YES"</programlisting>
|
||||
|
||||
<para>这个功能也可被编译进一个定制的内核,
|
||||
需在内核配置文件中加入以下这行:</para>
|
||||
|
||||
<programlisting>options GEOM_JOURNAL</programlisting>
|
||||
|
||||
<para>现在, 可以为空闲的文件系统创建日志了。 对于新增的 <acronym>SCSI</acronym> 磁盘
|
||||
<devicename>da4</devicename>, 具体的操作步骤为:</para>
|
||||
|
||||
|
@ -601,6 +684,11 @@ ggate0
|
|||
在尝试修改文件系统之前, 您应对其进行备份。 多数情况下,
|
||||
<command>gjournal</command> 会因为无法建立日志而失败, 在误用
|
||||
<command>tunefs</command> 时, 这可能导致失败。</para>
|
||||
|
||||
<para>对于 &os; 系统的启动磁盘使用日志也是可能的。
|
||||
请参阅 <ulink
|
||||
url="&url.articles.gjournal-desktop;">Implementing UFS Journaling on
|
||||
a Desktop PC</ulink> 以获得更多详细信息。</para>
|
||||
</sect1>
|
||||
</chapter>
|
||||
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
The FreeBSD Documentation Project
|
||||
The FreeBSD Simplified Chinese Project
|
||||
|
||||
Original Revision: 1.390
|
||||
Original Revision: 1.392
|
||||
$FreeBSD$
|
||||
-->
|
||||
|
||||
|
@ -3923,6 +3923,26 @@ Please press any key to reboot.</screen>
|
|||
2 的时候!)。 您应尽量避免使用 IRQ 2 或 9。</para>
|
||||
</answer>
|
||||
</qandaentry>
|
||||
|
||||
<qandaentry>
|
||||
|
||||
<indexterm>
|
||||
<primary>color</primary>
|
||||
<secondary>contrast</secondary>
|
||||
</indexterm>
|
||||
<question>
|
||||
<para>当在 X11 终端中运行 <application>sysinstall</application>
|
||||
的时候, 黄色的字体相对于浅灰色的背景变得难以阅读。
|
||||
有没有什么能让这个应用程序提供高对比度的方法?</para>
|
||||
</question>
|
||||
<answer>
|
||||
<para>如果你已经安装了 X11 并且 <application>sysinstall</application>
|
||||
在 &man.xterm.1; 或者 &man.rxvt.1; 中默认的颜色使得文字难以辩认,
|
||||
可以在你的 <filename>~.Xdefaults</filename> 中加入
|
||||
<literal>XTerm*color7: #c0c0c0</literal>
|
||||
获得深灰色的背景。</para>
|
||||
</answer>
|
||||
</qandaentry>
|
||||
</qandaset>
|
||||
</sect2>
|
||||
</sect1>
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
The FreeBSD Documentation Project
|
||||
The FreeBSD Simplified Chinese Project
|
||||
|
||||
Original Revision: 1.126
|
||||
Original Revision: 1.130
|
||||
$FreeBSD$
|
||||
-->
|
||||
|
||||
|
@ -362,7 +362,31 @@
|
|||
<secondary>运行 &os; 的大型站点</secondary>
|
||||
</indexterm>
|
||||
|
||||
<para>&os; 已被用来支持 Internet 上一些最大的站点,
|
||||
<para>&os; 被世界上最大的 IT 公司用作设备和产品的平台, 包括:</para>
|
||||
|
||||
<itemizedlist>
|
||||
<indexterm><primary>Apple</primary></indexterm>
|
||||
<listitem>
|
||||
<para><ulink url="http://www.apple.com/">Apple</ulink></para>
|
||||
</listitem>
|
||||
|
||||
<indexterm><primary>Cisco</primary></indexterm>
|
||||
<listitem>
|
||||
<para><ulink url="http://www.cisco.com/">Cisco</ulink></para>
|
||||
</listitem>
|
||||
|
||||
<indexterm><primary>Juniper</primary></indexterm>
|
||||
<listitem>
|
||||
<para><ulink url="http://www.juniper.com/">Juniper</ulink></para>
|
||||
</listitem>
|
||||
|
||||
<indexterm><primary>NetApp</primary></indexterm>
|
||||
<listitem>
|
||||
<para><ulink url="http://www.netapp.com/">NetApp</ulink></para>
|
||||
</listitem>
|
||||
</itemizedlist>
|
||||
|
||||
<para>&os; 也被用来支持 Internet 上一些最大的站点,
|
||||
包括:</para>
|
||||
|
||||
<itemizedlist>
|
||||
|
@ -371,15 +395,24 @@
|
|||
<para><ulink url="http://www.yahoo.com/">Yahoo!</ulink></para>
|
||||
</listitem>
|
||||
|
||||
<indexterm><primary>Yandex</primary></indexterm>
|
||||
<listitem>
|
||||
<para><ulink url="http://www.yandex.ru/">Yandex</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>
|
||||
<indexterm><primary>Rambler</primary></indexterm>
|
||||
<listitem>
|
||||
<para><ulink url="http://www.bluemountain.com/">Blue Mountain
|
||||
Arts</ulink></para>
|
||||
<para><ulink url="http://www.rambler.ru/">Rambler</ulink></para>
|
||||
</listitem>
|
||||
|
||||
<indexterm><primary>Sina</primary></indexterm>
|
||||
<listitem>
|
||||
<para><ulink url="http://www.sina.com/">Sina</ulink></para>
|
||||
</listitem>
|
||||
|
||||
<indexterm><primary>Pair Networks</primary></indexterm>
|
||||
|
@ -405,29 +438,12 @@
|
|||
<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>
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
The FreeBSD Documentation Project
|
||||
The FreeBSD Chinese Documentation Project
|
||||
|
||||
Original Revision: 1.186
|
||||
Original Revision: 1.190
|
||||
$FreeBSD$
|
||||
-->
|
||||
|
||||
|
@ -205,9 +205,9 @@ ath_hal(4) - Atheros Hardware Access Layer (HAL)</programlisting>
|
|||
在这个设备的手册页中有以下信息:</para>
|
||||
|
||||
<programlisting>Alternatively, to load the driver as a module at boot time, place the
|
||||
following line in &man.loader.conf.5:
|
||||
following line in &man.loader.conf.5:
|
||||
|
||||
if_ath_load="YES"</programlisting>
|
||||
if_ath_load="YES"</programlisting>
|
||||
|
||||
<para>遵照示例,在 <filename>/boot/loader.conf</filename> 中加入
|
||||
<literal>if_ath_load="YES"</literal>
|
||||
|
@ -299,7 +299,7 @@ ath_hal(4) - Atheros Hardware Access Layer (HAL)</programlisting>
|
|||
您可能几秒钟之后才会意识到您同时会删除定制的内核配置文件。
|
||||
另外, 也不要直接编辑 <filename>GENERIC</filename>,
|
||||
因为下次您
|
||||
<link linkend="cutting-edge">更新代码</link> 时它会被覆盖,
|
||||
<link linkend="updating-upgrading">更新代码</link> 时它会被覆盖,
|
||||
而您的修改也就随之丢失了。</para>
|
||||
|
||||
<para>您也可以考虑把内核配置文件放到别的地方,
|
||||
|
@ -340,7 +340,7 @@ ath_hal(4) - Atheros Hardware Access Layer (HAL)</programlisting>
|
|||
|
||||
<note>
|
||||
<para>如果您和 &os; project 进行了 <link
|
||||
linkend="cutting-edge">代码同步</link>,
|
||||
linkend="updating-upgrading">代码同步</link>,
|
||||
则一定要在进行任何更新之前查看
|
||||
<filename>/usr/src/UPDATING</filename>。
|
||||
这个文件中描述了更新过的代码中出现的重大问题或需要注意的地方。
|
||||
|
@ -1225,11 +1225,6 @@ device fwe # Ethernet over FireWire (non-standard!)</programl
|
|||
<para>进程不能接触大于4GB的VM空间。</para>
|
||||
</listitem>
|
||||
|
||||
<listitem>
|
||||
<para><acronym>KLD</acronym> 模块不能加载到一个打开了<acronym>PAE</acronym>支持的内核里面,
|
||||
这是因为内核模块和内核的建立框架不一样。</para>
|
||||
</listitem>
|
||||
|
||||
<listitem>
|
||||
<para>没有使用 &man.bus.dma.9; 接口的设备驱动程序在打开了
|
||||
<acronym>PAE</acronym> 支持的内核中会导致数据损坏。
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
The FreeBSD Documentation Project
|
||||
The FreeBSD Chinese Documentation Project
|
||||
|
||||
Original Revision: 1.124
|
||||
Original Revision: 1.126
|
||||
$FreeBSD$
|
||||
-->
|
||||
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
The FreeBSD Documentation Project
|
||||
The FreeBSD Simplified Chinese Project
|
||||
|
||||
Original Revision: 1.73
|
||||
Original Revision: 1.74
|
||||
$FreeBSD$
|
||||
-->
|
||||
|
||||
|
@ -783,12 +783,6 @@ test: biba/high</screen>
|
|||
|
||||
<screen>&prompt.root; <userinput>ugidfw add subject not uid root new object not uid root mode n</userinput></screen>
|
||||
|
||||
<note>
|
||||
<para>在 &os; 5.3 之前的版本中,
|
||||
<parameter>add</parameter> 参数并不存在。
|
||||
此时应使用 <parameter>set</parameter> 来代替它。
|
||||
请参见下面的命令例子。</para></note>
|
||||
|
||||
<para>这本身可能是一个很糟糕的主意,
|
||||
因为它会阻止所有用户执行哪怕最简单的命令, 例如
|
||||
<command>ls</command>。 更富于爱心的规则可能是:</para>
|
||||
|
@ -1183,6 +1177,7 @@ test: biba/high</screen>
|
|||
<para>这个安全策略模块最典型的用例是电子商务的 web 服务器,
|
||||
其上的文件服务保存公司的重要信息以及金融机构的情况。
|
||||
对于只有两三个用户的个人工作站而言, 则可能不甚适用。</para>
|
||||
</sect2>
|
||||
</sect1>
|
||||
|
||||
<sect1 id="mac-biba">
|
||||
|
@ -1721,7 +1716,7 @@ setpmac biba/10\(10-10\) /usr/local/etc/rc.d/nagios.sh forcestart</userinput></s
|
|||
<title>Error: &man..secure.path.3; cannot stat <filename>.login_conf</filename></title>
|
||||
|
||||
<para>当我试图从 <username>root</username>
|
||||
切换到其同中的其他用户时, 出现了错误提示
|
||||
用户切换到其同中的其他用户时, 出现了错误提示
|
||||
<errorname>_secure_path: unable to state .login_conf</errorname>。</para>
|
||||
|
||||
<para>这个提示通常在用户拥有高于它将要成为的那个用户的
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
The FreeBSD Documentation Project
|
||||
The FreeBSD Chinese Documentation Project
|
||||
|
||||
Original Revision: 1.451
|
||||
Original Revision: 1.455
|
||||
$FreeBSD$
|
||||
-->
|
||||
|
||||
|
@ -41,24 +41,11 @@
|
|||
<para>FreeBSD CD 和 DVD 光盘可以从许多在线零售商那里买到:</para>
|
||||
|
||||
<itemizedlist>
|
||||
<listitem>
|
||||
<address>
|
||||
<otheraddr>BSD Mall by Daemon News</otheraddr>
|
||||
<street>PO Box 161</street>
|
||||
<city>Nauvoo</city>, <state>IL</state> <postcode>62354</postcode>
|
||||
<country>USA</country>
|
||||
Phone: <phone>+1 866 273-6255</phone>
|
||||
Fax: <fax>+1 217 453-9956</fax>
|
||||
Email: <email>sales@bsdmall.com</email>
|
||||
WWW: <otheraddr><ulink url="http://www.bsdmall.com/"></ulink></otheraddr>
|
||||
</address>
|
||||
</listitem>
|
||||
|
||||
<listitem>
|
||||
<address>
|
||||
<otheraddr>FreeBSD Mall, Inc.</otheraddr>
|
||||
<street>3623 Sanford Street</street>
|
||||
<city>Concord</city>, <state>CA</state> <postcode>94520-1405</postcode>
|
||||
<street>700 Harvest Park Ste F</street>
|
||||
<city>Brentwood</city>, <state>CA</state> <postcode>94513</postcode>
|
||||
<country>USA</country>
|
||||
Phone: <phone>+1 925 240-6652</phone>
|
||||
Fax: <fax>+1 925 674-0821</fax>
|
||||
|
@ -252,6 +239,26 @@
|
|||
&chap.mirrors.ftp.inc;
|
||||
</sect1>
|
||||
|
||||
<sect1 id="mirrors-bittorrent">
|
||||
<title>BitTorrent</title>
|
||||
|
||||
<indexterm>
|
||||
<primary>BitTorrent</primary>
|
||||
</indexterm>
|
||||
|
||||
<para>基本发行版 CD 的 ISO 镜像也可以通过 BitTorrent 获得。
|
||||
用户下载镜像的 torrent 文件能够在这里找到 <ulink
|
||||
url="http://torrents.freebsd.org:8080/">http://torrents.freebsd.org:8080</ulink></para>
|
||||
|
||||
<para>BitTorrent 客户端软件可以从这个 port
|
||||
<filename role="package">net-p2p/py-bittorrent</filename>
|
||||
或预编译的二进制包安装。</para>
|
||||
|
||||
<para>在通过 BitTorrent 下载了 ISO 镜像之后,
|
||||
你可以照着 <xref linkend="burncd">burncd
|
||||
中的所描述的方法烧录到 CD 或 DVD 介质上。</para>
|
||||
</sect1>
|
||||
|
||||
<sect1 id="anoncvs">
|
||||
<title>匿名 CVS</title>
|
||||
|
||||
|
@ -2313,6 +2320,15 @@ doc/zh_*</screen>
|
|||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term>RELENG_6_4</term>
|
||||
|
||||
<listitem>
|
||||
<para>FreeBSD-6.4 的发行版分支, 只用于安全公告,
|
||||
以及其他重要更新。</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term>RELENG_6_3</term>
|
||||
|
||||
|
@ -2543,6 +2559,14 @@ doc/zh_*</screen>
|
|||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term>RELENG_6_4_0_RELEASE</term>
|
||||
|
||||
<listitem>
|
||||
<para>FreeBSD 6.4</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term>RELENG_6_3_0_RELEASE</term>
|
||||
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
The FreeBSD Documentation Project
|
||||
The FreeBSD Simplified Chinese Project
|
||||
|
||||
Original Revision: 1.109
|
||||
Original Revision: 1.113
|
||||
$FreeBSD$
|
||||
-->
|
||||
|
||||
|
@ -68,6 +68,11 @@
|
|||
<para>如何同步时间和日期,以及如何设置使用NTP协议的时间服务器。</para>
|
||||
</listitem>
|
||||
|
||||
<listitem>
|
||||
<para>如何配置标准的日志守护进程,
|
||||
<command>syslogd</command>, 接受远程主机的日志。</para>
|
||||
</listitem>
|
||||
|
||||
</itemizedlist>
|
||||
|
||||
<para>在阅读此章节之前,您应当:</para>
|
||||
|
@ -3929,7 +3934,20 @@ DocumentRoot /www/someotherdomain.tld
|
|||
|
||||
<para>如 <xref linkend="network-inetd-reread"> 所介绍的那样,
|
||||
修改这个文件之后, 必须让 <application>inetd</application> 重新加载它,
|
||||
才能使新的设置生效。</para>
|
||||
才能使新的设置生效。请参阅 <xref linkend="network-inetd-settings">
|
||||
以获取更多有关如何在你系统上启用 <application>inetd</application>
|
||||
的详细信息。</para>
|
||||
|
||||
<para><application>ftpd</application> 也可以作为一个独立的服务启动。
|
||||
这样的话就需要在 <filename>/etc/rc.conf</filename>
|
||||
中设置如下的变量:</para>
|
||||
|
||||
<programlisting>ftpd_enable="YES"</programlisting>
|
||||
|
||||
<para>在设置了上述变量之后,独立的服务将在下次系统重启的时候启动,
|
||||
或者通过以 <username>root</username> 身份手动执行如下的命令启动:</para>
|
||||
|
||||
<screen>&prompt.root; <userinput>/etc/rc.d/ftpd start</userinput></screen>
|
||||
|
||||
<para>现在可以通过输入下面的命令来登录您的 FTP 服务器了:</para>
|
||||
|
||||
|
@ -4446,6 +4464,241 @@ driftfile /var/db/ntp.drift</programlisting>
|
|||
</sect2>
|
||||
</sect1>
|
||||
|
||||
<sect1 id="network-syslogd">
|
||||
<sect1info>
|
||||
<authorgroup>
|
||||
<author>
|
||||
<firstname>Tom</firstname>
|
||||
<surname>Rhodes</surname>
|
||||
<contrib>Contributed by </contrib>
|
||||
</author>
|
||||
</authorgroup>
|
||||
</sect1info>
|
||||
|
||||
<title>使用 <command>syslogd</command> 记录远程主机的日志</title>
|
||||
|
||||
<para>处理系统日志对于系统安全和管理是一个重要方面。
|
||||
当有多台分布在中型或大型网络的机器,再或者是处于各种不同类型的网络中,
|
||||
监视他们上面的日志文件则显得非常难以操作, 在这种情况下,
|
||||
配置远程日志记录能使整个处理过程变得更加轻松。</para>
|
||||
|
||||
<para>集中记录日志到一台指定的机器能够减轻一些日志文件管理的负担。
|
||||
日志文件的收集, 合并与循环可以在一处配置,
|
||||
使用 &os; 原生的工具, 比如 &man.syslogd.8; 和 &man.newsyslog.8;。
|
||||
在以下的配置示例中, 主机 <hostid>A</hostid>, 命名为
|
||||
<hostid role="fqdn">logserv.example.com</hostid>,
|
||||
将用来收集本地网络的日志信息。 主机 <hostid>B</hostid>,
|
||||
命名为 <hostid role="fqdn">logclient.example.com</hostid>
|
||||
将把日志信息传送给服务器。 在现实中,
|
||||
这两个主机都需要配置正确的正向和反向的 <acronym>DNS</acronym>
|
||||
或者在 <filename>/etc/hosts</filename> 中记录。
|
||||
否则, 数据将被服务器拒收。</para>
|
||||
|
||||
<sect2>
|
||||
<title>日志服务器的配置</title>
|
||||
|
||||
<para>日志服务器是配置成用来接收远程主机日志信息的机器。
|
||||
在大多数的情况下这是为了方便配置, 或者是为了更好的管理。
|
||||
不论是何原因, 在继续深入之前需要提一些必需条件。</para>
|
||||
|
||||
<para>一个正确配置的日志服务器必须符合以下几个最基本的条件:</para>
|
||||
|
||||
<itemizedlist>
|
||||
<listitem>
|
||||
<para>服务器和客户端的防火墙规则允许 514 端口上的
|
||||
<acronym>UDP</acronym> 报文通过。</para>
|
||||
</listitem>
|
||||
|
||||
<listitem>
|
||||
<para>syslogd 被配置成接受从远程客户发来的消息。</para>
|
||||
</listitem>
|
||||
|
||||
<listitem>
|
||||
<para>syslogd 服务器和所有的客户端都必须有配有正确的正向和反向
|
||||
<acronym>DNS</acronym>, 或者在
|
||||
<filename>/etc/hosts</filename> 中有相应配置。</para>
|
||||
</listitem>
|
||||
</itemizedlist>
|
||||
|
||||
<para>配置日志服务器, 客户端必须在
|
||||
<filename>/etc/syslog.conf</filename> 中列出,
|
||||
并指定日志的 facility:</para>
|
||||
|
||||
<programlisting>+logclient.example.com
|
||||
*.* /var/log/logclient.log</programlisting>
|
||||
|
||||
<note>
|
||||
<para>更多关于各种被支持并可用的 <emphasis>facility</emphasis>
|
||||
能在 &man.syslog.conf.5; 手册页中找到。</para>
|
||||
</note>
|
||||
|
||||
<para>一旦加入以后, 所有此类 <literal>facility</literal>
|
||||
消息都会被记录到先前指定的文件
|
||||
<filename>/var/log/logclient.log</filename>。</para>
|
||||
|
||||
<para>最后, 日志文件应该被创建。 不论你用何种方法创建,
|
||||
比如 &man.touch.1; 能很好的完成此类任务:</para>
|
||||
|
||||
<screen>&prompt.root; <userinput>touch <filename>/var/log/logclient.log</filename></userinput></screen>
|
||||
|
||||
<para>此时, 应该重启并确认一下 <command>syslogd</command>
|
||||
守护进程:</para>
|
||||
|
||||
<screen>&prompt.root; <userinput>/etc/rc.d/syslogd restart</userinput>
|
||||
&prompt.root; <userinput>pgrep syslog</userinput></screen>
|
||||
|
||||
<para>如果返回了一个 <acronym>PIC</acronym> 的话,
|
||||
服务端应该被成功重启了, 并继续开始配置客户端。
|
||||
如果服务端没有重启的话, 请在
|
||||
<filename>/var/log/messages</filename>
|
||||
日志中查阅相关输出。</para>
|
||||
</sect2>
|
||||
|
||||
<sect2>
|
||||
<title>日志客户端配置</title>
|
||||
|
||||
<para>日志客户端是一台发送日志信息到日志服务器的机器,
|
||||
并在本地保存拷贝。</para>
|
||||
|
||||
<para>类似于日志服务器, 客户端也必须满足一些最基本的条件。</para>
|
||||
|
||||
<itemizedlist>
|
||||
<listitem>
|
||||
<para>&man.syslogd.8;
|
||||
必须被配置成发送指定类型的消息到能接收他们的日志服务器。</para>
|
||||
</listitem>
|
||||
|
||||
<listitem>
|
||||
<para>防火墙必须允许 512 端口上的 <acronym>UDP</acronym> 包通过。</para>
|
||||
</listitem>
|
||||
|
||||
<listitem>
|
||||
<para>必须配置正向与反向 <acronym>DNS</acronym>,
|
||||
或者在 <filename>/etc/hosts</filename> 中有正确的记录。</para>
|
||||
</listitem>
|
||||
</itemizedlist>
|
||||
|
||||
<para>相比服务器来说配置客户端更轻松一些。
|
||||
客户端的机器在 <filename>/etc/rc.conf</filename>
|
||||
中做如下的设置:</para>
|
||||
|
||||
<programlisting>syslogd_enable="YES"
|
||||
syslogd_flags="-a logclient.example.com -vv"</programlisting>
|
||||
|
||||
<para>第一个选项将在机器启动的时候启用 <command>syslogd</command>
|
||||
守护进程, 第二行允许在这台服务器上接收从客户端发送来的数据。
|
||||
后面的部分, 使用 <option>-vv</option> 增加日志消息的冗长程度。
|
||||
这对于调整 facility 非常有用,
|
||||
因为管理能够看见何种消息被发送至哪一级 facility。</para>
|
||||
|
||||
<para>Facility 是描述某个消息由系统的哪部分生成的。 举例来说,
|
||||
<acronym>ftp</acronym> 和 <acronym>ipfw</acronym> 都是 facility。
|
||||
当这两项服务生成日志消息时, 它们通常在日志消息中包含了这两种工具。
|
||||
Facility 通常带有一个优先级或等级,
|
||||
就是用来标记一个日志消息的重要程度。 最普通的为
|
||||
<literal>warning</literal> 和 <literal>info</literal>。
|
||||
请参阅 &man.syslog.3; 手册页以获得一个完整可用的
|
||||
facility 与优先级列表。</para>
|
||||
|
||||
<para>日志服务器必须在客户端的 <filename>/etc/syslog.conf</filename>
|
||||
中指明。 在此例中, <literal>@</literal>
|
||||
符号被用来表示发送日志数据到远程的服务器,
|
||||
看上去差不多如下这样:</para>
|
||||
|
||||
<programlisting>*.* @logserv.example.com</programlisting>
|
||||
|
||||
<para>添加后, 必须重启 <command>syslogd</command>
|
||||
使得上述修改生效:</para>
|
||||
|
||||
<screen>&prompt.root; <userinput>/etc/rc.d/syslogd restart</userinput></screen>
|
||||
|
||||
<para>测试日志消息是否能通过网络发送,
|
||||
使用 &man.logger.1; 发送一段消息至
|
||||
<command>syslogd</command>:</para>
|
||||
|
||||
<screen>&prompt.root; <userinput>logger "Test message from logclient"</userinput></screen>
|
||||
|
||||
<para>这段消息现在应该出现在客户和服务端上的
|
||||
<filename>/var/log/messages</filename>。</para>
|
||||
</sect2>
|
||||
|
||||
<sect2>
|
||||
<title>调试日志服务器</title>
|
||||
|
||||
<para>在某些情况下, 如果日志服务器没有收到消息的话就需要调试一番了。
|
||||
有几个可能的原因, 最常见的两个是网络连接的问题和
|
||||
<acronym>DNS</acronym> 的问题。 为了测试这些问题,
|
||||
请确认两边的机器都能使用 <filename>/etc/rc.conf</filename>
|
||||
中所设定的主机名访问到对方。 如果这个能正常工作的话,
|
||||
那么就需要对 <filename>/etc/rc.conf</filename>
|
||||
中的 <literal>syslogd_flags</literal> 选项做些修改了。</para>
|
||||
|
||||
<para>在以下的示例中,
|
||||
<filename>/var/log/logclient.log</filename> 是空的,
|
||||
<filename>/var/log/message</filename> 中也没有表明任何失败的原因。
|
||||
为了增加调试的输出, 修改 <literal>ayalogd_flags</literal>
|
||||
选项至类似于如下的示例, 并重启服务:</para>
|
||||
|
||||
<programlisting>syslogd_flags="-d -a logclien.example.com -vv"</programlisting>
|
||||
|
||||
<screen>&prompt.root; <userinput>/etc/rc.d/syslogd restart</userinput></screen>
|
||||
|
||||
<para>在重启服务之后, 屏幕上将立刻闪现类似这样的调试数据:</para>
|
||||
|
||||
<screen>logmsg: pri 56, flags 4, from logserv.example.com, msg syslogd: restart
|
||||
syslogd: restarted
|
||||
logmsg: pri 6, flags 4, from logserv.example.com, msg syslogd: kernel boot file is /boot/kernel/kernel
|
||||
Logging to FILE /var/log/messages
|
||||
syslogd: kernel boot file is /boot/kernel/kernel
|
||||
cvthname(192.168.1.10)
|
||||
validate: dgram from IP 192.168.1.10, port 514, name logclient.example.com;
|
||||
rejected in rule 0 due to name mismatch.</screen>
|
||||
|
||||
<para>很明显,消息是由于主机名不匹配而被拒收的。
|
||||
在一点一点的检查了配置文件之后, 发现了
|
||||
<filename>/etc/rc.conf</filename> 中如下这行有输入错误:</para>
|
||||
|
||||
<programlisting>syslogd_flags="-d -a logclien.example.com -vv"</programlisting>
|
||||
|
||||
<para>这行应该包涵有 <literal>logclient</literal>, 而不是
|
||||
<literal>logclien</literal>。
|
||||
在做了正确的修改并重启之后便能见到预期的效果了:</para>
|
||||
|
||||
<screen>&prompt.root; <userinput>/etc/rc.d/syslogd restart</userinput>
|
||||
logmsg: pri 56, flags 4, from logserv.example.com, msg syslogd: restart
|
||||
syslogd: restarted
|
||||
logmsg: pri 6, flags 4, from logserv.example.com, msg syslogd: kernel boot file is /boot/kernel/kernel
|
||||
syslogd: kernel boot file is /boot/kernel/kernel
|
||||
logmsg: pri 166, flags 17, from logserv.example.com,
|
||||
msg Dec 10 20:55:02 <syslog.err> logserv.example.com syslogd: exiting on signal 2
|
||||
cvthname(192.168.1.10)
|
||||
validate: dgram from IP 192.168.1.10, port 514, name logclient.example.com;
|
||||
accepted in rule 0.
|
||||
logmsg: pri 15, flags 0, from logclient.example.com, msg Dec 11 02:01:28 trhodes: Test message 2
|
||||
Logging to FILE /var/log/logclient.log
|
||||
Logging to FILE /var/log/messages</screen>
|
||||
|
||||
<para>此刻, 消息能够被正确接收并保存入文件了。</para>
|
||||
</sect2>
|
||||
|
||||
<sect2>
|
||||
<title>安全性方面的思考</title>
|
||||
|
||||
<para>就像其他的网络服务一样, 在实现配置之前需要考虑安全性。
|
||||
有时日志文件也包含了敏感信息, 比如本地主机上所启用的服务,
|
||||
用户帐号和配置数据。 从客户端发出的数据经过网络到达服务器,
|
||||
这期间既没有加密也没有密码保护。 如果有加密需要的话,
|
||||
可以使用 <filename role="package">security/stunnel</filename>,
|
||||
它将在一个加密的隧道中传输数据。</para>
|
||||
|
||||
<para>本地安全也同样是个问题。 日志文件在使用中或循环转后都没有被加密。
|
||||
本地用户可能读取这些文件以获得对系统更深入的了解。
|
||||
对于这类情况, 给这些文件设置正确的权限是非常有必要的。
|
||||
&man.newsyslog.8; 工具支持给新创建和循环的日志设置权限。
|
||||
把日志文件的权限设置为 <literal>600</literal>
|
||||
能阻止本地用户不必要的窥探。</para>
|
||||
</sect2>
|
||||
</sect1>
|
||||
</chapter>
|
||||
|
||||
<!--
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
The FreeBSD Documentation Project
|
||||
The FreeBSD Simplified Chinese Documentation Project
|
||||
|
||||
Original Revision: 1.284
|
||||
Original Revision: 1.286
|
||||
$FreeBSD$
|
||||
-->
|
||||
|
||||
|
@ -299,10 +299,20 @@ R-deps: </screen>
|
|||
<!-- 30 Mar 2001 -->
|
||||
</sect1info>
|
||||
|
||||
<title>使用Packages系统</title>
|
||||
<title>使用 Package 系统</title>
|
||||
|
||||
<para>在 FreeBSD 系统上有几种不同的工具用来管理 package:</para>
|
||||
|
||||
<itemizedlist>
|
||||
<listitem><para><command>sysinstall</command>
|
||||
能够在一个运行的系统上被调用来安装, 删除和列出已安装的 package。
|
||||
请参阅 <xref
|
||||
linkend="install-post"> 安装后的配置获取更多详细信息。</para></listitem>
|
||||
<listitem><para>以下章节将介绍基于命令行的 package 管理工具。</para></listitem>
|
||||
</itemizedlist>
|
||||
|
||||
<sect2>
|
||||
<title>一个package的安装</title>
|
||||
<title>一个 package 的安装</title>
|
||||
<indexterm>
|
||||
<primary>packages</primary>
|
||||
<secondary>installing</secondary>
|
||||
|
@ -599,7 +609,7 @@ docbook =
|
|||
|
||||
<screen>&prompt.root; <userinput>pkg_add -r portsnap</userinput></screen>
|
||||
|
||||
<para>请参见 <link linkend="updating-portsnap">使用 Portsnap</link>
|
||||
<para>请参见 <link linkend="updating-upgrading-portsnap">使用 Portsnap</link>
|
||||
以了解关于全部 <application>Portsnap</application>
|
||||
功能的详细描述。</para>
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
<!--
|
||||
The FreeBSD Chinese Documentation Project
|
||||
|
||||
Original Revision: 1.41
|
||||
Original Revision: 1.46
|
||||
$FreeBSD$
|
||||
-->
|
||||
|
||||
|
@ -21,12 +21,40 @@
|
|||
|
||||
<para>要获得附加的信息来源列表,请查阅 <xref linkend="bibliography">。</para>
|
||||
|
||||
<bridgehead id="preface-changes-from2" renderas=sect1>相对于第二版的改动</bridgehead>
|
||||
<bridgehead id="preface-changes-from3" renderas=sect1>相对于第三版的改动</bridgehead>
|
||||
|
||||
<para>目前的在线手册代表了数百位贡献者过去 10 年多所累积的努力成果。
|
||||
以下是自 2004 年出版的两卷第三版之后的一些重要变更:</para>
|
||||
|
||||
<itemizedlist>
|
||||
<listitem>
|
||||
<para><xref linkend="dtrace">, &dtrace;, 增加了有关强大的 &dtrace;
|
||||
性能分析工具有关的信息。</para>
|
||||
</listitem>
|
||||
|
||||
<listitem>
|
||||
<para><xref linkend="filesystems">, 文件系统支持,
|
||||
增加 &os; 上非原生文件系统有关的信息,
|
||||
比如 &sun; 的 ZFS。</para>
|
||||
</listitem>
|
||||
|
||||
<listitem>
|
||||
<para><xref linkend="audit">, 安全事件审计,
|
||||
增加了 &os; 新的审计功能和使用方法。</para>
|
||||
</listitem>
|
||||
|
||||
<listitem>
|
||||
<para><xref linkend="virtualization">, 虚拟化,
|
||||
增加了在虚拟化软件上安装 &os; 有关的信息。</para>
|
||||
</listitem>
|
||||
</itemizedlist>
|
||||
|
||||
<bridgehead id="preface-changes-from2" renderas=sect1>相对于第二版的改动 (2004)</bridgehead>
|
||||
|
||||
<para>您目前看到的这本手册的第三版是 FreeBSD 文档计划的成员历时两年完成的顶峰之作。
|
||||
这一版的内容已经增长到需要分成两卷才能印刷出版。
|
||||
第三版包含了如下的的主要变动:</para>
|
||||
|
||||
|
||||
<itemizedlist>
|
||||
<listitem>
|
||||
<para><xref linkend="config-tuning">, 配置和优化, 进行了扩充并增加了关于
|
||||
|
@ -89,7 +117,7 @@
|
|||
</itemizedlist>
|
||||
|
||||
<bridgehead id="preface-changes" renderas=sect1>
|
||||
相对于第一版的改变</bridgehead>
|
||||
相对于第一版的改变 (2001)</bridgehead>
|
||||
|
||||
<para>
|
||||
本手册的第二版是 FreeBSD 文档计划的成员历时两年完成的顶峰之作。
|
||||
|
@ -177,7 +205,7 @@
|
|||
|
||||
<bridgehead id="preface-overview" renderas=sect1>本手册的组织</bridgehead>
|
||||
|
||||
<para>这本手册分成了三个逻辑清晰的部分。第一部分
|
||||
<para>这本手册分成了五个逻辑清晰的部分。第一部分
|
||||
<emphasis>起步</emphasis> 涵盖了 FreeBSD 的安装和基本使用方法。
|
||||
读者可根据自己的情况按顺序或者跳过一些熟悉的主题来阅读。第二部分
|
||||
<emphasis>常用操作</emphasis> 涵盖了 FreeBSD 常用的功能,
|
||||
|
@ -363,31 +391,24 @@
|
|||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term><emphasis><xref linkend="cutting-edge">, 最前沿</emphasis></term>
|
||||
<term><emphasis><xref linkend="updating-upgrading">, 更新与升级 &os;</emphasis></term>
|
||||
<listitem>
|
||||
<para>介绍了 FreeBSD-STABLE、
|
||||
FreeBSD-CURRENT 以及 FreeBSD 发行版本之间的差异。
|
||||
描述了一般用户如何紧跟开发过程并从中受益。</para>
|
||||
FreeBSD-CURRENT 以及 FreeBSD 发行版本之间的差异。
|
||||
描述了一般用户如何紧跟开发过程并从中受益。
|
||||
涵盖了如何更新用户的系统至发行版最新安全修正的方法。</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term><emphasis><xref linkend="dtrace">, Dtrace</emphasis></term>
|
||||
<term><emphasis><xref linkend="dtrace">, &dtrace;</emphasis></term>
|
||||
<listitem>
|
||||
<para>本章描述了如何在 &os; 上配置和使用 &sun; 的 DTrace 工具.
|
||||
<para>本章描述了如何在 &os; 上配置和使用 &sun; 的 &dtrace; 工具.
|
||||
动态跟踪可以通过实时的系统分析,帮助找出系统性能瓶颈。</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
<!-- Part IV - Network Communications -->
|
||||
|
||||
<varlistentry>
|
||||
<term><emphasis><xref linkend="updating">, 更新 &os;</emphasis></term>
|
||||
<listitem>
|
||||
<para>本章描述了最新的用来更新 &os; 系统的工具。基本系统中的
|
||||
&man.freebsd-update.8; 和 Ports Collection 中的
|
||||
&man.portsnap.8;。</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term><emphasis><xref linkend="serialcomms">, 串行通信</emphasis></term>
|
||||
<listitem>
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
The FreeBSD Documentation Project
|
||||
The FreeBSD Simplified Chinese Project
|
||||
|
||||
Original Revision: 1.130
|
||||
Original Revision: 1.133
|
||||
$FreeBSD$
|
||||
-->
|
||||
|
||||
|
@ -1947,7 +1947,10 @@ raisechar=^^</programlisting>
|
|||
在启动时不要探测键盘。 您的 BIOS 不应抱怨键盘不存在。
|
||||
即使这一标志设置为 <quote>Not
|
||||
installed</quote> 时, 只要把键盘插上,
|
||||
它就仍可使用。</para>
|
||||
它就仍可使用。 如果以上的选项不存在于 BIOS 中,
|
||||
可尝试寻找 <quote>Halt on Error</quote> 选项。
|
||||
把这一项设置为 <quote>All but Keyboard</quote>
|
||||
或者是 <quote>No Errors</quote>, 都能器到相同的作用。</para>
|
||||
</tip>
|
||||
|
||||
<note>
|
||||
|
@ -2249,7 +2252,7 @@ boot:</screen>
|
|||
</sect3>
|
||||
|
||||
<sect3>
|
||||
<title>例2:您为sio0设置标记为0x30</title>
|
||||
<title>例2:您为 <devicename>sio0</devicename> 设置标记为 0x30</title>
|
||||
|
||||
<programlisting>device sio0 at isa? port IO_COM1 flags 0x30 irq 4</programlisting>
|
||||
|
||||
|
@ -2370,7 +2373,7 @@ console="comconsole,vidconsole"</programlisting>
|
|||
|
||||
<procedure>
|
||||
<step>
|
||||
<para>取得内核源代码 (参考 <xref linkend="cutting-edge">)。</para>
|
||||
<para>取得内核源代码 (参考 <xref linkend="updating-upgrading">)。</para>
|
||||
</step>
|
||||
|
||||
<step>
|
||||
|
|
|
@ -1,477 +0,0 @@
|
|||
<!--
|
||||
Original Revision: 1.1
|
||||
$FreeBSD$
|
||||
-->
|
||||
|
||||
<chapter id="updating">
|
||||
<chapterinfo>
|
||||
<authorgroup>
|
||||
<author>
|
||||
<firstname>Tom</firstname>
|
||||
<surname>Rhodes</surname>
|
||||
<contrib>Written by </contrib>
|
||||
</author>
|
||||
</authorgroup>
|
||||
<authorgroup>
|
||||
<author>
|
||||
<firstname>Colin</firstname>
|
||||
<surname>Percival</surname>
|
||||
<contrib>Based on notes provided by </contrib>
|
||||
</author>
|
||||
</authorgroup>
|
||||
</chapterinfo>
|
||||
|
||||
<title>更新 &os;</title>
|
||||
|
||||
<sect1 id="updating-synopsis">
|
||||
<title>概述</title>
|
||||
|
||||
<indexterm><primary>Updating FreeBSD</primary></indexterm>
|
||||
<indexterm>
|
||||
<primary>freebsd-update</primary>
|
||||
<see>Updating</see>
|
||||
</indexterm>
|
||||
|
||||
<para>长久以来,&os 操作系统的一个主要方面始终没有改变,
|
||||
那就是使用应用程序和工具去获得系统各种大大小小的更新。</para>
|
||||
|
||||
<para>多年来用户升级他们的系统,收集安全补丁,
|
||||
无损 Ports Collection 更新 ports 和 package
|
||||
唯一的选择是使用 <application>CVSup</application>
|
||||
工具。</para>
|
||||
|
||||
<para>当然原来的 <application>CVSup</application> 仍被支持,
|
||||
现在有一个 C 语言的版本加入了 &os;,
|
||||
并且有些新的方法能用来获得系统更新。</para>
|
||||
|
||||
<para>类似像 &man.portsnap.8; 和 &man.freebsd-update.8;
|
||||
这样的工具使得升级过程变得更加简便有效。
|
||||
这些新的方法在提高效率的同时也给用户提供一个简洁的接口。
|
||||
一些新的工具能通过 &man.cron.8; 执行,
|
||||
从而减少系统管理员的人为介入,这会有益于那些管理着成百上千台 &os;
|
||||
的人。<para>
|
||||
|
||||
<para>这一章节将会介绍这些新的方法,
|
||||
以及用户跟系统管理如何从这些新方法的实用和易用中获益。</para>
|
||||
|
||||
<para>在阅读了这章以后,你将了解:</para>
|
||||
|
||||
<itemizedlist>
|
||||
<listitem>
|
||||
<para>哪些工具能被用来更新系统和 Ports Collection。<para>
|
||||
</listitem>
|
||||
|
||||
<listitem>
|
||||
<para>如何使用 <command>freebsd-update</command>
|
||||
打安全补丁和完成主要及次要的 &os; 升级。</para>
|
||||
</listitem>
|
||||
|
||||
<listitem>
|
||||
<para>如何比较已安装的系统与原来已知拷贝的状态。</para>
|
||||
</listitem>
|
||||
</itemizedlist>
|
||||
|
||||
<para>在阅读这章之前,你应该:</para>
|
||||
|
||||
<itemizedlist>
|
||||
<listitem>
|
||||
<para>了解一些 &unix; 和 &os; 的基础知识
|
||||
(<xref linkend="basics">)。</para>
|
||||
</listitem>
|
||||
|
||||
<listitem>
|
||||
<para>熟悉基本的内核配置/编译方法
|
||||
(<xref linkend="kernelconfig">)。</para>
|
||||
</listitem>
|
||||
|
||||
<listitem>
|
||||
<para>熟悉使用 Ports Collection 在 &os;
|
||||
上安装第三方的应用程序
|
||||
(<xref linkend="ports">)。</para>
|
||||
</listitem>
|
||||
|
||||
<listitem>
|
||||
<para>熟悉组成 &os; 的各个部分以及使用
|
||||
&man.mergemaster.8; 工具
|
||||
(<xref linkend="cutting-edge">)。</para>
|
||||
</listitem>
|
||||
</itemizedlist>
|
||||
</sect1>
|
||||
|
||||
<sect1 id="updating-freebsdupdate">
|
||||
<title>FreeBSD 更新</title>
|
||||
|
||||
<para>打安全补丁是对于维护计算机软件的一个重要部分,
|
||||
特别是对于操作系统。对于 &os; 来说,
|
||||
很长的一段时间以来这都不是一件容易的事情。
|
||||
补丁打在源代码上,代码需要被重新编译为二进制,
|
||||
然后再重新安装编译后的程序。</para>
|
||||
|
||||
<para>&os; 引入了 <command>freebsd-update</command>
|
||||
工具之后这便不再是问题了。这个工具提供了 2 种功能。
|
||||
第一,它可以把二进制的安全和勘误更新直接应用于 &os;
|
||||
的基本系统,而不需要重新编译和安装。第二,
|
||||
这个工具还支持主要跟次要的发行版的升级。</para>
|
||||
|
||||
<note>
|
||||
<para>由安全小组支持的各种体系结构和发行版都可使用二进制更新。
|
||||
然而有些特性,比如升级 &os; 操作系统需要最近的 &man.freebsd-update.8;
|
||||
和 &os; 6.3。在升级到一个新的发行版本之前,
|
||||
应先阅读一下当前发行版的声明,
|
||||
因为他们可能包含有关于你期望升级版本的重要消息。
|
||||
这些发行声明可以通过以下链接查阅:
|
||||
<ulink url="http://www.FreeBSD.org/releases/"></ulink>。</para>
|
||||
</note>
|
||||
|
||||
<para>如果 <command>crontab</command> 中存在有用到
|
||||
<command>freebsd-update</command> 特性的部分,
|
||||
那么这些在开始以下操作前必须先被禁止。最新版本的
|
||||
<command>freebsd-update</command> 可以通过上面的
|
||||
<acronym>URL</acronym> 下载用 <command>tar</command>
|
||||
和 <command>gzip</command> 打包的版本,
|
||||
并按照下面的命令安装:</para>
|
||||
|
||||
<screen>&prompt.root; <userinput>gunzip -c freebsd-update-upgrade.tgz | tar xvf -</userinput>
|
||||
&prompt.root; <userinput>mv freebsd-update.sh /usr/sbin/freebsd-update</userinput>
|
||||
&prompt.root; <userinput>mv freebsd-update.conf /etc</userinput></screen>
|
||||
|
||||
<para>对于所有当前流行的发行版本来说,
|
||||
并不需要下载最新版。</para>
|
||||
|
||||
<sect2>
|
||||
<title>配置文件</title>
|
||||
|
||||
<para>有些用户可能希望调整配置文件来更好的控制升级过程。
|
||||
可用参数的文档非常齐全,
|
||||
但下面的这些可能需要进一步的解释:</para>
|
||||
|
||||
<programlisting># Components of the base system which should be kept updated.
|
||||
Components src world kernel</programlisting>
|
||||
|
||||
<para>这个参数是控制 &os; 的哪一部分将被保持更新。
|
||||
默认的是更新源代码,整个基本系统还有内核。
|
||||
这些部件跟安装时的那些相同,举例来说,
|
||||
在这里加入 “world/games” 就会允许打入游戏相关的补丁。
|
||||
使用 “src/bin” 则是允许更新
|
||||
<filename class="directory">src/bin</filename>
|
||||
目录中的源代码。</para>
|
||||
|
||||
<para>最好的选择是把这个选项保留为默认值,
|
||||
因为如果要修改它去包含一些指定的选项,
|
||||
就需要用户列出每一个想要更新的项目。
|
||||
这可能会引起可怕的后果,
|
||||
因为部分的源代码和二进制程序得不到同步。</para>
|
||||
|
||||
<programlisting># Paths which start with anything matching an entry in an IgnorePaths
|
||||
# statement will be ignored.
|
||||
IgnorePaths</programlisting>
|
||||
|
||||
<para>添加路径,比如
|
||||
<filename class="directory">/bin</filename> 或者
|
||||
<filename class="directory">/sbin</filename>
|
||||
让这些指定的目录在更新过程中不被修改。
|
||||
这个选项能够防止本地的修改被
|
||||
<command>freebsd-update</command> 覆盖。</para>
|
||||
|
||||
<programlisting># Paths which start with anything matching an entry in an UpdateIfUnmodified
|
||||
# statement will only be updated if the contents of the file have not been
|
||||
# modified by the user (unless changes are merged; see below).
|
||||
UpdateIfUnmodified /etc/ /var/ /root/ /.cshrc /.profile</programlisting>
|
||||
|
||||
<para>更新指定目录中的未被修改的配置文件。
|
||||
用户的任何修改都会使这些文件的自动更新失效。
|
||||
还有另外一个选项,
|
||||
<literal>KeepModifiedMetadata</literal>,
|
||||
这个能让 <command>freebsd-update</command>
|
||||
在合并时保存修改。</para>
|
||||
|
||||
<programlisting># When upgrading to a new &os; release, files which match MergeChanges
|
||||
# will have any local changes merged into the version from the new release.
|
||||
MergeChanges /etc/ /var/named/etc/</programlisting>
|
||||
|
||||
<para>一个 <command>freebsd-update</command>
|
||||
应该尝试合并的配置文件的列表。文件合并的过程是
|
||||
一系列的 &man.diff.1; 补丁类似于更少选项的 &man.mergemaster.8;
|
||||
合并的选项是接受,打开一个文本编辑器,或者
|
||||
<command>freebsd-update</command> 会被中止。
|
||||
在不能确定的时候,请先备份 <filename class="directory">/etc</filename>
|
||||
然后接受合并。更多关于 <command>mergemaster</command>
|
||||
的信息请参阅 <xref linkend="cutting-edge">。</para>
|
||||
|
||||
<programlisting># Directory in which to store downloaded updates and temporary
|
||||
# files used by &os; Update.
|
||||
# WorkDir /var/db/freebsd-update</programlisting>
|
||||
|
||||
<para>这个目录是放置所有补丁和临时文件的。
|
||||
用户做一个版本升级的话,请确认此处至少有 1 GB
|
||||
的可用磁盘空间。</para>
|
||||
|
||||
<programlisting># When upgrading between releases, should the list of Components be
|
||||
# read strictly (StrictComponents yes) or merely as a list of components
|
||||
# which *might* be installed of which &os; Update should figure out
|
||||
# which actually are installed and upgrade those (StrictComponents no)?
|
||||
# StrictComponents no</programlisting>
|
||||
|
||||
<para>当设置成 <literal>yes</literal> 时,
|
||||
<command>freebsd-udpate</command> 将假设这个
|
||||
<literal>Components</literal> 列表时完整的,
|
||||
并且对此列表以外的项目不会修改。实际上就是
|
||||
<command>freebsd-update</command> 会尝试更新
|
||||
<literal>Componets</literal>
|
||||
列表里的每一个文件。</para>
|
||||
</sect2>
|
||||
|
||||
<sect2>
|
||||
<title>安全补丁</title>
|
||||
|
||||
<para>安全补丁存储在远程的机器上,
|
||||
可以使用如下的命令下载并安装:</para>
|
||||
|
||||
<screen>&prompt.root; <userinput>freebsd-update fetch</userinput>
|
||||
&prompt.root; <userinput>freebsd-update install</userinput></screen>
|
||||
|
||||
<para>如果给内核打了补丁,那么系统需要重新启动。
|
||||
如果一切都进展顺利,系统就应该被打好了补丁而且
|
||||
<command>freebsd-update</command> 可由夜间
|
||||
&man.cron.8; 执行。在 <filename>/etc/crontab</filename>
|
||||
中加入以下条目足以完成这项任务:</para>
|
||||
|
||||
<programlisting>@daily root freebsd-update cron</programlisting>
|
||||
|
||||
<para>这条记录是说明每天运行一次
|
||||
<command>freebsd-update</command>。用这种方法,
|
||||
使用了 <option>cron</option> 参数,
|
||||
<command>freebsd-update</command> 仅检查是否存在更新。
|
||||
如果有了新的补丁,就会自动下载到本地的磁盘,
|
||||
但不会自动给系统打上。<username>root</username>
|
||||
会收到一封电子邮件告知需手动安装补丁。</para>
|
||||
|
||||
<para>如果出现了错误,可以使用下面的
|
||||
<command>freebsd-update</command>
|
||||
命令回退到上一次的修改:</para>
|
||||
|
||||
<screen>&prompt.root; <userinput>freebsd-update rollback</userinput></screen>
|
||||
|
||||
<para>完成以后如果内核或任何的内核模块被修改的话,
|
||||
就需要重新启动系统。这将使 &os;
|
||||
装载新的二进制程序进内存。</para>
|
||||
|
||||
<note>
|
||||
<para><command>freebsd-update</command> 只能应用于
|
||||
<filename>GENERIC</filename> 内核。如果对
|
||||
<filename>GENERIC</filename>
|
||||
做了任何修改或者安装了一个自行编译的内核,
|
||||
<command>freebsd-update</command>
|
||||
就无法完成升级 — 如前一个范例那样失败后
|
||||
产生一条错误信息。</para>
|
||||
</note>
|
||||
</sect2>
|
||||
|
||||
<sect2>
|
||||
<title>重大和次要的更新</title>
|
||||
|
||||
<para>这个过程会删除旧的目标文件和库,
|
||||
这将使大部分的第三方应用程序无法删除。
|
||||
建议将所有安装的 ports 先删除然后重新安装,或者稍后使用
|
||||
<filename role="package">ports-mgmt/portupgrade</filename>
|
||||
工具升级。 大多数用户将会使用如下命令尝试编译:</para>
|
||||
|
||||
<screen>&prompt.root; <userinput>portupgrade -af</userinput></screen>
|
||||
|
||||
<para>这将确保所有的东西都会被正确的重新安装。
|
||||
请注意环境变量 <makevar>BATCH</makevar> 设置成
|
||||
<literal>yes</literal> 的话将在整个过程中对所有询问回答
|
||||
<literal>yes</literal>,这会帮助在编译过程中免去人工的介入。</para>
|
||||
|
||||
<para>重大和次要的更新可以由
|
||||
<command>freebsd-update</command> 命令后指定一个发行版本来执行,
|
||||
举例来说,下面的命令将帮助你升级到 &os; 6.3:</para>
|
||||
|
||||
<screen>&prompt.root; <userinput>freebsd-update -r 6.3-RELEASE upgrade</userinput></screen>
|
||||
|
||||
<para>在这个命令被执行后,<command>freebsd-update</command>
|
||||
将会先解析配置文件和评估当前的系统以获得更新系统所需的必要信息。
|
||||
然后便会显示出一个包含了已检测到与未检测到的组件列表。
|
||||
例如:</para>
|
||||
|
||||
<screen>Looking up update.FreeBSD.org mirrors... 1 mirrors found.
|
||||
Fetching metadata signature for 6.3-BETA1 from update1.FreeBSD.org... done.
|
||||
Fetching metadata index... done.
|
||||
Inspecting system... done.
|
||||
|
||||
The following components of FreeBSD seem to be installed:
|
||||
kernel/smp src/base src/bin src/contrib src/crypto src/etc src/games
|
||||
src/gnu src/include src/krb5 src/lib src/libexec src/release src/rescue
|
||||
src/sbin src/secure src/share src/sys src/tools src/ubin src/usbin
|
||||
world/base world/info world/lib32 world/manpages
|
||||
|
||||
The following components of FreeBSD do not seem to be installed:
|
||||
kernel/generic world/catpages world/dict world/doc world/games
|
||||
world/proflibs
|
||||
|
||||
Does this look reasonable (y/n)? y</screen>
|
||||
|
||||
<para>此时,<command>freebsd-update</command>
|
||||
将会尝试下载所有升级所需的文件。在某些情况下,
|
||||
用户可能被问及需安装些什么和如何进行之类的问题。<para>
|
||||
|
||||
<para>下载完所有的补丁之后,它们很快就会被打上。
|
||||
这个过程可能会持续一段时间,取决与机器的速度和当前的负载情况。
|
||||
配置文件将会被合并 — 这一部分需要用户的参与,
|
||||
因为文件可能被合并或者屏幕上弹出了一个文本编辑器用来手工合并。
|
||||
在处理过程中,每一个成功的合并都会给用户显示出来。
|
||||
失败或者被忽略的合并则会引起合并程序的中止。
|
||||
用户可能想要备份一下 <filename class="directory">/etc</filename>
|
||||
之后手工合并重要的文件,比如
|
||||
<filename>master.passwd</filename> 或
|
||||
<filename>group</filename>。</para>
|
||||
|
||||
<note>
|
||||
<para>系统至此还没有被修改,所有的补丁和合并都在另外一个目录中进行。
|
||||
当所有的补丁都被成功的打上了以后,所有的配置文件都被合并后,
|
||||
我们就已经完成了整个升级过程中最困难的部分,
|
||||
下面就需要用户来安装这些变更了。</para>
|
||||
</note>
|
||||
|
||||
<para>一旦这个步骤完成后,使用如下的命令将升级后的文件安装到磁盘上。</para>
|
||||
|
||||
<screen>&prompt.root; <userinput>freebsd-update install</userinput></screen>
|
||||
|
||||
<para>内核与内核模块会先被打上补丁。此时机器必须要重新启动。
|
||||
使用下面的命令重启机器,这样新的内核将载入内存:</para>
|
||||
|
||||
<screen>&prompt.root; <userinput>shutdown -r now</userinput></screen>
|
||||
|
||||
<para>在系统重新上线后,需要再次运行 <command>freebsd-update</command>。
|
||||
升级的状态被保存着,这样 <command>freebsd-update</command>
|
||||
就无需重头开始,但是会删除所有旧的共享库和目标文件。
|
||||
执行如下命令继续这个阶段的升级:</para>
|
||||
|
||||
<screen>&prompt.root; <userinput>freebsd-update install</userinput></screen>
|
||||
|
||||
<note>
|
||||
<para>取决与是否有库的版本更新,通常只有 2 个而不是
|
||||
3 个安装阶段。</para>
|
||||
</note>
|
||||
|
||||
<para>现在需要重新编译和安装第三方软件。
|
||||
这么做的原因是某些已安装的软件可能依赖于在升级过程中已删除的库。
|
||||
可使用 <filename role="package">ports-mgmt/portupgrade</filename>
|
||||
自动化这个步骤,以如下的命令开始:</para>
|
||||
|
||||
<screen>&prompt.root; <userinput>portupgrade -f ruby</userinput>
|
||||
&prompt.root; <userinput>rm /var/db/pkg/pkgdb.db</userinput>
|
||||
&prompt.root; <userinput>portupgrade -f ruby18-bdb</userinput>
|
||||
&prompt.root; <userinput>rm /var/db/pkg/pkgdb.db /usr/ports/INDEX-*.db</userinput>
|
||||
&prompt.root; <userinput>portupgrade -af</userinput></screen>
|
||||
|
||||
<para>这个完成了以后,再最后一次运行
|
||||
<command>freebsd-update</command> 来结束升级过程。
|
||||
执行如下命令处理升级中的所有细节:</para>
|
||||
|
||||
<screen>&prompt.root; <userinput>freebsd-update install</userinput></screen>
|
||||
|
||||
<para>重新启动机器进入新版本的 &os; 升级过程至此就完成了。</para>
|
||||
</sect2>
|
||||
|
||||
<sect2>
|
||||
<title>系统状态对照</title>
|
||||
|
||||
<para><command>freebsd-update</command>
|
||||
工具也可被用来对着一个已知完好的 &os; 拷贝测试当前的版本。
|
||||
这个选项评估当前的系统工具,库和配置文件。
|
||||
使用以下的命令开始对照:</para>
|
||||
|
||||
<screen>&prompt.root; <userinput>freebsd-update IDS >> outfile.ids</userinput></screen>
|
||||
|
||||
<warning>
|
||||
<para>这个命令的名称是 <acronym>IDS</acronym>,
|
||||
它并不是一个像
|
||||
<filename role="package">security/snort</filename>
|
||||
这样的入侵检测系统的替代品。因为
|
||||
<command>freebsd-update</command> 在磁盘上存储数据,
|
||||
很显然它们有被篡改的可能。
|
||||
当然也可以使用一些方法来降低被篡改的可能性,比如设置
|
||||
<varname>kern.securelevel</varname> 和不使用时把
|
||||
<command>freebsd-update</command>
|
||||
数据放在只读文件系统上。例如 <acronym>DVD</acronym> 或
|
||||
安全存放的外置 <acronym>USB</acronym> 磁盘上。
|
||||
</warning>
|
||||
|
||||
<para>现在系统将会被检查,生成一份包含了文件和它们的 &man.sha256.1;
|
||||
哈希值的清单,有已知发行版中的值与当前系统中安装的值。
|
||||
这就是为什么输出被送到了 <filename>outfile.ids</filename> 文件。
|
||||
它滚动的太块无法用肉眼对照,而且会很快填满控制台的缓冲区。</para>
|
||||
|
||||
<para>这个文件中有非常长的行,但输出的格式很容易分析。
|
||||
举例来说,要获得一份与发行版中不同哈希值的文件列表,
|
||||
已可使用如下的命令:</para>
|
||||
|
||||
<screen>&prompt.root; <userinput>cat update.ids | awk '{ print $1 }' | more</userinput>
|
||||
/etc/master.passwd
|
||||
/etc/motd
|
||||
/etc/passwd
|
||||
/etc/pf.conf</screen>
|
||||
|
||||
<para>这份输出时删节缩短后的,其实是有更多的文件。
|
||||
其中有些文件并非人为修改,比如
|
||||
<filename>/etc/passwd</filename>
|
||||
被修改是因为添加了用户进系统。在某些情况下,
|
||||
还有另外的一些文件,诸如内核模块与
|
||||
<command>freebsd-update</command> 的不同是因为它们被更新过了。
|
||||
为了指定的文件或目录排除在外,把它们加到
|
||||
<filename>/etc/freebsd-update.conf</filename> 的
|
||||
<literal>IDSIgnorePaths</literal> 选项中。</para>
|
||||
|
||||
<para>除了前面讨论过的部分之外,
|
||||
这也能被当作是对升级方法的详细补充。</para>
|
||||
</sect2>
|
||||
</sect1>
|
||||
|
||||
<sect1 id="updating-portsnap">
|
||||
<title>Portsnap: 一个 Ports Collection 更新工具</title>
|
||||
|
||||
<para>&os; 基本系统也包括了一个更新 Ports Collection 的工具:
|
||||
&man.portsnap.8;。在运行之后,它会连上一个远程网站,
|
||||
校验安全密钥,然后下载一份 ports collection 的拷贝。
|
||||
密钥是用来校验所有下载文件的完整性,确保它们在传输是未被修改。
|
||||
使用以下的命令下载最新的 Ports Collection:</para>
|
||||
|
||||
<screen>&prompt.root; <userinput>portsnap fetch</userinput>
|
||||
Looking up portsnap.FreeBSD.org mirrors... 3 mirrors found.
|
||||
Fetching snapshot tag from portsnap1.FreeBSD.org... done.
|
||||
Fetching snapshot metadata... done.
|
||||
Updating from Wed Aug 6 18:00:22 EDT 2008 to Sat Aug 30 20:24:11 EDT 2008.
|
||||
Fetching 3 metadata patches.. done.
|
||||
Applying metadata patches... done.
|
||||
Fetching 3 metadata files... done.
|
||||
Fetching 90 patches.....10....20....30....40....50....60....70....80....90. done.
|
||||
Applying patches... done.
|
||||
Fetching 133 new ports or files... done.</screen>
|
||||
|
||||
<para>这个例子展示的是 &man.portsnap.8;
|
||||
发现并校验了几个用于当前 ports 的补丁。这还表明以前运行过,
|
||||
如果是第一次运行的话,那么仅仅只会下载 Ports Collection。</para>
|
||||
|
||||
<para>在 &man.portsnap.8; 成功完成一次
|
||||
<command>fetch</command> 操作后,而且本地系统上的 Ports Collection
|
||||
和随之而来的补丁通过校验以后。键入以下命令安装更新文件:</para>
|
||||
|
||||
<screen>&prompt.root; <userinput>portsnap extract</userinput>
|
||||
/usr/ports/.cvsignore
|
||||
/usr/ports/CHANGES
|
||||
/usr/ports/COPYRIGHT
|
||||
/usr/ports/GIDs
|
||||
/usr/ports/KNOBS
|
||||
/usr/ports/LEGAL
|
||||
/usr/ports/MOVED
|
||||
/usr/ports/Makefile
|
||||
/usr/ports/Mk/bsd.apache.mk
|
||||
/usr/ports/Mk/bsd.autotools.mk
|
||||
/usr/ports/Mk/bsd.cmake.mk
|
||||
<replaceable>...</replaceable></screen>
|
||||
|
||||
<para>至此更新就完成了,然后便可以使用更新后的
|
||||
Ports Collection 来安装或升级应用程序。</para>
|
||||
</sect1>
|
||||
</chapter>
|
|
@ -8,7 +8,7 @@
|
|||
For the FreeBSD Documentation Project
|
||||
The FreeBSD Simplified Chinese Project
|
||||
|
||||
Original Revision: 1.45
|
||||
Original Revision: 1.46
|
||||
$FreeBSD$
|
||||
-->
|
||||
|
||||
|
@ -841,9 +841,14 @@ sd name bigraid.p0.s4 drive e plex bigraid.p0 state initializing len 4194304b dr
|
|||
<sect3 id="vinum-rc-startup">
|
||||
<title>自动启动</title>
|
||||
|
||||
<note><para>这些内容仅适用于旧式的
|
||||
Vinum 实现。 在 <emphasis>Gvinum</emphasis> 内核模块加载时,
|
||||
总会执行自动启动操作。</para></note>
|
||||
<note>
|
||||
<para>这些内容仅适用于旧式的 Vinum 实现。
|
||||
<emphasis>Gvinum</emphasis> 在通过 &man.loader.conf.5;
|
||||
加载了内核模块之后就能自动启动。
|
||||
在启动时加载 <emphasis>Gvinum</emphasis> 模块,
|
||||
需在 <filename>/boot/loader.conf</filename> 中加入
|
||||
<literal>geom_vinum_load="YES"</literal>。</para>
|
||||
</note>
|
||||
|
||||
<para>要在引导系统时自动启动 Vinum, 需要在
|
||||
<filename>/etc/rc.conf</filename> 中加入下面的配置:</para>
|
||||
|
|
Loading…
Reference in a new issue