Whitespace-only fixes, translators please ignore.

This commit is contained in:
Warren Block 2014-01-30 23:09:22 +00:00
parent f9597a778d
commit d216048b26
Notes: svn2git 2020-12-08 03:00:23 +00:00
svn path=/head/; revision=43704

View file

@ -4,26 +4,53 @@
$FreeBSD$ $FreeBSD$
--> -->
<chapter xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" version="5.0" xml:id="config-tuning"> <chapter xmlns="http://docbook.org/ns/docbook"
<info><title>Configuration and Tuning</title> xmlns:xlink="http://www.w3.org/1999/xlink" version="5.0"
xml:id="config-tuning">
<info>
<title>Configuration and Tuning</title>
<authorgroup> <authorgroup>
<author><personname><firstname>Chern</firstname><surname>Lee</surname></personname><contrib>Written by </contrib></author> <author>
<personname>
<firstname>Chern</firstname>
<surname>Lee</surname>
</personname>
<contrib>Written by </contrib>
</author>
</authorgroup> </authorgroup>
<authorgroup> <authorgroup>
<author><personname><firstname>Mike</firstname><surname>Smith</surname></personname><contrib>Based on a tutorial written by </contrib></author> <author>
<personname>
<firstname>Mike</firstname>
<surname>Smith</surname>
</personname>
<contrib>Based on a tutorial written by </contrib>
</author>
</authorgroup> </authorgroup>
<authorgroup> <authorgroup>
<author><personname><firstname>Matt</firstname><surname>Dillon</surname></personname><contrib>Also based on tuning(7) written by </contrib></author> <author>
<personname>
<firstname>Matt</firstname>
<surname>Dillon</surname>
</personname>
<contrib>Also based on tuning(7) written by </contrib>
</author>
</authorgroup> </authorgroup>
</info> </info>
<sect1 xml:id="config-synopsis"> <sect1 xml:id="config-synopsis">
<title>Synopsis</title> <title>Synopsis</title>
<indexterm><primary>system configuration</primary></indexterm> <indexterm>
<indexterm><primary>system optimization</primary></indexterm> <primary>system configuration</primary>
</indexterm>
<indexterm>
<primary>system optimization</primary>
</indexterm>
<para>One of the important aspects of &os; is proper system <para>One of the important aspects of &os; is proper system
configuration. This chapter explains much of the &os; configuration. This chapter explains much of the &os;
@ -54,7 +81,8 @@
</listitem> </listitem>
<listitem> <listitem>
<para>How to use the various configuration files in <filename>/etc</filename>.</para> <para>How to use the various configuration files in
<filename>/etc</filename>.</para>
</listitem> </listitem>
<listitem> <listitem>
@ -71,7 +99,8 @@
<itemizedlist> <itemizedlist>
<listitem> <listitem>
<para>Understand &unix; and &os; basics (<xref linkend="basics"/>).</para> <para>Understand &unix; and &os; basics
(<xref linkend="basics"/>).</para>
</listitem> </listitem>
<listitem> <listitem>
@ -106,39 +135,38 @@
faster from the outer tracks to the inner. Thus, smaller faster from the outer tracks to the inner. Thus, smaller
and heavier-accessed file systems should be closer to the and heavier-accessed file systems should be closer to the
outside of the drive, while larger partitions like outside of the drive, while larger partitions like
<filename>/usr</filename> should be placed <filename>/usr</filename> should be placed toward the inner
toward the inner parts of the disk. It is a good idea to parts of the disk. It is a good idea to create partitions
create partitions in an order similar to: <filename>/</filename>, swap, in an order similar to: <filename>/</filename>, swap,
<filename>/var</filename>, and <filename>/var</filename>, and
<filename>/usr</filename>.</para> <filename>/usr</filename>.</para>
<para>The size of the <para>The size of the <filename>/var</filename> partition
<filename>/var</filename> partition reflects the intended machine's usage. This partition is
reflects the intended machine's usage. This partition used to hold mailboxes, log files, and printer spools.
is used to hold mailboxes, log files, and printer spools.
Mailboxes and log files can grow to unexpected sizes Mailboxes and log files can grow to unexpected sizes
depending on the number of users and how long log files depending on the number of users and how long log files are
are kept. On average, most users rarely need more than kept. On average, most users rarely need more than about a
about a gigabyte of free disk space in <filename>/var</filename>.</para> gigabyte of free disk space in
<filename>/var</filename>.</para>
<note> <note>
<para>Sometimes, a lot of disk space is required in <para>Sometimes, a lot of disk space is required in
<filename>/var/tmp</filename>. When <filename>/var/tmp</filename>. When new software is
new software is installed with &man.pkg.add.1;, the installed with &man.pkg.add.1;, the packaging tools
packaging tools extract a temporary copy of the packages extract a temporary copy of the packages under
under <filename>/var/tmp</filename>. <filename>/var/tmp</filename>. Large software packages,
Large software packages, like like <application>Firefox</application>,
<application>Firefox</application>,
<application>OpenOffice</application> or <application>OpenOffice</application> or
<application>LibreOffice</application> may be tricky to <application>LibreOffice</application> may be tricky to
install if there is not enough disk space under <filename>/var/tmp</filename>.</para> install if there is not enough disk space under
<filename>/var/tmp</filename>.</para>
</note> </note>
<para>The <filename>/usr</filename> <para>The <filename>/usr</filename> partition holds many of
partition holds many of the files which support the system, the files which support the system, including the &os; Ports
including the &os; Ports Collection and system source code. Collection and system source code. At least 2 gigabytes is
At least 2 gigabytes is recommended for this recommended for this partition.</para>
partition.</para>
<para>When selecting partition sizes, keep the space <para>When selecting partition sizes, keep the space
requirements in mind. Running out of space in one partition requirements in mind. Running out of space in one partition
@ -147,17 +175,21 @@
<note> <note>
<para>The <literal>Auto-defaults</literal> partition sizer <para>The <literal>Auto-defaults</literal> partition sizer
used by &man.sysinstall.8; will sometimes select smaller used by &man.sysinstall.8; will sometimes select smaller
than adequate <filename>/var</filename> than adequate <filename>/var</filename> and
and <filename>/</filename> partitions. <filename>/</filename> partitions. Partition wisely and
Partition wisely and generously.</para> generously.</para>
</note> </note>
</sect3> </sect3>
<sect3 xml:id="swap-design"> <sect3 xml:id="swap-design">
<title>Swap Partition</title> <title>Swap Partition</title>
<indexterm><primary>swap sizing</primary></indexterm> <indexterm>
<indexterm><primary>swap partition</primary></indexterm> <primary>swap sizing</primary>
</indexterm>
<indexterm>
<primary>swap partition</primary>
</indexterm>
<para>As a rule of thumb, the swap partition should be about <para>As a rule of thumb, the swap partition should be about
double the size of physical memory (<acronym>RAM</acronym>) double the size of physical memory (<acronym>RAM</acronym>)
@ -191,9 +223,11 @@
fine, but there are several reasons why this is a bad idea. fine, but there are several reasons why this is a bad idea.
First, each partition has different operational First, each partition has different operational
characteristics and separating them allows the file system characteristics and separating them allows the file system
to tune accordingly. For example, the root and <filename>/usr</filename> partitions are to tune accordingly. For example, the root and
read-mostly, with few writes, while a lot of reads and <filename>/usr</filename> partitions are read-mostly, with
writes could occur in <filename>/var</filename> and <filename>/var/tmp</filename>.</para> few writes, while a lot of reads and writes could occur in
<filename>/var</filename> and
<filename>/var/tmp</filename>.</para>
<para>By properly partitioning a system, fragmentation <para>By properly partitioning a system, fragmentation
introduced in the smaller write heavy partitions will not introduced in the smaller write heavy partitions will not
@ -202,11 +236,11 @@
increase I/O performance in the partitions where it occurs increase I/O performance in the partitions where it occurs
the most. While I/O performance in the larger partitions the most. While I/O performance in the larger partitions
may be needed, shifting them more toward the edge of the may be needed, shifting them more toward the edge of the
disk will not lead to a significant performance disk will not lead to a significant performance improvement
improvement over moving <filename>/var</filename> to the edge. Finally, over moving <filename>/var</filename> to the edge. Finally,
there are safety concerns. A smaller, neater root there are safety concerns. A smaller, neater root partition
partition which is mostly read-only has a greater chance of which is mostly read-only has a greater chance of surviving
surviving a bad crash.</para> a bad crash.</para>
</sect3> </sect3>
</sect2> </sect2>
</sect1> </sect1>
@ -286,9 +320,10 @@ ifconfig_fxp0="inet 10.1.1.1/8"</programlisting>
<indexterm><primary>/usr/local/etc</primary></indexterm> <indexterm><primary>/usr/local/etc</primary></indexterm>
<para>Typically, these files are installed in <filename>/usr/local/etc</filename>. In the case <para>Typically, these files are installed in
where an application has a large number of configuration <filename>/usr/local/etc</filename>. In the case where an
files, a subdirectory will be created to hold them.</para> application has a large number of configuration files, a
subdirectory will be created to hold them.</para>
<para>Normally, when a port or package is installed, sample <para>Normally, when a port or package is installed, sample
configuration files are also installed. These are usually configuration files are also installed. These are usually
@ -318,22 +353,30 @@ ifconfig_fxp0="inet 10.1.1.1/8"</programlisting>
</sect1> </sect1>
<sect1 xml:id="configtuning-starting-services"> <sect1 xml:id="configtuning-starting-services">
<info><title>Starting Services</title> <info>
<title>Starting Services</title>
<authorgroup> <authorgroup>
<author><personname><firstname>Tom</firstname><surname>Rhodes</surname></personname><contrib>Contributed by </contrib></author> <author>
<personname>
<firstname>Tom</firstname>
<surname>Rhodes</surname>
</personname>
<contrib>Contributed by </contrib>
</author>
</authorgroup> </authorgroup>
</info> </info>
<indexterm>
<primary>services</primary>
<indexterm><primary>services</primary></indexterm> </indexterm>
<para>Many users install third party software on &os; from the <para>Many users install third party software on &os; from the
Ports Collection and require the installed services to be Ports Collection and require the installed services to be
started upon system initialization. Services, such as started upon system initialization. Services, such as
<package>mail/postfix</package> or <package>mail/postfix</package> or
<package>www/apache22</package> are just two <package>www/apache22</package> are just two of the many
of the many software packages which may be started during system software packages which may be started during system
initialization. This section explains the procedures available initialization. This section explains the procedures available
for starting third party software.</para> for starting third party software.</para>
@ -345,7 +388,8 @@ ifconfig_fxp0="inet 10.1.1.1/8"</programlisting>
<para>Now that &os; includes <filename>rc.d</filename>, <para>Now that &os; includes <filename>rc.d</filename>,
configuration of application startup is easier and provides configuration of application startup is easier and provides
more features. Using the key words discussed in <xref linkend="configtuning-rcd"/>, applications can be set to more features. Using the key words discussed in
<xref linkend="configtuning-rcd"/>, applications can be set to
start after certain other services and extra flags can be start after certain other services and extra flags can be
passed through <filename>/etc/rc.conf</filename> in place of passed through <filename>/etc/rc.conf</filename> in place of
hard coded flags in the start up script. A basic script may hard coded flags in the start up script. A basic script may
@ -416,50 +460,62 @@ run_rc_command "$1"</programlisting>
</sect1> </sect1>
<sect1 xml:id="configtuning-cron"> <sect1 xml:id="configtuning-cron">
<info><title>Configuring &man.cron.8;</title> <info>
<title>Configuring &man.cron.8;</title>
<authorgroup> <authorgroup>
<author><personname><firstname>Tom</firstname><surname>Rhodes</surname></personname><contrib>Contributed by </contrib></author> <author>
<personname>
<firstname>Tom</firstname>
<surname>Rhodes</surname>
</personname>
<contrib>Contributed by </contrib>
</author>
</authorgroup> </authorgroup>
</info> </info>
<indexterm><primary>cron</primary> <indexterm>
<secondary>configuration</secondary></indexterm> <primary>cron</primary>
<secondary>configuration</secondary>
</indexterm>
<para>One of the most useful utilities in &os; is &man.cron.8;. <para>One of the most useful utilities in &os; is &man.cron.8;.
This utility runs in the background and regularly checks This utility runs in the background and regularly checks
<filename>/etc/crontab</filename> for tasks to execute and <filename>/etc/crontab</filename> for tasks to execute and
searches <filename>/var/cron/tabs</filename> searches <filename>/var/cron/tabs</filename> for custom
for custom &man.crontab.5; files. These files store &man.crontab.5; files. These files store information about
information about specific functions which &man.cron.8; is specific functions which &man.cron.8; is supposed to perform at
supposed to perform at certain times.</para> certain times.</para>
<para>Two different types of configuration files are used by <para>Two different types of configuration files are used by
&man.cron.8;: the system <filename>crontab</filename> and user &man.cron.8;: the system <filename>crontab</filename> and user
<filename>crontab</filename>s. These formats only differ in <filename>crontab</filename>s. These formats only differ in the
the sixth field and later. In the system sixth field and later. In the system
<filename>crontab</filename>, &man.cron.8; runs the command as <filename>crontab</filename>, &man.cron.8; runs the command as
the user specified in the sixth field. In a user the user specified in the sixth field. In a user
<filename>crontab</filename>, all commands run as the user who <filename>crontab</filename>, all commands run as the user who
created the <filename>crontab</filename>, so the sixth field created the <filename>crontab</filename>, so the sixth field is
is the last field; this is an important security feature. the last field; this is an important security feature. The
The final field is always the command to run.</para> final field is always the command to run.</para>
<note> <note>
<para>User crontabs allow individual users to schedule tasks <para>User crontabs allow individual users to schedule tasks
without the need for <systemitem class="username">root</systemitem> privileges. without the need for
<systemitem class="username">root</systemitem> privileges.
Commands in a user's crontab run with the permissions of the Commands in a user's crontab run with the permissions of the
user who owns the crontab.</para> user who owns the crontab.</para>
<para>The <systemitem class="username">root</systemitem> user can have a user <para>The <systemitem class="username">root</systemitem> user
<filename>crontab</filename> just like any other user. The can have a user <filename>crontab</filename> just like any
<systemitem class="username">root</systemitem> user <filename>crontab</filename> other user. The
is separate from the system <filename>crontab</filename>, <systemitem class="username">root</systemitem> user
<filename>crontab</filename> is separate from the system
<filename>crontab</filename>,
<filename>/etc/crontab</filename>. Because the system <filename>/etc/crontab</filename>. Because the system
<filename>crontab</filename> invokes the specified commands as <filename>crontab</filename> invokes the specified commands as
<systemitem class="username">root</systemitem>, there is usually no need to create <systemitem class="username">root</systemitem>, there is
a user <filename>crontab</filename> for usually no need to create a user <filename>crontab</filename>
<systemitem class="username">root</systemitem>.</para> for <systemitem class="username">root</systemitem>.</para>
</note> </note>
<para>Here is a sample entry from <para>Here is a sample entry from
@ -527,8 +583,9 @@ PATH=/etc:/bin:/sbin:/usr/bin:/usr/sbin <co xml:id="co-env"/>
<literal>*</literal> characters mean <literal>*</literal> characters mean
<quote>first-last</quote>, and can be interpreted as <quote>first-last</quote>, and can be interpreted as
<emphasis>every</emphasis> time. In this example, <emphasis>every</emphasis> time. In this example,
&man.atrun.8; is invoked by <systemitem class="username">root</systemitem> &man.atrun.8; is invoked by
every five minutes, regardless of the day or month.</para> <systemitem class="username">root</systemitem> every five
minutes, regardless of the day or month.</para>
<para>Commands can have any number of flags passed to them; <para>Commands can have any number of flags passed to them;
however, commands which extend to multiple lines need to be however, commands which extend to multiple lines need to be
@ -548,11 +605,11 @@ PATH=/etc:/bin:/sbin:/usr/bin:/usr/sbin <co xml:id="co-env"/>
<important> <important>
<para>Do not use the procedure described here to edit and <para>Do not use the procedure described here to edit and
install the system <filename>crontab</filename>, install the system <filename>crontab</filename>,
<filename>/etc/crontab</filename>. Instead, use an <filename>/etc/crontab</filename>. Instead, use an editor
editor and &man.cron.8; will notice that the file has and &man.cron.8; will notice that the file has changed and
changed and immediately begin using the updated version. immediately begin using the updated version. See <link
See <link xlink:href="&url.books.faq;/admin.html#root-not-found-cron-errors"> xlink:href="&url.books.faq;/admin.html#root-not-found-cron-errors">this
this FAQ entry</link> for more information.</para> FAQ entry</link> for more information.</para>
</important> </important>
<para>To install a freshly written user &man.crontab.5;, use <para>To install a freshly written user &man.crontab.5;, use
@ -581,14 +638,20 @@ PATH=/etc:/bin:/sbin:/usr/bin:/usr/sbin <co xml:id="co-env"/>
</sect1> </sect1>
<sect1 xml:id="configtuning-rcd"> <sect1 xml:id="configtuning-rcd">
<info><title>Using &man.rc.8; Under &os;</title> <info>
<title>Using &man.rc.8; Under &os;</title>
<authorgroup> <authorgroup>
<author><personname><firstname>Tom</firstname><surname>Rhodes</surname></personname><contrib>Contributed by </contrib></author> <author>
<personname>
<firstname>Tom</firstname>
<surname>Rhodes</surname>
</personname>
<contrib>Contributed by </contrib>
</author>
</authorgroup> </authorgroup>
</info> </info>
<para>In 2002, &os; integrated the NetBSD &man.rc.8; system for <para>In 2002, &os; integrated the NetBSD &man.rc.8; system for
system initialization. The files listed in system initialization. The files listed in
<filename>/etc/rc.d</filename> provide basic <filename>/etc/rc.d</filename> provide basic
@ -646,7 +709,8 @@ sshd_enable="YES"
<note> <note>
<para>The <literal># sshd</literal> line is output from the <para>The <literal># sshd</literal> line is output from the
above command, not a <systemitem class="username">root</systemitem> console.</para> above command, not a
<systemitem class="username">root</systemitem> console.</para>
</note> </note>
<para>To determine whether or not a service is running, use <para>To determine whether or not a service is running, use
@ -723,20 +787,27 @@ sshd is running as pid 433.</screen>
systems.</para> systems.</para>
<para>Additional information can be found in &man.rc.8; and <para>Additional information can be found in &man.rc.8; and
&man.rc.subr.8;. Refer to <link xlink:href="&url.articles.rc-scripting;">this article</link> for &man.rc.subr.8;. Refer to <link
instructions on how to create custom &man.rc.8; xlink:href="&url.articles.rc-scripting;">this article</link>
for instructions on how to create custom &man.rc.8;
scripts.</para> scripts.</para>
</sect1> </sect1>
<sect1 xml:id="config-network-setup"> <sect1 xml:id="config-network-setup">
<info><title>Setting Up Network Interface Cards</title> <info>
<title>Setting Up Network Interface Cards</title>
<authorgroup> <authorgroup>
<author><personname><firstname>Marc</firstname><surname>Fonvieille</surname></personname><contrib>Contributed by </contrib></author> <author>
<personname>
<firstname>Marc</firstname>
<surname>Fonvieille</surname>
</personname>
<contrib>Contributed by </contrib>
</author>
</authorgroup> </authorgroup>
</info> </info>
<indexterm> <indexterm>
<primary>network cards</primary> <primary>network cards</primary>
<secondary>configuration</secondary> <secondary>configuration</secondary>
@ -812,10 +883,11 @@ dc1: [ITHREAD]</screen>
<para>Alternatively, statically compile support for the <para>Alternatively, statically compile support for the
<acronym>NIC</acronym> into a custom kernel. Refer to <acronym>NIC</acronym> into a custom kernel. Refer to
<filename>/usr/src/sys/conf/NOTES</filename>, <filename>/usr/src/sys/conf/NOTES</filename>,
<filename>/usr/src/sys/arch/conf/NOTES</filename> <filename>/usr/src/sys/arch/conf/NOTES</filename> and the
and the manual page of the driver to determine which line manual page of the driver to determine which line to add
to add to the custom kernel configuration file. For more to the custom kernel configuration file. For more
information about recompiling the kernel, refer to <xref linkend="kernelconfig"/>. If the information about recompiling the kernel, refer to
<xref linkend="kernelconfig"/>. If the
<acronym>NIC</acronym> was detected at boot, the kernel <acronym>NIC</acronym> was detected at boot, the kernel
does not need to be recompiled.</para> does not need to be recompiled.</para>
</listitem> </listitem>
@ -824,10 +896,17 @@ dc1: [ITHREAD]</screen>
<sect3 xml:id="config-network-ndis"> <sect3 xml:id="config-network-ndis">
<title>Using &windows; <acronym>NDIS</acronym> Drivers</title> <title>Using &windows; <acronym>NDIS</acronym> Drivers</title>
<indexterm><primary><acronym>NDIS</acronym></primary></indexterm> <indexterm>
<indexterm><primary>NDISulator</primary></indexterm> <primary><acronym>NDIS</acronym></primary>
<indexterm><primary>&windows; drivers</primary></indexterm> </indexterm>
<indexterm><primary>&microsoft.windows;</primary> <indexterm>
<primary>NDISulator</primary>
</indexterm>
<indexterm>
<primary>&windows; drivers</primary>
</indexterm>
<indexterm>
<primary>&microsoft.windows;</primary>
<secondary>device drivers</secondary> <secondary>device drivers</secondary>
</indexterm> </indexterm>
<indexterm> <indexterm>
@ -887,7 +966,8 @@ linuxemu/chapter.xml -->
&os;/amd64, a &windows; 64-bit driver is needed.</para> &os;/amd64, a &windows; 64-bit driver is needed.</para>
<para>The next step is to compile the driver binary into a <para>The next step is to compile the driver binary into a
loadable kernel module. As <systemitem class="username">root</systemitem>, use loadable kernel module. As
<systemitem class="username">root</systemitem>, use
&man.ndisgen.8;:</para> &man.ndisgen.8;:</para>
<screen>&prompt.root; <userinput>ndisgen /path/to/W32DRIVER.INF /path/to/W32DRIVER.SYS</userinput></screen> <screen>&prompt.root; <userinput>ndisgen /path/to/W32DRIVER.INF /path/to/W32DRIVER.SYS</userinput></screen>
@ -928,9 +1008,9 @@ ndis0: 11g rates: 6Mbps 9Mbps 12Mbps 18Mbps 36Mbps 48Mbps 54Mbps</screen>
<para>To configure the system to load the &man.ndis.4; modules <para>To configure the system to load the &man.ndis.4; modules
at boot time, copy the generated module, at boot time, copy the generated module,
<filename>W32DRIVER_SYS.ko</filename>, to <filename>/boot/modules</filename>. Then, add the <filename>W32DRIVER_SYS.ko</filename>, to
following line to <filename>/boot/modules</filename>. Then, add the following
<filename>/boot/loader.conf</filename>:</para> line to <filename>/boot/loader.conf</filename>:</para>
<programlisting>W32DRIVER_SYS_load="YES"</programlisting> <programlisting>W32DRIVER_SYS_load="YES"</programlisting>
</sect3> </sect3>
@ -1010,22 +1090,27 @@ lo0: flags=8049&lt;UP,LOOPBACK,RUNNING,MULTICAST&gt; metric 0 mtu 16384
<listitem> <listitem>
<para>The card has an Internet (<literal>inet</literal>) <para>The card has an Internet (<literal>inet</literal>)
address, <systemitem class="ipaddress">192.168.1.3</systemitem>.</para> address, <systemitem
class="ipaddress">192.168.1.3</systemitem>.</para>
</listitem> </listitem>
<listitem> <listitem>
<para>It has a valid subnet mask <para>It has a valid subnet mask
(<literal>netmask</literal>), where <systemitem class="netmask">0xffffff00</systemitem> is the same as (<literal>netmask</literal>), where
<systemitem class="netmask">255.255.255.0</systemitem>.</para> <systemitem class="netmask">0xffffff00</systemitem> is the
same as <systemitem
class="netmask">255.255.255.0</systemitem>.</para>
</listitem> </listitem>
<listitem> <listitem>
<para>It has a valid broadcast address, <systemitem class="ipaddress">192.168.1.255</systemitem>.</para> <para>It has a valid broadcast address, <systemitem
class="ipaddress">192.168.1.255</systemitem>.</para>
</listitem> </listitem>
<listitem> <listitem>
<para>The <acronym>MAC</acronym> address of the card <para>The <acronym>MAC</acronym> address of the card
(<literal>ether</literal>) is <systemitem class="etheraddress">00:a0:cc:da:da:da</systemitem>.</para> (<literal>ether</literal>) is <systemitem
class="etheraddress">00:a0:cc:da:da:da</systemitem>.</para>
</listitem> </listitem>
<listitem> <listitem>
@ -1059,13 +1144,14 @@ lo0: flags=8049&lt;UP,LOOPBACK,RUNNING,MULTICAST&gt; metric 0 mtu 16384
<para>it would indicate the card has not been configured.</para> <para>it would indicate the card has not been configured.</para>
<para>The card must be configured as <systemitem class="username">root</systemitem>. <para>The card must be configured as
The <acronym>NIC</acronym> configuration can be performed <systemitem class="username">root</systemitem>. The
from the command line with &man.ifconfig.8; but will not <acronym>NIC</acronym> configuration can be performed from the
persist after a reboot unless the configuration is also added command line with &man.ifconfig.8; but will not persist after
to <filename>/etc/rc.conf</filename>. Add a line for each a reboot unless the configuration is also added to
<acronym>NIC</acronym> present on the system, as seen in <filename>/etc/rc.conf</filename>. Add a line for each
this example:</para> <acronym>NIC</acronym> present on the system, as seen in this
example:</para>
<programlisting>ifconfig_dc0="inet 192.168.1.3 netmask 255.255.255.0" <programlisting>ifconfig_dc0="inet 192.168.1.3 netmask 255.255.255.0"
ifconfig_dc1="inet 10.0.0.1 netmask 255.255.255.0 media 10baseT/UTP"</programlisting> ifconfig_dc1="inet 10.0.0.1 netmask 255.255.255.0 media 10baseT/UTP"</programlisting>
@ -1266,21 +1352,24 @@ round-trip min/avg/max/stddev = 0.700/0.729/0.766/0.025 ms</screen>
<para>For example, consider the case where the <para>For example, consider the case where the
<filename>fxp0</filename> interface is connected to two <filename>fxp0</filename> interface is connected to two
networks: <systemitem class="ipaddress">10.1.1.0</systemitem> with a networks: <systemitem class="ipaddress">10.1.1.0</systemitem>
netmask of <systemitem class="netmask">255.255.255.0</systemitem> and with a netmask of
<systemitem class="ipaddress">202.0.75.16</systemitem> with a netmask of <systemitem class="netmask">255.255.255.0</systemitem> and
<systemitem class="netmask">255.255.255.240</systemitem>. The system <systemitem class="ipaddress">202.0.75.16</systemitem> with a
is to be configured to appear in the ranges netmask of
<systemitem class="netmask">255.255.255.240</systemitem>. The
system is to be configured to appear in the ranges
<systemitem class="ipaddress">10.1.1.1</systemitem> through <systemitem class="ipaddress">10.1.1.1</systemitem> through
<systemitem class="ipaddress">10.1.1.5</systemitem> and <systemitem class="ipaddress">10.1.1.5</systemitem> and
<systemitem class="ipaddress">202.0.75.17</systemitem> through <systemitem class="ipaddress">202.0.75.17</systemitem> through
<systemitem class="ipaddress">202.0.75.20</systemitem>. Only the first <systemitem class="ipaddress">202.0.75.20</systemitem>. Only
address in a given network range should have a real netmask. the first address in a given network range should have a real
All the rest (<systemitem class="ipaddress">10.1.1.2</systemitem> through netmask. All the rest
(<systemitem class="ipaddress">10.1.1.2</systemitem> through
<systemitem class="ipaddress">10.1.1.5</systemitem> and <systemitem class="ipaddress">10.1.1.5</systemitem> and
<systemitem class="ipaddress">202.0.75.18</systemitem> through <systemitem class="ipaddress">202.0.75.18</systemitem> through
<systemitem class="ipaddress">202.0.75.20</systemitem>) must be configured <systemitem class="ipaddress">202.0.75.20</systemitem>) must be
with a netmask of configured with a netmask of
<systemitem class="netmask">255.255.255.255</systemitem>.</para> <systemitem class="netmask">255.255.255.255</systemitem>.</para>
<para>The following <filename>/etc/rc.conf</filename> entries <para>The following <filename>/etc/rc.conf</filename> entries
@ -1298,18 +1387,30 @@ ifconfig_fxp0_alias7="inet 202.0.75.20 netmask 255.255.255.255"</programlisting>
</sect1> </sect1>
<sect1 xml:id="configtuning-syslog"> <sect1 xml:id="configtuning-syslog">
<info><title>Configuring the System Logger, <info>
<command>syslogd</command></title> <title>Configuring the System Logger,
<command>syslogd</command></title>
<authorgroup> <authorgroup>
<author><personname><firstname>Niclas</firstname><surname>Zeising</surname></personname><contrib>Contributed by </contrib></author> <author>
<personname>
<firstname>Niclas</firstname>
<surname>Zeising</surname>
</personname>
<contrib>Contributed by </contrib>
</author>
</authorgroup> </authorgroup>
</info> </info>
<indexterm>
<primary>system logging</primary>
<indexterm><primary>system logging</primary></indexterm> </indexterm>
<indexterm><primary>syslog</primary></indexterm> <indexterm>
<indexterm><primary>&man.syslogd.8;</primary></indexterm> <primary>syslog</primary>
</indexterm>
<indexterm>
<primary>&man.syslogd.8;</primary>
</indexterm>
<para>System logging is an important aspect of system <para>System logging is an important aspect of system
administration. It is used to detect hardware and software administration. It is used to detect hardware and software
@ -1322,7 +1423,8 @@ ifconfig_fxp0_alias7="inet 202.0.75.20 netmask 255.255.255.255"</programlisting>
system logger, &man.syslogd.8;, and how to perform log rotation system logger, &man.syslogd.8;, and how to perform log rotation
and log management using &man.newsyslog.8;. Focus will be on and log management using &man.newsyslog.8;. Focus will be on
setting up and using &man.syslogd.8; on a local machine. For setting up and using &man.syslogd.8; on a local machine. For
more advanced setups using a separate loghost, see <xref linkend="network-syslogd"/>.</para> more advanced setups using a separate loghost, see
<xref linkend="network-syslogd"/>.</para>
<sect2> <sect2>
<title>Using <command>syslogd</command></title> <title>Using <command>syslogd</command></title>
@ -1857,12 +1959,19 @@ security.bsd.see_other_uids=0</programlisting>
</sect2> </sect2>
<sect2 xml:id="sysctl-readonly"> <sect2 xml:id="sysctl-readonly">
<info><title>&man.sysctl.8; Read-only</title> <info>
<title>&man.sysctl.8; Read-only</title>
<authorgroup> <authorgroup>
<author><personname><firstname>Tom</firstname><surname>Rhodes</surname></personname><contrib>Contributed by </contrib></author> <author>
<personname>
<firstname>Tom</firstname>
<surname>Rhodes</surname>
</personname>
<contrib>Contributed by </contrib>
</author>
</authorgroup> </authorgroup>
</info> </info>
<para>In some cases it may be desirable to modify read-only <para>In some cases it may be desirable to modify read-only
&man.sysctl.8; values, which will require a reboot of the &man.sysctl.8; values, which will require a reboot of the
@ -2550,7 +2659,8 @@ kern.maxvnodes: 100000</screen>
on an existing partition.</para> on an existing partition.</para>
<para>For information on how to encrypt swap space, which options <para>For information on how to encrypt swap space, which options
exist, and why it should be done, refer to <xref linkend="swap-encrypting"/>.</para> exist, and why it should be done, refer to
<xref linkend="swap-encrypting"/>.</para>
<sect2 xml:id="new-drive-swap"> <sect2 xml:id="new-drive-swap">
<title>Swap on a New or Existing Hard Drive</title> <title>Swap on a New or Existing Hard Drive</title>
@ -2652,15 +2762,27 @@ kern.maxvnodes: 100000</screen>
</sect1> </sect1>
<sect1 xml:id="acpi-overview"> <sect1 xml:id="acpi-overview">
<info><title>Power and Resource Management</title> <info>
<title>Power and Resource Management</title>
<authorgroup> <authorgroup>
<author><personname><firstname>Hiten</firstname><surname>Pandya</surname></personname><contrib>Written by </contrib></author> <author>
<author><personname><firstname>Tom</firstname><surname>Rhodes</surname></personname></author> <personname>
<firstname>Hiten</firstname>
<surname>Pandya</surname>
</personname>
<contrib>Written by </contrib>
</author>
<author>
<personname>
<firstname>Tom</firstname>
<surname>Rhodes</surname>
</personname>
</author>
</authorgroup> </authorgroup>
</info> </info>
<para>It is important to utilize hardware resources in an <para>It is important to utilize hardware resources in an
efficient manner. Before the Advanced Configuration and Power efficient manner. Before the Advanced Configuration and Power
Interface (<acronym>ACPI</acronym>) was introduced, it was Interface (<acronym>ACPI</acronym>) was introduced, it was
@ -2790,18 +2912,37 @@ kern.maxvnodes: 100000</screen>
</sect1> </sect1>
<sect1 xml:id="ACPI-debug"> <sect1 xml:id="ACPI-debug">
<info><title>Using and Debugging &os; <acronym>ACPI</acronym></title> <info>
<title>Using and Debugging &os; <acronym>ACPI</acronym></title>
<authorgroup> <authorgroup>
<author><personname><firstname>Nate</firstname><surname>Lawson</surname></personname><contrib>Written by </contrib></author> <author>
<personname>
<firstname>Nate</firstname>
<surname>Lawson</surname>
</personname>
<contrib>Written by </contrib>
</author>
</authorgroup> </authorgroup>
<authorgroup> <authorgroup>
<author><personname><firstname>Peter</firstname><surname>Schultz</surname></personname><contrib>With contributions from </contrib></author> <author>
<author><personname><firstname>Tom</firstname><surname>Rhodes</surname></personname></author> <personname>
<firstname>Peter</firstname>
<surname>Schultz</surname>
</personname>
<contrib>With contributions from </contrib>
</author>
<author>
<personname>
<firstname>Tom</firstname>
<surname>Rhodes</surname>
</personname>
</author>
</authorgroup> </authorgroup>
</info> </info>
<indexterm> <indexterm>
<primary>ACPI</primary> <primary>ACPI</primary>
<secondary>problems</secondary> <secondary>problems</secondary>
@ -2925,11 +3066,12 @@ kern.maxvnodes: 100000</screen>
<acronym>ACPI</acronym> subsystem. For &os;, &intel; has <acronym>ACPI</acronym> subsystem. For &os;, &intel; has
provided an interpreter (<acronym>ACPI-CA</acronym>) that is provided an interpreter (<acronym>ACPI-CA</acronym>) that is
shared with &linux; and NetBSD. The path to the shared with &linux; and NetBSD. The path to the
<acronym>ACPI-CA</acronym> source code is <filename>src/sys/contrib/dev/acpica</filename>. <acronym>ACPI-CA</acronym> source code is
The glue code that allows <acronym>ACPI-CA</acronym> to work <filename>src/sys/contrib/dev/acpica</filename>. The glue
on &os; is in <filename>src/sys/dev/acpica/Osd</filename>. code that allows <acronym>ACPI-CA</acronym> to work on &os; is
Finally, drivers that implement various in <filename>src/sys/dev/acpica/Osd</filename>. Finally,
<acronym>ACPI</acronym> devices are found in <filename>src/sys/dev/acpica</filename>.</para> drivers that implement various <acronym>ACPI</acronym> devices
are found in <filename>src/sys/dev/acpica</filename>.</para>
</sect2> </sect2>
<sect2 xml:id="ACPI-comprob"> <sect2 xml:id="ACPI-comprob">
@ -3320,11 +3462,12 @@ acpi_dsdt_name="/boot/DSDT.aml"</programlisting>
&amp;&amp; make clean &amp;&amp; &amp;&amp; make clean &amp;&amp;
make ACPI_DEBUG=1</userinput></screen> make ACPI_DEBUG=1</userinput></screen>
<para>Install <filename>acpi.ko</filename> in <filename>/boot/kernel</filename> and add the <para>Install <filename>acpi.ko</filename> in
desired level and layer to <filename>/boot/kernel</filename> and add the desired level
<filename>/boot/loader.conf</filename>. This example enables and layer to <filename>/boot/loader.conf</filename>. This
debug messages for all <acronym>ACPI-CA</acronym> components example enables debug messages for all
and all <acronym>ACPI</acronym> hardware drivers such as <acronym>ACPI-CA</acronym> components and all
<acronym>ACPI</acronym> hardware drivers such as
(<acronym>CPU</acronym> and <acronym>LID</acronym>. It only (<acronym>CPU</acronym> and <acronym>LID</acronym>. It only
outputs error messages at the least verbose level.</para> outputs error messages at the least verbose level.</para>
@ -3353,30 +3496,30 @@ debug.acpi.level="ACPI_LV_ERROR"</programlisting>
</listitem> </listitem>
<listitem> <listitem>
<para>The <acronym>ACPI</acronym> Mailing List Archives <para>The <acronym>ACPI</acronym> Mailing List Archives <uri
<uri xlink:href="http://lists.freebsd.org/pipermail/freebsd-acpi/">http://lists.freebsd.org/pipermail/freebsd-acpi/</uri></para> xlink:href="http://lists.freebsd.org/pipermail/freebsd-acpi/">http://lists.freebsd.org/pipermail/freebsd-acpi/</uri></para>
</listitem> </listitem>
<listitem> <listitem>
<para>The old <acronym>ACPI</acronym> Mailing List Archives <para>The old <acronym>ACPI</acronym> Mailing List Archives
<uri xlink:href="http://home.jp.FreeBSD.org/mail-list/acpi-jp/">http://home.jp.FreeBSD.org/mail-list/acpi-jp/</uri></para> <uri
xlink:href="http://home.jp.FreeBSD.org/mail-list/acpi-jp/">http://home.jp.FreeBSD.org/mail-list/acpi-jp/</uri></para>
</listitem> </listitem>
<listitem> <listitem>
<para>The <acronym>ACPI</acronym> 2.0 Specification <para>The <acronym>ACPI</acronym> 2.0 Specification <uri
<uri xlink:href="http://acpi.info/spec.htm">http://acpi.info/spec.htm</uri></para> xlink:href="http://acpi.info/spec.htm">http://acpi.info/spec.htm</uri></para>
</listitem> </listitem>
<listitem> <listitem>
<para>&man.acpi.4;, <para>&man.acpi.4;, &man.acpi.thermal.4;, &man.acpidump.8;,
&man.acpi.thermal.4;, &man.acpidump.8;, &man.iasl.8;, &man.iasl.8;, and &man.acpidb.8;</para>
and &man.acpidb.8;</para>
</listitem> </listitem>
<listitem> <listitem>
<para><link xlink:href="http://www.cpqlinux.com/acpi-howto.html#fix_broken_dsdt"> <para><link
<acronym>DSDT</acronym> debugging xlink:href="http://www.cpqlinux.com/acpi-howto.html#fix_broken_dsdt"><acronym>DSDT</acronym>
resource</link>.</para> debugging resource</link>.</para>
</listitem> </listitem>
</itemizedlist> </itemizedlist>
</sect2> </sect2>