handbook/printing/chapter.sgml	1.95 -> 1.96

- More translation:
	handbook/basics/chapter.sgml
	handbook/config/chapter.sgml
	handbook/introduction/chapter.sgml
	handbook/mail/chapter.sgml
	porters-handbook/book.sgml

- Fix typo:
	handbook/users/chapter.sgml

Main contributors:	gaod, jnlin, whsyu

Obtained from:		The FreeBSD Traditional Chinese Project
			https://opensvn.csie.org/traccgi/freebsddoc/wiki
This commit is contained in:
Chin-San Huang 2007-11-24 14:38:35 +00:00
parent 685dea9c44
commit 604222a8b7
Notes: svn2git 2020-12-08 03:00:23 +00:00
svn path=/head/; revision=31047
7 changed files with 497 additions and 624 deletions

View file

@ -27,7 +27,7 @@
如果您對這些內容熟悉的話,可以放心的跳過。 如果您對這些內容熟悉的話,可以放心的跳過。
如果您剛接觸 FreeBSD那您一定要仔細的讀完這章。</para> 如果您剛接觸 FreeBSD那您一定要仔細的讀完這章。</para>
<para>讀完這一章,您將會了解:</para> <para>讀完這章,您將了解:</para>
<itemizedlist> <itemizedlist>
<listitem> <listitem>
@ -1815,92 +1815,87 @@ Swap: 256M Total, 38M Used, 217M Free, 15% Inuse
<sect1 id="shells"> <sect1 id="shells">
<title>Shells</title> <title>Shells</title>
<indexterm><primary>shells</primary></indexterm> <indexterm><primary>shells</primary></indexterm>
<indexterm><primary>command line</primary></indexterm> <indexterm><primary>命令列 command line</primary></indexterm>
<para>In FreeBSD, a lot of everyday work is done in a command line <para>在 FreeBSD 中,很多日常的工作是在一個叫做 shell
interface called a shell. A shell's main job is to take commands 的文字介面中完成的。
from the input channel and execute them. A lot of shells also have Shell 的主要工作就是從輸入中收到命令並執行它們。
built in functions to help everyday tasks such as file management, 許多 shell 也有內建一些有助於日常工作的指令,
file globbing, command line editing, command macros, and environment 像是檔案管理、檔案比對、命令列編輯、指令巨集以及環境變數等。
variables. FreeBSD comes with a set of shells, such as FreeBSD 有內附了幾個 shell像是 <command>sh</command>
<command>sh</command>, the Bourne Shell, and <command>tcsh</command>, Bourne Shell以及 <command>tcsh</command>,改良版的 C-shell。
the improved C-shell. Many other shells are available 還有許多其他的 shell 可以從 FreeBSD Ports Collection
from the FreeBSD Ports Collection, such as 中取得,像是 <command>zsh</command> 以及 <command>bash</command>
<command>zsh</command> and <command>bash</command>.</para> 等。</para>
<para>Which shell do you use? It is really a matter of taste. If you <para>您用哪個 shell 呢? 其實每個人的喜好都不一樣。
are a C programmer you might feel more comfortable with a C-like shell 如果您是一個 C 程式設計師,那對於使用像是 <command>tcsh</command>
such as <command>tcsh</command>. If you have come from Linux or are new 這種 C-like 的 shell 可能會感到相當愉快。 如果你是從 Linux
to a &unix; command line interface you might try <command>bash</command>. 跳過來的,或者您是一個 &unix; 新手,那您也許會想要用
The point is that each <command>bash</command> 來當作文字介面。
shell has unique properties that may or may not work with your 每一個 shell 都有自已獨特之處,至於這些特點能不能配合您的工作環境?
preferred working environment, and that you have a choice of what 那就是您選擇 shell 的重點了。</para>
shell to use.</para>
<para>One common feature in a shell is filename completion. Given <para>檔名自動補齊就是常見的 shell 功能。
the typing of the first few letters of a command or filename, you 首先輸入指令或檔案的前幾個字母,這時通常您只需要按下 <keycap>Tab</keycap>
can usually have the shell automatically complete the rest of the 鍵,接下來 shell 就會自動把指令或是檔案名稱剩餘的部份補齊。
command or filename by hitting the <keycap>Tab</keycap> key on the keyboard. Here is 假設您有兩個檔案分別叫作 <filename>foobar</filename> 及
an example. Suppose you have two files called <filename>foo.bar</filename>。 現在要刪掉
<filename>foobar</filename> and <filename>foo.bar</filename>. You <filename>foo.bar</filename>,那麼可以輸入:
want to delete <filename>foo.bar</filename>. So what you would type <command>rm fo[<keycap>Tab</keycap>].[<keycap>Tab</keycap>]</command>
on the keyboard is: <command>rm fo[<keycap>Tab</keycap>].[<keycap>Tab</keycap>]</command>.</para> </para>
<para>The shell would print out <command>rm <para>Shell 會印出這個: <command>rm foo[嗶].bar</command>。</para>
foo[BEEP].bar</command>.</para>
<para>[嗶] 是 console 的響鈴,這嗶的一聲是 shell
在告訴我說它沒有辦法完全自動補齊檔名,因為有不只一個檔名符合條件。
<filename>foobar</filename> 和 <filename>foo.bar</filename> 都是
<literal>fo</literal> 開頭的檔名,不過它至少可以補齊到 <literal>foo</literal>。
如果您接著輸入 <literal>.</literal> 然後再按 <keycap>Tab</keycap>
一次,那 shell 就能夠替您把剩下的檔名填滿了。</para>
<para>The [BEEP] is the console bell, which is the shell telling me it
was unable to totally complete the filename because there is more
than one match. Both <filename>foobar</filename> and
<filename>foo.bar</filename> start with <literal>fo</literal>, but
it was able to complete to <literal>foo</literal>. If you type in
<literal>.</literal>, then hit <keycap>Tab</keycap> again, the shell would be able to
fill in the rest of the filename for you.</para>
<indexterm><primary>environment variables</primary></indexterm> <indexterm><primary>environment variables</primary></indexterm>
<para>Another feature of the shell is the use of environment variables. <para>Shell 的另一項特點是使用了環境變數。
Environment variables are a variable/key pair stored in the shell's 環境變數是以變數與鍵值variable/key的對應關係儲存於 shell
environment space. This space can be read by any program invoked by 的環境空間中,任何由 shell 所產生的程序都可以讀取此空間,
the shell, and thus contains a lot of program configuration. Here 因此這個空間儲存了許多程序的設定組態。在此附上
is a list of common environment variables and what they mean:</para> 一份常見環境變數與其含意的列表:</para>
<indexterm><primary>environment variables</primary></indexterm> <indexterm><primary>environment variables</primary></indexterm>
<informaltable frame="none" pgwide="1"> <informaltable frame="none" pgwide="1">
<tgroup cols="2"> <tgroup cols="2">
<thead> <thead>
<row> <row>
<entry>Variable</entry> <entry>變數</entry>
<entry>Description</entry> <entry>詳細說明</entry>
</row> </row>
</thead> </thead>
<tbody> <tbody>
<row> <row>
<entry><envar>USER</envar></entry> <entry><envar>USER</envar></entry>
<entry>Current logged in user's name.</entry> <entry>目前登入的使用者名稱。</entry>
</row> </row>
<row> <row>
<entry><envar>PATH</envar></entry> <entry><envar>PATH</envar></entry>
<entry>Colon-separated list of directories to search for <entry>以冒號(:)隔開的目錄列表,用以搜尋執行檔的路徑。</entry>
binaries.</entry>
</row> </row>
<row> <row>
<entry><envar>DISPLAY</envar></entry> <entry><envar>DISPLAY</envar></entry>
<entry>Network name of the X11 display to connect to, if <entry>若存在這個環境變數,則代表 X11 連結顯示器的網路名稱。</entry>
available.</entry>
</row> </row>
<row> <row>
<entry><envar>SHELL</envar></entry> <entry><envar>SHELL</envar></entry>
<entry>The current shell.</entry> <entry>目前使用的 shell。</entry>
</row> </row>
<row> <row>
<entry><envar>TERM</envar></entry> <entry><envar>TERM</envar></entry>
<entry>The name of the user's type of terminal. Used to determine <entry>使用者終端機的名稱,能藉由此變數判斷終端機的能力。</entry>
the capabilities of the terminal.</entry>
</row> </row>
<row> <row>
@ -1911,59 +1906,56 @@ Swap: 256M Total, 38M Used, 217M Free, 15% Inuse
<row> <row>
<entry><envar>OSTYPE</envar></entry> <entry><envar>OSTYPE</envar></entry>
<entry>Type of operating system. e.g., FreeBSD.</entry> <entry>作業系統的種類FreeBSD。</entry>
</row> </row>
<row> <row>
<entry><envar>MACHTYPE</envar></entry> <entry><envar>MACHTYPE</envar></entry>
<entry>The CPU architecture that the system is running <entry>目前系統所用的 CPU 架構。</entry>
on.</entry>
</row> </row>
<row> <row>
<entry><envar>EDITOR</envar></entry> <entry><envar>EDITOR</envar></entry>
<entry>The user's preferred text editor.</entry> <entry>使用者偏好的文字編輯器。</entry>
</row> </row>
<row> <row>
<entry><envar>PAGER</envar></entry> <entry><envar>PAGER</envar></entry>
<entry>The user's preferred text pager.</entry> <entry>使用者偏好的文字分頁器text pager</entry>
</row> </row>
<row> <row>
<entry><envar>MANPATH</envar></entry> <entry><envar>MANPATH</envar></entry>
<entry>Colon-separated list of directories to search for <entry>以冒號(:)隔開的目錄列表,用以搜尋 manual pages 的路徑。</entry>
manual pages.</entry>
</row> </row>
</tbody> </tbody>
</tgroup> </tgroup>
</informaltable> </informaltable>
<indexterm><primary>Bourne shells</primary></indexterm> <indexterm><primary>Bourne shells</primary></indexterm>
<para>Setting an environment variable differs somewhat from <para>在不同的 shell 底下設定環境變數的方式也有所不同。
shell to shell. For example, in the C-Style shells such as 舉例來說,在 C-Style 的 shell 底下,像是
<command>tcsh</command> and <command>csh</command>, you would use <command>tcsh</command> 和 <command>csh</command>,你必須使用
<command>setenv</command> to set environment variables. <command>setenv</command> 來設定環境變數。
Under Bourne shells such as <command>sh</command> and 但在 Bourne shells 底下,像是 <command>sh</command> 和
<command>bash</command>, you would use <command>bash</command>,你則必須使用
<command>export</command> to set your current environment <command>export</command> 來設定你所使用的環境變數。
variables. For example, to set or modify the 再舉個例子來說,若要設定或是修改
<envar>EDITOR</envar> environment variable, under <command>csh</command> or <envar>EDITOR</envar> 這個環境變數,在 <command>csh</command> 或
<command>tcsh</command> a <command>tcsh</command> 下設定 <envar>EDITOR</envar> 這個環境變數為
command like this would set <envar>EDITOR</envar> to <filename>/usr/local/bin/emacs</filename> 的指令是:</para>
<filename>/usr/local/bin/emacs</filename>:</para>
<screen>&prompt.user; <userinput>setenv EDITOR /usr/local/bin/emacs</userinput></screen> <screen>&prompt.user; <userinput>setenv EDITOR /usr/local/bin/emacs</userinput></screen>
<para>Under Bourne shells:</para> <para>在 Bourne shells 下則是:</para>
<screen>&prompt.user; <userinput>export EDITOR="/usr/local/bin/emacs"</userinput></screen> <screen>&prompt.user; <userinput>export EDITOR="/usr/local/bin/emacs"</userinput></screen>
<para>You can also make most shells expand the environment variable by <para>大多數的 shell 都支援使用者在命令列中將
placing a <literal>$</literal> character in front of it on the <literal>$</literal> 字元放在變數之前,以取得環境變數的值。
command line. For example, <command>echo $TERM</command> would 舉例來說,<command>echo $TERM</command> 會
print out whatever <envar>$TERM</envar> is set to, because the shell 顯示出 <envar>$TERM</envar> 的設定值,這是因為 shell 取得了
expands <envar>$TERM</envar> and passes it on to <command>echo</command>.</para> <envar>$TERM</envar> 的設定值,並將他傳給 <command>echo</command> 顯示出來。</para>
<para>Shells treat a lot of special characters, called meta-characters <para>Shells treat a lot of special characters, called meta-characters
as special representations of data. The most common one is the as special representations of data. The most common one is the
@ -1983,21 +1975,16 @@ Swap: 256M Total, 38M Used, 217M Free, 15% Inuse
is.</para> is.</para>
<sect2 id="changing-shells"> <sect2 id="changing-shells">
<title>Changing Your Shell</title> <title>變更你的 Shell</title>
<para>The easiest way to change your shell is to use the <para>變更 shell 最簡單的方法就是透過 <command>chsh</command> 命令。
<command>chsh</command> command. Running <command>chsh</command> will 執行 <command>chsh</command> 將會呼叫環境變數中 <envar>EDITOR</envar> 指定的
place you into the editor that is in your <envar>EDITOR</envar> 文字編輯器。如果沒有設定,則預設是 <command>vi</command>。依照需求去修改
environment variable; if it is not set, you will be placed in <quote>Shell:</quote> 的值。
<command>vi</command>. Change the <quote>Shell:</quote> line
accordingly.</para>
<para>You can also give <command>chsh</command> the <para>你也可以透過 <command>chsh</command> 的參數 <option>-s</option>,這可以
<option>-s</option> option; this will set your shell for you, 直接設定你的 shell 而不需要透過任何文字編輯器。例如,假設你想將 shell 變更為
without requiring you to enter an editor. <command>bash</command>,可以透過下列的方式:</para>
For example, if you wanted to
change your shell to <command>bash</command>, the following should do the
trick:</para>
<screen>&prompt.user; <userinput>chsh -s /usr/local/bin/bash</userinput></screen> <screen>&prompt.user; <userinput>chsh -s /usr/local/bin/bash</userinput></screen>

View file

@ -3,7 +3,7 @@
$FreeBSD$ $FreeBSD$
Original revision: 1.213 Original revision: 1.213
Chased revision: 1.217 Chased revision: 1.221
--> -->
<chapter id="config-tuning"> <chapter id="config-tuning">
@ -141,42 +141,30 @@
<para>根據經驗法則,通常 swap 分割區應該設為系統記憶體(RAM)大小的兩倍即可。 <para>根據經驗法則,通常 swap 分割區應該設為系統記憶體(RAM)大小的兩倍即可。
舉例來說:若機器有 128&nbsp;MB RAM 的話,那麼 舉例來說:若機器有 128&nbsp;MB RAM 的話,那麼
swap 則應該設為 256&nbsp;MB。 Systems with swap 則應該設為 256&nbsp;MB。 記憶體較少的機器,可以透過增加更多 swap 空間來提昇效能。
less memory may perform better with more swap. 我們建議 swap 空間不要設低於 256&nbsp;MB而且該考慮增加記憶體才是良策。
Less than 256&nbsp;megabytes of swap is not recommended and 當 swap 最少為記憶體的兩倍大時kernel 的 VM paging 演算法會把效能調整到最佳狀態。
memory expansion should be considered. 但若是機器記憶體很大,但 swap 卻劃分太少的話,會導致 VM page 掃瞄的效率過低,
The kernel's VM paging algorithms are tuned to 此外日後若增加更多記憶體時,也會導致一些異常狀況發生。</para>
perform best when the swap partition is at least two times the
size of main memory. Configuring too little swap can lead to
inefficiencies in the VM page scanning code and might create
issues later if more memory is added.</para>
<para>On larger systems with multiple SCSI disks (or <para>在較大型的機器內,通常會有多顆 SCSI 磁碟(或多顆 IDE 磁碟接在不同 IDE 匯流排上)
multiple IDE disks operating on different controllers), it is 建議在每顆磁碟上都建立 swap(最多到四顆)。
recommend that a swap is configured on each drive (up 而這些 swap 應該都大約一樣大小,
to four drives). The swap partitions should be Kernel 可接受任意大小的 swap但內部資料結構則是最大塊 swap 的 4 倍。
approximately the same size. The kernel can handle arbitrary 若有保持 swap 為同樣大小的話,則可讓 kernel 最佳化運用各磁碟之中的 swap 空間。
sizes but internal data structures scale to 4 times the 即使不太常會用到,分配大的 swap 也都還可接受,
largest swap partition. Keeping the swap partitions near the 因為它可在強制重開機之前讓你更容易從當掉的程式中恢復正常。</para>
same size will allow the kernel to optimally stripe swap space
across disks.
Large swap sizes are fine, even if swap is not
used much. It might be easier to recover
from a runaway program before being forced to reboot.</para>
</sect3> </sect3>
<sect3> <sect3>
<title>為何要規劃 Partition</title> <title>為何要規劃 Partition</title>
<para>Several users think a single large partition will be fine, <para>有些人覺得把硬碟就直接劃分一個大分割區就好了,
but there are several reasons why this is a bad idea. 但是事實上有些原因會證明為何這是個爛點子,
First, each partition has different operational 首先,每個分割區都有不同的運作特性,把它們分開的話可以讓檔案系統來調整。
characteristics and separating them allows the file system to 比如: <filename>/</filename> 以及 <filename>/usr</filename> 分割區大多只是讀取而已,
tune accordingly. For example, the root 比較少在寫入。 而讀寫都很頻繁的則是 <filename>/var</filename> 及
and <filename>/usr</filename> partitions are read-mostly, without <filename>/var/tmp</filename>。</para>
much writing. While a lot of reading and writing 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 introduced in the smaller write heavy partitions
@ -261,28 +249,21 @@
<sect1 id="configtuning-appconfig"> <sect1 id="configtuning-appconfig">
<title>各式應用程式的設定檔</title> <title>各式應用程式的設定檔</title>
<para>Typically, installed applications have their own <para>原則上,安裝的軟體都會有其自有的設定檔,也會有自己的格式及語法。
configuration files, with their own syntax, etc. It is 因此,將其與系統分開獨立是件非常重要的事情。如此一來,套件管理工具將可以
important that these files be kept separate from the base 很輕易的找出這些設定檔並管理這些設定檔。</para>
system, so that they may be easily located and managed by the
package management tools.</para>
<indexterm><primary>/usr/local/etc</primary></indexterm> <indexterm><primary>/usr/local/etc</primary></indexterm>
<para>Typically, these files are installed in <para>原則上,設定檔會被放置在 <filename>/usr/local/etc</filename>。
<filename>/usr/local/etc</filename>. In the case where an 若某軟體的設定檔為數眾多,那將會其下建立一個目錄以供放置</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>通常,當一個 port 或 package 被安裝的同時,一些基本的設定範例
configuration files are also installed. These are usually 也會一併被安裝至此。這些範例通常會被用 <filename>.default</filename> 做為副檔名。
identified with a <filename>.default</filename> suffix. If there 若安裝時沒有自行撰寫的軟體設定檔,那麼將會複製一份 <filename>.default</filename> 設定
are no existing 做為預設設定檔</para>
configuration files for the application, they will be created by
copying the <filename>.default</filename> files.</para>
<para>For example, consider the contents of the directory <para>舉個例子,我們來看看 <filename>/usr/local/etc/apache</filename></para>
<filename>/usr/local/etc/apache</filename>:</para>
<literallayout class="monospaced">-rw-r--r-- 1 root wheel 2184 May 20 1998 access.conf <literallayout class="monospaced">-rw-r--r-- 1 root wheel 2184 May 20 1998 access.conf
-rw-r--r-- 1 root wheel 2184 May 20 1998 access.conf.default -rw-r--r-- 1 root wheel 2184 May 20 1998 access.conf.default
@ -295,9 +276,8 @@
-rw-r--r-- 1 root wheel 7980 May 20 1998 srm.conf -rw-r--r-- 1 root wheel 7980 May 20 1998 srm.conf
-rw-r--r-- 1 root wheel 7933 May 20 1998 srm.conf.default</literallayout> -rw-r--r-- 1 root wheel 7933 May 20 1998 srm.conf.default</literallayout>
<para>The file sizes show that only the <filename>srm.conf</filename> <para><filename>srm.conf</filename> 的檔案被修改過了,爾後 <application>Apache</application> 的更新
file has been changed. A later update of the <application>Apache</application> port would not 將不會對這個已修改過的設定檔做任何變動。</para>
overwrite this changed file.</para>
</sect1> </sect1>
@ -667,7 +647,7 @@ HOME=/var/log
</authorgroup> </authorgroup>
</sect1info> </sect1info>
<title>在 &os; 5.X (含之後) 使用 rc</title> <title>在 &os; 使用 rc</title>
<para>從 2002 年起,&os; 整合了 NetBSD 的 <filename>rc.d</filename> 機制來作為系統服務啟動機制。 <para>從 2002 年起,&os; 整合了 NetBSD 的 <filename>rc.d</filename> 機制來作為系統服務啟動機制。
可以到 <filename>/etc/rc.d</filename> 目錄下去看,很多檔案都是基本服務,可以用 <option>start</option>, <option>stop</option> 可以到 <filename>/etc/rc.d</filename> 目錄下去看,很多檔案都是基本服務,可以用 <option>start</option>, <option>stop</option>
@ -860,7 +840,7 @@ ukphy1: 10baseT, 10baseT-FDX, 100baseTX, 100baseTX-FDX, auto</screen>
<itemizedlist> <itemizedlist>
<listitem> <listitem>
<para>The easiest way is to simply load a kernel module for <para>The easiest way is to simply load a kernel module for
your network card with &man.kldload.8;. Not all NIC your network card with &man.kldload.8;, or automatically at boot time by adding the appropriate line to the file <filename>/boot/loader.conf</filename>. Not all NIC
drivers are available as modules; notable examples of drivers are available as modules; notable examples of
devices for which modules do not exist are ISA cards.</para> devices for which modules do not exist are ISA cards.</para>
</listitem> </listitem>
@ -878,6 +858,128 @@ ukphy1: 10baseT, 10baseT-FDX, 100baseTX, 100baseTX-FDX, auto</screen>
not have to build a new kernel.</para> not have to build a new kernel.</para>
</listitem> </listitem>
</itemizedlist> </itemizedlist>
<sect3 id="config-network-ndis">
<title>Using &windows; NDIS Drivers</title>
<indexterm><primary>NDIS</primary></indexterm>
<indexterm><primary>NDISulator</primary></indexterm>
<indexterm><primary>&windows; drivers</primary></indexterm>
<indexterm><primary>Microsoft Windows</primary></indexterm>
<indexterm><primary>Microsoft Windows</primary>
<secondary>device drivers</secondary></indexterm>
<indexterm><primary>KLD (kernel loadable
object)</primary></indexterm>
<!-- We should probably omit the expanded name, and add a <see> entry
for it. Whatever is done must also be done to the same indexterm in
linuxemu/chapter.sgml -->
<para>Unfortunately, there are still many vendors that do not
provide schematics for their drivers to the open source
community because they regard such information as trade
secrets. Consequently, the developers of &os; and other
operating systems are left two choices: develop the drivers
by a long and pain-staking process of reverse engineering or
using the existing driver binaries available for the
&microsoft.windows; platforms. Most developers, including
those involved with &os;, have taken the latter
approach.</para>
<para>Thanks to the contributions of Bill Paul (wpaul), as of
&os;&nbsp;5.3-RELEASE there is <quote>native</quote> support
for the Network Driver Interface Specification (NDIS). The
&os; NDISulator (otherwise known as Project Evil) takes a
&windows; driver binary and basically tricks it into
thinking it is running on &windows;. Because the
&man.ndis.4; driver is using a &windows; binary, it is only
usable on &i386; and amd64 systems.</para>
<note>
<para>The &man.ndis.4; driver is designed to support mainly
PCI, CardBus and PCMCIA devices, USB devices are not yet
supported.</para>
</note>
<para>In order to use the NDISulator, you need three
things:</para>
<orderedlist>
<listitem>
<para>Kernel sources</para>
</listitem>
<listitem>
<para>&windowsxp; driver binary
(<filename>.SYS</filename> extension)</para>
</listitem>
<listitem>
<para>&windowsxp; driver configuration file
(<filename>.INF</filename> extension)</para>
</listitem>
</orderedlist>
<para>Locate the files for your specific card. Generally,
they can be found on the included CDs or at the vendors'
websites. In the following examples, we will use
<filename>W32DRIVER.SYS</filename> and
<filename>W32DRIVER.INF</filename>.</para>
<note>
<para>You can not use a &windows;/i386 driver with
&os;/amd64, you must get a &windows;/amd64 driver to make it
work properly.</para>
</note>
<para>The next step is to compile the driver binary into a
loadable kernel module. To accomplish this, as
<username>root</username>, use &man.ndisgen.8;:</para>
<screen>&prompt.root; <userinput>ndisgen <replaceable>/path/to/W32DRIVER.INF</replaceable> <replaceable>/path/to/W32DRIVER.SYS</replaceable></userinput></screen>
<para>The &man.ndisgen.8; utility is interactive and will
prompt for any extra information it requires; it will
produce a kernel module in the current directory which can
be loaded as follows:</para>
<screen>&prompt.root; <userinput>kldload <replaceable>./W32DRIVER.ko</replaceable></userinput></screen>
<para>In addition to the generated kernel module, you must
load the <filename>ndis.ko</filename> and
<filename>if_ndis.ko</filename> modules. This should be
automatically done when you load any module that depends on
&man.ndis.4;. If you want to load them manually, use the
following commands:</para>
<screen>&prompt.root; <userinput>kldload ndis</userinput>
&prompt.root; <userinput>kldload if_ndis</userinput></screen>
<para>The first command loads the NDIS miniport driver
wrapper, the second loads the actual network
interface.</para>
<para>Now, check &man.dmesg.8; to see if there were any errors
loading. If all went well, you should get output resembling
the following:</para>
<screen>ndis0: &lt;Wireless-G PCI Adapter&gt; mem 0xf4100000-0xf4101fff irq 3 at device 8.0 on pci1
ndis0: NDIS API version: 5.0
ndis0: Ethernet address: 0a:b1:2c:d3:4e:f5
ndis0: 11b rates: 1Mbps 2Mbps 5.5Mbps 11Mbps
ndis0: 11g rates: 6Mbps 9Mbps 12Mbps 18Mbps 36Mbps 48Mbps 54Mbps</screen>
<para>From here you can treat the
<devicename>ndis0</devicename> device like any other network
interface (e.g., <devicename>dc0</devicename>).</para>
<para>You can configure the system to load the NDIS modules at
boot time in the same way as with any other module. First,
copy the generated module,
<filename>W32DRIVER.ko</filename>, to the <filename
class="directory">/boot/modules</filename> directory. Then,
add the following line to
<filename>/boot/loader.conf</filename>:</para>
<programlisting>W32DRIVER_load="YES"</programlisting>
</sect3>
</sect2> </sect2>
<sect2> <sect2>
@ -1988,7 +2090,8 @@ device_probe_and_attach: cbb0 attach returned 12</screen>
require many thousands of file descriptors, depending on the require many thousands of file descriptors, depending on the
kind and number of services running concurrently.</para> kind and number of services running concurrently.</para>
<para><varname>kern.maxfile</varname>'s default value is <para>In older FreeBSD releases, <varname>kern.maxfile</varname>'s default
value is derived from the <option>maxusers</option> option in your
dictated by the <option>maxusers</option> option in your dictated by the <option>maxusers</option> option in your
kernel configuration file. <varname>kern.maxfiles</varname> grows kernel configuration file. <varname>kern.maxfiles</varname> grows
proportionally to the value of <option>maxusers</option>. When proportionally to the value of <option>maxusers</option>. When
@ -1999,6 +2102,23 @@ device_probe_and_attach: cbb0 attach returned 12</screen>
connected at once, the resources needed may be similar to a connected at once, the resources needed may be similar to a
high-scale web server.</para> high-scale web server.</para>
<para>As of FreeBSD 4.5, <varname>kern.maxusers</varname> is
automatically sized at boot based on the amount of memory available
in the system, and may be determined at run-time by inspecting the
value of the read-only <varname>kern.maxusers</varname> sysctl.
Some sites will require larger or smaller values of
<varname>kern.maxusers</varname> and may set it as a loader tunable;
values of 64, 128, and 256 are not uncommon. We do not recommend
going above 256 unless you need a huge number of file descriptors;
many of the tunable values set to their defaults by
<varname>kern.maxusers</varname> may be individually overridden at
boot-time or run-time in <filename>/boot/loader.conf</filename> (see
the &man.loader.conf.5; man page or the
<filename>/boot/defaults/loader.conf</filename> file for some hints)
or as described elsewhere in this document. Systems older than
FreeBSD&nbsp;4.4 must set this value via the kernel &man.config.8;
option <option>maxusers</option> instead.</para>
<para>The system will auto-tune <para>The system will auto-tune
<literal>maxusers</literal> for you if you explicitly set it to <literal>maxusers</literal> for you if you explicitly set it to
<literal>0</literal><footnote> <literal>0</literal><footnote>

View file

@ -41,7 +41,7 @@
<para>FreeBSD open-source 開發模式的基礎概念;</para> <para>FreeBSD open-source 開發模式的基礎概念;</para>
</listitem> </listitem>
<listitem> <listitem>
<para>當然囉,還有 <quote>FreeBSD</quote> 這名字的緣故。</para> <para>當然囉,還有 <quote>FreeBSD</quote> 這名字的由來。</para>
</listitem> </listitem>
</itemizedlist> </itemizedlist>

View file

@ -24,10 +24,10 @@
</authorgroup> </authorgroup>
</chapterinfo> </chapterinfo>
<title>Electronic Mail</title> <title>電子郵件</title>
<sect1 id="mail-synopsis"> <sect1 id="mail-synopsis">
<title>Synopsis</title> <title>概述</title>
<indexterm><primary>email</primary></indexterm> <indexterm><primary>email</primary></indexterm>
<para><quote>Electronic Mail</quote>, better known as email, is one of the <para><quote>Electronic Mail</quote>, better known as email, is one of the

View file

@ -1,8 +1,8 @@
<!-- <!--
The FreeBSD Documentation Project The FreeBSD Traditional Chinese Documentation Project
$FreeBSD$ $FreeBSD$
Original revision: 1.95 Original revision: 1.96
--> -->
<chapter id="printing"> <chapter id="printing">
@ -25,95 +25,89 @@
</authorgroup> </authorgroup>
</chapterinfo> </chapterinfo>
<title>Printing</title> <title>列印</title>
<sect1 id="printing-synopsis"> <sect1 id="printing-synopsis">
<title>Synopsis</title> <title>概述</title>
<indexterm><primary>LPD spooling system</primary></indexterm> <indexterm><primary>LPD spooling system</primary></indexterm>
<indexterm><primary>LPD 緩衝系統</primary></indexterm>
<indexterm><primary>printing</primary></indexterm> <indexterm><primary>printing</primary></indexterm>
<indexterm><primary>列印</primary></indexterm>
<para>FreeBSD can be used to print with a wide variety of printers, from the <para>FreeBSD 可以和各式各樣的印表機搭配列印,
oldest impact printer to the latest laser printers, and everything in 從最老的撞針式印表機到最新的雷射印表機都沒問題,
between, allowing you to produce high-quality printed output from the 讓您的應用程式可以產生出高品質的文件列印輸出。</para>
applications you run.</para>
<para>FreeBSD can also be configured to act as a print server on a <para>也可以把 FreeBSD 設定成一台網路列印伺服器;這時候的 FreeBSD
network; in this capacity FreeBSD can receive print jobs from a variety 能接收其他電腦送來的列印工作,包括其他 FreeBSD 的電腦、&windows;
of other computers, including other FreeBSD computers, &windows; and &macos; 的電腦以及 &macos; 的電腦。 FreeBSD
hosts. FreeBSD will ensure that one job at a time is printed, and can 會確保同時只有一件文件正在列印,而且可以統計哪個使用者及機器印得最多,
keep statistics on which users and machines are doing the most printing, 還有就是印出接下來是誰的文件這類的<quote>標題</quote>頁等。</para>
produce <quote>banner</quote> pages showing who's printout is who's, and
more.</para>
<para>After reading this chapter, you will know:</para> <para>讀完這章,您將了解:</para>
<itemizedlist> <itemizedlist>
<listitem> <listitem>
<para>How to configure the FreeBSD print spooler.</para> <para>如何設定 FreeBSD 的列印多工緩衝處理器。</para>
</listitem> </listitem>
<listitem> <listitem>
<para>How to install print filters, to handle special print jobs <para>如何安裝列印過濾器以分別處理特殊的列印工作,
differently, including converting incoming documents to print 包括把收到的文件轉換成您的印表機看得懂的列印格式等。</para>
formats that your printers understand.</para>
</listitem> </listitem>
<listitem> <listitem>
<para>How to enable header, or banner pages on your printout.</para> <para>了解如何在您列印時順便印出頁首或標題。</para>
</listitem> </listitem>
<listitem> <listitem>
<para>How to print with printers connected to other computers.</para> <para>如何利用別台電腦上的印表機列印。</para>
</listitem> </listitem>
<listitem> <listitem>
<para>How to print with printers connected directly to the <para>如何利用直接接在網路上的印表機列印。</para>
network.</para>
</listitem> </listitem>
<listitem> <listitem>
<para>How to control printer restrictions, including limiting the size <para>如何控制印表機的權限,包括限制列印工作的檔案大小,
of print jobs, and preventing certain users from printing.</para> 以及不允許特定使用者列印等。</para>
</listitem> </listitem>
<listitem> <listitem>
<para>How to keep printer statistics, and account for printer <para>如何記下印表機的統計資料,以及各帳號的印表機使用量。</para>
usage.</para>
</listitem> </listitem>
<listitem> <listitem>
<para>How to troubleshoot printing problems.</para> <para>如何解決列印時遇到的問題。</para>
</listitem> </listitem>
</itemizedlist> </itemizedlist>
<para>Before reading this chapter, you should:</para> <para>在開始閱讀這章之前,您需要︰</para>
<itemizedlist> <itemizedlist>
<listitem> <listitem>
<para>Know how to configure and install a new kernel <para>要有設定、編譯 kernel 的基礎概念
(<xref linkend="kernelconfig">).</para> (<xref linkend="kernelconfig">)</para>
</listitem> </listitem>
</itemizedlist> </itemizedlist>
</sect1> </sect1>
<sect1 id="printing-intro-spooler"> <sect1 id="printing-intro-spooler">
<title>Introduction</title> <title>介紹</title>
<para>In order to use printers with FreeBSD, you may set <para>要在 FreeBSD 上使用印表機,您需要設定好 Berkeley
them up to work with the Berkeley line printer spooling system, 行列式印表機列印緩衝系統,又稱為 <application>LPD</application>
also known as the <application>LPD</application> spooling system, 列印緩衝系統,或者就叫 <application>LPD</application>。
or just <application>LPD</application>. 這是 FreeBSD 標準的印表機控制系統,本章會介紹並教您如何設定
It is the standard printer control system in FreeBSD. This <application>LPD</application></para>
chapter introduces <application>LPD</application> and
will guide you through its configuration.</para>
<para>If you are already familiar with <para>如果您已經對 <application>LPD</application>
<application>LPD</application> or another printer spooling 或是其他列印緩衝系統很熟悉了,
system, you may wish to skip to section <link 您可以直接跳到<link linkend="printing-intro-setup">基本設定</link>。
linkend="printing-intro-setup">Basic Setup</link>.</para> </para>
<para><application>LPD</application> controls everything about a <para><application>LPD</application> 控制著主機上印表機的一切。
host's printers. It is responsible for a number of things:</para> 這些事情都是它在負責的:</para>
<itemizedlist> <itemizedlist>
<listitem> <listitem>
@ -532,69 +526,14 @@ ppc0: FIFO with 16/16/8 bytes threshold</screen>
follows.</para> follows.</para>
</sect4> </sect4>
</sect3> </sect3>
<sect3 id="printing-parallel-port-mode">
<sect3 id="printing-dev-ports">
<title>Adding <filename>/dev</filename> Entries for the
Ports</title>
<note><para>FreeBSD&nbsp;5.0 includes the <literal>devfs</literal>
filesystem which automatically creates device nodes as
needed. If you are running a version of FreeBSD with
<literal>devfs</literal> enabled then you can safely skip
this section.</para></note>
<para>Even though the kernel may support communication along a
serial or parallel port, you will still need a software
interface through which programs running on the system can
send and receive data. That is what entries in the
<filename>/dev</filename> directory are for.</para>
<para><emphasis>To add a <filename>/dev</filename> entry for a
port:</emphasis></para>
<procedure>
<step>
<para>Become <username>root</username> with the &man.su.1; command.
Enter the <username>root</username> password when prompted.</para>
</step>
<step>
<para>Change to the <filename>/dev</filename>
directory:</para>
<screen>&prompt.root; <userinput>cd /dev</userinput></screen>
</step>
<step>
<para>Type:</para>
<screen>&prompt.root; <userinput>./MAKEDEV <replaceable>port</replaceable></userinput></screen>
<para>Where <replaceable>port</replaceable> is the device
entry for the port you want to make. Use
<literal>lpt0</literal> for the printer on the first parallel port,
<literal>lpt1</literal> for the printer on the second port, and so on; use
<literal>ttyd0</literal> for the first serial port,
<literal>ttyd1</literal> for the second, and so on.</para>
</step>
<step>
<para>Type:</para>
<screen>&prompt.root; <userinput>ls -l <replaceable>port</replaceable></userinput></screen>
<para>to make sure the device entry got created.</para>
</step>
</procedure>
<sect4 id="printing-parallel-port-mode">
<title>Setting the Communication Mode for the Parallel <title>Setting the Communication Mode for the Parallel
Port</title> Port</title>
<para>When you are using the parallel interface, you can choose <para>When you are using the parallel interface, you can choose
whether FreeBSD should use interrupt-driven or polled whether FreeBSD should use interrupt-driven or polled
communication with the printer. The generic printer communication with the printer. The generic printer
device driver (&man.lpt.4;) on FreeBSD&nbsp;4.X and 5.X device driver (&man.lpt.4;) on FreeBSD
uses the &man.ppbus.4; system, which controls the port uses the &man.ppbus.4; system, which controls the port
chipset with the &man.ppc.4; driver.</para> chipset with the &man.ppc.4; driver.</para>
@ -639,15 +578,7 @@ ppc0: FIFO with 16/16/8 bytes threshold</screen>
<itemizedlist> <itemizedlist>
<listitem> <listitem>
<para>If you want interrupt-driven mode, for FreeBSD&nbsp;4.X add the <para>If you want interrupt-driven mode, edit the following line:</para>
<literal>irq</literal> specifier:</para>
<programlisting>device ppc0 at isa? irq <replaceable>N</replaceable></programlisting>
<para>Where <replaceable>N</replaceable> is the IRQ
number for your computer's parallel port.</para>
<para>For FreeBSD&nbsp;5.X, edit the following line:</para>
<programlisting>hint.ppc.0.irq="<replaceable>N</replaceable>"</programlisting> <programlisting>hint.ppc.0.irq="<replaceable>N</replaceable>"</programlisting>
@ -661,22 +592,14 @@ ppc0: FIFO with 16/16/8 bytes threshold</screen>
</listitem> </listitem>
<listitem> <listitem>
<para>If you want polled mode, do not add the <para>If you want polled mode, remove in your
<literal>irq</literal> specifier:</para>
<para>For FreeBSD&nbsp;4.X, use the following line in
your kernel configuration file:</para>
<programlisting>device ppc0 at isa?</programlisting>
<para>For FreeBSD&nbsp;5.X, simply remove in your
<filename>/boot/device.hints</filename> file, the <filename>/boot/device.hints</filename> file, the
following line:</para> following line:</para>
<programlisting>hint.ppc.0.irq="<replaceable>N</replaceable>"</programlisting> <programlisting>hint.ppc.0.irq="<replaceable>N</replaceable>"</programlisting>
<para>In some cases, this is not enough to put the <para>In some cases, this is not enough to put the
port in polled mode under FreeBSD&nbsp;5.X. Most of port in polled mode under FreeBSD. Most of
time it comes from &man.acpi.4; driver, this latter time it comes from &man.acpi.4; driver, this latter
is able to probe and attach devices, and therefore, is able to probe and attach devices, and therefore,
control the access mode to the printer port. You control the access mode to the printer port. You
@ -721,9 +644,9 @@ ppc0: FIFO with 16/16/8 bytes threshold</screen>
<filename>/etc/rc.local</filename> file to set the mode each <filename>/etc/rc.local</filename> file to set the mode each
time your system boots. See &man.lptcontrol.8; for more time your system boots. See &man.lptcontrol.8; for more
information.</para> information.</para>
</sect4> </sect3>
<sect4 id="printing-testing"> <sect3 id="printing-testing">
<title>Checking Printer Communications</title> <title>Checking Printer Communications</title>
<para>Before proceeding to configure the spooling system, you <para>Before proceeding to configure the spooling system, you
@ -762,7 +685,7 @@ showpage</programlisting>
accommodations.</para> accommodations.</para>
</note> </note>
<sect5 id="printing-checking-parallel"> <sect4 id="printing-checking-parallel">
<title>Checking a Parallel Printer</title> <title>Checking a Parallel Printer</title>
<indexterm> <indexterm>
@ -826,9 +749,9 @@ showpage</programlisting>
<para>You should see something print. Do not worry if the <para>You should see something print. Do not worry if the
text does not look right; we will fix such things text does not look right; we will fix such things
later.</para> later.</para>
</sect5> </sect4>
<sect5 id="printing-checking-serial"> <sect4 id="printing-checking-serial">
<title>Checking a Serial Printer</title> <title>Checking a Serial Printer</title>
<indexterm> <indexterm>
@ -923,7 +846,6 @@ showpage</programlisting>
<para>You should see something print. Do not worry if the <para>You should see something print. Do not worry if the
text does not look right; we will fix that later.</para> text does not look right; we will fix that later.</para>
</sect5>
</sect4> </sect4>
</sect3> </sect3>
@ -1196,8 +1118,8 @@ bamboo|ps|PS|S|panasonic|Panasonic KX-P4455 PostScript v51.4:\
<sect4 id="printing-device"> <sect4 id="printing-device">
<title>Identifying the Printer Device</title> <title>Identifying the Printer Device</title>
<para>In the <link linkend="printing-dev-ports">Adding <para>In the
<filename>/dev</filename> Entries for the Ports</link> Entries for the Ports
section, we identified which entry in the section, we identified which entry in the
<filename>/dev</filename> directory FreeBSD will use to <filename>/dev</filename> directory FreeBSD will use to
communicate with the printer. Now, we tell communicate with the printer. Now, we tell

View file

@ -2,7 +2,7 @@
The FreeBSD Documentation Project The FreeBSD Documentation Project
$FreeBSD$ $FreeBSD$
Original revision: 1.54 Original revision: 1.58
--> -->
<chapter id="users"> <chapter id="users">
@ -22,7 +22,8 @@
<sect1 id="users-synopsis"> <sect1 id="users-synopsis">
<title>概述</title> <title>概述</title>
<para>FreeBSD 允許多個使用者同時使用電腦。當然,這並不是很多人同時坐在同一台電腦前 <para>FreeBSD 允許多個使用者同時使用電腦。 當然,
這並不是很多人同時坐在同一台電腦前
<footnote> <footnote>
<para>Well..除非您連接 multiple terminals這種情況我們會在 <xref <para>Well..除非您連接 multiple terminals這種情況我們會在 <xref
linkend="serialcomms"> 講到。</para> linkend="serialcomms"> 講到。</para>
@ -45,11 +46,13 @@
</listitem> </listitem>
<listitem> <listitem>
<para>如何更改帳號的基本資料,像是帳號全名,或是使用的 shell 種類。</para> <para>如何更改帳號的基本資料,像是帳號全名,或是使用的 shell
種類。</para>
</listitem> </listitem>
<listitem> <listitem>
<para>如何針對帳號、群組來設限,比如:允許存取記憶體或 CPU 資源多寡等。</para> <para>如何針對帳號、群組來設限,比如:允許存取記憶體或 CPU
資源多寡等。</para>
</listitem> </listitem>
<listitem> <listitem>
@ -57,7 +60,7 @@
</listitem> </listitem>
</itemizedlist> </itemizedlist>
<para>在閱讀這章之前,您應當了解</para> <para>在開始閱讀這章之前,您需要</para>
<itemizedlist> <itemizedlist>
<listitem> <listitem>
@ -70,155 +73,137 @@
<sect1 id="users-introduction"> <sect1 id="users-introduction">
<title>介紹</title> <title>介紹</title>
<para>系統的所有存取是經由帳號來進行,而所有的程式 process 是由使用者來進行,所以 <para>系統的所有存取是經由帳號來進行,而所有的程式 process
使用者及帳號管理,乃是 FreeBSD 系統上不可或缺的重點。</para> 是由使用者來進行,所以使用者及帳號的管理,乃是 FreeBSD
系統上不可或缺的重點。</para>
<para>Every account on a FreeBSD system has certain information associated <para>所有於 FreeBSD 系統中的帳號皆包含下列相關資訊用來辨識身份。</para>
with it to identify the account.</para>
<variablelist> <variablelist>
<varlistentry> <varlistentry>
<term>User name</term> <term>使用者名稱</term>
<listitem> <listitem>
<para>The user name as it would be typed at the <para>使用者名稱要輸入在 <prompt>login:</prompt> 提示出現後。
<prompt>login:</prompt> prompt. User names must be unique across 使用者名稱必須是獨一無二,
the computer; you may not have two users with the same 不能有重複的使用者名稱。
user name. There are a number of rules for creating valid user 至於如何建立有效使用者名稱的規則,請參閱 &man.passwd.5; 說明,
names, documented in &man.passwd.5;; you would typically use user 通常使用者名稱是以八個以內的小寫字母所組成。</para>
names that consist of eight or fewer all lower case
characters.</para>
</listitem> </listitem>
</varlistentry> </varlistentry>
<varlistentry> <varlistentry>
<term>Password</term> <term>密碼</term>
<listitem> <listitem>
<para>Each account has a password associated with it. The password <para>每個帳號都可擁有一組密碼。 密碼也可以不設,
may be blank, in which case no password will be required to access 如此就不需密碼即可登入系統,但通常這並非妙策,
the system. This is normally a very bad idea; every account 每個帳號都應設定一組密碼。</para>
should have a password.</para>
</listitem> </listitem>
</varlistentry> </varlistentry>
<varlistentry> <varlistentry>
<term>User ID (UID)</term> <term>使用者代號 (User ID, UID)</term>
<listitem> <listitem>
<para>The UID is a number, traditionally from 0 to 65535<footnote id="users-largeuidgid"> <para>UID 是系統用來辨識使用者的數字,通常範圍是從 0 到 65535 <footnote id="users-largeuidgid">
<para>It is possible to use UID/GIDs as large as <para>UID/GID 最大可使用至 4294967295但這樣的 ID
4294967295, but such IDs can cause serious problems 可能會對已假設範圍的軟體造成嚴重問題。</para>
with software that makes assumptions about the values </footnote>。 FreeBSD 內部是使用 UID 來辨識使用者 &mdash;
of IDs.</para> FreeBSD 在執行任何指定使用者的指令之前,都會先把使用者名稱轉換為
</footnote>, used to uniquely identify UID。 也就是說,比如可以有數個不同的使用者名稱,
the user to the system. Internally, FreeBSD uses the UID to 但是都使用同一個 UID對 FreeBSD 來說,這些帳號都只代表同一使用者。
identify users&mdash;any FreeBSD commands that allow you to 不過,實際上需要這樣做的可能性不大。</para>
specify a user name will convert it to the UID before working with
it. This means that you can have several accounts with different
user names but the same UID. As far as FreeBSD is concerned these
accounts are one user. It is unlikely you will ever need to do
this.</para>
</listitem> </listitem>
</varlistentry> </varlistentry>
<varlistentry> <varlistentry>
<term>Group ID (GID)</term> <term>群組代號 (Group ID, GID)</term>
<listitem> <listitem>
<para>The GID is a number, traditionally from 0 to 65535<footnoteref linkend="users-largeuidgid">, used to uniquely identify <para>GID 是系統用來辨識使用者所屬群組的數字,通常範圍是從 0 到 65535<footnoteref linkend="users-largeuidgid">
the primary group that the user belongs to. Groups are a 。 用群組來控制資源存取,可有效減少一些設定檔的大小。
mechanism for controlling access to resources based on a user's 此外,使用者還可以同時屬於多個不同的群組。</para>
GID rather than their UID. This can significantly reduce the size
of some configuration files. A user may also be in more than one
group.</para>
</listitem> </listitem>
</varlistentry> </varlistentry>
<varlistentry> <varlistentry>
<term>Login class</term> <term>登入分類(Login classes)</term>
<listitem> <listitem>
<para>Login classes are an extension to the group mechanism that <para>
provide additional flexibility when tailoring the system to 登入分類是群組的延伸機制,
different users.</para> 提供了不同的使用者更彈性的。</para>
</listitem> </listitem>
</varlistentry> </varlistentry>
<varlistentry> <varlistentry>
<term>Password change time</term> <term>密碼變更期限</term>
<listitem> <listitem>
<para>By default FreeBSD does not force users to change their <para>FreeBSD 預設並不要求使用者週期性的更改密碼。您可以強制某些或
passwords periodically. You can enforce this on a per-user basis, 全部的使用者在指定的期間過後必須更改密碼。</para>
forcing some or all of your users to change their passwords after
a certain amount of time has elapsed.</para>
</listitem> </listitem>
</varlistentry> </varlistentry>
<varlistentry> <varlistentry>
<term>Account expiry time</term> <term>帳號期限</term>
<listitem> <listitem>
<para>By default FreeBSD does not expire accounts. If you are <para>FreeBSD 的帳號沒有預設的期限,如果您已知道帳號的使用期限,
creating accounts that you know have a limited lifespan, for 例如,學校中提供學生使用的帳號,可在建立帳號時指定帳號的期限。
example, in a school where you have accounts for the students, 當帳號過期後會無法登入系統,但該帳號的目錄及檔案則會保留。</para>
then you can specify when the account expires. After the expiry
time has elapsed the account cannot be used to log in to the
system, although the account's directories and files will
remain.</para>
</listitem> </listitem>
</varlistentry> </varlistentry>
<varlistentry> <varlistentry>
<term>User's full name</term> <term>使用者全名</term>
<listitem> <listitem>
<para>The user name uniquely identifies the account to FreeBSD, but <para>FreeBSD 的帳號使用使用者名稱用來辨識,但使用者名稱並不一定代表
does not necessarily reflect the user's real name. This 真實使用者的姓名。為帳號所需的相關資訊。</para>
information can be associated with the account.</para>
</listitem> </listitem>
</varlistentry> </varlistentry>
<varlistentry> <varlistentry>
<term>Home directory</term> <term>家目錄</term>
<listitem> <listitem>
<para>The home directory is the full path to a directory on the <para>家目錄為使用者登入系統時的所在目錄的完整路徑。
system in which the user will start when logging on to the 通常會將所有使用者的家目錄放置於
system. A common convention is to put all user home directories <filename>/home/<replaceable>使用者名稱</replaceable></filename>
under 或 <filename>/usr/home/<replaceable>使用者名稱</replaceable></filename>。
<filename>/home/<replaceable>username</replaceable></filename> 使用者可以將其個人的資料放置於其家目錄之中,並可以在此目錄底下
or <filename>/usr/home/<replaceable>username</replaceable></filename>. 建立新的目錄</para>
The user would store their personal files in their home directory,
and any directories they may create in there.</para>
</listitem> </listitem>
</varlistentry> </varlistentry>
<varlistentry> <varlistentry>
<term>User shell</term> <term>使用者 Shell</term>
<listitem> <listitem>
<para>The shell provides the default environment users use to <para>Shell 提供預設的環境讓使用者與系統互動。
interact with the system. There are many different kinds of Shell 擁有數種不同的種類, 可供進階使用者依使用習慣選擇。</para>
shells, and experienced users will have their own preferences,
which can be reflected in their account settings.</para>
</listitem> </listitem>
</varlistentry> </varlistentry>
</variablelist> </variablelist>
<!--
<para>There are three main types of accounts: the <link Superuser: 系統管理者帳號
linkend="users-superuser">Superuser</link>, <link System users: 系統帳號
linkend="users-system">system users</link>, and <link user accounts: 使用者帳號
linkend="users-user">user accounts</link>. The Superuser -->
account, usually called <username>root</username>, is used to <para>帳號主要分為下列三類: <link
manage the system with no limitations on privileges. System linkend="users-superuser">系統管理者帳號</link>, <link
users run services. Finally, user accounts are used by real linkend="users-system">系統帳號</link>,及 <link
people, who log on, read mail, and so forth.</para> linkend="users-user">使用者帳號</link>。 系統管理者帳號的帳號
通常為 <username>root</username>,擁有最大的權限來管理系統。
系統帳號用來執行伺服器服務。最後,使用者帳號供真正的使用者使用,
可登入、讀信等等。</para>
</sect1> </sect1>
<sect1 id="users-superuser"> <sect1 id="users-superuser">
<title>The Superuser Account</title> <title>系統管理者帳號</title>
<indexterm> <indexterm>
<primary>accounts</primary> <primary>accounts</primary>
@ -251,7 +236,7 @@
</sect1> </sect1>
<sect1 id="users-system"> <sect1 id="users-system">
<title>System Accounts</title> <title>系統帳號</title>
<indexterm> <indexterm>
<primary>accounts</primary> <primary>accounts</primary>
@ -287,7 +272,7 @@
</sect1> </sect1>
<sect1 id="users-user"> <sect1 id="users-user">
<title>User Accounts</title> <title>使用者帳號</title>
<indexterm> <indexterm>
<primary>accounts</primary> <primary>accounts</primary>
@ -310,17 +295,16 @@
</sect1> </sect1>
<sect1 id="users-modifying"> <sect1 id="users-modifying">
<title>Modifying Accounts</title> <title>更改帳號</title>
<indexterm> <indexterm>
<primary>accounts</primary> <primary>accounts</primary>
<secondary>modifying</secondary> <secondary>modifying</secondary>
</indexterm> </indexterm>
<para>There are a variety of different commands available in the <para>在 &unix; 的環境之中提供了各式不同的指令管理使用者帳號,
&unix; environment to manipulate user accounts. The most common 以下為較常使用的指令摘要及更詳細的使用範例。
commands are summarized below, followed by more detailed </para>
examples of their usage.</para>
<informaltable frame="none" pgwide="1"> <informaltable frame="none" pgwide="1">
<tgroup cols="2"> <tgroup cols="2">
@ -329,34 +313,30 @@
<thead> <thead>
<row> <row>
<entry>Command</entry> <entry>指令</entry>
<entry>Summary</entry> <entry>摘要</entry>
</row> </row>
</thead> </thead>
<tbody> <tbody>
<row> <row>
<entry>&man.adduser.8;</entry> <entry>&man.adduser.8;</entry>
<entry>The recommended command-line application for adding <entry>新增使用者。</entry>
new users.</entry>
</row> </row>
<row> <row>
<entry>&man.rmuser.8;</entry> <entry>&man.rmuser.8;</entry>
<entry>The recommended command-line application for <entry>移除使用者。</entry>
removing users.</entry>
</row> </row>
<row> <row>
<entry>&man.chpass.1;</entry> <entry>&man.chpass.1;</entry>
<entry>A flexible tool to change user database information.</entry> <entry>更改使用者資料。</entry>
</row> </row>
<row> <row>
<entry>&man.passwd.1;</entry> <entry>&man.passwd.1;</entry>
<entry>The simple command-line tool to change user <entry>更改使用者密碼。</entry>
passwords.</entry>
</row> </row>
<row> <row>
<entry>&man.pw.8;</entry> <entry>&man.pw.8;</entry>
<entry>A powerful and flexible tool to modify all aspects <entry>修改使用者的各種資料。</entry>
of user accounts.</entry>
</row> </row>
</tbody> </tbody>
</tgroup> </tgroup>
@ -376,109 +356,15 @@
<primary><filename class="directory">/usr/share/skel</filename></primary> <primary><filename class="directory">/usr/share/skel</filename></primary>
</indexterm> </indexterm>
<indexterm><primary>skeleton directory</primary></indexterm> <indexterm><primary>skeleton directory</primary></indexterm>
<para>&man.adduser.8; is a simple program for <para>&man.adduser.8; 是一支新增使用者的簡單程式。
adding new users. It creates entries in the system 它會建立資料於系統的 <filename>passwd</filename> 與
<filename>passwd</filename> and <filename>group</filename> <filename>group</filename>
files. It will also create a home directory for the new user, 檔案之中。 同時也會建立使用者的家目錄,從 <filename>
copy in the default configuration files (<quote>dotfiles</quote>) from /usr/share/skel</filename> 複製預設的組態檔(<quote>dotfiles</quote>)
<filename>/usr/share/skel</filename>, and can optionally mail 並可以選擇性的郵件通知新使用者歡迎訊息。</para>
the new user a welcome message.</para>
<para>In &os;&nbsp;5.0, &man.adduser.8; was rewritten from a
Perl script to a shell script that acts as wrapper around
&man.pw.8;, so its usage is slightly different on &os;&nbsp;4.X
and &os;&nbsp;5.X.</para>
<para>To create the initial configuration file, use
<command>adduser -s -config_create</command>.
<footnote>
<para>The <option>-s</option> makes &man.adduser.8;
default to
quiet. We use <option>-v</option> later when we want to
change defaults.</para>
</footnote>
Next, we configure &man.adduser.8;
defaults, and create our first user account, since using
<username>root</username> for normal usage is evil and
nasty.</para>
<example> <example>
<title>Configuring <command>adduser</command> and adding a <title>在 &os; 內新增使用者</title>
user on &os;&nbsp;4.X</title>
<screen>&prompt.root; <userinput>adduser -v</userinput>
Use option ``-silent'' if you don't want to see all warnings and questions.
Check /etc/shells
Check /etc/master.passwd
Check /etc/group
Enter your default shell: csh date no sh tcsh zsh [sh]: <userinput>zsh</userinput>
Your default shell is: zsh -&gt; /usr/local/bin/zsh
Enter your default HOME partition: [/home]:
Copy dotfiles from: /usr/share/skel no [/usr/share/skel]:
Send message from file: /etc/adduser.message no
[/etc/adduser.message]: <userinput>no</userinput>
Do not send message
Use passwords (y/n) [y]: <userinput>y</userinput>
Write your changes to /etc/adduser.conf? (y/n) [n]: <userinput>y</userinput>
Ok, let's go.
Don't worry about mistakes. I will give you the chance later to correct any input.
Enter username [a-z0-9_-]: <userinput>jru</userinput>
Enter full name []: <userinput>J. Random User</userinput>
Enter shell csh date no sh tcsh zsh [zsh]:
Enter home directory (full path) [/home/jru]:
Uid [1001]:
Enter login class: default []:
Login group jru [jru]:
Login group is ``jru''. Invite jru into other groups: guest no
[no]: <userinput>wheel</userinput>
Enter password []:
Enter password again []:
Name: jru
Password: ****
Fullname: J. Random User
Uid: 1001
Gid: 1001 (jru)
Class:
Groups: jru wheel
HOME: /home/jru
Shell: /usr/local/bin/zsh
OK? (y/n) [y]: <userinput>y</userinput>
Added user ``jru''
Copy files from /usr/share/skel to /home/jru
Add another user? (y/n) [y]: <userinput>n</userinput>
Goodbye!
&prompt.root;</screen>
</example>
<para>In summary, we changed the default shell to
<application>zsh</application> (an additional shell found in
the Ports Collection), and turned off the sending of a welcome mail to
added users. We then saved the configuration,
created an account for <username>jru</username>, and made
sure <username>jru</username> is in <username>wheel</username>
group (so that she may assume the role of
<username>root</username> with the &man.su.1;
command.)</para>
<note>
<para>The password you type in is not echoed, nor are asterisks
displayed. Make sure that you do not mistype the password.
</para>
</note>
<note>
<para>Just use &man.adduser.8; without arguments
from now on, and you will not have to go through changing the
defaults. If the program asks you to change the defaults,
exit the program, and try the <option>-s</option>
option.</para>
</note>
<example>
<title>Adding a user on &os;&nbsp;5.X</title>
<screen>&prompt.root; <userinput>adduser</userinput> <screen>&prompt.root; <userinput>adduser</userinput>
Username: <userinput>jru</userinput> Username: <userinput>jru</userinput>
@ -510,6 +396,11 @@ Add another user? (yes/no): <userinput>no</userinput>
Goodbye! Goodbye!
&prompt.root;</screen> &prompt.root;</screen>
</example> </example>
<note>
<para>您輸入的密碼並不會回應到螢幕,所以不會以星號顯示
。 請確定您所輸入的密碼無誤。</para>
</note>
</sect2> </sect2>
<sect2 id="users-rmuser"> <sect2 id="users-rmuser">
@ -521,62 +412,50 @@ Goodbye!
<secondary>removing</secondary> <secondary>removing</secondary>
</indexterm> </indexterm>
<para>You can use &man.rmuser.8; to <para>您可以使用 &man.rmuser.8; 來將使用者從系統之中完全移除
completely remove a user from the system. &man.rmuser.8; 會執行以下動作:</para>
&man.rmuser.8; performs the following
steps:</para>
<procedure> <procedure>
<step> <step>
<para>Removes the user's &man.crontab.1; entry (if <para>移除該使用者的 &man.crontab.1; 資料 (如果存在)。</para>
any).</para>
</step> </step>
<step> <step>
<para>Removes any &man.at.1; jobs belonging to the <para>移除所有屬於該使用者的 &man.at.1; 工作。</para>
user.</para>
</step> </step>
<step> <step>
<para>Kills all processes owned by the user.</para> <para>中止所有該使用者擁有的程序。</para>
</step> </step>
<step> <step>
<para>Removes the user from the system's local password <para>移除系統本機密碼檔中該使用者的資料。</para>
file.</para>
</step> </step>
<step> <step>
<para>Removes the user's home directory (if it is owned by <para>移除該使用者的家目錄 (如果為該使用者所有)。</para>
the user).</para>
</step> </step>
<step> <step>
<para>Removes the incoming mail files belonging to the user <para>移除 <filename>/var/mail</filename> 中屬於該使用者的郵件。</para>
from <filename>/var/mail</filename>.</para>
</step> </step>
<step> <step>
<para>Removes all files owned by the user from temporary <para>移除暫存空間 (如: <filename>/tmp</filename>) 中所有屬於該使用者的檔案。</para>
file storage areas such as <filename>/tmp</filename>.</para>
</step> </step>
<step> <step>
<para>Finally, removes the username from all groups to which <para>最後,在 <filename>/etc/group</filename> 檔內移除該使用者帳號。
it belongs in <filename>/etc/group</filename>. </para>
<note> <note>
<para>If a group becomes empty and the group name is the <para>若該群組已無成員,或者是群組名稱與該使用者名稱相同時,
same as the username, the group is removed; this 則群組將會被移除; 此操作會與 &man.adduser.8;
complements the per-user unique groups created by 所建立的帳號群組相對應。</para>
&man.adduser.8;.</para>
</note> </note>
</para>
</step> </step>
</procedure> </procedure>
<para>&man.rmuser.8; cannot be used to remove <para>&man.rmuser.8; 無法移除系統管理者帳號帳號,
superuser accounts, since that is almost always an indication 因為這即代表嚴重的破壞行為。</para>
of massive destruction.</para>
<para>By default, an interactive mode is used, which attempts to <para>為了確認您的操作,預設採互動模式。</para>
make sure you know what you are doing.</para>
<example> <example>
<title><command>rmuser</command> Interactive Account Removal</title> <title><command>rmuser</command> 帳號移除</title>
<screen>&prompt.root; <userinput>rmuser jru</userinput> <screen>&prompt.root; <userinput>rmuser jru</userinput>
Matching password entry: Matching password entry:
@ -597,27 +476,19 @@ Removing files belonging to jru from /var/tmp/vi.recover: done.
<title><command>chpass</command></title> <title><command>chpass</command></title>
<indexterm><primary><command>chpass</command></primary></indexterm> <indexterm><primary><command>chpass</command></primary></indexterm>
<para>&man.chpass.1; changes user database <para>&man.chpass.1; 可更改使用者資料如: 密碼、Shell及個人資訊。</para>
information such as passwords, shells, and personal
information.</para>
<para>Only system administrators, as the superuser, may change <para>僅系統管理者即系統管理者帳號可利用 &man.chpass.1; 更改其他使用者的資訊及密碼</para>
other users' information and passwords with
&man.chpass.1;.</para>
<para>When passed no options, aside from an optional username, <para>除了指定使用者名稱,當不加參數時,&man.chpass.1; 會將使用者資訊顯示於編輯器當中。
&man.chpass.1; displays an editor 並於使用者離開編輯器時更新使用者資訊。</para>
containing user information. When the user exists from the
editor, the user database is updated with the new
information.</para>
<note> <note>
<para>In &os;&nbsp;5.X, you will be asked for your password <para>若您並非系統管理者帳號,在離開編輯器前會詢問您的密碼。</para>
after exiting the editor if you are not the superuser.</para>
</note> </note>
<example> <example>
<title>Interactive <command>chpass</command> by Superuser</title> <title>系統管理者帳號 <command>chpass</command></title>
<screen>#Changing user database information for jru. <screen>#Changing user database information for jru.
Login: jru Login: jru
@ -636,11 +507,10 @@ Home Phone:
Other information:</screen> Other information:</screen>
</example> </example>
<para>The normal user can change only a small subset of this <para>一般使用者僅可更改自己的少部份資訊。</para>
information, and only for themselves.</para>
<example> <example>
<title>Interactive <command>chpass</command> by Normal User</title> <title>一般使用者 <command>chpass</command></title>
<screen>#Changing user database information for jru. <screen>#Changing user database information for jru.
Shell: /usr/local/bin/zsh Shell: /usr/local/bin/zsh
@ -652,14 +522,10 @@ Other information:</screen>
</example> </example>
<note> <note>
<para>&man.chfn.1; and &man.chsh.1; are <para>&man.chfn.1; 與 &man.chsh.1; 即為 &man.chpass.1;,也同
just links to &man.chpass.1;, as &man.ypchpass.1;、&man.ypchfn.1; 與 &man.ypchsh.1;。
are &man.ypchpass.1;, NIS 支援是自動的,所以無需在指令前加上 <literal>yp</literal>。
&man.ypchfn.1;, and 若這會困擾您,請不必擔心,<xref linkend="network-servers"> 將函蓋 NIS 的部份的說明。</para>
&man.ypchsh.1;. NIS support is automatic, so
specifying the <literal>yp</literal> before the command is
not necessary. If this is confusing to you, do not worry, NIS will
be covered in <xref linkend="network-servers">.</para>
</note> </note>
</sect2> </sect2>
<sect2 id="users-passwd"> <sect2 id="users-passwd">
@ -670,17 +536,15 @@ Other information:</screen>
<primary>accounts</primary> <primary>accounts</primary>
<secondary>changing password</secondary> <secondary>changing password</secondary>
</indexterm> </indexterm>
<para>&man.passwd.1; is the usual way to <para>&man.passwd.1; 是更改密碼常用的方式,除了超級管理者可更改其他使用者的密碼外
change your own password as a user, or another user's password 使用者僅能更改自己的密碼。</para>
as the superuser.</para>
<note> <note>
<para>To prevent accidental or unauthorized changes, the original <para>為了避免意外或未經同意的修改,在更新密碼前需輸入原密碼。</para>
password must be entered before a new password can be set.</para>
</note> </note>
<example> <example>
<title>Changing Your Password</title> <title>更改您的密碼</title>
<screen>&prompt.user; <userinput>passwd</userinput> <screen>&prompt.user; <userinput>passwd</userinput>
Changing local password for jru. Changing local password for jru.
@ -692,7 +556,7 @@ passwd: done</screen>
</example> </example>
<example> <example>
<title>Changing Another User's Password as the Superuser</title> <title>以系統管理者帳號去更改其他使用者的密碼</title>
<screen>&prompt.root; <userinput>passwd jru</userinput> <screen>&prompt.root; <userinput>passwd jru</userinput>
Changing local password for jru. Changing local password for jru.
@ -703,10 +567,8 @@ passwd: done</screen>
</example> </example>
<note> <note>
<para>As with &man.chpass.1;, <para>&man.chpass.1;、
&man.yppasswd.1; is just a link to &man.yppasswd.1; 即為 &man.passwd.1;,皆支援 NIS。</para>
&man.passwd.1;, so NIS works with either
command.</para>
</note> </note>
</sect2> </sect2>
@ -715,32 +577,32 @@ passwd: done</screen>
<title><command>pw</command></title> <title><command>pw</command></title>
<indexterm><primary><command>pw</command></primary></indexterm> <indexterm><primary><command>pw</command></primary></indexterm>
<para>&man.pw.8; is a command line utility to create, remove, <para>&man.pw.8; 用來建立、移除、修改及查詢使用者及群組。
modify, and display users and groups. It functions as a front 其功能即為系統使用者及群組檔案的前端。&man.pw.8; 擁有大量的指令參數
end to the system user and group files. &man.pw.8; 較適合使用於 shell script 中,對新手來說會此指令較其他指令複雜許多。
has a very powerful set of command line options that make it </para>
suitable for use in shell scripts, but new users may find it
more complicated than the other commands presented
here.</para>
</sect2> </sect2>
</sect1> </sect1>
<sect1 id="users-limiting"> <sect1 id="users-limiting">
<title>對帳號的資源運用作限制</title> <title>使用者資源限制</title>
<indexterm><primary>limiting users</primary></indexterm> <indexterm><primary>limiting users</primary></indexterm>
<indexterm> <indexterm>
<primary>accounts</primary> <primary>accounts</primary>
<secondary>limiting</secondary> <secondary>limiting</secondary>
</indexterm> </indexterm>
<para>If you have users, the ability to limit their system use may <!--
have come to mind. FreeBSD provides login class: 登入分級
several ways an administrator can limit the amount of system login capability: 登入容量
resources an individual may use. These limits are -->
divided into two sections: disk quotas, and other resource <para>
limits.</para> 若您擁有許多使用者,接下會想到該如何限制使用的資源。
FreeBSD 提供管理者許多方法來限制系統的資源給每個人使用。
這些限制分為兩個部份: 磁碟限額,以及其他資源限制。
</para>
<indexterm><primary>quotas</primary></indexterm> <indexterm><primary>quotas</primary></indexterm>
<indexterm> <indexterm>
@ -748,59 +610,46 @@ passwd: done</screen>
<secondary>quotas</secondary> <secondary>quotas</secondary>
</indexterm> </indexterm>
<indexterm><primary>disk quotas</primary></indexterm> <indexterm><primary>disk quotas</primary></indexterm>
<para>Disk quotas limit disk usage to users, and <para>磁碟限額可以限制使用者的磁碟用量,
they 它提供了一種方法可以快速的檢查並計算用量
provide a way to quickly check that usage without 而不需每次重新計算,
calculating it every time. Quotas are discussed in <xref 關於磁碟限額將於 <xref linkend="quotas"> 會討論。</para>
linkend="quotas">.</para>
<para>The other resource limits include ways to limit the amount of <para>其他資源限制包含了 CPU、記憶體、以及其他每個使用者可使用
CPU, memory, and other resources a user may consume. These are 的資源做限制,這些限制可使用 Login class 來定義並於在本章討論。</para>
defined using login classes and are discussed here.</para>
<indexterm> <indexterm>
<primary><filename>/etc/login.conf</filename></primary> <primary><filename>/etc/login.conf</filename></primary>
</indexterm> </indexterm>
<para>Login classes are defined in <para>Login class 定義於
<filename>/etc/login.conf</filename>. The precise semantics are <filename>/etc/login.conf</filename>。 明確語意不會在本節說明
beyond the scope of this section, but are described in detail in the 但詳細的描述會在 &man.login.conf.5; 文件中。 每使用者預設被
&man.login.conf.5; manual page. It is sufficient to say that each 分配到一個 Login class 中 (預設為 <literal>default</literal>)
user is assigned to a login class (<literal>default</literal> by 而每個 Login class 都有其資源的限制(Login capabilitiy)。
default), and that each login class has a set of login capabilities Login capabilitiy 以 <literal><replaceable>名稱</replaceable>=<replaceable>值</replaceable></literal> 成對,
associated with it. A login capability is a <replaceable>名稱</replaceable> 代表資源的種類,而 <replaceable>值</replaceable>
<literal><replaceable>name</replaceable>=<replaceable>value</replaceable></literal> 為任意的字串,為對應名稱的參數。 設定 Login class 及 Login capability 相當簡單,並同樣在
pair, where <replaceable>name</replaceable> is a well-known &man.login.conf.5; 中詳細說明。</para>
identifier and <replaceable>value</replaceable> is an arbitrary
string processed accordingly depending on the name. Setting up login
classes and capabilities is rather straight-forward and is also
described in &man.login.conf.5;.</para>
<note> <note>
<para>The system does not normally read the configuration in <para>系統不會直接讀取 <filename>/etc/login.conf</filename> 的組態
<filename>/etc/login.conf</filename> directly, but reads the database 而是讀取提供查詢較快的 <filename>/etc/login.conf.db</filename> 資料庫檔。
file <filename>/etc/login.conf.db</filename> which provides 要從 <filename>/etc/login.conf</filename> 產生 <filename>/etc/login.conf.db</filename>
faster lookups. 需要執行以下指令:</para>
To generate <filename>/etc/login.conf.db</filename> from
<filename>/etc/login.conf</filename>, execute the following
command:</para>
<screen>&prompt.root; <userinput>cap_mkdb /etc/login.conf</userinput></screen> <screen>&prompt.root; <userinput>cap_mkdb /etc/login.conf</userinput></screen>
</note> </note>
<para>Resource limits are different from plain vanilla login <para>資源限制於一般的 Login capability 有兩點不同。
capabilities in two ways. First, for every limit, there is a soft 第一,每種限制分為軟性限制及硬性限制。
(current) and hard limit. A soft limit may be adjusted by the user 軟性限制可由使用者或應用程式調整,但不能高於硬性限制。
or application, but may be no higher than the hard limit. The latter 後者限制可被使用者降低,但無法再提高。
may be lowered by the user, but never raised. Second, most resource 第二,多數資源限制是針對每個使用者的個別行程限制,而不是使用者的所有行程。
limits apply per process to a specific user, not the user as a whole. 注意,這些差異是由指定的限制程式托管,並非實作於 Login capability 的架構
Note, however, that these differences are mandated by the specific (例如,這些不是 <emphasis>真正</emphasis> 登入容量的特例)。</para>
handling of the limits, not by the implementation of the login
capability framework (i.e., they are not <emphasis>really</emphasis>
a special case of login capabilities).</para>
<para>And so, without further ado, below are the most commonly used <para>另外,為了避免麻煩,以下為幾個常用的資源限制
resource limits (the rest, along with all the other login (剩下及其他的 Login capability 可在 &man.login.conf.5; 中找到說明)。</para>
capabilities, may be found in &man.login.conf.5;).</para>
<variablelist> <variablelist>
<varlistentry> <varlistentry>
@ -833,7 +682,7 @@ passwd: done</screen>
<secondary>cputime</secondary> <secondary>cputime</secondary>
</indexterm> </indexterm>
<para>This is the maximum amount of CPU time a user's process may <para>This is the maximum amount of CPU time a user's process may
consume. Offending processes will be killed by the kernel. consume. Offending processes will be killed by the kernel.</para>
<note> <note>
<para>This is a limit on CPU <emphasis>time</emphasis> <para>This is a limit on CPU <emphasis>time</emphasis>
@ -844,7 +693,6 @@ passwd: done</screen>
legitimate task&mdash;can easily use almost 100% of a CPU legitimate task&mdash;can easily use almost 100% of a CPU
for some time.</para> for some time.</para>
</note> </note>
</para>
</listitem> </listitem>
</varlistentry> </varlistentry>
@ -1016,7 +864,7 @@ passwd: done</screen>
</sect1> </sect1>
<sect1 id="users-groups"> <sect1 id="users-groups">
<title>Groups</title> <title>群組</title>
<indexterm><primary>groups</primary></indexterm> <indexterm><primary>groups</primary></indexterm>
<indexterm> <indexterm>

View file

@ -675,7 +675,7 @@ DOS2UNIX_REGEX= .*\.(c|cpp|h)</programlisting>
</sect1> </sect1>
<sect1 id="slow-configure"> <sect1 id="slow-configure">
<title>Configuring</title> <title>設定</title>
<para>Include any additional customization commands in your <para>Include any additional customization commands in your
<filename>configure</filename> script and save it in the <filename>configure</filename> script and save it in the
@ -8446,13 +8446,9 @@ etc/orbit.conf.sample
<screen>&prompt.root; <userinput>(cd /var/tmp/$(make -V PORTNAME) && find -d * -type d) | sort | comm -13 OLD-DIRS - | sort -r | sed -e 's#^#@dirrm #' &gt;&gt; pkg-plist</userinput></screen> <screen>&prompt.root; <userinput>(cd /var/tmp/$(make -V PORTNAME) && find -d * -type d) | sort | comm -13 OLD-DIRS - | sort -r | sed -e 's#^#@dirrm #' &gt;&gt; pkg-plist</userinput></screen>
<para>Finally, you need to tidy up the packing list by hand; it is not <para>最後您應該手動整理檔案清單這不是全部自動化處理的。Man page 則應該利用 <makevar>MAN<replaceable>n</replaceable></makevar> 的方式
<emphasis>all</emphasis> automated. Manual pages should be listed in 寫在 port 的 <filename>Makefile</filename> 而不是寫在檔案清單中。
the port's <filename>Makefile</filename> under 使用者設定檔應該移除,或更名為<filename><replaceable>filename</replaceable>.sample</filename>。
<makevar>MAN<replaceable>n</replaceable></makevar>, and not in the
package list. User configuration files should be removed, or
installed as
<filename><replaceable>filename</replaceable>.sample</filename>.
The <filename>info/dir</filename> file should not be listed The <filename>info/dir</filename> file should not be listed
and appropriate <filename>install-info</filename> lines should and appropriate <filename>install-info</filename> lines should
be added as noted in the <link linkend="makefile-info">info be added as noted in the <link linkend="makefile-info">info