From owner-svn-doc-head@freebsd.org Wed Jan 4 08:47:28 2017 Return-Path: Delivered-To: svn-doc-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EA160C9D624; Wed, 4 Jan 2017 08:47:28 +0000 (UTC) (envelope-from rcyu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 623051883; Wed, 4 Jan 2017 08:47:28 +0000 (UTC) (envelope-from rcyu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v048lRsA086836; Wed, 4 Jan 2017 08:47:27 GMT (envelope-from rcyu@FreeBSD.org) Received: (from rcyu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v048lROH086834; Wed, 4 Jan 2017 08:47:27 GMT (envelope-from rcyu@FreeBSD.org) Message-Id: <201701040847.v048lROH086834@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rcyu set sender to rcyu@FreeBSD.org using -f From: Ruey-Cherng Yu Date: Wed, 4 Jan 2017 08:47:27 +0000 (UTC) To: doc-committers@freebsd.org, svn-doc-all@freebsd.org, svn-doc-head@freebsd.org Subject: svn commit: r49794 - head/zh_TW.UTF-8/books/handbook X-SVN-Group: doc-head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-doc-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the doc tree for head List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 04 Jan 2017 08:47:29 -0000 Author: rcyu Date: Wed Jan 4 08:47:27 2017 New Revision: 49794 URL: https://svnweb.freebsd.org/changeset/doc/49794 Log: Update the po file of the zh_TW handbook to sync with the latest English version. Mainly translate the following sections: 11.2. Starting Services 11.3. Configuring cron(8) 11.4. Managing Services in FreeBSD 11.5. Setting Up Network Interface Cards 11.6. Virtual Hosts 11.7. Configuring System Logging (11.7.1, 11.7.2) 11.8. Configuration Files 11.9. Tuning with sysctl(8) 11.12. Adding Swap Space Update the zh_TW translation of the following chapters or sections: 6.2.1.3. Firefox and Swfdec Flash® Plugin 6.2.4. Chromium 6.3.1. Calligra 6.3.5. LibreOffice 6.4. Document Viewers 7.2. Setting Up the Sound Card 8.2. Why Build a Custom Kernel? 8.3. Finding the System Hardware 19. The Z File System (ZFS) Submitted by: cwlin0416@gmail.com Differential Revision: https://reviews.freebsd.org/D9040 Modified: head/zh_TW.UTF-8/books/handbook/book.xml head/zh_TW.UTF-8/books/handbook/zh_TW.po Modified: head/zh_TW.UTF-8/books/handbook/book.xml ============================================================================== --- head/zh_TW.UTF-8/books/handbook/book.xml Tue Jan 3 18:42:44 2017 (r49793) +++ head/zh_TW.UTF-8/books/handbook/book.xml Wed Jan 4 08:47:27 2017 (r49794) @@ -117,6 +117,7 @@ + @@ -134,6 +135,7 @@ + @@ -283,6 +285,7 @@ + @@ -332,6 +335,7 @@ + @@ -400,6 +404,7 @@ + @@ -629,6 +634,7 @@ 2013 2014 2015 + 2016 The FreeBSD Documentation Project @@ -706,9 +712,9 @@ - 歡迎使用 FreeBSD! 本使用手冊涵蓋範圍包括了 FreeBSD 9.3-RELEASEFreeBSD 10.3-RELEASE。 這份使用手冊是很多人的集體創作,而且仍然『持續不斷』的進行中。 許多章節仍未完成,已完成的部份也有些需要更新。 如果您有興趣協助本計畫的話,請寄電子郵件至 FreeBSD 文件專案郵遞論壇。 + 歡迎使用 FreeBSD! 本使用手冊涵蓋範圍包括了 FreeBSD 11.0-RELEASE, FreeBSD 10.3-RELEASE 以及 FreeBSD 9.3-RELEASE 的安裝與平日操作的說明。 這份使用手冊是很多人的集體創作,而且仍然『持續不斷』的進行中,因此部份章節可能尚未仍未完成,如果您有興趣協助本計畫的話,請寄電子郵件至 FreeBSD 文件專案郵遞論壇。 - FreeBSD 網站 可以找到這份文件的最新版本,舊版文件可從 http://docs.FreeBSD.org/doc/ 取得,也可以從 FreeBSD FTP 伺服器 或是眾多 鏡像網站 下載不同格式的資料。 如果比較偏好實體書面資料,那可以在 FreeBSD 商城 購買。 此外,您可在 搜尋頁面 中搜尋本文件或其他文件的資料。 + FreeBSD 網站 可以找到本文件的最新版本,舊版文件可從 http://docs.FreeBSD.org/doc/ 取得。本文件也提供各種格式與不同壓縮方式的版本可自 FreeBSD FTP 伺服器 或是其中一個 鏡像網站 下載。 列印出來的實體書面資料可在 FreeBSD 商城 購買。 此外,您可在 搜尋頁面 中搜尋本文件或其他文件的資料。 @@ -1629,6 +1635,13 @@ + Stormshield + Stormshield + + - Stormshield 網路安全設備使用了硬體化版本的 FreeBSD 做為基礎,BSD 授權條款讓我們我們的智慧財產與系統可以整合,並同時回饋大量有趣的發展給社群。 + + + The Weather Channel The Weather Channel @@ -2258,7 +2271,7 @@ 檢查 FreeBSD 勘誤表 - 儘管 FreeBSD Project 努力確保每個 FreeBSD 發行版能夠儘可能地穩定,錯誤偶爾還是會悄悄出現。 有極小的機會錯誤會影響安裝過程。 當這些問題被發現並修正後,會被紀錄在 FreeBSD 網站的 FreeBSD 勘誤表 (http://www.freebsd.org/releases/10.3R/errata.html)。 安裝前要檢查勘誤表,確保沒有會影響到安裝的問題。 + 儘管 FreeBSD Project 努力確保每個 FreeBSD 發行版能夠儘可能地穩定,但錯誤偶爾還是會悄悄出現,並有極小的可能會發生影響安裝流程的錯誤,當這些問題被發現並修正後,會被紀錄在 FreeBSD 網站的 FreeBSD 勘誤表 (http://www.freebsd.org/releases/11.0R/errata.html)。 安裝前先檢查勘誤表,以確保沒有會影響到安裝的問題。 所有發行版的資訊和勘誤表可以在 FreeBSD 網站的發行資訊找到 (http://www.freebsd.org/releases/index.html)。 @@ -2293,6 +2306,10 @@ -memstick.img:這個檔案含有所有安裝 FreeBSD 所需的檔案,包含原始碼及 Port 套件集。這個檔案應依據以下操作指示寫入到 USB 隨身碟使用。 + + + -mini-memstick.img:類似 -bootonly.iso,但不含安裝檔 (可依所要下載),安裝時需要網際網路連線,可依 的說明將此檔案寫入至 USB 隨身碟。 + 映像檔下載完成之後,下載同一個目錄之中的 CHECKSUM.SHA256。FreeBSD 提供 sha2561 可用來計算映像檔的 校驗碼 (Checksum),使用方式為 sha256 imagefilename,其他作業系統也會有類似的程式。 @@ -8595,7 +8612,7 @@ EndSection Chromium - Chromium 是一個開放源始碼的瀏覽器計劃,該計劃的目標是要建立一個安全、快速且更穩定的網頁瀏覽體驗。Chromium 的功能有頁籤式瀏覽、彈出視窗封鎖、擴充套件等等。Chromium 也是 Google Chrome 網頁瀏覽器所採用的基礎。 + Chromium 是一個開放源始碼的瀏覽器計劃,該計劃的目標是要建立一個安全、快速且更穩定的網頁瀏覽體驗。Chromium 的功能有頁籤式瀏覽、彈出視窗封鎖、擴充套件等等。 Chromium 可以使用套件來安裝,只要輸入: @@ -9218,7 +9235,7 @@ EndSection PCI sound cards - 開始設定之前,必須先知道你的音效卡型號、晶片為何。 FreeBSD 支援許多種音效卡,請檢查支援的音效硬體表 Hardware Notes,以確認你的音效卡是否支援以及如何在 FreeBSD 上驅動。 + 開始設定之前,必須先知道你的音效卡型號、晶片為何。 FreeBSD 支援許多種音效卡,請檢查支援的音效硬體表 Hardware Notes,以確認你的音效卡是否支援以及如何在 FreeBSD 上驅動。 kernel @@ -10726,7 +10743,7 @@ add path usb/0.2.0 mode 0666 group usb早期的 FreeBSD 的核心 (Kernel) 被戲稱為 “巨石”。因為當時的核心是一個非常大的程式,且只支援固定的硬體裝置,如果您想改變核心的設定,就必須編譯一個新核心並重新開機,才能使用。 - 現在,大多數在 FreeBSD 核心的功能已採用模組 (Module) 的方式包裝,可以依據需求動態在核心載入或卸載。 這使得核心能夠快速採用新硬體環境的新功能,就叫做模組化核心 (Modular Kernel)。 + 現今,大多數在 FreeBSD 核心的功能已採用模組 (Module) 的方式包裝,並可依需求動態從核心載入或卸載。 這使得執行中的核心能夠快速適應新硬體環境並在核心開啟新的功能,這就是所謂模組化核心 (Modular Kernel)。 儘管如此,還是有一些功能因使用到靜態的核心設定須要編譯,因為這些功能與核心緊密結合,無法將做成可動態載入的模組。且部份強調安全性的環境會盡量避免載入與卸載核心模組,且只要將需要的功能靜態的編譯到核心當中。 @@ -10802,7 +10819,7 @@ ath0@pci0:3:0:0: class=0x020000 c 以上輸出資訊說明 ath 驅動程式已經找到一個無線乙太網路裝置。 - man1 指令加上 參數,可提供有用的資訊,例如,列出有包含指定關鍵字的手冊頁面清單: + man1 指令加上 旗標可提供有用的資訊,例如,這可列出有包含指定裝置品牌或名稱的手冊頁面清單: # man -k Atheros @@ -14025,29 +14042,14 @@ export PATH services - Many users install third party software on FreeBSD from the - Ports Collection and require the installed services to be - started upon system initialization. Services, such as - mail/postfix or - www/apache22 are just two of the many - software packages which may be started during system - initialization. This section explains the procedures available - for starting third party software. + 許多使用者會使用 Port 套件集安裝第三方軟體到 FreeBSD 且需要安裝服務在系統初始化時可啟動該軟體。服務,例如 mail/postfixwww/apache22 僅只是在眾多需要在系統初始化時啟動的軟體之中的兩個。本章節將說明可用來啟動第三方軟體的程序。 - In FreeBSD, most included services, such as cron8, are - started through the system start up scripts. + 在 FreeBSD 大多數內建的服務,例如 cron8 也是透過系統啟動 Script 來執行。 延伸應用程式設定 - Now that FreeBSD includes rc.d, - configuration of application startup is easier and provides - more features. Using the key words discussed in - , applications can be set to - start after certain other services and extra flags can be - passed through /etc/rc.conf in place of - hard coded flags in the start up script. A basic script may - look similar to the following: + 現在 FreeBSD 會引用 rc.d,讓設定應用程式啟動程式更簡單且提供更多的功能。使用於 所提到的關鍵字,可以設定應用程式在其他特定服務之後啟動且可以透過 /etc/rc.conf 來傳遞額外的旗標來取代寫死在啟動 Script 中的旗標。一個基本的 Script 可能會如下例所示: #!/bin/sh # @@ -14073,43 +14075,23 @@ pidfile=${utility_pidfile-"/var/run/util run_rc_command "$1" - This script will ensure that the provided - utility will be started after the - DAEMON pseudo-service. It also provides a - method for setting and tracking the process ID - (PID). + 這個 Script 會確保要執行的 utility 會在虛構的服務 DAEMON 之後啟動,也同時提供設定與追蹤程序 ID (Process ID, PID) 的方法。 - This application could then have the following line placed - in /etc/rc.conf: + 接著此應用程式便可將下行放到 /etc/rc.conf 中: utility_enable="YES" - This method allows for easier manipulation of command - line arguments, inclusion of the default functions provided - in /etc/rc.subr, compatibility with - rcorder8, and provides for easier configuration via - rc.conf. + 使用這種方式可以簡單的處理指令列參數、引用 /etc/rc.subr 所提供的預設函數、與 rcorder8 相容並可在 rc.conf 簡單的設定。 使用服務來啟動其他服務 - Other services can be started using inetd8. - Working with inetd8 and its configuration is - described in depth in - . - - In some cases, it may make more sense to use - cron8 to start system services. This approach - has a number of advantages as cron8 runs these - processes as the owner of the crontab5. This allows - regular users to start and maintain their own - applications. - - The @reboot feature of cron8, - may be used in place of the time specification. This causes - the job to run when cron8 is started, normally during - system initialization. + 其他的服務可以使用 inetd8 來啟動,在 有如何使用 inetd8 以及其設定的深入說明。 + + 在某些情況更適合使用 cron8 來啟動系統服務,由於 cron8 會使用 crontab5 的擁有者來執行這些程序,所以這個方法有不少優點,這讓一般的使用者也可以啟動與維護自己的應用程式。 + + cron8@reboot 功能,可用來替代指定詳細的時間,而該工作會在系統初始化時執行 cron8 後執行。 @@ -14133,35 +14115,13 @@ run_rc_command "$1" configuration - One of the most useful utilities in FreeBSD is - cron. This utility runs in the - background and regularly checks - /etc/crontab for tasks to execute and - searches /var/cron/tabs for custom crontab - files. These files are used to schedule tasks which - cron runs at the specified times. - Each entry in a crontab defines a task to run and is known as a - cron job. - - Two different types of configuration files are used: the - system crontab, which should not be modified, and user crontabs, - which can be created and edited as needed. The format used by - these files is documented in crontab5. The format of the - system crontab, /etc/crontab includes a - who column which does not exist in user - crontabs. In the system crontab, - cron runs the command as the user - specified in this column. In a user crontab, all commands run - as the user who created the crontab. - - User crontabs allow individual users to schedule their own - tasks. The root user - can also have a user crontab which can be - used to schedule tasks that do not exist in the system - crontab. + 在 FreeBSD 其中最有用的其中一項工具便是 cron,這個工具會在背景執行並且定期檢查 /etc/crontab 是否有要執行的工作然後搜尋 /var/cron/tabs 是否有自訂的 crontab 檔案,這些檔案用來安排要讓 cron 在指定的時間執行的工作,crontab 中的每一個項目定義了一個要執行的工作,又稱作 cron job - Here is a sample entry from the system crontab, - /etc/crontab: + 這裡使用了兩種類型的設定檔:其一是系統 crontab,系統 crontab 不應該被修改,其二為使用者 crontab,使用者 crontab 可以依需要建立與編輯。這兩種檔案的格式在 crontab5 有說明。系統 crontab /etc/crontab 的格式含有在使用者 crontab 所沒有的 who 欄位,在系統 crontab,cron 會依據該欄位所指定的使用者來執行指令,而在使用者 crontab,會以建立 crontab 的使用者來執行指令。 + + 使用者 crontab 讓個別使用者可以安排自己的工作,root 使用者也可有自己的使用者 crontab 來安排不在系統 crontab 中的工作。 + + 以下為系統 crontab /etc/crontab 的範例項目: # /etc/crontab - root's crontab for FreeBSD # @@ -14176,115 +14136,58 @@ PATH=/etc:/bin:/sbin:/usr/bin:/usr/sbin - Lines that begin with the # character - are comments. A comment can be placed in the file as a - reminder of what and why a desired action is performed. - Comments cannot be on the same line as a command or else - they will be interpreted as part of the command; they must - be on a new line. Blank lines are ignored. + # 字元為首的行代表註解。可在檔案中放置註解提醒要執行什麼動作及為何要執行。註解不可與指令同行,否則會被當做指令的一部份,註解必須在新的一行,空白行則會被忽略掉。 - The equals (=) character is used to - define any environment settings. In this example, it is - used to define the SHELL and - PATH. If the SHELL is - omitted, cron will use the - default Bourne shell. If the PATH is - omitted, the full path must be given to the command or - script to run. + 等號 (=) 字元用來定義任何環境設定。在這個例子當中,使用了等號來定義 SHELLPATH。若 SHELL 被省略,cron 則會使用預設的 Bourne shell。若 PATH 被省略,則必須指定指令或 Script 的完整路徑才能執行。 - This line defines the seven fields used in a system - crontab: minute, hour, - mday, month, - wday, who, and - command. The minute - field is the time in minutes when the specified command will - be run, the hour is the hour when the - specified command will be run, the mday - is the day of the month, month is the - month, and wday is the day of the week. - These fields must be numeric values, representing the - twenty-four hour clock, or a *, - representing all values for that field. The - who field only exists in the system - crontab and specifies which user the command should be run - as. The last field is the command to be executed. + 此行定義了在系統 crontab 會使用到的七個欄位:minute, hour, mday, month, wday, who 以及 commandminute 欄位是指定指令要執行的時間中的分,hour 指定指令要執行的時,mday 是月裡面的日,month 是月,以及 wday 是週裡面的日。這些欄位必須數值代表 24 小時制的時間或 * 來代表所有可能的值。who 這個欄位只有系統 crontab 才有,用來指定要用那一個使用者來執行指令。最後一個欄位則是要執行的指令。 - This entry defines the values for this cron job. The - */5, followed by several more - * characters, specifies that - /usr/libexec/atrun is invoked by - root every five - minutes of every hour, of every day and day of the week, of - every month. - - Commands can include any number of switches. However, - commands which extend to multiple lines need to be broken - with the backslash \ continuation - character. + 這個項目定義了該工作所使用的數值,*/5 後接著數個 * 字元指的是每個月的每一週的每一日的每個小時的每 5 分鐘會使用 root 執行 /usr/libexec/atrun + + 指令可含任何數量的參數,但若指令要使用多行則需以反斜線 \ 連線字元換行。 建立使用者的 Crontab - To create a user crontab, invoke - crontab in editor mode: + 要建立一個使用者 crontab 可使用編輯模式執行 crontab % crontab -e - This will open the user's crontab using the default text - editor. The first time a user runs this command, it will open - an empty file. Once a user creates a crontab, this command - will open that file for editing. - - It is useful to add these lines to the top of the crontab - file in order to set the environment variables and to remember - the meanings of the fields in the crontab: + 這樣會使用預設的文字編輯器來開啟使用者的 crontab,使用者第一次執行這個指令會開啟一個空的檔案,使用者建立 crontab 之後這個指令則會開啟已建立的 crontab 供編輯。 + + 加入這些行到 crontab 檔的最上方來設定環境變數以及備忘在 crontab 中欄位的意思非常有用: SHELL=/bin/sh PATH=/etc:/bin:/sbin:/usr/bin:/usr/sbin # Order of crontab fields # minute hour mday month wday command - Then add a line for each command or script to run, - specifying the time to run the command. This example runs the - specified custom Bourne shell script every day at two in the - afternoon. Since the path to the script is not specified in - PATH, the full path to the script is - given: + 然後每一個要執行的指令或 Script 加入一行,指定要執行指令的時間。這個例子會每天在下午 2 點執行指定的自訂 Bourne shell script,由於沒有在 PATH 指定 Script 的路徑,所以必須給予完整的 Script 路徑: 0 14 * * * /usr/home/dru/bin/mycustomscript.sh - Before using a custom script, make sure it is executable - and test it with the limited set of environment variables - set by cron. To replicate the environment that would be - used to run the above cron entry, use: + 在使用自訂的 Script 之前,請先確定該 Script 可以執行並且使用 cron 在有限的環境變數下測試。要複製一個用來執行上述 cron 項目的環境可以使用: env -i SHELL=/bin/sh PATH=/etc:/bin:/sbin:/usr/bin:/usr/sbin HOME=/home/dru LOGNAME=dru /usr/home/dru/bin/mycustomscript.sh - The environment set by cron is discussed in - crontab5. Checking that scripts operate correctly in - a cron environment is especially important if they include - any commands that delete files using wildcards. + crontab5 有討論 cron 使用的環境變數,若 Script 中含有任何會使用萬用字元刪除檔案的指令,那麼檢查 Script 可正常在 cron 的環境運作非常重要。 - When finished editing the crontab, save the file. It - will automatically be installed and - cron will read the crontab and run - its cron jobs at their specified times. To list the cron jobs - in a crontab, use this command: + 編輯完成 crontab 之後儲存檔案,編輯完的 crontab 會被自動安裝且 cron 會讀取該 crontab 並在其指定的時指執行其 cron job。要列出 crontab 中有那一些 cron job 可以使用此指令: % crontab -l 0 14 * * * /usr/home/dru/bin/mycustomscript.sh - To remove all of the cron jobs in a user crontab: + 要移除使用在使用者 crontab 中的 cron job 可: % crontab -r remove crontab for dru? y @@ -14306,53 +14209,21 @@ remove crontab for dru? y - FreeBSD uses the rc8 system of startup scripts during - system initialization and for managing services. The scripts - listed in /etc/rc.d provide basic services - which can be controlled with the , - , and options to - service8. For instance, sshd8 can be restarted - with the following command: + FreeBSD 在系統初始化時使用 rc8 系統的啟動 Script。列於 /etc/rc.d 的 Script 提供了基本的服務可使用 service8 加上 , 以及 選項來控制。例如,使用以下指令可以重新啟動 sshd8 # service sshd restart - This procedure can be used to start services on a running - system. Services will be started automatically at boot time - as specified in rc.conf5. For example, to enable - natd8 at system startup, add the following line to - /etc/rc.conf: + 這個程序可以用來在執行中的系統上啟動服務,而在 rc.conf5 中有指定的服務則會在開機時自動啟動。例如,要在系統啟動時開啟 natd8,可入下行到 /etc/rc.conf natd_enable="YES" - If a line is already - present, change the NO to - YES. The rc8 scripts will - automatically load any dependent services during the next boot, - as described below. - - Since the rc8 system is primarily intended to start - and stop services at system startup and shutdown time, the - , and - options will only perform their action - if the appropriate /etc/rc.conf variable - is set. For instance, sshd restart will - only work if sshd_enable is set to - in /etc/rc.conf. - To , or - a service regardless of the settings - in /etc/rc.conf, these commands should be - prefixed with one. For instance, to restart - sshd8 regardless of the current - /etc/rc.conf setting, execute the following - command: + 行已存在,則將 NO 更改為 YES,在下次開機時 rc8 script 便會自動載入任何相依的服務,詳細如下所述。 + + 由於 rc8 系統主要用於在系統開機與關機時啟動與停止服務,只有當有服務的變數設定在 /etc/rc.conf, 以及 才會有作用。例如 sshd restart 只會在 /etc/rc.conf 中的 sshd_enable 設為 時才會運作,若要不透過 /etc/rc.conf 的設定來 , 一個服務則需要在指令前加上 one,例如要不透過目前在 /etc/rc.conf 的設定重新啟動 sshd8 可執行以下指令: # service sshd onerestart - To check if a service is enabled in - /etc/rc.conf, run the appropriate - rc8 script with . This example - checks to see if sshd8 is enabled in - /etc/rc.conf: + 要檢查一個服務是否有在 /etc/rc.conf 開啟,可執行服務的 rc8 Script 加上 。這個例子會檢查 sshd8 是否在 /etc/rc.conf 已經開啟: # service sshd rcvar # sshd @@ -14361,149 +14232,77 @@ sshd_enable="YES" # (default: "") - The # sshd line is output from the - above command, not a - root console. + # sshd 的輸出來自上述指令,而非 root console。 - To determine whether or not a service is running, use - . For instance, to verify that - sshd8 is running: + 要判斷是一個服務是否正在執行,可使用 ,例如要確認 sshd8 是否正常在執行: # service sshd status sshd is running as pid 433. - In some cases, it is also possible to - a service. This attempts to send a - signal to an individual service, forcing the service to reload - its configuration files. In most cases, this means sending - the service a SIGHUP signal. Support for - this feature is not included for every service. - - The rc8 system is used for network services and it - also contributes to most of the system initialization. For - instance, when the - /etc/rc.d/bgfsck script is executed, it - prints out the following message: + 在某些情況,也可以 一個服務。這個動作會嘗試發送一個信號給指定的服務,強制服務重新載入其設定檔,在大多數的情況下,發送給服務的信號是 SIGHUP。並不是每個服務都有支援此功能。 + + rc8 系統會用在網路服務及也應用在大多數的系統初化 。例如執行 /etc/rc.d/bgfsck Script 會列印出以下訊息: Starting background file system checks in 60 seconds. - This script is used for background file system checks, - which occur only during system initialization. + 這個 Script 用來在背景做檔案系統檢查,只有在系統初始化時要執行。 - Many system services depend on other services to function - properly. For example, yp8 and other - RPC-based services may fail to start until - after the rpcbind8 service has started. To resolve this - issue, information about dependencies and other meta-data is - included in the comments at the top of each startup script. - The rcorder8 program is used to parse these comments - during system initialization to determine the order in which - system services should be invoked to satisfy the - dependencies. + 許多系統服務會相依其他服務來運作,例如 yp8 及其他以 RPC 為基礎的服務在 rpcbind8 服務啟動前可能會啟動失敗。要解決這種問題,就必須在啟動 Script 上方的註解中加入相依及其他 meta-data。在系統初始化時會用 rcorder8 程式分析這些註解來決定要以什麼順序來執行系統服務以滿足相依。 - The following key word must be included in all startup - scripts as it is required by rc.subr8 to - enable the startup script: + rc.subr8 的需要,以下的關鍵字必須加入到所有的啟動 Script 方可 enable 啟動 Script: - PROVIDE: Specifies the services this - file provides. + PROVIDE: 設定此檔案所提供的服務。 - The following key words may be included at the top of each - startup script. They are not strictly necessary, but are - useful as hints to rcorder8: + 以下關鍵字可能會在每個啟動 Script 的上方引用,雖然非必要,但是對於 rcorder8 是非常有用的提示: - REQUIRE: Lists services which are - required for this service. The script containing this key - word will run after the specified - services. + REQUIRE: 列出此服務需要引用的服務。有使用此關鍵字的 Script 會在指定服務啟動 之後 才執行。 - BEFORE: Lists services which depend - on this service. The script containing this key word will - run before the specified - services. + BEFORE: 列出相依此服務的服務。有使用此關鍵字的 Script 會在指定的服務啟動 之前 執行。 - By carefully setting these keywords for each startup script, - an administrator has a fine-grained level of control of the - startup order of the scripts, without the need for - runlevels used by some UNIX operating - systems. + 透過仔細的設定每個啟動 Script 的這些關鍵字,管理者便可對 Script 的啟動順序進行微調,而不需使用到其他 UNIX 作業系統所使用的 runlevels - Additional information can be found in rc8 and - rc.subr8. Refer to this article - for instructions on how to create custom rc8 - scripts. + 額外的資訊可在 rc8 以及 rc.subr8 中找到。請參考 此文章 來取得如何建立自訂 rc8 Script 的操作說明。 - 管理特定系統的設定 + 管理系統特定的設定 rc files rc.conf - The principal location for system configuration - information is /etc/rc.conf. This file - contains a wide range of configuration information and it is - read at system startup to configure the system. It provides - the configuration information for the - rc* files. - - The entries in /etc/rc.conf override - the default settings in - /etc/defaults/rc.conf. The file - containing the default settings should not be edited. - Instead, all system-specific changes should be made to - /etc/rc.conf. + 系統設定資訊的主要位於 /etc/rc.conf,這個檔案的設定資訊範圍非常廣且會在系統啟動時讀取來設定系統,它也提供設定資訊給 rc* 檔案使用。 + + /etc/rc.conf 中的設定項目會覆蓋在 /etc/defaults/rc.conf 的預設設定,不應直接編輯該檔案中的預設設定,所有系統特定的設定應到 /etc/rc.conf 所修改。 - A number of strategies may be applied in clustered - applications to separate site-wide configuration from - system-specific configuration in order to reduce - administration overhead. The recommended approach is to place - system-specific configuration into - /etc/rc.conf.local. For example, these - entries in /etc/rc.conf apply to all - systems: + 在叢集應用時要將系統特定的設定與各站特定的設定分開,藉此減少管理成本有好幾種方法,建議的方法是將系統特定的設定放置在 /etc/rc.conf.local,例如以下將要套用到所有系統的設定項目放在 /etc/rc.conf sshd_enable="YES" keyrate="fast" defaultrouter="10.1.1.254" - Whereas these entries in - /etc/rc.conf.local apply to this system - only: + 而只套用到此系統的設定放在 /etc/rc.conf.local hostname="node1.example.org" ifconfig_fxp0="inet 10.1.1.1/8" - Distribute /etc/rc.conf to every - system using an application such as - rsync or - puppet, while - /etc/rc.conf.local remains - unique. - - Upgrading the system will not overwrite - /etc/rc.conf, so system configuration - information will not be lost. + 使用應用程式如 rsyncpuppet/etc/rc.conf 散布到每個系統,而在各系統保留自己的 /etc/rc.conf.local + + 升級系統並不會覆寫 /etc/rc.conf,所以系統設定資訊不會因此遺失。 - Both /etc/rc.conf and - /etc/rc.conf.local - are parsed by sh1. This allows system operators to - create complex configuration scenarios. Refer to - rc.conf5 for further information on this - topic. + /etc/rc.conf 以及 /etc/rc.conf.local 兩個檔案都會使用 sh1 解析,這讓系統操作者能夠建立較複雜的設定方案。請參考 rc.conf5 來取得更多有關此主題的資訊。 @@ -14528,9 +14327,7 @@ ifconfig_fxp0="inet 10.1.1.1/8"configuration - Adding and configuring a network interface card - (NIC) is a common task for any FreeBSD - administrator. + 對 FreeBSD 管理者來說加入與設定網路介面卡 (Network Interface Card, NIC) 會是一件常見的工作。 找到正確的驅動程式 @@ -14540,30 +14337,11 @@ ifconfig_fxp0="inet 10.1.1.1/8"driver - First, determine the model of the NIC - and the chip it uses. FreeBSD supports a wide variety of - NICs. Check the Hardware Compatibility - List for the FreeBSD release to see if the NIC - is supported. - - If the NIC is supported, determine - the name of the FreeBSD driver for the NIC. - Refer to /usr/src/sys/conf/NOTES and - /usr/src/sys/arch/conf/NOTES - for the list of NIC drivers with some - information about the supported chipsets. When in doubt, read - the manual page of the driver as it will provide more - information about the supported hardware and any known - limitations of the driver. - - The drivers for common NICs are already - present in the GENERIC kernel, meaning - the NIC should be probed during boot. The - system's boot messages can be viewed by typing - more /var/run/dmesg.boot and using the - spacebar to scroll through the text. In this example, two - Ethernet NICs using the dc4 driver - are present on the system: + 首先,要先確定 NIC 的型號及其使用的晶片。FreeBSD 支援各種 NIC,可檢查該 FreeBSD 發佈版本的硬體相容性清單來查看是否有支援該 NIC + + 若有支援該 NIC,接著要確定該 NIC 所要需要的 FreeBSD 驅動程式名稱。請參考 /usr/src/sys/conf/NOTES/usr/src/sys/arch/conf/NOTES 來取得 NIC 驅動程式清單及其支援的晶片組相關資訊。當有疑問是,請閱讀該驅動程式的操作手冊,會有提供更多有關支援硬體及該驅動程式已知問題的資訊。 + + GENERIC 核心已有內含常見 NIC 的驅動程式 ,意思是在開機時應該會偵測到 NIC。可以輸入 more /var/run/dmesg.boot 來檢視系統的開機訊息並使用空白鍵捲動文字。在此例中,兩個乙太網路 NIC 使用系統已有的 dc4 驅動程式: dc0: <82c169 PNIC 10/100BaseTX> port 0xa000-0xa0ff mem 0xd3800000-0xd38 000ff irq 15 at device 11.0 on pci0 @@ -14580,33 +14358,15 @@ bmtphy1: 10baseT, 10baseT-FDX, 100baseT dc1: Ethernet address: 00:a0:cc:da:da:db dc1: [ITHREAD] - If the driver for the NIC is not - present in GENERIC, but a driver is - available, the driver will need to be loaded before the - NIC can be configured and used. This may - be accomplished in one of two ways: + 若在 GENERIC 中沒有該 NIC 的驅動程式,但有可用的驅動程式,那麼在設定及使用 NIC 前要先載入該驅動程式,有兩種方式可以完成這件事: - The easiest way is to load a kernel module for the - NIC using kldload8. To also - automatically load the driver at boot time, add the - appropriate line to - /boot/loader.conf. Not all - NIC drivers are available as - modules. + 最簡單的方式是使用 kldload8 載入 NIC 要使用的核心模組。要在開機時自動載入,可加入適當的設定到 /boot/loader.conf。不是所有 NIC 驅動程式皆可當做模組使用。 - Alternatively, statically compile support for the - NIC into a custom kernel. Refer to - /usr/src/sys/conf/NOTES, - /usr/src/sys/arch/conf/NOTES - and the manual page of the driver to determine which line - to add to the custom kernel configuration file. For more - information about recompiling the kernel, refer to . If the NIC - was detected at boot, the kernel does not need to be - recompiled. + 或者,靜態編譯對 NIC 的支援到自訂核心,請參考 /usr/src/sys/conf/NOTES, /usr/src/sys/arch/conf/NOTES 及驅動程式的操作手冊來了解要在自訂核心設定檔中要加入那些設定。要取得更多有關重新編譯核心的資訊可參考 。若在開機時有偵測到 NIC,就不需要再重新編譯核心。 @@ -14634,85 +14394,46 @@ dc1: [ITHREAD] for it. Whatever is done must also be done to the same indexterm in linuxemu/chapter.xml --> - 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 FreeBSD and other - operating systems are left with two choices: develop the - drivers by a long and pain-staking process of reverse - engineering or using the existing driver binaries available - for Microsoft Windows platforms. - - FreeBSD provides native support for the - Network Driver Interface Specification - (NDIS). It includes ndisgen8 - which can be used to convert a Windows XP driver into a - format that can be used on FreeBSD. Because the ndis4 - driver uses a Windows XP binary, it only runs on i386 - and amd64 systems. PCI, CardBus, - PCMCIA, and USB - devices are supported. + 很不幸的,仍有很多供應商並沒有提供它們驅動程式的技術文件給開源社群,因為這些文件有涉及商業機密。因此,FreeBSD 及其他作業系統的開發人員只剩下兩種方案可以選擇:透過長期與艱苦的過程做逆向工程來開發驅動程式或是使用現有供 Microsoft Windows 平台用的驅動程式 Binary。 + + FreeBSD 對 Network Driver Interface Specification (NDIS) 有提供 原生 的支援,這包含了 ndisgen8 可用來轉換 Windows XP 驅動程式成可在 FreeBSD 上使用的格式。由於 ndis4 驅動程式使用的是 Windows XP binary,所以只能在 i386 及 amd64 系統上執行。PCI, CardBus, PCMCIA 以及 USB 裝置也都有支援。 - To use ndisgen8, three things are needed: + 要使用 ndisgen8 需要三樣東西: - FreeBSD kernel sources. + FreeBSD 核心原始碼。 - A Windows XP driver binary with a - .SYS extension. + 一個 .SYS 附檔名的 Windows XP 驅動程式 Binary。 - A Windows XP driver configuration file with a - .INF extension. + 一個 .INF 附檔名的 Windows XP 驅動程式設定檔。 - Download the .SYS and - .INF files for the specific - NIC. Generally, these can be found on - the driver CD or at the vendor's website. The following - examples use W32DRIVER.SYS and - W32DRIVER.INF. - - The driver bit width must match the version of FreeBSD. - For FreeBSD/i386, use a Windows 32-bit driver. For - FreeBSD/amd64, a Windows 64-bit driver is needed. - - The next step is to compile the driver binary into a - loadable kernel module. As - root, use - ndisgen8: + 下載供指定 NIC 使用的 .SYS.INF 檔。通常這些檔案可以在驅動程式 CD 或者供應商的網站上找到。以下範例會使用 W32DRIVER.SYSW32DRIVER.INF + + 驅動程式的位元寬度必須與 FreeBSD 的版本相符。例如 FreeBSD/i386 需要使用 Windows 32-bit 驅動程式,而 FreeBSD/amd64 則需要使用 Windows 64-bit 驅動程式。 + + 下個步驟是編譯驅動程式 Binary 成可載入的核心模組。以 root 身份使用 ndisgen8 # ndisgen /path/to/W32DRIVER.INF /path/to/W32DRIVER.SYS - This command is interactive and prompts for any extra - information it requires. A new kernel module will be - generated in the current directory. Use kldload8 - to load the new module: + 這個指令是互動式的,會提示輸入任何所需的額外資訊,新的核心模組會被產生在目前的目錄,使用 kldload8 來載入新的模組: # kldload ./W32DRIVER_SYS.ko - In addition to the generated kernel module, the - ndis.ko and - if_ndis.ko modules must be loaded. - This should happen automatically when any module that - depends on ndis4 is loaded. If not, load them - manually, using the following commands: + 除了產生的核心模組之外,ndis.ko 以及 if_ndis.ko 也必須載入,會在任何有相依 ndis4 的模組被載入時一併自動載入。若沒有自動載入,則需使用以下指令手動載入: # kldload ndis # kldload if_ndis - The first command loads the ndis4 miniport driver - wrapper and the second loads the generated - NIC driver. - - Check dmesg8 to see if there were any load - errors. If all went well, the output should be similar to - the following: + 第一個指令會載入 ndis4 miniport 驅動程式包裝程式,而第二個指令會載入產生的 NIC 驅動程式。 + + 檢查 dmesg8 查看是否有任何載入錯誤,若一切正常,輸出結果應會如下所示: ndis0: <Wireless-G PCI Adapter> mem 0xf4100000-0xf4101fff irq 3 at device 8.0 on pci1 ndis0: NDIS API version: 5.0 @@ -14720,14 +14441,9 @@ ndis0: Ethernet address: 0a:b1:2c:d3:4e: ndis0: 11b rates: 1Mbps 2Mbps 5.5Mbps 11Mbps ndis0: 11g rates: 6Mbps 9Mbps 12Mbps 18Mbps 36Mbps 48Mbps 54Mbps - From here, ndis0 can be - configured like any other NIC. + 到此之後 ndis0 可以像任何其他 NIC 設定使用。 - To configure the system to load the ndis4 modules - at boot time, copy the generated module, - W32DRIVER_SYS.ko, to - /boot/modules. Then, add the following - line to /boot/loader.conf: + 要設定系統於開機時載入 ndis4 模組,可複製產生的模組 W32DRIVER_SYS.ko/boot/modules。然後加入下行到 /boot/loader.conf W32DRIVER_SYS_load="YES" @@ -14741,13 +14457,9 @@ ndis0: 11g rates: 6Mbps 9Mbps 12Mbps 18M configuration - Once the right driver is loaded for the - NIC, the card needs to be configured. It - may have been configured at installation time by - bsdinstall8. + 載入正確的 NIC 驅動程式之後,接著需要設定介面卡,這個動作可能在安裝時已經使用 bsdinstall8 設定過了。 - To display the NIC configuration, - enter the following command: + 要查看 NIC 設定可輸入以下指令: % ifconfig dc0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500 @@ -14769,85 +14481,57 @@ lo0: flags=8049<UP,LOOPBACK,RUNNING,M inet 127.0.0.1 netmask 0xff000000 nd6 options=3<PERFORMNUD,ACCEPT_RTADV> - In this example, the following devices were - displayed: + 在這個例子中列出了以下裝置: - dc0: The first Ethernet - interface. + dc0: 第一個乙太網路介面。 - dc1: The second Ethernet - interface. + dc1: 第二個乙太網路介面。 - lo0: The loopback - device. + lo0: Loopback 裝置。 - FreeBSD uses the driver name followed by the order in which - the card is detected at boot to name the - NIC. For example, - sis2 is the third - NIC on the system using the sis4 - driver. + FreeBSD 會使用驅動程式名稱接著開機時所偵測到的介面卡順序來命名 NIC。例如 sis2 是指在系統上使用 sis4 驅動程式的第三個 NIC - In this example, dc0 is up and - running. The key indicators are: + 在此例中,dc0 已經上線並且執行中。主要的依據有: - UP means that the card is - configured and ready. + UP 代表介面卡已設定好並且準備就緒。 - The card has an Internet (inet) - address, 192.168.1.3. + 介面卡有網際網路 (inet) 位址,192.168.1.3 - It has a valid subnet mask - (netmask), where - 0xffffff00 is the - same as 255.255.255.0. + 介面卡有一個有效的子網路遮罩 (netmask),其中 0xffffff00 等同於 255.255.255.0 - It has a valid broadcast address, 192.168.1.255. + 介面卡有一個有效的廣播位址,192.168.1.255 - The MAC address of the card - (ether) is 00:a0:cc:da:da:da. + 介面卡 (ether) 的 MAC 位址是 00:a0:cc:da:da:da - The physical media selection is on autoselection mode - (media: Ethernet autoselect (100baseTX - <full-duplex>)). In this example, - dc1 is configured to run with - 10baseT/UTP media. For more - information on available media types for a driver, refer - to its manual page. + 實體媒介選擇為自動選擇模式 (media: Ethernet autoselect (100baseTX <full-duplex>))。在本例中 dc1 被設定使用 10baseT/UTP 媒介。要取得更多有關可用的驅動程式媒介類型請參考操作手冊。 - The status of the link (status) is - active, indicating that the carrier - signal is detected. For dc1, the - status: no carrier status is normal - when an Ethernet cable is not plugged into the - card. + 連結的狀態 (status) 為使用中 (active),代表有偵測到載波信號 (Carrier Signal)。若 dc1 所代表的介面卡未插入乙太網路線則狀態為 status: no carrier 是正常的。 - If the ifconfig8 output had shown something similar - to: + ifconfig8 的輸出結果如下: dc0: flags=8843<BROADCAST,SIMPLEX,MULTICAST> metric 0 mtu 1500 options=80008<VLAN_MTU,LINKSTATE> @@ -14855,58 +14539,31 @@ lo0: flags=8049<UP,LOOPBACK,RUNNING,M media: Ethernet autoselect (100baseTX <full-duplex>) status: active - it would indicate the card has not been configured. + 則代表尚未設定介面卡。 - The card must be configured as - root. The - NIC configuration can be performed from the - command line with ifconfig8 but will not persist after - a reboot unless the configuration is also added to - /etc/rc.conf. If a - DHCP server is present on the LAN, - just add this line: + 介面卡必須以 root 來設定。NIC 的設定可在指令列執行 ifconfig8 來完成,但重新開機之後變會消失,除非將設定也加到 /etc/rc.conf。若在 LAN 中有 DHCP 伺服器,則只需加入此行: ifconfig_dc0="DHCP" - Replace dc0 with the correct value - for the system. + 替換 dc0 為該系統的正確值。 - The line added, then, follow the instructions given in - . + 加入這行之後,接著依據 指示操作。 - If the network was configured during installation, some - entries for the NIC(s) may be already - present. Double check /etc/rc.conf - before adding any lines. + 若網路在安裝時已設定,可能會已經有 NIC 的設定項目。在加入任何設定前請再次檢查 /etc/rc.conf - In the case, there is no DHCP server, - the NIC(s) have to be configured manually. - Add a line for each NIC present on the - system, as seen in this example: + 在這個例中,沒有 DHCP 伺服器,必須手動設定 NIC。提每一個在系統上的 NIC 加入一行設定,如此例: 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" - Replace dc0 and - dc1 and the IP - address information with the correct values for the system. - Refer to the man page for the driver, ifconfig8, and - rc.conf5 for more details about the allowed options and - the syntax of /etc/rc.conf. - - If the network is not using DNS, edit - /etc/hosts to add the names and - IP addresses of the hosts on the - LAN, if they are not already there. For - more information, refer to hosts5 and to *** DIFF OUTPUT TRUNCATED AT 1000 LINES ***