From 989d921f5d4ac8d8b7c831c13b8954ad1901be24 Mon Sep 17 00:00:00 2001 From: Sergio Carlavilla Delgado Date: Tue, 26 Jan 2021 00:31:29 +0100 Subject: Migrate doc to Hugo/AsciiDoctor I'm very pleased to announce the release of our new website and documentation using the new toolchain with Hugo and AsciiDoctor. To get more information about the new toolchain please read the FreeBSD Documentation Project Primer[1], Hugo docs[2] and AsciiDoctor docs[3]. Acknowledgment: Benedict Reuschling Glen Barber Hiroki Sato Li-Wen Hsu Sean Chittenden The FreeBSD Foundation [1] https://docs.FreeBSD.org/en/books/fdp-primer/ [2] https://gohugo.io/documentation/ [3] https://docs.asciidoctor.org/home/ Approved by: doceng, core --- zh_TW.UTF-8/Makefile | 9 - zh_TW.UTF-8/Makefile.inc | 3 - zh_TW.UTF-8/articles/Makefile | 15 - zh_TW.UTF-8/articles/Makefile.inc | 5 - zh_TW.UTF-8/articles/contributing/Makefile | 22 - zh_TW.UTF-8/articles/contributing/article.xml | 465 - zh_TW.UTF-8/articles/freebsd-questions/Makefile | 22 - zh_TW.UTF-8/articles/freebsd-questions/article.xml | 610 - zh_TW.UTF-8/articles/hubs/Makefile | 17 - zh_TW.UTF-8/articles/hubs/article.xml | 520 - zh_TW.UTF-8/articles/hubs/zh_TW.po | 665 - zh_TW.UTF-8/articles/leap-seconds/Makefile | 19 - zh_TW.UTF-8/articles/leap-seconds/article.xml | 64 - zh_TW.UTF-8/articles/leap-seconds/zh_TW.po | 239 - zh_TW.UTF-8/articles/mailing-list-faq/Makefile | 26 - zh_TW.UTF-8/articles/mailing-list-faq/article.xml | 416 - zh_TW.UTF-8/articles/nanobsd/Makefile | 28 - zh_TW.UTF-8/articles/nanobsd/article.xml | 434 - zh_TW.UTF-8/articles/pr-guidelines/Makefile | 19 - zh_TW.UTF-8/articles/pr-guidelines/article.xml | 875 - zh_TW.UTF-8/articles/problem-reports/Makefile | 19 - zh_TW.UTF-8/articles/problem-reports/article.xml | 1103 - zh_TW.UTF-8/articles/remote-install/Makefile | 30 - zh_TW.UTF-8/articles/remote-install/article.xml | 475 - zh_TW.UTF-8/books/Makefile | 13 - zh_TW.UTF-8/books/Makefile.inc | 5 - zh_TW.UTF-8/books/developers-handbook/Makefile | 42 - zh_TW.UTF-8/books/developers-handbook/book.xml | 183 - zh_TW.UTF-8/books/developers-handbook/chapters.ent | 33 - .../developers-handbook/introduction/chapter.xml | 186 - .../books/developers-handbook/ipv6/chapter.xml | 1571 - .../books/developers-handbook/kerneldebug/Makefile | 15 - .../developers-handbook/kerneldebug/chapter.xml | 848 - .../books/developers-handbook/l10n/chapter.xml | 75 - .../books/developers-handbook/policies/Makefile | 15 - .../books/developers-handbook/policies/chapter.xml | 402 - .../books/developers-handbook/secure/chapter.xml | 518 - .../books/developers-handbook/sockets/chapter.xml | 1780 - .../books/developers-handbook/testing/chapter.xml | 212 - .../books/developers-handbook/tools/chapter.xml | 2139 - .../books/developers-handbook/x86/chapter.xml | 6486 -- zh_TW.UTF-8/books/faq/Makefile | 28 - zh_TW.UTF-8/books/faq/book.xml | 6910 -- zh_TW.UTF-8/books/faq/zh_TW.po | 7846 -- zh_TW.UTF-8/books/fdp-primer/Makefile | 37 - zh_TW.UTF-8/books/fdp-primer/book.xml | 8465 -- zh_TW.UTF-8/books/fdp-primer/zh_TW.po | 12718 --- zh_TW.UTF-8/books/handbook/Makefile | 167 - zh_TW.UTF-8/books/handbook/book.xml | 61783 ---------- zh_TW.UTF-8/books/handbook/zh_TW.po | 106292 ------------------ zh_TW.UTF-8/books/porters-handbook/Makefile | 45 - zh_TW.UTF-8/books/porters-handbook/book.xml | 23101 ---- zh_TW.UTF-8/books/porters-handbook/zh_TW.po | 37193 ------ zh_TW.UTF-8/htdocs/Makefile | 52 - zh_TW.UTF-8/htdocs/Makefile.inc | 5 - zh_TW.UTF-8/htdocs/about.xml | 98 - zh_TW.UTF-8/htdocs/applications.xml | 129 - zh_TW.UTF-8/htdocs/art.xml | 127 - zh_TW.UTF-8/htdocs/availability.xml | 27 - zh_TW.UTF-8/htdocs/community.xsl | 148 - zh_TW.UTF-8/htdocs/developers.xml | 566 - zh_TW.UTF-8/htdocs/doc/Makefile | 47 - zh_TW.UTF-8/htdocs/docs.xml | 24 - zh_TW.UTF-8/htdocs/docs/Makefile | 16 - zh_TW.UTF-8/htdocs/docs/books.xml | 364 - zh_TW.UTF-8/htdocs/docs/webresources.xml | 111 - zh_TW.UTF-8/htdocs/index.xsl | 322 - zh_TW.UTF-8/htdocs/logo.xml | 118 - zh_TW.UTF-8/htdocs/news/Makefile | 59 - zh_TW.UTF-8/htdocs/platforms/Makefile | 12 - zh_TW.UTF-8/htdocs/platforms/Makefile.inc | 4 - zh_TW.UTF-8/htdocs/platforms/index.xml | 112 - zh_TW.UTF-8/htdocs/send-pr.xml | 163 - zh_TW.UTF-8/htdocs/support.xml | 40 - zh_TW.UTF-8/htdocs/where.xml | 622 - zh_TW.UTF-8/share/xml/authors.ent | 94 - zh_TW.UTF-8/share/xml/catalog.xml | 34 - zh_TW.UTF-8/share/xml/entities.ent | 26 - zh_TW.UTF-8/share/xml/freebsd-dblatex.xsl | 17 - zh_TW.UTF-8/share/xml/freebsd-fo.xsl | 69 - zh_TW.UTF-8/share/xml/freebsd-xhtml.xsl | 20 - zh_TW.UTF-8/share/xml/glossary.ent | 1920 - zh_TW.UTF-8/share/xml/header.l10n.ent | 121 - zh_TW.UTF-8/share/xml/l10n.ent | 124 - zh_TW.UTF-8/share/xml/libcommon.xsl | 105 - zh_TW.UTF-8/share/xml/mailing-lists.ent | 645 - zh_TW.UTF-8/share/xml/navibar.l10n.ent | 171 - zh_TW.UTF-8/share/xml/news.xml | 4976 - zh_TW.UTF-8/share/xml/press.xml | 528 - zh_TW.UTF-8/share/xml/release.l10n.ent | 137 - zh_TW.UTF-8/share/xml/trademarks.ent | 310 - zh_TW.UTF-8/share/xml/urls.ent | 125 - 92 files changed, 297796 deletions(-) delete mode 100644 zh_TW.UTF-8/Makefile delete mode 100644 zh_TW.UTF-8/Makefile.inc delete mode 100644 zh_TW.UTF-8/articles/Makefile delete mode 100644 zh_TW.UTF-8/articles/Makefile.inc delete mode 100644 zh_TW.UTF-8/articles/contributing/Makefile delete mode 100644 zh_TW.UTF-8/articles/contributing/article.xml delete mode 100644 zh_TW.UTF-8/articles/freebsd-questions/Makefile delete mode 100644 zh_TW.UTF-8/articles/freebsd-questions/article.xml delete mode 100644 zh_TW.UTF-8/articles/hubs/Makefile delete mode 100644 zh_TW.UTF-8/articles/hubs/article.xml delete mode 100644 zh_TW.UTF-8/articles/hubs/zh_TW.po delete mode 100644 zh_TW.UTF-8/articles/leap-seconds/Makefile delete mode 100644 zh_TW.UTF-8/articles/leap-seconds/article.xml delete mode 100644 zh_TW.UTF-8/articles/leap-seconds/zh_TW.po delete mode 100644 zh_TW.UTF-8/articles/mailing-list-faq/Makefile delete mode 100644 zh_TW.UTF-8/articles/mailing-list-faq/article.xml delete mode 100644 zh_TW.UTF-8/articles/nanobsd/Makefile delete mode 100644 zh_TW.UTF-8/articles/nanobsd/article.xml delete mode 100644 zh_TW.UTF-8/articles/pr-guidelines/Makefile delete mode 100644 zh_TW.UTF-8/articles/pr-guidelines/article.xml delete mode 100644 zh_TW.UTF-8/articles/problem-reports/Makefile delete mode 100644 zh_TW.UTF-8/articles/problem-reports/article.xml delete mode 100644 zh_TW.UTF-8/articles/remote-install/Makefile delete mode 100644 zh_TW.UTF-8/articles/remote-install/article.xml delete mode 100644 zh_TW.UTF-8/books/Makefile delete mode 100644 zh_TW.UTF-8/books/Makefile.inc delete mode 100644 zh_TW.UTF-8/books/developers-handbook/Makefile delete mode 100644 zh_TW.UTF-8/books/developers-handbook/book.xml delete mode 100644 zh_TW.UTF-8/books/developers-handbook/chapters.ent delete mode 100644 zh_TW.UTF-8/books/developers-handbook/introduction/chapter.xml delete mode 100644 zh_TW.UTF-8/books/developers-handbook/ipv6/chapter.xml delete mode 100644 zh_TW.UTF-8/books/developers-handbook/kerneldebug/Makefile delete mode 100644 zh_TW.UTF-8/books/developers-handbook/kerneldebug/chapter.xml delete mode 100644 zh_TW.UTF-8/books/developers-handbook/l10n/chapter.xml delete mode 100644 zh_TW.UTF-8/books/developers-handbook/policies/Makefile delete mode 100644 zh_TW.UTF-8/books/developers-handbook/policies/chapter.xml delete mode 100644 zh_TW.UTF-8/books/developers-handbook/secure/chapter.xml delete mode 100644 zh_TW.UTF-8/books/developers-handbook/sockets/chapter.xml delete mode 100644 zh_TW.UTF-8/books/developers-handbook/testing/chapter.xml delete mode 100644 zh_TW.UTF-8/books/developers-handbook/tools/chapter.xml delete mode 100644 zh_TW.UTF-8/books/developers-handbook/x86/chapter.xml delete mode 100644 zh_TW.UTF-8/books/faq/Makefile delete mode 100644 zh_TW.UTF-8/books/faq/book.xml delete mode 100644 zh_TW.UTF-8/books/faq/zh_TW.po delete mode 100644 zh_TW.UTF-8/books/fdp-primer/Makefile delete mode 100644 zh_TW.UTF-8/books/fdp-primer/book.xml delete mode 100644 zh_TW.UTF-8/books/fdp-primer/zh_TW.po delete mode 100644 zh_TW.UTF-8/books/handbook/Makefile delete mode 100644 zh_TW.UTF-8/books/handbook/book.xml delete mode 100644 zh_TW.UTF-8/books/handbook/zh_TW.po delete mode 100644 zh_TW.UTF-8/books/porters-handbook/Makefile delete mode 100644 zh_TW.UTF-8/books/porters-handbook/book.xml delete mode 100644 zh_TW.UTF-8/books/porters-handbook/zh_TW.po delete mode 100644 zh_TW.UTF-8/htdocs/Makefile delete mode 100644 zh_TW.UTF-8/htdocs/Makefile.inc delete mode 100644 zh_TW.UTF-8/htdocs/about.xml delete mode 100644 zh_TW.UTF-8/htdocs/applications.xml delete mode 100644 zh_TW.UTF-8/htdocs/art.xml delete mode 100644 zh_TW.UTF-8/htdocs/availability.xml delete mode 100644 zh_TW.UTF-8/htdocs/community.xsl delete mode 100644 zh_TW.UTF-8/htdocs/developers.xml delete mode 100644 zh_TW.UTF-8/htdocs/doc/Makefile delete mode 100644 zh_TW.UTF-8/htdocs/docs.xml delete mode 100644 zh_TW.UTF-8/htdocs/docs/Makefile delete mode 100644 zh_TW.UTF-8/htdocs/docs/books.xml delete mode 100644 zh_TW.UTF-8/htdocs/docs/webresources.xml delete mode 100644 zh_TW.UTF-8/htdocs/index.xsl delete mode 100644 zh_TW.UTF-8/htdocs/logo.xml delete mode 100644 zh_TW.UTF-8/htdocs/news/Makefile delete mode 100644 zh_TW.UTF-8/htdocs/platforms/Makefile delete mode 100644 zh_TW.UTF-8/htdocs/platforms/Makefile.inc delete mode 100644 zh_TW.UTF-8/htdocs/platforms/index.xml delete mode 100644 zh_TW.UTF-8/htdocs/send-pr.xml delete mode 100644 zh_TW.UTF-8/htdocs/support.xml delete mode 100644 zh_TW.UTF-8/htdocs/where.xml delete mode 100644 zh_TW.UTF-8/share/xml/authors.ent delete mode 100644 zh_TW.UTF-8/share/xml/catalog.xml delete mode 100644 zh_TW.UTF-8/share/xml/entities.ent delete mode 100644 zh_TW.UTF-8/share/xml/freebsd-dblatex.xsl delete mode 100644 zh_TW.UTF-8/share/xml/freebsd-fo.xsl delete mode 100644 zh_TW.UTF-8/share/xml/freebsd-xhtml.xsl delete mode 100644 zh_TW.UTF-8/share/xml/glossary.ent delete mode 100644 zh_TW.UTF-8/share/xml/header.l10n.ent delete mode 100644 zh_TW.UTF-8/share/xml/l10n.ent delete mode 100644 zh_TW.UTF-8/share/xml/libcommon.xsl delete mode 100644 zh_TW.UTF-8/share/xml/mailing-lists.ent delete mode 100644 zh_TW.UTF-8/share/xml/navibar.l10n.ent delete mode 100644 zh_TW.UTF-8/share/xml/news.xml delete mode 100644 zh_TW.UTF-8/share/xml/press.xml delete mode 100644 zh_TW.UTF-8/share/xml/release.l10n.ent delete mode 100644 zh_TW.UTF-8/share/xml/trademarks.ent delete mode 100644 zh_TW.UTF-8/share/xml/urls.ent (limited to 'zh_TW.UTF-8') diff --git a/zh_TW.UTF-8/Makefile b/zh_TW.UTF-8/Makefile deleted file mode 100644 index 55b5374fdf..0000000000 --- a/zh_TW.UTF-8/Makefile +++ /dev/null @@ -1,9 +0,0 @@ -# $FreeBSD$ - -SUBDIR = articles -SUBDIR += books - -COMPAT_SYMLINK= zh_TW - -DOC_PREFIX = ${.CURDIR}/.. -.include "${DOC_PREFIX}/share/mk/doc.project.mk" diff --git a/zh_TW.UTF-8/Makefile.inc b/zh_TW.UTF-8/Makefile.inc deleted file mode 100644 index 453700a49b..0000000000 --- a/zh_TW.UTF-8/Makefile.inc +++ /dev/null @@ -1,3 +0,0 @@ -# $FreeBSD$ - -DOC_PREFIX?= ${.CURDIR}/../.. diff --git a/zh_TW.UTF-8/articles/Makefile b/zh_TW.UTF-8/articles/Makefile deleted file mode 100644 index 24ccfc0219..0000000000 --- a/zh_TW.UTF-8/articles/Makefile +++ /dev/null @@ -1,15 +0,0 @@ -# $FreeBSD$ - -SUBDIR = -SUBDIR+= contributing -SUBDIR+= freebsd-questions -SUBDIR+= hubs -SUBDIR+= leap-seconds -SUBDIR+= mailing-list-faq -SUBDIR+= nanobsd -SUBDIR+= pr-guidelines -SUBDIR+= problem-reports -SUBDIR+= remote-install - -DOC_PREFIX?= ${.CURDIR}/../.. -.include "${DOC_PREFIX}/share/mk/doc.project.mk" diff --git a/zh_TW.UTF-8/articles/Makefile.inc b/zh_TW.UTF-8/articles/Makefile.inc deleted file mode 100644 index e9ca57f579..0000000000 --- a/zh_TW.UTF-8/articles/Makefile.inc +++ /dev/null @@ -1,5 +0,0 @@ -# -# $FreeBSD$ -# - -DESTDIR?= ${DOCDIR}/zh_TW.UTF-8/articles/${.CURDIR:T} diff --git a/zh_TW.UTF-8/articles/contributing/Makefile b/zh_TW.UTF-8/articles/contributing/Makefile deleted file mode 100644 index 72cfc4b491..0000000000 --- a/zh_TW.UTF-8/articles/contributing/Makefile +++ /dev/null @@ -1,22 +0,0 @@ -# -# The FreeBSD Traditional Chinese Project -# -# Original Revision: 1.6 -# $FreeBSD$ -# -# Article: Contributing to FreeBSD - -DOC?= article - -FORMATS?= html -WITH_ARTICLE_TOC?= YES - -INSTALL_COMPRESSED?=gz -INSTALL_ONLY_COMPRESSED?= - -SRCS= article.xml - -URL_RELPREFIX?= ../../../.. -DOC_PREFIX?= ${.CURDIR}/../../.. - -.include "${DOC_PREFIX}/share/mk/doc.project.mk" diff --git a/zh_TW.UTF-8/articles/contributing/article.xml b/zh_TW.UTF-8/articles/contributing/article.xml deleted file mode 100644 index 56ff1a66e0..0000000000 --- a/zh_TW.UTF-8/articles/contributing/article.xml +++ /dev/null @@ -1,465 +0,0 @@ - - - -
- 幫助 FreeBSD - - - - 無論是個人或是各種組織,如果希望為 FreeBSD 提供幫助,都可以在本文中找到合適的方法。 - - - - JordanHubbard原著: - - - - &tm-attrib.freebsd; - &tm-attrib.ieee; - &tm-attrib.general; - - - $FreeBSD$ - - $FreeBSD$ - - - - 貢獻 - - 你希望替 FreeBSD 做點什麼嗎?太好了,我們歡迎你。FreeBSD - 正是有賴於廣大使用者的貢獻才得以發展壯大的。我們不僅非常感謝您所做的貢獻,而且,這些工作對於 FreeBSD 的持續發展也至關重要。 - - - 也許與您想像的不同,您既不必得是一名出色的 Programmer,也無須和 - FreeBSD core team 成員有很好的私交,我們會一視同仁的對待您的工作。 - FreeBSD 的開發人員遍布全球,大家技術專長各異,年齡分布也非常廣泛。 - 然而,每天我們都在面對持續增加的工作,而苦於沒有足夠的人手,因此我們隨時歡迎您的幫助。 - - FreeBSD 計劃所處理的是一個完整的作業系統環境,而不只是一個 kernel 或是一些零散的工具包。 - 因此,我們的 TODO 待辦任務列表裡包含各式各樣的工作: - 從文件、使用者測試、demo,到系統安裝程式和更專業的 kernel 開發。 - 因此無論您的技術水準如何,從事何種領域,都可以幫助這個計劃。 - - 我們鼓勵從事和 FreeBSD 相關工作的企業和我們聯繫。 - 您需要一些特殊的擴展來使您的產品運轉起來嗎? - 您會發現我們很樂意答應您的請求,除非是特別稀奇古怪的。 - 您是否正從事相關的增值業務? 讓我們來幫助您吧, - 我們也許可以在某些方面相互合作。 - 自由軟體界正在努力打破舊有的框框(像是關於軟體開發、銷售和維護), - 我們希望懇請您至少能給它一次機會。 - - - 我們的需求 - - 下面列出了一些需要完成的任務和子計劃, - 它們代表 TODO(待辦任務列表) - 列表的意思,以及使用者的要求。 - - - 正在進行中的任務(非程式開發人員) - - 很多參加 FreeBSD 計劃的人不是 Programmer。 - 這個計劃裡有文件撰寫者、網頁設計師、以及技術支援人員。 - 對於這些義工來說,他們只需要貢獻一些時間,並且具有學習的意願。 - - - - 您可以時常翻閱 FAQ 和手冊(Handbook) - ,如果發現有解釋不清楚的地方,或是不合時宜的文件,甚至完全不正確的地方, - 都請告訴我們。當然,若能順手把他們修正,並把勘誤寄給我們,那就更好了。:) - (SGML 其實並不難學,但我們也不反對您直接提交一般 ASCII 的純文字版本)。 - - - - 幫助我們把 FreeBSD 文件翻譯成你的母語。 - 如果你的母語版本已經存在了, - 也可以翻譯一些額外的文件,或者檢查那些已有的文件是否為最新版。 - 您可以先簡單看看 FreeBSD 文件計劃中有關 翻譯時的常見問題。 - 參加翻譯工作,並不是說您要孤軍奮戰翻譯所有 FreeBSD 文件。 - 身為義工,要做多少工作完全取決於您的意願。一旦某個人開始翻譯了, - 之後幾乎一定會有其他人參與到這些工作中來。 - 如果時間有限,或者精力不夠去翻譯整份文件,那可以首先去翻譯安裝指南。 - - - - 閱讀 &a.questions; 並偶爾翻閱(甚至有規律地這樣做) &ng.misc; - 。與別人分享您的專業知識, - 並幫助他們解決問題,是件令人愉悅的事情; - 有時候,您甚至可以在這個過程中學到一些新東西! - 這些論壇有時也會為您激發出一些不錯的想法。 - - - - - - 正在進行中的任務(程式開發人員) - 列在這裡的大部分任務都需要您投入可觀的時間,或者需要您在 FreeBSD kernel - 方面有豐富的知識,或者兩者都要。當然這裡也有很多重要的任務,適合像是 - weekend hackers 這類只用週末就可以搞定的 Hacker。 - - - - 如果您正在跑的是 FreeBSD -CURRENT 版本,並且網路速度還不錯, - 那麼可以到 current.FreeBSD.org, - 這台每天會有一個新版本 — 如果您有空, - 您可以三不五時下載並安裝, - 其間如果出了什麼問題,請告訴我們。 - - - - 閱讀 &a.bugs;。這些問題,或許您能提供有建設性意義的意見, - 或者幫忙測試一些 patch 。此外,甚至可以嘗試修正其中的一些問題。 - - - - 如果您知道有一些修正已經在 -CURRENT 上成功地使用, - 但在經過一段時間(通常是 2 週左右)之後,仍未合併到 -STABLE - (這步驟就是 MFC -- Merged From Current),那麼可以給相關的 committer 人員發封禮貌的提醒信。 - - - - 將第三方(3rd party)軟體加入到原始碼中的 - src/contrib 目錄。 - - - - 確保 src/contrib 中的原始碼是最新的。 - - - - 編譯原始碼(或是部分原始碼)時,請改用更高的警告等級(warning level) - 以便偵錯(debug)用,並在完成測試、確認正常完畢之後,清除這些編譯的警告等級。 - - - - 更新那些在 ports 中使用過時的東西, - 例如 gets() 或包含 - malloc.h 所產生的警告。 - - - - 如果有為 ports 作了任何修正, - 請記得將您的 patch 發給原作者 (這樣下次升級時,您的工作會變得輕鬆一些)。 - - - - 先取得正式的標準,如 &posix; 的副本。 - 在 FreeBSD - C99 & POSIX 標準相容計劃 網站上,可以得到相關鏈接。 - 請將 FreeBSD 的行為與上述的標準進行比較,若所得結果與 C99 & POSIX 標準不同的話, - 特別是那些細節地方的微小差異,請發一個關於它的 PR (問題報告)。 - 如果可能,請指出如何修正它,並隨 PR 提交 patch 。 - 如果您認為標準有問題,請向這些規格標準的相關團體,請求對其進行重新的考慮。 - - - - 為這份列表提供更多建議! - - - - - - 查閱整個 PR 資料庫 - - 問題報告資料庫 - - FreeBSD - PR 列表 這裡會顯示目前所有 PR 的問題狀態,以及由 - FreeBSD 使用者提交的改進建議。 - PR 資料庫同時包括了開發人員和非開發人員的任務。 - 查看那些尚未解決的 PR,並看看是否有您感興趣的任務。 - 這其中可能有一些是非常簡單的問題,只需要看一看並確認 PR 是正確的。 - 另外一些可能會非常複雜,或者完全未附任何修正。 - - 首先看一看那些還沒有人接手的 PR。 - 如果 PR 已經分配給了其它人,但看起來是您能夠處理的, - 您可以寄信給那個人,並詢問您是否可以提供幫助 — - 他們可能已經有可供測試的 patch ,或有一些可供討論的意見。 - - - - 由 <quote>Ideas</quote> 中選一項 - - &os; list of - projects and ideas for volunteers 同樣地開放給有意願參與 - &os; 計劃的人。 - 這份清單將持續地更新,同時提供各個項目的資訊給所有人 - (不論是否為程式設計人員)。 - - - - - 如何提供幫助 - - 基本上可以分為以下 5 種方式: - - - 錯誤報告和意見發表 - - 通常,一般 - 的技術想法和建議應該發到 &a.hackers;。 - 同樣地,對於這些東西有興趣的人 (當然, - 他們同時還要能夠容忍 大量的 郵件!) - 可以考慮訂閱 &a.hackers;。 - 請參閱 FreeBSD - 使用手冊 以了解關於這個郵遞論壇, - 以及其它郵遞論壇的詳細情況。 - - 如果您發現了 bug 或者想要提交某些修改, - 請透過 &man.send-pr.1; 程式或使用 - 網頁介面 - 的回報 來提交。請試著填寫 PR 的每個項目。 - 一般來說,除非 patch 檔超過 65 KB,我們建議在 PR 中直接附上 patch 就可以了。 - 若可直接套用 patch 到原始碼的話,那麼建議在 PR 的 - Synopsis 欄位註明 [PATCH]。 - 對了,在附上 patch 時,請 不要 - 透過滑鼠的『複製、貼上』來進行,因為這樣做會把 Tab 變成空格, - 會導致 patch 就不能用了。如果 patch 超過 20KB, - 請考慮壓縮它並使用 &man.uuencode.1; 來進行編碼。 - - 在寫完 PR 之後,您會收到一封確認郵件以及事件追蹤編號。 - 請保留這個編號,因為事後可以用這編號發信到 &a.bugfollowup; - 來回覆、提供關於該事件的後續資料。您需要做的是將編號放到郵件的標題中, - 例如 "Re: - kern/3377"。 - 若是同一問題的回覆方面,應該透過這種方式來進行。 - - 如果您在一段時間 (超過 3 天甚至 1 週,這取決於您的郵件服務)之後仍然沒有收到確認信 - 或者由於一些原因無法使用 &man.send-pr.1; 程式, - 則可以發信到 &a.bugs; 來請別人幫你代寄。 - - 請參閱 這篇文章 - 了解如何撰寫好的問題報告。 - - - - 對於文件的修訂 - - 提交文件 - - 文件的修改方面,是由 &a.doc; 來審查。 - 請參閱 FreeBSD Documentation Project Primer - 來獲得完整的教學細節。 - 請按照 中介紹的方法使用 &man.send-pr.1; - 來提交新的文件,或者改善現有的文件 (哪怕是很小的改進也是歡迎的!)。 - - - - 對於現有原始碼的修改 - - FreeBSD-CURRENT - - 在現有原始碼上進行修改或增加功能,在某種程度上是需要更多技巧的事, - 並且還跟您對於目前 FreeBSD 的開發現狀了解程度有關。 - 有多種方式可以得到被稱作 FreeBSD-CURRENT - 的 FreeBSD 開發版本。 - 請參閱 FreeBSD 使用手冊的 相關部份 ,來了解使用 FreeBSD-CURRENT 的詳情。 - - 在舊的原始碼上進行修改,則通常可能原始碼已過時, - 或與新的版本差異太大而無法被重新整合到 FreeBSD 中。 - 如果您有訂 &a.announce; 以及 &a.current; 的話, - 則可以透過它們來大致了解目前的開發狀態。 - - 若您能夠儘量以最新的原始碼來進行您的修改, - 則下一步要做的事情就是產生您所修改的 diff 檔, - 並將它發給 FreeBSD 的維護人員。這項工作可以透過 &man.diff.1; - 命令來完成。 - - 提交 patch 時,建議 &man.diff.1; 格式採用 unified diff (可以用 diff - -u 來產生)。不過,如果您修改了大量的原始碼, - 則使用 diff -c 來生成的 context diff - 的 diff 可能更容易閱讀,因而推薦使用。一般而言,大都是採用 diff -ruN 即可。 - - - diff - - - 例如: - - - &prompt.user; diff -c oldfile newfile - - 或 - - &prompt.user; diff -c -r olddir newdir - - 將會對特定目錄,產生 context 的 diff 檔。 - - 或者像是... - &prompt.user; diff -u oldfile newfile - 或 - &prompt.user; diff -u -r olddir newdir - - 將產生一樣的 diff ,但是格式為 unified 。 - - 更多的細節部份,請參閱 &man.diff.1;。 - - 一旦您使用 &man.diff.1; 來產生 diff 檔 (可以使用 - &man.patch.1; 命令來測試一下),就可以提交它們,以便被 FreeBSD 收錄。 - 透過使用 - 中所介紹的 &man.send-pr.1; 程式就可以完成這項工作。 - 請注意:不要只把 diff 檔發到 &a.hackers;, - 否則它們可能會被遺忘! 我們會非常感激您提交的修改 - (這是一個義工計劃!); 因為我們都很忙, - 因此有時不一定能夠立即修正問題,但 PR 資料庫將一直保持著這些記錄, - 因此只要有人有了時間它們就能被改正了。 - 如果您的問題報告中包括 patch ,不要忘了在標題加上 - [PATCH] 來強調一下。 - - - uuencode - - - 如果您認為合適 (例如增、刪檔案或更改檔名), - 還可以考慮使用 - tar 來將檔案打包,然後用 &man.uuencode.1; - 來編碼。此外,也可以用 &man.shar.1; 產生的方式。 - - 如果您的修改可能存在潛在的爭議,例如, - 您不確定相關的版權問題,或者感覺需要經過更嚴格的復審才可以發佈它們, - 則應直接發給 &a.core;,而不是透過 &man.send-pr.1; 來發送。 - &a.core; 這小組成員大多從事 FreeBSD 的日常工作。 - 需要注意的是,這個小組也因此十分忙碌, - 因此只有在非常必要的時候,才應寫信給他們。 - - 請參考 &man.intro.9; 和 &man.style.9; 以了解關於撰寫程式碼的風格偏好。 - 若能在送出相關程式碼之前,先了解這些,那對大家來說將是極大的幫助。 - - - - 新原始碼或重要的加值軟體包 - - 如果您打算提供規模較大的原始碼,或者為 FreeBSD 增加重要的新功能, - 則可能必須將它們透過 uuencode 進行編碼,或傳到某個 Web 或 - FTP 站點,以便更多的人能夠得到它。如果您沒有這樣的主機, - 請到相關的 FreeBSD 郵遞論壇提出,看看是否有人願意幫您放置它們。 - - 對於大量的原始碼而言,關於版權的問題肯定會被提出。 - FreeBSD 基本系統中能夠使用的版權聲明包括: - - - - BSDBSD 版權聲明 版權。我們傾向於使用這類授權的原始碼, - 因為它『不附加多餘的條件』,因而更能夠吸引商業企業使用。 - FreeBSD 並不反對商業公司使用它的原始碼,相反, - 我們積極地鼓勵商業公司使用我們的原始碼, - 當然,如果它們若最終能把部分原始碼,重新捐贈給 FreeBSD 就更好了。 - - - - GNU General Public License,或簡稱 GPLGPLGNU General Public LicenseGNU General Public License - 我們並不很歡迎使用這樣授權的原始碼, - 因為商業公司使用它需要做更多的工作。不過,由於很多使用 - GPL 授權的原始碼目前是無法避免的 (compiler, assembler, text formatter等等) - ,拒絕使用所有採用這樣授權的軟體是很不明智的。 - 採用 GPL 授權的原始碼會被放到原始碼的一些特定的位置,例如 - /sys/gnu 或 - /usr/src/gnu,以便那些認為 GPL - 可能會造成麻煩的人能夠作出適當的判斷。 - - - - 使用其它授權的原始碼在進入 FreeBSD 之前必須經過慎重的復審和考慮。 - 採用包含嚴厲限制的商業授權的原始碼,一般來說會被拒絕, - 但我們鼓勵這些原始碼的作者,透過自己的管道來發布它們。 - - 若要在您的成果上加入 BSD-based 版權的話, - 請把下列文字放到每份原始碼的最開始部分, - 並用適當的文字替換 %% 之間的文字。 - - Copyright (c) %%proper_years_here%% - %%your_name_here%%, %%your_state%% %%your_zip%%. - All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer as - the first lines of this file unmodified. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY %%your_name_here%% ``AS IS'' AND ANY EXPRESS OR -IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES -OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -IN NO EVENT SHALL %%your_name_here%% BE LIABLE FOR ANY DIRECT, INDIRECT, -INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT -NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF -THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - - $Id$ - - 為了方便您的使用,在 - /usr/share/examples/etc/bsd-style-copyright - 也可以找到此授權的副本。 - - - - 贊助資金、硬體或 Internet mirror - - 我們非常願意接受各種形式的捐贈,以進一步拓展 FreeBSD 計劃 - ,因為有您的支持,像我們這樣的義工努力才能夠有更大的成就! - 捐贈硬體也非常重要,因為這樣能夠幫助我們增加可支援的硬體種類, - 而我們中的很多人並沒有足夠的資金來購置這些硬體。 - - - 捐款 - - FreeBSD 基金會是一個非營利的、有課稅豁免權的基金會, - 之所以會建立這個基金會,是為了讓 FreeBSD 計劃能夠可長可久。 - 因為該基金會屬 501(c)3 實體,一般而言捐款給基金會的話,可以免繳美國聯邦收入稅, - 以及科羅拉多州收入稅。通常對於有課稅豁免權的實體進行捐贈的話, - 可以折抵聯邦收入中應課稅部分的金額。 - - 您可以把支票寄往: -
- The FreeBSD Foundation - 7321 Brockway Dr. - Boulder, CO 80303 - USA -
-
- - FreeBSD 基金會現在可以透過 PayPal 從網上接受捐款。 - 如果您想向基金會捐款,請參閱 FreeBSD 基金會 網站。 - - 關於 FreeBSD 基金會的更多詳情,可以在 FreeBSD - 基金會 -- 介紹 找到。要聯絡基金會, - 請發送電子郵件到 - bod@FreeBSDFoundation.org -
- - - 捐贈硬體 - 捐贈 - - FreeBSD 計劃歡迎任何人捐贈可以使用的硬體。 - 如果您有興趣捐贈硬體,請聯繫 捐贈聯絡人辦公室。 - - - - 成為 FreeBSD mirror 的網站 - - 我們歡迎新的 FTP、WWW 或 - cvsup mirror 站。如果您希望成為這樣的 mirror 站, - 請參閱 如何架設 FreeBSD mirror - 一文,以了解進一步的情況。 - -
-
- - -
diff --git a/zh_TW.UTF-8/articles/freebsd-questions/Makefile b/zh_TW.UTF-8/articles/freebsd-questions/Makefile deleted file mode 100644 index e0524136c2..0000000000 --- a/zh_TW.UTF-8/articles/freebsd-questions/Makefile +++ /dev/null @@ -1,22 +0,0 @@ -# -# $FreeBSD$ -# Original revision: 1.6 -# -# Article: How to get best results from the FreeBSD-questions mailing list - -MAINTAINER=chinsan.tw@gmail.com - -DOC?= article - -FORMATS?= html -WITH_ARTICLE_TOC?= YES - -INSTALL_COMPRESSED?= gz -INSTALL_ONLY_COMPRESSED?= - -SRCS= article.xml - -URL_RELPREFIX?= ../../../.. -DOC_PREFIX?= ${.CURDIR}/../../.. - -.include "${DOC_PREFIX}/share/mk/doc.project.mk" diff --git a/zh_TW.UTF-8/articles/freebsd-questions/article.xml b/zh_TW.UTF-8/articles/freebsd-questions/article.xml deleted file mode 100644 index ad017406e0..0000000000 --- a/zh_TW.UTF-8/articles/freebsd-questions/article.xml +++ /dev/null @@ -1,610 +0,0 @@ - - - -
- 如何在 FreeBSD-questions mailing list 上得到正解 - - - GregLehey -
grog@FreeBSD.org
-
- - - &tm-attrib.freebsd; - &tm-attrib.microsoft; - &tm-attrib.netscape; - &tm-attrib.opengroup; - &tm-attrib.qualcomm; - &tm-attrib.general; - - - $FreeBSD$ - - $FreeBSD$ - - - 本文主要是給準備寫信到 FreeBSD-questions mailing list 的人提供一些參考。 - 我們會給你一些發問的技巧與建議,以便讓你的答案得到更有用的答覆。 - - 本文會定期發到 FreeBSD-questions mailing list 上。 - -
- - - 簡介 - - FreeBSD-questions is a mailing list maintained by - the FreeBSD project to help people who have questions about the normal - use of FreeBSD. Another group, FreeBSD-hackers, - discusses more advanced questions such as future development - work. - - - The term hacker has nothing to do with breaking - into other people's computers. The correct term for the latter - activity is cracker, but the popular press has not found - out yet. The FreeBSD hackers disapprove strongly of cracking - security, and have nothing to do with it. For a longer description of - hackers, see Eric Raymond's How To Become - A Hacker - - - This is a regular posting aimed to help both those seeking advice - from FreeBSD-questions (the newcomers), and also those - who answer the questions (the hackers). - - Inevitably there is some friction, which stems from the different - viewpoints of the two groups. The newcomers accuse the hackers of being - arrogant, stuck-up, and unhelpful, while the hackers accuse the - newcomers of being stupid, unable to read plain English, and expecting - everything to be handed to them on a silver platter. Of course, there is - an element of truth in both these claims, but for the most part these - viewpoints come from a sense of frustration. - - In this document, I would like to do something to relieve this - frustration and help everybody get better results from - FreeBSD-questions. In the following section, I recommend how to submit - a question; after that, we will look at how to answer one. - - - - How to subscribe to FreeBSD-questions - - FreeBSD-questions is a mailing list, so you need mail access. Point - your WWW browser to the information page of the FreeBSD-questions mailing list. - In the section titled Subscribing to freebsd-questions fill - in the Your email address field; the other fields are optional. - - - - The password fields in the subscription form provide only mild - security, but should prevent others from messing with your - subscription. Do not use a valuable password as - it will occasionally be emailed back to you in cleartext. - - - You will receive a confirmation message from - mailman; follow the included instructions - to complete your subscription. - - Finally, when you get the Welcome message from - mailman telling you the details of the list - and subscription area password, please save it. - If you ever should want to leave the list, you will need the information - there. See the next section for more details. - - - - How to unsubscribe from FreeBSD-questions - - When you subscribed to FreeBSD-questions, you got a welcome message - from mailman. In this message, amongst - other things, it told you how to unsubscribe. Here is a typical - message: - - Welcome to the freebsd-questions@freebsd.org mailing list! - -To post to this list, send your email to: - - freebsd-questions@freebsd.org - -General information about the mailing list is at: - - http://lists.freebsd.org/mailman/listinfo/freebsd-questions - -If you ever want to unsubscribe or change your options (e.g., switch to -or from digest mode, change your password, etc.), visit your -subscription page at: - -http://lists.freebsd.org/mailman/options/freebsd-questions/grog%40lemsi.de - -You can also make such adjustments via email by sending a message to: - - freebsd-questions-request@freebsd.org - -with the word `help' in the subject or body (don't include the -quotes), and you will get back a message with instructions. - -You must know your password to change your options (including changing -the password, itself) or to unsubscribe. It is: - - 12345 - -Normally, Mailman will remind you of your freebsd.org mailing list -passwords once every month, although you can disable this if you -prefer. This reminder will also include instructions on how to -unsubscribe or change your account options. There is also a button on -your options page that will email your current password to you. - - From the URL specified in your Welcome message you - may visit the Account management page and enter a request - to Unsubscribe you from FreeBSD-questions mailing - list. - - A confirmation message will be sent to you from - mailman; follow the included instructions - to finish unsubscribing. - - If you have done this, and you still can not figure out what - is going on, send a message to - freebsd-questions-request@FreeBSD.org, and they will - sort things out for you. Do not send a message to - FreeBSD-questions: they can not help you. - - - - Should I ask <literal>-questions</literal> or - <literal>-hackers</literal>? - - Two mailing lists handle general questions about FreeBSD, - FreeBSD-questions and - FreeBSD-hackers. In some cases, it is not really - clear which group you should ask. The following criteria should help - for 99% of all questions, however: - - - - If the question is of a general nature, ask - FreeBSD-questions. Examples might be questions - about installing FreeBSD or the use of a particular &unix; - utility. - - - - If you think the question relates to a bug, but you are not sure, - or you do not know how to look for it, send the message to - FreeBSD-questions. - - - - If the question relates to a bug, and you are - sure that it is a bug (for example, you can - pinpoint the place in the code where it happens, and you maybe have - a fix), then send the message to - FreeBSD-hackers. - - - - If the question relates to enhancements to FreeBSD, and you - can make suggestions about how to implement them, then send the - message to FreeBSD-hackers. - - - - There are also a number of other specialized mailing lists, for - example FreeBSD-isp, which caters to the interests of - ISPs (Internet Service Providers) who run FreeBSD. If you happen to be - an ISP, this does not mean you should automatically send your questions - to FreeBSD-isp. The criteria above still apply, and - it is in your interest to stick to them, since you are more likely to get - good results that way. - - - - Before submitting a question - - You can (and should) do some things yourself before asking a question - on one of the mailing lists: - - - - Try solving the problem on your own. If you post a question which - shows that you have tried to solve the problem, your question will - generally attract more positive attention from people reading it. - Trying to solve the problem yourself will also enhance your understanding - of FreeBSD, and will eventually let you use your knowledge to help others - by answering questions posted to the mailing lists. - - - - - Read the manual pages, and the FreeBSD documentation (either - installed in /usr/doc or accessible via WWW at - http://www.FreeBSD.org), especially the - handbook - and the FAQ. - - - - - Browse and/or search the archives for the mailing list, to see if your - question or a similar one has been asked (and possibly answered) on the - list. You can browse and/or search the mailing list archives - at http://www.FreeBSD.org/mail - and http://www.FreeBSD.org/search/search.html#mailinglists - respectively. This can be done at other WWW sites as well, for example - at http://marc.theaimsgroup.com. - - - - - Use a search engine such as Google - or Yahoo to find answers to your question. - Google even has a BSD-specific search interface. - - - - - - - How to submit a question - - When submitting a question to FreeBSD-questions, consider the - following points: - - - - Remember that nobody gets paid for answering a FreeBSD - question. They do it of their own free will. You can influence this - free will positively by submitting a well-formulated question - supplying as much relevant information as possible. You can - influence this free will negatively by submitting an incomplete, - illegible, or rude question. It is perfectly possible to send a - message to FreeBSD-questions and not get an answer even if you - follow these rules. It is much more possible to not get an answer if - you do not. In the rest of this document, we will look at how to get - the most out of your question to FreeBSD-questions. - - - - Not everybody who answers FreeBSD questions reads every message: - they look at the subject line and decide whether it interests them. - Clearly, it is in your interest to specify a subject. FreeBSD - problem or Help are not enough. If you provide no subject at - all, many people will not bother reading it. If your subject is not - specific enough, the people who can answer it may not read - it. - - - - Format your message so that it is legible, and - PLEASE DO NOT SHOUT!!!!!. We appreciate that a lot of people do not - speak English as their first language, and we try to make - allowances for that, but it is really painful to try to read a - message written full of typos or without any line breaks. - - Do not underestimate the effect that a poorly formatted mail - message has, not just on the FreeBSD-questions mailing list. - Your mail message is all people see of you, and if it is poorly - formatted, one line per paragraph, badly spelt, or full of - errors, it will give people a poor impression of you. - - A lot of badly formatted messages come from - bad mailers or badly - configured mailers. The following mailers are known to - send out badly formatted messages without you finding out about - them: - - - - cc:Mail - - - - &eudora; - - - - exmh - - - - µsoft; Exchange - - - - µsoft; Internet Mail - - - - µsoft; &outlook; - - - - &netscape; - - - - As you can see, the mailers in the Microsoft world are frequent - offenders. If at all possible, use a &unix; mailer. If you must use a - mailer under Microsoft environments, make sure it is set up - correctly. Try not to use MIME: a lot of people - use mailers which do not get on very well with - MIME. - - - - Make sure your time and time zone are set correctly. This may - seem a little silly, since your message still gets there, but many - of the people you are trying to reach get several hundred messages a - day. They frequently sort the incoming messages by subject and by - date, and if your message does not come before the first answer, they - may assume they missed it and not bother to look. - - - - Do not include unrelated questions in the same message. Firstly, - a long message tends to scare people off, and secondly, it is more - difficult to get all the people who can answer all the questions to - read the message. - - - - Specify as much information as possible. This is a difficult - area, and we need to expand on what information you need to submit, - but here is a start: - - - - In nearly every case, it is important to know the version of - FreeBSD you are running. This is particularly the case for - FreeBSD-CURRENT, where you should also specify the date of the - sources, though of course you should not be sending questions - about -CURRENT to FreeBSD-questions. - - - With any problem which could be - hardware related, tell us about your hardware. In case of - doubt, assume it is possible that it is hardware. What kind of - CPU are you using? How fast? What motherboard? How much - memory? What peripherals? - - There is a judgement call here, of course, but the output of - the &man.dmesg.8; command can frequently be very useful, since it - tells not just what hardware you are running, but what version of - FreeBSD as well. - - - - If you get error messages, do not say I get error - messages, say (for example) I get the error - message 'No route to host'. - - - - If your system panics, do not say My system - panicked, say (for example) my system panicked - with the message 'free vnode isn't'. - - - - If you have difficulty installing FreeBSD, please tell us - what hardware you have. In particular, it is important to know - the IRQs and I/O addresses of the boards installed in your - machine. - - - - If you have difficulty getting PPP to run, describe the - configuration. Which version of PPP do you use? What kind of - authentication do you have? Do you have a static or dynamic IP - address? What kind of messages do you get in the log - file? - - - - - - A lot of the information you need to supply is the output of - programs, such as &man.dmesg.8;, or console messages, which usually - appear in /var/log/messages. Do not try to copy - this information by typing it in again; it is a real pain, and you are - bound to make a mistake. To send log file contents, either make a - copy of the file and use an editor to trim the information to what - is relevant, or cut and paste into your message. For the output of - programs like &man.dmesg.8;, redirect the output to a file and - include that. For example, - - &prompt.user; dmesg > /tmp/dmesg.out - - This redirects the information to the file - /tmp/dmesg.out. - - - - If you do all this, and you still do not get an answer, there - could be other reasons. For example, the problem is so complicated - that nobody knows the answer, or the person who does know the answer - was offline. If you do not get an answer after, say, a week, it - might help to re-send the message. If you do not get an answer to - your second message, though, you are probably not going to get one - from this forum. Resending the same message again and again will - only make you unpopular. - - - - To summarize, let's assume you know the answer to the following - question (yes, it is the same one in each case). - You choose which of these two questions you would be more prepared to - answer: - - - Message 1 - - Subject: HELP!!?!?? -I just can't get hits damn silly FereBSD system to -workd, and Im really good at this tsuff, but I have never seen -anythign sho difficult to install, it jst wont work whatever I try -so why don't you guys tell me what I doing wrong. - - - - Message 2 - - Subject: Problems installing FreeBSD - -I've just got the FreeBSD 2.1.5 CDROM from Walnut Creek, and I'm having a lot -of difficulty installing it. I have a 66 MHz 486 with 16 MB of -memory and an Adaptec 1540A SCSI board, a 1.2GB Quantum Fireball -disk and a Toshiba 3501XA CDROM drive. The installation works just -fine, but when I try to reboot the system, I get the message -Missing Operating System. - - - - - How to follow up to a question - - Often you will want to send in additional information to a question - you have already sent. The best way to do this is to reply to your - original message. This has three advantages: - - - - You include the original message text, so people will know what - you are talking about. Do not forget to trim unnecessary text out, - though. - - - - The text in the subject line stays the same (you did remember to - put one in, did you not?). Many mailers will sort messages by - subject. This helps group messages together. - - - - The message reference numbers in the header will refer to the - previous message. Some mailers, such as - mutt, can - thread messages, showing the exact - relationships between the messages. - - - - - - How to answer a question - - - Before you answer a question to FreeBSD-questions, consider: - - - - A lot of the points on submitting questions also apply to - answering questions. Read them. - - - - Has somebody already answered the question? The easiest way to - check this is to sort your incoming mail by subject: then - (hopefully) you will see the question followed by any answers, all - together. - - If somebody has already answered it, it does not automatically - mean that you should not send another answer. But it makes sense to - read all the other answers first. - - - - Do you have something to contribute beyond what has already been - said? In general, Yeah, me too answers do not help - much, although there are exceptions, like when somebody is - describing a problem he is having, and he does not know whether it is - his fault or whether there is something wrong with the hardware or - software. If you do send a me too answer, you should - also include any further relevant information. - - - - Are you sure you understand the question? Very frequently, the - person who asks the question is confused or does not express himself - very well. Even with the best understanding of the system, it is - easy to send a reply which does not answer the question. This - does not help: you will leave the person who submitted the question - more frustrated or confused than ever. If nobody else answers, and - you are not too sure either, you can always ask for more - information. - - - - Are you sure your answer is correct? - If not, wait a day or so. If nobody else comes up with a - better answer, you can still reply and say, for example, I - do not know if this is correct, but since nobody else has - replied, why don't you try replacing your ATAPI CDROM with - a frog?. - - - - Unless there is a good reason to do otherwise, reply to the - sender and to FreeBSD-questions. Many people on the - FreeBSD-questions are lurkers: they learn by reading - messages sent and replied to by others. If you take a message which - is of general interest off the list, you are depriving these people - of their information. Be careful with group replies; lots of people - send messages with hundreds of CCs. If this is the case, be sure to - trim the Cc: lines appropriately. - - - - Include relevant text from the original message. Trim it to the - minimum, but do not overdo it. It should still be possible for - somebody who did not read the original message to understand what - you are talking about. - - - - Use some technique to identify which text came from the original - message, and which text you add. I personally find that prepending - > to the original message - works best. Leaving white space after the - > and leave empty lines - between your text and the original text both make the result more - readable. - - - - Put your response in the correct place (after the text to which - it replies). It is very difficult to read a thread of responses - where each reply comes before the text to which it replies. - - - - Most mailers change the subject line on a reply by prepending a - text such as Re: . If your mailer does not do it - automatically, you should do it manually. - - - - If the submitter did not abide by format conventions (lines too - long, inappropriate subject line), please fix - it. In the case of an incorrect subject line (such as - HELP!!??), change the subject line to (say) - Re: Difficulties with sync PPP (was: HELP!!??). That - way other people trying to follow the thread will have less - difficulty following it. - - In such cases, it is appropriate to say what you did and why you - did it, but try not to be rude. If you find you can not answer - without being rude, do not answer. - - If you just want to reply to a message because of its bad - format, just reply to the submitter, not to the list. You can just - send him this message in reply, if you like. - - - -
diff --git a/zh_TW.UTF-8/articles/hubs/Makefile b/zh_TW.UTF-8/articles/hubs/Makefile deleted file mode 100644 index f04f8a971f..0000000000 --- a/zh_TW.UTF-8/articles/hubs/Makefile +++ /dev/null @@ -1,17 +0,0 @@ -# -# $FreeBSD$ -# -# Article: Mirroring FreeBSD - -DOC?= article - -FORMATS?= html -WITH_ARTICLE_TOC?= YES - -INSTALL_COMPRESSED?=gz -INSTALL_ONLY_COMPRESSED?= - -SRCS= article.xml - -DOC_PREFIX?= ${.CURDIR}/../../.. -.include "${DOC_PREFIX}/share/mk/doc.project.mk" diff --git a/zh_TW.UTF-8/articles/hubs/article.xml b/zh_TW.UTF-8/articles/hubs/article.xml deleted file mode 100644 index 5d87a92f21..0000000000 --- a/zh_TW.UTF-8/articles/hubs/article.xml +++ /dev/null @@ -1,520 +0,0 @@ - - -
- Mirroring FreeBSD - - - JunKuriyama
kuriyama@FreeBSD.org
- ValentinoVaschetto
logo@FreeBSD.org
- DanielLang
dl@leo.org
- DanielLang
kensmith@FreeBSD.org
-
- - - FreeBSD 是 FreeBSD基金會的註冊商標. - 許多製造商和經銷商使用一些稱為商標的圖案或文字設計來彰顯自己的產品.本文中出現的眾多商標,以及 FreeBSD Project 本身廣所人知的商標,後面將以 ® 符號來標註. - - - $FreeBSD$ - - $FreeBSD$ - - - 這是份介紹如何 mirror FreeBSD,主要是針對網路中心管理者或託管於大型資料中心的管理者. - -
- - - 我們目前不接受新Mirror站點的申請. - - - - 聯繫方式 - - The Mirror System Coordinators can be reached through email - at mirror-admin@FreeBSD.org. There is also - a FreeBSD mirror sites mailing lists. - - - - FreeBSD mirrors 的需求 - - 磁碟空間 - 磁碟空間是最為需要. 根據你想要 mirror 的發行版、CPU架構 ,可能會消耗大量的磁碟空間.另外請注意 官方 鏡像站需要完整 mirror。網站內容亦需要完整鏡像。且這裡所述的數字是反應目前版本狀態 (如 10.4-RELEASE/11.1-RELEASE )。而不斷的開發與發行將會增加所需空間。並請務必保留一些 ( 約10-20% ) 額外空間。這裡大約估計如下: - - 完整的作業系統套件 FTP 站所需:1.4 TB - CTM deltas: 10 GB - 網站: 1GB - - 目前 FTP Distribution 的磁碟使用可在 ftp://ftp.FreeBSD.org/pub/FreeBSD/dir.sizes 找到。 - - - 網路連線/頻寬 - 當然,你一定要能連上 Internet。 頻寬需求多少,這要看你所想要的 mirror 程度而定。 若只想要 mirror 一部份的 FreeBSD 檔案以作為網站或 intranet 的局部用途, 那麼頻寬需求會明顯比成為公共服務用途的小一些。 若想成為 official mirror 之一的話,那麼頻寬就勢必得增加才夠用。以下,我們僅列出一些估計值以做為參考: - - 本地站台,沒有要公共存取: 基本上沒有最低需求,但是 < 2Mbps 同步將會非常緩慢 - 非官方公共站台: 34Mbps 是不錯的開始. - 官方站台: > 100Mbps 是建議值,並且你的主機必須盡可能連接靠近邊界路由器. - - - - 系統需求,CPU,RAM - 這取決於預期的客戶端數量,這是由伺服器的策略決定的。也會受到您提供的服務類型而影響.普通的 FTP 或 HTTP 服務可能不需要大量的資源。注意如果您提供rsync. 這可能會對 CPU 和記憶體的需求產生巨大的影響,因為會消耗大量記憶體。 以下只是給你一個非常粗略的的例子。 - 針對一個較常被瀏覽的網站 rsync,您須考量處理器大約 800Mhz 至 1Ghz,並且安裝最少 512MB RAM,這或許是成為一個 官方 站台的最小需求. - 為了一個經常使用的網站你絕對需要更多 RAM (2GB是不錯的開始) 並且儘可能有更多 CPU , 這也表示你需要一個 SMP 系統。 - 您也會需要考慮有一個較快的磁碟系統。在管理 SVN repository 需要一個快速的磁碟系統 ( 強烈建議 RAID)。有自己的快取記憶體的 SCSI 控制器也可以加快速度,因為大多數這些服務會對磁碟進行大量的小幅修改。 - - - 提供的服務 - 每個鏡像站都需要一有一組可用的核心服務。除了這些所需的服務之外,還有許多伺服器管理員可以選擇提供的選用服務。本節將說明您可以提供哪些服務以及如何實作這些服務。 - - FTP (需要提供給FTP檔案集) - 這是最基本的服務之一。需要為每個鏡像站提供公共的 FTP distributions 。 FTP 存取必須是匿名的, 不允許上傳/下載比率 (這是一件荒謬的事),上傳功能不是必需的 (且必須 絕不允許 FreeBSD 檔案空間)。另外,FreeBSD archive 應該在路徑/pub/FreeBSD下。 - 這裡有很多可用的軟體可以架設允許匿名的 FTP 服務 (按字母順序)。 - - /usr/libexec/ftpd: FreeBSD 內建的 ftpd 可以使用。請您參閱 ftpd8 - - - ftp/ncftpd。一個商業軟體套件,免費供教育使用。 - - - ftp/oftpd:一個以安全性作為主要考量的 ftpd。 - - - ftp/proftpd:一個模組化且非常有彈性的 ftpd。 - - - ftp/pure-ftpd: 另一個為安全所設計的 ftpd。 - - ftp/twoftpd:如上。 - ftp/vsftpd非常安全的 ftpd。 - - FreeBSD 的 ftpdproftpd 和也許 ncftpd 是最常使用的 FTP 軟體。其他的在鏡像站並沒有大量用戶基礎。需要考慮的一件事情是,您可能需要性地來限制允許同時連線數,從而限制消耗多少網路頻寬和系統資源。 - - - Rsync (給FTP檔案集選用) - Rsync 通常是用在存取 FreeBSD 系統中的FTP內容,其他的鏡像站可以使用你的系統當作他們的來源。這個協定和 FTP 有很多不同,它比較不那麼消耗頻寬,只有當比對檔案間有變動才傳輸檔案,而不是整個檔案傳完。Rsync 需要較多的記憶體。大小取決於檔案與目錄的數目及同步模組大小。Rsync 可以使用 rshssh (現在為預設)來傳輸, 或使用自己的協定單獨存取(這是公共rsync伺服器的首選方法)。可以用認證、連接限制和其他限制。只有一個軟體套件可以用: - - net/rsync - - - - HTTP(網頁需要,FTP 檔案集則是選用) - 如果您想提供 FreeBSD 的網頁,您需要安裝一個網頁伺服器。您可以選擇利用 HTTP 提供 FTP 檔案集。網頁伺服器軟體的選擇留給鏡像站管理員選擇。一些最受歡迎的選擇是: - - - - www/apache22Apache 是網際網路上最廣泛使用的網頁伺服器。 它被 FreeBSD 計畫廣泛使用。 - - - - www/thttpd:如果您要提供大量的靜態內容,您可能會發現使用諸如 thttpd 之類的應用程式會比 Apache 更有效率。它針對 FreeBSD 的優秀性能進行了最佳化。 - - - - www/boaBoathttpdApache 外的另一個選擇。對於純粹的靜態網頁,它應該會提供比 Apache 更好的性能。在寫這篇文章的時候,它並不包含像在 thttpd 中一樣針對FreeBSD 做最佳化。 - - - - www/nginxNginx 是一款高性能的最新網頁服務器,具有低記憶體佔用量和關鍵特色,可以構建現代高效率網頁基礎架構,功能包括 HTTP 伺服器,HTTP 和郵件反向代理,快取,負載平衡,壓縮,請求限制(request throtting),連接多工與再利用,SSL 卸載和 HTTP 媒體串流。 - - - - - - - 如何Mirror FreeBSD 站台 - 好,現在你知道硬體需求和如何提供服務,但不知道如何做。:-) 這節將解釋如何實際 mirror FreeBSD 的不同部分,使用哪些工具以及從哪裡 mirror。 - - 鏡像 FTP 站 - FTP 部份有最大量的資料需要被 mirror。它包括網路安裝所需的發布集,實際上是原始碼樹快照的分支,可燒錄光碟供安裝系統的ISO映像檔 ,一個可 live 開機的檔案系統,以及一個 port tree 的快照。當然,全都有各種 FreeBSD 版本和各種CPU架構。 - - The best way to mirror the FTP area is rsync. - You can install the port net/rsync and then use - rsync to sync with your upstream host. - rsync is already mentioned - in . - Since rsync access is not - required, your preferred upstream site may not allow it. - You may need to hunt around a little bit to find a site - that allows rsync access. - - 由於 rsync 客戶端的數量將對伺服器主機產生重大影響,因此大多數管理員會對伺服器負荷加以限制。對於 mirror 站台,您應該詢問您要 mirror 站台的管理人員他們的管理政策,也許需要對您的主機開放例外(因為您是一個 mirror 站)。 - - 一個需要mirror FreeBSD官網的指令如下: - % rsync -vaHz --delete rsync://ftp4.de.FreeBSD.org/FreeBSD/ /pub/FreeBSD/ - Consult the documentation for rsync, - which is also available at - http://rsync.samba.org/, - about the various options to be used with rsync. - If you sync the whole module (unlike subdirectories), - be aware that the module-directory (here "FreeBSD") - will not be created, so you cannot omit the target directory. - Also you might - want to set up a script framework that calls such a command - via cron8. - - - - Mirroring 網頁 - FreeBSD 網站應只能透過rsync指令來mirror. - 一個 mirror FreeBSD 網站的指令應該看起像這樣: - % rsync -vaHz --delete rsync://bit0.us-west.freebsd.org/FreeBSD-www-data/ /usr/local/www/ - - - Mirroring 套件 - 由於對頻寬,儲存空間和管理的要求非常高,FreeBSD 計畫決定不允許公眾 mirror 套件. 對於擁有大量伺服主機的網站,建議為 pkg8 使用 HTTP proxy 快取可能會有所幫助。或者,您可以使用以下指令獲得套件與相依套件: - - % pkg fetch -d -o /usr/local/mirror vim - - 一旦這些套件包被下載,就必須執行以下命令來產生套件庫數據: - - % pkg repo /usr/local/mirror - - 一旦套件被下載並且已經生成了套件庫的數據,就可以透過 HTTP 協定將套件提供給客戶端機器。有關更多訊息,請參閱 pkg8 的 man pages,特別是pkg-repo8 頁面。 - - - 我多久應該mirror? - - Every mirror should be updated at a minimum of once per day. - Certainly a script with locking to prevent multiple runs - happening at the same time will be needed to run from - cron8. Since nearly every admin does this in their own - way, specific instructions cannot be provided. It could work - something like this: - - - - - Put the command to run your mirroring application - in a script. Use of a plain /bin/sh - script is recommended. - - - - - Add some output redirections so diagnostic - messages are logged to a file. - - - - - Test if your script works. Check the logs. - - - - - Use crontab1 to add the script to the - appropriate user's crontab5. This should be a - different user than what your FTP daemon runs as so that - if file permissions inside your FTP area are not - world-readable those files can not be accessed by anonymous - FTP. This is used to stage releases — - making sure all of the official mirror sites have all of the - necessary release files on release day. - - - - - Here are some recommended schedules: - - FTP fileset: daily - WWW pages: daily - - - - - Where to mirror from - - This is an important issue. So this section will - spend some effort to explain the backgrounds. We will say this - several times: under no circumstances should you mirror from - ftp.FreeBSD.org. - - - A few words about the organization - - Mirrors are organized by country. All - official mirrors have a DNS entry of the form - ftpN.CC.FreeBSD.org. - CC (i.e. country code) is the - top level domain (TLD) - of the country where this mirror is located. - N is a number, - telling that the host would be the Nth - mirror in that country. - (Same applies to - wwwN.CC.FreeBSD.org, etc.) - There are mirrors with no CC part. - These are the mirror sites that are very well connected and - allow a large number of concurrent users. - ftp.FreeBSD.org is actually two machines, one currently - located in Denmark and the other in the United States. - It is NOT a master site and should never be - used to mirror from. Lots of online documentation leads - interactiveusers to - ftp.FreeBSD.org so automated mirroring - systems should find a different machine to mirror from. - - - Additionally there exists a hierarchy of mirrors, which - is described in terms of tiers. - The master sites are not referred to but can be - described as Tier-0. Mirrors - that mirror from these sites can be considered - Tier-1, mirrors of Tier-1-mirrors, - are Tier-2, etc. - Official sites are encouraged to be of a low tier, - but the lower the tier the higher the requirements in - terms as described in . - Also access to low-tier-mirrors may be restricted, and - access to master sites is definitely restricted. - The tier-hierarchy is not reflected - by DNS and generally not documented anywhere except - for the master sites. However, official mirrors with low numbers - like 1-4, are usually Tier-1 - (this is just a rough hint, and there is no rule). - - - - Ok, but where should I get the stuff now? - - Under no circumstances should you mirror from ftp.FreeBSD.org. - The short answer is: from the - site that is closest to you in Internet terms, or gives you - the fastest access. - - - I just want to mirror from somewhere! - - If you have no special intentions or - requirements, the statement in - applies. This means: - - - - - Check for those which provide fastest access - (number of hops, round-trip-times) - and offer the services you intend to - use (like rsync). - - - - - Contact the administrators of your chosen site stating your - request, and asking about their terms and - policies. - - - - - Set up your mirror as described above. - - - - - - I am an official mirror, what is the right site for me? - - In general the description in - still applies. Of course you may want to put some - weight on the fact that your upstream should be of - a low tier. - There are some other considerations about official - mirrors that are described in . - - - - I want to access the master sites! - - If you have good reasons and good prerequisites, - you may want and get access to one of the - master sites. Access to these sites is - generally restricted, and there are special policies - for access. If you are already an official - mirror, this certainly helps you getting access. - In any other case make sure your country really needs another mirror. - If it already has three or more, ask the zone administrator (hostmaster@CC.FreeBSD.org) or FreeBSD mirror sites mailing lists first. - - - Whoever helped you become, an official - should have helped you gain access to an appropriate upstream - host, either one of the master sites or a suitable Tier-1 - site. If not, you can send email to - mirror-admin@FreeBSD.org to request help with - that. - - - There is one master site for the FTP fileset. - - - ftp-master.FreeBSD.org - - This is the master site for the FTP fileset. - - - ftp-master.FreeBSD.org provides - rsync - access, in addition to FTP. - Refer to . - - - Mirrors are also encouraged to allow rsync - access for the FTP contents, since they are - Tier-1-mirrors. - - - - - - - Official Mirrors - - Official mirrors are mirrors that - - - - a) have a FreeBSD.org DNS entry - (usually a CNAME). - - - - - b) are listed as an official mirror in the FreeBSD - documentation (like handbook). - - - - - So far to distinguish official mirrors. - Official mirrors are not necessarily Tier-1-mirrors. - However you probably will not find a Tier-1-mirror, - that is not also official. - - - Special Requirements for official (tier-1) mirrors - - It is not so easy to state requirements for all - official mirrors, since the project is sort of - tolerant here. It is more easy to say, - what official tier-1 mirrors - are required to. All other official mirrors - can consider this a big should. - - Tier-1 mirrors are required to: - - carry the complete fileset - allow access to other mirror sites - provide FTP and - rsync access - - - Furthermore, admins should be subscribed to the FreeBSD mirror sites mailing lists. - See this link for details, how to subscribe. - - - It is very important for a hub administrator, especially - Tier-1 hub admins, to check the - release schedule - for the next FreeBSD release. This is important because it will tell you when the - next release is scheduled - to come out, and thus giving you time to prepare for the big spike of traffic which follows it. - - - It is also important that hub administrators try to keep their mirrors as up-to-date as - possible (again, even more crucial for Tier-1 mirrors). If Mirror1 does not update for a - while, lower tier mirrors will begin to mirror old data from Mirror1 and thus begins - a downward spiral... Keep your mirrors up to date! - - - - - How to become official then? - - - We are not accepting any new mirrors at this time. - - - - - Some statistics from mirror sites - - Here are links to the stat pages of your favorite mirrors - (a.k.a. the only ones who feel like providing stats). - - - FTP site statistics - - - ftp.is.FreeBSD.org - hostmaster@is.FreeBSD.org - - - (Bandwidth) (FTP - processes) (HTTP processes) - - - - - ftp2.ru.FreeBSD.org - mirror@macomnet.ru - - (Bandwidth) - (HTTP and FTP users) - - - - - -
diff --git a/zh_TW.UTF-8/articles/hubs/zh_TW.po b/zh_TW.UTF-8/articles/hubs/zh_TW.po deleted file mode 100644 index b7b2ad4f05..0000000000 --- a/zh_TW.UTF-8/articles/hubs/zh_TW.po +++ /dev/null @@ -1,665 +0,0 @@ -# $FreeBSD$ -msgid "" -msgstr "" -"Project-Id-Version: \n" -"POT-Creation-Date: 2017-12-15 03:12+0800\n" -"PO-Revision-Date: 2018-02-03 13:43+0800\n" -"Language: zh_TW\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"Last-Translator: \n" -"Language-Team: \n" -"X-Generator: Poedit 1.8.11\n" - -#. Put one translator per line, in the form NAME , YEAR1, YEAR2 -msgctxt "_" -msgid "translator-credits" -msgstr "translator-credits" - -#. (itstool) path: info/title -#: article.translate.xml:4 -msgid "Mirroring FreeBSD" -msgstr "Mirroring FreeBSD" - -#. (itstool) path: affiliation/address -#: article.translate.xml:8 -#, no-wrap -msgid "kuriyama@FreeBSD.org" -msgstr "kuriyama@FreeBSD.org" - -#. (itstool) path: authorgroup/author -#: article.translate.xml:7 -msgid "JunKuriyama <_:address-1/> " -msgstr "JunKuriyama <_:address-1/> " - -#. (itstool) path: affiliation/address -#: article.translate.xml:11 -#, no-wrap -msgid "logo@FreeBSD.org" -msgstr "logo@FreeBSD.org" - -#. (itstool) path: authorgroup/author -#: article.translate.xml:10 -msgid "ValentinoVaschetto <_:address-1/> " -msgstr "ValentinoVaschetto <_:address-1/> " - -#. (itstool) path: affiliation/address -#: article.translate.xml:14 -#, no-wrap -msgid "dl@leo.org" -msgstr "dl@leo.org" - -#. (itstool) path: authorgroup/author -#: article.translate.xml:13 -msgid "DanielLang <_:address-1/> " -msgstr "DanielLang <_:address-1/> " - -#. (itstool) path: affiliation/address -#: article.translate.xml:17 -#, no-wrap -msgid "kensmith@FreeBSD.org" -msgstr "kensmith@FreeBSD.org" - -#. (itstool) path: authorgroup/author -#: article.translate.xml:16 -msgid "KenSmith <_:address-1/> " -msgstr "DanielLang <_:address-1/> " - -#. (itstool) path: legalnotice/para -#: article.translate.xml:22 -msgid "FreeBSD is a registered trademark of the FreeBSD Foundation." -msgstr "FreeBSD 是 FreeBSD基金會的註冊商標." - -#. (itstool) path: legalnotice/para -#: article.translate.xml:24 -msgid "Many of the designations used by manufacturers and sellers to distinguish their products are claimed as trademarks. Where those designations appear in this document, and the FreeBSD Project was aware of the trademark claim, the designations have been followed by the or the ® symbol." -msgstr "許多製造商和經銷商使用一些稱為商標的圖案或文字設計來彰顯自己的產品.本文中出現的眾多商標,以及 FreeBSD Project 本身廣所人知的商標,後面將以 ® 符號來標註." - -#. (itstool) path: info/pubdate -#. (itstool) path: info/releaseinfo -#: article.translate.xml:32 article.translate.xml:34 -msgid "$FreeBSD$" -msgstr "$FreeBSD$" - -#. (itstool) path: abstract/para -#: article.translate.xml:37 -msgid "An in-progress article on how to mirror FreeBSD, aimed at hub administrators." -msgstr "這是份介紹如何 mirror FreeBSD,主要是針對網路中心管理者或託管於大型資料中心的管理者." - -#. (itstool) path: note/para -#: article.translate.xml:43 -msgid "We are not accepting new mirrors at this time." -msgstr "我們目前不接受新Mirror站點的申請." - -# 聯絡方式 -#. (itstool) path: sect1/title -#: article.translate.xml:47 -msgid "Contact Information" -msgstr "聯繫方式" - -#. (itstool) path: sect1/para -#: article.translate.xml:49 -msgid "The Mirror System Coordinators can be reached through email at mirror-admin@FreeBSD.org. There is also a FreeBSD mirror sites mailing lists." -msgstr "" - -#. (itstool) path: sect1/title -#: article.translate.xml:55 -msgid "Requirements for FreeBSD mirrors" -msgstr "FreeBSD mirrors 的需求" - -#. (itstool) path: sect2/title -#: article.translate.xml:57 -msgid "Disk Space" -msgstr "磁碟空間" - -#. (itstool) path: sect2/para -#: article.translate.xml:58 -msgid "Disk space is one of the most important requirements. Depending on the set of releases, architectures, and degree of completeness you want to mirror, a huge amount of disk space may be consumed. Also keep in mind that official mirrors are probably required to be complete. The web pages should always be mirrored completely. Also note that the numbers stated here are reflecting the current state (at 10.4-RELEASE/11.1-RELEASE). Further development and releases will only increase the required amount. Also make sure to keep some (ca. 10-20%) extra space around just to be sure. Here are some approximate figures:" -msgstr "磁碟空間是最為需要. 根據你想要 mirror 的發行版、CPU架構 ,可能會消耗大量的磁碟空間.另外請注意 官方 鏡像站需要完整 mirror。網站內容亦需要完整鏡像。且這裡所述的數字是反應目前版本狀態 (如 10.4-RELEASE/11.1-RELEASE )。而不斷的開發與發行將會增加所需空間。並請務必保留一些 ( 約10-20% ) 額外空間。這裡大約估計如下:" - -#. (itstool) path: listitem/para -#: article.translate.xml:74 -msgid "Full FTP Distribution: 1.4 TB" -msgstr "完整的作業系統套件 FTP 站所需:1.4 TB" - -# CTM deltas: 10GB -#. (itstool) path: listitem/para -#: article.translate.xml:75 -msgid "CTM deltas: 10 GB" -msgstr "CTM deltas: 10 GB" - -#. (itstool) path: listitem/para -#: article.translate.xml:76 -msgid "Web pages: 1GB" -msgstr "網站: 1GB" - -#. (itstool) path: sect2/para -#: article.translate.xml:78 -msgid "The current disk usage of FTP Distribution can be found at ftp://ftp.FreeBSD.org/pub/FreeBSD/dir.sizes." -msgstr "目前 FTP Distribution 的磁碟使用可在 ftp://ftp.FreeBSD.org/pub/FreeBSD/dir.sizes 找到。" - -#. (itstool) path: sect2/title -#: article.translate.xml:84 -msgid "Network Connection/Bandwidth" -msgstr "網路連線/頻寬" - -#. (itstool) path: sect2/para -#: article.translate.xml:85 -msgid "Of course, you need to be connected to the Internet. The required bandwidth depends on your intended use of the mirror. If you just want to mirror some parts of FreeBSD for local use at your site/intranet, the demand may be much smaller than if you want to make the files publicly available. If you intend to become an official mirror, the bandwidth required will be even higher. We can only give rough estimates here:" -msgstr "當然,你一定要能連上 Internet。 頻寬需求多少,這要看你所想要的 mirror 程度而定。 若只想要 mirror 一部份的 FreeBSD 檔案以作為網站或 intranet 的局部用途, 那麼頻寬需求會明顯比成為公共服務用途的小一些。 若想成為 official mirror 之一的話,那麼頻寬就勢必得增加才夠用。以下,我們僅列出一些估計值以做為參考: " - -#. (itstool) path: listitem/para -#: article.translate.xml:96 -msgid "Local site, no public access: basically no minimum, but < 2 Mbps could make syncing too slow." -msgstr "本地站台,沒有要公共存取: 基本上沒有最低需求,但是 < 2Mbps 同步將會非常緩慢" - -#. (itstool) path: listitem/para -#: article.translate.xml:98 -msgid "Unofficial public site: 34 Mbps is probably a good start." -msgstr "非官方公共站台: 34Mbps 是不錯的開始." - -#. (itstool) path: listitem/para -#: article.translate.xml:99 -msgid "Official site: > 100 Mbps is recommended, and your host should be connected as close as possible to your border router." -msgstr "官方站台: > 100Mbps 是建議值,並且你的主機必須盡可能連接靠近邊界路由器." - -#. (itstool) path: sect2/title -#: article.translate.xml:104 -msgid "System Requirements, CPU, RAM" -msgstr "系統需求,CPU,RAM" - -#. (itstool) path: sect2/para -#: article.translate.xml:105 -msgid "One thing this depends on the expected number of clients, which is determined by the server's policy. It is also affected by the types of services you want to offer. Plain FTP or HTTP services may not require a huge amount of resources. Watch out if you provide rsync. This can have a huge impact on CPU and memory requirements as it is considered a memory hog. The following are just examples to give you a very rough hint." -msgstr "這取決於預期的客戶端數量,這是由伺服器的策略決定的。也會受到您提供的服務類型而影響.普通的 FTP 或 HTTP 服務可能不需要大量的資源。注意如果您提供rsync. 這可能會對 CPU 和記憶體的需求產生巨大的影響,因為會消耗大量記憶體。 以下只是給你一個非常粗略的的例子。" - -#. (itstool) path: sect2/para -#: article.translate.xml:117 -msgid "For a moderately visited site that offers rsync, you might consider a current CPU with around 800MHz - 1 GHz, and at least 512MB RAM. This is probably the minimum you want for an official site." -msgstr "針對一個較常被瀏覽的網站 rsync,您須考量處理器大約 800Mhz 至 1Ghz,並且安裝最少 512MB RAM,這或許是成為一個 官方 站台的最小需求." - -#. (itstool) path: sect2/para -#: article.translate.xml:125 -msgid "For a frequently used site you definitely need more RAM (consider 2GB as a good start) and possibly more CPU, which could also mean that you need to go for a SMP system." -msgstr "為了一個經常使用的網站你絕對需要更多 RAM (2GB是不錯的開始) 並且儘可能有更多 CPU , 這也表示你需要一個 SMP 系統。" - -#. (itstool) path: sect2/para -#: article.translate.xml:131 -msgid "You also want to consider a fast disk subsystem. Operations on the SVN repository require a fast disk subsystem (RAID is highly advised). A SCSI controller that has a cache of its own can also speed up things since most of these services incur a large number of small modifications to the disk." -msgstr "您也會需要考慮有一個較快的磁碟系統。在管理 SVN repository 需要一個快速的磁碟系統 ( 強烈建議 RAID)。有自己的快取記憶體的 SCSI 控制器也可以加快速度,因為大多數這些服務會對磁碟進行大量的小幅修改。" - -#. (itstool) path: sect2/title -#: article.translate.xml:141 -msgid "Services to offer" -msgstr "提供的服務" - -#. (itstool) path: sect2/para -#: article.translate.xml:142 -msgid "Every mirror site is required to have a set of core services available. In addition to these required services, there are a number of optional services that server administrators may choose to offer. This section explains which services you can provide and how to go about implementing them." -msgstr "每個鏡像站都需要一有一組可用的核心服務。除了這些所需的服務之外,還有許多伺服器管理員可以選擇提供的選用服務。本節將說明您可以提供哪些服務以及如何實作這些服務。" - -#. (itstool) path: sect3/title -#: article.translate.xml:150 -msgid "FTP (required for FTP fileset)" -msgstr "FTP (需要提供給FTP檔案集)" - -#. (itstool) path: sect3/para -#: article.translate.xml:151 -msgid "This is one of the most basic services, and it is required for each mirror offering public FTP distributions. FTP access must be anonymous, and no upload/download ratios are allowed (a ridiculous thing anyway). Upload capability is not required (and must never be allowed for the FreeBSD file space). Also the FreeBSD archive should be available under the path /pub/FreeBSD." -msgstr "這是最基本的服務之一。需要為每個鏡像站提供公共的 FTP distributions 。 FTP 存取必須是匿名的, 不允許上傳/下載比率 (這是一件荒謬的事),上傳功能不是必需的 (且必須 絕不允許 FreeBSD 檔案空間)。另外,FreeBSD archive 應該在路徑/pub/FreeBSD下。" - -#. (itstool) path: sect3/para -#: article.translate.xml:162 -msgid "There is a lot of software available which can be set up to allow anonymous FTP (in alphabetical order)." -msgstr "這裡有很多可用的軟體可以架設允許匿名的 FTP 服務 (按字母順序)。" - -#. (itstool) path: listitem/para -#: article.translate.xml:167 -msgid "/usr/libexec/ftpd: FreeBSD's own ftpd can be used. Be sure to read ftpd8." -msgstr "/usr/libexec/ftpd: FreeBSD 內建的 ftpd 可以使用。請您參閱 ftpd8。" - -#. (itstool) path: listitem/para -#: article.translate.xml:171 -msgid "ftp/ncftpd: A commercial package, free for educational use." -msgstr "ftp/ncftpd。一個商業軟體套件,免費供教育使用。" - -#. (itstool) path: listitem/para -#: article.translate.xml:175 -msgid "ftp/oftpd: An ftpd designed with security as a main focus." -msgstr "ftp/oftpd:一個以安全性作為主要考量的 ftpd。" - -#. (itstool) path: listitem/para -#: article.translate.xml:179 -msgid "ftp/proftpd: A modular and very flexible ftpd." -msgstr "ftp/proftpd:一個模組化且非常有彈性的 ftpd。" - -#. (itstool) path: listitem/para -#: article.translate.xml:182 -msgid "ftp/pure-ftpd: Another ftpd developed with security in mind." -msgstr "ftp/pure-ftpd: 另一個為安全所設計的 ftpd。" - -#. (itstool) path: listitem/para -#: article.translate.xml:185 -msgid "ftp/twoftpd: As above." -msgstr "ftp/twoftpd:如上。" - -#. (itstool) path: listitem/para -#: article.translate.xml:186 -msgid "ftp/vsftpd: The very secure ftpd." -msgstr "ftp/vsftpd非常安全的 ftpd。" - -#. (itstool) path: sect3/para -#: article.translate.xml:188 -msgid "FreeBSD's ftpd, proftpd and maybe ncftpd are among the most commonly used FTPds. The others do not have a large userbase among mirror sites. One thing to consider is that you may need flexibility in limiting how many simultaneous connections are allowed, thus limiting how much network bandwidth and system resources are consumed." -msgstr "FreeBSD 的 ftpdproftpd 和也許 ncftpd 是最常使用的 FTP 軟體。其他的在鏡像站並沒有大量用戶基礎。需要考慮的一件事情是,您可能需要性地來限制允許同時連線數,從而限制消耗多少網路頻寬和系統資源。" - -#. (itstool) path: sect3/title -#: article.translate.xml:198 -msgid "Rsync (optional for FTP fileset)" -msgstr "Rsync (給FTP檔案集選用)" - -#. (itstool) path: sect3/para -#: article.translate.xml:199 -msgid "Rsync is often offered for access to the contents of the FTP area of FreeBSD, so other mirror sites can use your system as their source. The protocol is different from FTP in many ways. It is much more bandwidth friendly, as only differences between files are transferred instead of whole files when they change. Rsync does require a significant amount of memory for each instance. The size depends on the size of the synced module in terms of the number of directories and files. Rsync can use rsh and ssh (now default) as a transport, or use its own protocol for stand-alone access (this is the preferred method for public rsync servers). Authentication, connection limits, and other restrictions may be applied. There is just one software package available:" -msgstr "Rsync 通常是用在存取 FreeBSD 系統中的FTP內容,其他的鏡像站可以使用你的系統當作他們的來源。這個協定和 FTP 有很多不同,它比較不那麼消耗頻寬,只有當比對檔案間有變動才傳輸檔案,而不是整個檔案傳完。Rsync 需要較多的記憶體。大小取決於檔案與目錄的數目及同步模組大小。Rsync 可以使用 rshssh (現在為預設)來傳輸, 或使用自己的協定單獨存取(這是公共rsync伺服器的首選方法)。可以用認證、連接限制和其他限制。只有一個軟體套件可以用:" - -#. (itstool) path: listitem/para -#: article.translate.xml:217 -msgid "net/rsync" -msgstr "net/rsync" - -#. (itstool) path: sect3/title -#: article.translate.xml:221 -msgid "HTTP (required for web pages, optional for FTP fileset)" -msgstr "HTTP(網頁需要,FTP 檔案集則是選用)" - -#. (itstool) path: sect3/para -#: article.translate.xml:222 -msgid "If you want to offer the FreeBSD web pages, you will need to install a web server. You may optionally offer the FTP fileset via HTTP. The choice of web server software is left up to the mirror administrator. Some of the most popular choices are:" -msgstr "如果您想提供 FreeBSD 的網頁,您需要安裝一個網頁伺服器。您可以選擇利用 HTTP 提供 FTP 檔案集。網頁伺服器軟體的選擇留給鏡像站管理員選擇。一些最受歡迎的選擇是:" - -#. (itstool) path: listitem/para -#: article.translate.xml:231 -msgid "www/apache22: Apache is the most widely deployed web server on the Internet. It is used extensively by the FreeBSD Project." -msgstr "www/apache22Apache 是網際網路上最廣泛使用的網頁伺服器。 它被 FreeBSD 計畫廣泛使用。" - -#. (itstool) path: listitem/para -#: article.translate.xml:238 -msgid "www/thttpd: If you are going to be serving a large amount of static content you may find that using an application such as thttpd is more efficient than Apache. It is optimized for excellent performance on FreeBSD." -msgstr "www/thttpd:如果您要提供大量的靜態內容,您可能會發現使用諸如 thttpd 之類的應用程式會比 Apache 更有效率。它針對 FreeBSD 的優秀性能進行了最佳化。" - -#. (itstool) path: listitem/para -#: article.translate.xml:246 -msgid "www/boa: Boa is another alternative to thttpd and Apache. It should provide considerably better performance than Apache for purely static content. It does not, at the time of this writing, contain the same set of optimizations for FreeBSD that are found in thttpd." -msgstr "www/boaBoathttpdApache 外的另一個選擇。對於純粹的靜態網頁,它應該會提供比 Apache 更好的性能。在寫這篇文章的時候,它並不包含像在 thttpd 中一樣針對FreeBSD 做最佳化。" - -#. (itstool) path: listitem/para -#: article.translate.xml:258 -msgid "www/nginx: Nginx is a high performance edge web server with a low memory footprint and key features to build a modern and efficient web infrastructure. Features include a HTTP server, HTTP and mail reverse proxy, caching, load balancing, compression, request throttling, connection multiplexing and reuse, SSL offload and HTTP media streaming." -msgstr "www/nginxNginx 是一款高性能的最新網頁服務器,具有低記憶體佔用量和關鍵特色,可以構建現代高效率網頁基礎架構,功能包括 HTTP 伺服器,HTTP 和郵件反向代理,快取,負載平衡,壓縮,請求限制(request throtting),連接多工與再利用,SSL 卸載和 HTTP 媒體串流。" - -#. (itstool) path: sect1/title -#: article.translate.xml:272 -msgid "How to Mirror FreeBSD" -msgstr "如何Mirror FreeBSD 站台" - -#. (itstool) path: sect1/para -#: article.translate.xml:273 -msgid "Ok, now you know the requirements and how to offer the services, but not how to get it. :-) This section explains how to actually mirror the various parts of FreeBSD, what tools to use, and where to mirror from." -msgstr "好,現在你知道硬體需求和如何提供服務,但不知道如何做。:-) 這節將解釋如何實際 mirror FreeBSD 的不同部分,使用哪些工具以及從哪裡 mirror。" - -#. (itstool) path: sect2/title -#: article.translate.xml:281 -msgid "Mirroring the FTP site" -msgstr "鏡像 FTP 站" - -#. (itstool) path: sect2/para -#: article.translate.xml:282 -msgid "The FTP area is the largest amount of data that needs to be mirrored. It includes the distribution sets required for network installation, the branches which are actually snapshots of checked-out source trees, the ISO Images to write CD-ROMs with the installation distribution, a live file system, and a snapshot of the ports tree. All of course for various FreeBSD versions, and various architectures." -msgstr "FTP 部份有最大量的資料需要被 mirror。它包括網路安裝所需的發布集,實際上是原始碼樹快照的分支,可燒錄光碟供安裝系統的ISO映像檔 ,一個可 live 開機的檔案系統,以及一個 port tree 的快照。當然,全都有各種 FreeBSD 版本和各種CPU架構。" - -#. (itstool) path: sect2/para -#: article.translate.xml:292 -msgid "The best way to mirror the FTP area is rsync. You can install the port net/rsync and then use rsync to sync with your upstream host. rsync is already mentioned in . Since rsync access is not required, your preferred upstream site may not allow it. You may need to hunt around a little bit to find a site that allows rsync access." -msgstr "" - -#. (itstool) path: note/para -#: article.translate.xml:303 -msgid "Since the number of rsync clients will have a significant impact on the server machine, most admins impose limitations on their server. For a mirror, you should ask the site maintainer you are syncing from about their policy, and maybe an exception for your host (since you are a mirror)." -msgstr "由於 rsync 客戶端的數量將對伺服器主機產生重大影響,因此大多數管理員會對伺服器負荷加以限制。對於 mirror 站台,您應該詢問您要 mirror 站台的管理人員他們的管理政策,也許需要對您的主機開放例外(因為您是一個 mirror 站)。" - -#. (itstool) path: sect2/para -#: article.translate.xml:312 -msgid "A command line to mirror FreeBSD might look like:" -msgstr "一個需要mirror FreeBSD官網的指令如下:" - -#. (itstool) path: sect2/screen -#: article.translate.xml:313 -#, no-wrap -msgid "% rsync -vaHz --delete rsync://ftp4.de.FreeBSD.org/FreeBSD/ /pub/FreeBSD/" -msgstr "% rsync -vaHz --delete rsync://ftp4.de.FreeBSD.org/FreeBSD/ /pub/FreeBSD/" - -# source text少了一個的標籤,多了一個不知道重不重要? -#. (itstool) path: sect2/para -#: article.translate.xml:314 -msgid "Consult the documentation for rsync, which is also available at http://rsync.samba.org/, about the various options to be used with rsync. If you sync the whole module (unlike subdirectories), be aware that the module-directory (here \"FreeBSD\") will not be created, so you cannot omit the target directory. Also you might want to set up a script framework that calls such a command via cron8." -msgstr "" - -#. (itstool) path: sect2/title -#: article.translate.xml:327 -msgid "Mirroring the WWW pages" -msgstr "Mirroring 網頁" - -#. (itstool) path: sect2/para -#: article.translate.xml:328 -msgid "The FreeBSD website should only be mirrored via rsync." -msgstr "FreeBSD 網站應只能透過rsync指令來mirror." - -#. (itstool) path: sect2/para -#: article.translate.xml:331 -msgid "A command line to mirror the FreeBSD web site might look like:" -msgstr "一個 mirror FreeBSD 網站的指令應該看起像這樣:" - -#. (itstool) path: sect2/screen -#: article.translate.xml:332 -#, no-wrap -msgid "% rsync -vaHz --delete rsync://bit0.us-west.freebsd.org/FreeBSD-www-data/ /usr/local/www/" -msgstr "% rsync -vaHz --delete rsync://bit0.us-west.freebsd.org/FreeBSD-www-data/ /usr/local/www/" - -#. (itstool) path: sect2/title -#: article.translate.xml:335 -msgid "Mirroring Packages" -msgstr "Mirroring 套件" - -#. (itstool) path: sect2/para -#: article.translate.xml:336 -msgid "Due to very high requirements of bandwidth, storage and adminstration the FreeBSD Project has decided not to allow public mirrors of packages. For sites with lots of machines, it might be advantagous to run a caching HTTP proxy for the pkg8 process. Alternatively specific packages and their dependencies can be fetched by running something like the following:" -msgstr "由於對頻寬,儲存空間和管理的要求非常高,FreeBSD 計畫決定不允許公眾 mirror 套件. 對於擁有大量伺服主機的網站,建議為 pkg8 使用 HTTP proxy 快取可能會有所幫助。或者,您可以使用以下指令獲得套件與相依套件:" - -#. (itstool) path: sect2/screen -#: article.translate.xml:343 -#, no-wrap -msgid "% pkg fetch -d -o /usr/local/mirror vim" -msgstr "% pkg fetch -d -o /usr/local/mirror vim" - -#. (itstool) path: sect2/para -#: article.translate.xml:345 -msgid "Once those packages have been fetched, the repository metadata must be generated by running:" -msgstr "一旦這些套件包被下載,就必須執行以下命令來產生套件庫數據:" - -#. (itstool) path: sect2/screen -#: article.translate.xml:347 -#, no-wrap -msgid "% pkg repo /usr/local/mirror" -msgstr "% pkg repo /usr/local/mirror" - -#. (itstool) path: sect2/para -#: article.translate.xml:349 -msgid "Once the packages have been fetched and the metadata for the repository has been generated, serve the packages up to the client machines via HTTP. For additional information see the man pages for pkg8, specifically the pkg-repo8 page." -msgstr "一旦套件被下載並且已經生成了套件庫的數據,就可以透過 HTTP 協定將套件提供給客戶端機器。有關更多訊息,請參閱 pkg8 的 man pages,特別是pkg-repo8 頁面。" - -#. (itstool) path: sect2/title -#: article.translate.xml:356 -msgid "How often should I mirror?" -msgstr "我多久應該mirror?" - -#. (itstool) path: sect2/para -#: article.translate.xml:357 -msgid "Every mirror should be updated at a minimum of once per day. Certainly a script with locking to prevent multiple runs happening at the same time will be needed to run from cron8. Since nearly every admin does this in their own way, specific instructions cannot be provided. It could work something like this:" -msgstr "" - -#. (itstool) path: step/para -#: article.translate.xml:367 -msgid "Put the command to run your mirroring application in a script. Use of a plain /bin/sh script is recommended." -msgstr "" - -#. (itstool) path: step/para -#: article.translate.xml:374 -msgid "Add some output redirections so diagnostic messages are logged to a file." -msgstr "" - -#. (itstool) path: step/para -#: article.translate.xml:380 -msgid "Test if your script works. Check the logs." -msgstr "" - -#. (itstool) path: step/para -#: article.translate.xml:385 -msgid "Use crontab1 to add the script to the appropriate user's crontab5. This should be a different user than what your FTP daemon runs as so that if file permissions inside your FTP area are not world-readable those files can not be accessed by anonymous FTP. This is used to stage releases — making sure all of the official mirror sites have all of the necessary release files on release day." -msgstr "" - -#. (itstool) path: sect2/para -#: article.translate.xml:397 -msgid "Here are some recommended schedules:" -msgstr "" - -#. (itstool) path: listitem/para -#: article.translate.xml:400 -msgid "FTP fileset: daily" -msgstr "" - -#. (itstool) path: listitem/para -#: article.translate.xml:401 -msgid "WWW pages: daily" -msgstr "" - -#. (itstool) path: sect1/title -#: article.translate.xml:406 -msgid "Where to mirror from" -msgstr "" - -#. (itstool) path: sect1/para -#: article.translate.xml:407 -msgid "This is an important issue. So this section will spend some effort to explain the backgrounds. We will say this several times: under no circumstances should you mirror from ftp.FreeBSD.org." -msgstr "" - -#. (itstool) path: sect2/title -#: article.translate.xml:414 -msgid "A few words about the organization" -msgstr "" - -#. (itstool) path: sect2/para -#: article.translate.xml:415 -msgid "Mirrors are organized by country. All official mirrors have a DNS entry of the form ftpN.CC.FreeBSD.org. CC (i.e. country code) is the top level domain (TLD) of the country where this mirror is located. N is a number, telling that the host would be the Nth mirror in that country. (Same applies to wwwN.CC.FreeBSD.org, etc.) There are mirrors with no CC part. These are the mirror sites that are very well connected and allow a large number of concurrent users. ftp.FreeBSD.org is actually two machines, one currently located in Denmark and the other in the United States. It is NOT a master site and should never be used to mirror from. Lots of online documentation leads interactiveusers to ftp.FreeBSD.org so automated mirroring systems should find a different machine to mirror from." -msgstr "" - -#. (itstool) path: sect2/para -#: article.translate.xml:438 -msgid "Additionally there exists a hierarchy of mirrors, which is described in terms of tiers. The master sites are not referred to but can be described as Tier-0. Mirrors that mirror from these sites can be considered Tier-1, mirrors of Tier-1-mirrors, are Tier-2, etc. Official sites are encouraged to be of a low tier, but the lower the tier the higher the requirements in terms as described in . Also access to low-tier-mirrors may be restricted, and access to master sites is definitely restricted. The tier-hierarchy is not reflected by DNS and generally not documented anywhere except for the master sites. However, official mirrors with low numbers like 1-4, are usually Tier-1 (this is just a rough hint, and there is no rule)." -msgstr "" - -#. (itstool) path: sect2/title -#: article.translate.xml:459 -msgid "Ok, but where should I get the stuff now?" -msgstr "" - -#. (itstool) path: sect2/para -#: article.translate.xml:460 -msgid "Under no circumstances should you mirror from ftp.FreeBSD.org. The short answer is: from the site that is closest to you in Internet terms, or gives you the fastest access." -msgstr "" - -#. (itstool) path: sect3/title -#: article.translate.xml:467 -msgid "I just want to mirror from somewhere!" -msgstr "" - -#. (itstool) path: sect3/para -#: article.translate.xml:468 -msgid "If you have no special intentions or requirements, the statement in applies. This means:" -msgstr "" - -#. (itstool) path: step/para -#: article.translate.xml:475 -msgid "Check for those which provide fastest access (number of hops, round-trip-times) and offer the services you intend to use (like rsync)." -msgstr "" - -#. (itstool) path: step/para -#: article.translate.xml:483 -msgid "Contact the administrators of your chosen site stating your request, and asking about their terms and policies." -msgstr "" - -#. (itstool) path: step/para -#: article.translate.xml:490 -msgid "Set up your mirror as described above." -msgstr "" - -#. (itstool) path: sect3/title -#: article.translate.xml:497 -msgid "I am an official mirror, what is the right site for me?" -msgstr "" - -#. (itstool) path: sect3/para -#: article.translate.xml:498 -msgid "In general the description in still applies. Of course you may want to put some weight on the fact that your upstream should be of a low tier. There are some other considerations about official mirrors that are described in ." -msgstr "" - -#. (itstool) path: sect3/title -#: article.translate.xml:508 -msgid "I want to access the master sites!" -msgstr "" - -#. (itstool) path: sect3/para -#: article.translate.xml:509 -msgid "If you have good reasons and good prerequisites, you may want and get access to one of the master sites. Access to these sites is generally restricted, and there are special policies for access. If you are already an official mirror, this certainly helps you getting access. In any other case make sure your country really needs another mirror. If it already has three or more, ask the zone administrator (hostmaster@CC.FreeBSD.org) or FreeBSD mirror sites mailing lists first." -msgstr "" - -#. (itstool) path: sect3/para -#: article.translate.xml:519 -msgid "Whoever helped you become, an official should have helped you gain access to an appropriate upstream host, either one of the master sites or a suitable Tier-1 site. If not, you can send email to mirror-admin@FreeBSD.org to request help with that." -msgstr "" - -#. (itstool) path: sect3/para -#: article.translate.xml:527 -msgid "There is one master site for the FTP fileset." -msgstr "" - -# ftp-master.FreeBSD.org -#. (itstool) path: sect4/title -#: article.translate.xml:531 -msgid "ftp-master.FreeBSD.org" -msgstr "" - -#. (itstool) path: sect4/para -#: article.translate.xml:532 -msgid "This is the master site for the FTP fileset." -msgstr "" - -# ftp-master.FreeBSD.org 提供 rsync 存取, 針對 FTP站點提供rsync -# . 請參閱 . -#. (itstool) path: sect4/para -#: article.translate.xml:535 -msgid "ftp-master.FreeBSD.org provides rsync access, in addition to FTP. Refer to ." -msgstr "" - -#. (itstool) path: sect4/para -#: article.translate.xml:541 -msgid "Mirrors are also encouraged to allow rsync access for the FTP contents, since they are Tier-1-mirrors." -msgstr "" - -#. (itstool) path: sect1/title -#: article.translate.xml:551 -msgid "Official Mirrors" -msgstr "" - -# 官方mirror站具有以下條件 -#. (itstool) path: sect1/para -#: article.translate.xml:552 -msgid "Official mirrors are mirrors that" -msgstr "" - -#. (itstool) path: listitem/para -#: article.translate.xml:556 -msgid "a) have a FreeBSD.org DNS entry (usually a CNAME)." -msgstr "" - -#. (itstool) path: listitem/para -#: article.translate.xml:562 -msgid "b) are listed as an official mirror in the FreeBSD documentation (like handbook)." -msgstr "" - -#. (itstool) path: sect1/para -#: article.translate.xml:569 -msgid "So far to distinguish official mirrors. Official mirrors are not necessarily Tier-1-mirrors. However you probably will not find a Tier-1-mirror, that is not also official." -msgstr "" - -#. (itstool) path: sect2/title -#: article.translate.xml:575 -msgid "Special Requirements for official (tier-1) mirrors" -msgstr "" - -#. (itstool) path: sect2/para -#: article.translate.xml:576 -msgid "It is not so easy to state requirements for all official mirrors, since the project is sort of tolerant here. It is more easy to say, what official tier-1 mirrors are required to. All other official mirrors can consider this a big should." -msgstr "" - -#. (itstool) path: sect2/para -#: article.translate.xml:583 -msgid "Tier-1 mirrors are required to:" -msgstr "" - -#. (itstool) path: listitem/para -#: article.translate.xml:586 -msgid "carry the complete fileset" -msgstr "" - -#. (itstool) path: listitem/para -#: article.translate.xml:587 -msgid "allow access to other mirror sites" -msgstr "" - -#. (itstool) path: listitem/para -#: article.translate.xml:588 -msgid "provide FTP and rsync access" -msgstr "" - -#. (itstool) path: sect2/para -#: article.translate.xml:592 -msgid "Furthermore, admins should be subscribed to the FreeBSD mirror sites mailing lists. See this link for details, how to subscribe." -msgstr "" - -#. (itstool) path: important/para -#: article.translate.xml:596 -msgid "It is very important for a hub administrator, especially Tier-1 hub admins, to check the release schedule for the next FreeBSD release. This is important because it will tell you when the next release is scheduled to come out, and thus giving you time to prepare for the big spike of traffic which follows it." -msgstr "" - -#. (itstool) path: important/para -#: article.translate.xml:603 -msgid "It is also important that hub administrators try to keep their mirrors as up-to-date as possible (again, even more crucial for Tier-1 mirrors). If Mirror1 does not update for a while, lower tier mirrors will begin to mirror old data from Mirror1 and thus begins a downward spiral... Keep your mirrors up to date!" -msgstr "" - -#. (itstool) path: sect2/title -#: article.translate.xml:612 -msgid "How to become official then?" -msgstr "" - -#. (itstool) path: sect2/para -#: article.translate.xml:668 -msgid "We are not accepting any new mirrors at this time." -msgstr "" - -#. (itstool) path: sect1/title -#: article.translate.xml:674 -msgid "Some statistics from mirror sites" -msgstr "" - -#. (itstool) path: sect1/para -#: article.translate.xml:675 -msgid "Here are links to the stat pages of your favorite mirrors (a.k.a. the only ones who feel like providing stats)." -msgstr "" - -#. (itstool) path: sect2/title -#: article.translate.xml:680 -msgid "FTP site statistics" -msgstr "" - -#. (itstool) path: listitem/para -#: article.translate.xml:683 -msgid "ftp.is.FreeBSD.org - hostmaster@is.FreeBSD.org - (Bandwidth) (FTP processes) (HTTP processes) " -msgstr "" - -# ftp2.ru.FreeBSD.org - mirror@macomnet.ru - (Bandwidth) (HTTP and FTP users) -#. (itstool) path: listitem/para -#: article.translate.xml:691 -msgid "ftp2.ru.FreeBSD.org - mirror@macomnet.ru - (Bandwidth) (HTTP and FTP users)" -msgstr "" diff --git a/zh_TW.UTF-8/articles/leap-seconds/Makefile b/zh_TW.UTF-8/articles/leap-seconds/Makefile deleted file mode 100644 index 890b94f26e..0000000000 --- a/zh_TW.UTF-8/articles/leap-seconds/Makefile +++ /dev/null @@ -1,19 +0,0 @@ -# -# $FreeBSD$ -# -# Article: Leap Seconds - -DOC?= article - -FORMATS?= html -WITH_ARTICLE_TOC?= YES - -INSTALL_COMPRESSED?= gz -INSTALL_ONLY_COMPRESSED?= - -SRCS= article.xml - -URL_RELPREFIX?= ../../../.. -DOC_PREFIX?= ${.CURDIR}/../../.. - -.include "${DOC_PREFIX}/share/mk/doc.project.mk" diff --git a/zh_TW.UTF-8/articles/leap-seconds/article.xml b/zh_TW.UTF-8/articles/leap-seconds/article.xml deleted file mode 100644 index 6ad9fd2e30..0000000000 --- a/zh_TW.UTF-8/articles/leap-seconds/article.xml +++ /dev/null @@ -1,64 +0,0 @@ - - -
- - - FreeBSD 對潤秒的支援 - - $FreeBSD$ - - - - 說明 - - 潤秒是為了同步地球自轉,與原子鐘所做的特定一秒的修正。本文描述FreeBSD 如何處理潤秒。 - - 本文寫作時,下一個潤秒會發生在2015年6月30日23:59:60 CST。下一次潤秒會發生在南北美洲和亞太地區的工作日。 - - 潤秒是由 IERSBulletin C所發表。 - - 標準的潤秒行為描述在RFC 7164.。也可見 time2posix3 - - - - FreeBSD預設的潤秒處理 - - 最簡單的處理潤秒方法使用FreeBSD預設的 POSIX 時間規則,並使用 NTP。如果 ntpd8 在執行,而且時間和上游正確處理潤秒的 NTP 伺服器同步,潤秒會使系統時間自動重複當天的最後一秒。不需要其他調整。 - - 如果上游的 NTP 伺服器無法正確地處理潤秒, ntpd8 會在錯誤的上游伺服器發現錯誤並跳一秒後,跟著把時間跳一秒。 - - 如果未使用 NTP ,將需要在潤秒過後,手動調整系統時鐘。 - - - - 警告 - - 潤秒的插入在全世界是在同一個瞬間: UTC 午夜。在日本,是在上午九點,在太平洋,是正午,在美洲,是傍晚,在歐洲,是晚上。 - - 我們相信和預期,如果提供正確和穩定的NTP 服務,FreeBSD會如設計地在這次潤秒正確運作,就像在之前遇到潤秒時一樣。 - - 然而我們要警告,實務上沒有應用程式曾經要求核心關於潤秒的事。我們的經驗是,如同設計,潤秒本質上是潤秒前一秒的重播,這對大部份應用程式設計師來說是意想不到的事。 - - 其他作業系統或電腦可能會或可能不會像FreeBSD用同樣方法處理潤秒,沒有正確和穩定NTP 服務的系統一點也不會知道潤秒的發生。 - - 電腦因為潤秒而當機並不是沒有聽聞,經驗上也顯示,有大量公用的NTP 伺服器沒有正確地處理和公告潤秒。 - - 請試著確定不會因為潤秒而發生任何可怕的事情。 - - - - 測試 - - 測試是否有使用潤秒是有可能的。由於 NTP的性質,測試可能要運作到潤秒前24小時。有些主要的參考時鐘來源只在潤秒前一個小時公告。詢問NTP行程: - - % ntpq -c 'rv 0 leap' - - 包含leap_add_sec 的輸出指出對於潤秒的支援。潤秒前24小時,或是潤秒已經過了,會顯示leap_none - - - - 結論 - - 實務上,FreeBSD 的潤秒通常不是個問題。我們希望這篇概述能幫助釐清預期會遇到什麼狀況,如何使潤秒事件進行的更順利。 - -
diff --git a/zh_TW.UTF-8/articles/leap-seconds/zh_TW.po b/zh_TW.UTF-8/articles/leap-seconds/zh_TW.po deleted file mode 100644 index 6be72337a7..0000000000 --- a/zh_TW.UTF-8/articles/leap-seconds/zh_TW.po +++ /dev/null @@ -1,239 +0,0 @@ -# $FreeBSD$ -msgid "" -msgstr "" -"Project-Id-Version: \n" -"POT-Creation-Date: 2015-11-10 08:43-0700\n" -"PO-Revision-Date: 2015-11-06 22:51+0800\n" -"Last-Translator: \n" -"Language-Team: \n" -"Language: zh_TW\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"X-Generator: Poedit 1.7.5\n" - -#. Put one translator per line, in the form NAME , YEAR1, YEAR2 -msgctxt "_" -msgid "translator-credits" -msgstr "translator-credits" - -#. (itstool) path: info/title -#: article.translate.xml:6 -msgid "FreeBSD Support for Leap Seconds" -msgstr "FreeBSD 對潤秒的支援" - -#. (itstool) path: info/pubdate -#: article.translate.xml:8 -msgid "" -"$FreeBSD: head/en_US.ISO8859-1/articles/leap-seconds/article.xml 46895 " -"2015-06-29 16:41:41Z wblock $" -msgstr "" -"$FreeBSD: head/en_US.ISO8859-1/articles/leap-seconds/article.xml 46895 " -"2015-06-29 16:41:41Z wblock $" - -#. (itstool) path: sect1/title -#: article.translate.xml:12 -msgid "Introduction" -msgstr "說明" - -#. (itstool) path: sect1/para -#: article.translate.xml:14 -msgid "" -"A leap second is an ad-hoc one-second correction to " -"synchronize atomic timescales with Earth rotation. This article describes " -"how FreeBSD interacts with leap seconds." -msgstr "" -"潤秒是為了同步地球自轉,與原子鐘所做的特定一秒的修正。本" -"文描述FreeBSD 如何處理潤秒。" - -#. (itstool) path: sect1/para -#: article.translate.xml:19 -msgid "" -"As of this writing, the next leap second will occur at 2015-Jun-30 23:59:60 " -"UTC. This leap second will occur during a business day for North and South " -"America and the Asia/Pacific region." -msgstr "" -"本文寫作時,下一個潤秒會發生在2015年6月30日23:59:60 CST。下一次潤秒會發生在南" -"北美洲和亞太地區的工作日。" - -#. (itstool) path: sect1/para -#: article.translate.xml:24 -msgid "" -"Leap seconds are announced by IERS on Bulletin C." -msgstr "" -"潤秒是由 IERSBulletin C所發表。" - -#. (itstool) path: sect1/para -#: article.translate.xml:28 -msgid "" -"Standard leap second behavior is described in RFC 7164. Also see " -"time2posix3." -msgstr "" -"標準的潤秒行為描述在RFC 7164.。也可見 " -"time2posix3。" - -#. (itstool) path: sect1/title -#: article.translate.xml:33 -msgid "Default Leap Second Handling on FreeBSD" -msgstr "FreeBSD預設的潤秒處理" - -#. (itstool) path: sect1/para -#: article.translate.xml:35 -msgid "" -"The easiest way to handle leap seconds is with the POSIX " -"time rules FreeBSD uses by default, combined with NTP. When ntpd8 is running and the " -"time is synchronized with upstream NTP servers that " -"handle leap seconds correctly, the leap second will cause the system time to " -"automatically repeat the last second of the day. No other adjustments are " -"necessary." -msgstr "" -"最簡單的處理潤秒方法使用FreeBSD預設的 POSIX 時間規則,並使" -"用 NTP。如果 " -"ntpd8 在執行,而且時間和上游正確處理潤秒的 NTP 伺" -"服器同步,潤秒會使系統時間自動重複當天的最後一秒。不需要其他調整。" - -#. (itstool) path: sect1/para -#: article.translate.xml:44 -msgid "" -"If the upstream NTP servers do not handle leap seconds " -"correctly, ntpd8 will step the time by one second after the errant " -"upstream server has noticed and stepped itself." -msgstr "" -"如果上游的 NTP 伺服器無法正確地處理潤秒, " -"ntpd8 會在錯誤的上游伺服器發現錯誤並跳一秒後,跟著把時間跳一秒。" - -#. (itstool) path: sect1/para -#: article.translate.xml:49 -msgid "" -"If NTP is not being used, manual adjustment of the system " -"clock will be required after the leap second has passed." -msgstr "" -"如果未使用 NTP ,將需要在潤秒過後,手動調整系統時鐘。" - -#. (itstool) path: sect1/title -#: article.translate.xml:55 -msgid "Cautions" -msgstr "警告" - -#. (itstool) path: sect1/para -#: article.translate.xml:57 -msgid "" -"Leap seconds are inserted at the same instant all over the world: " -"UTC midnight. In Japan that is mid-morning, in the " -"Pacific mid-day, in the Americas late afternoon, and in Europe at night." -msgstr "" -"潤秒的插入在全世界是在同一個瞬間: UTC 午夜。在日本,是在" -"上午九點,在太平洋,是正午,在美洲,是傍晚,在歐洲,是晚上。" - -#. (itstool) path: sect1/para -#: article.translate.xml:62 -msgid "" -"We believe and expect that FreeBSD, if provided correct and stable " -"NTP service, will work as designed during this leap " -"second, as it did during the previous ones." -msgstr "" -"我們相信和預期,如果提供正確和穩定的NTP 服務,FreeBSD會如" -"設計地在這次潤秒正確運作,就像在之前遇到潤秒時一樣。" - -#. (itstool) path: sect1/para -#: article.translate.xml:67 -msgid "" -"However, we caution that practically no applications have ever asked the " -"kernel about leap seconds. Our experience is that, as designed, leap seconds " -"are essentially a replay of the second before the leap second, and this is a " -"surprise to most application programmers." -msgstr "" -"然而我們要警告,實務上沒有應用程式曾經要求核心關於潤秒的事。我們的經驗是,如" -"同設計,潤秒本質上是潤秒前一秒的重播,這對大部份應用程式設計師來說是意想不到" -"的事。" - -#. (itstool) path: sect1/para -#: article.translate.xml:73 -msgid "" -"Other operating systems and other computers may or may not handle the leap-" -"second the same way as FreeBSD, and systems without correct and stable " -"NTP service will not know anything about leap seconds at " -"all." -msgstr "" -"其他作業系統或電腦可能會或可能不會像FreeBSD用同樣方法處理潤秒,沒有正確和穩定" -"NTP 服務的系統一點也不會知道潤秒的發生。" - -#. (itstool) path: sect1/para -#: article.translate.xml:78 -msgid "" -"It is not unheard of for computers to crash because of leap seconds, and " -"experience has shown that a large fraction of all public NTP servers might handle and announce the leap second incorrectly." -msgstr "" -"電腦因為潤秒而當機並不是沒有聽聞,經驗上也顯示,有大量公用的NTP 伺服器沒有正確地處理和公告潤秒。" - -#. (itstool) path: sect1/para -#: article.translate.xml:83 -msgid "" -"Please try to make sure nothing horrible happens because of the leap second." -msgstr "請試著確定不會因為潤秒而發生任何可怕的事情。" - -#. (itstool) path: sect1/title -#: article.translate.xml:88 -msgid "Testing" -msgstr "測試" - -#. (itstool) path: sect1/para -#: article.translate.xml:90 -msgid "" -"It is possible to test whether a leap second will be used. Due to the nature " -"of NTP, the test might work up to 24 hours before the " -"leap second. Some major reference clock sources only announce leap seconds " -"one hour ahead of the event. Query the NTP daemon:" -msgstr "" -"測試是否有使用潤秒是有可能的。由於 NTP的性質,測試可能要運" -"作到潤秒前24小時。有些主要的參考時鐘來源只在潤秒前一個小時公告。詢問" -"NTP行程:" - -#. (itstool) path: sect1/screen -#: article.translate.xml:96 -#, no-wrap -msgid "% ntpq -c 'rv 0 leap'" -msgstr "% ntpq -c 'rv 0 leap'" - -#. (itstool) path: sect1/para -#: article.translate.xml:98 -msgid "" -"Output that includes leap_add_sec indicates proper " -"support of the leap second. Before the 24 hours leading up to the leap " -"second, or after the leap second has passed, leap_none " -"will be shown." -msgstr "" -"包含leap_add_sec 的輸出指出對於潤秒的支援。潤秒前24小時," -"或是潤秒已經過了,會顯示leap_none。" - -#. (itstool) path: sect1/title -#: article.translate.xml:105 -msgid "Conclusion" -msgstr "結論" - -#. (itstool) path: sect1/para -#: article.translate.xml:107 -msgid "" -"In practice, leap seconds are usually not a problem on FreeBSD. We hope that " -"this overview helps clarify what to expect and how to make the leap second " -"event proceed more smoothly." -msgstr "" -"實務上,FreeBSD 的潤秒通常不是個問題。我們希望這篇概述能幫助釐清預期會遇到什" -"麼狀況,如何使潤秒事件進行的更順利。" diff --git a/zh_TW.UTF-8/articles/mailing-list-faq/Makefile b/zh_TW.UTF-8/articles/mailing-list-faq/Makefile deleted file mode 100644 index 53a873470a..0000000000 --- a/zh_TW.UTF-8/articles/mailing-list-faq/Makefile +++ /dev/null @@ -1,26 +0,0 @@ -# -# $FreeBSD$ -# -# Article: Frequently Asked Questions About The FreeBSD Mailing Lists - -DOC?= article - -FORMATS?= html - -INSTALL_COMPRESSED?=gz -INSTALL_ONLY_COMPRESSED?= - -WITH_ARTICLE_TOC?=YES - -# -# SRCS lists the individual XML files that make up the document. Changes -# to any of these files will force a rebuild -# - -# XML content -SRCS= article.xml - -URL_RELPREFIX?= ../../../.. -DOC_PREFIX?= ${.CURDIR}/../../.. - -.include "${DOC_PREFIX}/share/mk/doc.project.mk" diff --git a/zh_TW.UTF-8/articles/mailing-list-faq/article.xml b/zh_TW.UTF-8/articles/mailing-list-faq/article.xml deleted file mode 100644 index d85000e6e7..0000000000 --- a/zh_TW.UTF-8/articles/mailing-list-faq/article.xml +++ /dev/null @@ -1,416 +0,0 @@ - - - - - - - -
- &os; Mailing Lists 常見問答集 - - - - The &os; Documentation Project - - - - 2004 - 2005 - 2006 - &os; 文件計畫 - - - $FreeBSD$ - - $FreeBSD$ - - - 這是有關 &os; mailing lists 的 FAQ。如果您對協助本文件/翻譯計畫 - 的進行有興趣的話,請寄 e-mail 到 - &a.doc;。此外,隨時可從 - FreeBSD 網站 拿到這份文件的最新版本。 - 也可以利用 HTTP 來下載 HTML - 文件,或是經由 - FreeBSD FTP 站 下載純文字、&postscript;、或 PDF 版本的檔案。 - 您也可以在這裡使用 - 搜尋 FAQ 資料 - 的功能。 - - - - - 前言 - - 如同其他 FAQs 一樣,本文主要目的是希望涵蓋在 &os; mailing - lists 上面的常見問題(當然,包括答案)。 - 雖然,原本構想是希望能降低這些重複問題的網路流量,但如今已被公認 FAQs 也是相當好用的資源之一。 - - 本文主要是描述社群之間所培養的一些禮儀(或默契),但本文本身並非『聖旨』般的權威。 - 若發現本文內有任何技術瑕疵,或者是想建議可以增加哪些部分的話,請送 PR,或是 email 到 &a.doc;。謝囉! - - - - - &os; mailing lists 的目的為何? - - - - &os; mailing lists 主要是提供 &os; 社群間的溝通管道,這裡有各式專題領域的探討,以及興趣交流。 - - - - - - &os; mailing lists 的參與者有哪些? - - - - 這個問題,要看各個 list 的『版規(charter)』定位而有所不同。有些 lists 主要是 developers 在參與討論的; - 而有些則主要是幾乎整體 &os; 社群都可以隨意參與討論的。請看 這份清單 上面有目前所有 list 的摘要說明。 - - - - - - &os; mailing lists 對任何人都是開放參與的嗎? - - - - 再重複一次,這要看各個 list 的『版規(charter)』定位而有所不同。 - 請在發文前,先注意閱讀該 list 的『版規(charter)』,並遵守相關原則。 - 如此一來,才會讓大家都能溝通更無礙。 - - 如果看了上一個問答內的清單之後,還是不清楚要到哪個 list 去發問的話, - 那麼可以試著把問題丟到 freebsd-questions 看看(但請先看下面講的補充)。 - - 請注意:習慣上所有 mailing lists 都是開放發表討論的,也不必得先成為訂閱會員才行。 - 這是相當審慎的選擇,來讓參與 &os; 社群更輕鬆容易,並鼓勵互相分享彼此的想法。 - 然而,由於過去有些人的濫用,有些 lists 現在開始限制參與討論的部分,以避免不必要的困擾。 - - - - - - 要怎麼訂閱呢? - - - - 可以用 - Mailman 網頁介面 來訂閱任何公開的 lists。 - - - - - - 要怎麼退訂? - - - - 一樣請用剛上面說的網頁介面,或者 mailing list 上面每封信結尾處都會有相關 URL 連結的指示說明。 - - 千萬請不要直接寫信到這些公開的 mailing lists 說你要退訂。 - 首先呢..因為本來就不是這樣退訂的,其次你會惹來眾怒而招來圍剿、筆戰。 - 這是很典型的退訂錯誤示範,請不要這樣做。 - - - - - - 可以找到舊信的資料庫嗎? - - - - 嗯,有!可以在 這邊 - 找到相關的舊信資料庫(archive)。 - - - - - - mailing lists 可有摘要版呢? - - - - 當然也有,請看 - Mailman 網頁介面。 - - - - - - - Mailing List 的參與禮儀 - - 在 mailing lists 上參與討論,就像在其他社群一樣,我們都需要一些溝通上的共識。 - 發言請注重禮儀(或默契),切勿無的放矢。 - - - - - 在發文之前,有什麼注意事項呢? - - - - 最重要的是你已經看了這篇文章,然而,若您對 &os; 不熟的話, - 可能需要先廣泛閱讀 - 相關書籍及文章 - 來先熟悉這套作業系統和一些典故,尤其是其中的 - &os; 常見問答集 (FAQ) 文件, - - &os; 使用手冊(Handbook), - 以及相關文章: - How to get best results from the FreeBSD-questions mailing list、 - - Explaining BSD、以及 - &os; First Steps。 - - 此外,對上述文件內已有解答的部份又提出來問的話,會被認為是相當不禮貌的。 - 這並不是因為這群志工是相當吝於回答的,而是一再被相同的問題不斷疲勞轟炸之後,所產生的挫折感很重。 - 尤其是現成答案明明就在眼前,卻仍同樣問題滿天飛,這實在是...。 - 請注意:這些 &os; 相關文件幾乎都是由一群無薪志工的好心成果,而他們也是人。 - - - - - - - 如何避免不當發文呢? - - - - - - 發文時,請務必遵守該 mailing list 的遊戲規則。 - - - - 不要作人身攻擊。好的網路公民,應該要有更高的言行標準。 - - - - 請不要試圖作 Spam 行為(廣告、轉貼多處等不請自來行為)。 - 所有 mailing lists 都會積極禁止這些違規者,一旦有的話,那麼後果請自行負責。 - - - - - - - - 發文時,有什麼該注意的嗎? - - - - - - 發文時,請保持一行約 75 個字元就自動斷行,因為並不是每個看的人都有很炫的圖形介面(GUI)看信軟體。 - - - - 請注意:事實上,網路頻寬並不是無限的。 - 並非每個讀者的頻寬都很大,所以若想貼一些像是 config.log - 之類的設定檔內容,或是大量的 stack trace 紀錄,那麼請把它放在自己網站上,然後貼出該網址 URL 就行了。 - 還有一件事,請記住,這些信件都會被舊信資料庫保存下來,所以這樣作會造成保存的資料庫會很快被塞到很大, - 甚至可能塞爆 Server 的硬碟空間。 - - - - 文章是要讓人看得懂,所以請注意版面編排的可讀性,還有.. - 千 萬 不 要 大 聲 嚷 叫!!!!! 這點可不只 &os; mailing lists 才需如此注意, - 請勿低估文章『基本編排』的重要性、連鎖效應。 - 信中的表達方式通常就代表著別人眼中的你,若文章讓人看了很吃力(霧煞煞)、拼字錯誤百出、 - 充滿語意或邏輯錯誤、或是文內充滿一堆驚嘆號,這會讓人對你印象觀感極差。 - - - - 在一些特定的 list 場合,請用適當的語言來溝通。許多非英語系的mailing - lists 可以到 - - 這邊 查看看。 - - 對於許多母語不是英語的人,我們都能諒解他們的苦楚,並且試著儘量多多包涵。 - 英文非母語的人,我們會儘量不惡意批評拼字或文法錯誤之處。 - &os; 在這方面,一直有相當優秀的紀錄,請讓我們繼續保持這傳統吧。 - - - - 寫信時,請用相容標準的 Mail User Agent (MUA)程式。 - 不良的(或設定錯誤的)寄信程式 - 這裡列有許多信件格式的錯誤示範。以下是一些已知的寄信程式的不良示範: - - - - cc:Mail - - - - (舊版的)&eudora; - - - - exmh - - - - µsoft; Exchange - - - - µsoft; Internet Mail - - - - µsoft; &outlook; - - - - (舊版的)&netscape; - - - - 如同上述所見,Microsoft 出的一堆寄信程式通常都是不相容標準格式的。 - 請儘量改用 &unix; 上的寄信程式。若必須在 Microsoft 環境下使用寄信程式的話, - 請記得確認設定是否正確。請儘量不要用 MIME 格式: - 因為有一堆人都在濫用 MIME 信件格式。 - - - - 請確認:時間與時區設定是否正確。 - 這問題看起來有點蠢,因為你寄出的信還是會到達 mailing list 上, - 但是呢,每位 mailing lists 上的訂戶每天都會看數百封的信, - 他們通常會把信件以標題跟時間作為排序依據。 - 若你的信沒有在第一篇正解之前就先出現的話,他們就會假設可能是漏收你這封信, - 然後就沒再去看你那封信了。 - - - - 請提供程式出現的相關訊息,像是 &man.dmesg.8; 或者 console - messages 也就是通常會出現在 /var/log/messages 出現的。 - 請不要用手打,因為這不僅很苦,而且也可能打錯字或亂掉原有格式。請直接把相關的 log 檔丟出來, - 或是用編輯器來剪裁、或是用滑鼠複製/貼上來完成。舉個例子,如果是要把像是 dmesg - 的程式訊息倒入到某個檔案去的話,那麼作法如下: - - &prompt.user; dmesg > /tmp/dmesg.out - - 這樣子會把訊息送到 /tmp/dmesg.out 檔內。 - - - - 在用滑鼠剪貼時,請注意是否有犯一些細節的剪貼壞習慣。 - 尤其是像貼 Makefiles 之類檔案時,由於 tab - 鍵所打出來的分格,是屬於特殊字元。因此,在 - GNATS PR 資料庫 上很常看到這類很常見的惱人問題: - Makefiles 內的 tab 經過剪貼後,變成『空白(white space)』 - 或是困擾的 =3B escape sequence,這些會讓 committers 們十分不爽。 - - - - - - - - 在 mailing lists 上回文的話,有什麼要特別注意的嗎? - - - - - - 請適當調整文章引言長度。回文時,引言部份請引『有談到的』部分為主,但請不要過與不及。 - 應該保留涉及討論範圍的原文,這樣子才能讓沒看過前面文章的人知道是在講什麼,而非一頭霧水。 - - 還有一點也很重要,原文若是幅度相當長的話,記得註明 "yes, I see this too"。 - - - - 善用技巧來確認原文與自己寫的部份: - 通常會在原文的每行前面加上 > 以作記號。 - 請記得保留 > 符號後面的空白,並且在原文以及你所寫的段落之間加上空行, - 以便閱讀。 - - - - 請不要斷章取義、穿鑿附會:通常對原始文章『斷章取義』、『穿鑿附會』會讓大家很不爽,因為他們原意並非如此,卻被曲解。 - - - - 回文時,不要寫在原文上面(top post)。 - 這個意思是:若要回文時,請寫在原文下方,不要寫在原文上面,以免讓人有時空錯置的錯亂混淆。 - - - - 答: Because it reverses the logical flow of - conversation. - - - 問: Why is top posting frowned upon? - - - (感謝 Randy Bush 提供笑話) - - - - - - - - - Mailing Lists 上的重複性問題 - - 在 mailing lists 上參與討論,就像在其他社群一樣,我們都需要一些溝通上的共識。 - 許多 mailing lists 都會假設參與討論者都大致知道 FreeBSD 計劃的一些歷史淵源。 - 尤其是社群的新手總是定期會不斷重複問類似問題。 - 每個發文的人,都有責任來避免掉入這樣的惡性循環輪迴內。 - 因此,應儘可能讓 mailing list 上能正常討論,而避免讓自己陷入筆戰泥沼。 - - 要怎麼避免呢?最好的方法就是善用這些 - mailing list 舊信資料庫(archives),來瞭解相關背景。 - 正由於這原因,所以 - mailing list 搜尋介面 就顯得非常好用。 - (若這方法仍無法找到有用的答案,那麼請改用自己愛用的搜尋引擎吧) - - 透過這些舊信資料庫,不只可瞭解先前討論過哪些話題,也可以知道:是怎麼討論的、 - 哪些人參與討論過、主要看的人又是哪些人。 - 入境隨俗這些原則不只是 &os; mailing list 上才這樣,一樣可以適合其他地方。 - - archives 的內容無疑地相當廣泛,而且會有些問題不斷反覆出現, - 有時討論到後面總會離題。無論如何,在發問前的義務就是先做好功課, - 以避免這類的月經文惡性循環,尤其是令人反感的 bikeshed(打嘴砲) - - - - 什麼是 "Bikeshed" 呀? - 單就字面上意思解釋的話,bikeshed 是指專門給腳踏車、機車之類的兩輪交通工具使用的遮雨棚, - 然而呢,在 &os; 這邊的說法卻有其他意思(帶有貶抑)指的是: - 某些特定話題的重複討論,尤其是指在 &os; 社群內絕不會有共識,且有爭議的話題。 - (這字彙的起源在 - 這份文件 內有更多說明)。你只要在發信到任一 &os; mailing lists 之前,知道這個基本概念就行了。 - - 一般來講,『bikeshed』是很容易產生許多波的筆戰與額外討論的爭議話題,如果事先不知道這些背景的話。 - - 拜託,請幫個忙讓討論回歸正常,而不要只是到處打嘴砲而已。感恩! - - - - 致謝 - - - - &a.grog; - - - How to get best results from the FreeBSD-questions mailing list 一文的原作者, - 我們從他這文內獲得許多 mailing list 上的禮儀(或默契)寫作題材。 - - - - - &a.linimon; - - 本 FAQ 雛形的原作 - - - - - -
diff --git a/zh_TW.UTF-8/articles/nanobsd/Makefile b/zh_TW.UTF-8/articles/nanobsd/Makefile deleted file mode 100644 index 38de994f6c..0000000000 --- a/zh_TW.UTF-8/articles/nanobsd/Makefile +++ /dev/null @@ -1,28 +0,0 @@ -# -# The FreeBSD Traditional Chinese Project -# -# Original Revision: 1.2 -# $FreeBSD$ -# -# Article: Introduction to NanoBSD - -DOC?= article - -FORMATS?= html -WITH_ARTICLE_TOC?= YES - -INSTALL_COMPRESSED?= gz -INSTALL_ONLY_COMPRESSED?= - -# Images from the cross-document image library -IMAGES_LIB= callouts/1.png -IMAGES_LIB+= callouts/2.png -IMAGES_LIB+= callouts/3.png -IMAGES_LIB+= callouts/4.png - -SRCS= article.xml - -URL_RELPREFIX?= ../../../.. -DOC_PREFIX?= ${.CURDIR}/../../.. - -.include "${DOC_PREFIX}/share/mk/doc.project.mk" diff --git a/zh_TW.UTF-8/articles/nanobsd/article.xml b/zh_TW.UTF-8/articles/nanobsd/article.xml deleted file mode 100644 index 44702eb5df..0000000000 --- a/zh_TW.UTF-8/articles/nanobsd/article.xml +++ /dev/null @@ -1,434 +0,0 @@ - - - -
- NanoBSD 簡介 - - - - DanielGerzo - - - - 2006 - The FreeBSD Documentation Project - - - $FreeBSD$ - - $FreeBSD$ - - - &tm-attrib.freebsd; - &tm-attrib.general; - - - - 這篇文件提供了關於 NanoBSD 工具的情報介紹, - 這工具可用來建立用於嵌入式環境應用程式的 &os; 系統映像檔, - 以便存放到 Compact Flash 卡(或隨身碟)。 - - - - - NanoBSD 簡介 - - NanoBSD - - NanoBSD 是 &a.phk; 目前正在開發的一項工具。 - 它可用來建立用於嵌入式環境應用程式的 &os; 系統映像檔, - 以便存放到 Compact Flash 卡(或隨身碟,mass storage medium)。 - - 這一工具也可以用來自製安裝映像檔, - 以簡化俗稱為 嵌入式系統(computer appliances) 的系統安裝、維護工作。 - 通常,每個嵌入式系統產品都有限定硬體和軟體, - 或者換言之,所有的應用程式都是預先裝好的。 - 這些設備可以直接放到現有的網路中,而且(幾乎是)立即使用。 - - NanoBSD 提供的功能包括: - - - - 可以和 &os; 一樣使用 Ports 和 Packages — - 所有的應用程序都可以在 NanoBSD 中直接使用, - 而方式與 &os; 完全一樣。 - - - - 功能絲毫未損 — 在 &os; 做的任何工作,都可以在 - NanoBSD 中使用, - 除非您在建立 NanoBSD 映像檔時, - 有指定要拿掉它們。 - - - - 所有東西在運行時都是唯讀的 — 可以安全地拔掉電源插頭。 - 系統不正常關機的話,不用再跑 &man.fsck.8; 了。 - - - - 可輕鬆編譯、自行打造 — 只需使用一個 shell script 和一個設定檔, - 您可以輕鬆依需求來量身訂做適用的映像檔。 - - - - - - 如何使用 NanoBSD - - - NanoBSD 的設計 - - 一旦將映像檔存入嵌入式硬體,就可以用它來引導 NanoBSD - 了。 預設情況下,隨身碟會劃分為三部分: - - - - 兩個映像檔分割區: code#1 - 和 code#2 - - - - 一個設定檔分割區,在運行環境中, - 可以將其掛載(mount)到 /cfg 目錄下。 - - - - 這些分割區,在預設情況下是以唯讀方式掛載。 - - /etc 和 - /var 目錄均為 - &man.md.4;(malloc)磁碟。 - - 設定檔的分割區則是在 - /cfg 目錄。 - 它包含了用於 /etc - 目錄的檔案,在啟動之後暫時以唯讀方式掛載。 因此,若想要重開機保留新的設定, - 那麼要記得從 /etc 把改過的檔案複製回 - /cfg 目錄才行。 - - - 把修改過 <filename>/etc/resolv.conf</filename> 設定保存起來 - - &prompt.root; vi /etc/resolv.conf -[...] -&prompt.root; mount /cfg -&prompt.root; cp /etc/resolv.conf /cfg -&prompt.root; umount /cfg - - - - 只有在系統啟動過程中,以及需要修改設定檔的時候,才需要掛載含有 - /cfg 的那個分割區。 - - 一直都掛載 /cfg - 不是一個好主意,特別是當您把 NanoBSD - 放在不適合進行大量寫入動作的分割區時 - (比如:由於檔案系統的同步化會定期在系統碟內寫入資料)。 - - - - - 打造 NanoBSD 映像檔 - - NanoBSD 映像檔是透過使用非常簡單的 - nanobsd.sh shell script 來打造的,這個 script 可以在 - /usr/src/tools/tools/nanobsd - 目錄中找到。 這個 script 建立的映像檔,可以用 &man.dd.1; 工具來複製到隨身碟上。 - - 打造 - NanoBSD 映像檔所需的指令是: - - &prompt.root; cd /usr/src/tools/tools/nanobsd -&prompt.root; sh nanobsd.sh -&prompt.root; cd /usr/obj/nanobsd.full -&prompt.root; dd if=_.disk.full of=/dev/da0 bs=64k - - - - 進入 NanoBSD 打造 script 的主目錄。 - - - - 開始打造過程。 - - - - 進入打造好的映像檔所在的目錄。 - - - - 在隨身碟上安裝 NanoBSD - - - - - - 自行打造 NanoBSD 映像檔 - - 這可能是 NanoBSD 最為重要, - 同時也是您最感興趣的功能。 同時,在開發 - NanoBSD 應用程式時,這也是相當耗時的過程。 - - 執行下面的指令將會 - nanobsd.sh 讀取目前所在目錄的 - myconf.nano 檔的設定: - - &prompt.root; sh nanobsd.sh -c myconf.nano - - 自行打造的流程,只需兩個步驟: - - - - 自訂選項 - - - - 自訂功能 - - - - - 自訂選項 - - 透過修改設定,可以設定用於 - NanoBSD 打造過程中 buildworld - 和 installworld 階段的編譯、安裝選項,以及 - NanoBSD 主要打造過程中的選項。 - 透過使用這些選項可以削減系統的尺寸,使之能夠放入 - 64 MB 的隨身碟。 您還可以進一步透過這些選項來削減 &os;, - 直到它只包含 kernel 以及兩三個 userland 檔案為止。 - - 設定檔案中包含用以代替預設值的設定選項。簡介最重要的幾項設定如下: - - - - NANO_NAME — 本次打造的名稱(所建立工作目錄的名稱)。 - - - - NANO_SRC — 用以編譯、打造映像檔的 source tree 的位置。 - - - - NANO_KERNEL — 設定用來編譯的 kernel 設定檔檔名。 - - - - CONF_BUILD — 用於 - buildworld 打造階段的選項。 - - - - CONF_INSTALL — 用於 - installworld 打造階段的選項。 - - - - CONF_WORLD — 用於 - buildworld 和 - installworld 這兩個打造階段的選項。 - - - - FlashDevice — 定義所用的嵌入式硬體類型。 - 詳情請參考 FlashDevice.sub 檔。 - - - - - - 自訂功能 - - 透過在設定檔案中使用 shell 函數,可以進一步微調 - NanoBSD。 舉例說明一下自行打造函數的基本方式: - - cust_foo()( - echo "bar=topless" > \ - ${NANO_WORLDDIR}/etc/foo -) -customize_cmd cust_foo - - 下面舉更實際點的例子,它會把預設的 - /etc 目錄大小,從 5MB 調整為 30MB: - - cust_etc_size()( - cd ${NANO_WORLDDIR}/conf - echo 30000 > default/etc/md_size -) -customize_cmd cust_etc_size - - 除此之外,還有幾個預設的功能定義可以用來自訂: - - - - cust_comconsole — 在預設 VGA 顯示卡上停用 &man.getty.8; - (/dev/ttyv*)並啟用 serial port 的 COM1 以作為系統 console。 - - - - cust_allow_ssh_root — 允許 &man.sshd.8; - 可以用 root 帳號登入。 - - - - cust_install_files — - 從 nanobsd/Files - 目錄中安裝檔案,這包含一些實用的系統管理 script 。 - - - - - - 設定檔案舉例 - - 下面是用於自行打造的 NanoBSD 映像檔的完整例子: - - NANO_NAME=custom -NANO_SRC=/usr/src -NANO_KERNEL=MYKERNEL -NANO_IMAGES=2 - -CONF_BUILD=' -NO_KLDLOAD=YES -NO_NETGRAPH=YES -NO_PAM=YES -' - -CONF_INSTALL=' -NO_ACPI=YES -NO_BLUETOOTH=YES -NO_CVS=YES -NO_FORTRAN=YES -NO_HTML=YES -NO_LPR=YES -NO_MAN=YES -NO_SENDMAIL=YES -NO_SHAREDOCS=YES -NO_EXAMPLES=YES -NO_INSTALLLIB=YES -NO_CALENDAR=YES -NO_MISC=YES -NO_SHARE=YES -' - -CONF_WORLD=' -NO_BIND=YES -NO_MODULES=YES -NO_KERBEROS=YES -NO_GAMES=YES -NO_RESCUE=YES -NO_LOCALES=YES -NO_SYSCONS=YES -NO_INFO=YES -' - -FlashDevice SanDisk 1G - -cust_nobeastie()( - touch ${NANO_WORLDDIR}/boot/loader.conf - echo "beastie_disable=\"YES\"" >> ${NANO_WORLDDIR}/boot/loader.conf -) - -customize_cmd cust_comconsole -customize_cmd cust_install_files -customize_cmd cust_allow_ssh_root -customize_cmd cust_nobeastie - - - - - 更新 NanoBSD - - 更新 NanoBSD 相對 &os; 而言較為簡單: - - - - 和之前一樣打造新的 NanoBSD 映像檔。 - - - - 將新的映像檔放入正運行的 - NanoBSD 中未用的分割區之一。 - - 與之前最初安裝 NanoBSD 的步驟相比, - 這一步驟最重要的區別在於:這次不用 _.disk.full 檔(它包含整個磁碟的映像檔), - 而應安裝 _.disk.image 映像檔(這個檔案中,只包含一個系統分割區)。 - - - - 重新啟動,並從新安裝的分割區中啟動系統。 - - - - 如果一切順利的話,升級工作就完成了。 - - - - 如果發生了任何問題,則可以從先前的分割區啟動 - (其中包含了舊的、 可用的映像檔),來盡快恢復系統功能。 - 接下來可以修正新編譯的版本中存在的問題,並重複前述步驟。 - - - - 要在正在運行的 - NanoBSD 系統中安裝新的映像檔,可以使用位於 - /root 目錄的 - updatep1 或 - updatep2 script , - 實際上要用哪一個 script,則取決於正在運行的系統是位於哪個分割區而定。 - - 隨時提供新 NanoBSD 映像檔所提供的服務, - 以及採用的傳輸方法的不同,您可以參考並使用下列三種方式之一: - - - 使用 &man.ftp.1; - - 如果傳輸速度是第一要求的話,請採用下面例子: - - &prompt.root; ftp myhost -get _.disk.image "| sh updatep1" - - - - 使用 &man.ssh.1; - - 如果想更安全的話,應參考下面例子: - - &prompt.root; ssh myhost cat _.disk.image.gz | zcat | sh updatep1 - - - - 使用 &man.nc.1; - - 如果遠程主機既不提供 &man.ftp.1; 服務,也不提供 &man.sshd.8; 服務的話: - - - - 首先,在提供映像檔的主機上開啟 TCP listen,並讓它把映像檔傳給 client: - - myhost&prompt.root; nc -l 2222 < _.disk.image - - - 請確認您所使用的 port 沒有被防火牆阻止來自 - NanoBSD client 的連線請求。 - - - - 連到提供新映像檔服務的主機,並執行 updatep1 這支 script: - - &prompt.root; nc myhost 2222 | sh updatep1 - - - - - - - -
diff --git a/zh_TW.UTF-8/articles/pr-guidelines/Makefile b/zh_TW.UTF-8/articles/pr-guidelines/Makefile deleted file mode 100644 index 17e369ff2c..0000000000 --- a/zh_TW.UTF-8/articles/pr-guidelines/Makefile +++ /dev/null @@ -1,19 +0,0 @@ -# -# $FreeBSD$ -# -# Article: Problem Report Handling Guidelines - -DOC?= article - -FORMATS?= html -WITH_ARTICLE_TOC?= YES - -INSTALL_COMPRESSED?=gz -INSTALL_ONLY_COMPRESSED?= - -SRCS= article.xml - -URL_RELPREFIX?= ../../../.. -DOC_PREFIX?= ${.CURDIR}/../../.. - -.include "${DOC_PREFIX}/share/mk/doc.project.mk" diff --git a/zh_TW.UTF-8/articles/pr-guidelines/article.xml b/zh_TW.UTF-8/articles/pr-guidelines/article.xml deleted file mode 100644 index 9a2bebcc23..0000000000 --- a/zh_TW.UTF-8/articles/pr-guidelines/article.xml +++ /dev/null @@ -1,875 +0,0 @@ - - - - - - - -
- - 問題回報(PR)的處理原則 - - - $FreeBSD$ - - - &tm-attrib.freebsd; - &tm-attrib.opengroup; - &tm-attrib.general; - - - - 這篇文章主要在講:由 FreeBSD PR 維護小組所提出的一些 FreeBSD 問題回報(PR) - 建議,希望大家在弄 PR 時都能遵守。 - - - - Dag-ErlingSmørgrav - - HitenPandya - - - $FreeBSD$ - - - -
- 前言 - - GNATS 是 FReeBSD 計劃所採用的一套專門管理錯誤(回報bug) 系統。 - 由於對 FreeBSD 品質保證而言,是否能準確掌握各項錯誤回報與進度是十分重要的, - 因此,如何正確有效使用 GNATS 也就必須注意。 - - Access to GNATS is available to FreeBSD developers, as well as - to the wider community. 為了讓 GNATS 資料庫使用上儘量一致,於是就產生了怎麼處理像是:followup(回文)、關閉PR等的參考原則。 -
- -
- 問題回報(PR)的生命週期 - - - - 首先,回報者(originator)以 &man.send-pr.1; 送出 PR,然後會收到一封確認信。 - - - - 然後,committer 們就會有人(假設叫做 Joe)發掘有興趣的 PR 並將該 PR 指派給自己來處理。 - 或者 bugbuster 會有人(假設叫做 Jane) 就會下決定:她覺得 Joe 比較適合處理,就將該 PR 指派(assign)給他 - - - - Joe 會先與有問題的回報者作些意見交流(以確定這問題有進入 audit 追蹤流程內) - 以及判斷問題點。 - 然後再確定問題點有寫入 audit 追蹤流程之後,然後把該 PR 狀態設為 - analyzed(已分析) - - - - Joe 開始徹夜找出問題解法,然後將 patch 送到 follow-up(回文用),並請回報者協助測試是否正常。 - 然後,他就會將 PR 狀態設為 feedback 囉。 - - - - 如此重複 analyzed、feedback 幾趟之後,直到 Joe 與回報者雙方都相當滿意 patch 結果, - 於是就會將 patch 給 commits 進入 -CURRENT (或者若 -CURRENT - 上面沒這問題的話,就直接送到 -STABLE),在 commit log 內要把相關 PR 寫上去 - (同時回報者若有送完整或部分 patch 的話,就順便記載),然後,若沒什麼事的話,就開始準備 MFC 哩。 - (譯註:MFC意指 Merged From CURRENT ,也就是把 -CURRENT 上的東西併入 -STABLE - - - - 若該 patch 不需要 MFC 的話,Joe 就會關掉(close)該 PR 了。 - - - - 若該 patch 需要 MFC 的話,Joe 會把 PR 狀態改為 patched(已修正), - 直到已經 MFC 完畢,才會 close(關掉)。 - - - - - 很多送出來的 PR 都很少附上問題的相關訊息,而有些則是相當複雜難搞, - 或只是提到部分表面問題而已; - 遇到這種情況時,是非常需要得到所有相關訊息以便解決問題。 - 若遇到這種無解的問題或再次發生的話,就必須要 re-open(重新開啟) 該 PR,以待解決。 - - - PR 上所附的 email address 可能因某些原因而無法收信時,遇到這種狀況,通常就是 - followup 該 PR ,並(在 followup 時)請回報者重新提供可正常收信的 email address。 - 當系統上的 mail 系統關閉或沒裝的時候,這通常是在使用 &man.send-pr.1; 的替代方案。 - -
- -
- 問題回報(PR)的狀態 - - 若 PR 有任何變化的話,請務必記得更新 PR 的『狀態(state)』。 - 『狀態』應該要能正確反映該 PR 的目前進度才是。 - - - 以下是更改 PR 狀態的小例子: - - 當有可以修正問題的 PR 出現,而相關負責的 developer(s) - 也覺得這樣的修正可以接受,他們會 followup 該 PR,並將其狀態改為 - feedback。同時,回報者應重新評估最終的修正結果,並回應:所回報的錯誤是否已成功修正。 - - - 每份 PR 通常會有下面這幾種狀態之一: - - - - open - - PR 最初的狀態:這個問題被提出來,並在等待處理中。 - - - - - analyzed - - 已經開始處理這問題,並且有找到疑似解決的方法。 - - - - - feedback - - 需要回報者提供更詳細的相關資料,正如教學要因材施教,治病也要因人下藥,越多相關訊息,才能有最佳效果。 - - - - - patched - - 已經送相關 patch 了,但仍因某些原因(MFC,或來自回報者的確認結果異常)因此尚未完畢。 - - - - - suspended(暫緩) - - 因為沒附上相關訊息或參考資料,所以還沒辦法處理這問題。 - This is a prime candidate for - somebody who is looking for a project to take on. If the - problem cannot be solved at all, it will be closed, rather - than suspended. The documentation project uses - suspended for wish-list - items that entail a significant amount of work which no one - currently has time for. - - - - - closed - - A problem report is closed when any changes have been - integrated, documented, and tested, or when fixing the - problem is abandoned. - - - - - - The patched state is directly related to - feedback, so you may go directly to closed state if - the originator cannot test the patch, and it works in your own testing. - -
- -
- 問題回報(PR)的種類 - - While handling problem reports, either as a developer who has - direct access to the GNATS database or as a contributor who - browses the database and submits followups with patches, comments, - suggestions or change requests, you will come across several - different types of PRs. - - - - PRs not yet assigned to anyone. - - - PRs already assigned to someone. - - - 重複的 PR - - - Stale PRs - - - Misfiled PRs - - - - The following sections describe what each different type of - PRs is used for, when a PR belongs to one of these types, and what - treatment each different type receives. - -
- Unassigned PRs - - When PRs arrive, they are initially assigned to a generic - (placeholder) assignee. These are always prepended with - freebsd-. The exact value for this default - depends on the category; in most cases, it corresponds to a - specific &os; mailing list. Here is the current list, with - the most common ones listed first: - - - Default Assignees — most common - - - - Type - Categories - Default Assignee - - - - - - base system - bin, conf, gnu, kern, misc - freebsd-bugs - - - - architecture-specific - alpha, i386, ia64, powerpc, sparc64 - freebsd-arch - - - - ports collection - ports - freebsd-ports-bugs - - - - documentation shipped with the system - docs - freebsd-doc - - - - &os; web pages (not including docs) - www - freebsd-www - - - -
- - - Default Assignees — other - - - - Type - Categories - Default Assignee - - - - - - advocacy efforts - advocacy - freebsd-advocacy - - - - &java.virtual.machine; problems - java - freebsd-java - - - - standards compliance - standards - freebsd-standards - - - - threading libraries - threads - freebsd-threads - - - - &man.usb.4; subsystem - usb - freebsd-usb - - - -
- - Do not be surprised to find that the submitter of the - PR has assigned it to the wrong category. If you fix the - category, do not forget to fix the assignment as well. - (In particular, our submitters seem to have a hard time - understanding that just because their problem manifested - on an i386 system, that it might be generic to all of &os;, - and thus be more appropriate for kern. - The converse is also true, of course.) - - Certain PRs may be reassigned away from these generic - assignees by anyone. For assignees which are mailing lists, - please use the long form when making the assignment (e.g., - freebsd-foo instead of foo); - this will avoid duplicate emails sent to the mailing list. - - - Here is a sample list of such entities; it is probably - not complete. In some cases, entries that have the short form are - aliases, not mailing lists. - - - - Common Assignees — base system - - - - Type - Suggested Category - Suggested Assignee - - - - - - problem specific to the &arm; architecture - kern - freebsd-arm - - - - problem specific to the &mips; architecture - kern - freebsd-mips - - - - problem specific to the &powerpc; architecture - kern - freebsd-ppc - - - - problem with Advanced Configuration and Power - Management (&man.acpi.4;) - kern - freebsd-acpi - - - - problem with Asynchronous Transfer Mode (ATM) - drivers - kern - freebsd-atm - - - - problem with &firewire; drivers - kern - freebsd-firewire - - - - problem with the filesystem code - kern - freebsd-fs - - - - problem with the &man.geom.4; subsystem - kern - freebsd-geom - - - - problem with the &man.ipfw.4; subsystem - kern - freebsd-ipfw - - - - problem with Integrated Services Digital Network - (ISDN) drivers - kern - freebsd-isdn - - - - problem with &linux; or SVR4 emulation - kern - freebsd-emulation - - - - problem with the networking stack - kern - freebsd-net - - - - problem with PicoBSD - kern - freebsd-small - - - - problem with the &man.pf.4; subsystem - kern - freebsd-pf - - - - problem with the &man.scsi.4; subsystem - kern - freebsd-scsi - - - - problem with the &man.sound.4; subsystem - kern - freebsd-multimedia - - - - problem with &man.sysinstall.8; - bin - freebsd-qa - - - - problem with the system startup scripts - (&man.rc.8;) - kern - freebsd-rc - - - -
- - - Common Assignees — Ports Collection - - - - Type - Suggested Category - Suggested Assignee - - - - - - problem with the ports framework - (not with an individual port!) - ports - portmgr - - - - port which is maintained by apache@FreeBSD.org - ports - apache - - - - port which is maintained by eclipse@FreeBSD.org - ports - freebsd-eclipse - - - - port which is maintained by gnome@FreeBSD.org - ports - gnome - - - - port which is maintained by haskell@FreeBSD.org - ports - haskell - - - - port which is maintained by java@FreeBSD.org - ports - freebsd-java - - - - port which is maintained by kde@FreeBSD.org - ports - kde - - - - port which is maintained by - openoffice@FreeBSD.org - ports - freebsd-openoffice - - - - port which is maintained by perl@FreeBSD.org - ports - perl - - - - port which is maintained by python@FreeBSD.org - ports - freebsd-python - - - - port which is maintained by x11@FreeBSD.org - ports - freebsd-x11 - - - -
- - Ports PRs which have a maintainer who is a ports committer - may be reassigned by anyone (but note that not every &os; - committer is necessarily a ports committer, so you cannot - simply go by the email address alone.) - - - For other PRs, please do not reassign them to individuals - (other than yourself) unless you are certain that the assignee - really wants to track the PR. This will help to avoid the - case where no one looks at fixing a particular problem - because everyone assumes that the assignee is already working - on it. - -
- -
- Assigned PRs - - If a PR has the responsible field set - to the username of a FreeBSD developer, it means that the PR - has been handed over to that particular person for further - work. - - Assigned PRs should not be touched by anyone but the - assignee. If you have comments, submit a followup. If for - some reason you think the PR should change state or be - reassigned, send a message to the assignee. If the assignee - does not respond within two weeks, unassign the PR and do as - you please. -
- -
- 重複的 PR - - If you find more than one PR that describe the same issue, - choose the one that contains the largest amount of useful - information and close the others, stating clearly the number - of the superseding PR. If several PRs contain non-overlapping - useful information, submit all the missing information to one - in a followup, including references to the others; then close - the other PRs (which are now completely superseded). -
- -
- Stale PRs - - A PR is considered stale if it has not been modified in more - than six months. Apply the following procedure to deal with - stale PRs: - - - - If the PR contains sufficient detail, try to reproduce - the problem in -CURRENT and - -STABLE. If you succeed, submit a - followup detailing your findings and try to find someone - to assign it to. Set the state to analyzed - if appropriate. - - - - If the PR describes an issue which you know is the - result of a usage error (incorrect configuration or - otherwise), submit a followup explaining what the - originator did wrong, then close the PR with the reason - User error or Configuration - error. - - - - If the PR describes an error which you know has been - corrected in both -CURRENT and - -STABLE, close it with a message - stating when it was fixed in each branch. - - - - If the PR describes an error which you know has been - corrected in -CURRENT, but not in - -STABLE, try to find out when the person - who corrected it is planning to MFC it, or try to find - someone else (maybe yourself?) to do it. Set the state to - feedback and assign it to whomever will do - the MFC. - - - - In other cases, ask the originator to confirm if - the problem still exists in newer versions. If the - originator does not reply within a month, close the PR - with the notation Feedback timeout. - - -
- -
- Misfiled PRs - - GNATS is picky about the format of a submitted bug report. - This is why a lot of PRs end up being misfiled if - the submitter forgets to fill in a field or puts the wrong sort of - data in some of the PR fields. This section aims to provide most - of the necessary details for FreeBSD developers that can help them to - close or refile these PRs. - - When GNATS cannot deduce what to do with a problem report - that reaches the database, it sets the responsible of the PR to - gnats-admin and files it under the - pending category. This is now a - misfiled PR and will not appear in bug report - listings, unless someone explicitly asks for a list of all the - misfiled PRs. If you have access to the FreeBSD cluster - machines, you can use query-pr to view a - listing of PRs that have been misfiled: - - &prompt.user; query-pr -x -q -r gnats-admin - 52458 gnats-ad open serious medium Re: declaration clash f - 52510 gnats-ad open serious medium Re: lots of sockets in - 52557 gnats-ad open serious medium - 52570 gnats-ad open serious medium Jigdo maintainer update - - Commonly PRs like the ones shown above are misfiled for one - of the following reasons: - - - - A followup to an existing PR, sent through email, has - the wrong format on its Subject: - header. - - - - A submitter sent a Cc: to a mailing list and someone - followed up to that post instead of the email issued by - GNATS after processing. The email to the list will not - have the category/PRnumber tracking tag. (This is why we - discourage submitters from doing this exact thing.) - - - - When completing the &man.send-pr.1; template, the submitter - forgot to set the category or class of the PR to a proper - value. - - - - When completing the &man.send-pr.1; template, the submitter - set Confidential to yes. (Since we allow - anyone to mirror GNATS via cvsup, - our PRs are public information. Security alerts should - therefore not be sent via GNATS but instead via email to - the Security Team.) - - - - It is not a real PR, but some random message sent to - bug-followup@FreeBSD.org or - freebsd-gnats-submit@FreeBSD.org. - - - -
- Followups misfiled as new PRs - - The first category of misfiled PRs, the one with the wrong - subject header, is actually the one that requires the greatest - amount of work from developers. These are not real PRs, - describing separate problem reports. When a reply is received - for an existing PR at one of the addresses that GNATS - listens to for incoming messages, the subject - of the reply should always be of the form: - - Subject: Re: category/number: old synopsis text - - Most mailers will add the - Re:  part when you - reply to the original mail message of a PR. The - category/number:  part - is a GNATS-specific convention that you have to manually - insert to the subject of your followup reports. - - Any FreeBSD developer, who has direct access to the GNATS - database, can periodically check for PRs of this sort and move - interesting bits of the misfiled PR into the audit trail of - the original PR (by posting a proper followup to a bug report - to the address &a.bugfollowup;). Then - the misfiled PR can be closed with a message similar - to: - - Your problem report was misfiled. Please use the format -"Subject: category/number: original text" when following -up to older, existing PRs. I've added the relevant bits -from the body of this PR to kern/12345 - - Searching with query-pr for the - original PR, of which a misfiled followup is a reply, is as - easy as running: - - &prompt.user; query-pr -q -y "some text" - - After you locate the original PR and the misfiled - followups, use the option of - query-pr to save the full text of all the - relevant PRs in a &unix; mailbox file, i.e.: - - &prompt.user; query-pr -F 52458 52474 > mbox - - Now you can use any mail user agent to view all the PRs - you saved in mbox. Copy the text of all - the misfiled PRs in a followup to the original PR and make - sure you include the proper Subject: - header. Then close the misfiled PRs. When you close the misfiled - PRs remember that the submitter receives a mail notification that - his PR changed state to closed. Make sure you - provide enough details in the log about the reason of this state - change. Typically something like the following is ok: - - Followup to ports/45364 misfiled as a new PR. -This was misfiled because the subject did not have the format: - - Re: ports/45364: ... - - This way the submitter of the misfiled PR will know what to - avoid the next time a followup to an existing PR is sent. -
- -
- PRs misfiled because of missing fields - - The second type of misfiled PRs is usually the result of a - submitter forgetting to fill all the necessary fields when - writing the original PR. - - Missing or bogus category or - class fields can result in a misfiled report. - Developers can use &man.edit-pr.1; to change the category or - class of these misfiled PRs to a more appropriate value and - save the PR. - - Another common cause of misfiled PRs because of formatting - issues is quoting, changes or removal of the - send-pr template, either by the user who - edits the template or by mailers which do strange things to - plain text messages. This does not happen a lot of the time, - but it can be fixed with edit-pr too; it - does require a bit of work from the developer who refiles the - PR, but it is relatively easy to do most of the time. -
- -
- Misfiled PRs that are not really problem reports - - Sometimes a user wants to submit a report for a problem - and sends a simple email message to GNATS. The GNATS scripts - will recognize bug reports that are formatted using the - &man.send-pr.1; template. They cannot parse any sort of email - though. This is why submissions of bug reports that are sent - to freebsd-gnats-submit@FreeBSD.org have to - follow the template of send-pr, but email - reports can be sent to &a.bugs;. - - Developers that come across PRs that look like they should have - been posted to &a.bugs.name; or some other list should close the - PR, informing the submitter in their state-change log why this - is not really a PR and where the message should be posted. - - The email addresses that GNATS listens to for incoming PRs - have been published as part of the FreeBSD documentation, have - been announced and listed on the web-site. This means that - spammers found them. Spam messages - that reach GNATS are promptly filed - under the pending category until someone looks - at them. Closing one of these with &man.edit-pr.1; is very - annoying though, because GNATS replies to the submitter and - the sender's address of spam mail is never valid these days. - Bounces will come back for each PR that is closed. - - Currently, with the installation of some antispam filters - that check all submissions to the GNATS database, the amount - of spam that reaches the pending state is very - small. - - All developers who have access to the FreeBSD.org cluster - machines are encouraged to check for misfiled PRs and immediately - close those that are spam mail. Whenever you close one of - these PRs, please do the following: - - - - Set Category to junk. - - - - Set Confidential to no. - - - - Set Responsible to yourself (and not, e.g., - freebsd-bugs, which merely - sends more mail). - - - - Set State to closed. - - - - Junk PRs are not - backed up, so filing spam mail under this category makes it - obvious that we do not care to keep it around or waste disk - space for it. If you merely close them without changing the - category, they remain both in the master database and in - any copies of the database mirrored through - cvsup. -
-
-
- -
- 延伸閱讀 - - 下面這是在寫、處理 PR 時,可以參考的資料。當然很明顯,這份清單仍須補充。 - - - - How to - Write FreeBSD Problem Reports—給 PR 回報者用的參考原則。 - - -
-
diff --git a/zh_TW.UTF-8/articles/problem-reports/Makefile b/zh_TW.UTF-8/articles/problem-reports/Makefile deleted file mode 100644 index ab12340558..0000000000 --- a/zh_TW.UTF-8/articles/problem-reports/Makefile +++ /dev/null @@ -1,19 +0,0 @@ -# -# $FreeBSD$ -# -# Article: Writing FreeBSD Problem Reports - -DOC?= article - -FORMATS?= html -WITH_ARTICLE_TOC?= YES - -INSTALL_COMPRESSED?=gz -INSTALL_ONLY_COMPRESSED?= - -SRCS= article.xml - -URL_RELPREFIX?= ../../../.. -DOC_PREFIX?= ${.CURDIR}/../../.. - -.include "${DOC_PREFIX}/share/mk/doc.project.mk" diff --git a/zh_TW.UTF-8/articles/problem-reports/article.xml b/zh_TW.UTF-8/articles/problem-reports/article.xml deleted file mode 100644 index ebacf3e366..0000000000 --- a/zh_TW.UTF-8/articles/problem-reports/article.xml +++ /dev/null @@ -1,1103 +0,0 @@ - - -
- Writing &os; Problem Reports - - - $FreeBSD$ - - - &tm-attrib.freebsd; - &tm-attrib.cvsup; - &tm-attrib.ibm; - &tm-attrib.intel; - &tm-attrib.sparc; - &tm-attrib.sun; - &tm-attrib.general; - - - - This article describes how to best formulate and submit a - problem report to the &os; Project. - - - - Dag-ErlingSmørgravContributed by - - MarkLinimon - - - $FreeBSD$ - - - problem reports - -
- Introduction - - One of the most frustrating experiences one can have as a - software user is to submit a problem report only to have it - summarily closed with a terse and unhelpful explanation like - not a bug or bogus PR. Similarly, - one of the most frustrating experiences as a software developer - is to be flooded with problem reports that are not really - problem reports but requests for support, or that contain little - or no information about what the problem is and how to reproduce - it. - - This document attempts to describe how to write good problem - reports. What, you ask, is a good problem report? Well, to go - straight to the bottom line, a good problem report is one that - can be analyzed and dealt with swiftly, to the mutual - satisfaction of both user and developer. - - Although the primary focus of this article is on &os; - problem reports, most of it should apply quite well to other - software projects. - - Note that this article is organized thematically, not - chronologically, so you should read through the entire document - before submitting a problem report, rather than treat it as a - step-by-step tutorial. -
- -
- When to submit a problem report - - There are many types of problems, and not all of them should - engender a problem report. Of course, nobody is perfect, and - there will be times when you are convinced you have found a bug - in a program when in fact you have misunderstood the syntax for - a command or made a typographical error in a configuration file - (though that in - itself may sometimes be indicative of poor documentation or poor - error handling in the application). There are still many cases - where submitting a problem report is clearly - not the right - course of action, and will only serve to frustrate you and the - developers. Conversely, there are cases where it might be - appropriate to submit a problem report about something else than - a bug—an enhancement or a feature request, for - instance. - - So how do you determine what is a bug and what is not? As a - simple rule of thumb your problem is not a - bug if it can be expressed as a question (usually of the form - How do I do X? or Where can I find - Y?). It is not always quite so black and white, but the - question rule covers a large majority of cases. If you are looking - for an answer, consider posing your question to the - &a.questions;. - - Some cases where it may be appropriate to submit a problem - report about something that is not a bug are: - - - - Requests for feature enhancements. It is generally a - good idea to air these on the mailing lists before - submitting a problem report. - - - - Notification of updates to externally maintained - software (mainly ports, but also externally maintained base - system components such as BIND or various GNU - utilities). - - For unmaintained ports (MAINTAINER contains - ports@FreeBSD.org), such update notifications - might get picked up by an interested - committer, or you might be asked to provide a patch to update - the port; providing it upfront will greatly improve your chances - that the port will get updated in a timely manner. - - If the port is maintained, PRs announcing new upstream releases - are usually not very useful since they generate supplementary work - for the committers, and the maintainer likely knows already there is - a new version, they have probably worked with the developers on it, - they are probably testing to see there is no regression, etc. - - In either case, following the process described in Porter's - Handbook will yield the best results. - - - - A bug that can not be reproduced can rarely be - fixed. If the bug only occurred once and you can not reproduce - it, and it does not seem to happen to anybody else, chances are - none of the developers will be able to reproduce it or figure - out what is wrong. That does not mean it did not happen, but it - does mean that the chances of your problem report ever leading - to a bug fix are very slim. To make matters worse, often - these kinds of bugs are actually caused by failing hard drives - or overheating processors — you should always try to rule - out these causes, whenever possible, before submitting a PR. - - Next, to decide to whom you should file your problem - report, you need to understand that the software that makes - up &os; is composed of several different elements: - - - - Code in the base system that is written and maintained - by &os; contributors, such as the kernel, the C library, - and the device drivers (categorized as kern); - the binary utilities (bin); the manual - pages and documentation (docs); and - the web pages (www). All bugs in - these areas should be reported to the &os; developers. - - - - Code in the base system that is written and maintained - by others, and imported into &os; and adapted. Examples - include bind, &man.gcc.1;, and - &man.sendmail.8;. Most bugs in these areas should be reported - to the &os; developers; but in some cases they may need to be - reported to the original authors instead if the problems are - not &os;-specific. Usually these bugs will fall under either - the bin or gnu - categories. - - - - Individual applications that are not in the base system - but are instead part of the &os; Ports Collection (category - ports). Most of these applications are - not written by &os; developers; what &os; provides is merely - a framework for installing the application. Therefore, you - should only report a problem to the &os; developers when you - believe the problem is &os;-specific; otherwise, you should - report it to the authors of the software. - - - - - Then you should ascertain whether or not the problem is - timely. There are few things - that will annoy a developer more than receiving a problem report - about a bug she has already fixed. - - If the problem is in the base system, you should first read - the FAQ section on - - &os; versions, if you are not already familiar with - the topic. It is not possible for &os; to fix problems in - anything other than certain recent branches of the base system, - so filing a bug report about an older version will probably - only result in a developer advising you to upgrade to a - supported version to see if the problem still recurs. The - Security Officer team maintains the - list of supported - versions. - - If the problem is in a port, note that you must first - upgrade to the latest version of the Ports Collection and see - if the problem still applies. Due to the rapid pace of changes - in these applications, it is infeasible for &os; to support - anything other than the absolute latest versions, and problems - with older version of applications simply cannot be fixed. -
- -
- Preparations - - A good rule to follow is to always do a background search - before submitting a problem report. Maybe your problem has - already been reported; maybe it is being discussed on the - mailing lists, or recently was; it may even already be fixed in - a newer version than what you are running. You should therefore - check all the obvious places before submitting your problem - report. For &os;, this means: - - - - The &os; - Frequently Asked - Questions (FAQ) list. - The FAQ attempts to provide answers for a wide range of questions, - such as those concerning - hardware - compatibility, - user - applications, - and kernel - configuration. - - - - The - mailing - lists—if you are not subscribed, use - the - searchable archives on the &os; web site. If your - problem has not been discussed on the lists, you might try - posting a message about it and waiting a few days to see if - someone can spot something you have overlooked. - - - - Optionally, the entire web—use your favorite - search engine to locate any references to your problem. You - may even get hits from archived mailing lists or newsgroups - you did not know of or had not thought to search - through. - - - - Next, the searchable - - &os; PR database (GNATS). Unless your problem - is recent or obscure, there is a fair chance it has already - been reported. - - - - Most importantly, you should attempt to see if existing - documentation in the source base addresses your problem. - - For the base &os; code, you should - carefully study the contents of the - /usr/src/UPDATING file on your system - or its latest version at - http://www.FreeBSD.org/cgi/cvsweb.cgi/src/UPDATING. - (This is vital information - if you are upgrading from one version to - another—especially if you are upgrading to the - &os.current; branch). - - However, if the problem is in something that was installed - as a part of the &os; Ports Collection, you should refer to - /usr/ports/UPDATING (for individual ports) - or /usr/ports/CHANGES (for changes - that affect the entire Ports Collection). - http://www.FreeBSD.org/cgi/cvsweb.cgi/ports/UPDATING - and - http://www.FreeBSD.org/cgi/cvsweb.cgi/ports/CHANGES - are also available via CVSweb. - - -
- -
- Writing the problem report - - Now that you have decided that your issue merits a problem - report, and that it is a &os; problem, it is time to write - the actual problem report. Before we get into the mechanics - of the program used to generate and submit PRs, here are some - tips and tricks to help make sure that your PR will be most - effective. - -
- Tips and tricks for writing a good problem report - - - - Do not leave the Synopsis - line empty. The PRs go both onto a mailing list - that goes all over the world (where the Synopsis - is used - for the Subject: line), but also into a - database. Anyone who comes along later and browses the - database by synopsis, and finds a PR with a blank subject - line, tends just to skip over it. Remember that PRs stay - in this database until they are closed by someone; an - anonymous one will usually just disappear in the - noise. - - - - Avoid using a weak Synopsis - line. You should not assume that anyone reading - your PR has any context for your submission, so the more - you provide, the better. For instance, what part of the - system does the problem apply to? Do you only see the - problem while installing, or while running? To - illustrate, instead of Synopsis: portupgrade is - broken, see how much more informative this - seems: Synopsis: port sysutils/portupgrade - coredumps on -current. (In the case of ports, - it is especially helpful to have both the category and - portname in the Synopsis line.) - - - - If you have a patch, say so. - A PR with a patch included is much more likely to be - looked at than one without. If you are including one, - put the string [patch] at the - beginning of the Synopsis. (Although it is - not mandatory to use that exact string, by convention, - that is the one that is used.) - - - - If you are a maintainer, say so. - If you are maintaining a part of the source code (for - instance, a port), you might consider adding the string - [maintainer update] at the beginning of - your synopsis line, and you definitely should set the - Class of - your PR to maintainer-update. This way - any committer that handles your PR will not have to check. - - - - Be specific. - The more information you supply about what problem you - are having, the better your chance of getting a response. - - - - Include the version of &os; you are running (there - is a place to put that, see below) and on which architecture. - You should include whether you are running from a release - (e.g. from a CDROM or download), or from - a system maintained by &man.cvsup.1; (and, if so, how - recently you updated). If you are tracking the - &os.current; branch, that is the very first thing someone - will ask, because fixes (especially for high-profile - problems) tend to get committed very quickly, and - &os.current; users are expected to keep up. - - - - Include which global options you have specified in - your make.conf. Note: specifying - -O2 and above to &man.gcc.1; is - known to be buggy in many situations. While the - &os; developers will accept patches, they are - generally unwilling to investigate such issues due - to simple lack of time and volunteers, and may - instead respond that this just is not supported. - - - - If this is a kernel problem, then be prepared to - supply the following information. (You do not - have to include these by default, which only tends to - fill up the database, but you should include excerpts - that you think might be relevant): - - - - your kernel configuration (including which - hardware devices you have installed) - - - whether or not you have debugging options enabled - (such as WITNESS), and if so, - whether the problem persists when you change the - sense of that option - - - a backtrace, if one was generated - - - the fact that you have read - src/UPDATING and that your problem - is not listed there (someone is guaranteed to ask) - - - whether or not you can run any other kernel as - a fallback (this is to rule out hardware-related - issues such as failing disks and overheating CPUs, - which can masquerade as kernel problems) - - - - - - If this is a ports problem, then be prepared to - supply the following information. (You do not - have to include these by default, which only tends to - fill up the database, but you should include excerpts - that you think might be relevant): - - - - which ports you have installed - - - any environment variables that override the - defaults in bsd.port.mk, such - as PORTSDIR - - - the fact that you have read - ports/UPDATING and that your problem - is not listed there (someone is guaranteed to ask) - - - - - - - - - - Avoid vague requests for features. - PRs of the form someone should really implement something - that does so-and-so are less likely to get results than - very specific requests. Remember, the source is available - to everyone, so if you want a feature, the best way to - ensure it being included is to get to work! Also consider - the fact that many things like this would make a better - topic for discussion on freebsd-questions - than an entry in the PR database, as discussed above. - - - - Make sure no one else has already submitted - a similar PR. Although this has already been - mentioned above, it bears repeating here. It only take a - minute or two to use the web-based search engine at - http://www.FreeBSD.org/cgi/query-pr-summary.cgi?query. - (Of course, everyone is guilty of forgetting to do this - now and then.) - - - Avoid controversial requests. - If your PR addresses an area that has been controversial - in the past, you should probably be prepared to not only - offer patches, but also justification for why the patches - are The Right Thing To Do. As noted above, - a careful search of the mailing lists using the archives - at http://www.FreeBSD.org/search/search.html#mailinglists - is always good preparation. - - - - Be polite. - Almost anyone who would potentially work on your PR is a - volunteer. No one likes to be told that they have to do - something when they are already doing it for some - motivation other than monetary gain. This is a good thing - to keep in mind at all times on Open Source - projects. - - -
- -
- Before you begin - - If you are using the &man.send-pr.1; program, make sure your - VISUAL (or EDITOR if - VISUAL is not set) environment variable is set - to something sensible. - - You should also make sure that mail delivery works fine. - &man.send-pr.1; uses mail messages for the submission and - tracking of problem reports. If you cannot post mail messages - from the machine you are running &man.send-pr.1; on, your - problem report will not reach the GNATS database. For details - on the setup of mail on &os;, see the Electronic - Mail chapter of the &os; Handbook at - http://www.FreeBSD.org/doc/en_US.ISO8859-1/books/handbook/mail.html. - - Make sure that your mailer will not mangle the message on - its way to GNATS. In particular, if your mailer automatically - breaks lines, changes tabs to spaces, or escapes newline - characters, any patch that you submit will be rendered - unusable. For the text sections, however, we request that - you insert manual linebreaks somewhere around 70 characters, - so that the web display of the PR will be readable. - - Similar considerations apply if you are using the web-based - PR submittal form instead of &man.send-pr.1;. Note that - cut-and-paste operations can have their own side-effects on - text formatting. In certain cases it may be necessary to use - &man.uuencode.1; to ensure that patches arrive unmodified. - - Finally, if your submission will be lengthy, you should - to prepare your work offline so that nothing will be lost in - case there is a problem submitting it. This can be an especial - problem with the web form. -
- -
- Attaching patches or files - - The following applies to submitting PRs via email: - - The &man.send-pr.1; program has provisions for attaching - files to a problem report. You can attach as many files as - you want provided that each has a unique base name (i.e. the - name of the file proper, without the path). Just use the - command-line option to specify the names - of the files you wish to attach: - -&prompt.user; send-pr -a /var/run/dmesg -a /tmp/errors - - Do not worry about binary files, they will be automatically - encoded so as not to upset your mail agent. - - If you attach a patch, make sure you use the - or option to - &man.diff.1; to create a context or unified diff (unified is - preferred), and make - sure to specify the exact CVS revision numbers of the files - you modified so the developers who read your report will be - able to apply them easily. For problems with the kernel or the - base utilities, a patch against &os.current; (the HEAD - CVS branch) is preferred since all new code should be applied - and tested there first. After appropriate or substantial testing - has been done, the code will be merged/migrated to the &os.stable; - branch. - - If you attach a patch inline, instead of as an attachment, - note that the most common problem by far is the tendency of some - email programs to render tabs as spaces, which will completely - ruin anything intended to be part of a Makefile. - - Do not send patches as attachments using - Content-Transfer-Encoding: quoted-printable. - These will perform character escaping and the entire patch - will be useless. - - Also note that while including small patches in a PR is - generally all right—particularly when they fix the problem - described in the PR—large patches and especially new code - which may require substantial review before committing should - be placed on a web or ftp server, and the URL should be - included in the PR instead of the patch. Patches in email - tend to get mangled, especially when GNATS is involved, and - the larger the patch, the harder it will be for interested - parties to unmangle it. Also, posting a patch on the web - allows you to modify it without having to resubmit the entire - patch in a followup to the original PR. Finally, large - patches simply increase the size of the database, since - closed PRs are not actually deleted but instead kept and - simply marked as closed. - - You should also take note that unless you explicitly - specify otherwise in your PR or in the patch itself, any - patches you submit will be assumed to be licensed under the - same terms as the original file you modified. -
- -
- Filling out the template - - The next section applies to the email method only: - - When you run &man.send-pr.1;, you are presented with a - template. The template consists of a list of fields, some of - which are pre-filled, and some of which have comments explaining - their purpose or listing acceptable values. Do not worry - about the comments; they will be removed automatically if you - do not modify them or remove them yourself. - - At the top of the template, below the - SEND-PR: lines, are the email headers. You - do not normally need to modify these, unless you are sending - the problem report from a machine or account that can send but - not receive mail, in which case you will want to set the - From: and Reply-To: to - your real email address. You may also want to send yourself - (or someone else) a carbon copy of the problem report by - adding one or more email addresses to the - Cc: header. - - In the email template you will find the following two - single-line fields: - - - - Submitter-Id: Do not change this. - The default value of current-users is - correct, even if you run &os.stable;. - - - - Confidential: This is prefilled - to no. Changing it makes no sense as - there is no such thing as a confidential &os; problem - report—the PR database is distributed worldwide by - CVSup. - - - - - The next section describes fields that are common to both - the email interface and the web interface: - - - - - Originator: - Please specify your real name, optionally followed - by your email address in angle brackets. - In the email interface, this is normally - prefilled with the gecos field of the - currently logged-in - user. - - - The email address you use will become public information - and may become available to spammers. You should either - have spam handling procedures in place, or use a temporary - email account. However, please note that if you do not - use a valid email account at all, we will not be able to - ask you questions about your PR. - - - - - - Organization: Whatever you feel - like. This field is not used for anything - significant. - - - - Synopsis: Fill this out with a - short and accurate description of the problem. The - synopsis is used as the subject of the problem report - email, and is used in problem report listings and - summaries; problem reports with obscure synopses tend to - get ignored. - - As noted above, if your problem report includes a patch, - please have the synopsis start with [patch]; - if this is a ports PR and you are the - maintainer, you may consider adding - [maintainer update] and set the - Class of your PR to - maintainer-update. - - - - Severity: One of - non-critical, - serious or - critical. Do not overreact; refrain - from labeling your problem critical - unless it really is (e.g. data corruption issues, serious - regression from previous functionality in -CURRENT) - or serious unless - it is something that will affect many users (kernel - panics or freezes; problems with - particular device drivers or system utilities). &os; - developers will not necessarily work on your problem faster - if you inflate its importance since there are so many other - people who have done exactly that — in fact, some - developers pay little attention to this field - because of this. - - - Major security problems should not - be filed in GNATS, because all GNATS information is public - knowledge. Please send such problems in private email to - &a.security-officer;. - - - - - Priority: One of - low, medium or - high. high should - be reserved for problems that will affect practically - every user of &os; and medium for - something that will affect many users. - - - This field has become so widely abused that it is - almost completely meaningless. - - - - - Category: Choose an appropriate - category. - - - There are a number of "platform" categories into which - bugs in the base system that are specific to one particular - hardware architecture should be filed. Problems that are - generic all across versions of &os; should probably be - filed as kern or bin; - see discussion of those categories below. - - Example: you have a common PC-based machine, and think - you have encountered a problem specific to a particular - chipset or a particular motherboard: i386 - is the right category. - - Example: You are having a problem with an add-in - peripheral card on a commonly seen bus, or a problem with - a particular type of hard disk drive: in this case, it - probably applies to more than one architecture, and - kern is the right category. - - - Here is the current list of categories (taken from - http://www.FreeBSD.org/cgi/cvsweb.cgi/src/gnu/usr.bin/send-pr/categories): - - - - advocacy: problems relating to - &os;'s public image. Rarely used. - - - - alpha: problems specific to the - Alpha platform. - - - - amd64: problems specific to the - AMD64 platform. - - - - bin: problems with userland - programs in the base system. If running &man.whereis.1; - shows /bin, /usr/sbin, - or something similar, then this is probably the right - category. (A few contributed programs might instead - need to be in gnu; see below.) - - - - conf: problems with - configuration files, default values, and so forth. - Things that affect /usr/share - or /etc/rc* belong here. - - - - docs: problems with manual pages - or on-line documentation. - - - - gnu: problems with imported GNU software - such as &man.gcc.1; or &man.grep.1;. - - - - i386: problems specific to the - &i386; platform. - - - - ia64: problems specific to the - ia64 platform. - - - - java: problems related to the &java; - Virtual Machine. (Ports that merely depend on &java; to - run should be filed under ports.) - - - - - kern: problems with - the kernel, (non-platform-specific) device drivers, - or the base libraries. - - - - misc: anything that does not fit - in any of the other categories. (Note that there is - almost nothing that truly belongs in this category, - except for problems with the release and build - infrastructure. Temporary build failures on - HEAD do not belong here. Also note - that it is - easy for things to get lost in this category). - - - - ports: problems relating to the - ports tree. - - - - powerpc: problems specific to the - &powerpc; platform. - - - - sparc64: problems specific to the - &sparc64; platform. - - - - standards: Standards conformance - issues. - - - - threads: problems related to the - &os; threads implementation (especially on &os.current;). - - - - usb: problems related to the - &os; USB implementation. - - - - www: Changes or enhancements to - the &os; website. - Problems with code found in /usr/ports/www - do not belong here, they belong in - ports instead. - - - - - - Class: Choose one of the - following: - - - - sw-bug: software bugs. - - - - doc-bug: errors in - documentation. - - - - change-request: requests for - additional features or changes in existing - features. - - - - update: updates to ports or - other contributed software. - - - - maintainer-update: updates to - ports for which you are the maintainer. - - - - - - Release: The version of &os; - that you are running. This is filled out automatically if - you are using - &man.send-pr.1; and need only be changed if you are - sending a problem report from a different system than the - one that exhibits the problem. - - - - Finally, there is a series of multi-line fields: - - - - Environment: This should - describe, as accurately as possible, the environment in - which the problem has been observed. This includes the - operating system version, the version of the specific - program or file that contains the problem, and any other - relevant items such as system configuration, other - installed software that influences the problem, - etc.—quite simply everything a developer needs to - know to reconstruct the environment in which the problem - occurs. - - - - Description: A complete and - accurate description of the problem you are experiencing. - Try to avoid speculating about the causes of the problem - unless you are certain that you are on the right track, as - it may mislead a developer into making incorrect - assumptions about the problem. - - - - How-To-Repeat: A summary of the - actions you need to take to reproduce the problem. - - - - Fix: Preferably a patch, or at - least a workaround (which not only helps other people with - the same problem work around it, but may also help a - developer understand the cause for the problem), but if - you do not have any firm ideas for either, it is better to - leave this field blank than to speculate. - - -
- -
- Sending off the problem report - - If you are using &man.send-pr.1;: - - Once you are done filling out the template, have saved it, - and exit your editor, &man.send-pr.1; will prompt you with - s)end, e)dit or a)bort?. You can then hit - s to go ahead and submit the problem report, - e to restart the editor and make - further modifications, or a to abort. - If you choose the latter, your problem report will remain on - disk (&man.send-pr.1; will tell you the filename before it - terminates), so you can edit it at your leisure, or maybe - transfer it to a system with better net connectivity, before - sending it with the to - &man.send-pr.1;: - -&prompt.user; send-pr -f ~/my-problem-report - - This will read the specified file, validate the contents, - strip comments and send it off. - - If you are using the web form: - - Before you hit submit, you will need to - fill in a field containing text that is represented in image - form on the page. This unfortunate measure has had to be - adopted due to misuse by automated systems and a few misguided - individuals. It is a necessary evil that no one likes; please - do not ask us to remove it. - - Note that you are strongly advised to - save your work somewhere before hitting submit. - A common problem for users is to have their web browser displaying - a stale image from its cache. If this happens to you, your - submission will be rejected and you may lose your work. - - If you are unable to view images for any reason, and are also - unable to use &man.send-pr.1;, please accept our apologies for - the inconvenience and email your problem report to the bugbuster - team at freebsd-bugbusters@FreeBSD.org. -
- -
- -
- Follow-up - - Once your problem report has been filed, you will receive a - confirmation by email which will include the tracking number - that was assigned to your problem report and a URL you can use - to check its status. With a little luck, someone will take an - interest in your problem and try to address it, or, as the case - may be, explain why it is not a problem. You will be - automatically notified of any change of status, and you will - receive copies of any comments or patches someone may attach to - your problem report's audit trail. - - If someone requests additional information from you, or you - remember or discover something you did not mention in the - initial report, please use one of two methods to submit your - followup: - - - - The easiest way is to use the followup link on - the individual PR's web page, which you can reach from the - - PR search page. Clicking on this link will bring up an - an email window with the correct To: and Subject: lines filled in - (if your browser is configured to do this). - - - - Alternatively, you can just mail it to - &a.bugfollowup;, making sure that the - tracking number is included in the subject so the bug tracking - system will know what problem report to attach it to. - - - If you do not include the tracking - number, GNATS will become confused and create an entirely - new PR which it then assigns to the GNATS administrator, - and then your followup will become lost until someone - comes in to clean up the mess, which could be days or - weeks afterwards. - - Wrong way: Subject: that PR I sent - Right way: Subject: Re: ports/12345: compilation problem with foo/bar - - - - - - If the problem report remains open after the problem has - gone away, just send a follow-up (in the manner prescribed - above) saying that the problem report can be closed, and, if - possible, explaining how or when the problem was fixed. -
- -
- If you are having problems - - Most PRs go through the system and are accepted quickly; - however, at times GNATS runs behind and you may not get your - email confirmation for 10 minutes or even longer. Please try to - be patient. - - In addition, because GNATS receives all its input via email, - it is absolutely vital that &os; runs all its submissions through - spam filters. If you do not get a response within an hour or - two, you may have fallen afoul of them; if so, please contact - the GNATS administrators at bugmeister@FreeBSD.org - and ask for help. - - - Among the anti-spam measures is one that weighs against - many common abuses seen HTML-based email (although not necessarily - the mere inclusion of HTML in a PR). We strongly recommend - against the use of HTML-based email when sending PRs: not - only is it more likely to fall afoul of the filters, it also - tends to merely clutter up the database. Plain old email is - strongly preferred. - - - On rare occasions you will encounter a GNATS bug where a - PR is accepted and assigned a tracking number but it does not - show up on the list of PRs on any of the web query pages. What - may have happened is that the database index has gotten out of - synchronization with the database itself. The way that you - can test whether this has happened is to pull up the - - view a single PR page and see whether the PR shows up. - If it does, please notify the GNATS administrators at - bugmeister@FreeBSD.org. Note that there is a - cron job that periodically rebuilds the database, - so unless you are in a hurry, no action needs to be taken. -
- -
- Further Reading - - This is a list of resources relevant to the proper writing - and processing of problem reports. It is by no means complete. - - - - - How to Report Bugs Effectively—an excellent - essay by Simon G. Tatham on composing useful (non-&os;-specific) - problem reports. - - - Problem - Report Handling Guidelines—valuable insight - into how problem reports are handled by the &os; - developers. - - -
- - -
diff --git a/zh_TW.UTF-8/articles/remote-install/Makefile b/zh_TW.UTF-8/articles/remote-install/Makefile deleted file mode 100644 index 3efa3a5e93..0000000000 --- a/zh_TW.UTF-8/articles/remote-install/Makefile +++ /dev/null @@ -1,30 +0,0 @@ -# -# The FreeBSD Traditional Chinese Project -# -# Original Revision: 1.1 -# $FreeBSD$ -# - -DOC?= article - -FORMATS?= html -WITH_ARTICLE_TOC?= YES - -INSTALL_COMPRESSED?= gz -INSTALL_ONLY_COMPRESSED?= - -SRCS= article.xml - -# Images from the cross-document image library -IMAGES_LIB= callouts/1.png -IMAGES_LIB+= callouts/2.png -IMAGES_LIB+= callouts/3.png -IMAGES_LIB+= callouts/4.png -IMAGES_LIB+= callouts/5.png -IMAGES_LIB+= callouts/6.png -IMAGES_LIB+= callouts/7.png - -URL_RELPREFIX?= ../../../.. -DOC_PREFIX?= ${.CURDIR}/../../.. - -.include "${DOC_PREFIX}/share/mk/doc.project.mk" diff --git a/zh_TW.UTF-8/articles/remote-install/article.xml b/zh_TW.UTF-8/articles/remote-install/article.xml deleted file mode 100644 index d927f61be6..0000000000 --- a/zh_TW.UTF-8/articles/remote-install/article.xml +++ /dev/null @@ -1,475 +0,0 @@ - - - -
- 遠端安裝 &os; 作業系統而不必接 Remote Console - - - DanielGerzo -
danger@FreeBSD.org
-
- - - &tm-attrib.freebsd; - &tm-attrib.general; - - - - 2008 - The &os; Documentation Project - - - $FreeBSD$ - - $FreeBSD$ - - - 本文介紹如何在沒辦法連到遠端 console 的機器做 &os; 遠端安裝。 - 本文構想來自於作者與 &a.mm; 的合作成果, - 以及 &a.pjd; 所投注的諸多心血。 - -
- - - 緣起 - - 世上有許多 server hosting provider,但其中有官方支援 &os; - 則不是相當多。 他們通常會在所提供的機器上有 &linux; distribution - 的安裝支援。 - - 有些會讓您可選擇喜好的 &linux; distribution 來裝, - 像這種情況就可以試著安裝 &os;。 而有些則是會提供救急用的系統, - 這種也可以用來安裝 &os;。 - - 本文介紹這些遠端基本安裝 &os; 的方式,以及 RAID-1 與 - ZFS 設定步驟。 - - - - 介紹 - - 茲摘錄一下本文的目的以及闡述這邊所涵蓋的東西。 - 對於無官方支援 &os; 的代管服務(colocation)用戶而言, - 本文中所介紹到的指令會相當有用。 - - - - 正如先前 緣起 所提到的,許多名聲還不賴的 - server hosting 公司會提供一些救急用系統,可以透過 - LAN 方式開機,也可以透過 - SSH 方式進行管理。 通常會有該加值服務, - 以讓他們的客戶可以連進來修復有問題的作業系統。 - 本節之後將介紹如何透過救急系統來安裝 &os;。 - - - - - 下一節會介紹如何在本機設定以及打造最小巧的 &os; —— - 該版最後會在遠端機器上透過 ramdisk 方式啟動,並以 - sysinstallFTP - mirror 站來安裝完整的 &os; 作業系統。 - - - - 本文其餘部分將介紹安裝程序,以及 ZFS - 檔案系統的設定。 - - - - - 需求 - - 為了成功完成遠端安裝,必須要有: - - - - 要有可以上網的作業系統,並且 SSH - 可以連線。 - - - - 瞭解 &os; 的安裝程序 - - - - 熟悉如何使用 &man.sysinstall.8; - - - - 有 &os; 安裝光碟片或者 ISO image 檔 - - - - - - - 準備 - <application>mfsBSD</application> - - 在裝 &os; 之前,要先打造最小化的 &os; 作業系統 image 檔, - 以便可以從硬碟上開機。 如此一來,新的系統就可以透過網路來操作, - 而剩下來的安裝部分即可不必透過 console。 - - mfsBSD 這套工具就是用來打造小型的 - &os; image 檔。 mfsBSD (名字其中 - mfs 就是 memory file system)所建造出來的 - 整套系統會透過 ramdisk 方式來運作。 由於此一特色,硬碟的部分就不受限, - 因此可以用來安裝完整的 &os; 作業系統。 mfsBSD - 的首頁位於 http://people.freebsd.org/~mm/mfsbsd/, - 其中連結有該工具的最新 release 部分。 - - 請注意:mfsBSD 內部運作方式的細節,不 - 在本文介紹範圍之內。 若對這方面有興趣的讀者,可至 - mfsBSD 官網查閱相關文件。 - - 首先下載最新的 mfsBSD 並解壓縮之, - 然後切到解壓縮後的工作目錄,也就是 mfsBSD - script 檔所在處: - - &prompt.root; fetch http://people.freebsd.org/~mm/mfsbsd/mfsbsd-latest.tar.gz -&prompt.root; tar xvzf mfsbsd-1.0-beta1.tar.gz -&prompt.root; cd mfsbsd-1.0-beta1/ - - - 設定 <application>mfsBSD</application> - - 在將 mfsBSD 開機之前, - 有幾個重要設定要先設妥。 此時最重要的設定,很明顯就是網路設定。 - 到底網路怎麼設最好,則取決於所處的網路環境, - 以及該網路卡會以哪一種驅動程式載入而定。 我們將會看到 - mfsBSD 如何在任何網路情況下進行設定。 - - 另一件重要事就是設定 root 密碼。 - 這點可以透過 conf/rootpw.conf 來完成。 - 請切記:該檔密碼是以明文方式存放,因此不建議放真正平常有在用的密碼。 - 然而這密碼只是臨時密碼而已,可以在之後開機時再做更換。 - - - 設定網路(<filename>conf/interfaces.conf</filename> 方式) - - 若對要裝的機器網卡為何還不知道是哪一款,但可以善加利用 - mfsBSD 的自動偵測功能。 - mfsBSD 的開機 script 會根據網卡的 MAC - 位址範圍來偵測正確的驅動程式,像是下列的 - conf/interfaces.conf 設定內容: - - initconf_interfaces="ext1" -initconf_mac_ext1="00:00:00:00:00:00" -initconf_ip_ext1="192.168.0.2" -initconf_netmask_ext1="255.255.255.0" - - 別忘了在 conf/rc.conf 內要加上 - defaultrouter 的相關設定: - - defaultrouter="192.168.0.1" - - - - 設定網路(<filename>conf/rc.conf</filename> 方式) - - 若已經知道網卡是哪一種,那麼要設定網路的話直接改 - conf/rc.conf 會比較方便。 - 該檔設定語法與 &os; 標準的 &man.rc.conf.5; 是一致的。 - - 舉個例子,若知道該機器網卡是用 &man.re.4;,那麼就在 - conf/rc.conf 做下列類似設定: - - defaultrouter="192.168.0.1" -ifconfig_re0="inet 192.168.0.2 netmask 255.255.255.0" - - - - - 打造 <application>mfsBSD</application> image - - 打造 mfsBSD - image 檔的過程相當簡單。 - - 首先是把 &os; 安裝光碟或者安裝用的 ISO image - 檔丟到 /cdrom。 - 為維持所有例子的一致,本文假設都是用 &os; 7.0-RELEASE - ISO。 而把 ISO image 檔掛載到 /cdrom 目錄相當簡單, - 就是用 &man.mdconfig.8;: - - &prompt.root; mdconfig -a -t vnode -u 10 -f 7.0-RELEASE-amd64-disc1.iso -&prompt.root; mount_cd9660 /dev/md10 /cdrom - - 接著就開始打造可開機的 mfsBSD - image: - - &prompt.root; make BASE=/cdrom/7.0-RELEASE - - - 上述的 make 指令要在 - mfsBSD 的最上層目錄執行,比方說 ~/mfsbsd-1.0-beta1/ - - - - - <application>mfsBSD</application> 開動 - - 現在 mfsBSD image 已經備妥, - 要上傳到遠端機器的救急系統或者預先安裝的 &linux; distribution。 - 要完成這工作最適合的工具就是 scp - - &prompt.root; scp disk.img root@192.168.0.2:. - - 為了能順利啟動 mfsBSD image, - 要把檔案放在欲安裝機器的第一顆(可開機)硬碟上。 - 假設例子的第一顆開機硬碟代號為 sda, - 那麼作法就類似下面這樣: - - &prompt.root; dd if=/root/disk.img of=/dev/sda bs=1m - - 若一切順利,該 image 檔現在應該會在第一顆硬碟的 - MBR 磁區並可以開始進行重開機了。 可以用 - &man.ping.8; 工具來檢測該機器開機完畢與否。 一旦 ping 到之後, - 就可以透過 &man.ssh.1; 連進去,並且用 root - 以及剛設定的密碼登入。 - - - - - &os; 作業系統的安裝 - - 現在 mfsBSD 已順利啟動,並且應該可以透過 - &man.ssh.1; 方式來連。 本節將介紹如何建立 slice 分割、設定 - gmirror 以作 RAID-1、如何以 - sysinstall 來安裝 &os; - 作業系統的最小化安裝。 - - - 準備硬碟 - - 首先要作的是配置硬碟空間給 &os;,像是建立 slice 跟分割區。 - 很明顯地,目前在跑的作業系統是載入到系統記憶體內執行, - 因此要對硬碟配置並無任何問題。 這些工作可以用 - sysinstall 或者以 &man.fdisk.8; 搭配 - &man.bsdlabel.8; 來完成。 - - 首先先把各硬碟都先清空。 請對各硬碟作下列指令: - - &prompt.root; dd if=/dev/zero of=/dev/ad0 count=2 - - 接著,以您慣用的工具來建立 slice 以及設定 label。 通常會建議以 - 的 sysinstall 工具來作會比較輕鬆, - 或者是強而又不太會出槌的文字介面 &unix; 標準工具(像是 &man.fdisk.8;, - &man.bsdlabel.8;),這部分稍後也會一併介紹。 前者部分在 &os; Handbook - 的 安裝 - &os; 章節有相當詳盡的介紹,所以這邊主要要介紹的是如何建立 - RAID-1 系統以及 ZFS。 - 這邊會介紹建立以 &man.gmirror.8; 做成的小型 mirrored 檔案系統: - / (根目錄), /usr 以及 /var,而硬碟的其餘剩餘空間則通通以 - &man.zpool.8; 做成 ZFS 的 mirrored 檔案系統 - 。 請注意:必須要先把 &os; 作業系統裝好並開完機後,才能進行設定 - ZFS 檔案系統。 - - 下面的例子會介紹如何建立 slice 以及 label、在每個分割區上啟用 - &man.gmirror.8;、如何在每個 mirrored 分割區上建立 - UFS2 檔案系統: - - &prompt.root; fdisk -BI /dev/ad0 -&prompt.root; fdisk -BI /dev/ad1 -&prompt.root; bsdlabel -wB /dev/ad0s1 -&prompt.root; bsdlabel -wB /dev/ad1s1 -&prompt.root; bsdlabel -e /dev/ad0s1 -&prompt.root; bsdlabel /dev/ad0s1 > /tmp/bsdlabel.txt && bsdlabel -R /dev/ad1s1 /tmp/bsdlabel.txt -&prompt.root; gmirror label root /dev/ad[01]s1a -&prompt.root; gmirror label var /dev/ad[01]s1d -&prompt.root; gmirror label usr /dev/ad[01]s1e -&prompt.root; gmirror label -F swap /dev/ad[01]s1b -&prompt.root; newfs /dev/mirror/root -&prompt.root; newfs /dev/mirror/var -&prompt.root; newfs /dev/mirror/usr - - - - 對該硬碟建立 slice 並且在第零軌處將開機表作初始。 - 請對該機器所有硬碟都作此一動作。 - - - - 對各硬碟寫入 label 以及 bootstrap 碼。 - - - - 現在手動修改該硬碟的 label,至於如何建立分割區(partitions) - 請參閱 &man.bsdlabel.8; 說明。 - 分割區分別建立:a 是給 / (根目錄), - b 給 swap, - d/var, - e/usr, - 最後,會在稍後步驟把 f 給 - ZFS 使用。 - - - - 把剛剛的 label 設定先匯出,再匯入到第二顆硬碟上, - 如此一來兩邊的硬碟 label 設定就會同樣。 - - - - 在各分割區上啟用 &man.gmirror.8; - - - - 請注意: 選項是用在 swap 上。 - 這參數會讓 &man.gmirror.8; 認為該硬體是處於可靠狀態, - 即使發生電源故障或系統當掉,也不會去同步。 - - - - 在各個有做 mirror 的分割區上建立 UFS2 - 檔案系統 - - - - - - 系統安裝 - - 這裡是最重要的一環, - 本節介紹實際上如何在先前一節所做好的硬碟安裝最小化的 &os;, - 為了完成此一目標,所有檔案系統都必須掛載妥當,才能讓 - sysinstall 可以把 &os; 裝到硬碟內: - - &prompt.root; mount /dev/mirror/root /mnt -&prompt.root; mkdir /mnt/var /mnt/usr -&prompt.root; mount /dev/mirror/var /mnt/var -&prompt.root; mount /dev/mirror/usr /mnt/usr - - 做完上述動作之後,請執行 &man.sysinstall.8;。 請從主選單中選擇 - Custom 安裝,選 - OptionsEnter。 - 然後以方向鍵移動到 Install Root 處,按 - Space 鍵然後改為 /mnt,再按 Enter - 鍵以將修改值存起來,然後按 q 鍵即可離開這個 - Options 畫面。 - - - 請注意:本步驟極為重要,若忽略的話那麼 - sysinstall 就沒辦法安裝 &os;。 - - - 接著選 Distributions,然後移動游標到 - 處,按 Space 鍵。 - 本文之所以介紹最小化安裝是為了要節省網路流量,因為系統安裝是透過 - ftp 方式來進行。 要離開本畫面,請選 - 即可。 - - - 至於 Partition 及 - Label 步驟則可略過, - 因為這些目前已經都設定完畢了。 - - - Media 選單中請選 - 。 請選最近的 mirror 站,並且讓 - sysinstall 假設網路已經設妥。 - 接下來就會回到 Custom 選單。 - - 最後,按下 Commit 即可開始進行安裝。 - 完成安裝後,即可離開 sysinstall - - - - 後續安裝步驟 - - 此時 &os; 作業系統應該已經裝完,然而還有些後續流程要做。 - 必須要做一些後續設定,才能讓 &os; 可以開機跟登入。 - - 現在必須要用 &man.chroot.8; 以切到剛剛新裝好的系統內。 - 指令如下: - - &prompt.root; chroot /mnt - - 然後再打下列指令以繼續完成: - - - - GENERIC kernel 複製到 - /boot/kernel - 目錄: - - &prompt.root; cp -Rp /boot/GENERIC/* /boot/kernel - - - - 建立 /etc/rc.conf, - /etc/resolv.conf 及 - /etc/fstab 檔案。 別忘了,要記得在 - /etc/rc.conf 檔設相關網路設定,以及把 - sshd 啟用。 此外, - /etc/fstab 檔應該會長像下面這樣: - - # Device Mountpoint FStype Options Dump Pass# -/dev/mirror/swap none swap sw 0 0 -/dev/mirror/root / ufs rw 1 1 -/dev/mirror/usr /usr ufs rw 2 2 -/dev/mirror/var /var ufs rw 2 2 -/dev/cd0 /cdrom cd9660 ro,noauto 0 0 - - - - 新增 /boot/loader.conf 檔, - 並且內容填入下列: - - geom_mirror_load="YES" -zfs_load="YES" - - - - 執行下列指令,以在下次開機時啟用 ZFS - : - - &prompt.root; echo 'zfs_enable="YES"' >> /etc/rc.conf - - - - 使用 &man.adduser.8; 工具來新增其他使用者帳號。 別忘了, - 至少要有一個帳號得加入 wheel 群組, - 才能在重開機後以該帳號切換為 root。 - - - - 再次檢查上述相關的設定,是否有遺漏或打錯。 - - - - 現在該系統終於可以重開機了,請用 &man.reboot.8; - 指令以重開機。 - - - - - ZFS - - 系統重開機完畢之後,應該就可以登入了。 歡迎使用全新的 &os; 安裝方式, - 完全透過遠端而不必接上 remote console! - - 接下來只剩要調整 &man.zpool.8; 以及建立 &man.zfs.8; 檔案系統而已。 - ZFS 的建立及管理是相當淺顯易懂。 首先, - 建立 mirrored pool: - - &prompt.root; zpool create tank mirror /dev/ad[01]s1f - - 接著,建立檔案系統: - - &prompt.root; zfs create tank/ports -&prompt.root; zfs create tank/src -&prompt.root; zfs set compression=gzip tank/ports -&prompt.root; zfs set compression=on tank/src -&prompt.root; zfs set mountpoint=/usr/ports tank/ports -&prompt.root; zfs set mountpoint=/usr/src tank/src - - 一切就是這樣簡單。 若對 &os; 上的 ZFS - 細節部分有興趣,請參閱 &os; Wiki 上的 ZFS 一節說明。 - -
diff --git a/zh_TW.UTF-8/books/Makefile b/zh_TW.UTF-8/books/Makefile deleted file mode 100644 index 45eb550a9a..0000000000 --- a/zh_TW.UTF-8/books/Makefile +++ /dev/null @@ -1,13 +0,0 @@ -# $FreeBSD$ - -SUBDIR = developers-handbook -SUBDIR+= faq -SUBDIR+= fdp-primer -SUBDIR+= handbook -SUBDIR+= porters-handbook -#SUBDIR+= zh-tut - -ROOT_SYMLINKS = faq fdp-primer handbook porters-handbook - -DOC_PREFIX?= ${.CURDIR}/../.. -.include "${DOC_PREFIX}/share/mk/doc.project.mk" diff --git a/zh_TW.UTF-8/books/Makefile.inc b/zh_TW.UTF-8/books/Makefile.inc deleted file mode 100644 index dd9acff37a..0000000000 --- a/zh_TW.UTF-8/books/Makefile.inc +++ /dev/null @@ -1,5 +0,0 @@ -# -# $FreeBSD$ -# - -DESTDIR?= ${DOCDIR}/zh_TW.UTF-8/books/${.CURDIR:T} diff --git a/zh_TW.UTF-8/books/developers-handbook/Makefile b/zh_TW.UTF-8/books/developers-handbook/Makefile deleted file mode 100644 index 81fed7b836..0000000000 --- a/zh_TW.UTF-8/books/developers-handbook/Makefile +++ /dev/null @@ -1,42 +0,0 @@ -# -# $FreeBSD$ -# -# Build the FreeBSD Developers' Handbook. -# - -MAINTAINER=doc@FreeBSD.org - -DOC?= book - -FORMATS?= html-split - -INSTALL_COMPRESSED?= gz -INSTALL_ONLY_COMPRESSED?= - -# Images -IMAGES_EN= sockets/layers.eps sockets/sain.eps sockets/sainfill.eps sockets/sainlsb.eps sockets/sainmsb.eps sockets/sainserv.eps sockets/serv.eps sockets/serv2.eps sockets/slayers.eps - -# -# SRCS lists the individual XML files that make up the document. Changes -# to any of these files will force a rebuild -# - -# XML content -SRCS= book.xml -SRCS+= introduction/chapter.xml -SRCS+= ipv6/chapter.xml -SRCS+= kerneldebug/chapter.xml -SRCS+= l10n/chapter.xml -SRCS+= policies/chapter.xml -SRCS+= secure/chapter.xml -SRCS+= sockets/chapter.xml -SRCS+= testing/chapter.xml -SRCS+= tools/chapter.xml -SRCS+= x86/chapter.xml - -# Entities - -URL_RELPREFIX?= ../../../.. -DOC_PREFIX?= ${.CURDIR}/../../.. - -.include "${DOC_PREFIX}/share/mk/doc.project.mk" diff --git a/zh_TW.UTF-8/books/developers-handbook/book.xml b/zh_TW.UTF-8/books/developers-handbook/book.xml deleted file mode 100644 index 6b48de373f..0000000000 --- a/zh_TW.UTF-8/books/developers-handbook/book.xml +++ /dev/null @@ -1,183 +0,0 @@ - - %chapters; -]> - - - FreeBSD Developers' Handbook - - - FreeBSD 文件計畫 - - August 2000 - - - 2000 - 2001 - 2002 - 2003 - 2004 - 2005 - 2006 - 2007 - The FreeBSD Documentation Project - - - &legalnotice; - - - &tm-attrib.freebsd; - &tm-attrib.apple; - &tm-attrib.ibm; - &tm-attrib.ieee; - &tm-attrib.intel; - &tm-attrib.linux; - &tm-attrib.microsoft; - &tm-attrib.opengroup; - &tm-attrib.sun; - &tm-attrib.general; - - - $FreeBSD$ - - - - 歡迎使用 Developers' Handbook! - 這份文件是由許多人 不斷撰寫 而成的, - 而且許多章節仍需更新或者內容還是一片空白, - 如果你想幫忙 FreeBSD 文件計劃, - 請寄信到 &a.doc;。 - - - - 最新版的文件都在 FreeBSD 官網 上面, - 也可從 FreeBSD FTP server 下載不同格式的資料。 - 當然也可以在其他的 mirror站下載。 - - - - - - - 基本概念 - - &chap.introduction; - &chap.tools; - &chap.secure; - &chap.l10n; - &chap.policies; - &chap.testing; - - - - Interprocess Communication(IPC) - - &chap.sockets; - &chap.ipv6; - - - - - Kernel(核心) - - &chap.kerneldebug; - - - - - Architectures(電腦架構) - - &chap.x86; - - - - - 附錄 - - - - - - DaveAPatterson - JohnLHennessy - - 1998Morgan Kaufmann Publishers, - Inc. - 1-55860-428-6 - - Morgan Kaufmann Publishers, Inc. - - Computer Organization and Design - The Hardware / Software Interface - 1-2 - - - - - W.RichardStevens - - 1993Addison Wesley Longman, - Inc. - 0-201-56317-7 - - Addison Wesley Longman, Inc. - - Advanced Programming in the Unix Environment - 1-2 - - - - - MarshallKirkMcKusick - KeithBostic - MichaelJKarels - JohnSQuarterman - - 1996Addison-Wesley Publishing Company, - Inc. - 0-201-54979-4 - - Addison-Wesley Publishing Company, Inc. - - The Design and Implementation of the 4.4 BSD Operating System - 1-2 - - - - - AlephOne - - Phrack 49; "Smashing the Stack for Fun and Profit" - - - - - ChrispinCowan - CaltonPu - DaveMaier - - StackGuard; Automatic Adaptive Detection and Prevention of - Buffer-Overflow Attacks - - - - - ToddMiller - Theode Raadt - - strlcpy and strlcat -- consistent, safe string copy and - concatenation. - - - - - &chap.index; - - - diff --git a/zh_TW.UTF-8/books/developers-handbook/chapters.ent b/zh_TW.UTF-8/books/developers-handbook/chapters.ent deleted file mode 100644 index 481ce9a436..0000000000 --- a/zh_TW.UTF-8/books/developers-handbook/chapters.ent +++ /dev/null @@ -1,33 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - -"> diff --git a/zh_TW.UTF-8/books/developers-handbook/introduction/chapter.xml b/zh_TW.UTF-8/books/developers-handbook/introduction/chapter.xml deleted file mode 100644 index 636eff06d5..0000000000 --- a/zh_TW.UTF-8/books/developers-handbook/introduction/chapter.xml +++ /dev/null @@ -1,186 +0,0 @@ - - - - 簡介 - - MurrayStokelyContributed by - JeroenRuigrok van der Werven - - - - - - 在 FreeBSD 開發程式 - 好了我們開始吧!我想你的 FreeBSD 已經安裝好了,而且已經準備好要用它寫點程式了吧? - 但是要從哪裡開始呢?&os; 有提供寫程式的程式或環境嗎? - 身為 programer 的我可以做什麼呢? - - 本章試著回答你一些問題,當然,單就 programming 程度來說可分很多種層次, - 有的人只是單純當興趣,有的則是他的專業, - 本章主要內容是針對程式初學者, - 當然,對於那些不熟 &os; 的程式開發者而言,本文件內容也是十分實用的。 - - - - The BSD Vision - - 為了讓你寫出來的程式在 &unix; like系統上具有良好的使用性、效能和穩定性, - 我們必須跟你介紹一些程式概念(original software tools ideology)。 - - - - 程式架構指南 - - 我們想介紹的概念如下 - - - - 在整個程式還沒寫完前,不要增加新的功能。 - - 另外一個重點就是,讓你自己選擇你的程式將會具有何種功能, - 而不是讓別人決定,不想要去滿足全世界的需求,除非你想讓你的程式具有擴充性或相容性。 - - 千萬記住:在沒有相關經驗時,參考範例程式碼所寫出來的程式, - 會比自己憑空寫出來的好。 - - 當你寫的程式沒辦法完全解決問題時,最好的方法就是不要試著要去解決它。 - - 若用 10% 的心力就能輕鬆完成 90% 的工作份量,就用這個簡單法子吧。 - - 盡可能地簡化問題的複雜。 - - 提供機制(mechanism),而非原則(policy)。 - 比方說,把使用者介面選擇權交由使用者來決定。 - - - - 以上摘自 Scheifler & Gettys 的 "X Window System" 論文 - - - - - <filename>/usr/src</filename> 的架構 - - 完整的 FreeBSD 原始碼都在公開的 CVS repository 中。 - 通常 FreeBSD 原始碼都會裝在 /usr/src, - 而且包含下列子目錄: - - - - - - - Directory - Description - - - - - - bin/ - Source for files in - /bin - - - - contrib/ - Source for files from contributed software. - - - - crypto/ - Cryptographical sources - - - - etc/ - Source for files in /etc - - - - games/ - Source for files in /usr/games - - - - gnu/ - Utilities covered by the GNU Public License - - - - include/ - Source for files in /usr/include - - - - kerberos5/ - Source for Kerberos version 5 - - - - lib/ - Source for files in /usr/lib - - - - libexec/ - Source for files in /usr/libexec - - - - release/ - Files required to produce a FreeBSD release - - - - rescue/ - Build system for the - /rescue utilities - - - - sbin/ - Source for files in /sbin - - - - secure/ - FreeSec sources - - - - share/ - Source for files in /usr/share - - - - sys/ - Kernel source files - - - - tools/ - Tools used for maintenance and testing of - FreeBSD - - - - usr.bin/ - Source for files in /usr/bin - - - - usr.sbin/ - Source for files in /usr/sbin - - - - - - - diff --git a/zh_TW.UTF-8/books/developers-handbook/ipv6/chapter.xml b/zh_TW.UTF-8/books/developers-handbook/ipv6/chapter.xml deleted file mode 100644 index a7b78244fb..0000000000 --- a/zh_TW.UTF-8/books/developers-handbook/ipv6/chapter.xml +++ /dev/null @@ -1,1571 +0,0 @@ - - - - IPv6 Internals - - - IPv6/IPsec Implementation - - YoshinobuInoueContributed by - - - - - - - This section should explain IPv6 and IPsec related implementation - internals. These functionalities are derived from KAME project - - - IPv6 - - - Conformance - - The IPv6 related functions conforms, or tries to conform to - the latest set of IPv6 specifications. For future reference we list - some of the relevant documents below (NOTE: this - is not a complete list - this is too hard to maintain...). - - For details please refer to specific chapter in the document, - RFCs, manual pages, or comments in the source code. - - Conformance tests have been performed on the KAME STABLE kit - at TAHI project. Results can be viewed at - http://www.tahi.org/report/KAME/. - We also attended Univ. of New Hampshire IOL tests - (http://www.iol.unh.edu/) in the - past, with our past snapshots. - - - - RFC1639: FTP Operation Over Big Address Records - (FOOBAR) - - - RFC2428 is preferred over RFC1639. FTP clients will - first try RFC2428, then RFC1639 if failed. - - - - - - RFC1886: DNS Extensions to support IPv6 - - - - RFC1933: Transition Mechanisms for IPv6 Hosts and - Routers - - - IPv4 compatible address is not supported. - - - automatic tunneling (described in 4.3 of this RFC) is not - supported. - - - &man.gif.4; interface implements IPv[46]-over-IPv[46] - tunnel in a generic way, and it covers "configured tunnel" - described in the spec. See 23.5.1.5 - in this document for details. - - - - - - RFC1981: Path MTU Discovery for IPv6 - - - - RFC2080: RIPng for IPv6 - - - usr.sbin/route6d support this. - - - - - - RFC2292: Advanced Sockets API for IPv6 - - - For supported library functions/kernel APIs, see - sys/netinet6/ADVAPI. - - - - - - RFC2362: Protocol Independent Multicast-Sparse - Mode (PIM-SM) - - - RFC2362 defines packet formats for PIM-SM. - draft-ietf-pim-ipv6-01.txt is - written based on this. - - - - - - RFC2373: IPv6 Addressing Architecture - - - supports node required addresses, and conforms to - the scope requirement. - - - - - - RFC2374: An IPv6 Aggregatable Global Unicast Address - Format - - - supports 64-bit length of Interface ID. - - - - - - RFC2375: IPv6 Multicast Address Assignments - - - Userland applications use the well-known addresses - assigned in the RFC. - - - - - - RFC2428: FTP Extensions for IPv6 and NATs - - - RFC2428 is preferred over RFC1639. FTP clients will - first try RFC2428, then RFC1639 if failed. - - - - - - RFC2460: IPv6 specification - - - - RFC2461: Neighbor discovery for IPv6 - - - See 23.5.1.2 - in this document for details. - - - - - - RFC2462: IPv6 Stateless Address Autoconfiguration - - - See 23.5.1.4 in this - document for details. - - - - - - RFC2463: ICMPv6 for IPv6 specification - - - See 23.5.1.9 in this - document for details. - - - - - - RFC2464: Transmission of IPv6 Packets over Ethernet - Networks - - - - RFC2465: MIB for IPv6: Textual Conventions and General - Group - - - Necessary statistics are gathered by the kernel. Actual - IPv6 MIB support is provided as a patchkit for ucd-snmp. - - - - - - RFC2466: MIB for IPv6: ICMPv6 group - - - Necessary statistics are gathered by the kernel. Actual - IPv6 MIB support is provided as patchkit for ucd-snmp. - - - - - - RFC2467: Transmission of IPv6 Packets over FDDI - Networks - - - - RFC2497: Transmission of IPv6 packet over ARCnet - Networks - - - - RFC2553: Basic Socket Interface Extensions for IPv6 - - - IPv4 mapped address (3.7) and special behavior of IPv6 - wildcard bind socket (3.8) are supported. See 23.5.1.12 - in this document for details. - - - - - - RFC2675: IPv6 Jumbograms - - - See 23.5.1.7 in - this document for details. - - - - - - RFC2710: Multicast Listener Discovery for IPv6 - - - - RFC2711: IPv6 router alert option - - - - draft-ietf-ipngwg-router-renum-08: Router - renumbering for IPv6 - - - - draft-ietf-ipngwg-icmp-namelookups-02: - IPv6 Name Lookups Through ICMP - - - - draft-ietf-ipngwg-icmp-name-lookups-03: - IPv6 Name Lookups Through ICMP - - - - draft-ietf-pim-ipv6-01.txt: - PIM for IPv6 - - - &man.pim6dd.8; implements dense mode. &man.pim6sd.8; - implements sparse mode. - - - - - - draft-itojun-ipv6-tcp-to-anycast-00: - Disconnecting TCP connection toward IPv6 anycast address - - - - draft-yamamoto-wideipv6-comm-model-00 - - - - See 23.5.1.6 in this - document for details. - - - - - - draft-ietf-ipngwg-scopedaddr-format-00.txt - : An Extension of Format for IPv6 Scoped - Addresses - - - - - - Neighbor Discovery - - Neighbor Discovery is fairly stable. Currently Address - Resolution, Duplicated Address Detection, and Neighbor Unreachability - Detection are supported. In the near future we will be adding Proxy - Neighbor Advertisement support in the kernel and Unsolicited Neighbor - Advertisement transmission command as admin tool. - - If DAD fails, the address will be marked "duplicated" and - message will be generated to syslog (and usually to console). The - "duplicated" mark can be checked with &man.ifconfig.8;. It is - administrators' responsibility to check for and recover from DAD - failures. The behavior should be improved in the near future. - - Some of the network driver loops multicast packets back to itself, - even if instructed not to do so (especially in promiscuous mode). - In such cases DAD may fail, because DAD engine sees inbound NS packet - (actually from the node itself) and considers it as a sign of duplicate. - You may want to look at #if condition marked "heuristics" in - sys/netinet6/nd6_nbr.c:nd6_dad_timer() as workaround (note that the code - fragment in "heuristics" section is not spec conformant). - - Neighbor Discovery specification (RFC2461) does not talk about - neighbor cache handling in the following cases: - - - - when there was no neighbor cache entry, node - received unsolicited RS/NS/NA/redirect packet without - link-layer address - - - neighbor cache handling on medium without link-layer - address (we need a neighbor cache entry for IsRouter bit) - - - - For first case, we implemented workaround based on discussions - on IETF ipngwg mailing list. For more details, see the comments in - the source code and email thread started from (IPng 7155), dated - Feb 6 1999. - - IPv6 on-link determination rule (RFC2461) is quite different - from assumptions in BSD network code. At this moment, no on-link - determination rule is supported where default router list is empty - (RFC2461, section 5.2, last sentence in 2nd paragraph - note that - the spec misuse the word "host" and "node" in several places in - the section). - - To avoid possible DoS attacks and infinite loops, only 10 - options on ND packet is accepted now. Therefore, if you have 20 - prefix options attached to RA, only the first 10 prefixes will be - recognized. If this troubles you, please ask it on FREEBSD-CURRENT - mailing list and/or modify nd6_maxndopt in - sys/netinet6/nd6.c. If there are high demands - we may provide sysctl knob for the variable. - - - - Scope Index - - IPv6 uses scoped addresses. Therefore, it is very important to - specify scope index (interface index for link-local address, or - site index for site-local address) with an IPv6 address. Without - scope index, scoped IPv6 address is ambiguous to the kernel, and - kernel will not be able to determine the outbound interface for a - packet. - - Ordinary userland applications should use advanced API - (RFC2292) to specify scope index, or interface index. For similar - purpose, sin6_scope_id member in sockaddr_in6 structure is defined - in RFC2553. However, the semantics for sin6_scope_id is rather vague. - If you care about portability of your application, we suggest you to - use advanced API rather than sin6_scope_id. - - In the kernel, an interface index for link-local scoped address is - embedded into 2nd 16bit-word (3rd and 4th byte) in IPv6 address. For - example, you may see something like: - - - fe80:1::200:f8ff:fe01:6317 - - - in the routing table and interface address structure (struct - in6_ifaddr). The address above is a link-local unicast address - which belongs to a network interface whose interface identifier is 1. - The embedded index enables us to identify IPv6 link local - addresses over multiple interfaces effectively and with only a - little code change. - - Routing daemons and configuration programs, like &man.route6d.8; - and &man.ifconfig.8;, will need to manipulate the "embedded" scope - index. These programs use routing sockets and ioctls (like - SIOCGIFADDR_IN6) and the kernel API will return IPv6 addresses with - 2nd 16bit-word filled in. The APIs are for manipulating kernel - internal structure. Programs that use these APIs have to be prepared - about differences in kernels anyway. - - When you specify scoped address to the command line, NEVER write - the embedded form (such as ff02:1::1 or fe80:2::fedc). This is not - supposed to work. Always use standard form, like ff02::1 or - fe80::fedc, with command line option for specifying interface (like - ping6 -I ne0 ff02::1). In general, if a command - does not have command line option to specify outgoing interface, that - command is not ready to accept scoped address. This may seem to be - opposite from IPv6's premise to support "dentist office" situation. - We believe that specifications need some improvements for this. - - Some of the userland tools support extended numeric IPv6 syntax, - as documented in - draft-ietf-ipngwg-scopedaddr-format-00.txt. You - can specify outgoing link, by using name of the outgoing interface - like "fe80::1%ne0". This way you will be able to specify link-local - scoped address without much trouble. - - To use this extension in your program, you will need to use - &man.getaddrinfo.3;, and &man.getnameinfo.3; with NI_WITHSCOPEID. - The implementation currently assumes 1-to-1 relationship between a - link and an interface, which is stronger than what specs say. - - - - Plug and Play - - Most of the IPv6 stateless address autoconfiguration is implemented - in the kernel. Neighbor Discovery functions are implemented in the - kernel as a whole. Router Advertisement (RA) input for hosts is - implemented in the kernel. Router Solicitation (RS) output for - endhosts, RS input for routers, and RA output for routers are - implemented in the userland. - - - Assignment of link-local, and special addresses - - IPv6 link-local address is generated from IEEE802 address - (Ethernet MAC address). Each of interface is assigned an IPv6 - link-local address automatically, when the interface becomes up - (IFF_UP). Also, direct route for the link-local address is added - to routing table. - - Here is an output of netstat command: - -Internet6: -Destination Gateway Flags Netif Expire -fe80:1::%ed0/64 link#1 UC ed0 -fe80:2::%ep0/64 link#2 UC ep0 - - Interfaces that has no IEEE802 address (pseudo interfaces - like tunnel interfaces, or ppp interfaces) will borrow IEEE802 - address from other interfaces, such as Ethernet interfaces, - whenever possible. If there is no IEEE802 hardware attached, - a last resort pseudo-random value, MD5(hostname), will - be used as source of link-local address. If it is not suitable - for your usage, you will need to configure the link-local address - manually. - - If an interface is not capable of handling IPv6 (such as - lack of multicast support), link-local address will not be - assigned to that interface. See section 2 for details. - - Each interface joins the solicited multicast address and the - link-local all-nodes multicast addresses (e.g. fe80::1:ff01:6317 - and ff02::1, respectively, on the link the interface is attached). - In addition to a link-local address, the loopback address (::1) - will be assigned to the loopback interface. Also, ::1/128 and - ff01::/32 are automatically added to routing table, and loopback - interface joins node-local multicast group ff01::1. - - - - Stateless address autoconfiguration on hosts - - In IPv6 specification, nodes are separated into two categories: - routers and hosts. Routers - forward packets addressed to others, hosts does not forward the - packets. net.inet6.ip6.forwarding defines whether this node is - router or host (router if it is 1, host if it is 0). - - When a host hears Router Advertisement from the router, a host - may autoconfigure itself by stateless address autoconfiguration. - This behavior can be controlled by net.inet6.ip6.accept_rtadv (host - autoconfigures itself if it is set to 1). By autoconfiguration, - network address prefix for the receiving interface (usually global - address prefix) is added. Default route is also configured. - Routers periodically generate Router Advertisement packets. To - request an adjacent router to generate RA packet, a host can - transmit Router Solicitation. To generate a RS packet at any time, - use the rtsol command. &man.rtsold.8; daemon is - also available. &man.rtsold.8; generates Router Solicitation whenever - necessary, and it works great for nomadic usage (notebooks/laptops). - If one wishes to ignore Router Advertisements, use sysctl to set - net.inet6.ip6.accept_rtadv to 0. - - To generate Router Advertisement from a router, use the - &man.rtadvd.8; daemon. - - Note that, IPv6 specification assumes the following items, and - nonconforming cases are left unspecified: - - - - Only hosts will listen to router advertisements - - - Hosts have single network interface (except loopback) - - - - Therefore, this is unwise to enable net.inet6.ip6.accept_rtadv - on routers, or multi-interface host. A misconfigured node can - behave strange (nonconforming configuration allowed for those who - would like to do some experiments). - - To summarize the sysctl knob: - - accept_rtadv forwarding role of the node - --- --- --- - 0 0 host (to be manually configured) - 0 1 router - 1 0 autoconfigured host - (spec assumes that host has single - interface only, autoconfigured host - with multiple interface is - out-of-scope) - 1 1 invalid, or experimental - (out-of-scope of spec) - - RFC2462 has validation rule against incoming RA prefix - information option, in 5.5.3 (e). This is to protect hosts from - malicious (or misconfigured) routers that advertise very short - prefix lifetime. There was an update from Jim Bound to ipngwg - mailing list (look for "(ipng 6712)" in the archive) and it is - implemented Jim's update. - - See 23.5.1.2 in - the document for relationship between DAD and - autoconfiguration. - - - - - Generic tunnel interface - - GIF (Generic InterFace) is a pseudo interface for configured - tunnel. Details are described in &man.gif.4;. Currently - - - - v6 in v6 - - - v6 in v4 - - - v4 in v6 - - - v4 in v4 - - - - are available. Use &man.gifconfig.8; to assign physical (outer) - source and destination address to gif interfaces. Configuration that - uses same address family for inner and outer IP header (v4 in v4, or - v6 in v6) is dangerous. It is very easy to configure interfaces and - routing tables to perform infinite level of tunneling. - Please be warned. - - gif can be configured to be ECN-friendly. See 23.5.4.5 for ECN-friendliness of - tunnels, and &man.gif.4; for how to configure. - - If you would like to configure an IPv4-in-IPv6 tunnel with gif - interface, read &man.gif.4; carefully. You will need to - remove IPv6 link-local address automatically assigned to the gif - interface. - - - - Source Address Selection - - Current source selection rule is scope oriented (there are some - exceptions - see below). For a given destination, a source IPv6 - address is selected by the following rule: - - - - If the source address is explicitly specified by - the user (e.g. via the advanced API), the specified address - is used. - - - - If there is an address assigned to the outgoing - interface (which is usually determined by looking up the - routing table) that has the same scope as the destination - address, the address is used. - - This is the most typical case. - - - - If there is no address that satisfies the above - condition, choose a global address assigned to one of - the interfaces on the sending node. - - - - If there is no address that satisfies the above condition, - and destination address is site local scope, choose a site local - address assigned to one of the interfaces on the sending node. - - - - - If there is no address that satisfies the above condition, - choose the address associated with the routing table entry for the - destination. This is the last resort, which may cause scope - violation. - - - - For instance, ::1 is selected for ff01::1, - fe80:1::200:f8ff:fe01:6317 for fe80:1::2a0:24ff:feab:839b (note - that embedded interface index - described in 23.5.1.3 - helps us - choose the right source address. Those embedded indices will not - be on the wire). If the outgoing interface has multiple address for - the scope, a source is selected longest match basis (rule 3). Suppose - 3ffe:501:808:1:200:f8ff:fe01:6317 and 3ffe:2001:9:124:200:f8ff:fe01:6317 - are given to the outgoing interface. 3ffe:501:808:1:200:f8ff:fe01:6317 - is chosen as the source for the destination 3ffe:501:800::1. - - Note that the above rule is not documented in the IPv6 spec. - It is considered "up to implementation" item. There are some cases - where we do not use the above rule. One example is connected TCP - session, and we use the address kept in tcb as the source. Another - example is source address for Neighbor Advertisement. Under the spec - (RFC2461 7.2.2) NA's source should be the target address of the - corresponding NS's target. In this case we follow the spec rather - than the above longest-match rule. - - For new connections (when rule 1 does not apply), deprecated - addresses (addresses with preferred lifetime = 0) will not be chosen - as source address if other choices are available. If no other choices - are available, deprecated address will be used as a last resort. If - there are multiple choice of deprecated addresses, the above scope - rule will be used to choose from those deprecated addresses. If you - would like to prohibit the use of deprecated address for some reason, - configure net.inet6.ip6.use_deprecated to 0. The issue related to - deprecated address is described in RFC2462 5.5.4 (NOTE: there is - some debate underway in IETF ipngwg on how to use "deprecated" - address). - - - - Jumbo Payload - - The Jumbo Payload hop-by-hop option is implemented and can - be used to send IPv6 packets with payloads longer than 65,535 octets. - But currently no physical interface whose MTU is more than 65,535 is - supported, so such payloads can be seen only on the loopback - interface (i.e. lo0). - - If you want to try jumbo payloads, you first have to reconfigure - the kernel so that the MTU of the loopback interface is more than - 65,535 bytes; add the following to the kernel configuration file: - - - options "LARGE_LOMTU" #To test jumbo payload - - - and recompile the new kernel. - - Then you can test jumbo payloads by the &man.ping6.8; command - with -b and -s options. The -b option must be specified to enlarge - the size of the socket buffer and the -s option specifies the length - of the packet, which should be more than 65,535. For example, - type as follows: - - &prompt.user; ping6 -b 70000 -s 68000 ::1 - - The IPv6 specification requires that the Jumbo Payload option - must not be used in a packet that carries a fragment header. If - this condition is broken, an ICMPv6 Parameter Problem message must - be sent to the sender. specification is followed, but you cannot - usually see an ICMPv6 error caused by this requirement. - - When an IPv6 packet is received, the frame length is checked and - compared to the length specified in the payload length field of the - IPv6 header or in the value of the Jumbo Payload option, if any. If - the former is shorter than the latter, the packet is discarded and - statistics are incremented. You can see the statistics as output of - &man.netstat.8; command with `-s -p ip6' option: - - &prompt.user; netstat -s -p ip6 - ip6: - (snip) - 1 with data size < data length - - So, kernel does not send an ICMPv6 error unless the erroneous - packet is an actual Jumbo Payload, that is, its packet size is more - than 65,535 bytes. As described above, currently no physical interface - with such a huge MTU is supported, so it rarely returns an - ICMPv6 error. - - TCP/UDP over jumbogram is not supported at this moment. This - is because we have no medium (other than loopback) to test this. - Contact us if you need this. - - IPsec does not work on jumbograms. This is due to some - specification twists in supporting AH with jumbograms (AH header - size influences payload length, and this makes it real hard to - authenticate inbound packet with jumbo payload option as well as AH). - - - There are fundamental issues in *BSD support for jumbograms. - We would like to address those, but we need more time to finalize - these. To name a few: - - - - mbuf pkthdr.len field is typed as "int" in 4.4BSD, so - it will not hold jumbogram with len > 2G on 32bit architecture - CPUs. If we would like to support jumbogram properly, the field - must be expanded to hold 4G + IPv6 header + link-layer header. - Therefore, it must be expanded to at least int64_t - (u_int32_t is NOT enough). - - - - We mistakingly use "int" to hold packet length in many - places. We need to convert them into larger integral type. - It needs a great care, as we may experience overflow during - packet length computation. - - - - We mistakingly check for ip6_plen field of IPv6 header - for packet payload length in various places. We should be - checking mbuf pkthdr.len instead. ip6_input() will perform - sanity check on jumbo payload option on input, and we can - safely use mbuf pkthdr.len afterwards. - - - - TCP code needs a careful update in bunch of places, of - course. - - - - - - Loop prevention in header processing - - IPv6 specification allows arbitrary number of extension headers - to be placed onto packets. If we implement IPv6 packet processing - code in the way BSD IPv4 code is implemented, kernel stack may - overflow due to long function call chain. sys/netinet6 code - is carefully designed to avoid kernel stack overflow. Because of - this, sys/netinet6 code defines its own protocol switch - structure, as "struct ip6protosw" (see - netinet6/ip6protosw.h). There is no such - update to IPv4 part (sys/netinet) for compatibility, but small - change is added to its pr_input() prototype. So "struct ipprotosw" - is also defined. Because of this, if you receive IPsec-over-IPv4 - packet with massive number of IPsec headers, kernel stack may blow - up. IPsec-over-IPv6 is okay. (Off-course, for those all IPsec - headers to be processed, each such IPsec header must pass each - IPsec check. So an anonymous attacker will not be able to do such an - attack.) - - - - ICMPv6 - - After RFC2463 was published, IETF ipngwg has decided to - disallow ICMPv6 error packet against ICMPv6 redirect, to prevent - ICMPv6 storm on a network medium. This is already implemented - into the kernel. - - - - Applications - - For userland programming, we support IPv6 socket API as - specified in RFC2553, RFC2292 and upcoming Internet drafts. - - TCP/UDP over IPv6 is available and quite stable. You can - enjoy &man.telnet.1;, &man.ftp.1;, &man.rlogin.1;, &man.rsh.1;, - &man.ssh.1;, etc. These applications are protocol independent. - That is, they automatically chooses IPv4 or IPv6 according to DNS. - - - - - Kernel Internals - - While ip_forward() calls ip_output(), ip6_forward() directly - calls if_output() since routers must not divide IPv6 packets into - fragments. - - ICMPv6 should contain the original packet as long as possible - up to 1280. UDP6/IP6 port unreach, for instance, should contain - all extension headers and the *unchanged* UDP6 and IP6 headers. - So, all IP6 functions except TCP never convert network byte - order into host byte order, to save the original packet. - - tcp_input(), udp6_input() and icmp6_input() can not assume that - IP6 header is preceding the transport headers due to extension - headers. So, in6_cksum() was implemented to handle packets whose IP6 - header and transport header is not continuous. TCP/IP6 nor UDP6/IP6 - header structures do not exist for checksum calculation. - - To process IP6 header, extension headers and transport headers - easily, network drivers are now required to store packets in one - internal mbuf or one or more external mbufs. A typical old driver - prepares two internal mbufs for 96 - 204 bytes data, however, now - such packet data is stored in one external mbuf. - - netstat -s -p ip6 tells you whether or not - your driver conforms such requirement. In the following example, - "cce0" violates the requirement. (For more information, refer to - Section 2.) - - Mbuf statistics: - 317 one mbuf - two or more mbuf:: - lo0 = 8 - cce0 = 10 - 3282 one ext mbuf - 0 two or more ext mbuf - - - Each input function calls IP6_EXTHDR_CHECK in the beginning to - check if the region between IP6 and its header is continuous. - IP6_EXTHDR_CHECK calls m_pullup() only if the mbuf has M_LOOP flag, - that is, the packet comes from the loopback interface. m_pullup() - is never called for packets coming from physical network interfaces. - - - Both IP and IP6 reassemble functions never call m_pullup(). - - - - IPv4 mapped address and IPv6 wildcard socket - - RFC2553 describes IPv4 mapped address (3.7) and special behavior - of IPv6 wildcard bind socket (3.8). The spec allows you to: - - - Accept IPv4 connections by AF_INET6 wildcard bind - socket. - - - Transmit IPv4 packet over AF_INET6 socket by using - special form of the address like ::ffff:10.1.1.1. - - - - but the spec itself is very complicated and does not specify - how the socket layer should behave. Here we call the former one - "listening side" and the latter one "initiating side", for - reference purposes. - - You can perform wildcard bind on both of the address families, - on the same port. - - The following table show the behavior of FreeBSD 4.x. - - listening side initiating side - (AF_INET6 wildcard (connection to ::ffff:10.1.1.1) - socket gets IPv4 conn.) - --- --- -FreeBSD 4.x configurable supported - default: enabled - - - The following sections will give you more details, and how you can - configure the behavior. - - Comments on listening side: - - It looks that RFC2553 talks too little on wildcard bind issue, - especially on the port space issue, failure mode and relationship - between AF_INET/INET6 wildcard bind. There can be several separate - interpretation for this RFC which conform to it but behaves differently. - So, to implement portable application you should assume nothing - about the behavior in the kernel. Using &man.getaddrinfo.3; is the - safest way. Port number space and wildcard bind issues were discussed - in detail on ipv6imp mailing list, in mid March 1999 and it looks - that there is no concrete consensus (means, up to implementers). - You may want to check the mailing list archives. - - If a server application would like to accept IPv4 and IPv6 - connections, there will be two alternatives. - - One is using AF_INET and AF_INET6 socket (you will need two - sockets). Use &man.getaddrinfo.3; with AI_PASSIVE into ai_flags, - and &man.socket.2; and &man.bind.2; to all the addresses returned. - By opening multiple sockets, you can accept connections onto the - socket with proper address family. IPv4 connections will be - accepted by AF_INET socket, and IPv6 connections will be accepted - by AF_INET6 socket. - - Another way is using one AF_INET6 wildcard bind socket. Use - &man.getaddrinfo.3; with AI_PASSIVE into ai_flags and with - AF_INET6 into ai_family, and set the 1st argument hostname to - NULL. And &man.socket.2; and &man.bind.2; to the address returned. - (should be IPv6 unspecified addr). You can accept either of IPv4 - and IPv6 packet via this one socket. - - To support only IPv6 traffic on AF_INET6 wildcard binded socket - portably, always check the peer address when a connection is made - toward AF_INET6 listening socket. If the address is IPv4 mapped - address, you may want to reject the connection. You can check the - condition by using IN6_IS_ADDR_V4MAPPED() macro. - - To resolve this issue more easily, there is system dependent - &man.setsockopt.2; option, IPV6_BINDV6ONLY, used like below. - - int on; - - setsockopt(s, IPPROTO_IPV6, IPV6_BINDV6ONLY, - (char *)&on, sizeof (on)) < 0)); - - - When this call succeed, then this socket only receive IPv6 - packets. - - Comments on initiating side: - - Advise to application implementers: to implement a portable - IPv6 application (which works on multiple IPv6 kernels), we believe - that the following is the key to the success: - - - - NEVER hardcode AF_INET nor AF_INET6. - - - - Use &man.getaddrinfo.3; and &man.getnameinfo.3; - throughout the system. Never use gethostby*(), getaddrby*(), - inet_*() or getipnodeby*(). (To update existing applications - to be IPv6 aware easily, sometime getipnodeby*() will be - useful. But if possible, try to rewrite the code to use - &man.getaddrinfo.3; and &man.getnameinfo.3;.) - - - - If you would like to connect to destination, use - &man.getaddrinfo.3; and try all the destination returned, - like &man.telnet.1; does. - - - - Some of the IPv6 stack is shipped with buggy - &man.getaddrinfo.3;. Ship a minimal working version with - your application and use that as last resort. - - - - If you would like to use AF_INET6 socket for both IPv4 and - IPv6 outgoing connection, you will need to use &man.getipnodebyname.3;. - When you would like to update your existing application to be IPv6 - aware with minimal effort, this approach might be chosen. But please - note that it is a temporal solution, because &man.getipnodebyname.3; - itself is not recommended as it does not handle scoped IPv6 addresses - at all. For IPv6 name resolution, &man.getaddrinfo.3; is the - preferred API. So you should rewrite your application to use - &man.getaddrinfo.3;, when you get the time to do it. - - When writing applications that make outgoing connections, - story goes much simpler if you treat AF_INET and AF_INET6 as totally - separate address family. {set,get}sockopt issue goes simpler, - DNS issue will be made simpler. We do not recommend you to rely - upon IPv4 mapped address. - - - unified tcp and inpcb code - - FreeBSD 4.x uses shared tcp code between IPv4 and IPv6 - (from sys/netinet/tcp*) and separate udp4/6 code. It uses - unified inpcb structure. - - The platform can be configured to support IPv4 mapped address. - Kernel configuration is summarized as follows: - - - - By default, AF_INET6 socket will grab IPv4 - connections in certain condition, and can initiate - connection to IPv4 destination embedded in IPv4 mapped - IPv6 address. - - - - You can disable it on entire system with sysctl like - below. - - - sysctl net.inet6.ip6.mapped_addr=0 - - - - - - - listening side - - Each socket can be configured to support special AF_INET6 - wildcard bind (enabled by default). You can disable it on - each socket basis with &man.setsockopt.2; like below. - - int on; - - setsockopt(s, IPPROTO_IPV6, IPV6_BINDV6ONLY, - (char *)&on, sizeof (on)) < 0)); - - - Wildcard AF_INET6 socket grabs IPv4 connection if and only - if the following conditions are satisfied: - - - - there is no AF_INET socket that matches the IPv4 - connection - - - - the AF_INET6 socket is configured to accept IPv4 - traffic, i.e. getsockopt(IPV6_BINDV6ONLY) returns 0. - - - - There is no problem with open/close ordering. - - - - initiating side - - FreeBSD 4.x supports outgoing connection to IPv4 mapped - address (::ffff:10.1.1.1), if the node is configured to support - IPv4 mapped address. - - - - - - sockaddr_storage - - When RFC2553 was about to be finalized, there was discussion on - how struct sockaddr_storage members are named. One proposal is to - prepend "__" to the members (like "__ss_len") as they should not be - touched. The other proposal was not to prepend it (like "ss_len") - as we need to touch those members directly. There was no clear - consensus on it. - - As a result, RFC2553 defines struct sockaddr_storage as - follows: - - struct sockaddr_storage { - u_char __ss_len; /* address length */ - u_char __ss_family; /* address family */ - /* and bunch of padding */ - }; - - - On the contrary, XNET draft defines as follows: - - struct sockaddr_storage { - u_char ss_len; /* address length */ - u_char ss_family; /* address family */ - /* and bunch of padding */ - }; - - - In December 1999, it was agreed that RFC2553bis should pick - the latter (XNET) definition. - - Current implementation conforms to XNET definition, based on - RFC2553bis discussion. - - If you look at multiple IPv6 implementations, you will be able - to see both definitions. As an userland programmer, the most - portable way of dealing with it is to: - - - - ensure ss_family and/or ss_len are available on the - platform, by using GNU autoconf, - - - - have -Dss_family=__ss_family to unify all occurrences - (including header file) into __ss_family, or - - - - never touch __ss_family. cast to sockaddr * and use sa_family - like: - - struct sockaddr_storage ss; - family = ((struct sockaddr *)&ss)->sa_family - - - - - - - - - Network Drivers - - Now following two items are required to be supported by standard - drivers: - - - - mbuf clustering requirement. In this stable release, we - changed MINCLSIZE into MHLEN+1 for all the operating systems - in order to make all the drivers behave as we expect. - - - - multicast. If &man.ifmcstat.8; yields no multicast group for - a interface, that interface has to be patched. - - - - If any of the drivers do not support the requirements, then - the drivers can not be used for IPv6 and/or IPsec communication. If - you find any problem with your card using IPv6/IPsec, then, please - report it to the &a.bugs;. - - (NOTE: In the past we required all PCMCIA drivers to have a - call to in6_ifattach(). We have no such requirement any more) - - - - Translator - - We categorize IPv4/IPv6 translator into 4 types: - - - - Translator A --- It is used in the early - stage of transition to make it possible to establish a - connection from an IPv6 host in an IPv6 island to an IPv4 host - in the IPv4 ocean. - - - - Translator B --- It is used in the early - stage of transition to make it possible to establish a connection - from an IPv4 host in the IPv4 ocean to an IPv6 host in an - IPv6 island. - - - - Translator C --- It is used in the late - stage of transition to make it possible to establish a - connection from an IPv4 host in an IPv4 island to an IPv6 host - in the IPv6 ocean. - - - - Translator D --- It is used in the late - stage of transition to make it possible to establish a - connection from an IPv6 host in the IPv6 ocean to an IPv4 host - in an IPv4 island. - - - - TCP relay translator for category A is supported. This is called - "FAITH". We also provide IP header translator for category A. - (The latter is not yet put into FreeBSD 4.x yet.) - - - FAITH TCP relay translator - - FAITH system uses TCP relay daemon called &man.faithd.8; helped - by the kernel. FAITH will reserve an IPv6 address prefix, and relay - TCP connection toward that prefix to IPv4 destination. - - For example, if the reserved IPv6 prefix is - 3ffe:0501:0200:ffff::, and the IPv6 destination for TCP connection - is 3ffe:0501:0200:ffff::163.221.202.12, the connection will be - relayed toward IPv4 destination 163.221.202.12. - - destination IPv4 node (163.221.202.12) - ^ - | IPv4 tcp toward 163.221.202.12 - FAITH-relay dual stack node - ^ - | IPv6 TCP toward 3ffe:0501:0200:ffff::163.221.202.12 - source IPv6 node - - - &man.faithd.8; must be invoked on FAITH-relay dual stack - node. - - For more details, consult - src/usr.sbin/faithd/README - - - - - IPsec - - IPsec is mainly organized by three components. - - - - Policy Management - - - - Key Management - - - - AH and ESP handling - - - - - Policy Management - - The kernel implements experimental policy management code. - There are two way to manage security policy. One is to configure - per-socket policy using &man.setsockopt.2;. In this cases, policy - configuration is described in &man.ipsec.set.policy.3;. The other - is to configure kernel packet filter-based policy using PF_KEY - interface, via &man.setkey.8;. - - The policy entry is not re-ordered with its - indexes, so the order of entry when you add is very significant. - - - - Key Management - - The key management code implemented in this kit (sys/netkey) - is a home-brew PFKEY v2 implementation. This conforms to RFC2367. - - - The home-brew IKE daemon, "racoon" is included in the - kit (kame/kame/racoon). Basically you will need to run racoon as - daemon, then set up a policy to require keys (like - ping -P 'out ipsec esp/transport//use'). - The kernel will contact racoon daemon as necessary to exchange - keys. - - - - AH and ESP handling - - IPsec module is implemented as "hooks" to the standard IPv4/IPv6 - processing. When sending a packet, ip{,6}_output() checks if ESP/AH - processing is required by checking if a matching SPD (Security - Policy Database) is found. If ESP/AH is needed, - {esp,ah}{4,6}_output() will be called and mbuf will be updated - accordingly. When a packet is received, {esp,ah}4_input() will be - called based on protocol number, i.e. (*inetsw[proto])(). - {esp,ah}4_input() will decrypt/check authenticity of the packet, - and strips off daisy-chained header and padding for ESP/AH. It is - safe to strip off the ESP/AH header on packet reception, since we - will never use the received packet in "as is" form. - - By using ESP/AH, TCP4/6 effective data segment size will be - affected by extra daisy-chained headers inserted by ESP/AH. Our - code takes care of the case. - - Basic crypto functions can be found in directory "sys/crypto". - ESP/AH transform are listed in {esp,ah}_core.c with wrapper functions. - If you wish to add some algorithm, add wrapper function in - {esp,ah}_core.c, and add your crypto algorithm code into - sys/crypto. - - Tunnel mode is partially supported in this release, with the - following restrictions: - - - - IPsec tunnel is not combined with GIF generic tunneling - interface. It needs a great care because we may create an - infinite loop between ip_output() and tunnelifp->if_output(). - Opinion varies if it is better to unify them, or not. - - - - MTU and Don't Fragment bit (IPv4) considerations need more - checking, but basically works fine. - - - - Authentication model for AH tunnel must be revisited. - We will need to improve the policy management engine, - eventually. - - - - - - Conformance to RFCs and IDs - - The IPsec code in the kernel conforms (or, tries to conform) - to the following standards: - - "old IPsec" specification documented in - rfc182[5-9].txt - - "new IPsec" specification documented in - rfc240[1-6].txt, - rfc241[01].txt, rfc2451.txt - and draft-mcdonald-simple-ipsec-api-01.txt - (draft expired, but you can take from - ftp://ftp.kame.net/pub/internet-drafts/). - (NOTE: IKE specifications, rfc241[7-9].txt are - implemented in userland, as "racoon" IKE daemon) - - Currently supported algorithms are: - - - old IPsec AH - - - null crypto checksum (no document, just for - debugging) - - - keyed MD5 with 128bit crypto checksum - (rfc1828.txt) - - - keyed SHA1 with 128bit crypto checksum - (no document) - - - HMAC MD5 with 128bit crypto checksum - (rfc2085.txt) - - - HMAC SHA1 with 128bit crypto checksum - (no document) - - - - - - old IPsec ESP - - - null encryption (no document, similar to - rfc2410.txt) - - - DES-CBC mode (rfc1829.txt) - - - - - - new IPsec AH - - - null crypto checksum (no document, - just for debugging) - - - keyed MD5 with 96bit crypto checksum - (no document) - - - keyed SHA1 with 96bit crypto checksum - (no document) - - - HMAC MD5 with 96bit crypto checksum - (rfc2403.txt) - - - HMAC SHA1 with 96bit crypto checksum - (rfc2404.txt) - - - - - - new IPsec ESP - - - null encryption - (rfc2410.txt) - - - DES-CBC with derived IV - (draft-ietf-ipsec-ciph-des-derived-01.txt, - draft expired) - - - DES-CBC with explicit IV - (rfc2405.txt) - - - 3DES-CBC with explicit IV - (rfc2451.txt) - - - BLOWFISH CBC - (rfc2451.txt) - - - CAST128 CBC - (rfc2451.txt) - - - RC5 CBC - (rfc2451.txt) - - - each of the above can be combined with: - - - ESP authentication with HMAC-MD5(96bit) - - - ESP authentication with HMAC-SHA1(96bit) - - - - - - - - The following algorithms are NOT supported: - - - - old IPsec AH - - - - HMAC MD5 with 128bit crypto checksum + 64bit - replay prevention (rfc2085.txt) - - - keyed SHA1 with 160bit crypto checksum + 32bit padding - (rfc1852.txt) - - - - - - - IPsec (in kernel) and IKE (in userland as "racoon") has been - tested at several interoperability test events, and it is known to - interoperate with many other implementations well. Also, current - IPsec implementation as quite wide coverage for IPsec crypto - algorithms documented in RFC (we cover algorithms without intellectual - property issues only). - - - - ECN consideration on IPsec tunnels - - ECN-friendly IPsec tunnel is supported as described in - draft-ipsec-ecn-00.txt. - - Normal IPsec tunnel is described in RFC2401. On encapsulation, - IPv4 TOS field (or, IPv6 traffic class field) will be copied from inner - IP header to outer IP header. On decapsulation outer IP header - will be simply dropped. The decapsulation rule is not compatible - with ECN, since ECN bit on the outer IP TOS/traffic class field will be - lost. - - To make IPsec tunnel ECN-friendly, we should modify encapsulation - and decapsulation procedure. This is described in - http://www.aciri.org/floyd/papers/draft-ipsec-ecn-00.txt, - chapter 3. - - IPsec tunnel implementation can give you three behaviors, by - setting net.inet.ipsec.ecn (or net.inet6.ipsec6.ecn) to some - value: - - - - RFC2401: no consideration for ECN (sysctl value -1) - - - ECN forbidden (sysctl value 0) - - - ECN allowed (sysctl value 1) - - - - Note that the behavior is configurable in per-node manner, - not per-SA manner (draft-ipsec-ecn-00 wants per-SA configuration, - but it looks too much for me). - - The behavior is summarized as follows (see source code for - more detail): - - - encapsulate decapsulate - --- --- -RFC2401 copy all TOS bits drop TOS bits on outer - from inner to outer. (use inner TOS bits as is) - -ECN forbidden copy TOS bits except for ECN drop TOS bits on outer - (masked with 0xfc) from inner (use inner TOS bits as is) - to outer. set ECN bits to 0. - -ECN allowed copy TOS bits except for ECN use inner TOS bits with some - CE (masked with 0xfe) from change. if outer ECN CE bit - inner to outer. is 1, enable ECN CE bit on - set ECN CE bit to 0. the inner. - - - - General strategy for configuration is as follows: - - - if both IPsec tunnel endpoint are capable of ECN-friendly - behavior, you should better configure both end to ECN allowed - (sysctl value 1). - - - if the other end is very strict about TOS bit, use "RFC2401" - (sysctl value -1). - - - in other cases, use "ECN forbidden" (sysctl value 0). - - - - The default behavior is "ECN forbidden" (sysctl value 0). - - For more information, please refer to: - - - http://www.aciri.org/floyd/papers/draft-ipsec-ecn-00.txt, - RFC2481 (Explicit Congestion Notification), - src/sys/netinet6/{ah,esp}_input.c - - (Thanks goes to Kenjiro Cho kjc@csl.sony.co.jp - for detailed analysis) - - - - Interoperability - - Here are (some of) platforms that KAME code have tested - IPsec/IKE interoperability in the past. Note that both ends may - have modified their implementation, so use the following list just - for reference purposes. - - Altiga, Ashley-laurent (vpcom.com), Data Fellows (F-Secure), - Ericsson ACC, FreeS/WAN, HITACHI, IBM &aix;, IIJ, Intel, - µsoft; &windowsnt;, NIST (linux IPsec + plutoplus), Netscreen, OpenBSD, - RedCreek, Routerware, SSH, Secure Computing, Soliton, Toshiba, - VPNet, Yamaha RT100i - - - - diff --git a/zh_TW.UTF-8/books/developers-handbook/kerneldebug/Makefile b/zh_TW.UTF-8/books/developers-handbook/kerneldebug/Makefile deleted file mode 100644 index 0f3b90b3e1..0000000000 --- a/zh_TW.UTF-8/books/developers-handbook/kerneldebug/Makefile +++ /dev/null @@ -1,15 +0,0 @@ -# -# Build the Handbook with just the content from this chapter. -# -# $FreeBSD$ -# - -CHAPTERS= kerneldebug/chapter.xml - -VPATH= .. - -MASTERDOC= ${.CURDIR}/../${DOC}.${DOCBOOKSUFFIX} - -DOC_PREFIX?= ${.CURDIR}/../../../.. - -.include "../Makefile" diff --git a/zh_TW.UTF-8/books/developers-handbook/kerneldebug/chapter.xml b/zh_TW.UTF-8/books/developers-handbook/kerneldebug/chapter.xml deleted file mode 100644 index a2cd16fa99..0000000000 --- a/zh_TW.UTF-8/books/developers-handbook/kerneldebug/chapter.xml +++ /dev/null @@ -1,848 +0,0 @@ - - - - Kernel Debugging - - PaulRichardsContributed by - JörgWunsch - - - - - - - Obtaining a Kernel Crash Dump - - When running a development kernel (eg: &os.current;), such as a - kernel under extreme conditions (eg: very high load averages, - tens of thousands of connections, exceedingly high number of - concurrent users, hundreds of &man.jail.8;s, etc.), or using a - new feature or device driver on &os.stable; (eg: - PAE), sometimes a kernel will panic. In the - event that it does, this chapter will demonstrate how to extract - useful information out of a crash. - - A system reboot is inevitable once a kernel panics. Once a - system is rebooted, the contents of a system's physical memory - (RAM) is lost, as well as any bits that are - on the swap device before the panic. To preserve the bits in - physical memory, the kernel makes use of the swap device as a - temporary place to store the bits that are in RAM across a - reboot after a crash. In doing this, when &os; boots after a - crash, a kernel image can now be extracted and debugging can - take place. - - A swap device that has been configured as a dump - device still acts as a swap device. Dumps to non-swap devices - (such as tapes or CDRWs, for example) are not supported at this time. A - swap device is synonymous with a swap - partition. - - To be able to extract a usable core, it is required that at - least one swap partition be large enough to hold all of the bits - in physical memory. When a kernel panics, before the system - reboots, the kernel is smart enough to check to see if a swap - device has been configured as a dump device. If there is a - valid dump device, the kernel dumps the contents of what is in - physical memory to the swap device. - - - Configuring the Dump Device - - Before the kernel will dump the contents of its physical - memory to a dump device, a dump device must be configured. A - dump device is specified by using the &man.dumpon.8; command - to tell the kernel where to save kernel crash dumps. The - &man.dumpon.8; program must be called after the swap partition - has been configured with &man.swapon.8;. This is normally - handled by setting the dumpdev variable in - &man.rc.conf.5; to the path of the swap device (the - recommended way to extract a kernel dump). - - Alternatively, the dump device can be hard-coded via the - dump clause in the &man.config.5; line of - a kernel configuration file. This approach is deprecated and should - be used only if a kernel is crashing before &man.dumpon.8; can be executed. - - Check /etc/fstab or - &man.swapinfo.8; for a list of swap devices. - - Make sure the dumpdir - specified in &man.rc.conf.5; exists before a kernel - crash! - - &prompt.root; mkdir /var/crash -&prompt.root; chmod 700 /var/crash - - Also, remember that the contents of - /var/crash is sensitive and very likely - contains confidential information such as passwords. - - - - - Extracting a Kernel Dump - - Once a dump has been written to a dump device, the dump - must be extracted before the swap device is mounted. - To extract a dump - from a dump device, use the &man.savecore.8; program. If - dumpdev has been set in &man.rc.conf.5;, - &man.savecore.8; will be called automatically on the first - multi-user boot after the crash and before the swap device - is mounted. The location of the extracted core is placed in - the &man.rc.conf.5; value dumpdir, by - default /var/crash and will be named - vmcore.0. - - In the event that there is already a file called - vmcore.0 in - /var/crash (or whatever - dumpdir is set to), the kernel will - increment the trailing number for every crash to avoid - overwriting an existing vmcore (eg: - vmcore.1). While debugging, it is - highly likely that you will want to use the highest version - vmcore in - /var/crash when searching for the right - vmcore. - - - If you are testing a new kernel but need to boot a different one in - order to get your system up and running again, boot it only into single - user mode using the flag at the boot prompt, and - then perform the following steps: - - &prompt.root; fsck -p -&prompt.root; mount -a -t ufs # make sure /var/crash is writable -&prompt.root; savecore /var/crash /dev/ad0s1b -&prompt.root; exit # exit to multi-user - - This instructs &man.savecore.8; to extract a kernel dump - from /dev/ad0s1b and place the contents in - /var/crash. Do not forget to make sure the - destination directory /var/crash has enough - space for the dump. Also, do not forget to specify the correct path to your swap - device as it is likely different than - /dev/ad0s1b! - - The recommended, and certainly the easiest way to automate - obtaining crash dumps is to use the dumpdev - variable in &man.rc.conf.5;. - - - - - Debugging a Kernel Crash Dump with <command>kgdb</command> - - - This section covers &man.kgdb.1; as found in &os; 5.3 - and later. In previous versions, one must use - gdb -k to read a core dump file. - - - Once a dump has been obtained, getting useful information - out of the dump is relatively easy for simple problems. Before - launching into the internals of &man.kgdb.1; to debug - the crash dump, locate the debug version of your kernel - (normally called kernel.debug) and the path - to the source files used to build your kernel (normally - /usr/obj/usr/src/sys/KERNCONF, - where KERNCONF - is the ident specified in a kernel - &man.config.5;). With those two pieces of info, let the - debugging commence! - - To enter into the debugger and begin getting information - from the dump, the following steps are required at a minimum: - - &prompt.root; cd /usr/obj/usr/src/sys/KERNCONF -&prompt.root; kgdb kernel.debug /var/crash/vmcore.0 - - You can debug the crash dump using the kernel sources just like - you can for any other program. - - This first dump is from a 5.2-BETA kernel and the crash - comes from deep within the kernel. The output below has been - modified to include line numbers on the left. This first trace - inspects the instruction pointer and obtains a back trace. The - address that is used on line 41 for the list - command is the instruction pointer and can be found on line - 17. Most developers will request having at least this - information sent to them if you are unable to debug the problem - yourself. If, however, you do solve the problem, make sure that - your patch winds its way into the source tree via a problem - report, mailing lists, or by being able to commit it! - - 1:&prompt.root; cd /usr/obj/usr/src/sys/KERNCONF - 2:&prompt.root; kgdb kernel.debug /var/crash/vmcore.0 - 3:GNU gdb 5.2.1 (FreeBSD) - 4:Copyright 2002 Free Software Foundation, Inc. - 5:GDB is free software, covered by the GNU General Public License, and you are - 6:welcome to change it and/or distribute copies of it under certain conditions. - 7:Type "show copying" to see the conditions. - 8:There is absolutely no warranty for GDB. Type "show warranty" for details. - 9:This GDB was configured as "i386-undermydesk-freebsd"... -10:panic: page fault -11:panic messages: -12:--- -13:Fatal trap 12: page fault while in kernel mode -14:cpuid = 0; apic id = 00 -15:fault virtual address = 0x300 -16:fault code: = supervisor read, page not present -17:instruction pointer = 0x8:0xc0713860 -18:stack pointer = 0x10:0xdc1d0b70 -19:frame pointer = 0x10:0xdc1d0b7c -20:code segment = base 0x0, limit 0xfffff, type 0x1b -21: = DPL 0, pres 1, def32 1, gran 1 -22:processor eflags = resume, IOPL = 0 -23:current process = 14394 (uname) -24:trap number = 12 -25:panic: page fault -26 cpuid = 0; -27:Stack backtrace: -28 -29:syncing disks, buffers remaining... 2199 2199 panic: mi_switch: switch in a critical section -30:cpuid = 0; -31:Uptime: 2h43m19s -32:Dumping 255 MB -33: 16 32 48 64 80 96 112 128 144 160 176 192 208 224 240 -34:--- -35:Reading symbols from /boot/kernel/snd_maestro3.ko...done. -36:Loaded symbols for /boot/kernel/snd_maestro3.ko -37:Reading symbols from /boot/kernel/snd_pcm.ko...done. -38:Loaded symbols for /boot/kernel/snd_pcm.ko -39:#0 doadump () at /usr/src/sys/kern/kern_shutdown.c:240 -40:240 dumping++; -41:(kgdb) list *0xc0713860 -42:0xc0713860 is in lapic_ipi_wait (/usr/src/sys/i386/i386/local_apic.c:663). -43:658 incr = 0; -44:659 delay = 1; -45:660 } else -46:661 incr = 1; -47:662 for (x = 0; x < delay; x += incr) { -48:663 if ((lapic->icr_lo & APIC_DELSTAT_MASK) == APIC_DELSTAT_IDLE) -49:664 return (1); -50:665 ia32_pause(); -51:666 } -52:667 return (0); -53:(kgdb) backtrace -54:#0 doadump () at /usr/src/sys/kern/kern_shutdown.c:240 -55:#1 0xc055fd9b in boot (howto=260) at /usr/src/sys/kern/kern_shutdown.c:372 -56:#2 0xc056019d in panic () at /usr/src/sys/kern/kern_shutdown.c:550 -57:#3 0xc0567ef5 in mi_switch () at /usr/src/sys/kern/kern_synch.c:470 -58:#4 0xc055fa87 in boot (howto=256) at /usr/src/sys/kern/kern_shutdown.c:312 -59:#5 0xc056019d in panic () at /usr/src/sys/kern/kern_shutdown.c:550 -60:#6 0xc0720c66 in trap_fatal (frame=0xdc1d0b30, eva=0) -61: at /usr/src/sys/i386/i386/trap.c:821 -62:#7 0xc07202b3 in trap (frame= -63: {tf_fs = -1065484264, tf_es = -1065484272, tf_ds = -1065484272, tf_edi = 1, tf_esi = 0, tf_ebp = -602076292, tf_isp = -602076324, tf_ebx = 0, tf_edx = 0, tf_ecx = 1000000, tf_eax = 243, tf_trapno = 12, tf_err = 0, tf_eip = -1066321824, tf_cs = 8, tf_eflags = 65671, tf_esp = 243, tf_ss = 0}) -64: at /usr/src/sys/i386/i386/trap.c:250 -65:#8 0xc070c9f8 in calltrap () at {standard input}:94 -66:#9 0xc07139f3 in lapic_ipi_vectored (vector=0, dest=0) -67: at /usr/src/sys/i386/i386/local_apic.c:733 -68:#10 0xc0718b23 in ipi_selected (cpus=1, ipi=1) -69: at /usr/src/sys/i386/i386/mp_machdep.c:1115 -70:#11 0xc057473e in kseq_notify (ke=0xcc05e360, cpu=0) -71: at /usr/src/sys/kern/sched_ule.c:520 -72:#12 0xc0575cad in sched_add (td=0xcbcf5c80) -73: at /usr/src/sys/kern/sched_ule.c:1366 -74:#13 0xc05666c6 in setrunqueue (td=0xcc05e360) -75: at /usr/src/sys/kern/kern_switch.c:422 -76:#14 0xc05752f4 in sched_wakeup (td=0xcbcf5c80) -77: at /usr/src/sys/kern/sched_ule.c:999 -78:#15 0xc056816c in setrunnable (td=0xcbcf5c80) -79: at /usr/src/sys/kern/kern_synch.c:570 -80:#16 0xc0567d53 in wakeup (ident=0xcbcf5c80) -81: at /usr/src/sys/kern/kern_synch.c:411 -82:#17 0xc05490a8 in exit1 (td=0xcbcf5b40, rv=0) -83: at /usr/src/sys/kern/kern_exit.c:509 -84:#18 0xc0548011 in sys_exit () at /usr/src/sys/kern/kern_exit.c:102 -85:#19 0xc0720fd0 in syscall (frame= -86: {tf_fs = 47, tf_es = 47, tf_ds = 47, tf_edi = 0, tf_esi = -1, tf_ebp = -1077940712, tf_isp = -602075788, tf_ebx = 672411944, tf_edx = 10, tf_ecx = 672411600, tf_eax = 1, tf_trapno = 12, tf_err = 2, tf_eip = 671899563, tf_cs = 31, tf_eflags = 642, tf_esp = -1077940740, tf_ss = 47}) -87: at /usr/src/sys/i386/i386/trap.c:1010 -88:#20 0xc070ca4d in Xint0x80_syscall () at {standard input}:136 -89:---Can't read userspace from dump, or kernel process--- -90:(kgdb) quit - - - This next trace is an older dump from the FreeBSD 2 time - frame, but is more involved and demonstrates more of the - features of gdb. Long lines have been folded - to improve readability, and the lines are numbered for - reference. Despite this, it is a real-world error trace taken - during the development of the pcvt console driver. - - 1:Script started on Fri Dec 30 23:15:22 1994 - 2:&prompt.root; cd /sys/compile/URIAH - 3:&prompt.root; gdb -k kernel /var/crash/vmcore.1 - 4:Reading symbol data from /usr/src/sys/compile/URIAH/kernel -...done. - 5:IdlePTD 1f3000 - 6:panic: because you said to! - 7:current pcb at 1e3f70 - 8:Reading in symbols for ../../i386/i386/machdep.c...done. - 9:(kgdb) backtrace -10:#0 boot (arghowto=256) (../../i386/i386/machdep.c line 767) -11:#1 0xf0115159 in panic () -12:#2 0xf01955bd in diediedie () (../../i386/i386/machdep.c line 698) -13:#3 0xf010185e in db_fncall () -14:#4 0xf0101586 in db_command (-266509132, -266509516, -267381073) -15:#5 0xf0101711 in db_command_loop () -16:#6 0xf01040a0 in db_trap () -17:#7 0xf0192976 in kdb_trap (12, 0, -272630436, -266743723) -18:#8 0xf019d2eb in trap_fatal (...) -19:#9 0xf019ce60 in trap_pfault (...) -20:#10 0xf019cb2f in trap (...) -21:#11 0xf01932a1 in exception:calltrap () -22:#12 0xf0191503 in cnopen (...) -23:#13 0xf0132c34 in spec_open () -24:#14 0xf012d014 in vn_open () -25:#15 0xf012a183 in open () -26:#16 0xf019d4eb in syscall (...) -27:(kgdb) up 10 -28:Reading in symbols for ../../i386/i386/trap.c...done. -29:#10 0xf019cb2f in trap (frame={tf_es = -260440048, tf_ds = 16, tf_\ -30:edi = 3072, tf_esi = -266445372, tf_ebp = -272630356, tf_isp = -27\ -31:2630396, tf_ebx = -266427884, tf_edx = 12, tf_ecx = -266427884, tf\ -32:_eax = 64772224, tf_trapno = 12, tf_err = -272695296, tf_eip = -26\ -33:6672343, tf_cs = -266469368, tf_eflags = 66066, tf_esp = 3072, tf_\ -34:ss = -266427884}) (../../i386/i386/trap.c line 283) -35:283 (void) trap_pfault(&frame, FALSE); -36:(kgdb) frame frame->tf_ebp frame->tf_eip -37:Reading in symbols for ../../i386/isa/pcvt/pcvt_drv.c...done. -38:#0 0xf01ae729 in pcopen (dev=3072, flag=3, mode=8192, p=(struct p\ -39:roc *) 0xf07c0c00) (../../i386/isa/pcvt/pcvt_drv.c line 403) -40:403 return ((*linesw[tp->t_line].l_open)(dev, tp)); -41:(kgdb) list -42:398 -43:399 tp->t_state |= TS_CARR_ON; -44:400 tp->t_cflag |= CLOCAL; /* cannot be a modem (:-) */ -45:401 -46:402 #if PCVT_NETBSD || (PCVT_FREEBSD >= 200) -47:403 return ((*linesw[tp->t_line].l_open)(dev, tp)); -48:404 #else -49:405 return ((*linesw[tp->t_line].l_open)(dev, tp, flag)); -50:406 #endif /* PCVT_NETBSD || (PCVT_FREEBSD >= 200) */ -51:407 } -52:(kgdb) print tp -53:Reading in symbols for ../../i386/i386/cons.c...done. -54:$1 = (struct tty *) 0x1bae -55:(kgdb) print tp->t_line -56:$2 = 1767990816 -57:(kgdb) up -58:#1 0xf0191503 in cnopen (dev=0x00000000, flag=3, mode=8192, p=(st\ -59:ruct proc *) 0xf07c0c00) (../../i386/i386/cons.c line 126) -60: return ((*cdevsw[major(dev)].d_open)(dev, flag, mode, p)); -61:(kgdb) up -62:#2 0xf0132c34 in spec_open () -63:(kgdb) up -64:#3 0xf012d014 in vn_open () -65:(kgdb) up -66:#4 0xf012a183 in open () -67:(kgdb) up -68:#5 0xf019d4eb in syscall (frame={tf_es = 39, tf_ds = 39, tf_edi =\ -69: 2158592, tf_esi = 0, tf_ebp = -272638436, tf_isp = -272629788, tf\ -70:_ebx = 7086, tf_edx = 1, tf_ecx = 0, tf_eax = 5, tf_trapno = 582, \ -71:tf_err = 582, tf_eip = 75749, tf_cs = 31, tf_eflags = 582, tf_esp \ -72:= -272638456, tf_ss = 39}) (../../i386/i386/trap.c line 673) -73:673 error = (*callp->sy_call)(p, args, rval); -74:(kgdb) up -75:Initial frame selected; you cannot go up. -76:(kgdb) quit - Comments to the above script: - - - - line 6: - - - This is a dump taken from within DDB (see below), hence the - panic comment because you said to!, and a rather - long stack trace; the initial reason for going into DDB has been a - page fault trap though. - - - - - line 20: - - - This is the location of function trap() - in the stack trace. - - - - - line 36: - - - Force usage of a new stack frame; this is no longer necessary. - The stack frames are supposed to point to the right - locations now, even in case of a trap. - From looking at the code in source line 403, there is a - high probability that either the pointer access for - tp was messed up, or the array access was out of - bounds. - - - - - line 52: - - - The pointer looks suspicious, but happens to be a valid - address. - - - - - line 56: - - - However, it obviously points to garbage, so we have found our - error! (For those unfamiliar with that particular piece of code: - tp->t_line refers to the line discipline of - the console device here, which must be a rather small integer - number.) - - - - - If your system is crashing regularly and you are running - out of disk space, deleting old vmcore - files in /var/crash could save a - considerable amount of disk space! - - - - Debugging a Crash Dump with DDD - - Examining a kernel crash dump with a graphical debugger like - ddd is also possible (you will need to install - the devel/ddd port in order to use the - ddd debugger). Add the - option to the ddd command line you would use - normally. For example; - - &prompt.root; ddd -k /var/crash/kernel.0 /var/crash/vmcore.0 - - You should then be able to go about looking at the crash dump using - ddd's graphical interface. - - - - Post-Mortem Analysis of a Dump - - What do you do if a kernel dumped core but you did not expect it, - and it is therefore not compiled using config -g? Not - everything is lost here. Do not panic! - - Of course, you still need to enable crash dumps. See above for the - options you have to specify in order to do this. - - Go to your kernel config directory - (/usr/src/sys/arch/conf) - and edit your configuration file. Uncomment (or add, if it does not - exist) the following line: - - makeoptions DEBUG=-g #Build kernel with gdb(1) debug symbols - - Rebuild the kernel. Due to the time stamp change on the Makefile, - some other object files will be rebuilt, for example - trap.o. With a bit of luck, the added - option will not change anything for the generated - code, so you will finally get a new kernel with similar code to the - faulting one but with some debugging symbols. You should at least verify the - old and new sizes with the &man.size.1; command. If there is a - mismatch, you probably need to give up here. - - Go and examine the dump as described above. The debugging symbols - might be incomplete for some places, as can be seen in the stack trace - in the example above where some functions are displayed without line - numbers and argument lists. If you need more debugging symbols, remove - the appropriate object files, recompile the kernel again and repeat the - gdb -k - session until you know enough. - - All this is not guaranteed to work, but it will do it fine in most - cases. - - - - On-Line Kernel Debugging Using DDB - - While gdb -k as an off-line debugger provides a very - high level of user interface, there are some things it cannot do. The - most important ones being breakpointing and single-stepping kernel - code. - - If you need to do low-level debugging on your kernel, there is an - on-line debugger available called DDB. It allows setting of - breakpoints, single-stepping kernel functions, examining and changing - kernel variables, etc. However, it cannot access kernel source files, - and only has access to the global and static symbols, not to the full - debug information like gdb does. - - To configure your kernel to include DDB, add the option line - - options DDB - - to your config file, and rebuild. (See The FreeBSD Handbook for details on - configuring the FreeBSD kernel). - - - If you have an older version of the boot blocks, your - debugger symbols might not be loaded at all. Update the boot blocks; - the recent ones load the DDB symbols automatically. - - - Once your DDB kernel is running, there are several ways to enter - DDB. The first, and earliest way is to type the boot flag - right at the boot prompt. The kernel will start up - in debug mode and enter DDB prior to any device probing. Hence you can - even debug the device probe/attach functions. - - The second scenario is to drop to the debugger once the - system has booted. There are two simple ways to accomplish - this. If you would like to break to the debugger from the - command prompt, simply type the command: - - &prompt.root; sysctl debug.enter_debugger=ddb - - Alternatively, if you are at the system console, you may use - a hot-key on the keyboard. The default break-to-debugger - sequence is Ctrl - AltESC. For - syscons, this sequence can be remapped and some of the - distributed maps out there do this, so check to make sure you - know the right sequence to use. There is an option available - for serial consoles that allows the use of a serial line BREAK on the - console line to enter DDB (options BREAK_TO_DEBUGGER - in the kernel config file). It is not the default since there are a lot - of serial adapters around that gratuitously generate a BREAK - condition, for example when pulling the cable. - - The third way is that any panic condition will branch to DDB if the - kernel is configured to use it. For this reason, it is not wise to - configure a kernel with DDB for a machine running unattended. - - The DDB commands roughly resemble some gdb - commands. The first thing you probably need to do is to set a - breakpoint: - - b function-name -b address - - Numbers are taken hexadecimal by default, but to make them distinct - from symbol names; hexadecimal numbers starting with the letters - a-f need to be preceded with 0x - (this is optional for other numbers). Simple expressions are allowed, - for example: function-name + 0x103. - - To continue the operation of an interrupted kernel, simply - type: - - c - - To get a stack trace, use: - - trace - - - Note that when entering DDB via a hot-key, the kernel is currently - servicing an interrupt, so the stack trace might be not of much use - to you. - - - If you want to remove a breakpoint, use - - - del -del address-expression - - The first form will be accepted immediately after a breakpoint hit, - and deletes the current breakpoint. The second form can remove any - breakpoint, but you need to specify the exact address; this can be - obtained from: - - show b - - To single-step the kernel, try: - - s - - This will step into functions, but you can make DDB trace them until - the matching return statement is reached by: - - n - - - This is different from gdb's - next statement; it is like gdb's - finish. - - - To examine data from memory, use (for example): - - x/wx 0xf0133fe0,40 -x/hd db_symtab_space -x/bc termbuf,10 -x/s stringbuf - - for word/halfword/byte access, and hexadecimal/decimal/character/ string - display. The number after the comma is the object count. To display - the next 0x10 items, simply use: - - x ,10 - - Similarly, use - - x/ia foofunc,10 - - to disassemble the first 0x10 instructions of - foofunc, and display them along with their offset - from the beginning of foofunc. - - To modify memory, use the write command: - - w/b termbuf 0xa 0xb 0 -w/w 0xf0010030 0 0 - - The command modifier - (b/h/w) - specifies the size of the data to be written, the first following - expression is the address to write to and the remainder is interpreted - as data to write to successive memory locations. - - If you need to know the current registers, use: - - show reg - - Alternatively, you can display a single register value by e.g. - - p $eax - - and modify it by: - - set $eax new-value - - Should you need to call some kernel functions from DDB, simply - say: - - call func(arg1, arg2, ...) - - The return value will be printed. - - For a &man.ps.1; style summary of all running processes, use: - - ps - - Now you have examined why your kernel failed, and you wish to - reboot. Remember that, depending on the severity of previous - malfunctioning, not all parts of the kernel might still be working as - expected. Perform one of the following actions to shut down and reboot - your system: - - panic - - This will cause your kernel to dump core and reboot, so you can - later analyze the core on a higher level with gdb. This command - usually must be followed by another continue - statement. - - call boot(0) - - Which might be a good way to cleanly shut down the running system, - sync() all disks, and finally reboot. As long as - the disk and filesystem interfaces of the kernel are not damaged, this - might be a good way for an almost clean shutdown. - - call cpu_reset() - - This is the final way out of disaster and almost the same as hitting the - Big Red Button. - - If you need a short command summary, simply type: - - help - - However, it is highly recommended to have a printed copy of the - &man.ddb.4; manual page ready for a debugging - session. Remember that it is hard to read the on-line manual while - single-stepping the kernel. - - - - On-Line Kernel Debugging Using Remote GDB - - This feature has been supported since FreeBSD 2.2, and it is - actually a very neat one. - - GDB has already supported remote debugging for - a long time. This is done using a very simple protocol along a serial - line. Unlike the other methods described above, you will need two - machines for doing this. One is the host providing the debugging - environment, including all the sources, and a copy of the kernel binary - with all the symbols in it, and the other one is the target machine that - simply runs a similar copy of the very same kernel (but stripped of the - debugging information). - - You should configure the kernel in question with config - -g, include into the configuration, and - compile it as usual. This gives a large binary, due to the - debugging information. Copy this kernel to the target machine, strip - the debugging symbols off with strip -x, and boot it - using the boot option. Connect the serial line - of the target machine that has "flags 080" set on its sio device - to any serial line of the debugging host. - Now, on the debugging machine, go to the compile directory of the target - kernel, and start gdb: - - &prompt.user; gdb -k kernel -GDB is free software and you are welcome to distribute copies of it - under certain conditions; type "show copying" to see the conditions. -There is absolutely no warranty for GDB; type "show warranty" for details. -GDB 4.16 (i386-unknown-freebsd), -Copyright 1996 Free Software Foundation, Inc... -(kgdb) - - Initialize the remote debugging session (assuming the first serial - port is being used) by: - - (kgdb) target remote /dev/cuaa0 - - Now, on the target host (the one that entered DDB right before even - starting the device probe), type: - - Debugger("Boot flags requested debugger") -Stopped at Debugger+0x35: movb $0, edata+0x51bc -db> gdb - - DDB will respond with: - - Next trap will enter GDB remote protocol mode - - Every time you type gdb, the mode will be toggled - between remote GDB and local DDB. In order to force a next trap - immediately, simply type s (step). Your hosting GDB - will now gain control over the target kernel: - - Remote debugging using /dev/cuaa0 -Debugger (msg=0xf01b0383 "Boot flags requested debugger") - at ../../i386/i386/db_interface.c:257 -(kgdb) - - You can use this session almost as any other GDB session, including - full access to the source, running it in gud-mode inside an Emacs window - (which gives you an automatic source code display in another Emacs - window), etc. - - - - Debugging Loadable Modules Using GDB - - When debugging a panic that occurred within a module, or - using remote GDB against a machine that uses dynamic modules, - you need to tell GDB how to obtain symbol information for those - modules. - - First, you need to build the module(s) with debugging - information: - - &prompt.root; cd /sys/modules/linux -&prompt.root; make clean; make COPTS=-g - - If you are using remote GDB, you can run - kldstat on the target machine to find out - where the module was loaded: - - &prompt.root; kldstat -Id Refs Address Size Name - 1 4 0xc0100000 1c1678 kernel - 2 1 0xc0a9e000 6000 linprocfs.ko - 3 1 0xc0ad7000 2000 warp_saver.ko - 4 1 0xc0adc000 11000 linux.ko - - If you are debugging a crash dump, you will need to walk the - linker_files list, starting at - linker_files->tqh_first and following the - link.tqe_next pointers until you find the - entry with the filename you are looking for. - The address member of that entry is the load - address of the module. - - Next, you need to find out the offset of the text section - within the module: - - &prompt.root; objdump --section-headers /sys/modules/linux/linux.ko | grep text - 3 .rel.text 000016e0 000038e0 000038e0 000038e0 2**2 - 10 .text 00007f34 000062d0 000062d0 000062d0 2**2 - - The one you want is the .text section, - section 10 in the above example. The fourth hexadecimal field - (sixth field overall) is the offset of the text section within - the file. Add this offset to the load address of the module to - obtain the relocation address for the module's code. In our - example, we get 0xc0adc000 + 0x62d0 = 0xc0ae22d0. Use the - add-symbol-file command in GDB to tell the - debugger about the module: - - (kgdb) add-symbol-file /sys/modules/linux/linux.ko 0xc0ae22d0 -add symbol table from file "/sys/modules/linux/linux.ko" at text_addr = 0xc0ae22d0? -(y or n) y -Reading symbols from /sys/modules/linux/linux.ko...done. -(kgdb) - - You should now have access to all the symbols in the - module. - - - - Debugging a Console Driver - - Since you need a console driver to run DDB on, things are more - complicated if the console driver itself is failing. You might remember - the use of a serial console (either with modified boot blocks, or by - specifying at the Boot: prompt), - and hook up a standard terminal onto your first serial port. DDB works - on any configured console driver, including a serial - console. - - - - Debugging the Deadlocks - - You may experience so called deadlocks, the situation where - system stops doing useful work. To provide the helpful bug report - in this situation, you shall use ddb as described above. Please, - include the output of ps and - trace for suspected processes in the - report. - - If possible, consider doing further investigation. Receipt - below is especially useful if you suspect deadlock occurs in the - VFS layer. Add the options - makeoptions DEBUG=-g - options INVARIANTS - options INVARIANT_SUPPORT - options WITNESS - options DEBUG_LOCKS - options DEBUG_VFS_LOCKS - options DIAGNOSTIC - - to the kernel config. When deadlock occurs, in addition to the - output of the ps command, provide information - from the show allpcpu, show - alllocks, show lockedvnods and - show alltrace. - - For threaded processes, to obtain meaningful backtraces, use - thread thread-id to switch to the thread - stack, and do backtrace with where. - - diff --git a/zh_TW.UTF-8/books/developers-handbook/l10n/chapter.xml b/zh_TW.UTF-8/books/developers-handbook/l10n/chapter.xml deleted file mode 100644 index 548fd08e3a..0000000000 --- a/zh_TW.UTF-8/books/developers-handbook/l10n/chapter.xml +++ /dev/null @@ -1,75 +0,0 @@ - - - - Localization and Internationalization - L10N and I18N - - - Programming I18N Compliant Applications - Qt - GTK - To make your application more useful for speakers of other - languages, we hope that you will program I18N compliant. The GNU - gcc compiler and GUI libraries like QT and GTK support I18N through - special handling of strings. Making a program I18N compliant is - very easy. It allows contributors to port your application to - other languages quickly. Refer to the library specific I18N - documentation for more details. - - In contrast with common perception, I18N compliant code is - easy to write. Usually, it only involves wrapping your strings - with library specific functions. In addition, please be sure to - allow for wide or multibyte character support. - - - A Call to Unify the I18N Effort - - It has come to our attention that the individual I18N/L10N - efforts for each country has been repeating each others' - efforts. Many of us have been reinventing the wheel repeatedly - and inefficiently. We hope that the various major groups in - I18N could congregate into a group effort similar to the Core - Team's responsibility. - - Currently, we hope that, when you write or port I18N - programs, you would send it out to each country's related - FreeBSD mailing list for testing. In the future, we hope to - create applications that work in all the languages - out-of-the-box without dirty hacks. - - The &a.i18n; has been established. If you are an I18N/L10N - developer, please send your comments, ideas, questions, and - anything you deem related to it. - - - - Perl and Python - - Perl - - - Python - - - Perl and Python have I18N and wide character handling - libraries. Please use them for I18N compliance. - - In older FreeBSD versions, - Perl may give warnings about not having a wide character locale - installed on your system. You can set the - environment variable LD_PRELOAD to - /usr/lib/libxpg4.so in your shell. - - In sh-based shells: - - LD_PRELOAD=/usr/lib/libxpg4.so - - In C-based shells: - - setenv LD_PRELOAD /usr/lib/libxpg4.so - - - diff --git a/zh_TW.UTF-8/books/developers-handbook/policies/Makefile b/zh_TW.UTF-8/books/developers-handbook/policies/Makefile deleted file mode 100644 index 771a262e60..0000000000 --- a/zh_TW.UTF-8/books/developers-handbook/policies/Makefile +++ /dev/null @@ -1,15 +0,0 @@ -# -# Build the Handbook with just the content from this chapter. -# -# $FreeBSD$ -# - -CHAPTERS= policies/chapter.xml - -VPATH= .. - -MASTERDOC= ${.CURDIR}/../${DOC}.${DOCBOOKSUFFIX} - -DOC_PREFIX?= ${.CURDIR}/../../../.. - -.include "../Makefile" diff --git a/zh_TW.UTF-8/books/developers-handbook/policies/chapter.xml b/zh_TW.UTF-8/books/developers-handbook/policies/chapter.xml deleted file mode 100644 index 9dffb99394..0000000000 --- a/zh_TW.UTF-8/books/developers-handbook/policies/chapter.xml +++ /dev/null @@ -1,402 +0,0 @@ - - - - Source Tree Guidelines and Policies - - Poul-HenningKampContributed by - - - - - - - This chapter documents various guidelines and policies in force for - the FreeBSD source tree. - - - <varname>MAINTAINER</varname> on Makefiles - ports maintainer - - If a particular portion of the FreeBSD distribution is being - maintained by a person or group of persons, they can communicate this - fact to the world by adding a - - MAINTAINER= email-addresses - - line to the Makefiles covering this portion of the - source tree. - - The semantics of this are as follows: - - The maintainer owns and is responsible for that code. This means - that he is responsible for fixing bugs and answering problem reports - pertaining to that piece of the code, and in the case of contributed - software, for tracking new versions, as appropriate. - - Changes to directories which have a maintainer defined shall be sent - to the maintainer for review before being committed. Only if the - maintainer does not respond for an unacceptable period of time, to - several emails, will it be acceptable to commit changes without review - by the maintainer. However, it is suggested that you try to have the - changes reviewed by someone else if at all possible. - - It is of course not acceptable to add a person or group as - maintainer unless they agree to assume this duty. On the other hand it - does not have to be a committer and it can easily be a group of - people. - - - - Contributed Software - - Poul-HenningKampContributed by - DavidO'Brien - - - - - - - contributed software - - Some parts of the FreeBSD distribution consist of software that is - actively being maintained outside the FreeBSD project. For historical - reasons, we call this contributed software. Some - examples are sendmail, gcc and patch. - - Over the last couple of years, various methods have been used in - dealing with this type of software and all have some number of - advantages and drawbacks. No clear winner has emerged. - - Since this is the case, after some debate one of these methods has - been selected as the official method and will be required - for future imports of software of this kind. Furthermore, it is - strongly suggested that existing contributed software converge on this - model over time, as it has significant advantages over the old method, - including the ability to easily obtain diffs relative to the - official versions of the source by everyone (even without - cvs access). This will make it significantly easier to return changes - to the primary developers of the contributed software. - - Ultimately, however, it comes down to the people actually doing the - work. If using this model is particularly unsuited to the package being - dealt with, exceptions to these rules may be granted only with the - approval of the core team and with the general consensus of the other - developers. The ability to maintain the package in the future will be a - key issue in the decisions. - - - Because of some unfortunate design limitations with the RCS file - format and CVS's use of vendor branches, minor, trivial and/or - cosmetic changes are strongly discouraged on - files that are still tracking the vendor branch. Spelling - fixes are explicitly included here under the - cosmetic category and are to be avoided for files with - revision 1.1.x.x. The repository bloat impact from a single character - change can be rather dramatic. - - - The Tcl embedded programming - language will be used as example of how this model works: - - src/contrib/tcl contains the source as - distributed by the maintainers of this package. Parts that are entirely - not applicable for FreeBSD can be removed. In the case of Tcl, the - mac, win and - compat subdirectories were eliminated before the - import. - - src/lib/libtcl contains only a bmake style - Makefile that uses the standard - bsd.lib.mk makefile rules to produce the library - and install the documentation. - - src/usr.bin/tclsh contains only a bmake style - Makefile which will produce and install the - tclsh program and its associated man-pages using the - standard bsd.prog.mk rules. - - src/tools/tools/tcl_bmake contains a couple of - shell-scripts that can be of help when the tcl software needs updating. - These are not part of the built or installed software. - - The important thing here is that the - src/contrib/tcl directory is created according to - the rules: it is supposed to contain the sources as distributed (on a - proper CVS vendor-branch and without RCS keyword expansion) with as few - FreeBSD-specific changes as possible. The 'easy-import' tool on - freefall will assist in doing the import, but if there are any doubts on - how to go about it, it is imperative that you ask first and not blunder - ahead and hope it works out. CVS is not forgiving of - import accidents and a fair amount of effort is required to back out - major mistakes. - - Because of the previously mentioned design limitations with CVS's - vendor branches, it is required that official patches from - the vendor be applied to the original distributed sources and the result - re-imported onto the vendor branch again. Official patches should never - be patched into the FreeBSD checked out version and committed, as this - destroys the vendor branch coherency and makes importing future versions - rather difficult as there will be conflicts. - - Since many packages contain files that are meant for compatibility - with other architectures and environments that FreeBSD, it is - permissible to remove parts of the distribution tree that are of no - interest to FreeBSD in order to save space. Files containing copyright - notices and release-note kind of information applicable to the remaining - files shall not be removed. - - If it seems easier, the bmake - Makefiles can be produced from the dist tree - automatically by some utility, something which would hopefully make it - even easier to upgrade to a new version. If this is done, be sure to - check in such utilities (as necessary) in the - src/tools directory along with the port itself so - that it is available to future maintainers. - - In the src/contrib/tcl level directory, a file - called FREEBSD-upgrade should be added and it - should state things like: - - - - Which files have been left out. - - - - Where the original distribution was obtained from and/or the - official master site. - - - - Where to send patches back to the original authors. - - - - Perhaps an overview of the FreeBSD-specific changes that have - been made. - - - - However, please do not import FREEBSD-upgrade - with the contributed source. Rather you should cvs add - FREEBSD-upgrade ; cvs ci after the initial import. Example - wording from src/contrib/cpio is below: - - This directory contains virgin sources of the original distribution files -on a "vendor" branch. Do not, under any circumstances, attempt to upgrade -the files in this directory via patches and a cvs commit. New versions or -official-patch versions must be imported. Please remember to import with -"-ko" to prevent CVS from corrupting any vendor RCS Ids. - -For the import of GNU cpio 2.4.2, the following files were removed: - - INSTALL cpio.info mkdir.c - Makefile.in cpio.texi mkinstalldirs - -To upgrade to a newer version of cpio, when it is available: - 1. Unpack the new version into an empty directory. - [Do not make ANY changes to the files.] - - 2. Remove the files listed above and any others that don't apply to - FreeBSD. - - 3. Use the command: - cvs import -ko -m 'Virgin import of GNU cpio v<version>' \ - src/contrib/cpio GNU cpio_<version> - - For example, to do the import of version 2.4.2, I typed: - cvs import -ko -m 'Virgin import of GNU v2.4.2' \ - src/contrib/cpio GNU cpio_2_4_2 - - 4. Follow the instructions printed out in step 3 to resolve any - conflicts between local FreeBSD changes and the newer version. - -Do not, under any circumstances, deviate from this procedure. - -To make local changes to cpio, simply patch and commit to the main -branch (aka HEAD). Never make local changes on the GNU branch. - -All local changes should be submitted to "cpio@gnu.ai.mit.edu" for -inclusion in the next vendor release. - -obrien@FreeBSD.org - 30 March 1997 - - - - Encumbered Files - - It might occasionally be necessary to include an encumbered file in - the FreeBSD source tree. For example, if a device requires a small - piece of binary code to be loaded to it before the device will operate, - and we do not have the source to that code, then the binary file is said - to be encumbered. The following policies apply to including encumbered - files in the FreeBSD source tree. - - - - Any file which is interpreted or executed by the system CPU(s) - and not in source format is encumbered. - - - - Any file with a license more restrictive than BSD or GNU is - encumbered. - - - - A file which contains downloadable binary data for use by the - hardware is not encumbered, unless (1) or (2) apply to it. It must - be stored in an architecture neutral ASCII format (file2c or - uuencoding is recommended). - - - - Any encumbered file requires specific approval from the - Core team before it is added to the - CVS repository. - - - - Encumbered files go in src/contrib or - src/sys/contrib. - - - - The entire module should be kept together. There is no point in - splitting it, unless there is code-sharing with non-encumbered - code. - - - - Object files are named - arch/filename.o.uu>. - - - - Kernel files: - - - - Should always be referenced in - conf/files.* (for build simplicity). - - - - Should always be in LINT, but the - Core team decides per case if it - should be commented out or not. The - Core team can, of course, change - their minds later on. - - - - The Release Engineer - decides whether or not it goes into the release. - - - - - - User-land files: - - - - core team - The Core team decides if - the code should be part of make world. - - - - release engineer - The Release Engineer - decides if it goes into the release. - - - - - - - - Shared Libraries - - SatoshiAsamiContributed by - PeterWemm - DavidO'Brien - - - - - - - If you are adding shared library support to a port or other piece of - software that does not have one, the version numbers should follow these - rules. Generally, the resulting numbers will have nothing to do with - the release version of the software. - - The three principles of shared library building are: - - - - Start from 1.0 - - - - If there is a change that is backwards compatible, bump minor - number (note that ELF systems ignore the minor number) - - - - If there is an incompatible change, bump major number - - - - For instance, added functions and bugfixes result in the minor - version number being bumped, while deleted functions, changed function - call syntax, etc. will force the major version number to change. - - Stick to version numbers of the form major.minor - (x.y). Our a.out - dynamic linker does not handle version numbers of the form - x.y.z - well. Any version number after the y - (i.e. the third digit) is totally ignored when comparing shared lib - version numbers to decide which library to link with. Given two shared - libraries that differ only in the micro revision, - ld.so will link with the higher one. That is, if you link - with libfoo.so.3.3.3, the linker only records - 3.3 in the headers, and will link with anything - starting with - libfoo.so.3.(anything >= - 3).(highest - available). - - - ld.so will always use the highest - minor revision. For instance, it will use - libc.so.2.2 in preference to - libc.so.2.0, even if the program was initially - linked with libc.so.2.0. - - - In addition, our ELF dynamic linker does not handle minor version - numbers at all. However, one should still specify a major and minor - version number as our Makefiles do the right thing - based on the type of system. - - For non-port libraries, it is also our policy to change the shared - library version number only once between releases. In addition, it is - our policy to change the major shared library version number only once - between major OS releases (i.e. from 3.0 to 4.0). When you make a - change to a system library that requires the version number to be - bumped, check the Makefile's commit logs. It is the - responsibility of the committer to ensure that the first such change - since the release will result in the shared library version number in - the Makefile to be updated, and any subsequent - changes will not. - - diff --git a/zh_TW.UTF-8/books/developers-handbook/secure/chapter.xml b/zh_TW.UTF-8/books/developers-handbook/secure/chapter.xml deleted file mode 100644 index e382c5fc69..0000000000 --- a/zh_TW.UTF-8/books/developers-handbook/secure/chapter.xml +++ /dev/null @@ -1,518 +0,0 @@ - - - - Secure Programming - - MurrayStokelyContributed by - - - - - - Synopsis - - This chapter describes some of the security issues that - have plagued &unix; programmers for decades and some of the new - tools available to help programmers avoid writing exploitable - code. - - - Secure Design - Methodology - - Writing secure applications takes a very scrutinous and - pessimistic outlook on life. Applications should be run with - the principle of least privilege so that no - process is ever running with more than the bare minimum access - that it needs to accomplish its function. Previously tested - code should be reused whenever possible to avoid common - mistakes that others may have already fixed. - - One of the pitfalls of the &unix; environment is how easy it - is to make assumptions about the sanity of the environment. - Applications should never trust user input (in all its forms), - system resources, inter-process communication, or the timing of - events. &unix; processes do not execute synchronously so logical - operations are rarely atomic. - - - Buffer Overflows - - Buffer Overflows have been around since the very - beginnings of the Von-Neuman architecture. - - buffer overflow - Von-Neuman - - They first gained widespread notoriety in 1988 with the Morris - Internet worm. Unfortunately, the same basic attack remains - - Morris Internet worm - - effective today. Of the 17 CERT security advisories of 1999, 10 - - - CERTsecurity advisories - - - of them were directly caused by buffer-overflow software bugs. - By far the most common type of buffer overflow attack is based - on corrupting the stack. - - stack - arguments - - Most modern computer systems use a stack to pass arguments - to procedures and to store local variables. A stack is a last - in first out (LIFO) buffer in the high memory area of a process - image. When a program invokes a function a new "stack frame" is - - LIFO - - process image - stack pointer - - - created. This stack frame consists of the arguments passed to - the function as well as a dynamic amount of local variable - space. The "stack pointer" is a register that holds the current - - stack frame - stack pointer - - location of the top of the stack. Since this value is - constantly changing as new values are pushed onto the top of the - stack, many implementations also provide a "frame pointer" that - is located near the beginning of a stack frame so that local - variables can more easily be addressed relative to this - value. The return address for function - - frame pointer - - process image - frame pointer - - return address - stack-overflow - - calls is also stored on the stack, and this is the cause of - stack-overflow exploits since overflowing a local variable in a - function can overwrite the return address of that function, - potentially allowing a malicious user to execute any code he or - she wants. - - Although stack-based attacks are by far the most common, - it would also be possible to overrun the stack with a heap-based - (malloc/free) attack. - - The C programming language does not perform automatic - bounds checking on arrays or pointers as many other languages - do. In addition, the standard C library is filled with a - handful of very dangerous functions. - - - - - strcpy(char *dest, const char - *src) - May overflow the dest buffer - - - strcat(char *dest, const char - *src) - May overflow the dest buffer - - - getwd(char *buf) - May overflow the buf buffer - - - gets(char *s) - May overflow the s buffer - - - [vf]scanf(const char *format, - ...) - May overflow its arguments. - - - realpath(char *path, char - resolved_path[]) - May overflow the path buffer - - - [v]sprintf(char *str, const char - *format, ...) - May overflow the str buffer. - - - - - - Example Buffer Overflow - - The following example code contains a buffer overflow - designed to overwrite the return address and skip the - instruction immediately following the function call. (Inspired - by ) - -#include stdio.h - -void manipulate(char *buffer) { - char newbuffer[80]; - strcpy(newbuffer,buffer); -} - -int main() { - char ch,buffer[4096]; - int i=0; - - while ((buffer[i++] = getchar()) != '\n') {}; - - i=1; - manipulate(buffer); - i=2; - printf("The value of i is : %d\n",i); - return 0; -} - - Let us examine what the memory image of this process would - look like if we were to input 160 spaces into our little program - before hitting return. - - [XXX figure here!] - - Obviously more malicious input can be devised to execute - actual compiled instructions (such as exec(/bin/sh)). - - - Avoiding Buffer Overflows - - The most straightforward solution to the problem of - stack-overflows is to always use length restricted memory and - string copy functions. strncpy and - strncat are part of the standard C library. - - - string copy functions - strncpy - - - string copy functions - strncat - - - These functions accept a length value as a parameter which - should be no larger than the size of the destination buffer. - These functions will then copy up to `length' bytes from the - source to the destination. However there are a number of - problems with these functions. Neither function guarantees NUL - termination if the size of the input buffer is as large as the - - NUL termination - - destination. The length parameter is also used inconsistently - between strncpy and strncat so it is easy for programmers to get - confused as to their proper usage. There is also a significant - performance loss compared to strcpy when - copying a short string into a large buffer since - strncpy NUL fills up the size - specified. - - In OpenBSD, another memory copy implementation has been - - OpenBSD - - created to get around these problem. The - strlcpy and strlcat - functions guarantee that they will always null terminate the - destination string when given a non-zero length argument. For - more information about these functions see . The OpenBSD strlcpy and - strlcat instructions have been in FreeBSD - since 3.3. - - - string copy functions - strlcpy - - - - string copy functions - strlcat - - - Compiler based run-time bounds checking - - bounds checking - compiler-based - - Unfortunately there is still a very large assortment of - code in public use which blindly copies memory around without - using any of the bounded copy routines we just discussed. - Fortunately, there is another solution. Several compiler - add-ons and libraries exist to do Run-time bounds checking in - C/C++. - - StackGuard - gcc - - StackGuard is one such add-on that is implemented as a - small patch to the gcc code generator. From the StackGuard - website: - -
"StackGuard detects and defeats stack - smashing attacks by protecting the return address on the stack - from being altered. StackGuard places a "canary" word next to - the return address when a function is called. If the canary - word has been altered when the function returns, then a stack - smashing attack has been attempted, and the program responds - by emitting an intruder alert into syslog, and then - halts."
- -
"StackGuard is implemented as a small patch - to the gcc code generator, specifically the function_prolog() - and function_epilog() routines. function_prolog() has been - enhanced to lay down canaries on the stack when functions - start, and function_epilog() checks canary integrity when the - function exits. Any attempt at corrupting the return address - is thus detected before the function - returns."
-
- - buffer overflow - - Recompiling your application with StackGuard is an - effective means of stopping most buffer-overflow attacks, but - it can still be compromised. - -
- - Library based run-time bounds checking - - - bounds checking - library-based - - - Compiler-based mechanisms are completely useless for - binary-only software for which you cannot recompile. For - these situations there are a number of libraries which - re-implement the unsafe functions of the C-library - (strcpy, fscanf, - getwd, etc..) and ensure that these - functions can never write past the stack pointer. - - - libsafe - libverify - libparanoia - - - Unfortunately these library-based defenses have a number - of shortcomings. These libraries only protect against a very - small set of security related issues and they neglect to fix - the actual problem. These defenses may fail if the - application was compiled with -fomit-frame-pointer. Also, the - LD_PRELOAD and LD_LIBRARY_PATH environment variables can be - overwritten/unset by the user. - - -
-
- - SetUID issues - - seteuid - - There are at least 6 different IDs associated with any - given process. Because of this you have to be very careful with - the access that your process has at any given time. In - particular, all seteuid applications should give up their - privileges as soon as it is no longer required. - - - user IDs - real user ID - - - user IDs - effective user ID - - - The real user ID can only be changed by a superuser - process. The login program sets this - when a user initially logs in and it is seldom changed. - - The effective user ID is set by the - exec() functions if a program has its - seteuid bit set. An application can call - seteuid() at any time to set the effective - user ID to either the real user ID or the saved set-user-ID. - When the effective user ID is set by exec() - functions, the previous value is saved in the saved set-user-ID. - - - - Limiting your program's environment - - chroot() - - The traditional method of restricting a process - is with the chroot() system call. This - system call changes the root directory from which all other - paths are referenced for a process and any child processes. For - this call to succeed the process must have execute (search) - permission on the directory being referenced. The new - environment does not actually take effect until you - chdir() into your new environment. It - should also be noted that a process can easily break out of a - chroot environment if it has root privilege. This could be - accomplished by creating device nodes to read kernel memory, - attaching a debugger to a process outside of the jail, or in - many other creative ways. - - The behavior of the chroot() system - call can be controlled somewhat with the - kern.chroot_allow_open_directories sysctl - variable. When this value is set to 0, - chroot() will fail with EPERM if there are - any directories open. If set to the default value of 1, then - chroot() will fail with EPERM if there are - any directories open and the process is already subject to a - chroot() call. For any other value, the - check for open directories will be bypassed completely. - - FreeBSD's jail functionality - - jail - - The concept of a Jail extends upon the - chroot() by limiting the powers of the - superuser to create a true `virtual server'. Once a prison is - set up all network communication must take place through the - specified IP address, and the power of "root privilege" in this - jail is severely constrained. - - While in a prison, any tests of superuser power within the - kernel using the suser() call will fail. - However, some calls to suser() have been - changed to a new interface suser_xxx(). - This function is responsible for recognizing or denying access - to superuser power for imprisoned processes. - - A superuser process within a jailed environment has the - power to: - - - Manipulate credential with - setuid, seteuid, - setgid, setegid, - setgroups, setreuid, - setregid, setlogin - Set resource limits with setrlimit - Modify some sysctl nodes - (kern.hostname) - chroot() - Set flags on a vnode: - chflags, - fchflags - Set attributes of a vnode such as file - permission, owner, group, size, access time, and modification - time. - Bind to privileged ports in the Internet - domain (ports < 1024) - - - Jail is a very useful tool for - running applications in a secure environment but it does have - some shortcomings. Currently, the IPC mechanisms have not been - converted to the suser_xxx so applications - such as MySQL cannot be run within a jail. Superuser access - may have a very limited meaning within a jail, but there is - no way to specify exactly what "very limited" means. - - - &posix;.1e Process Capabilities - - POSIX.1e Process Capabilities - TrustedBSD - - &posix; has released a working draft that adds event - auditing, access control lists, fine grained privileges, - information labeling, and mandatory access control. - This is a work in progress and is the focus of the TrustedBSD project. Some - of the initial work has been committed to &os.current; - (cap_set_proc(3)). - - - - - - Trust - - An application should never assume that anything about the - users environment is sane. This includes (but is certainly not - limited to): user input, signals, environment variables, - resources, IPC, mmaps, the filesystem working directory, file - descriptors, the # of open files, etc. - - positive filtering - data validation - - You should never assume that you can catch all forms of - invalid input that a user might supply. Instead, your - application should use positive filtering to only allow a - specific subset of inputs that you deem safe. Improper data - validation has been the cause of many exploits, especially with - CGI scripts on the world wide web. For filenames you need to be - extra careful about paths ("../", "/"), symbolic links, and - shell escape characters. - - Perl Taint mode - - Perl has a really cool feature called "Taint" mode which - can be used to prevent scripts from using data derived outside - the program in an unsafe way. This mode will check command line - arguments, environment variables, locale information, the - results of certain syscalls (readdir(), - readlink(), - getpwxxx(), and all file input. - - - - - Race Conditions - - A race condition is anomalous behavior caused by the - unexpected dependence on the relative timing of events. In - other words, a programmer incorrectly assumed that a particular - event would always happen before another. - - race conditions - signals - - race conditions - access checks - - race conditions - file opens - - Some of the common causes of race conditions are signals, - access checks, and file opens. Signals are asynchronous events - by nature so special care must be taken in dealing with them. - Checking access with access(2) then - open(2) is clearly non-atomic. Users can - move files in between the two calls. Instead, privileged - applications should seteuid() and then call - open() directly. Along the same lines, an - application should always set a proper umask before - open() to obviate the need for spurious - chmod() calls. - - - -
diff --git a/zh_TW.UTF-8/books/developers-handbook/sockets/chapter.xml b/zh_TW.UTF-8/books/developers-handbook/sockets/chapter.xml deleted file mode 100644 index 38d74e686c..0000000000 --- a/zh_TW.UTF-8/books/developers-handbook/sockets/chapter.xml +++ /dev/null @@ -1,1780 +0,0 @@ - - - - Sockets - - G. AdamStanislavContributed by - - - - - - - Synopsis - - BSD sockets take interprocess - communications to a new level. It is no longer necessary for the - communicating processes to run on the same machine. They still - can, but they do not have to. - - Not only do these processes not have to run on the same - machine, they do not have to run under the same operating - system. Thanks to BSD sockets, your FreeBSD - software can smoothly cooperate with a program running on a - &macintosh;, another one running on a &sun; workstation, yet another - one running under &windows; 2000, all connected with an - Ethernet-based local area network. - - But your software can equally well cooperate with processes - running in another building, or on another continent, inside a - submarine, or a space shuttle. - - It can also cooperate with processes that are not part of a - computer (at least not in the strict sense of the word), but of - such devices as printers, digital cameras, medical equipment. - Just about anything capable of digital communications. - - - - - Networking and Diversity - - We have already hinted on the diversity - of networking. Many different systems have to talk to each - other. And they have to speak the same language. They also have - to understand the same language the same - way. - - People often think that body language - is universal. But it is not. Back in my early teens, my father - took me to Bulgaria. We were sitting at a table in a park in - Sofia, when a vendor approached us trying to sell us some - roasted almonds. - - I had not learned much Bulgarian by then, so, instead of - saying no, I shook my head from side to side, the - universal body language for - no. The vendor quickly started serving us - some almonds. - - I then remembered I had been told that in Bulgaria shaking - your head sideways meant yes. Quickly, I - started nodding my head up and down. The vendor noticed, took - his almonds, and walked away. To an uninformed observer, I did - not change the body language: I continued using the language of - shaking and nodding my head. What changed was the - meaning of the body language. At first, the - vendor and I interpreted the same language as having completely - different meaning. I had to adjust my own interpretation of that - language so the vendor would understand. - - It is the same with computers: The same symbols may have - different, even outright opposite meaning. Therefore, for - two computers to understand each other, they must not only - agree on the same language, but on the - same interpretation of the language. - - - - - Protocols - - While various programming languages tend to have complex - syntax and use a number of multi-letter reserved words (which - makes them easy for the human programmer to understand), the - languages of data communications tend to be very terse. Instead - of multi-byte words, they often use individual - bits. There is a very convincing reason - for it: While data travels inside your - computer at speeds approaching the speed of light, it often - travels considerably slower between two computers. - - Because the languages used in data communications are so - terse, we usually refer to them as - protocols rather than languages. - - As data travels from one computer to another, it always uses - more than one protocol. These protocols are - layered. The data can be compared to the - inside of an onion: You have to peel off several layers of - skin to get to the data. This is best - illustrated with a picture: - - - - - - - - +----------------+ -| Ethernet | -|+--------------+| -|| IP || -||+------------+|| -||| TCP ||| -|||+----------+||| -|||| HTTP |||| -||||+--------+|||| -||||| PNG ||||| -|||||+------+||||| -|||||| Data |||||| -|||||+------+||||| -||||+--------+|||| -|||+----------+||| -||+------------+|| -|+--------------+| -+----------------+ - - - - Protocol Layers - - - - In this example, we are trying to get an image from a web - page we are connected to via an Ethernet. - - The image consists of raw data, which is simply a sequence - of RGB values that our software can process, - i.e., convert into an image and display on our monitor. - - Alas, our software has no way of knowing how the raw data is - organized: Is it a sequence of RGB values, or - a sequence of grayscale intensities, or perhaps of - CMYK encoded colors? Is the data represented - by 8-bit quanta, or are they 16 bits in size, or perhaps 4 bits? - How many rows and columns does the image consist of? Should - certain pixels be transparent? - - I think you get the picture... - - To inform our software how to handle the raw data, it is - encoded as a PNG file. It could be a - GIF, or a JPEG, but it is - a PNG. - - And PNG is a protocol. - - At this point, I can hear some of you yelling, - No, it is not! It is a file - format! - - Well, of course it is a file format. But from the - perspective of data communications, a file format is a protocol: - The file structure is a language, a terse - one at that, communicating to our process - how the data is organized. Ergo, it is a - protocol. - - Alas, if all we received was the PNG - file, our software would be facing a serious problem: How is it - supposed to know the data is representing an image, as opposed - to some text, or perhaps a sound, or what not? Secondly, how is - it supposed to know the image is in the PNG - format as opposed to GIF, or - JPEG, or some other image format? - - To obtain that information, we are using another protocol: - HTTP. This protocol can tell us exactly that - the data represents an image, and that it uses the - PNG protocol. It can also tell us some other - things, but let us stay focused on protocol layers here. - - - So, now we have some data wrapped in the PNG - protocol, wrapped in the HTTP protocol. - How did we get it from the server? - - By using TCP/IP over Ethernet, that is - how. Indeed, that is three more protocols. Instead of - continuing inside out, I am now going to talk about Ethernet, - simply because it is easier to explain the rest that way. - - Ethernet is an interesting system of connecting computers in - a local area network - (LAN). Each computer has a network - interface card (NIC), which has a - unique 48-bit ID called its - address. No two Ethernet - NICs in the world have the same address. - - - These NICs are all connected with each - other. Whenever one computer wants to communicate with another - in the same Ethernet LAN, it sends a message - over the network. Every NIC sees the - message. But as part of the Ethernet - protocol, the data contains the address of - the destination NIC (among other things). So, - only one of all the network interface cards will pay attention - to it, the rest will ignore it. - - But not all computers are connected to the same - network. Just because we have received the data over our - Ethernet does not mean it originated in our own local area - network. It could have come to us from some other network (which - may not even be Ethernet based) connected with our own network - via the Internet. - - All data is transferred over the Internet using - IP, which stands for Internet - Protocol. Its basic role is to let us know where in - the world the data has arrived from, and where it is supposed to - go to. It does not guarantee we will - receive the data, only that we will know where it came from - if we do receive it. - - Even if we do receive the data, IP does - not guarantee we will receive various chunks of data in the same - order the other computer has sent it to us. So, we can receive - the center of our image before we receive the upper left corner - and after the lower right, for example. - - It is TCP (Transmission Control - Protocol) that asks the sender to resend any lost - data and that places it all into the proper order. - - All in all, it took five different - protocols for one computer to communicate to another what an - image looks like. We received the data wrapped into the - PNG protocol, which was wrapped into the - HTTP protocol, which was wrapped into the - TCP protocol, which was wrapped into the - IP protocol, which was wrapped into the - Ethernet protocol. - - Oh, and by the way, there probably were several other - protocols involved somewhere on the way. For example, if our - LAN was connected to the Internet through a - dial-up call, it used the PPP protocol over - the modem which used one (or several) of the various modem - protocols, et cetera, et cetera, et cetera... - - As a developer you should be asking by now, - How am I supposed to handle it - all? - - Luckily for you, you are not supposed - to handle it all. You are supposed to - handle some of it, but not all of it. Specifically, you need not - worry about the physical connection (in our case Ethernet and - possibly PPP, etc). Nor do you need to handle - the Internet Protocol, or the Transmission Control - Protocol. - - In other words, you do not have to do anything to receive - the data from the other computer. Well, you do have to - ask for it, but that is almost as simple as - opening a file. - - Once you have received the data, it is up to you to figure - out what to do with it. In our case, you would need to - understand the HTTP protocol and the - PNG file structure. - - To use an analogy, all the internetworking protocols become - a gray area: Not so much because we do not understand how it - works, but because we are no longer concerned about it. The - sockets interface takes care of this gray area for us: - - - - - - - - +----------------+ -|xxxxEthernetxxxx| -|+--------------+| -||xxxxxxIPxxxxxx|| -||+------------+|| -|||xxxxxTCPxxxx||| -|||+----------+||| -|||| HTTP |||| -||||+--------+|||| -||||| PNG ||||| -|||||+------+||||| -|||||| Data |||||| -|||||+------+||||| -||||+--------+|||| -|||+----------+||| -||+------------+|| -|+--------------+| -+----------------+ - - - - Sockets Covered Protocol Layers - - - - We only need to understand any protocols that tell us how to - interpret the data, not how to - receive it from another process, nor how to - send it to another process. - - - - - The Sockets Model - - BSD sockets are built on the basic &unix; - model: Everything is a file. In our - example, then, sockets would let us receive an HTTP - file, so to speak. It would then be up to us to - extract the PNG file - from it. - - - Because of the complexity of internetworking, we cannot just - use the open system call, or - the open() C function. Instead, we need to - take several steps to opening a socket. - - Once we do, however, we can start treating the - socket the same way we treat any - file descriptor: We can - read from it, write to - it, pipe it, and, eventually, - close it. - - - - - Essential Socket Functions - - While FreeBSD offers different functions to work with - sockets, we only need four to - open a socket. And in some cases we only need - two. - - - The Client-Server Difference - - Typically, one of the ends of a socket-based data - communication is a server, the other is a - client. - - - The Common Elements - - - <function>socket</function> - - The one function used by both, clients and servers, is - &man.socket.2;. It is declared this way: - - -int socket(int domain, int type, int protocol); - - - The return value is of the same type as that of - open, an integer. FreeBSD allocates - its value from the same pool as that of file handles. - That is what allows sockets to be treated the same way as - files. - - The domain argument tells the - system what protocol family you want - it to use. Many of them exist, some are vendor specific, - others are very common. They are declared in - sys/socket.h. - - Use PF_INET for - UDP, TCP and other - Internet protocols (IPv4). - - Five values are defined for the - type argument, again, in - sys/socket.h. All of them start with - SOCK_. The most - common one is SOCK_STREAM, which - tells the system you are asking for a reliable - stream delivery service (which is - TCP when used with - PF_INET). - - If you asked for SOCK_DGRAM, you - would be requesting a connectionless datagram - delivery service (in our case, - UDP). - - If you wanted to be in charge of the low-level - protocols (such as IP), or even network - interfaces (e.g., the Ethernet), you would need to specify - SOCK_RAW. - - Finally, the protocol argument - depends on the previous two arguments, and is not always - meaningful. In that case, use 0 for - its value. - - - The Unconnected Socket - - Nowhere, in the socket function - have we specified to what other system we should be - connected. Our newly created socket remains - unconnected. - - This is on purpose: To use a telephone analogy, we - have just attached a modem to the phone line. We have - neither told the modem to make a call, nor to answer if - the phone rings. - - - - - - <varname>sockaddr</varname> - - Various functions of the sockets family expect the - address of (or pointer to, to use C terminology) a small - area of the memory. The various C declarations in the - sys/socket.h refer to it as - struct sockaddr. This structure is - declared in the same file: - - -/* - * Structure used by kernel to store most - * addresses. - */ -struct sockaddr { - unsigned char sa_len; /* total length */ - sa_family_t sa_family; /* address family */ - char sa_data[14]; /* actually longer; address value */ -}; -#define SOCK_MAXADDRLEN 255 /* longest possible addresses */ - - - Please note the vagueness with - which the sa_data field is declared, - just as an array of 14 bytes, with - the comment hinting there can be more than - 14 of them. - - This vagueness is quite deliberate. Sockets is a very - powerful interface. While most people perhaps think of it - as nothing more than the Internet interface—and most - applications probably use it for that - nowadays—sockets can be used for just about - any kind of interprocess - communications, of which the Internet (or, more precisely, - IP) is only one. - - The sys/socket.h refers to the - various types of protocols sockets will handle as - address families, and lists them - right before the definition of - sockaddr: - - -/* - * Address families. - */ -#define AF_UNSPEC 0 /* unspecified */ -#define AF_LOCAL 1 /* local to host (pipes, portals) */ -#define AF_UNIX AF_LOCAL /* backward compatibility */ -#define AF_INET 2 /* internetwork: UDP, TCP, etc. */ -#define AF_IMPLINK 3 /* arpanet imp addresses */ -#define AF_PUP 4 /* pup protocols: e.g. BSP */ -#define AF_CHAOS 5 /* mit CHAOS protocols */ -#define AF_NS 6 /* XEROX NS protocols */ -#define AF_ISO 7 /* ISO protocols */ -#define AF_OSI AF_ISO -#define AF_ECMA 8 /* European computer manufacturers */ -#define AF_DATAKIT 9 /* datakit protocols */ -#define AF_CCITT 10 /* CCITT protocols, X.25 etc */ -#define AF_SNA 11 /* IBM SNA */ -#define AF_DECnet 12 /* DECnet */ -#define AF_DLI 13 /* DEC Direct data link interface */ -#define AF_LAT 14 /* LAT */ -#define AF_HYLINK 15 /* NSC Hyperchannel */ -#define AF_APPLETALK 16 /* Apple Talk */ -#define AF_ROUTE 17 /* Internal Routing Protocol */ -#define AF_LINK 18 /* Link layer interface */ -#define pseudo_AF_XTP 19 /* eXpress Transfer Protocol (no AF) */ -#define AF_COIP 20 /* connection-oriented IP, aka ST II */ -#define AF_CNT 21 /* Computer Network Technology */ -#define pseudo_AF_RTIP 22 /* Help Identify RTIP packets */ -#define AF_IPX 23 /* Novell Internet Protocol */ -#define AF_SIP 24 /* Simple Internet Protocol */ -#define pseudo_AF_PIP 25 /* Help Identify PIP packets */ -#define AF_ISDN 26 /* Integrated Services Digital Network*/ -#define AF_E164 AF_ISDN /* CCITT E.164 recommendation */ -#define pseudo_AF_KEY 27 /* Internal key-management function */ -#define AF_INET6 28 /* IPv6 */ -#define AF_NATM 29 /* native ATM access */ -#define AF_ATM 30 /* ATM */ -#define pseudo_AF_HDRCMPLT 31 /* Used by BPF to not rewrite headers - * in interface output routine - */ -#define AF_NETGRAPH 32 /* Netgraph sockets */ -#define AF_SLOW 33 /* 802.3ad slow protocol */ -#define AF_SCLUSTER 34 /* Sitara cluster protocol */ -#define AF_ARP 35 -#define AF_BLUETOOTH 36 /* Bluetooth sockets */ -#define AF_MAX 37 - - - - The one used for IP is - AF_INET. It is a symbol for the constant - 2. - - It is the address family listed - in the sa_family field of - sockaddr that decides how exactly the - vaguely named bytes of sa_data will be - used. - - Specifically, whenever the address - family is AF_INET, we can use - struct sockaddr_in found in - netinet/in.h, wherever - sockaddr is expected: - - -/* - * Socket address, internet style. - */ -struct sockaddr_in { - uint8_t sin_len; - sa_family_t sin_family; - in_port_t sin_port; - struct in_addr sin_addr; - char sin_zero[8]; -}; - - - We can visualize its organization this way: - - - - - - - - 0 1 2 3 - +--------+--------+-----------------+ - 0 | 0 | Family | Port | - +--------+--------+-----------------+ - 4 | IP Address | - +-----------------------------------+ - 8 | 0 | - +-----------------------------------+ -12 | 0 | - +-----------------------------------+ - - - - sockaddr_in - - - - The three important fields are - sin_family, which is byte 1 of the - structure, sin_port, a 16-bit value - found in bytes 2 and 3, and sin_addr, a - 32-bit integer representation of the IP - address, stored in bytes 4-7. - - Now, let us try to fill it out. Let us assume we are - trying to write a client for the - daytime protocol, which simply states - that its server will write a text string representing the - current date and time to port 13. We want to use - TCP/IP, so we need to specify - AF_INET in the address family - field. AF_INET is defined as - 2. Let us use the - IP address of 192.43.244.18, which is the time - server of US federal government (time.nist.gov). - - - - - - - - 0 1 2 3 - +--------+--------+-----------------+ - 0 | 0 | 2 | 13 | - +-----------------+-----------------+ - 4 | 192.43.244.18 | - +-----------------------------------+ - 8 | 0 | - +-----------------------------------+ -12 | 0 | - +-----------------------------------+ - - - - Specific example of sockaddr_in - - - - By the way the sin_addr field is - declared as being of the struct in_addr - type, which is defined in - netinet/in.h: - - -/* - * Internet address (a structure for historical reasons) - */ -struct in_addr { - in_addr_t s_addr; -}; - - - In addition, in_addr_t is a 32-bit - integer. - - The 192.43.244.18 is - just a convenient notation of expressing a 32-bit integer - by listing all of its 8-bit bytes, starting with the - most significant one. - - So far, we have viewed sockaddr as - an abstraction. Our computer does not store - short integers as a single 16-bit - entity, but as a sequence of 2 bytes. Similarly, it stores - 32-bit integers as a sequence of 4 bytes. - - Suppose we coded something like this: - - - sa.sin_family = AF_INET; - sa.sin_port = 13; - sa.sin_addr.s_addr = (((((192 << 8) | 43) << 8) | 244) << 8) | 18; - - - What would the result look like? - - Well, that depends, of course. On a &pentium;, or other - x86, based computer, it would look like this: - - - - - - - - 0 1 2 3 - +--------+--------+--------+--------+ - 0 | 0 | 2 | 13 | 0 | - +--------+--------+--------+--------+ - 4 | 18 | 244 | 43 | 192 | - +-----------------------------------+ - 8 | 0 | - +-----------------------------------+ -12 | 0 | - +-----------------------------------+ - - - - sockaddr_in on an Intel system - - - - On a different system, it might look like this: - - - - - - - - - 0 1 2 3 - +--------+--------+--------+--------+ - 0 | 0 | 2 | 0 | 13 | - +--------+--------+--------+--------+ - 4 | 192 | 43 | 244 | 18 | - +-----------------------------------+ - 8 | 0 | - +-----------------------------------+ -12 | 0 | - +-----------------------------------+ - - - - sockaddr_in on an MSB system - - - - And on a PDP it might look different yet. But the - above two are the most common ways in use today. - - Ordinarily, wanting to write portable code, - programmers pretend that these differences do not - exist. And they get away with it (except when they code in - assembly language). Alas, you cannot get away with it that - easily when coding for sockets. - - Why? - - Because when communicating with another computer, you - usually do not know whether it stores data most - significant byte (MSB) or - least significant byte - (LSB) first. - - You might be wondering, So, will - sockets not handle it for me? - - It will not. - - While that answer may surprise you at first, remember - that the general sockets interface only understands the - sa_len and sa_family - fields of the sockaddr structure. You - do not have to worry about the byte order there (of - course, on FreeBSD sa_family is only 1 - byte anyway, but many other &unix; systems do not have - sa_len and use 2 bytes for - sa_family, and expect the data in - whatever order is native to the computer). - - But the rest of the data is just - sa_data[14] as far as sockets - goes. Depending on the address - family, sockets just forwards that data to its - destination. - - Indeed, when we enter a port number, it is because we - want the other computer to know what service we are asking - for. And, when we are the server, we read the port number - so we know what service the other computer is expecting - from us. Either way, sockets only has to forward the port - number as data. It does not interpret it in any way. - - Similarly, we enter the IP address - to tell everyone on the way where to send our data - to. Sockets, again, only forwards it as data. - - That is why, we (the programmers, - not the sockets) have to distinguish - between the byte order used by our computer and a - conventional byte order to send the data in to the other - computer. - - We will call the byte order our computer uses the - host byte order, or just the - host order. - - There is a convention of sending the multi-byte data - over IP - MSB first. This, - we will refer to as the network byte - order, or simply the network - order. - - Now, if we compiled the above code for an Intel based - computer, our host byte order would - produce: - - - - - - - - 0 1 2 3 - +--------+--------+--------+--------+ - 0 | 0 | 2 | 13 | 0 | - +--------+--------+--------+--------+ - 4 | 18 | 244 | 43 | 192 | - +-----------------------------------+ - 8 | 0 | - +-----------------------------------+ -12 | 0 | - +-----------------------------------+ - - - - Host byte order on an Intel system - - - - But the network byte order - requires that we store the data MSB - first: - - - - - - - - 0 1 2 3 - +--------+--------+--------+--------+ - 0 | 0 | 2 | 0 | 13 | - +--------+--------+--------+--------+ - 4 | 192 | 43 | 244 | 18 | - +-----------------------------------+ - 8 | 0 | - +-----------------------------------+ -12 | 0 | - +-----------------------------------+ - - - - Network byte order - - - - Unfortunately, our host order is - the exact opposite of the network - order. - - We have several ways of dealing with it. One would be - to reverse the values in our code: - - - - sa.sin_family = AF_INET; - sa.sin_port = 13 << 8; - sa.sin_addr.s_addr = (((((18 << 8) | 244) << 8) | 43) << 8) | 192; - - - This will trick our compiler - into storing the data in the network byte - order. In some cases, this is exactly the way - to do it (e.g., when programming in assembly - language). In most cases, however, it can cause a - problem. - - Suppose, you wrote a sockets-based program in C. You - know it is going to run on a &pentium;, so you enter all - your constants in reverse and force them to the - network byte order. It works - well. - - Then, some day, your trusted old &pentium; becomes a - rusty old &pentium;. You replace it with a system whose - host order is the same as the - network order. You need to recompile - all your software. All of your software continues to - perform well, except the one program you wrote. - - You have since forgotten that you had forced all of - your constants to the opposite of the host - order. You spend some quality time tearing out - your hair, calling the names of all gods you ever heard - of (and some you made up), hitting your monitor with a - nerf bat, and performing all the other traditional - ceremonies of trying to figure out why something that has - worked so well is suddenly not working at all. - - Eventually, you figure it out, say a couple of swear - words, and start rewriting your code. - - Luckily, you are not the first one to face the - problem. Someone else has created the &man.htons.3; and - &man.htonl.3; C functions to convert a - short and long - respectively from the host byte - order to the network byte - order, and the &man.ntohs.3; and &man.ntohl.3; - C functions to go the other way. - - On MSB-first - systems these functions do nothing. On - LSB-first systems - they convert values to the proper order. - - So, regardless of what system your software is - compiled on, your data will end up in the correct order - if you use these functions. - - - - - - - Client Functions - - Typically, the client initiates the connection to the - server. The client knows which server it is about to call: - It knows its IP address, and it knows the - port the server resides at. It is akin - to you picking up the phone and dialing the number (the - address), then, after someone answers, - asking for the person in charge of wingdings (the - port). - - - <function>connect</function> - - Once a client has created a socket, it needs to - connect it to a specific port on a remote system. It uses - &man.connect.2;: - - -int connect(int s, const struct sockaddr *name, socklen_t namelen); - - - The s argument is the socket, i.e., - the value returned by the socket - function. The name is a pointer to - sockaddr, the structure we have talked - about extensively. Finally, namelen - informs the system how many bytes are in our - sockaddr structure. - - If connect is successful, it - returns 0. Otherwise it returns - -1 and stores the error code in - errno. - - There are many reasons why - connect may fail. For example, with - an attempt to an Internet connection, the - IP address may not exist, or it may be - down, or just too busy, or it may not have a server - listening at the specified port. Or it may outright - refuse any request for specific - code. - - - - - Our First Client - - We now know enough to write a very simple client, one - that will get current time from 192.43.244.18 and print it to - stdout. - - -/* - * daytime.c - * - * Programmed by G. Adam Stanislav - */ -#include <stdio.h> -#include <sys/types.h> -#include <sys/socket.h> -#include <netinet/in.h> - -int main() { - register int s; - register int bytes; - struct sockaddr_in sa; - char buffer[BUFSIZ+1]; - - if ((s = socket(PF_INET, SOCK_STREAM, 0)) < 0) { - perror("socket"); - return 1; - } - - bzero(&sa, sizeof sa); - - sa.sin_family = AF_INET; - sa.sin_port = htons(13); - sa.sin_addr.s_addr = htonl((((((192 << 8) | 43) << 8) | 244) << 8) | 18); - if (connect(s, (struct sockaddr *)&sa, sizeof sa) < 0) { - perror("connect"); - close(s); - return 2; - } - - while ((bytes = read(s, buffer, BUFSIZ)) > 0) - write(1, buffer, bytes); - - close(s); - return 0; -} - - - Go ahead, enter it in your editor, save it as - daytime.c, then compile and run - it: - -&prompt.user; cc -O3 -o daytime daytime.c -&prompt.user; ./daytime - -52079 01-06-19 02:29:25 50 0 1 543.9 UTC(NIST) * -&prompt.user; - - In this case, the date was June 19, 2001, the time was - 02:29:25 UTC. Naturally, your results - will vary. - - - - - - - Server Functions - - The typical server does not initiate the - connection. Instead, it waits for a client to call it and - request services. It does not know when the client will - call, nor how many clients will call. It may be just sitting - there, waiting patiently, one moment, The next moment, it - can find itself swamped with requests from a number of - clients, all calling in at the same time. - - The sockets interface offers three basic functions to - handle this. - - - <function>bind</function> - - Ports are like extensions to a phone line: After you - dial a number, you dial the extension to get to a specific - person or department. - - There are 65535 IP ports, but a - server usually processes requests that come in on only one - of them. It is like telling the phone room operator that - we are now at work and available to answer the phone at a - specific extension. We use &man.bind.2; to tell sockets - which port we want to serve. - - -int bind(int s, const struct sockaddr *addr, socklen_t addrlen); - - - Beside specifying the port in addr, - the server may include its IP - address. However, it can just use the symbolic constant - INADDR_ANY to indicate it will serve all - requests to the specified port regardless of what its - IP address is. This symbol, along with - several similar ones, is declared in - netinet/in.h - - -#define INADDR_ANY (u_int32_t)0x00000000 - - - Suppose we were writing a server for the - daytime protocol over - TCP/IP. Recall that - it uses port 13. Our sockaddr_in - structure would look like this: - - - - - - - - 0 1 2 3 - +--------+--------+--------+--------+ - 0 | 0 | 2 | 0 | 13 | - +--------+--------+--------+--------+ - 4 | 0 | - +-----------------------------------+ - 8 | 0 | - +-----------------------------------+ -12 | 0 | - +-----------------------------------+ - - - - Example Server sockaddr_in - - - - - - <function>listen</function> - - To continue our office phone analogy, after you have - told the phone central operator what extension you will be - at, you now walk into your office, and make sure your own - phone is plugged in and the ringer is turned on. Plus, you - make sure your call waiting is activated, so you can hear - the phone ring even while you are talking to someone. - - The server ensures all of that with the &man.listen.2; - function. - - -int listen(int s, int backlog); - - - In here, the backlog variable tells - sockets how many incoming requests to accept while you are - busy processing the last request. In other words, it - determines the maximum size of the queue of pending - connections. - - - - - <function>accept</function> - - After you hear the phone ringing, you accept the call - by answering the call. You have now established a - connection with your client. This connection remains - active until either you or your client hang up. - - The server accepts the connection by using the - &man.accept.2; function. - - -int accept(int s, struct sockaddr *addr, socklen_t *addrlen); - - - Note that this time addrlen is a - pointer. This is necessary because in this case it is the - socket that fills out addr, the - sockaddr_in structure. - - The return value is an integer. Indeed, the - accept returns a new - socket. You will use this new socket to - communicate with the client. - - What happens to the old socket? It continues to listen - for more requests (remember the backlog - variable we passed to listen?) until - we close it. - - Now, the new socket is meant only for - communications. It is fully connected. We cannot pass it - to listen again, trying to accept - additional connections. - - - - - Our First Server - - Our first server will be somewhat more complex than - our first client was: Not only do we have more sockets - functions to use, but we need to write it as a - daemon. - - This is best achieved by creating a child - process after binding the port. The main - process then exits and returns control to the - shell (or whatever program - invoked it). - - The child calls listen, then - starts an endless loop, which accepts a connection, serves - it, and eventually closes its socket. - - -/* - * daytimed - a port 13 server - * - * Programmed by G. Adam Stanislav - * June 19, 2001 - */ -#include <stdio.h> -#include <time.h> -#include <unistd.h> -#include <sys/types.h> -#include <sys/socket.h> -#include <netinet/in.h> - -#define BACKLOG 4 - -int main() { - register int s, c; - int b; - struct sockaddr_in sa; - time_t t; - struct tm *tm; - FILE *client; - - if ((s = socket(PF_INET, SOCK_STREAM, 0)) < 0) { - perror("socket"); - return 1; - } - - bzero(&sa, sizeof sa); - - sa.sin_family = AF_INET; - sa.sin_port = htons(13); - - if (INADDR_ANY) - sa.sin_addr.s_addr = htonl(INADDR_ANY); - - if (bind(s, (struct sockaddr *)&sa, sizeof sa) < 0) { - perror("bind"); - return 2; - } - - switch (fork()) { - case -1: - perror("fork"); - return 3; - break; - default: - close(s); - return 0; - break; - case 0: - break; - } - - listen(s, BACKLOG); - - for (;;) { - b = sizeof sa; - - if ((c = accept(s, (struct sockaddr *)&sa, &b)) < 0) { - perror("daytimed accept"); - return 4; - } - - if ((client = fdopen(c, "w")) == NULL) { - perror("daytimed fdopen"); - return 5; - } - - if ((t = time(NULL)) < 0) { - perror("daytimed time"); - - return 6; - } - - tm = gmtime(&t); - fprintf(client, "%.4i-%.2i-%.2iT%.2i:%.2i:%.2iZ\n", - tm->tm_year + 1900, - tm->tm_mon + 1, - tm->tm_mday, - tm->tm_hour, - tm->tm_min, - tm->tm_sec); - - fclose(client); - } -} - - - We start by creating a socket. Then we fill out the - sockaddr_in structure in - sa. Note the conditional use of - INADDR_ANY: - - - if (INADDR_ANY) - sa.sin_addr.s_addr = htonl(INADDR_ANY); - - - Its value is 0. Since we have - just used bzero on the entire - structure, it would be redundant to set it to - 0 again. But if we port our code to - some other system where INADDR_ANY is - perhaps not a zero, we need to assign it to - sa.sin_addr.s_addr. Most modern C - compilers are clever enough to notice that - INADDR_ANY is a constant. As long as it - is a zero, they will optimize the entire conditional - statement out of the code. - - After we have called bind - successfully, we are ready to become a - daemon: We use - fork to create a child process. In - both, the parent and the child, the s - variable is our socket. The parent process will not need - it, so it calls close, then it - returns 0 to inform its own parent it - had terminated successfully. - - Meanwhile, the child process continues working in the - background. It calls listen and sets - its backlog to 4. It does not need a - large value here because daytime is - not a protocol many clients request all the time, and - because it can process each request instantly anyway. - - Finally, the daemon starts an endless loop, which - performs the following steps: - - - Call accept. It waits - here until a client contacts it. At that point, it - receives a new socket, c, which it - can use to communicate with this particular client. - - - It uses the C function - fdopen to turn the socket from a - low-level file descriptor to a - C-style FILE pointer. This will allow - the use of fprintf later on. - - - It checks the time, and prints it in the - ISO 8601 format - to the client file. It - then uses fclose to close the - file. That will automatically close the socket as well. - - - - - We can generalize this, and use - it as a model for many other servers: - - - - - - - - +-----------------+ -| Create Socket | -+-----------------+ - | -+-----------------+ -| Bind Port | Daemon Process -+-----------------+ - | +--------+ - +-------------+-->| Init | - | | +--------+ -+-----------------+ | | -| Exit | | +--------+ -+-----------------+ | | Listen | - | +--------+ - | | - | +--------+ - | | Accept | - | +--------+ - | | - | +--------+ - | | Serve | - | +--------+ - | | - | +--------+ - | | Close | - |<--------+ - - - - Sequential Server - - - - This flowchart is good for sequential - servers, i.e., servers that can serve one - client at a time, just as we were able to with our - daytime server. This is only possible - whenever there is no real conversation - going on between the client and the server: As soon as the - server detects a connection to the client, it sends out - some data and closes the connection. The entire operation - may take nanoseconds, and it is finished. - - The advantage of this flowchart is that, except for - the brief moment after the parent - forks and before it exits, there is - always only one process active: Our - server does not take up much memory and other system - resources. - - Note that we have added initialize - daemon in our flowchart. We did not need to - initialize our own daemon, but this is a good place in the - flow of the program to set up any - signal handlers, open any files we - may need, etc. - - Just about everything in the flow chart can be used - literally on many different servers. The - serve entry is the exception. We - think of it as a black - box, i.e., something you design - specifically for your own server, and just plug it - into the rest. - - Not all protocols are that simple. Many receive a - request from the client, reply to it, then receive another - request from the same client. Because of that, they do not - know in advance how long they will be serving the - client. Such servers usually start a new process for each - client. While the new process is serving its client, the - daemon can continue listening for more connections. - - Now, go ahead, save the above source code as - daytimed.c (it is customary to end - the names of daemons with the letter - d). After you have compiled it, try - running it: - -&prompt.user; ./daytimed -bind: Permission denied -&prompt.user; - - What happened here? As you will recall, the - daytime protocol uses port 13. But - all ports below 1024 are reserved to the superuser - (otherwise, anyone could start a daemon pretending to - serve a commonly used port, while causing a security - breach). - - Try again, this time as the superuser: - -&prompt.root; ./daytimed -&prompt.root; - - What... Nothing? Let us try again: - -&prompt.root; ./daytimed - -bind: Address already in use -&prompt.root; - - Every port can only be bound by one program at a - time. Our first attempt was indeed successful: It started - the child daemon and returned quietly. It is still running - and will continue to run until you either kill it, or any - of its system calls fail, or you reboot the system. - - Fine, we know it is running in the background. But is - it working? How do we know it is a proper - daytime server? Simple: - -&prompt.user; telnet localhost 13 - -Trying ::1... -telnet: connect to address ::1: Connection refused -Trying 127.0.0.1... -Connected to localhost. -Escape character is '^]'. -2001-06-19T21:04:42Z -Connection closed by foreign host. -&prompt.user; - - telnet tried the new - IPv6, and failed. It retried with - IPv4 and succeeded. The daemon - works. - - If you have access to another &unix; system via - telnet, you can use it to test - accessing the server remotely. My computer does not have a - static IP address, so this is what I - did: - -&prompt.user; who - -whizkid ttyp0 Jun 19 16:59 (216.127.220.143) -xxx ttyp1 Jun 19 16:06 (xx.xx.xx.xx) -&prompt.user; telnet 216.127.220.143 13 - -Trying 216.127.220.143... -Connected to r47.bfm.org. -Escape character is '^]'. -2001-06-19T21:31:11Z -Connection closed by foreign host. -&prompt.user; - - Again, it worked. Will it work using the domain name? - - -&prompt.user; telnet r47.bfm.org 13 - -Trying 216.127.220.143... -Connected to r47.bfm.org. -Escape character is '^]'. -2001-06-19T21:31:40Z -Connection closed by foreign host. -&prompt.user; - - By the way, telnet prints - the Connection closed by foreign host - message after our daemon has closed the socket. This shows - us that, indeed, using - fclose(client); in our code works as - advertised. - - - - - - - - - - - Helper Functions - - FreeBSD C library contains many helper functions for sockets - programming. For example, in our sample client we hard coded - the time.nist.gov - IP address. But we do not always know the - IP address. Even if we do, our software is - more flexible if it allows the user to enter the - IP address, or even the domain name. - - - - <function>gethostbyname</function> - - While there is no way to pass the domain name directly to - any of the sockets functions, the FreeBSD C library comes with - the &man.gethostbyname.3; and &man.gethostbyname2.3; functions, - declared in netdb.h. - - -struct hostent * gethostbyname(const char *name); -struct hostent * gethostbyname2(const char *name, int af); - - - Both return a pointer to the hostent - structure, with much information about the domain. For our - purposes, the h_addr_list[0] field of the - structure points at h_length bytes of the - correct address, already stored in the network byte - order. - - This allows us to create a much more flexible—and - much more useful—version of our - daytime program: - - -/* - * daytime.c - * - * Programmed by G. Adam Stanislav - * 19 June 2001 - */ -#include <stdio.h> -#include <string.h> -#include <sys/types.h> -#include <sys/socket.h> -#include <netinet/in.h> -#include <netdb.h> - -int main(int argc, char *argv[]) { - register int s; - register int bytes; - struct sockaddr_in sa; - struct hostent *he; - char buf[BUFSIZ+1]; - char *host; - - if ((s = socket(PF_INET, SOCK_STREAM, 0)) < 0) { - perror("socket"); - return 1; - } - - bzero(&sa, sizeof sa); - - sa.sin_family = AF_INET; - sa.sin_port = htons(13); - - host = (argc > 1) ? (char *)argv[1] : "time.nist.gov"; - - if ((he = gethostbyname(host)) == NULL) { - perror(host); - return 2; - } - - bcopy(he->h_addr_list[0],&sa.sin_addr, he->h_length); - - if (connect(s, (struct sockaddr *)&sa, sizeof sa) < 0) { - perror("connect"); - return 3; - } - - while ((bytes = read(s, buf, BUFSIZ)) > 0) - write(1, buf, bytes); - - close(s); - return 0; -} - - - We now can type a domain name (or an IP - address, it works both ways) on the command line, and the - program will try to connect to its - daytime server. Otherwise, it will still - default to time.nist.gov. However, even in - this case we will use gethostbyname - rather than hard coding 192.43.244.18. That way, even if its - IP address changes in the future, we will - still find it. - - Since it takes virtually no time to get the time from your - local server, you could run daytime - twice in a row: First to get the time from time.nist.gov, the second time from - your own system. You can then compare the results and see how - exact your system clock is: - -&prompt.user; daytime ; daytime localhost - - -52080 01-06-20 04:02:33 50 0 0 390.2 UTC(NIST) * -2001-06-20T04:02:35Z -&prompt.user; - - As you can see, my system was two seconds ahead of the - NIST time. - - - - - <function>getservbyname</function> - - Sometimes you may not be sure what port a certain service - uses. The &man.getservbyname.3; function, also declared in - netdb.h comes in very handy in those - cases: - - -struct servent * getservbyname(const char *name, const char *proto); - - - The servent structure contains the - s_port, which contains the proper port, - already in network byte order. - - Had we not known the correct port for the - daytime service, we could have found it - this way: - - - struct servent *se; - ... - if ((se = getservbyname("daytime", "tcp")) == NULL { - fprintf(stderr, "Cannot determine which port to use.\n"); - return 7; - } - sa.sin_port = se->s_port; - - - You usually do know the port. But if you are developing a - new protocol, you may be testing it on an unofficial - port. Some day, you will register the protocol and its port - (if nowhere else, at least in your - /etc/services, which is where - getservbyname looks). Instead of - returning an error in the above code, you just use the - temporary port number. Once you have listed the protocol in - /etc/services, your software will find - its port without you having to rewrite the code. - - - - - - - Concurrent Servers - - Unlike a sequential server, a concurrent - server has to be able to serve more than one client - at a time. For example, a chat server may - be serving a specific client for hours—it cannot wait till - it stops serving a client before it serves the next one. - - This requires a significant change in our flowchart: - - - - - - - - +-----------------+ -| Create Socket | -+-----------------+ - | -+-----------------+ -| Bind Port | Daemon Process -+-----------------+ - | +--------+ - +-------------+-->| Init | - | | +--------+ -+-----------------+ | | -| Exit | | +--------+ -+-----------------+ | | Listen | - | +--------+ - | | - | +--------+ - | | Accept | - | +--------+ - | | +------------------+ - | +------>| Close Top Socket | - | | +------------------+ - | +--------+ | - | | Close | +------------------+ - | +--------+ | Serve | - | | +------------------+ - |<--------+ | - +------------------+ - | Close Acc Socket | - +--------+ +------------------+ - | Signal | | - +--------+ +------------------+ - | Exit | - +------------------+ - - - - Concurrent Server - - - - We moved the serve from the - daemon process to its own server - process. However, because each child process inherits - all open files (and a socket is treated just like a file), the - new process inherits not only the accepted - handle, i.e., the socket returned by the - accept call, but also the top - socket, i.e., the one opened by the top process right - at the beginning. - - However, the server process does not - need this socket and should close it - immediately. Similarly, the daemon process - no longer needs the accepted socket, and - not only should, but must - close it—otherwise, it will run out - of available file descriptors sooner or - later. - - After the server process is done - serving, it should close the accepted - socket. Instead of returning to - accept, it now exits. - - - Under &unix;, a process does not really - exit. Instead, it - returns to its parent. Typically, a parent - process waits for its child process, and - obtains a return value. However, our daemon - process cannot simply stop and wait. That would - defeat the whole purpose of creating additional processes. But - if it never does wait, its children will - become zombies—no longer functional - but still roaming around. - - For that reason, the daemon process - needs to set signal handlers in its - initialize daemon phase. At least a - SIGCHLD signal has to be processed, so the - daemon can remove the zombie return values from the system and - release the system resources they are taking up. - - That is why our flowchart now contains a process - signals box, which is not connected to any other box. - By the way, many servers also process SIGHUP, - and typically interpret as the signal from the superuser that - they should reread their configuration files. This allows us to - change settings without having to kill and restart these - servers. - - - - diff --git a/zh_TW.UTF-8/books/developers-handbook/testing/chapter.xml b/zh_TW.UTF-8/books/developers-handbook/testing/chapter.xml deleted file mode 100644 index fde68a1b61..0000000000 --- a/zh_TW.UTF-8/books/developers-handbook/testing/chapter.xml +++ /dev/null @@ -1,212 +0,0 @@ - - - - Regression and Performance Testing - - Regression tests are used to exercise a particular bit of the - system to check that it works as expected, and to make sure that - old bugs are not reintroduced. - - The &os; regression testing tools can be found in the &os; - source tree in the directory src/tools/regression. - -
- Micro Benchmark Checklist - - This section contains hints for doing proper - micro-benchmarking on &os; or of &os; itself. - - It is not possible to use all of the suggestions below every - single time, but the more used, the better the benchmark's - ability to test small differences will be. - - - - Disable APM and any other kind of - clock fiddling (ACPI ?). - - - - Run in single user mode. E.g. &man.cron.8;, and and - other daemons only add noise. The &man.sshd.8; daemon can - also cause problems. If ssh access is required during test - either disable the SSHv1 key regeneration, or kill the - parent sshd daemon during the tests. - - - - Do not run &man.ntpd.8;. - - - - If &man.syslog.3; events are generated, run - &man.syslogd.8; with an empty - /etc/syslogd.conf, otherwise, do not - run it. - - - - Minimize disk-I/O, avoid it entirely if possible. - - - - Do not mount file systems that are not needed. - - - - Mount /, - /usr, and any other - file system as read-only if possible. This removes atime - updates to disk (etc.) from the I/O picture. - - - - Reinitialize the read/write test file system with - &man.newfs.8; and populate it from a &man.tar.1; or - &man.dump.8; file before every run. Unmount and mount it - before starting the test. This results in a consistent file - system layout. For a worldstone test this would apply to - /usr/obj (just - reinitialize with newfs and mount). To - get 100% reproducibility, populate the file system from a - &man.dd.1; file (i.e.: dd - if=myimage of=/dev/ad0s1h - bs=1m) - - - - Use malloc backed or preloaded &man.md.4; - partitions. - - - - Reboot between individual iterations of the test, this - gives a more consistent state. - - - - Remove all non-essential device drivers from the kernel. - For instance if USB is not needed for the test, do not put - USB in the kernel. Drivers which attach often have timeouts - ticking away. - - - - Unconfigure hardware that are not in use. Detach disks - with &man.atacontrol.8; and &man.camcontrol.8; if the disks - are not used for the test. - - - - Do not configure the network unless it is being tested, - or wait until after the test has been performed to ship the - results off to another computer. - - If the system must be connected to a public network, - watch out for spikes of broadcast traffic. Even though it - is hardly noticeable, it will take up CPU cycles. Multicast - has similar caveats. - - - - Put each file system on its own disk. This minimizes - jitter from head-seek optimizations. - - - - Minimize output to serial or VGA consoles. Running - output into files gives less jitter. (Serial consoles - easily become a bottleneck.) Do not touch keyboard while - the test is running, even space or - back-space shows up in the numbers. - - - - Make sure the test is long enough, but not too long. If - the test is too short, timestamping is a problem. If it is - too long temperature changes and drift will affect the - frequency of the quartz crystals in the computer. Rule of - thumb: more than a minute, less than an hour. - - - - Try to keep the temperature as stable as possible around - the machine. This affects both quartz crystals and disk - drive algorithms. To get real stable clock, consider - stabilized clock injection. E.g. get a OCXO + PLL, inject - output into clock circuits instead of motherboard xtal. - Contact &a.phk; for more information about this. - - - - Run the test at least 3 times but it is better to run - more than 20 times both for before and - after code. Try to interleave if possible - (i.e.: do not run 20 times before then 20 times after), this - makes it possible to spot environmental effects. Do not - interleave 1:1, but 3:3, this makes it possible to spot - interaction effects. - - A good pattern is: bababa{bbbaaa}*. - This gives hint after the first 1+1 runs (so it is possible - to stop the test if it goes entirely the wrong way), a - standard deviation after the first 3+3 (gives a good - indication if it is going to be worth a long run) and - trending and interaction numbers later on. - - - - Use usr/src/tools/tools/ministat - to see if the numbers are significant. Consider buying - Cartoon guide to statistics ISBN: - 0062731025, highly recommended, if you have forgotten or - never learned about standard deviation and Student's - T. - - - - Do not use background &man.fsck.8; unless the test is a - benchmark of background fsck. Also, - disable background_fsck in - /etc/rc.conf unless the benchmark is - not started at least 60+fsck - runtime seconds after the boot, as &man.rc.8; wakes - up and checks if fsck needs to run on any - file systems when background fsck is - enabled. Likewise, make sure there are no snapshots lying - around unless the benchmark is a test with snapshots. - - - - If the benchmark show unexpected bad performance, check - for things like high interrupt volume from an unexpected - source. Some versions of ACPI have been - reported to misbehave and generate excess - interrupts. To help diagnose odd test results, take a few - snapshots of vmstat -i and look for - anything unusual. - - - - Make sure to be careful about optimization parameters - for kernel and userspace, likewise debugging. It is easy to - let something slip through and realize later the test was - not comparing the same thing. - - - - Do not ever benchmark with the - WITNESS and INVARIANTS - kernel options enabled unless the test is interested to - benchmarking those features. WITNESS can - cause 400%+ drops in performance. Likewise, userspace - &man.malloc.3; parameters default differently in -CURRENT - from the way they ship in production releases. - - -
-
diff --git a/zh_TW.UTF-8/books/developers-handbook/tools/chapter.xml b/zh_TW.UTF-8/books/developers-handbook/tools/chapter.xml deleted file mode 100644 index c9ca702ca2..0000000000 --- a/zh_TW.UTF-8/books/developers-handbook/tools/chapter.xml +++ /dev/null @@ -1,2139 +0,0 @@ - - - - 程式開發工具 - - JamesRaynardContributed by - MurrayStokely - - - - - 概敘 - - 本章將介紹如何使用一些 FreeBSD 所提供的程式開發工具(programing tools), - 本章所介紹的工具程式在其他版本的 &unix; 上也可使用, - 在此 並不會 嘗試描述寫程式時的每個細節, - 本章大部分篇幅都是假設你以前沒有或只有少數的寫程式經驗, - 不過,還是希望大多數的程式開發人員都能從中重新得到一些啟發。 - - - - 簡介 - - FreeBSD 提供一個非常棒的開發環境, - 比如說像是 C、C++、Fortran 和 assembler(組合語言)的編譯器(compiler), - 在 FreeBSD 中都已經包含在基本的系統中了 - 更別提 Perl 和其他標準 &unix; 工具,像是sed 以及 awk, - 如果你還是覺得不夠,FreeBSD在 Ports collection 中還提供其他的編譯器和直譯器(interpreter), - FreeBSD 相容許多標準,像是 &posix;ANSI C, - 當然還有它所繼承的 BSD 傳統。 - 所以在 FreeBSD 上寫的程式不需修改或頂多稍微修改,就可以在許多平台上編譯、執行。 - - 無論如何,就算你從來沒在 &unix; 平台上寫過程式,也可以徹底感受到FreeBSD 令人無法抗拒的迷人魔力。 - 本章的目標就是協助你快速上手,而暫時不需深入太多進階主題, - 並且講解一些基礎概念,以讓你可以瞭解我們在講些什麼。 - - 本章內容並不要求你得有程式開發經驗,或者你只有一點點的經驗而已。 - 不過,我們假設你已經會 &unix; 系統的基本操作, - 而且更重要的是,請保持樂於學習的心態! - - - - - Programming 概念 - - 簡單的說,程式只是一堆指令的集合體;而這些指令是用來告訴電腦應該要作那些事情。 - 有時候,指令的執行取決於前一個指令的結果而定。 - 本章將會告訴你有 2 個主要的方法,讓你可以對電腦下達這些指示(instruction) 或 命令(commands)。 - 第一個方法就是 直譯器(interpreter), - 而第二個方法是 編譯器(compiler)。 - 由於對於電腦而言,人類語言的語意過於模糊而太難理解, - 因此命令(commands)就常會以一種(或多種)程式語言寫成,用來指示電腦所要執行的特定動作為何。 - - - 直譯器 - - 使用直譯器時,所使用的程式語言就像變成一個會和你互動的環境。 - 當在命令提示列上打上命令時,直譯器會即時執行該命令。 - 在比較複雜的程式中,可以把所有想下達的命令統統輸入到某檔案裡面去, - 然後呼叫直譯器去讀取該檔案,並且執行你寫在這個檔案中的指令。 - 如果所下的指令有錯誤產生,大多數的直譯器會進入偵錯模式(debugger), - 並且顯示相關錯誤訊息,以便對程式除錯。 - - 這種方式好處在於:可以立刻看到指令的執行結果,以及錯誤也可迅速修正。 - 相對的,最大的壞處便是當你想把你寫的程式分享給其他人時,這些人必須要有跟你一樣的直譯器。 - 而且別忘了,他們也要會使用直譯器直譯程式才行。 - 當然使用者也不希望不小心按錯鍵,就進入偵錯模式而不知所措。 - 就執行效率而言,直譯器會使用到很多的記憶體, - 而且這類直譯式程式,通常並不會比編譯器所編譯的程式的更有效率。 - - 筆者個人認為,如果你之前沒有學過任何程式語言,最好先學學習直譯式語言(interpreted languages), - 像是 Lisp,Smalltalk,Perl 和 Basic 都是,&unix; 的 shell 像是 shcsh - 它們本身就是直譯器,事實上,很多人都在它們自己機器上撰寫各式的 shell script, - 來順利完成各項 housekeeping(維護) 任務。 - &unix; 的使用哲學之一就是提供大量的小工具, - 並使用 shell script 來組合運用這些小工具,以便工作更有效率。 - - - - FreeBSD 提供的直譯器 - - 下面這邊有份 &os; Ports Collection 所提供的直譯器清單,還有討論一些比較受歡迎的直譯式語言 - - 至於如何使用 Ports Collection 安裝的說明,可參閱 FreeBSD Handbook 中的 - Ports章節。 - - - BASIC - - - BASIC 是 Beginner's ALL-purpose Symbolic Instruction Code 的縮寫。 - BASIC 於 1950 年代開始發展,最初開發這套語言的目的是為了教導當時的大學學生如何寫程式。 - 到了 1980,BASIC已經是很多 programmer 第一個學習的程式語言了。 - 此外,BASIC 也是 Visual Basic 的基礎。 - - FreeBSD Ports Collection 也有收錄相關的 BASIC 直譯器。 - Bywater Basic 直譯器放在 lang/bwbasic。 - 而 Phil Cockroft's Basic 直譯器(早期也叫 Rabbit Basic)放在 lang/pbasic - - - - - Lisp - - - LISP 是在 1950 年代開始發展的一個直譯式語言,而且 LISP 就是一種 - number-crunching languages(迅速進行大量運算的程式語言),在當時算是一個普遍的程式語言。 - LISP 的表達不是基於數字(numbers),而是基於表(lists)。 - 而最能表示出 LISP 特色的地方就在於: LISP 是 List Processing 的縮寫。 - 在人工智慧(Artificial Intelligence, AI)領域上 LISP 的各式應用非常普遍。 - - LISP 是非常強悍且複雜的程式語言,但是缺點是程式碼會非常大而且難以操作。 - - 絕大部分的 LISP 直譯器都可以在 &unix; 系統上運作,當然 &os; 的 Ports Collection 也有收錄。 - GNU Common Lisp 收錄在 lang/gcl, - Bruno Haible 和 Michael Stoll 的 CLISP 收錄在 lang/clisp - ,此外 CMUCL(包含一個已經最佳化的編譯器), - 以及其他簡化版的 LISP 直譯器(比如以 C 語言寫的 SLisp,只用幾百行程式碼就實作大多數 Common Lisp 的功能) - 則是分別收錄在 lang/cmucl 以及 - lang/slisp - - - - - Perl - - - 對系統管理者而言,最愛用 perl 來撰寫 scripts 以管理主機, - 同時也經常用來寫 WWW 主機上的 CGI Script 程式。 - - Perl 在 Ports Collection 內的 lang/perl5。 - 而 &os; 4.X 則是把 Perl 裝在 /usr/bin/perl - - - - - Scheme - - - Scheme 是 LISP 的另一分支,Scheme 的特點就是比 Common LISP 還要簡潔有力。 - 由於 Scheme 簡單,所以很多大學拿來當作第一堂程式語言教學教材。 - 而且對於研究人員來說也可以快速的開發他們所需要的程式。 - - Scheme 收錄在 lang/elk, - Elk Scheme 直譯器(由麻省理工學院所發展的 Scheme 直譯器)收錄在 - lang/mit-scheme, - SCM Scheme Interpreter 收錄在 lang/scm - - - - - Icon - - - Icon 屬高階程式語言,Icon 具有強大的字串(String)和結構(Structure)處理能力。 - &os; Ports Collection 所收錄的 Icon 直譯器版本則是放在 - lang/icon - - - - - Logo - - - Logo 是種容易學習的程式語言,最常在一些教學課程中被拿來當作開頭範例。 - 如果要給小朋友開始上程式語言課的話,Logo 是相當不錯的選擇。 - 因為,即使對小朋友來說,要用 Logo 來秀出複雜多邊形圖形是相當輕鬆容易的。 - - Logo 在 &os; Ports Collection 的最新版則是放在 lang/logo - - - - - Python - - - Python 是物件導向的直譯式語言, - Python 的擁護者總是宣稱 Python 是最好入門的程式語言。 - 雖然 Python 可以很簡單的開始,但是不代表它就會輸給其他直譯式語言(像是 Perl 和 Tcl), - 事實證明 Python 也可以拿來開發大型、複雜的應用程式。 - - &os; Ports Collection 收錄在 lang/python - - - - - Ruby - - - Ruby 是純物件導向的直譯式語言。 - Ruby 目前非常流行,原因在於他易懂的程式語法結構,在撰寫程式時的彈性, - 以及天生具有輕易的發展維護大型專案的能力。 - - &os; Ports Collection 收錄在 lang/ruby8 - - - - - Tcl and Tk - - - Tcl 是內嵌式的直譯式語言,讓 Tcl 可以如此廣泛運用的原因是 Tcl 的移植性。 - Tcl 也可以快速發展一個簡單但是具有雛型的程式或者具有完整功能的程式。 - - Tcl 許多的版本都可在 &os; 上運作,而最新的 Tcl 版本為 Tcl 8.4, - &os; Ports Collection 收錄在 lang/tcl84 - - - - - - - 編譯器 - - 編譯器和直譯器兩者相比的話,有些不同,首先就是必須先把程式碼統統寫入到檔案裡面, - 然後必須執行編譯器來試著編譯程式,如果編譯器不接受所寫的程式,那就必須一直修改程式, - 直到編譯器接受且把你的程式編譯成執行檔。 - 此外,也可以在提示命令列,或在除錯器中執行你編譯好的程式看看它是否可以運作。 - - 如果在提示命令列下執行,那麼有可能會產生 core dump。 - - - 很明顯的,使用編譯器並不像直譯器般可以馬上得到結果。 - 不管如何,編譯器允許你作很多直譯器不可能或者是很難達到的事情。 - 例如:撰寫和作業系統密切互動的程式,甚至是你自己寫的作業系統! - 當你想要寫出高效率的程式時,編譯器便派上用場了。 - 編譯器可以在編譯時順便最佳化你的程式,但是直譯器卻不行。 - 而編譯器與直譯器最大的差別在於:當你想把你寫好的程式拿到另外一台機器上跑時, - 你只要將編譯器編譯出來的可執行檔,拿到新機器上便可以執行, - 而直譯器則必須要求新機器上,必須要有跟另一台機器上相同的直譯器, - 才能組譯執行你的程式! - - 編譯式的程式語言包含 Pascal、C 和 C++, - C 和 C++ 不是一個親和力十足的語言,但是很適合具有經驗的 Programmer。 - Pascal 其實是一個設計用來教學用的程式語言,而且也很適合用來入門, - &os; 預設並沒有把 Pascal 整合進 base system 中, - 但是 GNU Pascal Compiler 和 Free Pascal Compiler 都可分別在 - lang/gpclang/fpc 中找到。 - - 如果你用不同的程式來寫編譯式程式,那麼不斷地編輯-編譯-執行-除錯的這個循環肯定會很煩人, - 為了更簡化、方便程式開發流程,很多商業編譯器廠商開始發展所謂的 IDE - (Integrated Development Environments) 開發環境, - FreeBSD 預設並沒有把 IDE 整合進 base system 中, - 但是你可透過 devel/kdevelop 安裝 kdevelop - 或使用 Emacs 來體驗 IDE 開發環境。 - 在後面的 專題將介紹,如何以 Emacs 來作為 IDE 開發環境。 - - - - - - - - 用 <command>cc</command> 來編譯程式 - - 本章範例只有針對 GNU C compiler 和 GNU C++ compiler 作說明, - 這兩個在 FreeBSD base system 中就有了, - 直接打 ccgcc 就可以執行。 - 至於,如何用直譯器產生程式的說明,通常可在直譯器的文件或線上文件找到說明,因此不再贅述。 - - 當你寫完你的傑作後,接下來便是讓這個程式可以在 FreeBSD 上執行, - 通常這些要一些步驟才能完成,有些步驟則需要不同程式來完成。 - - - - 預先處理(Pre-process)你的程式碼,移除程式內的註解,和其他技巧, - 像是 expanding(擴大) C 的 marco。 - - - - 確認你的程式語法是否確實遵照 C/C++ 的規定,如果沒有符合的話,編譯器會出現警告。 - - - - 將原始碼轉成組合語言 — 它跟機器語言(machine code)非常相近,但仍在人類可理解的範圍內(據說應該是這樣)。 - - 嚴格說起來,在這個階段 cc 並不是真的把原始程式轉成組合語言, - 而是轉為 machine-independent 的 p-code - - - - - 把組合語言轉成機器語言 — 是的,這裡說的機器語言就是常提到的 bit 和 byte,也就是 1 和 0。 - - - - 確認程式中用到的函式呼叫、全域變數是否正確,舉例來說:如若呼叫了不存在的函式,編譯器會顯示警告。 - - - - 如果程式是由程式碼檔案來編譯,編譯器會整合起來。 - - - - 編譯器會負責產生東西,讓系統上的 run-time loader 可以把程式載入記憶體內執行。 - - - - 最後會把編譯完的執行檔存在硬碟上。 - - - - 通常 編譯(compiling) 是指第 1 到第 4 個步驟。 - — 其他步驟則稱為 連結(linking), - 有時候步驟 1 也可以是指 預先處理(pre-processing), - 而步驟 3 到步驟 4 則是 組譯(assembling) - - 幸運的是,你可以不用理會以上細節,編譯器都會自動完成。 - 因為 cc 只是是個前端程式(front end),它會依照正確的參數來呼叫相關程式幫你處理。 - 只需打: - &prompt.user; cc foobar.c - - 上述指令會把 foobar.c 開始編譯,並完成上述動作。 - 如果你有許多檔案需要編譯,那請打類似下列指令即可: - - &prompt.user; cc foo.c bar.c - - 記住語法錯誤檢查就是 — 純粹檢查語法錯誤與否, - 而不會幫你檢測任何邏輯錯誤,比如:無限迴圈,或是排序方式想用 binary sort 卻弄成 bubble sort。 - - 剛所說的 binary sort 和 bubble sort 問題, - 在已排序好的序列中,binary sort 搜索效率會比 bubble sort 好。 - - - cc 有非常多的選項,都可透過線上手冊來查。 - 下面只提一些必要且重要的選項,以作為例子。 - - - - - - - 編譯後的執行檔檔名,如果沒有使用這選項的話, - 編譯好的程式預設檔名將會是 a.out - - - 至於 的原因,則是一團歷史迷霧了。 - - - - &prompt.user; cc foobar.c 執行檔就是 a.out -&prompt.user; cc -o foobar foobar.c 執行檔就是 foobar - - - - - - - - - - 使用 時,只會編譯原始碼,而不作連結(linking)。 - 當只想確認語法是否正確或使用 Makefile 來編譯程式時,這個選項非常有用。 - - - - &prompt.user; cc -c foobar.c - - - - 這會產生叫做 foobarobject file(非執行檔)。 - 這檔可以與其他的 object file 連結在一起,而成執行檔。 - - - - - - - - 將會把一些給 gdb 用的除錯訊息包進去執行檔裡面,所謂的除錯訊息例如: - 程式在第幾行出錯、那個程式第幾行做什麼函式呼叫等等。除錯資訊非常好用。 - 但缺點就是:對於程式來說,額外的除錯訊息會讓編譯出來的程式比較肥些。 - 的適用時機在於:當程式還在開發時使用就好, - 而當你要釋出你的 發行版本(release version) - 或者確認程式可運作正常的話,就不必用 這選項了。 - - - &prompt.user; cc -g foobar.c - - - - 這動作會產生有含除錯訊息的執行檔。 - - 請注意,因為上例沒用 以指定執行檔名稱, - 所以執行檔會是 a.out 這檔。 - 那麼,要如何產生 foobar 的執行檔並內含除錯訊息, - 這就留待看倌們練習一下囉。 - - - - - - - - - 會產生最佳化的執行檔, - 編譯器會使用一些技巧,來讓程式可以跑的比未經最佳化的程式還快, - 可以在大寫 O 後面加上數字來指明想要的最佳化層級。 - 但是最佳化還是會有一些錯誤,舉例來說在 FreeBSD 2.10 release 中用 cc - 且指定 時,在某些情形下會產生錯誤的執行檔。 - - 只有當要釋出發行版本、或者加速程式時,才需要使用最佳化選項。 - - - &prompt.user; cc -O -o foobar foobar.c - - - - 這會產生 foobar 執行檔的最佳化版本。 - - - - - 以下三個參數將會強迫 cc 確認程式碼是否符合一些國際標準的規範, - 也就是通常說的 ANSI 標準, - 而 ANSI 嚴格來講屬 ISO 標準。 - - - - - - - 顯示 cc 維護者所認為值得注意的所有警告訊息。 - 不過這名字可能會造成誤解,事實上它並未完全顯示 cc 所能注意到的各項警告訊息。 - - - - - - - - 關閉 cc 特有的某些特殊非 ANSI C 標準功能。 - 不過這名字可能會造成誤解,事實上它並不保證你的程式會完全符合 ANSI 標準。 - - - - - - - - 全面關閉 cc 所特有的非 ANSI C 標準功能。 - - - - - 除了這些參數,cc 還允許你使用一些額外的參數取代標準參數,有些額外參數非常有用, - 但是實際上並不是所有的編譯器都有提供這些參數。 - 照標準來寫程式的最主要目的就是,希望你寫出來的程式可以在所有編譯器上編譯、執行無誤, - 當程式可以達成上述目的時,就稱為 portable code(移植性良好的程式碼) - - 一般來說,在撰寫程式時就應要注意『移植性』。 - 否則。當想把程式拿到另外一台機器上跑的時候,就可能得需要重寫程式。 - - - &prompt.user; cc -Wall -ansi -pedantic -o foobar foobar.c - - - 上述指令會確認 foobar.c 內的語法是否符合標準, - 並且產生名為 foobar 的執行檔。 - - - - - - - 告訴 gcc 在連結(linking)程式時你需要用到的函式庫名稱。 - - 最常見的情況就是,當你在程式中使用了 C 數學函式庫, - 跟其他作業平台不一樣的是,這函示學函式都不在標準函式庫(library)中, - 因此編譯器並不知道這函式庫名稱,你必須告訴編譯器要加上它才行。 - - 規則很簡單,如果有個函式庫叫做 libsomething.a, - 就必須在編譯時加上參數 才行。 - 舉例來說,數學函式庫叫做 libm.a, - 所以你必須給 cc 的參數就是 。 - 一般情況下,通常會把這參數必須放在指令的最後。 - - - &prompt.user; cc -o foobar foobar.c -lm - - - - 上面這指令會讓 gcc 跟數學函式庫作連結,以便你的程式可以呼叫函式庫內含的數學函式。 - - 如果你正在編譯的程式是 C++ 程式碼,你還必須額外指定 或者是 - 。 - 如果你的 FreeBSD 是 2.2(含)以後版本, - 你可以用指令 c++ 來取代 cc。 - 在 FreeBSD 上 c++ 也可以用 g++ 取代。 - - - &prompt.user; cc -o foobar foobar.cc -lg++ 適用 FreeBSD 2.1.6 或更早期的版本 -&prompt.user; cc -o foobar foobar.cc -lstdc++ 適用 FreeBSD 2.2 及之後的版本 -&prompt.user; c++ -o foobar foobar.cc - - - - 上述指令都會從原始檔 foobar.cc 編譯產生名為 fooboar 的執行檔。 - 這邊要提醒的是在 &unix; 系統中 C++ 程式傳統都以 .C、 - .cxx 或者是 .cc 作為副檔名, - 而非 &ms-dos; 那種以 .cpp 作為副檔名的命名方式(不過也越來越普遍了)。 - gcc 會依副檔名來決定用哪一種編譯器編譯, - 然而,現在已經不再限制副檔名了, - 所以可以自由的使用 .cpp 作為 C++ 程式碼的副檔名! - - - - - - 常見的 <command>cc</command> 問題 - - - - - 我用 sin() 函示撰寫我的程式, - 但是有個錯誤訊息(如下),這代表著? - - - /var/tmp/cc0143941.o: Undefined symbol `_sin' referenced from text segment - - - - - - 當使用 sin() 這類的數學函示時, - 你必須告訴 cc 要和數學函式庫作連結(linking),就像這樣: - - - &prompt.user; cc -o foobar foobar.c -lm - - - - - - - - 好吧,我試著寫些簡單的程式,來練習使用 -lm 選項(該程式會運算 2.1 的 6 次方) - - - #include <stdio.h> - -int main() { - float f; - - f = pow(2.1, 6); - printf("2.1 ^ 6 = %f\n", f); - return 0; -} - - - - 然後進行編譯: - - - &prompt.user; cc temp.c -lm - - - - 編譯後執行程式,得到下面這結果: - - - &prompt.user; ./a.out -2.1 ^ 6 = 1023.000000 - - - - 很明顯的,程式結果不是正確答案,到底是哪邊出錯? - - - - 當編譯器發現你呼叫一個函示時,它會確認該函示的回傳值類型(prototype), - 如果沒有特別指明,則預設的回傳值類型為 int(整數)。 - 很明顯的,你的程式所需要的並不是回傳值類別為 int - - - - - - 那如何才可以修正剛所說的問題? - - - - 數學函示的回傳值類型(prototype)會定義在 math.h, - 如果你有 include 這檔,編譯器就會知道該函示的回傳值類型,如此一來該運算就會得到正確的結果! - - - #include <math.h> -#include <stdio.h> - -int main() { -... - - - - 加了上述內容之後,再重新編譯,最後執行: - - - &prompt.user; ./a.out -2.1 ^ 6 = 85.766121 - - - - 如果有用到數學函式,請確定要有 include math.h 這檔, - 而且記得要和數學函式庫作連結。 - - - - - - 已經編譯好 foobar.c, - 但是編譯後找不到 foobar 執行檔。 該去哪邊找呢? - - - - 記得,除非有指定編譯結果的執行檔檔名,否則預設的執行檔檔名是 a.out。 - 用 參數, - 就可以達到所想要的結果,比如: - - - &prompt.user; cc -o foobar foobar.c - - - - - - - - 好,有個編譯好的程式叫做 foobar, - 用 ls 指令時可以看到, - 但執行時,訊息卻說卻沒有這檔案。為什麼? - - - - 與 &ms-dos; 不同的是,除非有指定執行檔的路徑, - 否則 &unix; 系統並不會在目前的目錄下尋找你想執行的檔案。 - 在指令列下打 ./foobar 代表 - 執行在這個目錄底下名為 foobar 的程式, - 或者也可以更改 PATH 環境變數設定如下,以達成類似效果: - - - bin:/usr/bin:/usr/local/bin:. - - - - 上一行最後的 "." 代表如果在前面寫的其他目錄找不到,就找目前的目錄 - - - - - - 試著執行 test 執行檔, - 但是卻沒有任何事發生,到底是哪裡出錯了? - - - - 大多數的 &unix; 系統都會在路徑 /usr/bin 擺放執行檔。 - 除非有指定使用在目前目錄內的 test,否則 shell 會優先選擇位在 - /usr/bintest, - 要指定檔名的話,作法類似: - - - &prompt.user; ./test - - - - 為了避免上述困擾,請為你的程式取更好的名稱吧! - - - - - - 當執行我寫的程式時剛開始正常, - 接下來卻出現 core dumped 錯誤訊息。這錯誤訊息到底代表什麼? - - - - 關於 core dumped 這個名稱的由來, - 可以追溯到早期的 &unix; 系統開始使用 core memory 對資料排序時。 - 基本上當程式在很多情況下發生錯誤後, - 作業系統會把 core memory 中的資訊寫入 core 這檔案中, - 以便讓 programmer 知道程式到底是為何出錯。 - - - - - - 真是太神奇了!程式居然發生 core dumped 了,該怎麼辦? - - - - 請用 gdb 來分析 core 結果(詳情請參考 )。 - - - - - - 當程式已經把 core memory 資料 dump 出來後, - 同時也出現另一個錯誤 segmentation fault 這意思是? - - - - 基本上,這個錯誤表示你的程式在記憶體中試著做一個嚴重的非法運作(illegal operation), - &unix; 就是被設計來保護整個作業系統免於被惡質的程式破壞,所以才會告訴你這個訊息。 - - 最常造成segmentation fault的原因通常為: - - - - 試著對一個 NULL 的指標(pointer)作寫入的動作,如 - - char *foo = NULL; -strcpy(foo, "bang!"); - - - - - 使用一個尚未初始化(initialized)的指標,如: - - char *foo; -strcpy(foo, "bang!"); - - - 尚未初始化的指標的初始值將會是隨機的,如果你夠幸運的話, - 這個指標的初始值會指向 kernel 已經用到的記憶體位置, - kernel 會結束掉這個程式以確保系統運作正常。如果你不夠幸運, - 初始指到的記憶體位置是你程式必須要用到的資料結構(data structures)的位置, - 當這個情形發生時程式將會當的不知其所以然。 - - - - 試著寫入超過陣列(array)元素個數,如: - - int bar[20]; -bar[27] = 6; - - - - - 試著讀寫在唯讀記憶體(read-only memory)中的資料,如: - - char *foo = "My string"; -strcpy(foo, "bang!"); - - - &unix; compilers often put string literals like - "My string" into read-only areas - of memory. - - - - Doing naughty things with - malloc() and - free(), eg - - char bar[80]; -free(bar); - - - or - - char *foo = malloc(27); -free(foo); -free(foo); - - - - - Making one of these mistakes will not always lead to - an error, but they are always bad practice. Some - systems and compilers are more tolerant than others, - which is why programs that ran well on one system can - crash when you try them on an another. - - - - - - Sometimes when I get a core dump it says - bus error. It says in my &unix; - book that this means a hardware problem, but the - computer still seems to be working. Is this - true? - - - - No, fortunately not (unless of course you really do - have a hardware problem…). This is usually - another way of saying that you accessed memory in a way - you should not have. - - - - - - This dumping core business sounds as though it could - be quite useful, if I can make it happen when I want to. - Can I do this, or do I have to wait until there is an - error? - - - - Yes, just go to another console or xterm, do - - &prompt.user; ps - - - to find out the process ID of your program, and - do - - &prompt.user; kill -ABRT pid - - - where - pid is - the process ID you looked up. - - This is useful if your program has got stuck in an - infinite loop, for instance. If your program happens to - trap SIGABRT, there are several other - signals which have a similar effect. - - Alternatively, you can create a core dump from - inside your program, by calling the - abort() function. See the manual page - of &man.abort.3; to learn more. - - If you want to create a core dump from outside your - program, but do not want the process to terminate, you - can use the gcore program. See the - manual page of &man.gcore.1; for more information. - - - - - - - - - Make - - - What is <command>make</command>? - - When you are working on a simple program with only one or - two source files, typing in - - &prompt.user; cc file1.c file2.c - - is not too bad, but it quickly becomes very tedious when - there are several files—and it can take a while to - compile, too. - - One way to get around this is to use object files and only - recompile the source file if the source code has changed. So - we could have something like: - - &prompt.user; cc file1.o file2.ofile37.c - - if we had changed file37.c, but not any - of the others, since the last time we compiled. This may - speed up the compilation quite a bit, but does not solve the - typing problem. - - Or we could write a shell script to solve the typing - problem, but it would have to re-compile everything, making it - very inefficient on a large project. - - What happens if we have hundreds of source files lying - about? What if we are working in a team with other people who - forget to tell us when they have changed one of their source - files that we use? - - Perhaps we could put the two solutions together and write - something like a shell script that would contain some kind of - magic rule saying when a source file needs compiling. Now all - we need now is a program that can understand these rules, as - it is a bit too complicated for the shell. - - This program is called make. It reads - in a file, called a makefile, that - tells it how different files depend on each other, and works - out which files need to be re-compiled and which ones do not. - For example, a rule could say something like if - fromboz.o is older than - fromboz.c, that means someone must have - changed fromboz.c, so it needs to be - re-compiled. The makefile also has rules telling - make how to re-compile the source file, - making it a much more powerful tool. - - Makefiles are typically kept in the same directory as the - source they apply to, and can be called - makefile, Makefile - or MAKEFILE. Most programmers use the - name Makefile, as this puts it near the - top of a directory listing, where it can easily be - seen. - - - They do not use the MAKEFILE form - as block capitals are often used for documentation files - like README. - - - - - Example of using <command>make</command> - - Here is a very simple make file: - - foo: foo.c - cc -o foo foo.c - - It consists of two lines, a dependency line and a creation - line. - - The dependency line here consists of the name of the - program (known as the target), followed - by a colon, then whitespace, then the name of the source file. - When make reads this line, it looks to see - if foo exists; if it exists, it compares - the time foo was last modified to the - time foo.c was last modified. If - foo does not exist, or is older than - foo.c, it then looks at the creation line - to find out what to do. In other words, this is the rule for - working out when foo.c needs to be - re-compiled. - - The creation line starts with a tab (press - the tab key) and then the command you would - type to create foo if you were doing it - at a command prompt. If foo is out of - date, or does not exist, make then executes - this command to create it. In other words, this is the rule - which tells make how to re-compile - foo.c. - - So, when you type make, it will - make sure that foo is up to date with - respect to your latest changes to foo.c. - This principle can be extended to - Makefiles with hundreds of - targets—in fact, on FreeBSD, it is possible to compile - the entire operating system just by typing make - world in the appropriate directory! - - Another useful property of makefiles is that the targets - do not have to be programs. For instance, we could have a make - file that looks like this: - - foo: foo.c - cc -o foo foo.c - -install: - cp foo /home/me - - We can tell make which target we want to make by - typing: - - &prompt.user; make target - - make will then only look at that target - and ignore any others. For example, if we type - make foo with the makefile above, make - will ignore the install target. - - If we just type make on its own, - make will always look at the first target and then stop - without looking at any others. So if we typed - make here, it will just go to the - foo target, re-compile - foo if necessary, and then stop without - going on to the install target. - - Notice that the install target does not - actually depend on anything! This means that the command on - the following line is always executed when we try to make that - target by typing make install. In this - case, it will copy foo into the user's - home directory. This is often used by application makefiles, - so that the application can be installed in the correct - directory when it has been correctly compiled. - - This is a slightly confusing subject to try to explain. - If you do not quite understand how make - works, the best thing to do is to write a simple program like - hello world and a make file like the one above - and experiment. Then progress to using more than one source - file, or having the source file include a header file. The - touch command is very useful here—it - changes the date on a file without you having to edit - it. - - - - Make and include-files - - C code often starts with a list of files to include, for - example stdio.h. Some of these files are system-include - files, some of them are from the project you are now working - on: - - - #include <stdio.h> -#include "foo.h" - -int main(.... - - To make sure that this file is recompiled the moment - foo.h is changed, you have to add it in - your Makefile: - - foo: foo.c foo.h - - The moment your project is getting bigger and you have - more and more own include-files to maintain, it will be a - pain to keep track of all include files and the files which - are depending on it. If you change an include-file but - forget to recompile all the files which are depending on - it, the results will be devastating. gcc - has an option to analyze your files and to produce a list - of include-files and their dependencies: . - - - If you add this to your Makefile: - - depend: - gcc -E -MM *.c > .depend - - and run make depend, the file - .depend will appear with a list of - object-files, C-files and the include-files: - - foo.o: foo.c foo.h - - If you change foo.h, next time - you run make all files depending on - foo.h will be recompiled. - - Do not forget to run make depend each - time you add an include-file to one of your files. - - - - FreeBSD Makefiles - - Makefiles can be rather complicated to write. Fortunately, - BSD-based systems like FreeBSD come with some very powerful - ones as part of the system. One very good example of this is - the FreeBSD ports system. Here is the essential part of a - typical ports Makefile: - - MASTER_SITES= ftp://freefall.cdrom.com/pub/FreeBSD/LOCAL_PORTS/ -DISTFILES= scheme-microcode+dist-7.3-freebsd.tgz - -.include <bsd.port.mk> - - Now, if we go to the directory for this port and type - make, the following happens: - - - - A check is made to see if the source code for this - port is already on the system. - - - - If it is not, an FTP connection to the URL in - MASTER_SITES is set up to download the - source. - - - - The checksum for the source is calculated and compared - it with one for a known, good, copy of the source. This - is to make sure that the source was not corrupted while in - transit. - - - - Any changes required to make the source work on - FreeBSD are applied—this is known as - patching. - - - - Any special configuration needed for the source is - done. (Many &unix; program distributions try to work out - which version of &unix; they are being compiled on and which - optional &unix; features are present—this is where - they are given the information in the FreeBSD ports - scenario). - - - - The source code for the program is compiled. In - effect, we change to the directory where the source was - unpacked and do make—the - program's own make file has the necessary information to - build the program. - - - - We now have a compiled version of the program. If we - wish, we can test it now; when we feel confident about the - program, we can type make install. - This will cause the program and any supporting files it - needs to be copied into the correct location; an entry is - also made into a package database, so - that the port can easily be uninstalled later if we change - our mind about it. - - - - Now I think you will agree that is rather impressive for a - four line script! - - The secret lies in the last line, which tells - make to look in the system makefile called - bsd.port.mk. It is easy to overlook this - line, but this is where all the clever stuff comes - from—someone has written a makefile that tells - make to do all the things above (plus a - couple of other things I did not mention, including handling - any errors that may occur) and anyone can get access to that - just by putting a single line in their own make file! - - If you want to have a look at these system makefiles, - they are in /usr/share/mk, but it is - probably best to wait until you have had a bit of practice with - makefiles, as they are very complicated (and if you do look at - them, make sure you have a flask of strong coffee - handy!) - - - - More advanced uses of <command>make</command> - - Make is a very powerful tool, and can - do much more than the simple example above shows. - Unfortunately, there are several different versions of - make, and they all differ considerably. - The best way to learn what they can do is probably to read the - documentation—hopefully this introduction will have - given you a base from which you can do this. - - The version of make that comes with FreeBSD is the - Berkeley make; there is a tutorial - for it in /usr/share/doc/psd/12.make. To - view it, do - - &prompt.user; zmore paper.ascii.gz - - in that directory. - - Many applications in the ports use GNU - make, which has a very good set of - info pages. If you have installed any of these - ports, GNU make will automatically - have been installed as gmake. It is also - available as a port and package in its own right. - - To view the info pages for GNU - make, you will have to edit the - dir file in the - /usr/local/info directory to add an entry - for it. This involves adding a line like - - * Make: (make). The GNU Make utility. - - to the file. Once you have done this, you can type - info and then select - make from the menu (or in - Emacs, do C-h - i). - - - - - Debugging - - - The Debugger - - The debugger that comes with FreeBSD is called - gdb (GNU - debugger). You start it up by typing - - &prompt.user; gdb progname - - although most people prefer to run it inside - Emacs. You can do this by: - - M-x gdb RET progname RET - - Using a debugger allows you to run the program under more - controlled circumstances. Typically, you can step through the - program a line at a time, inspect the value of variables, - change them, tell the debugger to run up to a certain point - and then stop, and so on. You can even attach to a program - that is already running, or load a core file to investigate why - the program crashed. It is even possible to debug the kernel, - though that is a little trickier than the user applications - we will be discussing in this section. - - gdb has quite good on-line help, as - well as a set of info pages, so this section will concentrate - on a few of the basic commands. - - Finally, if you find its text-based command-prompt style - off-putting, there is a graphical front-end for it (xxgdb) in the ports - collection. - - This section is intended to be an introduction to using - gdb and does not cover specialized topics - such as debugging the kernel. - - - - Running a program in the debugger - - You will need to have compiled the program with the - option to get the most out of using - gdb. It will work without, but you will only - see the name of the function you are in, instead of the source - code. If you see a line like: - - … (no debugging symbols found) … - - when gdb starts up, you will know that - the program was not compiled with the - option. - - At the gdb prompt, type - break main. This will tell the - debugger to skip over the preliminary set-up code in the - program and start at the beginning of your code. Now type - run to start the program—it will - start at the beginning of the set-up code and then get stopped - by the debugger when it calls main(). - (If you have ever wondered where main() - gets called from, now you know!). - - You can now step through the program, a line at a time, by - pressing n. If you get to a function call, - you can step into it by pressing s. Once - you are in a function call, you can return from stepping into a - function call by pressing f. You can also - use up and down to take - a quick look at the caller. - - Here is a simple example of how to spot a mistake in a - program with gdb. This is our program - (with a deliberate mistake): - - #include <stdio.h> - -int bazz(int anint); - -main() { - int i; - - printf("This is my program\n"); - bazz(i); - return 0; -} - -int bazz(int anint) { - printf("You gave me %d\n", anint); - return anint; -} - - This program sets i to be - 5 and passes it to a function - bazz() which prints out the number we - gave it. - - When we compile and run the program we get - - &prompt.user; cc -g -o temp temp.c -&prompt.user; ./temp -This is my program -anint = 4231 - - That was not what we expected! Time to see what is going - on! - - &prompt.user; gdb temp -GDB is free software and you are welcome to distribute copies of it - under certain conditions; type "show copying" to see the conditions. -There is absolutely no warranty for GDB; type "show warranty" for details. -GDB 4.13 (i386-unknown-freebsd), Copyright 1994 Free Software Foundation, Inc. -(gdb) break main Skip the set-up code -Breakpoint 1 at 0x160f: file temp.c, line 9. gdb puts breakpoint at main() -(gdb) run Run as far as main() -Starting program: /home/james/tmp/temp Program starts running - -Breakpoint 1, main () at temp.c:9 gdb stops at main() -(gdb) n Go to next line -This is my program Program prints out -(gdb) s step into bazz() -bazz (anint=4231) at temp.c:17 gdb displays stack frame -(gdb) - - Hang on a minute! How did anint get to be - 4231? Did we not we set it to be - 5 in main()? Let's - move up to main() and have a look. - - (gdb) up Move up call stack -#1 0x1625 in main () at temp.c:11 gdb displays stack frame -(gdb) p i Show us the value of i -$1 = 4231 gdb displays 4231 - - Oh dear! Looking at the code, we forgot to initialize - i. We meant to put - - -main() { - int i; - - i = 5; - printf("This is my program\n"); - - - but we left the i=5; line out. As we - did not initialize i, it had whatever number - happened to be in that area of memory when the program ran, - which in this case happened to be - 4231. - - - gdb displays the stack frame every - time we go into or out of a function, even if we are using - up and down to move - around the call stack. This shows the name of the function - and the values of its arguments, which helps us keep track - of where we are and what is going on. (The stack is a - storage area where the program stores information about the - arguments passed to functions and where to go when it - returns from a function call). - - - - - Examining a core file - - A core file is basically a file which contains the - complete state of the process when it crashed. In the - good old days, programmers had to print out hex - listings of core files and sweat over machine code manuals, - but now life is a bit easier. Incidentally, under FreeBSD and - other 4.4BSD systems, a core file is called - progname.core instead of just - core, to make it clearer which program a - core file belongs to. - - To examine a core file, start up gdb in - the usual way. Instead of typing break or - run, type - - (gdb) core progname.core - - If you are not in the same directory as the core file, - you will have to do dir - /path/to/core/file first. - - You should see something like this: - - &prompt.user; gdb a.out -GDB is free software and you are welcome to distribute copies of it - under certain conditions; type "show copying" to see the conditions. -There is absolutely no warranty for GDB; type "show warranty" for details. -GDB 4.13 (i386-unknown-freebsd), Copyright 1994 Free Software Foundation, Inc. -(gdb) core a.out.core -Core was generated by `a.out'. -Program terminated with signal 11, Segmentation fault. -Cannot access memory at address 0x7020796d. -#0 0x164a in bazz (anint=0x5) at temp.c:17 -(gdb) - - In this case, the program was called - a.out, so the core file is called - a.out.core. We can see that the program - crashed due to trying to access an area in memory that was not - available to it in a function called - bazz. - - Sometimes it is useful to be able to see how a function was - called, as the problem could have occurred a long way up the - call stack in a complex program. The bt - command causes gdb to print out a - back-trace of the call stack: - - (gdb) bt -#0 0x164a in bazz (anint=0x5) at temp.c:17 -#1 0xefbfd888 in end () -#2 0x162c in main () at temp.c:11 -(gdb) - - The end() function is called when a - program crashes; in this case, the bazz() - function was called from main(). - - - - Attaching to a running program - - One of the neatest features about gdb - is that it can attach to a program that is already running. Of - course, that assumes you have sufficient permissions to do so. - A common problem is when you are stepping through a program - that forks, and you want to trace the child, but the debugger - will only let you trace the parent. - - What you do is start up another gdb, - use ps to find the process ID for the - child, and do - - (gdb) attach pid - - in gdb, and then debug as usual. - - That is all very well, you are probably - thinking, but by the time I have done that, the child - process will be over the hill and far away. Fear - not, gentle reader, here is how to do it (courtesy of the - gdb info pages): - - -if ((pid = fork()) < 0) /* _Always_ check this */ - error(); -else if (pid == 0) { /* child */ - int PauseMode = 1; - - while (PauseMode) - sleep(10); /* Wait until someone attaches to us */ - -} else { /* parent */ - - - Now all you have to do is attach to the child, set - PauseMode to 0, and wait - for the sleep() call to return! - - - - - Using Emacs as a Development Environment - - - Emacs - - Unfortunately, &unix; systems do not come with the kind of - everything-you-ever-wanted-and-lots-more-you-did-not-in-one-gigantic-package - integrated development environments that other systems - have. - - - Some powerful, free IDEs now exist, such as KDevelop - in the ports collection. - - - However, it is possible to set up your own environment. It - may not be as pretty, and it may not be quite as integrated, - but you can set it up the way you want it. And it is free. - And you have the source to it. - - The key to it all is Emacs. Now there are some people who - loathe it, but many who love it. If you are one of the former, - I am afraid this section will hold little of interest to you. - Also, you will need a fair amount of memory to run it—I would - recommend 8MB in text mode and 16MB in X as the bare minimum - to get reasonable performance. - - Emacs is basically a highly customizable - editor—indeed, it has been customized to the point where - it is more like an operating system than an editor! Many - developers and sysadmins do in fact spend practically all - their time working inside Emacs, leaving it only to log - out. - - It is impossible even to summarize everything Emacs can do - here, but here are some of the features of interest to - developers: - - - - Very powerful editor, allowing search-and-replace on - both strings and regular expressions (patterns), jumping - to start/end of block expression, etc, etc. - - - - Pull-down menus and online help. - - - - Language-dependent syntax highlighting and - indentation. - - - - Completely customizable. - - - - You can compile and debug programs within - Emacs. - - - - On a compilation error, you can jump to the offending - line of source code. - - - - Friendly-ish front-end to the info - program used for reading GNU hypertext documentation, - including the documentation on Emacs itself. - - - - Friendly front-end to gdb, allowing - you to look at the source code as you step through your - program. - - - - You can read Usenet news and mail while your program - is compiling. - - - - And doubtless many more that I have overlooked. - - Emacs can be installed on FreeBSD using the Emacs - port. - - Once it is installed, start it up and do C-h - t to read an Emacs tutorial—that means - hold down the control key, press - h, let go of the control - key, and then press t. (Alternatively, you - can you use the mouse to select Emacs - Tutorial from the Help - menu). - - Although Emacs does have menus, it is well worth learning - the key bindings, as it is much quicker when you are editing - something to press a couple of keys than to try to find the - mouse and then click on the right place. And, when you are - talking to seasoned Emacs users, you will find they often - casually throw around expressions like M-x - replace-s RET foo RET bar RET so it is - useful to know what they mean. And in any case, Emacs has far - too many useful functions for them to all fit on the menu - bars. - - Fortunately, it is quite easy to pick up the key-bindings, - as they are displayed next to the menu item. My advice is to - use the menu item for, say, opening a file until you - understand how it works and feel confident with it, then try - doing C-x C-f. When you are happy with that, move on to - another menu command. - - If you can not remember what a particular combination of - keys does, select Describe Key from - the Help menu and type it in—Emacs - will tell you what it does. You can also use the - Command Apropos menu item to find - out all the commands which contain a particular word in them, - with the key binding next to it. - - By the way, the expression above means hold down the - Meta key, press x, release - the Meta key, type - replace-s (short for - replace-string—another feature of - Emacs is that you can abbreviate commands), press the - return key, type foo - (the string you want replaced), press the - return key, type bar (the string you want to - replace foo with) and press - return again. Emacs will then do the - search-and-replace operation you have just requested. - - If you are wondering what on earth the - Meta key is, it is a special key that many - &unix; workstations have. Unfortunately, PC's do not have one, - so it is usually the alt key (or if you are - unlucky, the escape key). - - Oh, and to get out of Emacs, do C-x C-c - (that means hold down the control key, press - x, press c and release the - control key). If you have any unsaved files - open, Emacs will ask you if you want to save them. (Ignore - the bit in the documentation where it says - C-z is the usual way to leave - Emacs—that leaves Emacs hanging around in the - background, and is only really useful if you are on a system - which does not have virtual terminals). - - - - Configuring Emacs - - Emacs does many wonderful things; some of them are built - in, some of them need to be configured. - - Instead of using a proprietary macro language for - configuration, Emacs uses a version of Lisp specially adapted - for editors, known as Emacs Lisp. Working with Emacs Lisp can - be quite helpful if you want to go on and learn something like - Common Lisp. Emacs Lisp has many features of Common Lisp, - although it is considerably smaller (and thus easier to - master). - - The best way to learn Emacs Lisp is to download the Emacs - Tutorial - - However, there is no need to actually know any Lisp to get - started with configuring Emacs, as I have included a sample - .emacs file, which should be enough to - get you started. Just copy it into your home directory and - restart Emacs if it is already running; it will read the - commands from the file and (hopefully) give you a useful basic - setup. - - - - A sample <filename>.emacs</filename> file - - Unfortunately, there is far too much here to explain it in - detail; however there are one or two points worth - mentioning. - - - - Everything beginning with a ; is a comment - and is ignored by Emacs. - - - - In the first line, the - -*- Emacs-Lisp -*- is so that - we can edit the .emacs file itself - within Emacs and get all the fancy features for editing - Emacs Lisp. Emacs usually tries to guess this based on - the filename, and may not get it right for - .emacs. - - - - The tab key is bound to an - indentation function in some modes, so when you press the - tab key, it will indent the current line of code. If you - want to put a tab character in whatever - you are writing, hold the control key down - while you are pressing the tab key. - - - - This file supports syntax highlighting for C, C++, - Perl, Lisp and Scheme, by guessing the language from the - filename. - - - - Emacs already has a pre-defined function called - next-error. In a compilation output - window, this allows you to move from one compilation error - to the next by doing M-n; we define a - complementary function, - previous-error, that allows you to go - to a previous error by doing M-p. The - nicest feature of all is that C-c C-c - will open up the source file in which the error occurred - and jump to the appropriate line. - - - - We enable Emacs's ability to act as a server, so that - if you are doing something outside Emacs and you want to - edit a file, you can just type in - - &prompt.user; emacsclient filename - - - and then you can edit the file in your - Emacs! - - - Many Emacs users set their EDITOR - environment to - emacsclient so this happens every - time they need to edit a file. - - - - - - A sample <filename>.emacs</filename> file - - ;; -*-Emacs-Lisp-*- - -;; This file is designed to be re-evaled; use the variable first-time -;; to avoid any problems with this. -(defvar first-time t - "Flag signifying this is the first time that .emacs has been evaled") - -;; Meta -(global-set-key "\M- " 'set-mark-command) -(global-set-key "\M-\C-h" 'backward-kill-word) -(global-set-key "\M-\C-r" 'query-replace) -(global-set-key "\M-r" 'replace-string) -(global-set-key "\M-g" 'goto-line) -(global-set-key "\M-h" 'help-command) - -;; Function keys -(global-set-key [f1] 'manual-entry) -(global-set-key [f2] 'info) -(global-set-key [f3] 'repeat-complex-command) -(global-set-key [f4] 'advertised-undo) -(global-set-key [f5] 'eval-current-buffer) -(global-set-key [f6] 'buffer-menu) -(global-set-key [f7] 'other-window) -(global-set-key [f8] 'find-file) -(global-set-key [f9] 'save-buffer) -(global-set-key [f10] 'next-error) -(global-set-key [f11] 'compile) -(global-set-key [f12] 'grep) -(global-set-key [C-f1] 'compile) -(global-set-key [C-f2] 'grep) -(global-set-key [C-f3] 'next-error) -(global-set-key [C-f4] 'previous-error) -(global-set-key [C-f5] 'display-faces) -(global-set-key [C-f8] 'dired) -(global-set-key [C-f10] 'kill-compilation) - -;; Keypad bindings -(global-set-key [up] "\C-p") -(global-set-key [down] "\C-n") -(global-set-key [left] "\C-b") -(global-set-key [right] "\C-f") -(global-set-key [home] "\C-a") -(global-set-key [end] "\C-e") -(global-set-key [prior] "\M-v") -(global-set-key [next] "\C-v") -(global-set-key [C-up] "\M-\C-b") -(global-set-key [C-down] "\M-\C-f") -(global-set-key [C-left] "\M-b") -(global-set-key [C-right] "\M-f") -(global-set-key [C-home] "\M-<") -(global-set-key [C-end] "\M->") -(global-set-key [C-prior] "\M-<") -(global-set-key [C-next] "\M->") - -;; Mouse -(global-set-key [mouse-3] 'imenu) - -;; Misc -(global-set-key [C-tab] "\C-q\t") ; Control tab quotes a tab. -(setq backup-by-copying-when-mismatch t) - -;; Treat 'y' or <CR> as yes, 'n' as no. -(fset 'yes-or-no-p 'y-or-n-p) -(define-key query-replace-map [return] 'act) -(define-key query-replace-map [?\C-m] 'act) - -;; Load packages -(require 'desktop) -(require 'tar-mode) - -;; Pretty diff mode -(autoload 'ediff-buffers "ediff" "Intelligent Emacs interface to diff" t) -(autoload 'ediff-files "ediff" "Intelligent Emacs interface to diff" t) -(autoload 'ediff-files-remote "ediff" - "Intelligent Emacs interface to diff") - -(if first-time - (setq auto-mode-alist - (append '(("\\.cpp$" . c++-mode) - ("\\.hpp$" . c++-mode) - ("\\.lsp$" . lisp-mode) - ("\\.scm$" . scheme-mode) - ("\\.pl$" . perl-mode) - ) auto-mode-alist))) - -;; Auto font lock mode -(defvar font-lock-auto-mode-list - (list 'c-mode 'c++-mode 'c++-c-mode 'emacs-lisp-mode 'lisp-mode 'perl-mode 'scheme-mode) - "List of modes to always start in font-lock-mode") - -(defvar font-lock-mode-keyword-alist - '((c++-c-mode . c-font-lock-keywords) - (perl-mode . perl-font-lock-keywords)) - "Associations between modes and keywords") - -(defun font-lock-auto-mode-select () - "Automatically select font-lock-mode if the current major mode is in font-lock-auto-mode-list" - (if (memq major-mode font-lock-auto-mode-list) - (progn - (font-lock-mode t)) - ) - ) - -(global-set-key [M-f1] 'font-lock-fontify-buffer) - -;; New dabbrev stuff -;(require 'new-dabbrev) -(setq dabbrev-always-check-other-buffers t) -(setq dabbrev-abbrev-char-regexp "\\sw\\|\\s_") -(add-hook 'emacs-lisp-mode-hook - '(lambda () - (set (make-local-variable 'dabbrev-case-fold-search) nil) - (set (make-local-variable 'dabbrev-case-replace) nil))) -(add-hook 'c-mode-hook - '(lambda () - (set (make-local-variable 'dabbrev-case-fold-search) nil) - (set (make-local-variable 'dabbrev-case-replace) nil))) -(add-hook 'text-mode-hook - '(lambda () - (set (make-local-variable 'dabbrev-case-fold-search) t) - (set (make-local-variable 'dabbrev-case-replace) t))) - -;; C++ and C mode... -(defun my-c++-mode-hook () - (setq tab-width 4) - (define-key c++-mode-map "\C-m" 'reindent-then-newline-and-indent) - (define-key c++-mode-map "\C-ce" 'c-comment-edit) - (setq c++-auto-hungry-initial-state 'none) - (setq c++-delete-function 'backward-delete-char) - (setq c++-tab-always-indent t) - (setq c-indent-level 4) - (setq c-continued-statement-offset 4) - (setq c++-empty-arglist-indent 4)) - -(defun my-c-mode-hook () - (setq tab-width 4) - (define-key c-mode-map "\C-m" 'reindent-then-newline-and-indent) - (define-key c-mode-map "\C-ce" 'c-comment-edit) - (setq c-auto-hungry-initial-state 'none) - (setq c-delete-function 'backward-delete-char) - (setq c-tab-always-indent t) -;; BSD-ish indentation style - (setq c-indent-level 4) - (setq c-continued-statement-offset 4) - (setq c-brace-offset -4) - (setq c-argdecl-indent 0) - (setq c-label-offset -4)) - -;; Perl mode -(defun my-perl-mode-hook () - (setq tab-width 4) - (define-key c++-mode-map "\C-m" 'reindent-then-newline-and-indent) - (setq perl-indent-level 4) - (setq perl-continued-statement-offset 4)) - -;; Scheme mode... -(defun my-scheme-mode-hook () - (define-key scheme-mode-map "\C-m" 'reindent-then-newline-and-indent)) - -;; Emacs-Lisp mode... -(defun my-lisp-mode-hook () - (define-key lisp-mode-map "\C-m" 'reindent-then-newline-and-indent) - (define-key lisp-mode-map "\C-i" 'lisp-indent-line) - (define-key lisp-mode-map "\C-j" 'eval-print-last-sexp)) - -;; Add all of the hooks... -(add-hook 'c++-mode-hook 'my-c++-mode-hook) -(add-hook 'c-mode-hook 'my-c-mode-hook) -(add-hook 'scheme-mode-hook 'my-scheme-mode-hook) -(add-hook 'emacs-lisp-mode-hook 'my-lisp-mode-hook) -(add-hook 'lisp-mode-hook 'my-lisp-mode-hook) -(add-hook 'perl-mode-hook 'my-perl-mode-hook) - -;; Complement to next-error -(defun previous-error (n) - "Visit previous compilation error message and corresponding source code." - (interactive "p") - (next-error (- n))) - -;; Misc... -(transient-mark-mode 1) -(setq mark-even-if-inactive t) -(setq visible-bell nil) -(setq next-line-add-newlines nil) -(setq compile-command "make") -(setq suggest-key-bindings nil) -(put 'eval-expression 'disabled nil) -(put 'narrow-to-region 'disabled nil) -(put 'set-goal-column 'disabled nil) -(if (>= emacs-major-version 21) - (setq show-trailing-whitespace t)) - -;; Elisp archive searching -(autoload 'format-lisp-code-directory "lispdir" nil t) -(autoload 'lisp-dir-apropos "lispdir" nil t) -(autoload 'lisp-dir-retrieve "lispdir" nil t) -(autoload 'lisp-dir-verify "lispdir" nil t) - -;; Font lock mode -(defun my-make-face (face color &optional bold) - "Create a face from a color and optionally make it bold" - (make-face face) - (copy-face 'default face) - (set-face-foreground face color) - (if bold (make-face-bold face)) - ) - -(if (eq window-system 'x) - (progn - (my-make-face 'blue "blue") - (my-make-face 'red "red") - (my-make-face 'green "dark green") - (setq font-lock-comment-face 'blue) - (setq font-lock-string-face 'bold) - (setq font-lock-type-face 'bold) - (setq font-lock-keyword-face 'bold) - (setq font-lock-function-name-face 'red) - (setq font-lock-doc-string-face 'green) - (add-hook 'find-file-hooks 'font-lock-auto-mode-select) - - (setq baud-rate 1000000) - (global-set-key "\C-cmm" 'menu-bar-mode) - (global-set-key "\C-cms" 'scroll-bar-mode) - (global-set-key [backspace] 'backward-delete-char) - ; (global-set-key [delete] 'delete-char) - (standard-display-european t) - (load-library "iso-transl"))) - -;; X11 or PC using direct screen writes -(if window-system - (progn - ;; (global-set-key [M-f1] 'hilit-repaint-command) - ;; (global-set-key [M-f2] [?\C-u M-f1]) - (setq hilit-mode-enable-list - '(not text-mode c-mode c++-mode emacs-lisp-mode lisp-mode - scheme-mode) - hilit-auto-highlight nil - hilit-auto-rehighlight 'visible - hilit-inhibit-hooks nil - hilit-inhibit-rebinding t) - (require 'hilit19) - (require 'paren)) - (setq baud-rate 2400) ; For slow serial connections - ) - -;; TTY type terminal -(if (and (not window-system) - (not (equal system-type 'ms-dos))) - (progn - (if first-time - (progn - (keyboard-translate ?\C-h ?\C-?) - (keyboard-translate ?\C-? ?\C-h))))) - -;; Under UNIX -(if (not (equal system-type 'ms-dos)) - (progn - (if first-time - (server-start)))) - -;; Add any face changes here -(add-hook 'term-setup-hook 'my-term-setup-hook) -(defun my-term-setup-hook () - (if (eq window-system 'pc) - (progn -;; (set-face-background 'default "red") - ))) - -;; Restore the "desktop" - do this as late as possible -(if first-time - (progn - (desktop-load-default) - (desktop-read))) - -;; Indicate that this file has been read at least once -(setq first-time nil) - -;; No need to debug anything now - -(setq debug-on-error nil) - -;; All done -(message "All done, %s%s" (user-login-name) ".") - - - - - - Extending the Range of Languages Emacs Understands - - Now, this is all very well if you only want to program in - the languages already catered for in the - .emacs file (C, C++, Perl, Lisp and - Scheme), but what happens if a new language called - whizbang comes out, full of exciting - features? - - The first thing to do is find out if whizbang comes with - any files that tell Emacs about the language. These usually - end in .el, short for Emacs - Lisp. For example, if whizbang is a FreeBSD port, we - can locate these files by doing - - &prompt.user; find /usr/ports/lang/whizbang -name "*.el" -print - - and install them by copying them into the Emacs site Lisp - directory. On FreeBSD 2.1.0-RELEASE, this is - /usr/local/share/emacs/site-lisp. - - So for example, if the output from the find command - was - - /usr/ports/lang/whizbang/work/misc/whizbang.el - - we would do - - &prompt.root; cp /usr/ports/lang/whizbang/work/misc/whizbang.el /usr/local/share/emacs/site-lisp - - Next, we need to decide what extension whizbang source - files have. Let's say for the sake of argument that they all - end in .wiz. We need to add an entry to - our .emacs file to make sure Emacs will - be able to use the information in - whizbang.el. - - Find the auto-mode-alist entry in - .emacs and add a line for whizbang, such - as: - - -("\\.lsp$" . lisp-mode) -("\\.wiz$" . whizbang-mode) -("\\.scm$" . scheme-mode) - - - This means that Emacs will automatically go into - whizbang-mode when you edit a file ending - in .wiz. - - Just below this, you will find the - font-lock-auto-mode-list entry. Add - whizbang-mode to it like so: - - ;; Auto font lock mode -(defvar font-lock-auto-mode-list - (list 'c-mode 'c++-mode 'c++-c-mode 'emacs-lisp-mode 'whizbang-mode 'lisp-mode 'perl-mode 'scheme-mode) - "List of modes to always start in font-lock-mode") - - This means that Emacs will always enable - font-lock-mode (ie syntax highlighting) - when editing a .wiz file. - - And that is all that is needed. If there is anything else - you want done automatically when you open up a - .wiz file, you can add a - whizbang-mode hook (see - my-scheme-mode-hook for a simple example - that adds auto-indent). - - - - - Further Reading - - For information about setting up a development environment - for contributing fixes to FreeBSD itself, please see - &man.development.7;. - - - - Brian Harvey and Matthew Wright - Simply Scheme - MIT 1994. - ISBN 0-262-08226-8 - - - - Randall Schwartz - Learning Perl - O'Reilly 1993 - ISBN 1-56592-042-2 - - - - Patrick Henry Winston and Berthold Klaus Paul Horn - Lisp (3rd Edition) - Addison-Wesley 1989 - ISBN 0-201-08319-1 - - - - Brian W. Kernighan and Rob Pike - The Unix Programming Environment - Prentice-Hall 1984 - ISBN 0-13-937681-X - - - - Brian W. Kernighan and Dennis M. Ritchie - The C Programming Language (2nd Edition) - Prentice-Hall 1988 - ISBN 0-13-110362-8 - - - - Bjarne Stroustrup - The C++ Programming Language - Addison-Wesley 1991 - ISBN 0-201-53992-6 - - - - W. Richard Stevens - Advanced Programming in the Unix Environment - Addison-Wesley 1992 - ISBN 0-201-56317-7 - - - - W. Richard Stevens - Unix Network Programming - Prentice-Hall 1990 - ISBN 0-13-949876-1 - - - - - diff --git a/zh_TW.UTF-8/books/developers-handbook/x86/chapter.xml b/zh_TW.UTF-8/books/developers-handbook/x86/chapter.xml deleted file mode 100644 index b9e4fc44a3..0000000000 --- a/zh_TW.UTF-8/books/developers-handbook/x86/chapter.xml +++ /dev/null @@ -1,6486 +0,0 @@ - - - - -x86 Assembly Language Programming - - -This chapter was written by &a.stanislav;. - - - - - -Synopsis - - -Assembly language programming under &unix; is highly undocumented. It -is generally assumed that no one would ever want to use it because -various &unix; systems run on different microprocessors, so everything -should be written in C for portability. - - - -In reality, C portability is quite a myth. Even C programs need -to be modified when ported from one &unix; to another, regardless of -what processor each runs on. Typically, such a program is full -of conditional statements depending on the system it is -compiled for. - - - -Even if we believe that all of &unix; software should be written in C, -or some other high-level language, we still need assembly language -programmers: Who else would write the section of C library -that accesses the kernel? - - - -In this chapter I will attempt to show you -how you can use assembly language writing -&unix; programs, specifically under FreeBSD. - - - -This chapter does not explain the basics of assembly language. -There are enough resources about that (for a complete -online course in assembly language, see Randall Hyde's -Art -of Assembly Language; or if you prefer -a printed book, take a look at Jeff Duntemann's -Assembly -Language Step-by-Step). However, -once the chapter is finished, any assembly language programmer -will be able to write programs for FreeBSD -quickly and efficiently. - - - -Copyright © 2000-2001 G. Adam Stanislav. All rights reserved. - - - - - -The Tools - - -The Assembler - - -The most important tool for assembly language programming is the -assembler, the software that converts assembly language code -into machine language. - - - -Two very different assemblers are available for FreeBSD. One is -as1, -which uses the traditional &unix; assembly language syntax. It -comes with the system. - - - -The other is /usr/ports/devel/nasm. -It uses the Intel syntax. Its main advantage is that it -can assemble code for many operating systems. It needs -to be installed separately, but is completely free. - - - -This chapter uses nasm -syntax because most assembly language programmers -coming to FreeBSD from other operating systems -will find it easier to understand. And, because, -quite frankly, that is what I am used to. - - - - - -The Linker - - -The output of the assembler, like that of any -compiler, needs to be linked to form an executable file. - - - -The standard -ld1 -linker comes with FreeBSD. It works with the -code assembled with either assembler. - - - - - - -System Calls - - -Default Calling Convention - - -By default, the FreeBSD kernel uses the C calling -convention. Further, although the kernel is accessed -using int 80h, -it is assumed the program will call a function that -issues int 80h, rather than -issuing int 80h directly. - - - -This convention is very convenient, and quite superior to the -µsoft; convention used by &ms-dos;. -Why? Because the &unix; convention allows any program written in -any language to access the kernel. - - - -An assembly language program can do that as well. -For example, we could open a file: - - - -kernel: - int 80h ; Call kernel - ret - -open: - push dword mode - push dword flags - push dword path - mov eax, 5 - call kernel - add esp, byte 12 - ret - - - -This is a very clean and portable way of coding. If you need to -port the code to a &unix; system which uses a different interrupt, -or a different way of passing parameters, all you need to change -is the kernel procedure. - - - -But assembly language programmers like to shave off cycles. The above example -requires a call/ret combination. -We can eliminate it by -pushing an extra dword: - - - -open: - push dword mode - push dword flags - push dword path - mov eax, 5 - push eax ; Or any other dword - int 80h - add esp, byte 16 - - - -The 5 that we have placed in -EAX identifies -the kernel function, in this case open. - - - - -Alternate Calling Convention - -FreeBSD is an extremely flexible system. It offers other ways of -calling the kernel. For it to work, however, the system must -have Linux emulation installed. - - - -Linux is a &unix; like system. However, its kernel uses the same -system-call convention of passing parameters in registers -&ms-dos; does. As with the &unix; convention, -the function number is placed in EAX. -The parameters, however, are not passed on the stack but in -EBX, ECX, EDX, ESI, EDI, EBP: - - - -open: - mov eax, 5 - mov ebx, path - mov ecx, flags - mov edx, mode - int 80h - - - -This convention has a great disadvantage over -the &unix; way, at least as far as assembly language programming -is concerned: Every time you make a kernel call -you must push the registers, then -pop them later. This makes your code -bulkier and slower. Nevertheless, FreeBSD gives -you a choice. - - - -If you do choose the Linux convention, you must let -the system know about it. After your program is assembled and -linked, you need to brand the executable: - - -&prompt.user; brandelf -f Linux filename - - - - -Which Convention Should You Use? - - -If you are coding specifically for FreeBSD, you should always -use the &unix; convention: It is faster, you can store global -variables in registers, you do not have to brand -the executable, and you do not impose the installation of -the Linux emulation package on the target system. - - - -If you want to create portable code that can also run -on Linux, you will probably still want to give the FreeBSD -users as efficient a code as possible. I will show you -how you can accomplish that after I have explained the basics. - - - - - -Call Numbers - - -To tell the kernel which system service you are calling, -place its number in EAX. Of course, you need -to know what the number is. - - - -The <filename>syscalls</filename> File - - -The numbers are listed in syscalls. -locate syscalls finds this file -in several different formats, all produced automatically -from syscalls.master. - - - -You can find the master file for the default &unix; calling -convention in -/usr/src/sys/kern/syscalls.master. -If you need to use the other convention implemented -in the Linux emulation mode, read -/usr/src/sys/i386/linux/syscalls.master. - - - - -Not only do FreeBSD and Linux use different calling -conventions, they sometimes use different numbers for -the same functions. - - - - -syscalls.master describes how -the call is to be made: - - - -0 STD NOHIDE { int nosys(void); } syscall nosys_args int -1 STD NOHIDE { void exit(int rval); } exit rexit_args void -2 STD POSIX { int fork(void); } -3 STD POSIX { ssize_t read(int fd, void *buf, size_t nbyte); } -4 STD POSIX { ssize_t write(int fd, const void *buf, size_t nbyte); } -5 STD POSIX { int open(char *path, int flags, int mode); } -6 STD POSIX { int close(int fd); } -etc... - - -It is the leftmost column that tells us the number to place in -EAX. - - - -The rightmost column tells us what parameters to -push. They are pushed -from right to left. - - - - -For example, to open a file, we need -to push the mode first, -then flags, then the address at which -the path is stored. - - - - - - - - - - -Return Values - - -A system call would not be useful most of the time -if it did not return some kind of a value: The file -descriptor of an open file, the number of bytes read -to a buffer, the system time, etc. - - - -Additionally, the system needs to inform us if an error -occurs: A file does not exist, system resources are exhausted, -we passed an invalid parameter, etc. - - - -Man Pages - - -The traditional place to look for information about various -system calls under &unix; systems are the manual pages. -FreeBSD describes its system calls in section 2, sometimes -in section 3. - - - -For example, open2 says: - - -
- -If successful, open() returns a non-negative -integer, termed a file descriptor. It returns -1 on failure, -and sets errno to indicate the error. - - -
- -The assembly language programmer new to &unix; and FreeBSD will -immediately ask the puzzling question: Where is -errno and how do I get to it? - - - - -The information presented in the manual pages applies -to C programs. The assembly language programmer needs additional -information. - - - -
- - -Where Are the Return Values? - - -Unfortunately, it depends... For most system calls it is -in EAX, but not for all. -A good rule of thumb, -when working with a system call for -the first time, is to look for -the return value in EAX. -If it is not there, you -need further research. - - - - -I am aware of one system call that returns the value in -EDX: SYS_fork. All others -I have worked with use EAX. -But I have not worked with them all yet. - - - - - -If you cannot find the answer here or anywhere else, -study libc source code and see how it -interfaces with the kernel. - - - - - -Where Is <varname>errno</varname>? - - -Actually, nowhere... - - - -errno is part of the C language, not the -&unix; kernel. When accessing kernel services directly, the -error code is returned in EAX, -the same register the proper -return value generally ends up in. - - - -This makes perfect sense. If there is no error, there is -no error code. If there is an error, there is no return -value. One register can contain either. - - - - - -Determining an Error Occurred - - -When using the standard FreeBSD calling convention, -the carry flag is cleared upon success, -set upon failure. - - - -When using the Linux emulation mode, the signed -value in EAX is non-negative upon success, -and contains the return value. In case of an error, the value -is negative, i.e., -errno. - - - - -
- - -Creating Portable Code - - -Portability is generally not one of the strengths of assembly language. -Yet, writing assembly language programs for different platforms is -possible, especially with nasm. I have written -assembly language libraries that can be assembled for such different -operating systems as &windows; and FreeBSD. - - - -It is all the more possible when you want your code to run -on two platforms which, while different, are based on -similar architectures. - - - -For example, FreeBSD is &unix;, Linux is &unix; like. I only -mentioned three differences between them (from an assembly language -programmer's perspective): The calling convention, the -function numbers, and the way of returning values. - - -Dealing with Function Numbers - - -In many cases the function numbers are the same. However, -even when they are not, the problem is easy to deal with: -Instead of using numbers in your code, use constants which -you have declared differently depending on the target -architecture: - - - -%ifdef LINUX -%define SYS_execve 11 -%else -%define SYS_execve 59 -%endif - - -Dealing with Conventions - -Both, the calling convention, and the return value (the -errno problem) can be resolved with macros: - - - -%ifdef LINUX - -%macro system 0 - call kernel -%endmacro - -align 4 -kernel: - push ebx - push ecx - push edx - push esi - push edi - push ebp - - mov ebx, [esp+32] - mov ecx, [esp+36] - mov edx, [esp+40] - mov esi, [esp+44] - mov ebp, [esp+48] - int 80h - - pop ebp - pop edi - pop esi - pop edx - pop ecx - pop ebx - - or eax, eax - js .errno - clc - ret - -.errno: - neg eax - stc - ret - -%else - -%macro system 0 - int 80h -%endmacro - -%endif - - - - -Dealing with Other Portability Issues - - -The above solutions can handle most cases of writing code -portable between FreeBSD and Linux. Nevertheless, with some -kernel services the differences are deeper. - - - -In that case, you need to write two different handlers -for those particular system calls, and use conditional -assembly. Luckily, most of your code does something other -than calling the kernel, so usually you will only need -a few such conditional sections in your code. - - - - -Using a Library - - -You can avoid portability issues in your main code altogether -by writing a library of system calls. Create a separate library -for FreeBSD, a different one for Linux, and yet other libraries -for more operating systems. - - - -In your library, write a separate function (or procedure, if -you prefer the traditional assembly language terminology) for each system -call. Use the C calling convention of passing parameters. -But still use EAX to pass the call number in. -In that case, your FreeBSD library can be very simple, as -many seemingly different functions can be just labels to -the same code: - - - -sys.open: -sys.close: -[etc...] - int 80h - ret - - - -Your Linux library will require more different functions. -But even here you can group system calls using the same -number of parameters: - - - -sys.exit: -sys.close: -[etc... one-parameter functions] - push ebx - mov ebx, [esp+12] - int 80h - pop ebx - jmp sys.return - -... - -sys.return: - or eax, eax - js sys.err - clc - ret - -sys.err: - neg eax - stc - ret - - - -The library approach may seem inconvenient at first because -it requires you to produce a separate file your code depends -on. But it has many advantages: For one, you only need to -write it once and can use it for all your programs. You can -even let other assembly language programmers use it, or perhaps use -one written by someone else. But perhaps the greatest -advantage of the library is that your code can be ported -to other systems, even by other programmers, by simply -writing a new library without any changes to your code. - - - -If you do not like the idea of having a library, you can -at least place all your system calls in a separate assembly language file -and link it with your main program. Here, again, all porters -have to do is create a new object file to link with your -main program. - - - - - -Using an Include File - - -If you are releasing your software as (or with) -source code, you can use macros and place them -in a separate file, which you include in your -code. - - - -Porters of your software will simply write a new -include file. No library or external object file -is necessary, yet your code is portable without any -need to edit the code. - - - - -This is the approach we will use throughout this chapter. -We will name our include file system.inc, and -add to it whenever we deal with a new system call. - - - - -We can start our system.inc by declaring the -standard file descriptors: - - - -%define stdin 0 -%define stdout 1 -%define stderr 2 - - - -Next, we create a symbolic name for each system call: - - - -%define SYS_nosys 0 -%define SYS_exit 1 -%define SYS_fork 2 -%define SYS_read 3 -%define SYS_write 4 -; [etc...] - - - -We add a short, non-global procedure with a long name, -so we do not accidentally reuse the name in our code: - - - -section .text -align 4 -access.the.bsd.kernel: - int 80h - ret - - - -We create a macro which takes one argument, the syscall number: - - - -%macro system 1 - mov eax, %1 - call access.the.bsd.kernel -%endmacro - - - -Finally, we create macros for each syscall. These macros take -no arguments. - - - -%macro sys.exit 0 - system SYS_exit -%endmacro - -%macro sys.fork 0 - system SYS_fork -%endmacro - -%macro sys.read 0 - system SYS_read -%endmacro - -%macro sys.write 0 - system SYS_write -%endmacro - -; [etc...] - - - -Go ahead, enter it into your editor and save it as -system.inc. We will add more to it as we -discuss more syscalls. - - - - - - - -Our First Program - - -We are now ready for our first program, the mandatory -Hello, World! - - - - 1: %include 'system.inc' - 2: - 3: section .data - 4: hello db 'Hello, World!', 0Ah - 5: hbytes equ $-hello - 6: - 7: section .text - 8: global _start - 9: _start: -10: push dword hbytes -11: push dword hello -12: push dword stdout -13: sys.write -14: -15: push dword 0 -16: sys.exit - - - -Here is what it does: Line 1 includes the defines, the macros, -and the code from system.inc. - - - -Lines 3-5 are the data: Line 3 starts the data section/segment. -Line 4 contains the string "Hello, World!" followed by a new -line (0Ah). Line 5 creates a constant that contains -the length of the string from line 4 in bytes. - - - -Lines 7-16 contain the code. Note that FreeBSD uses the elf -file format for its executables, which requires every -program to start at the point labeled _start (or, more -precisely, the linker expects that). This label has to be -global. - - - -Lines 10-13 ask the system to write hbytes bytes -of the hello string to stdout. - - - -Lines 15-16 ask the system to end the program with the return -value of 0. The SYS_exit syscall never -returns, so the code ends there. - - - - -If you have come to &unix; from &ms-dos; -assembly language background, you may be used to writing directly -to the video hardware. You will never have to worry about -this in FreeBSD, or any other flavor of &unix;. As far as -you are concerned, you are writing to a file known as -stdout. This can be the video screen, or -a telnet terminal, or an actual file, -or even the input of another program. Which one it is, -is for the system to figure out. - - - -Assembling the Code - - -Type the code (except the line numbers) in an editor, and save -it in a file named hello.asm. You need -nasm to assemble it. - - -Installing <application>nasm</application> - - -If you do not have nasm, type: - - -&prompt.user; su -Password:your root password -&prompt.root; cd /usr/ports/devel/nasm -&prompt.root; make install -&prompt.root; exit -&prompt.user; - - -You may type make install clean instead of just -make install if you do not want to keep -nasm source code. - - - -Either way, FreeBSD will automatically download -nasm from the Internet, -compile it, and install it on your system. - - - - -If your system is not FreeBSD, you need to get -nasm from its -home -page. You can still use it to assemble FreeBSD code. - - - - -Now you can assemble, link, and run the code: - - -&prompt.user; nasm -f elf hello.asm -&prompt.user; ld -s -o hello hello.o -&prompt.user; ./hello -Hello, World! -&prompt.user; - - - - - - - - -Writing &unix; Filters - - -A common type of &unix; application is a filter—a program -that reads data from the stdin, processes it -somehow, then writes the result to stdout. - - - -In this chapter, we shall develop a simple filter, and -learn how to read from stdin and write to -stdout. This filter will convert each byte -of its input into a hexadecimal number followed by a -blank space. - - - -%include 'system.inc' - -section .data -hex db '0123456789ABCDEF' -buffer db 0, 0, ' ' - -section .text -global _start -_start: - ; read a byte from stdin - push dword 1 - push dword buffer - push dword stdin - sys.read - add esp, byte 12 - or eax, eax - je .done - - ; convert it to hex - movzx eax, byte [buffer] - mov edx, eax - shr dl, 4 - mov dl, [hex+edx] - mov [buffer], dl - and al, 0Fh - mov al, [hex+eax] - mov [buffer+1], al - - ; print it - push dword 3 - push dword buffer - push dword stdout - sys.write - add esp, byte 12 - jmp short _start - -.done: - push dword 0 - sys.exit - - -In the data section we create an array called hex. -It contains the 16 hexadecimal digits in ascending order. -The array is followed by a buffer which we will use for -both input and output. The first two bytes of the buffer -are initially set to 0. This is where we will write -the two hexadecimal digits (the first byte also is -where we will read the input). The third byte is a -space. - - - -The code section consists of four parts: Reading the byte, -converting it to a hexadecimal number, writing the result, -and eventually exiting the program. - - - -To read the byte, we ask the system to read one byte -from stdin, and store it in the first byte -of the buffer. The system returns the number -of bytes read in EAX. This will be 1 -while data is coming, or 0, when no more input -data is available. Therefore, we check the value of -EAX. If it is 0, -we jump to .done, otherwise we continue. - - - - -For simplicity sake, we are ignoring the possibility -of an error condition at this time. - - - - -The hexadecimal conversion reads the byte from the -buffer into EAX, or actually just -AL, while clearing the remaining bits of -EAX to zeros. We also copy the byte to -EDX because we need to convert the upper -four bits (nibble) separately from the lower -four bits. We store the result in the first two -bytes of the buffer. - - - -Next, we ask the system to write the three bytes -of the buffer, i.e., the two hexadecimal digits and -the blank space, to stdout. We then -jump back to the beginning of the program and -process the next byte. - - - -Once there is no more input left, we ask the system -to exit our program, returning a zero, which is -the traditional value meaning the program was -successful. - - - -Go ahead, and save the code in a file named hex.asm, -then type the following (the ^D means press the -control key and type D while holding the -control key down): - - -&prompt.user; nasm -f elf hex.asm -&prompt.user; ld -s -o hex hex.o -&prompt.user; ./hex -Hello, World! -48 65 6C 6C 6F 2C 20 57 6F 72 6C 64 21 0A Here I come! -48 65 72 65 20 49 20 63 6F 6D 65 21 0A ^D &prompt.user; - - - -If you are migrating to &unix; from &ms-dos;, -you may be wondering why each line ends with 0A -instead of 0D 0A. -This is because &unix; does not use the cr/lf convention, but -a "new line" convention, which is 0A in hexadecimal. - - - - -Can we improve this? Well, for one, it is a bit confusing because -once we have converted a line of text, our input no longer -starts at the beginning of the line. We can modify it to print -a new line instead of a space after each 0A: - - - -%include 'system.inc' - -section .data -hex db '0123456789ABCDEF' -buffer db 0, 0, ' ' - -section .text -global _start -_start: - mov cl, ' ' - -.loop: - ; read a byte from stdin - push dword 1 - push dword buffer - push dword stdin - sys.read - add esp, byte 12 - or eax, eax - je .done - - ; convert it to hex - movzx eax, byte [buffer] - mov [buffer+2], cl - cmp al, 0Ah - jne .hex - mov [buffer+2], al - -.hex: - mov edx, eax - shr dl, 4 - mov dl, [hex+edx] - mov [buffer], dl - and al, 0Fh - mov al, [hex+eax] - mov [buffer+1], al - - ; print it - push dword 3 - push dword buffer - push dword stdout - sys.write - add esp, byte 12 - jmp short .loop - -.done: - push dword 0 - sys.exit - - -We have stored the space in the CL register. We can -do this safely because, unlike µsoft.windows;, &unix; system -calls do not modify the value of any register they do not use -to return a value in. - - - -That means we only need to set CL once. We have, therefore, -added a new label .loop and jump to it for the next byte -instead of jumping at _start. We have also added the -.hex label so we can either have a blank space or a -new line as the third byte of the buffer. - - - -Once you have changed hex.asm to reflect -these changes, type: - - -&prompt.user; nasm -f elf hex.asm -&prompt.user; ld -s -o hex hex.o -&prompt.user; ./hex -Hello, World! -48 65 6C 6C 6F 2C 20 57 6F 72 6C 64 21 0A -Here I come! -48 65 72 65 20 49 20 63 6F 6D 65 21 0A -^D &prompt.user; - - -That looks better. But this code is quite inefficient! We -are making a system call for every single byte twice (once -to read it, another time to write the output). - - - - - -Buffered Input and Output - - -We can improve the efficiency of our code by buffering our -input and output. We create an input buffer and read a whole -sequence of bytes at one time. Then we fetch them one by one -from the buffer. - - - -We also create an output buffer. We store our output in it until -it is full. At that time we ask the kernel to write the contents -of the buffer to stdout. - - - -The program ends when there is no more input. But we still need -to ask the kernel to write the contents of our output buffer -to stdout one last time, otherwise some of our output -would make it to the output buffer, but never be sent out. -Do not forget that, or you will be wondering why some of your -output is missing. - - - -%include 'system.inc' - -%define BUFSIZE 2048 - -section .data -hex db '0123456789ABCDEF' - -section .bss -ibuffer resb BUFSIZE -obuffer resb BUFSIZE - -section .text -global _start -_start: - sub eax, eax - sub ebx, ebx - sub ecx, ecx - mov edi, obuffer - -.loop: - ; read a byte from stdin - call getchar - - ; convert it to hex - mov dl, al - shr al, 4 - mov al, [hex+eax] - call putchar - - mov al, dl - and al, 0Fh - mov al, [hex+eax] - call putchar - - mov al, ' ' - cmp dl, 0Ah - jne .put - mov al, dl - -.put: - call putchar - jmp short .loop - -align 4 -getchar: - or ebx, ebx - jne .fetch - - call read - -.fetch: - lodsb - dec ebx - ret - -read: - push dword BUFSIZE - mov esi, ibuffer - push esi - push dword stdin - sys.read - add esp, byte 12 - mov ebx, eax - or eax, eax - je .done - sub eax, eax - ret - -align 4 -.done: - call write ; flush output buffer - push dword 0 - sys.exit - -align 4 -putchar: - stosb - inc ecx - cmp ecx, BUFSIZE - je write - ret - -align 4 -write: - sub edi, ecx ; start of buffer - push ecx - push edi - push dword stdout - sys.write - add esp, byte 12 - sub eax, eax - sub ecx, ecx ; buffer is empty now - ret - - -We now have a third section in the source code, named -.bss. This section is not included in our -executable file, and, therefore, cannot be initialized. We use -resb instead of db. -It simply reserves the requested size of uninitialized memory -for our use. - - - -We take advantage of the fact that the system does not modify the -registers: We use registers for what, otherwise, would have to be -global variables stored in the .data section. This is -also why the &unix; convention of passing parameters to system calls -on the stack is superior to the Microsoft convention of passing -them in the registers: We can keep the registers for our own use. - - - -We use EDI and ESI as pointers to the next byte -to be read from or written to. We use EBX and -ECX to keep count of the number of bytes in the -two buffers, so we know when to dump the output to, or read more -input from, the system. - - - -Let us see how it works now: - - -&prompt.user; nasm -f elf hex.asm -&prompt.user; ld -s -o hex hex.o -&prompt.user; ./hex -Hello, World! -Here I come! -48 65 6C 6C 6F 2C 20 57 6F 72 6C 64 21 0A -48 65 72 65 20 49 20 63 6F 6D 65 21 0A -^D &prompt.user; - - -Not what you expected? The program did not print the output -until we pressed ^D. That is easy to fix by -inserting three lines of code to write the output every time -we have converted a new line to 0A. I have marked -the three lines with > (do not copy the > in your -hex.asm). - - - -%include 'system.inc' - -%define BUFSIZE 2048 - -section .data -hex db '0123456789ABCDEF' - -section .bss -ibuffer resb BUFSIZE -obuffer resb BUFSIZE - -section .text -global _start -_start: - sub eax, eax - sub ebx, ebx - sub ecx, ecx - mov edi, obuffer - -.loop: - ; read a byte from stdin - call getchar - - ; convert it to hex - mov dl, al - shr al, 4 - mov al, [hex+eax] - call putchar - - mov al, dl - and al, 0Fh - mov al, [hex+eax] - call putchar - - mov al, ' ' - cmp dl, 0Ah - jne .put - mov al, dl - -.put: - call putchar -> cmp al, 0Ah -> jne .loop -> call write - jmp short .loop - -align 4 -getchar: - or ebx, ebx - jne .fetch - - call read - -.fetch: - lodsb - dec ebx - ret - -read: - push dword BUFSIZE - mov esi, ibuffer - push esi - push dword stdin - sys.read - add esp, byte 12 - mov ebx, eax - or eax, eax - je .done - sub eax, eax - ret - -align 4 -.done: - call write ; flush output buffer - push dword 0 - sys.exit - -align 4 -putchar: - stosb - inc ecx - cmp ecx, BUFSIZE - je write - ret - -align 4 -write: - sub edi, ecx ; start of buffer - push ecx - push edi - push dword stdout - sys.write - add esp, byte 12 - sub eax, eax - sub ecx, ecx ; buffer is empty now - ret - - - -Now, let us see how it works: - - -&prompt.user; nasm -f elf hex.asm -&prompt.user; ld -s -o hex hex.o -&prompt.user; ./hex -Hello, World! -48 65 6C 6C 6F 2C 20 57 6F 72 6C 64 21 0A -Here I come! -48 65 72 65 20 49 20 63 6F 6D 65 21 0A -^D &prompt.user; - - -Not bad for a 644-byte executable, is it! - - - - -This approach to buffered input/output still -contains a hidden danger. I will discuss—and -fix—it later, when I talk about the -dark -side of buffering. - - - -How to Unread a Character - - -This may be a somewhat advanced topic, mostly of interest to -programmers familiar with the theory of compilers. If you wish, -you may skip to the next -section, and perhaps read this later. - - - -While our sample program does not require it, more sophisticated -filters often need to look ahead. In other words, they may need -to see what the next character is (or even several characters). -If the next character is of a certain value, it is part of the -token currently being processed. Otherwise, it is not. - - - -For example, you may be parsing the input stream for a textual -string (e.g., when implementing a language compiler): If a -character is followed by another character, or perhaps a digit, -it is part of the token you are processing. If it is followed by -white space, or some other value, then it is not part of the -current token. - - - -This presents an interesting problem: How to return the next -character back to the input stream, so it can be read again -later? - - - -One possible solution is to store it in a character variable, -then set a flag. We can modify getchar to check the flag, -and if it is set, fetch the byte from that variable instead of the -input buffer, and reset the flag. But, of course, that slows us -down. - - - -The C language has an ungetc() function, just for that -purpose. Is there a quick way to implement it in our code? -I would like you to scroll back up and take a look at the -getchar procedure and see if you can find a nice and -fast solution before reading the next paragraph. Then come back -here and see my own solution. - - - -The key to returning a character back to the stream is in how -we are getting the characters to start with: - - - -First we check if the buffer is empty by testing the value -of EBX. If it is zero, we call the -read procedure. - - - -If we do have a character available, we use lodsb, then -decrease the value of EBX. The lodsb -instruction is effectively identical to: - - - - mov al, [esi] - inc esi - - - -The byte we have fetched remains in the buffer until the next -time read is called. We do not know when that happens, -but we do know it will not happen until the next call to -getchar. Hence, to "return" the last-read byte back -to the stream, all we have to do is decrease the value of -ESI and increase the value of EBX: - - - -ungetc: - dec esi - inc ebx - ret - - - -But, be careful! We are perfectly safe doing this if our look-ahead -is at most one character at a time. If we are examining more than -one upcoming character and call ungetc several times -in a row, it will work most of the time, but not all the time -(and will be tough to debug). Why? - - - -Because as long as getchar does not have to call -read, all of the pre-read bytes are still in the buffer, -and our ungetc works without a glitch. But the moment -getchar calls read, -the contents of the buffer change. - - - -We can always rely on ungetc working properly on the last -character we have read with getchar, but not on anything -we have read before that. - - - -If your program reads more than one byte ahead, you have at least -two choices: - - - -If possible, modify the program so it only reads one byte ahead. -This is the simplest solution. - - - -If that option is not available, first of all determine the maximum -number of characters your program needs to return to the input -stream at one time. Increase that number slightly, just to be -sure, preferably to a multiple of 16—so it aligns nicely. -Then modify the .bss section of your code, and create -a small "spare" buffer right before your input buffer, -something like this: - - - -section .bss - resb 16 ; or whatever the value you came up with -ibuffer resb BUFSIZE -obuffer resb BUFSIZE - - - -You also need to modify your ungetc to pass the value -of the byte to unget in AL: - - - -ungetc: - dec esi - inc ebx - mov [esi], al - ret - - - -With this modification, you can call ungetc -up to 17 times in a row safely (the first call will still -be within the buffer, the remaining 16 may be either within -the buffer or within the "spare"). - - - - - - -Command Line Arguments - - -Our hex program will be more useful if it can -read the names of an input and output file from its command -line, i.e., if it can process the command line arguments. -But... Where are they? - - - -Before a &unix; system starts a program, it pushes some -data on the stack, then jumps at the _start -label of the program. Yes, I said jumps, not calls. That means the -data can be accessed by reading [esp+offset], -or by simply popping it. - - - -The value at the top of the stack contains the number of -command line arguments. It is traditionally called -argc, for "argument count." - - - -Command line arguments follow next, all argc of them. -These are typically referred to as argv, for -"argument value(s)." That is, we get argv[0], -argv[1], ..., -argv[argc-1]. These are not the actual -arguments, but pointers to arguments, i.e., memory addresses of -the actual arguments. The arguments themselves are -NUL-terminated character strings. - - - -The argv list is followed by a NULL pointer, -which is simply a 0. There is more, but this is -enough for our purposes right now. - - - - -If you have come from the &ms-dos; programming -environment, the main difference is that each argument is in -a separate string. The second difference is that there is no -practical limit on how many arguments there can be. - - - - -Armed with this knowledge, we are almost ready for the next -version of hex.asm. First, however, we need to -add a few lines to system.inc: - - - -First, we need to add two new entries to our list of system -call numbers: - - - -%define SYS_open 5 -%define SYS_close 6 - - - -Then we add two new macros at the end of the file: - - - -%macro sys.open 0 - system SYS_open -%endmacro - -%macro sys.close 0 - system SYS_close -%endmacro - - - -Here, then, is our modified source code: - - - -%include 'system.inc' - -%define BUFSIZE 2048 - -section .data -fd.in dd stdin -fd.out dd stdout -hex db '0123456789ABCDEF' - -section .bss -ibuffer resb BUFSIZE -obuffer resb BUFSIZE - -section .text -align 4 -err: - push dword 1 ; return failure - sys.exit - -align 4 -global _start -_start: - add esp, byte 8 ; discard argc and argv[0] - - pop ecx - jecxz .init ; no more arguments - - ; ECX contains the path to input file - push dword 0 ; O_RDONLY - push ecx - sys.open - jc err ; open failed - - add esp, byte 8 - mov [fd.in], eax - - pop ecx - jecxz .init ; no more arguments - - ; ECX contains the path to output file - push dword 420 ; file mode (644 octal) - push dword 0200h | 0400h | 01h - ; O_CREAT | O_TRUNC | O_WRONLY - push ecx - sys.open - jc err - - add esp, byte 12 - mov [fd.out], eax - -.init: - sub eax, eax - sub ebx, ebx - sub ecx, ecx - mov edi, obuffer - -.loop: - ; read a byte from input file or stdin - call getchar - - ; convert it to hex - mov dl, al - shr al, 4 - mov al, [hex+eax] - call putchar - - mov al, dl - and al, 0Fh - mov al, [hex+eax] - call putchar - - mov al, ' ' - cmp dl, 0Ah - jne .put - mov al, dl - -.put: - call putchar - cmp al, dl - jne .loop - call write - jmp short .loop - -align 4 -getchar: - or ebx, ebx - jne .fetch - - call read - -.fetch: - lodsb - dec ebx - ret - -read: - push dword BUFSIZE - mov esi, ibuffer - push esi - push dword [fd.in] - sys.read - add esp, byte 12 - mov ebx, eax - or eax, eax - je .done - sub eax, eax - ret - -align 4 -.done: - call write ; flush output buffer - - ; close files - push dword [fd.in] - sys.close - - push dword [fd.out] - sys.close - - ; return success - push dword 0 - sys.exit - -align 4 -putchar: - stosb - inc ecx - cmp ecx, BUFSIZE - je write - ret - -align 4 -write: - sub edi, ecx ; start of buffer - push ecx - push edi - push dword [fd.out] - sys.write - add esp, byte 12 - sub eax, eax - sub ecx, ecx ; buffer is empty now - ret - - - -In our .data section we now have two new variables, -fd.in and fd.out. We store the input and -output file descriptors here. - - - -In the .text section we have replaced the references -to stdin and stdout with -[fd.in] and [fd.out]. - - - -The .text section now starts with a simple error -handler, which does nothing but exit the program with a return -value of 1. -The error handler is before _start so we are -within a short distance from where the errors occur. - - - -Naturally, the program execution still begins at _start. -First, we remove argc and argv[0] from the -stack: They are of no interest to us (in this program, that is). - - - -We pop argv[1] to ECX. This -register is particularly suited for pointers, as we can handle -NULL pointers with jecxz. If argv[1] -is not NULL, we try to open the file named in the first -argument. Otherwise, we continue the program as before: Reading -from stdin, writing to stdout. -If we fail to open the input file (e.g., it does not exist), -we jump to the error handler and quit. - - - -If all went well, we now check for the second argument. If -it is there, we open the output file. Otherwise, we send -the output to stdout. If we fail to open the output -file (e.g., it exists and we do not have the write permission), -we, again, jump to the error handler. - - - -The rest of the code is the same as before, except we close -the input and output files before exiting, and, as mentioned, -we use [fd.in] and [fd.out]. - - - -Our executable is now a whopping 768 bytes long. - - - -Can we still improve it? Of course! Every program can be improved. -Here are a few ideas of what we could do: - - - - - -Have our error handler print a message to -stderr. - - - - - -Add error handlers to the read -and write functions. - - - - - -Close stdin when we open an input file, -stdout when we open an output file. - - - - - -Add command line switches, such as -i -and -o, so we can list the input and -output files in any order, or perhaps read from -stdin and write to a file. - - - - - -Print a usage message if command line arguments are incorrect. - - - - - -I shall leave these enhancements as an exercise to the reader: -You already know everything you need to know to implement them. - - - - - -&unix; Environment - - -An important &unix; concept is the environment, which is defined by -environment variables. Some are set by the system, others -by you, yet others by the shell, or any program -that loads another program. - - - -How to Find Environment Variables - - -I said earlier that when a program starts executing, the stack -contains argc followed by the NULL-terminated -argv array, followed by something else. The -"something else" is the environment, or, -to be more precise, a NULL-terminated array of pointers to -environment variables. This is often referred -to as env. - - - -The structure of env is the same as that of -argv, a list of memory addresses followed by a -NULL (0). In this case, there is no -"envc"—we figure out where the array ends -by searching for the final NULL. - - - -The variables usually come in the name=value -format, but sometimes the =value part -may be missing. We need to account for that possibility. - - - - - -webvars - - -I could just show you some code that prints the environment -the same way the &unix; env command does. But -I thought it would be more interesting to write a simple -assembly language CGI utility. - - - -CGI: A Quick Overview - - -I have a -detailed -CGI tutorial on my web site, -but here is a very quick overview of CGI: - - - - - -The web server communicates with the CGI -program by setting environment variables. - - - - - -The CGI program -sends its output to stdout. -The web server reads it from there. - - - - - -It must start with an HTTP -header followed by two blank lines. - - - - - -It then prints the HTML -code, or whatever other type of data it is producing. - - - - - - -While certain environment variables use -standard names, others vary, depending on the web server. That -makes webvars -quite a useful diagnostic tool. - - - - - - -The Code - - -Our webvars program, then, must send out -the HTTP header followed by some -HTML mark-up. It then must read -the environment variables one by one -and send them out as part of the -HTML page. - - - -The code follows. I placed comments and explanations -right inside the code: - - - -;;;;;;; webvars.asm ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -; -; Copyright (c) 2000 G. Adam Stanislav -; All rights reserved. -; -; Redistribution and use in source and binary forms, with or without -; modification, are permitted provided that the following conditions -; are met: -; 1. Redistributions of source code must retain the above copyright -; notice, this list of conditions and the following disclaimer. -; 2. Redistributions in binary form must reproduce the above copyright -; notice, this list of conditions and the following disclaimer in the -; documentation and/or other materials provided with the distribution. -; -; THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND -; ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -; IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -; ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE -; FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -; DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS -; OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -; HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT -; LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY -; OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF -; SUCH DAMAGE. -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -; -; Version 1.0 -; -; Started: 8-Dec-2000 -; Updated: 8-Dec-2000 -; -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -%include 'system.inc' - -section .data -http db 'Content-type: text/html', 0Ah, 0Ah - db '<?xml version="1.0" encoding="utf-8"?>', 0Ah - db '<!DOCTYPE html PUBLIC "-//W3C/DTD XHTML Strict//EN" ' - db '"DTD/xhtml1-strict.dtd">', 0Ah - db '<html xmlns="http://www.w3.org/1999/xhtml" ' - db 'xml.lang="en" lang="en">', 0Ah - db '<head>', 0Ah - db '<title>Web Environment</title>', 0Ah - db '<meta name="author" content="G. Adam Stanislav" />', 0Ah - db '</head>', 0Ah, 0Ah - db '<body bgcolor="#ffffff" text="#000000" link="#0000ff" ' - db 'vlink="#840084" alink="#0000ff">', 0Ah - db '<div class="webvars">', 0Ah - db '<h1>Web Environment</h1>', 0Ah - db '<p>The following <b>environment variables</b> are defined ' - db 'on this web server:</p>', 0Ah, 0Ah - db '<table align="center" width="80" border="0" cellpadding="10" ' - db 'cellspacing="0" class="webvars">', 0Ah -httplen equ $-http -left db '<tr>', 0Ah - db '<td class="name"><tt>' -leftlen equ $-left -middle db '</tt></td>', 0Ah - db '<td class="value"><tt><b>' -midlen equ $-middle -undef db '<i>(undefined)</i>' -undeflen equ $-undef -right db '</b></tt></td>', 0Ah - db '</tr>', 0Ah -rightlen equ $-right -wrap db '</table>', 0Ah - db '</div>', 0Ah - db '</body>', 0Ah - db '</html>', 0Ah, 0Ah -wraplen equ $-wrap - -section .text -global _start -_start: - ; First, send out all the http and xhtml stuff that is - ; needed before we start showing the environment - push dword httplen - push dword http - push dword stdout - sys.write - - ; Now find how far on the stack the environment pointers - ; are. We have 12 bytes we have pushed before "argc" - mov eax, [esp+12] - - ; We need to remove the following from the stack: - ; - ; The 12 bytes we pushed for sys.write - ; The 4 bytes of argc - ; The EAX*4 bytes of argv - ; The 4 bytes of the NULL after argv - ; - ; Total: - ; 20 + eax * 4 - ; - ; Because stack grows down, we need to ADD that many bytes - ; to ESP. - lea esp, [esp+20+eax*4] - cld ; This should already be the case, but let's be sure. - - ; Loop through the environment, printing it out -.loop: - pop edi - or edi, edi ; Done yet? - je near .wrap - - ; Print the left part of HTML - push dword leftlen - push dword left - push dword stdout - sys.write - - ; It may be tempting to search for the '=' in the env string next. - ; But it is possible there is no '=', so we search for the - ; terminating NUL first. - mov esi, edi ; Save start of string - sub ecx, ecx - not ecx ; ECX = FFFFFFFF - sub eax, eax -repne scasb - not ecx ; ECX = string length + 1 - mov ebx, ecx ; Save it in EBX - - ; Now is the time to find '=' - mov edi, esi ; Start of string - mov al, '=' -repne scasb - not ecx - add ecx, ebx ; Length of name - - push ecx - push esi - push dword stdout - sys.write - - ; Print the middle part of HTML table code - push dword midlen - push dword middle - push dword stdout - sys.write - - ; Find the length of the value - not ecx - lea ebx, [ebx+ecx-1] - - ; Print "undefined" if 0 - or ebx, ebx - jne .value - - mov ebx, undeflen - mov edi, undef - -.value: - push ebx - push edi - push dword stdout - sys.write - - ; Print the right part of the table row - push dword rightlen - push dword right - push dword stdout - sys.write - - ; Get rid of the 60 bytes we have pushed - add esp, byte 60 - - ; Get the next variable - jmp .loop - -.wrap: - ; Print the rest of HTML - push dword wraplen - push dword wrap - push dword stdout - sys.write - - ; Return success - push dword 0 - sys.exit - - - -This code produces a 1,396-byte executable. Most of it is data, -i.e., the HTML mark-up we need to send out. - - - -Assemble and link it as usual: - - -&prompt.user; nasm -f elf webvars.asm -&prompt.user; ld -s -o webvars webvars.o - - -To use it, you need to upload webvars to your -web server. Depending on how your web server is set up, you -may have to store it in a special cgi-bin directory, -or perhaps rename it with a .cgi extension. - - - -Then you need to use your browser to view its output. -To see its output on my web server, please go to -http://www.int80h.org/webvars/. -If curious about the additional environment variables -present in a password protected web directory, go to -http://www.int80h.org/private/, -using the name asm and password -programmer. - - - - - - - - - -Working with Files - - -We have already done some basic file work: We know how -to open and close them, how to read and write them using -buffers. But &unix; offers much more functionality when it -comes to files. We will examine some of it in this section, -and end up with a nice file conversion utility. - - - -Indeed, let us start at the end, that is, with the file -conversion utility. It always makes programming easier -when we know from the start what the end product is -supposed to do. - - - -One of the first programs I wrote for &unix; was -tuc, -a text-to-&unix; file converter. It converts a text -file from other operating systems to a &unix; text file. -In other words, it changes from different kind of line endings -to the newline convention of &unix;. It saves the output -in a different file. Optionally, it converts a &unix; text -file to a DOS text file. - - - -I have used tuc extensively, but always -only to convert from some other OS -to &unix;, never the other way. I have always wished -it would just overwrite the file instead of me having -to send the output to a different file. Most of the time, -I end up using it like this: - - -&prompt.user; tuc myfile tempfile -&prompt.user; mv tempfile myfile - - -It would be nice to have a ftuc, -i.e., fast tuc, and use it like this: - - -&prompt.user; ftuc myfile - - -In this chapter, then, we will write -ftuc in assembly language -(the original tuc -is in C), and study various -file-oriented kernel services in the process. - - - -At first sight, such a file conversion is very -simple: All you have to do is strip the carriage -returns, right? - - - -If you answered yes, think again: That approach will -work most of the time (at least with MS -DOS text files), but will fail occasionally. - - - -The problem is that not all non &unix; text files end their -line with the carriage return / line feed sequence. Some -use carriage returns without line feeds. Others combine several -blank lines into a single carriage return followed by several -line feeds. And so on. - - - -A text file converter, then, must be able to handle -any possible line endings: - - - - - -carriage return / line feed - - - - - -carriage return - - - - - -line feed / carriage return - - - - - -line feed - - - - - -It should also handle files that use some kind of a -combination of the above (e.g., carriage return followed -by several line feeds). - - - -Finite State Machine - - -The problem is easily solved by the use of a technique -called finite state machine, originally developed -by the designers of digital electronic circuits. A -finite state machine is a digital circuit -whose output is dependent not only on its input but on -its previous input, i.e., on its state. The microprocessor -is an example of a finite state machine: Our -assembly language code is assembled to machine language in which -some assembly language code produces a single byte -of machine language, while others produce several bytes. -As the microprocessor fetches the bytes from the memory -one by one, some of them simply change its state rather than -produce some output. When all the bytes of the op code are -fetched, the microprocessor produces some output, or changes -the value of a register, etc. - - - -Because of that, all software is essentially a sequence of state -instructions for the microprocessor. Nevertheless, the concept -of finite state machine is useful in software design as well. - - - -Our text file converter can be designed as a finite state machine with three -possible states. We could call them states 0-2, -but it will make our life easier if we give them symbolic names: - - - - - -ordinary - - - - - -cr - - - - - -lf - - - - - -Our program will start in the ordinary -state. During this state, the program action depends on -its input as follows: - - - - - -If the input is anything other than a carriage return -or line feed, the input is simply passed on to the output. The -state remains unchanged. - - - - - -If the input is a carriage return, the state is changed -to cr. The input is then discarded, i.e., -no output is made. - - - - - -If the input is a line feed, the state is changed to -lf. The input is then discarded. - - - - - -Whenever we are in the cr state, it is -because the last input was a carriage return, which was -unprocessed. What our software does in this state again -depends on the current input: - - - - - -If the input is anything other than a carriage return -or line feed, output a line feed, then output the input, then -change the state to ordinary. - - - - - -If the input is a carriage return, we have received -two (or more) carriage returns in a row. We discard the -input, we output a line feed, and leave the state unchanged. - - - - - -If the input is a line feed, we output the line feed -and change the state to ordinary. Note that -this is not the same as the first case above – if we tried -to combine them, we would be outputting two line feeds -instead of one. - - - - - -Finally, we are in the lf state after -we have received a line feed that was not preceded by a -carriage return. This will happen when our file already is -in &unix; format, or whenever several lines in a row are -expressed by a single carriage return followed by several -line feeds, or when line ends with a line feed / -carriage return sequence. Here is how we need to handle -our input in this state: - - - - - -If the input is anything other than a carriage return or -line feed, we output a line feed, then output the input, then -change the state to ordinary. This is exactly -the same action as in the cr state upon -receiving the same kind of input. - - - - - -If the input is a carriage return, we discard the input, -we output a line feed, then change the state to ordinary. - - - - - -If the input is a line feed, we output the line feed, -and leave the state unchanged. - - - - - -The Final State - - -The above finite state machine works for the entire file, but leaves -the possibility that the final line end will be ignored. That will -happen whenever the file ends with a single carriage return or -a single line feed. I did not think of it when I wrote -tuc, just to discover that -occasionally it strips the last line ending. - - - -This problem is easily fixed by checking the state after the -entire file was processed. If the state is not -ordinary, we simply -need to output one last line feed. - - - - -Now that we have expressed our algorithm as a finite state machine, -we could easily design a dedicated digital electronic -circuit (a "chip") to do the conversion for us. Of course, -doing so would be considerably more expensive than writing -an assembly language program. - - - - - - -The Output Counter - - -Because our file conversion program may be combining two -characters into one, we need to use an output counter. We -initialize it to 0, and increase it -every time we send a character to the output. At the end of -the program, the counter will tell us what size we need -to set the file to. - - - - - - - -Implementing FSM in Software - - -The hardest part of working with a finite state machine -is analyzing the problem and expressing it as a -finite state machine. That accomplished, -the software almost writes itself. - - - -In a high-level language, such as C, there are several main -approaches. One is to use a switch statement -which chooses what function should be run. For example, - - - - switch (state) { - default: - case REGULAR: - regular(inputchar); - break; - case CR: - cr(inputchar); - break; - case LF: - lf(inputchar); - break; - } - - - -Another approach is by using an array of function pointers, -something like this: - - - - (output[state])(inputchar); - - - -Yet another is to have state be a -function pointer, set to point at the appropriate function: - - - - (*state)(inputchar); - - -This is the approach we will use in our program because it is very easy to do in assembly language, and very fast, too. We will simply keep the address of the right procedure in EBX, and then just issue: - - - call ebx - - - -This is possibly faster than hardcoding the address in the code -because the microprocessor does not have to fetch the address from -the memory—it is already stored in one of its registers. I said -possibly because with the caching modern -microprocessors do, either way may be equally fast. - - - - - -Memory Mapped Files - - -Because our program works on a single file, we cannot use the -approach that worked for us before, i.e., to read from an input -file and to write to an output file. - - - -&unix; allows us to map a file, or a section of a file, -into memory. To do that, we first need to open the file with the -appropriate read/write flags. Then we use the mmap -system call to map it into the memory. One nice thing about -mmap is that it automatically works with -virtual memory: We can map more of the file into the memory than -we have physical memory available, yet still access it through -regular memory op codes, such as mov, -lods, and stos. -Whatever changes we make to the memory image of the file will be -written to the file by the system. We do not even have to keep -the file open: As long as it stays mapped, we can -read from it and write to it. - - - -The 32-bit Intel microprocessors can access up to four -gigabytes of memory – physical or virtual. The FreeBSD system -allows us to use up to a half of it for file mapping. - - - -For simplicity sake, in this tutorial we will only convert files -that can be mapped into the memory in their entirety. There are -probably not too many text files that exceed two gigabytes in size. -If our program encounters one, it will simply display a message -suggesting we use the original -tuc instead. - - - -If you examine your copy of syscalls.master, -you will find two separate syscalls named mmap. -This is because of evolution of &unix;: There was the traditional -BSD mmap, -syscall 71. That one was superseded by the &posix; mmap, -syscall 197. The FreeBSD system supports both because -older programs were written by using the original BSD -version. But new software uses the &posix; version, -which is what we will use. - - - -The syscalls.master file lists -the &posix; version like this: - - - -197 STD BSD { caddr_t mmap(caddr_t addr, size_t len, int prot, \ - int flags, int fd, long pad, off_t pos); } - - - -This differs slightly from what -mmap2 -says. That is because -mmap2 -describes the C version. - - - -The difference is in the long pad argument, which is not present in the C version. However, the FreeBSD syscalls add a 32-bit pad after pushing a 64-bit argument. In this case, off_t is a 64-bit value. - - -When we are finished working with a memory-mapped file, -we unmap it with the munmap syscall: - - - - -For an in-depth treatment of mmap, see -W. Richard Stevens' -Unix -Network Programming, Volume 2, Chapter 12. - - - - - - -Determining File Size - - -Because we need to tell mmap how many bytes -of the file to map into the memory, and because we want to map -the entire file, we need to determine the size of the file. - - - -We can use the fstat syscall to get all -the information about an open file that the system can give us. -That includes the file size. - - - -Again, syscalls.master lists two versions -of fstat, a traditional one -(syscall 62), and a &posix; one -(syscall 189). Naturally, we will use the -&posix; version: - - - -189 STD POSIX { int fstat(int fd, struct stat *sb); } - - - -This is a very straightforward call: We pass to it the address -of a stat structure and the descriptor -of an open file. It will fill out the contents of the -stat structure. - - - -I do, however, have to say that I tried to declare the -stat structure in the -.bss section, and -fstat did not like it: It set the carry -flag indicating an error. After I changed the code to allocate -the structure on the stack, everything was working fine. - - - - - -Changing the File Size - - -Because our program may combine carriage return / line feed -sequences into straight line feeds, our output may be smaller -than our input. However, since we are placing our output into -the same file we read the input from, we may have to change the -size of the file. - - - -The ftruncate system call allows us to do -just that. Despite its somewhat misleading name, the -ftruncate system call can be used to both -truncate the file (make it smaller) and to grow it. - - - -And yes, we will find two versions of ftruncate -in syscalls.master, an older one -(130), and a newer one (201). We will use -the newer one: - - - -201 STD BSD { int ftruncate(int fd, int pad, off_t length); } - - - -Please note that this one contains a int pad again. - - - - - -ftuc - - -We now know everything we need to write ftuc. -We start by adding some new lines in system.inc. -First, we define some constants and structures, somewhere at -or near the beginning of the file: - - - -;;;;;;; open flags -%define O_RDONLY 0 -%define O_WRONLY 1 -%define O_RDWR 2 - -;;;;;;; mmap flags -%define PROT_NONE 0 -%define PROT_READ 1 -%define PROT_WRITE 2 -%define PROT_EXEC 4 -;; -%define MAP_SHARED 0001h -%define MAP_PRIVATE 0002h - -;;;;;;; stat structure -struc stat -st_dev resd 1 ; = 0 -st_ino resd 1 ; = 4 -st_mode resw 1 ; = 8, size is 16 bits -st_nlink resw 1 ; = 10, ditto -st_uid resd 1 ; = 12 -st_gid resd 1 ; = 16 -st_rdev resd 1 ; = 20 -st_atime resd 1 ; = 24 -st_atimensec resd 1 ; = 28 -st_mtime resd 1 ; = 32 -st_mtimensec resd 1 ; = 36 -st_ctime resd 1 ; = 40 -st_ctimensec resd 1 ; = 44 -st_size resd 2 ; = 48, size is 64 bits -st_blocks resd 2 ; = 56, ditto -st_blksize resd 1 ; = 64 -st_flags resd 1 ; = 68 -st_gen resd 1 ; = 72 -st_lspare resd 1 ; = 76 -st_qspare resd 4 ; = 80 -endstruc - - - -We define the new syscalls: - - - -%define SYS_mmap 197 -%define SYS_munmap 73 -%define SYS_fstat 189 -%define SYS_ftruncate 201 - - - -We add the macros for their use: - - - -%macro sys.mmap 0 - system SYS_mmap -%endmacro - -%macro sys.munmap 0 - system SYS_munmap -%endmacro - -%macro sys.ftruncate 0 - system SYS_ftruncate -%endmacro - -%macro sys.fstat 0 - system SYS_fstat -%endmacro - - - -And here is our code: - - - -;;;;;;; Fast Text-to-Unix Conversion (ftuc.asm) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;; -;; Started: 21-Dec-2000 -;; Updated: 22-Dec-2000 -;; -;; Copyright 2000 G. Adam Stanislav. -;; All rights reserved. -;; -;;;;;;; v.1 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -%include 'system.inc' - -section .data - db 'Copyright 2000 G. Adam Stanislav.', 0Ah - db 'All rights reserved.', 0Ah -usg db 'Usage: ftuc filename', 0Ah -usglen equ $-usg -co db "ftuc: Can't open file.", 0Ah -colen equ $-co -fae db 'ftuc: File access error.', 0Ah -faelen equ $-fae -ftl db 'ftuc: File too long, use regular tuc instead.', 0Ah -ftllen equ $-ftl -mae db 'ftuc: Memory allocation error.', 0Ah -maelen equ $-mae - -section .text - -align 4 -memerr: - push dword maelen - push dword mae - jmp short error - -align 4 -toolong: - push dword ftllen - push dword ftl - jmp short error - -align 4 -facerr: - push dword faelen - push dword fae - jmp short error - -align 4 -cantopen: - push dword colen - push dword co - jmp short error - -align 4 -usage: - push dword usglen - push dword usg - -error: - push dword stderr - sys.write - - push dword 1 - sys.exit - -align 4 -global _start -_start: - pop eax ; argc - pop eax ; program name - pop ecx ; file to convert - jecxz usage - - pop eax - or eax, eax ; Too many arguments? - jne usage - - ; Open the file - push dword O_RDWR - push ecx - sys.open - jc cantopen - - mov ebp, eax ; Save fd - - sub esp, byte stat_size - mov ebx, esp - - ; Find file size - push ebx - push ebp ; fd - sys.fstat - jc facerr - - mov edx, [ebx + st_size + 4] - - ; File is too long if EDX != 0 ... - or edx, edx - jne near toolong - mov ecx, [ebx + st_size] - ; ... or if it is above 2 GB - or ecx, ecx - js near toolong - - ; Do nothing if the file is 0 bytes in size - jecxz .quit - - ; Map the entire file in memory - push edx - push edx ; starting at offset 0 - push edx ; pad - push ebp ; fd - push dword MAP_SHARED - push dword PROT_READ | PROT_WRITE - push ecx ; entire file size - push edx ; let system decide on the address - sys.mmap - jc near memerr - - mov edi, eax - mov esi, eax - push ecx ; for SYS_munmap - push edi - - ; Use EBX for state machine - mov ebx, ordinary - mov ah, 0Ah - cld - -.loop: - lodsb - call ebx - loop .loop - - cmp ebx, ordinary - je .filesize - - ; Output final lf - mov al, ah - stosb - inc edx - -.filesize: - ; truncate file to new size - push dword 0 ; high dword - push edx ; low dword - push eax ; pad - push ebp - sys.ftruncate - - ; close it (ebp still pushed) - sys.close - - add esp, byte 16 - sys.munmap - -.quit: - push dword 0 - sys.exit - -align 4 -ordinary: - cmp al, 0Dh - je .cr - - cmp al, ah - je .lf - - stosb - inc edx - ret - -align 4 -.cr: - mov ebx, cr - ret - -align 4 -.lf: - mov ebx, lf - ret - -align 4 -cr: - cmp al, 0Dh - je .cr - - cmp al, ah - je .lf - - xchg al, ah - stosb - inc edx - - xchg al, ah - ; fall through - -.lf: - stosb - inc edx - mov ebx, ordinary - ret - -align 4 -.cr: - mov al, ah - stosb - inc edx - ret - -align 4 -lf: - cmp al, ah - je .lf - - cmp al, 0Dh - je .cr - - xchg al, ah - stosb - inc edx - - xchg al, ah - stosb - inc edx - mov ebx, ordinary - ret - -align 4 -.cr: - mov ebx, ordinary - mov al, ah - ; fall through - -.lf: - stosb - inc edx - ret - - - -Do not use this program on files stored on a disk formated -by &ms-dos; or &windows;. There seems to be a -subtle bug in the FreeBSD code when using mmap -on these drives mounted under FreeBSD: If the file is over -a certain size, mmap will just fill the memory -with zeros, and then copy them to the file overwriting -its contents. - - - - - - - -One-Pointed Mind - - -As a student of Zen, I like the idea of a one-pointed mind: -Do one thing at a time, and do it well. - - - -This, indeed, is very much how &unix; works as well. While -a typical &windows; application is attempting to do everything -imaginable (and is, therefore, riddled with bugs), a -typical &unix; program does only one thing, and it does it -well. - - - -The typical &unix; user then essentially assembles his own -applications by writing a shell script which combines the -various existing programs by piping the output of one -program to the input of another. - - - -When writing your own &unix; software, it is generally a -good idea to see what parts of the problem you need to -solve can be handled by existing programs, and only -write your own programs for that part of the problem -that you do not have an existing solution for. - - -CSV - - -I will illustrate this principle with a specific real-life -example I was faced with recently: - - - -I needed to extract the 11th field of each record from a -database I downloaded from a web site. The database was a -CSV file, i.e., a list of -comma-separated values. That is quite -a standard format for sharing data among people who may be -using different database software. - - - -The first line of the file contains the list of various fields -separated by commas. The rest of the file contains the data -listed line by line, with values separated by commas. - - - -I tried awk, using the comma as a separator. -But because several lines contained a quoted comma, -awk was extracting the wrong field -from those lines. - - - -Therefore, I needed to write my own software to extract the 11th -field from the CSV file. However, going with the &unix; -spirit, I only needed to write a simple filter that would do the -following: - - - - - -Remove the first line from the file; - - - - - -Change all unquoted commas to a different character; - - - - - -Remove all quotation marks. - - - - - -Strictly speaking, I could use sed to remove -the first line from the file, but doing so in my own program -was very easy, so I decided to do it and reduce the size of -the pipeline. - - - -At any rate, writing a program like this took me about -20 minutes. Writing a program that extracts the 11th field -from the CSV file would take a lot longer, -and I could not reuse it to extract some other field from some -other database. - - - -This time I decided to let it do a little more work than -a typical tutorial program would: - - - - - -It parses its command line for options; - - - - - -It displays proper usage if it finds wrong arguments; - - - - - -It produces meaningful error messages. - - - - - -Here is its usage message: - - -Usage: csv [-t<delim>] [-c<comma>] [-p] [-o <outfile>] [-i <infile>] - - -All parameters are optional, and can appear in any order. - - - -The -t parameter declares what to replace -the commas with. The tab is the default here. -For example, -t; will replace all unquoted -commas with semicolons. - - - -I did not need the -c option, but it may -come in handy in the future. It lets me declare that I want a -character other than a comma replaced with something else. -For example, -c@ will replace all at signs -(useful if you want to split a list of email addresses -to their user names and domains). - - - -The -p option preserves the first line, i.e., -it does not delete it. By default, we delete the first -line because in a CSV file it contains the field -names rather than data. - - - -The -i and -o -options let me specify the input and the output files. Defaults -are stdin and stdout, -so this is a regular &unix; filter. - - - -I made sure that both -i filename and --ifilename are accepted. I also made -sure that only one input and one output files may be -specified. - - - -To get the 11th field of each record, I can now do: - - -&prompt.user; csv '-t;' data.csv | awk '-F;' '{print $11}' - - -The code stores the options (except for the file descriptors) -in EDX: The comma in DH, the new -separator in DL, and the flag for -the -p option in the highest bit of -EDX, so a check for its sign will give us a -quick decision what to do. - - - -Here is the code: - - - -;;;;;;; csv.asm ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -; -; Convert a comma-separated file to a something-else separated file. -; -; Started: 31-May-2001 -; Updated: 1-Jun-2001 -; -; Copyright (c) 2001 G. Adam Stanislav -; All rights reserved. -; -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; - -%include 'system.inc' - -%define BUFSIZE 2048 - -section .data -fd.in dd stdin -fd.out dd stdout -usg db 'Usage: csv [-t<delim>] [-c<comma>] [-p] [-o <outfile>] [-i <infile>]', 0Ah -usglen equ $-usg -iemsg db "csv: Can't open input file", 0Ah -iemlen equ $-iemsg -oemsg db "csv: Can't create output file", 0Ah -oemlen equ $-oemsg - -section .bss -ibuffer resb BUFSIZE -obuffer resb BUFSIZE - -section .text -align 4 -ierr: - push dword iemlen - push dword iemsg - push dword stderr - sys.write - push dword 1 ; return failure - sys.exit - -align 4 -oerr: - push dword oemlen - push dword oemsg - push dword stderr - sys.write - push dword 2 - sys.exit - -align 4 -usage: - push dword usglen - push dword usg - push dword stderr - sys.write - push dword 3 - sys.exit - -align 4 -global _start -_start: - add esp, byte 8 ; discard argc and argv[0] - mov edx, (',' << 8) | 9 - -.arg: - pop ecx - or ecx, ecx - je near .init ; no more arguments - - ; ECX contains the pointer to an argument - cmp byte [ecx], '-' - jne usage - - inc ecx - mov ax, [ecx] - -.o: - cmp al, 'o' - jne .i - - ; Make sure we are not asked for the output file twice - cmp dword [fd.out], stdout - jne usage - - ; Find the path to output file - it is either at [ECX+1], - ; i.e., -ofile -- - ; or in the next argument, - ; i.e., -o file - - inc ecx - or ah, ah - jne .openoutput - pop ecx - jecxz usage - -.openoutput: - push dword 420 ; file mode (644 octal) - push dword 0200h | 0400h | 01h - ; O_CREAT | O_TRUNC | O_WRONLY - push ecx - sys.open - jc near oerr - - add esp, byte 12 - mov [fd.out], eax - jmp short .arg - -.i: - cmp al, 'i' - jne .p - - ; Make sure we are not asked twice - cmp dword [fd.in], stdin - jne near usage - - ; Find the path to the input file - inc ecx - or ah, ah - jne .openinput - pop ecx - or ecx, ecx - je near usage - -.openinput: - push dword 0 ; O_RDONLY - push ecx - sys.open - jc near ierr ; open failed - - add esp, byte 8 - mov [fd.in], eax - jmp .arg - -.p: - cmp al, 'p' - jne .t - or ah, ah - jne near usage - or edx, 1 << 31 - jmp .arg - -.t: - cmp al, 't' ; redefine output delimiter - jne .c - or ah, ah - je near usage - mov dl, ah - jmp .arg - -.c: - cmp al, 'c' - jne near usage - or ah, ah - je near usage - mov dh, ah - jmp .arg - -align 4 -.init: - sub eax, eax - sub ebx, ebx - sub ecx, ecx - mov edi, obuffer - - ; See if we are to preserve the first line - or edx, edx - js .loop - -.firstline: - ; get rid of the first line - call getchar - cmp al, 0Ah - jne .firstline - -.loop: - ; read a byte from stdin - call getchar - - ; is it a comma (or whatever the user asked for)? - cmp al, dh - jne .quote - - ; Replace the comma with a tab (or whatever the user wants) - mov al, dl - -.put: - call putchar - jmp short .loop - -.quote: - cmp al, '"' - jne .put - - ; Print everything until you get another quote or EOL. If it - ; is a quote, skip it. If it is EOL, print it. -.qloop: - call getchar - cmp al, '"' - je .loop - - cmp al, 0Ah - je .put - - call putchar - jmp short .qloop - -align 4 -getchar: - or ebx, ebx - jne .fetch - - call read - -.fetch: - lodsb - dec ebx - ret - -read: - jecxz .read - call write - -.read: - push dword BUFSIZE - mov esi, ibuffer - push esi - push dword [fd.in] - sys.read - add esp, byte 12 - mov ebx, eax - or eax, eax - je .done - sub eax, eax - ret - -align 4 -.done: - call write ; flush output buffer - - ; close files - push dword [fd.in] - sys.close - - push dword [fd.out] - sys.close - - ; return success - push dword 0 - sys.exit - -align 4 -putchar: - stosb - inc ecx - cmp ecx, BUFSIZE - je write - ret - -align 4 -write: - jecxz .ret ; nothing to write - sub edi, ecx ; start of buffer - push ecx - push edi - push dword [fd.out] - sys.write - add esp, byte 12 - sub eax, eax - sub ecx, ecx ; buffer is empty now -.ret: - ret - - - -Much of it is taken from hex.asm above. But there -is one important difference: I no longer call write -whenever I am outputting a line feed. Yet, the code can be -used interactively. - - - -I have found a better solution for the interactive problem -since I first started writing this chapter. I wanted to -make sure each line is printed out separately only when needed. -After all, there is no need to flush out every line when used -non-interactively. - - - -The new solution I use now is to call write every -time I find the input buffer empty. That way, when running in -the interactive mode, the program reads one line from the user's -keyboard, processes it, and sees its input buffer is empty. It -flushes its output and reads the next line. - - - -The Dark Side of Buffering - -This change prevents a mysterious lockup -in a very specific case. I refer to it as the -dark side of buffering, mostly -because it presents a danger that is not -quite obvious. - - - -It is unlikely to happen with a program like the -csv above, so let us consider yet -another filter: In this case we expect our input -to be raw data representing color values, such as -the red, green, and -blue intensities of a pixel. Our -output will be the negative of our input. - - - -Such a filter would be very simple to write. -Most of it would look just like all the other -filters we have written so far, so I am only -going to show you its inner loop: - - - -.loop: - call getchar - not al ; Create a negative - call putchar - jmp short .loop - - -Because this filter works with raw data, -it is unlikely to be used interactively. - - - -But it could be called by image manipulation software. -And, unless it calls write before each call -to read, chances are it will lock up. - - - -Here is what might happen: - - - -The image editor will load our filter using the -C function popen(). - - - -It will read the first row of pixels from -a bitmap or pixmap. - - - -It will write the first row of pixels to -the pipe leading to -the fd.in of our filter. - - - -Our filter will read each pixel -from its input, turn it to a negative, -and write it to its output buffer. - - - -Our filter will call getchar -to fetch the next pixel. - - - -getchar will find an empty -input buffer, so it will call -read. - - - -read will call the -SYS_read system call. - - - -The kernel will suspend -our filter until the image editor -sends more data to the pipe. - - - -The image editor will read from the -other pipe, connected to the -fd.out of our filter so it can set the first row of the -output image before -it sends us the second row of the input. - - - -The kernel suspends -the image editor until it receives -some output from our filter, so it -can pass it on to the image editor. - - - - -At this point our filter waits for the image -editor to send it more data to process, while -the image editor is waiting for our filter -to send it the result of the processing -of the first row. But the result sits in -our output buffer. - - - -The filter and the image editor will continue -waiting for each other forever (or, at least, -until they are killed). Our software has just -entered a -race condition. - - - -This problem does not exist if our filter flushes -its output buffer before asking the -kernel for more input data. - - - - - - - - - -Using the <acronym>FPU</acronym> - -Strangely enough, most of assembly language literature does not -even mention the existence of the FPU, -or floating point unit, let alone discuss -programming it. - - - -Yet, never does assembly language shine more than when -we create highly optimized FPU -code by doing things that can be done only in assembly language. - -Organization of the <acronym>FPU</acronym> - -The FPU consists of 8 80–bit floating–point registers. -These are organized in a stack fashion—you can -push a value on TOS -(top of stack) and you can -pop it. - - - -That said, the assembly language op codes are not push -and pop because those are already taken. - - -You can push a value on TOS -by using fld, fild, -and fbld. Several other op codes -let you push many common -constants—such as pi—on -the TOS. - - - -Similarly, you can pop a value by -using fst, fstp, -fist, fistp, and -fbstp. Actually, only the op -codes that end with a p will -literally pop the value, -the rest will store it -somewhere else without removing it from -the TOS. - - - -We can transfer the data between the -TOS and the computer memory either as -a 32–bit, 64–bit, or 80–bit real, -a 16–bit, 32–bit, or 64–bit integer, -or an 80–bit packed decimal. - - - -The 80–bit packed decimal is -a special case of binary coded -decimal which is very convenient when -converting between the ASCII -representation of data and the internal -data of the FPU. It allows us to use -18 significant digits. - - - -No matter how we represent data in the memory, -the FPU always stores it in the 80–bit -real format in its registers. - - - -Its internal precision is at least 19 decimal -digits, so even if we choose to display results -as ASCII in the full -18–digit precision, we are still showing -correct results. - - - -We can perform mathematical operations on the -TOS: We can calculate its -sine, we can scale it -(i.e., we can multiply or divide it by a power -of 2), we can calculate its base–2 -logarithm, and many other things. - - - -We can also multiply or -divide it by, add -it to, or subtract it from, -any of the FPU registers (including -itself). - - - -The official Intel op code for the -TOS is st, and -for the registers -st(0)st(7). -st and st(0), then, -refer to the same register. - - - -For whatever reasons, the original author of -nasm has decided to use -different op codes, namely -st0st7. -In other words, there are no parentheses, -and the TOS is always -st0, never just st. - - - -The Packed Decimal Format - -The packed decimal format -uses 10 bytes (80 bits) of -memory to represent 18 digits. The -number represented there is always an -integer. - - - - -You can use it to get decimal places -by multiplying the TOS -by a power of 10 first. - - - - -The highest bit of the highest byte -(byte 9) is the sign bit: -If it is set, the number is negative, -otherwise, it is positive. -The rest of the bits of this byte are unused/ignored. - - - -The remaining 9 bytes store the 18 digits -of the number: 2 digits per byte. - - -The more significant digit is -stored in the high nibble -(4 bits), the less significant -digit in the low nibble. - - - -That said, you might think that -1234567 -would be stored in the memory like this (using -hexadecimal notation): - - - -80 00 00 00 00 00 01 23 45 67 - - -Alas it is not! As with everything else of Intel make, -even the packed decimal is -little–endian. - - -That means our -1234567 -is stored like this: - - - -67 45 23 01 00 00 00 00 00 80 - - -Remember that, or you will be pulling your hair out -in desperation! - - - - -The book to read—if you can find it—is Richard Startz' -8087/80287/80387 -for the IBM PC & Compatibles. -Though it does seem to take the fact about the -little–endian storage of the packed -decimal for granted. I kid you not about the -desperation of trying to figure out what was wrong -with the filter I show below before -it occurred to me I should try the -little–endian order even for this type of data. - - - - - - - - -Excursion to Pinhole Photography - -To write meaningful software, we must not only -understand our programming tools, but also the -field we are creating software for. - - - -Our next filter will help us whenever we want -to build a pinhole camera, -so, we need some background in pinhole -photography before we can continue. - - - -The Camera - -The easiest way to describe any camera ever built -is as some empty space enclosed in some -lightproof material, with a small hole in the -enclosure. - - - -The enclosure is usually sturdy (e.g., a box), -though sometimes it is flexible (the bellows). -It is quite dark inside the camera. However, the -hole lets light rays in through a single point -(though in some cases there may be several). -These light rays form an image, a representation -of whatever is outside the camera, in front of the -hole. - - - -If some light sensitive material (such as film) -is placed inside the camera, it can capture the -image. - - -The hole often contains a lens, or -a lens assembly, often called the objective. - - - - - -The Pinhole - -But, strictly speaking, the lens is not necessary: -The original cameras did not use a lens but a -pinhole. Even today, pinholes -are used, both as a tool to study how cameras -work, and to achieve a special kind of image. - - - -The image produced by the pinhole -is all equally sharp. Or blurred. -There is an ideal size for a pinhole: If it is -either larger or smaller, the image loses its -sharpness. - - - - -Focal Length - -This ideal pinhole diameter is a function -of the square root of focal -length, which is the distance of the -pinhole from the film. - - - - D = PC * sqrt(FL) - - -In here, D is the -ideal diameter of the pinhole, -FL is the focal length, -and PC is a pinhole -constant. According to Jay Bender, -its value is 0.04, while -Kenneth Connors has determined it to -be 0.037. Others have -proposed other values. Plus, this -value is for the daylight only: Other types -of light will require a different constant, -whose value can only be determined by -experimentation. - - - - - -The F–Number - -The f–number is a very useful measure of -how much light reaches the film. A light -meter can determine that, for example, -to expose a film of specific sensitivity -with f5.6 may require the exposure to last -1/1000 sec. - - -It does not matter whether it is a 35–mm -camera, or a 6x9cm camera, etc. -As long as we know the f–number, we can determine -the proper exposure. - - - -The f–number is easy to calculate: - - - - F = FL / D - - -In other words, the f–number equals the focal -length divided by the diameter of the pinhole. -It also means a higher f–number either implies -a smaller pinhole or a larger focal distance, -or both. That, in turn, implies, the higher -the f–number, the longer the exposure has to be. - - - -Furthermore, while pinhole diameter and focal -distance are one–dimensional measurements, -both, the film and the pinhole, are two–dimensional. -That means that -if you have measured the exposure at f–number -A as t, then the exposure -at f–number B is: - - - t * (B / A)² - - - - -Normalized F–Number - -While many modern cameras can change the diameter -of their pinhole, and thus their f–number, quite -smoothly and gradually, such was not always the case. - - - -To allow for different f–numbers, cameras typically -contained a metal plate with several holes of -different sizes drilled to them. - - - -Their sizes were chosen according to the above -formula in such a way that the resultant f–number -was one of standard f–numbers used on all cameras -everywhere. For example, a very old Kodak Duaflex IV -camera in my possession has three such holes for -f–numbers 8, 11, and 16. - - - -A more recently made camera may offer f–numbers of -2.8, 4, 5.6, 8, 11, -16, 22, and 32 (as well as others). -These numbers were not chosen arbitrarily: They all are -powers of the square root of 2, though they may -be rounded somewhat. - - - - - -The F–Stop - -A typical camera is designed in such a way that setting -any of the normalized f–numbers changes the feel of the -dial. It will naturally stop in that -position. Because of that, these positions of the dial -are called f–stops. - - -Since the f–numbers at each stop are powers of the -square root of 2, moving the dial by 1 -stop will double the amount of light required for -proper exposure. Moving it by 2 stops will -quadruple the required exposure. Moving the dial by -3 stops will require the increase in exposure -8 times, etc. - - - - - - - -Designing the Pinhole Software - -We are now ready to decide what exactly we want our -pinhole software to do. - - - -Processing Program Input - -Since its main purpose is to help us design a working -pinhole camera, we will use the focal -length as the input to the program. This is something -we can determine without software: Proper focal length -is determined by the size of the film and by the need -to shoot "regular" pictures, wide angle pictures, or -telephoto pictures. - - - -Most of the programs we have written so far worked with -individual characters, or bytes, as their input: The -hex program converted individual bytes -into a hexadecimal number, the csv -program either let a character through, or deleted it, -or changed it to a different character, etc. - - - -One program, ftuc used the state machine -to consider at most two input bytes at a time. - - - -But our pinhole program cannot just -work with individual characters, it has to deal with -larger syntactic units. - - - -For example, if we want the program to calculate the -pinhole diameter (and other values we will discuss -later) at the focal lengths of 100 mm, -150 mm, and 210 mm, we may want -to enter something like this: - -100, 150, 210 - -Our program needs to consider more than a single byte of -input at a time. When it sees the first 1, -it must understand it is seeing the first digit of a -decimal number. When it sees the 0 and -the other 0, it must know it is seeing -more digits of the same number. - - - -When it encounters the first comma, it must know it is -no longer receiving the digits of the first number. -It must be able to convert the digits of the first number -into the value of 100. And the digits of the -second number into the value of 150. And, -of course, the digits of the third number into the -numeric value of 210. - - - -We need to decide what delimiters to accept: Do the -input numbers have to be separated by a comma? If so, -how do we treat two numbers separated by something else? - - - -Personally, I like to keep it simple. Something either -is a number, so I process it. Or it is not a number, -so I discard it. I do not like the computer complaining -about me typing in an extra character when it is -obvious that it is an extra character. Duh! - - - -Plus, it allows me to break up the monotony of computing -and type in a query instead of just a number: - - -What is the best pinhole diameter for the focal length of 150? - -There is no reason for the computer to spit out -a number of complaints: - - -Syntax error: What -Syntax error: is -Syntax error: the -Syntax error: best - -Et cetera, et cetera, et cetera. - - -Secondly, I like the # character to denote -the start of a comment which extends to the end of the -line. This does not take too much effort to code, and -lets me treat input files for my software as executable -scripts. - - - -In our case, we also need to decide what units the -input should come in: We choose millimeters -because that is how most photographers measure -the focus length. - - - -Finally, we need to decide whether to allow the use -of the decimal point (in which case we must also -consider the fact that much of the world uses a -decimal comma). - - -In our case allowing for the decimal point/comma -would offer a false sense of precision: There is -little if any noticeable difference between the -focus lengths of 50 and 51, -so allowing the user to input something like -50.5 is not a good idea. This is -my opinion, mind you, but I am the one writing -this program. You can make other choices in yours, -of course. - - - - - -Offering Options - -The most important thing we need to know when building -a pinhole camera is the diameter of the pinhole. Since -we want to shoot sharp images, we will use the above -formula to calculate the pinhole diameter from focal length. -As experts are offering several different values for the -PC constant, we will need to have the choice. - - - -It is traditional in &unix; programming to have two main ways -of choosing program parameters, plus to have a default for -the time the user does not make a choice. - - - -Why have two ways of choosing? - - -One is to allow a (relatively) permanent -choice that applies automatically each time the -software is run without us having to tell it over and -over what we want it to do. - - - -The permanent choices may be stored in a configuration -file, typically found in the user's home directory. -The file usually has the same name as the application -but is started with a dot. Often "rc" -is added to the file name. So, ours could be -~/.pinhole or ~/.pinholerc. -(The ~/ means current user's -home directory.) - - - -The configuration file is used mostly by programs -that have many configurable parameters. Those -that have only one (or a few) often use a different -method: They expect to find the parameter in an -environment variable. In our case, -we might look at an environment variable named -PINHOLE. - - - -Usually, a program uses one or the other of the -above methods. Otherwise, if a configuration -file said one thing, but an environment variable -another, the program might get confused (or just -too complicated). - - - -Because we only need to choose one -such parameter, we will go with the second method -and search the environment for a variable named -PINHOLE. - - -The other way allows us to make ad hoc -decisions: "Though I usually want -you to use 0.039, this time I want 0.03872." -In other words, it allows us to override -the permanent choice. - - - -This type of choice is usually done with command -line parameters. - - - -Finally, a program always needs a -default. The user may not make -any choices. Perhaps he does not know what -to choose. Perhaps he is "just browsing." -Preferably, the default will be the value -most users would choose anyway. That way -they do not need to choose. Or, rather, they -can choose the default without an additional -effort. - - - -Given this system, the program may find conflicting -options, and handle them this way: - - - -If it finds an ad hoc choice -(e.g., command line parameter), it should -accept that choice. It must ignore any permanent -choice and any default. - - - -Otherwise, if it finds -a permanent option (e.g., an environment -variable), it should accept it, and ignore -the default. - - -Otherwise, it should use -the default. - - - - -We also need to decide what format -our PC option should have. - - - -At first site, it seems obvious to use the -PINHOLE=0.04 format for the -environment variable, and -p0.04 -for the command line. - - - -Allowing that is actually a security risk. -The PC constant is a very small -number. Naturally, we will test our software -using various small values of PC. -But what will happen if someone runs the program -choosing a huge value? - - - -It may crash the program because we have not -designed it to handle huge numbers. - - - -Or, we may spend more time on the program so -it can handle huge numbers. We might do that -if we were writing commercial software for -computer illiterate audience. - - - -Or, we might say, "Tough! -The user should know better."" - - - -Or, we just may make it impossible for the user -to enter a huge number. This is the approach we -will take: We will use an implied 0. -prefix. - - - -In other words, if the user wants 0.04, -we will expect him to type -p04, -or set PINHOLE=04 in his environment. -So, if he says -p9999999, we will -interpret it as 0.9999999—still -ridiculous but at least safer. - - - -Secondly, many users will just want to go with either -Bender's constant or Connors' constant. -To make it easier on them, we will interpret --b as identical to -p04, -and -c as identical to -p037. - - - - - -The Output - -We need to decide what we want our software to -send to the output, and in what format. - - - -Since our input allows for an unspecified number -of focal length entries, it makes sense to use -a traditional database–style output of showing -the result of the calculation for each -focal length on a separate line, while -separating all values on one line by a -tab character. - - - -Optionally, we should also allow the user -to specify the use of the CSV -format we have studied earlier. In this case, -we will print out a line of comma–separated -names describing each field of every line, -then show our results as before, but substituting -a comma for the tab. - - -We need a command line option for the CSV -format. We cannot use -c because -that already means use Connors' constant. -For some strange reason, many web sites refer to -CSV files as "Excel -spreadsheet" (though the CSV -format predates Excel). We will, therefore, use -the -e switch to inform our software -we want the output in the CSV format. - - - -We will start each line of the output with the -focal length. This may sound repetitious at first, -especially in the interactive mode: The user -types in the focal length, and we are repeating it. - - - -But the user can type several focal lengths on one -line. The input can also come in from a file or -from the output of another program. In that case -the user does not see the input at all. - - - -By the same token, the output can go to a file -which we will want to examine later, or it could -go to the printer, or become the input of another -program. - - - -So, it makes perfect sense to start each line with -the focal length as entered by the user. - - - -No, wait! Not as entered by the user. What if the user -types in something like this: - -00000000150 - -Clearly, we need to strip those leading zeros. - - -So, we might consider reading the user input as is, -converting it to binary inside the FPU, -and printing it out from there. - - - -But... - - -What if the user types something like this: - - -17459765723452353453534535353530530534563507309676764423 - -Ha! The packed decimal FPU format -lets us input 18–digit numbers. But the -user has entered more than 18 digits. How -do we handle that? - - - -Well, we could modify our code to read -the first 18 digits, enter it to the FPU, -then read more, multiply what we already have on the -TOS by 10 raised to the number -of additional digits, then add to it. - - - -Yes, we could do that. But in this -program it would be ridiculous (in a different one it may be just the thing to do): Even the circumference of the Earth expressed in -millimeters only takes 11 digits. Clearly, -we cannot build a camera that large (not yet, -anyway). - - - -So, if the user enters such a huge number, he is -either bored, or testing us, or trying to break -into the system, or playing games—doing -anything but designing a pinhole camera. - - - -What will we do? - - -We will slap him in the face, in a manner of speaking: - -17459765723452353453534535353530530534563507309676764423 ??? ??? ??? ??? ??? - -To achieve that, we will simply ignore any leading zeros. -Once we find a non–zero digit, we will initialize a -counter to 0 and start taking three steps: - - - - -Send the digit to the output. - - - -Append the digit to a buffer we will use later to -produce the packed decimal we can send to the -FPU. - - - -Increase the counter. - - - - -Now, while we are taking these three steps, -we also need to watch out for one of two -conditions: - - - - -If the counter grows above 18, -we stop appending to the buffer. We -continue reading the digits and sending -them to the output. - - - - - -If, or rather when, -the next input character is not -a digit, we are done inputting -for now. - - - -Incidentally, we can simply -discard the non–digit, unless it -is a #, which we must -return to the input stream. It -starts a comment, so we must see it -after we are done producing output -and start looking for more input. - - - - - -That still leaves one possibility -uncovered: If all the user enters -is a zero (or several zeros), we -will never find a non–zero to -display. - - -We can determine this has happened -whenever our counter stays at 0. -In that case we need to send 0 -to the output, and perform another -"slap in the face": - - -0 ??? ??? ??? ??? ??? - -Once we have displayed the focal -length and determined it is valid -(greater than 0 -but not exceeding 18 digits), -we can calculate the pinhole diameter. - - - -It is not by coincidence that pinhole -contains the word pin. Indeed, -many a pinhole literally is a pin -hole, a hole carefully punched with the -tip of a pin. - - - -That is because a typical pinhole is very -small. Our formula gets the result in -millimeters. We will multiply it by 1000, -so we can output the result in microns. - - - -At this point we have yet another trap to face: -Too much precision. - - - -Yes, the FPU was designed -for high precision mathematics. But we -are not dealing with high precision -mathematics. We are dealing with physics -(optics, specifically). - - - -Suppose we want to convert a truck into -a pinhole camera (we would not be the -first ones to do that!). Suppose its box is -12 -meters long, so we have the focal length -of 12000. Well, using Bender's constant, it gives us square root of -12000 multiplied by 0.04, -which is 4.381780460 millimeters, -or 4381.780460 microns. - - - -Put either way, the result is absurdly precise. -Our truck is not exactly 12000 -millimeters long. We did not measure its length -with such a precision, so stating we need a pinhole -with the diameter of 4.381780460 -millimeters is, well, deceiving. 4.4 -millimeters would do just fine. - - - - -I "only" used ten digits in the above example. -Imagine the absurdity of going for all 18! - - - - -We need to limit the number of significant -digits of our result. One way of doing it -is by using an integer representing microns. -So, our truck would need a pinhole with the diameter -of 4382 microns. Looking at that number, we still decide that 4400 microns, -or 4.4 millimeters is close enough. - - - -Additionally, we can decide that no matter how -big a result we get, we only want to display four -significant digits (or any other number -of them, of course). Alas, the FPU -does not offer rounding to a specific number -of digits (after all, it does not view the -numbers as decimal but as binary). - - - -We, therefore, must devise an algorithm to reduce -the number of significant digits. - - - -Here is mine (I think it is awkward—if -you know a better one, please, let me know): - - - -Initialize a counter to 0. - - - -While the number is greater than or equal to -10000, divide it by -10 and increase the counter. - - - -Output the result. - - -While the counter is greater than 0, -output 0 and decrease the counter. - - - - - -The 10000 is only good if you want -four significant digits. For any other -number of significant digits, replace -10000 with 10 -raised to the number of significant digits. - - - - -We will, then, output the pinhole diameter -in microns, rounded off to four significant -digits. - - - -At this point, we know the focal -length and the pinhole -diameter. That means we have enough -information to also calculate the -f–number. - - - -We will display the f–number, rounded to -four significant digits. Chances are the -f–number will tell us very little. To make -it more meaningful, we can find the nearest -normalized f–number, i.e., -the nearest power of the square root -of 2. - - - -We do that by multiplying the actual f–number -by itself, which, of course, will give us -its square. We will then calculate -its base–2 logarithm, which is much -easier to do than calculating the -base–square–root–of–2 logarithm! -We will round the result to the nearest integer. -Next, we will raise 2 to the result. Actually, -the FPU gives us a good shortcut -to do that: We can use the fscale -op code to "scale" 1, which is -analogous to shifting an -integer left. Finally, we calculate the square -root of it all, and we have the nearest -normalized f–number. - - - -If all that sounds overwhelming—or too much -work, perhaps—it may become much clearer -if you see the code. It takes 9 op -codes altogether: - - - fmul st0, st0 - fld1 - fld st1 - fyl2x - frndint - fld1 - fscale - fsqrt - fstp st1 - - -The first line, fmul st0, st0, squares -the contents of the TOS -(top of the stack, same as st, -called st0 by nasm). -The fld1 pushes 1 -on the TOS. - - -The next line, fld st1, pushes -the square back to the TOS. -At this point the square is both in st -and st(2) (it will become -clear why we leave a second copy on the stack -in a moment). st(1) contains -1. - - - -Next, fyl2x calculates base–2 -logarithm of st multiplied by -st(1). That is why we placed 1 on st(1) before. - - -At this point, st contains -the logarithm we have just calculated, -st(1) contains the square -of the actual f–number we saved for later. - - - -frndint rounds the TOS -to the nearest integer. fld1 pushes -a 1. fscale shifts the -1 we have on the TOS -by the value in st(1), -effectively raising 2 to st(1). - - - -Finally, fsqrt calculates -the square root of the result, i.e., -the nearest normalized f–number. - - - -We now have the nearest normalized -f–number on the TOS, -the base–2 logarithm rounded to the -nearest integer in st(1), -and the square of the actual f–number -in st(2). We are saving -the value in st(2) for later. - - - -But we do not need the contents of -st(1) anymore. The last -line, fstp st1, places the -contents of st to -st(1), and pops. As a -result, what was st(1) -is now st, what was st(2) -is now st(1), etc. -The new st contains the -normalized f–number. The new -st(1) contains the square -of the actual f–number we have -stored there for posterity. - - - -At this point, we are ready to output -the normalized f–number. Because it is -normalized, we will not round it off to -four significant digits, but will -send it out in its full precision. - - - -The normalized f-number is useful as long -as it is reasonably small and can be found -on our light meter. Otherwise we need a -different method of determining proper -exposure. - - - -Earlier we have figured out the formula -of calculating proper exposure at an arbitrary -f–number from that measured at a different -f–number. - - - -Every light meter I have ever seen can determine -proper exposure at f5.6. We will, therefore, -calculate an "f5.6 multiplier," -i.e., by how much we need to multiply the exposure measured -at f5.6 to determine the proper exposure -for our pinhole camera. - - - -From the above formula we know this factor can be -calculated by dividing our f–number (the -actual one, not the normalized one) by -5.6, and squaring the result. - - - -Mathematically, dividing the square of our -f–number by the square of 5.6 -will give us the same result. - - - -Computationally, we do not want to square -two numbers when we can only square one. -So, the first solution seems better at first. - - - -But... - - -5.6 is a constant. -We do not have to have our FPU -waste precious cycles. We can just tell it -to divide the square of the f–number by -whatever 5.6² equals to. -Or we can divide the f–number by 5.6, -and then square the result. The two ways -now seem equal. - - - -But, they are not! - - -Having studied the principles of photography -above, we remember that the 5.6 -is actually square root of 2 raised to -the fifth power. An irrational -number. The square of this number is -exactly 32. - - - -Not only is 32 an integer, -it is a power of 2. We do not need -to divide the square of the f–number by -32. We only need to use -fscale to shift it right by -five positions. In the FPU -lingo it means we will fscale it -with st(1) equal to --5. That is much -faster than a division. - - - -So, now it has become clear why we have -saved the square of the f–number on the -top of the FPU stack. -The calculation of the f5.6 multiplier -is the easiest calculation of this -entire program! We will output it rounded -to four significant digits. - - - -There is one more useful number we can calculate: -The number of stops our f–number is from f5.6. -This may help us if our f–number is just outside -the range of our light meter, but we have -a shutter which lets us set various speeds, -and this shutter uses stops. - - - -Say, our f–number is 5 stops from -f5.6, and the light meter says -we should use 1/1000 sec. -Then we can set our shutter speed to 1/1000 -first, then move the dial by 5 stops. - - - -This calculation is quite easy as well. All -we have to do is to calculate the base-2 -logarithm of the f5.6 multiplier -we had just calculated (though we need its -value from before we rounded it off). We then -output the result rounded to the nearest integer. -We do not need to worry about having more than -four significant digits in this one: The result -is most likely to have only one or two digits -anyway. - - - - - - -FPU Optimizations - -In assembly language we can optimize the FPU -code in ways impossible in high languages, -including C. - - - -Whenever a C function needs to calculate -a floating–point value, it loads all necessary -variables and constants into FPU -registers. It then does whatever calculation is -required to get the correct result. Good C -compilers can optimize that part of the code really -well. - - - -It "returns" the value by leaving -the result on the TOS. -However, before it returns, it cleans up. -Any variables and constants it used in its -calculation are now gone from the FPU. - - - -It cannot do what we just did above: We calculated -the square of the f–number and kept it on the -stack for later use by another function. - - - -We knew we would need that value -later on. We also knew we had enough room on the -stack (which only has room for 8 numbers) -to store it there. - - - -A C compiler has no way of knowing -that a value it has on the stack will be -required again in the very near future. - - - -Of course, the C programmer may know it. -But the only recourse he has is to store the -value in a memory variable. - - - -That means, for one, the value will be changed -from the 80-bit precision used internally -by the FPU to a C double -(64 bits) or even single (32 -bits). - - - -That also means that the value must be moved -from the TOS into the memory, -and then back again. Alas, of all FPU -operations, the ones that access the computer -memory are the slowest. - - - -So, whenever programming the FPU -in assembly language, look for the ways of keeping -intermediate results on the FPU -stack. - - - -We can take that idea even further! In our -program we are using a constant -(the one we named PC). - - - -It does not matter how many pinhole diameters -we are calculating: 1, 10, 20, -1000, we are always using the same constant. -Therefore, we can optimize our program by keeping -the constant on the stack all the time. - - - -Early on in our program, we are calculating the -value of the above constant. We need to divide -our input by 10 for every digit in the -constant. - - - -It is much faster to multiply than to divide. -So, at the start of our program, we divide 10 -into 1 to obtain 0.1, which we -then keep on the stack: Instead of dividing the -input by 10 for every digit, -we multiply it by 0.1. - - - -By the way, we do not input 0.1 directly, -even though we could. We have a reason for that: -While 0.1 can be expressed with just one -decimal place, we do not know how many binary -places it takes. We, therefore, let the FPU -calculate its binary value to its own high precision. - - - -We are using other constants: We multiply the pinhole -diameter by 1000 to convert it from -millimeters to microns. We compare numbers to -10000 when we are rounding them off to -four significant digits. So, we keep both, 1000 -and 10000, on the stack. And, of course, -we reuse the 0.1 when rounding off numbers -to four digits. - - - -Last but not least, we keep -5 on the stack. -We need it to scale the square of the f–number, -instead of dividing it by 32. It is not -by coincidence we load this constant last. That makes -it the top of the stack when only the constants -are on it. So, when the square of the f–number is -being scaled, the -5 is at st(1), -precisely where fscale expects it to be. - - - -It is common to create certain constants from -scratch instead of loading them from the memory. -That is what we are doing with -5: - - - - fld1 ; TOS = 1 - fadd st0, st0 ; TOS = 2 - fadd st0, st0 ; TOS = 4 - fld1 ; TOS = 1 - faddp st1, st0 ; TOS = 5 - fchs ; TOS = -5 - - -We can generalize all these optimizations into one rule: -Keep repeat values on the stack! - - - - -&postscript; is a stack–oriented -programming language. There are many more books -available about &postscript; than about the -FPU assembly language: Mastering -&postscript; will help you master the FPU. - - - - - - -<application>pinhole</application>—The Code - -;;;;;;; pinhole.asm ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -; -; Find various parameters of a pinhole camera construction and use -; -; Started: 9-Jun-2001 -; Updated: 10-Jun-2001 -; -; Copyright (c) 2001 G. Adam Stanislav -; All rights reserved. -; -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; - -%include 'system.inc' - -%define BUFSIZE 2048 - -section .data -align 4 -ten dd 10 -thousand dd 1000 -tthou dd 10000 -fd.in dd stdin -fd.out dd stdout -envar db 'PINHOLE=' ; Exactly 8 bytes, or 2 dwords long -pinhole db '04,', ; Bender's constant (0.04) -connors db '037', 0Ah ; Connors' constant -usg db 'Usage: pinhole [-b] [-c] [-e] [-p <value>] [-o <outfile>] [-i <infile>]', 0Ah -usglen equ $-usg -iemsg db "pinhole: Can't open input file", 0Ah -iemlen equ $-iemsg -oemsg db "pinhole: Can't create output file", 0Ah -oemlen equ $-oemsg -pinmsg db "pinhole: The PINHOLE constant must not be 0", 0Ah -pinlen equ $-pinmsg -toobig db "pinhole: The PINHOLE constant may not exceed 18 decimal places", 0Ah -biglen equ $-toobig -huhmsg db 9, '???' -separ db 9, '???' -sep2 db 9, '???' -sep3 db 9, '???' -sep4 db 9, '???', 0Ah -huhlen equ $-huhmsg -header db 'focal length in millimeters,pinhole diameter in microns,' - db 'F-number,normalized F-number,F-5.6 multiplier,stops ' - db 'from F-5.6', 0Ah -headlen equ $-header - -section .bss -ibuffer resb BUFSIZE -obuffer resb BUFSIZE -dbuffer resb 20 ; decimal input buffer -bbuffer resb 10 ; BCD buffer - -section .text -align 4 -huh: - call write - push dword huhlen - push dword huhmsg - push dword [fd.out] - sys.write - add esp, byte 12 - ret - -align 4 -perr: - push dword pinlen - push dword pinmsg - push dword stderr - sys.write - push dword 4 ; return failure - sys.exit - -align 4 -consttoobig: - push dword biglen - push dword toobig - push dword stderr - sys.write - push dword 5 ; return failure - sys.exit - -align 4 -ierr: - push dword iemlen - push dword iemsg - push dword stderr - sys.write - push dword 1 ; return failure - sys.exit - -align 4 -oerr: - push dword oemlen - push dword oemsg - push dword stderr - sys.write - push dword 2 - sys.exit - -align 4 -usage: - push dword usglen - push dword usg - push dword stderr - sys.write - push dword 3 - sys.exit - -align 4 -global _start -_start: - add esp, byte 8 ; discard argc and argv[0] - sub esi, esi - -.arg: - pop ecx - or ecx, ecx - je near .getenv ; no more arguments - - ; ECX contains the pointer to an argument - cmp byte [ecx], '-' - jne usage - - inc ecx - mov ax, [ecx] - inc ecx - -.o: - cmp al, 'o' - jne .i - - ; Make sure we are not asked for the output file twice - cmp dword [fd.out], stdout - jne usage - - ; Find the path to output file - it is either at [ECX+1], - ; i.e., -ofile -- - ; or in the next argument, - ; i.e., -o file - - or ah, ah - jne .openoutput - pop ecx - jecxz usage - -.openoutput: - push dword 420 ; file mode (644 octal) - push dword 0200h | 0400h | 01h - ; O_CREAT | O_TRUNC | O_WRONLY - push ecx - sys.open - jc near oerr - - add esp, byte 12 - mov [fd.out], eax - jmp short .arg - -.i: - cmp al, 'i' - jne .p - - ; Make sure we are not asked twice - cmp dword [fd.in], stdin - jne near usage - - ; Find the path to the input file - or ah, ah - jne .openinput - pop ecx - or ecx, ecx - je near usage - -.openinput: - push dword 0 ; O_RDONLY - push ecx - sys.open - jc near ierr ; open failed - - add esp, byte 8 - mov [fd.in], eax - jmp .arg - -.p: - cmp al, 'p' - jne .c - or ah, ah - jne .pcheck - - pop ecx - or ecx, ecx - je near usage - - mov ah, [ecx] - -.pcheck: - cmp ah, '0' - jl near usage - cmp ah, '9' - ja near usage - mov esi, ecx - jmp .arg - -.c: - cmp al, 'c' - jne .b - or ah, ah - jne near usage - mov esi, connors - jmp .arg - -.b: - cmp al, 'b' - jne .e - or ah, ah - jne near usage - mov esi, pinhole - jmp .arg - -.e: - cmp al, 'e' - jne near usage - or ah, ah - jne near usage - mov al, ',' - mov [huhmsg], al - mov [separ], al - mov [sep2], al - mov [sep3], al - mov [sep4], al - jmp .arg - -align 4 -.getenv: - ; If ESI = 0, we did not have a -p argument, - ; and need to check the environment for "PINHOLE=" - or esi, esi - jne .init - - sub ecx, ecx - -.nextenv: - pop esi - or esi, esi - je .default ; no PINHOLE envar found - - ; check if this envar starts with 'PINHOLE=' - mov edi, envar - mov cl, 2 ; 'PINHOLE=' is 2 dwords long -rep cmpsd - jne .nextenv - - ; Check if it is followed by a digit - mov al, [esi] - cmp al, '0' - jl .default - cmp al, '9' - jbe .init - ; fall through - -align 4 -.default: - ; We got here because we had no -p argument, - ; and did not find the PINHOLE envar. - mov esi, pinhole - ; fall through - -align 4 -.init: - sub eax, eax - sub ebx, ebx - sub ecx, ecx - sub edx, edx - mov edi, dbuffer+1 - mov byte [dbuffer], '0' - - ; Convert the pinhole constant to real -.constloop: - lodsb - cmp al, '9' - ja .setconst - cmp al, '0' - je .processconst - jb .setconst - - inc dl - -.processconst: - inc cl - cmp cl, 18 - ja near consttoobig - stosb - jmp short .constloop - -align 4 -.setconst: - or dl, dl - je near perr - - finit - fild dword [tthou] - - fld1 - fild dword [ten] - fdivp st1, st0 - - fild dword [thousand] - mov edi, obuffer - - mov ebp, ecx - call bcdload - -.constdiv: - fmul st0, st2 - loop .constdiv - - fld1 - fadd st0, st0 - fadd st0, st0 - fld1 - faddp st1, st0 - fchs - - ; If we are creating a CSV file, - ; print header - cmp byte [separ], ',' - jne .bigloop - - push dword headlen - push dword header - push dword [fd.out] - sys.write - -.bigloop: - call getchar - jc near done - - ; Skip to the end of the line if you got '#' - cmp al, '#' - jne .num - call skiptoeol - jmp short .bigloop - -.num: - ; See if you got a number - cmp al, '0' - jl .bigloop - cmp al, '9' - ja .bigloop - - ; Yes, we have a number - sub ebp, ebp - sub edx, edx - -.number: - cmp al, '0' - je .number0 - mov dl, 1 - -.number0: - or dl, dl ; Skip leading 0's - je .nextnumber - push eax - call putchar - pop eax - inc ebp - cmp ebp, 19 - jae .nextnumber - mov [dbuffer+ebp], al - -.nextnumber: - call getchar - jc .work - cmp al, '#' - je .ungetc - cmp al, '0' - jl .work - cmp al, '9' - ja .work - jmp short .number - -.ungetc: - dec esi - inc ebx - -.work: - ; Now, do all the work - or dl, dl - je near .work0 - - cmp ebp, 19 - jae near .toobig - - call bcdload - - ; Calculate pinhole diameter - - fld st0 ; save it - fsqrt - fmul st0, st3 - fld st0 - fmul st5 - sub ebp, ebp - - ; Round off to 4 significant digits -.diameter: - fcom st0, st7 - fstsw ax - sahf - jb .printdiameter - fmul st0, st6 - inc ebp - jmp short .diameter - -.printdiameter: - call printnumber ; pinhole diameter - - ; Calculate F-number - - fdivp st1, st0 - fld st0 - - sub ebp, ebp - -.fnumber: - fcom st0, st6 - fstsw ax - sahf - jb .printfnumber - fmul st0, st5 - inc ebp - jmp short .fnumber - -.printfnumber: - call printnumber ; F number - - ; Calculate normalized F-number - fmul st0, st0 - fld1 - fld st1 - fyl2x - frndint - fld1 - fscale - fsqrt - fstp st1 - - sub ebp, ebp - call printnumber - - ; Calculate time multiplier from F-5.6 - - fscale - fld st0 - - ; Round off to 4 significant digits -.fmul: - fcom st0, st6 - fstsw ax - sahf - - jb .printfmul - inc ebp - fmul st0, st5 - jmp short .fmul - -.printfmul: - call printnumber ; F multiplier - - ; Calculate F-stops from 5.6 - - fld1 - fxch st1 - fyl2x - - sub ebp, ebp - call printnumber - - mov al, 0Ah - call putchar - jmp .bigloop - -.work0: - mov al, '0' - call putchar - -align 4 -.toobig: - call huh - jmp .bigloop - -align 4 -done: - call write ; flush output buffer - - ; close files - push dword [fd.in] - sys.close - - push dword [fd.out] - sys.close - - finit - - ; return success - push dword 0 - sys.exit - -align 4 -skiptoeol: - ; Keep reading until you come to cr, lf, or eof - call getchar - jc done - cmp al, 0Ah - jne .cr - ret - -.cr: - cmp al, 0Dh - jne skiptoeol - ret - -align 4 -getchar: - or ebx, ebx - jne .fetch - - call read - -.fetch: - lodsb - dec ebx - clc - ret - -read: - jecxz .read - call write - -.read: - push dword BUFSIZE - mov esi, ibuffer - push esi - push dword [fd.in] - sys.read - add esp, byte 12 - mov ebx, eax - or eax, eax - je .empty - sub eax, eax - ret - -align 4 -.empty: - add esp, byte 4 - stc - ret - -align 4 -putchar: - stosb - inc ecx - cmp ecx, BUFSIZE - je write - ret - -align 4 -write: - jecxz .ret ; nothing to write - sub edi, ecx ; start of buffer - push ecx - push edi - push dword [fd.out] - sys.write - add esp, byte 12 - sub eax, eax - sub ecx, ecx ; buffer is empty now -.ret: - ret - -align 4 -bcdload: - ; EBP contains the number of chars in dbuffer - push ecx - push esi - push edi - - lea ecx, [ebp+1] - lea esi, [dbuffer+ebp-1] - shr ecx, 1 - - std - - mov edi, bbuffer - sub eax, eax - mov [edi], eax - mov [edi+4], eax - mov [edi+2], ax - -.loop: - lodsw - sub ax, 3030h - shl al, 4 - or al, ah - mov [edi], al - inc edi - loop .loop - - fbld [bbuffer] - - cld - pop edi - pop esi - pop ecx - sub eax, eax - ret - -align 4 -printnumber: - push ebp - mov al, [separ] - call putchar - - ; Print the integer at the TOS - mov ebp, bbuffer+9 - fbstp [bbuffer] - - ; Check the sign - mov al, [ebp] - dec ebp - or al, al - jns .leading - - ; We got a negative number (should never happen) - mov al, '-' - call putchar - -.leading: - ; Skip leading zeros - mov al, [ebp] - dec ebp - or al, al - jne .first - cmp ebp, bbuffer - jae .leading - - ; We are here because the result was 0. - ; Print '0' and return - mov al, '0' - jmp putchar - -.first: - ; We have found the first non-zero. - ; But it is still packed - test al, 0F0h - jz .second - push eax - shr al, 4 - add al, '0' - call putchar - pop eax - and al, 0Fh - -.second: - add al, '0' - call putchar - -.next: - cmp ebp, bbuffer - jb .done - - mov al, [ebp] - push eax - shr al, 4 - add al, '0' - call putchar - pop eax - and al, 0Fh - add al, '0' - call putchar - - dec ebp - jmp short .next - -.done: - pop ebp - or ebp, ebp - je .ret - -.zeros: - mov al, '0' - call putchar - dec ebp - jne .zeros - -.ret: - ret - - -The code follows the same format as all the other -filters we have seen before, with one subtle -exception: - - -
- -We are no longer assuming that the end of input -implies the end of things to do, something we -took for granted in the character–oriented -filters. - - - -This filter does not process characters. It -processes a language -(albeit a very simple -one, consisting only of numbers). - - - -When we have no more input, it can mean one -of two things: - - - -We are done and can quit. This is the -same as before. - - - - - -The last character we have read was a digit. -We have stored it at the end of our -ASCII–to–float conversion -buffer. We now need to convert -the contents of that buffer into a -number and write the last line of our -output. - - - - - -For that reason, we have modified our getchar -and our read routines to return with -the carry flag clear whenever we are -fetching another character from the input, or the -carry flag set whenever there is no more -input. - - - -Of course, we are still using assembly language magic -to do that! Take a good look at getchar. -It always returns with the -carry flag clear. - - - -Yet, our main code relies on the carry -flag to tell it when to quit—and it works. - - - -The magic is in read. Whenever it -receives more input from the system, it just -returns to getchar, which -fetches a character from the input buffer, -clears the carry flag -and returns. - - - -But when read receives no more -input from the system, it does not -return to getchar at all. -Instead, the add esp, byte 4 -op code adds 4 to ESP, -sets the carry -flag, and returns. - - - -So, where does it return to? Whenever a -program uses the call op code, -the microprocessor pushes the -return address, i.e., it stores it on -the top of the stack (not the FPU -stack, the system stack, which is in the memory). -When a program uses the ret -op code, the microprocessor pops -the return value from the stack, and jumps -to the address that was stored there. - - - -But since we added 4 to -ESP (which is the stack -pointer register), we have effectively -given the microprocessor a minor case -of amnesia: It no longer -remembers it was getchar -that called read. - - - -And since getchar never -pushed anything before -calling read, -the top of the stack now contains the -return address to whatever or whoever -called getchar. -As far as that caller is concerned, -he called getchar, -which returned with the -carry flag set! - - -
- -Other than that, the bcdload -routine is caught up in the middle of a -Lilliputian conflict between the Big–Endians -and the Little–Endians. - - - -It is converting the text representation -of a number into that number: The text -is stored in the big–endian order, but -the packed decimal is little–endian. - - - -To solve the conflict, we use the std -op code early on. We cancel it with cld -later on: It is quite important we do not -call anything that may depend on -the default setting of the direction -flag while std is active. - - - -Everything else in this code should be quite -clear, providing you have read the entire chapter -that precedes it. - - - -It is a classical example of the adage that -programming requires a lot of thought and only -a little coding. Once we have thought through every -tiny detail, the code almost writes itself. - - -
- - -Using <application>pinhole</application> - -Because we have decided to make the program -ignore any input except for numbers -(and even those inside a comment), we can -actually perform textual queries. -We do not have to, but we can. - - - -In my humble opinion, forming a textual query, -instead of having to follow a very strict -syntax, makes software much more user friendly. - - - -Suppose we want to build a pinhole camera to use the -4x5 inch film. The standard focal -length for that film is about 150mm. We want -to fine–tune our focal length so the -pinhole diameter is as round a number as possible. -Let us also suppose we are quite comfortable with -cameras but somewhat intimidated by computers. -Rather than just have to type in a bunch of numbers, -we want to ask a couple of questions. - - - -Our session might look like this: - -&prompt.user; pinhole - -Computer, - -What size pinhole do I need for the focal length of 150? -150 490 306 362 2930 12 -Hmmm... How about 160? -160 506 316 362 3125 12 -Let's make it 155, please. -155 498 311 362 3027 12 -Ah, let's try 157... -157 501 313 362 3066 12 -156? -156 500 312 362 3047 12 -That's it! Perfect! Thank you very much! -^D - -We have found that while for the focal length -of 150, our pinhole diameter should be 490 -microns, or 0.49 mm, if we go with the almost -identical focal length of 156 mm, we can -get away with a pinhole diameter of exactly -one half of a millimeter. - - - - - -Scripting - -Because we have chosen the # -character to denote the start of a comment, -we can treat our pinhole -software as a scripting language. - - - -You have probably seen shell -scripts that start with: - - -#! /bin/sh - - -...or... - - -#!/bin/sh - -...because the blank space after the #! -is optional. - - - -Whenever &unix; is asked to run an executable -file which starts with the #!, -it assumes the file is a script. It adds the -command to the rest of the first line of the -script, and tries to execute that. - - - -Suppose now that we have installed pinhole -in /usr/local/bin/, we can now -write a script to calculate various pinhole -diameters suitable for various focal lengths -commonly used with the 120 film. - - -The script might look something like this: - - -#! /usr/local/bin/pinhole -b -i -# Find the best pinhole diameter -# for the 120 film - -### Standard -80 - -### Wide angle -30, 40, 50, 60, 70 - -### Telephoto -100, 120, 140 - - -Because 120 is a medium size film, -we may name this file medium. - - - -We can set its permissions to execute, -and run it as if it were a program: - - -&prompt.user; chmod 755 medium -&prompt.user; ./medium - -&unix; will interpret that last command as: - -&prompt.user; /usr/local/bin/pinhole -b -i ./medium - -It will run that command and display: - - -80 358 224 256 1562 11 -30 219 137 128 586 9 -40 253 158 181 781 10 -50 283 177 181 977 10 -60 310 194 181 1172 10 -70 335 209 181 1367 10 -100 400 250 256 1953 11 -120 438 274 256 2344 11 -140 473 296 256 2734 11 - - -Now, let us enter: - -&prompt.user; ./medium -c - -&unix; will treat that as: - -&prompt.user; /usr/local/bin/pinhole -b -i ./medium -c - -That gives it two conflicting options: --b and -c -(Use Bender's constant and use Connors' -constant). We have programmed it so -later options override early ones—our -program will calculate everything -using Connors' constant: - - -80 331 242 256 1826 11 -30 203 148 128 685 9 -40 234 171 181 913 10 -50 262 191 181 1141 10 -60 287 209 181 1370 10 -70 310 226 256 1598 11 -100 370 270 256 2283 11 -120 405 296 256 2739 11 -140 438 320 362 3196 12 - -We decide we want to go with Bender's -constant after all. We want to save its -values as a comma–separated file: - - -&prompt.user; ./medium -b -e > bender -&prompt.user; cat bender -focal length in millimeters,pinhole diameter in microns,F-number,normalized F-number,F-5.6 multiplier,stops from F-5.6 -80,358,224,256,1562,11 -30,219,137,128,586,9 -40,253,158,181,781,10 -50,283,177,181,977,10 -60,310,194,181,1172,10 -70,335,209,181,1367,10 -100,400,250,256,1953,11 -120,438,274,256,2344,11 -140,473,296,256,2734,11 -&prompt.user; - - -
- - -Caveats - - -Assembly language programmers who "grew up" under -&ms-dos; and &windows; often tend to take shortcuts. -Reading the keyboard scan codes and writing directly to video -memory are two classical examples of practices which, under -&ms-dos; are not frowned upon but considered the -right thing to do. - - - -The reason? Both the PC BIOS and -&ms-dos; are notoriously -slow when performing these operations. - - - -You may be tempted to continue similar practices in the -&unix; environment. For example, I have seen a web site which -explains how to access the keyboard scan codes on a popular &unix; clone. - - - -That is generally a very bad idea -in &unix; environment! Let me explain why. - - - -&unix; Is Protected - - -For one thing, it may simply not be possible. &unix; runs in -protected mode. Only the kernel and device drivers are allowed -to access hardware directly. Perhaps a particular &unix; clone -will let you read the keyboard scan codes, but chances are a real -&unix; operating system will not. And even if one version may let you -do it, the next one may not, so your carefully crafted software may -become a dinosaur overnight. - - - - - -&unix; Is an Abstraction - - -But there is a much more important reason not to try -accessing the hardware directly (unless, of course, -you are writing a device driver), even on the &unix; like -systems that let you do it: - - - -&unix; is an abstraction! - - - -There is a major difference in the philosophy of design -between &ms-dos; and &unix;. -&ms-dos; was designed as a single-user -system. It is run on a computer with a keyboard and a video -screen attached directly to that computer. User input is almost -guaranteed to come from that keyboard. Your program's output -virtually always ends up on that screen. - - - -This is NEVER guaranteed under &unix;. It is quite common -for a &unix; user to pipe and redirect program input and output: - - -&prompt.user; program1 | program2 | program3 > file1 - - -If you have written program2, your input -does not come from the keyboard but from the output of -program1. Similarly, your output does not -go to the screen but becomes the input for -program3 whose output, in turn, -goes to file1. - - - -But there is more! Even if you made sure that your input comes -from, and your output goes to, the terminal, there is no guarantee -the terminal is a PC: It may not have its video memory -where you expect it, nor may its keyboard be producing -PC-style scan codes. It may be a &macintosh;, -or any other computer. - - - -Now you may be shaking your head: My software is in -PC assembly language, how can -it run on a &macintosh;? But I did not say your software -would be running on a &macintosh;, only that its terminal -may be a &macintosh;. - - - -Under &unix;, the terminal does not have to be directly -attached to the computer that runs your software, it can -even be on another continent, or, for that matter, on another -planet. It is perfectly possible that a &macintosh; user in -Australia connects to a &unix; system in North America (or -anywhere else) via telnet. The -software then runs on one computer, while the terminal is -on a different computer: If you try to read the scan codes, -you will get the wrong input! - - - -Same holds true about any other hardware: A file you are reading -may be on a disk you have no direct access to. A camera you are -reading images from may be on a space shuttle, connected to you -via satellites. - - - -That is why under &unix; you must never make any assumptions about -where your data is coming from and going to. Always let the -system handle the physical access to the hardware. - - - - -These are caveats, not absolute rules. Exceptions are possible. -For example, if a text editor has determined it is running -on a local machine, it may want to read the scan codes -directly for improved control. I am not mentioning these caveats -to tell you what to do or what not to do, just to make you aware -of certain pitfalls that await you if you have just arrived to &unix; -form &ms-dos;. Of course, creative people often break -rules, and it is OK as long as they know they are breaking -them and why. - - - - - - - - - -Acknowledgements - - -This tutorial would never have been possible without the -help of many experienced FreeBSD programmers from the -&a.hackers;, many of whom have patiently -answered my questions, and pointed me in the right direction -in my attempts to explore the inner workings of &unix; -system programming in general and FreeBSD in particular. - - - -Thomas M. Sommers opened the door for me. His -How -do I write "Hello, world" in FreeBSD assembler? -web page was my first encounter with an example of -assembly language programming under FreeBSD. - - - -Jake Burkholder has kept the door open by willingly -answering all of my questions and supplying me with -example assembly language source code. - - - -Copyright © 2000-2001 G. Adam Stanislav. All rights reserved. - - - - - -
diff --git a/zh_TW.UTF-8/books/faq/Makefile b/zh_TW.UTF-8/books/faq/Makefile deleted file mode 100644 index c36ea2a7e1..0000000000 --- a/zh_TW.UTF-8/books/faq/Makefile +++ /dev/null @@ -1,28 +0,0 @@ -# -# $FreeBSD$ -# -# Build the FreeBSD Chinese FAQ -# - -MAINTAINER=doc@FreeBSD.org - -DOC?= book - -FORMATS?= html-split html - -INSTALL_COMPRESSED?= gz -INSTALL_ONLY_COMPRESSED?= - -WITH_BIBLIOXREF_TITLE?=YES -# -# SRCS lists the individual XML files that make up the document. Changes -# to any of these files will force a rebuild -# - -# XML content -SRCS= book.xml - -URL_RELPREFIX?= ../../../.. -DOC_PREFIX?= ${.CURDIR}/../../.. - -.include "${DOC_PREFIX}/share/mk/doc.project.mk" diff --git a/zh_TW.UTF-8/books/faq/book.xml b/zh_TW.UTF-8/books/faq/book.xml deleted file mode 100644 index 99c5d74e22..0000000000 --- a/zh_TW.UTF-8/books/faq/book.xml +++ /dev/null @@ -1,6910 +0,0 @@ - - - -12-CURRENT"> -X"> -head/"> -X"> -12-STABLE"> -stable/12/"> - -X"> -11-STABLE"> -stable/11/"> - -]> - - - FreeBSD 11.<replaceable>X</replaceable> and 12.<replaceable>X</replaceable> 常見問答集 - - FreeBSD 文件計畫 - - - 1995 - 1996 - 1997 - 1998 - 1999 - 2000 - 2001 - 2002 - 2003 - 2004 - 2005 - 2006 - 2007 - 2008 - 2009 - 2010 - 2011 - 2012 - 2013 - 2014 - 2015 - 2016 - 2017 - 2018 - - The FreeBSD Documentation Project - - - - - 版權所有 - - Redistribution and use in source (XML DocBook) and 'compiled' - forms (XML, HTML, PDF, PostScript, RTF and so forth) with or without - modification, are permitted provided that the following conditions are - met: - - - - Redistributions of source code (XML DocBook) must retain the - above copyright notice, this list of conditions and the following - disclaimer as the first lines of this file unmodified. - - - - Redistributions in compiled form (transformed to other DTDs, - converted to PDF, PostScript, RTF and other formats) must - reproduce the above copyright notice, this list of conditions and - the following disclaimer in the documentation and/or other - materials provided with the distribution. - - - - - THIS DOCUMENTATION IS PROVIDED BY THE FREEBSD DOCUMENTATION - PROJECT "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, - BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND - FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL - THE FREEBSD DOCUMENTATION PROJECT BE LIABLE FOR ANY DIRECT, INDIRECT, - INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, - BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS - OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR - TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE - USE OF THIS DOCUMENTATION, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH - DAMAGE. - - - - - - FreeBSD 是 FreeBSD基金會的註冊商標。 - Adobe, Acrobat, Acrobat Reader, 以及 PostScript 是 Adobe Systems Incorporated 在美國和/或其他國家的商標或註冊商標。 - IBM, AIX, OS/2, PowerPC, PS/2, S/390, 和 ThinkPad 是 國際商用機器公司在美國和其他國家的註冊商標或商標。 - IEEE, POSIX, 和 802 是 Institute of Electrical and Electronics Engineers, Inc. 在美國的註冊商標。 - Intel, Celeron, Centrino, Core, EtherExpress, i386, i486, Itanium, Pentium, 和 Xeon 是 Intel Corporation 及其分支機構在美國和其他國家的商標或註冊商標。 - Linux 是 Linus Torvalds 的註冊商標。 - Microsoft, IntelliMouse, MS-DOS, Outlook, Windows, Windows Media, 和 Windows NT 是 Microsoft Corporation 在美國和/或其他國家的商標或註冊商標。 - NetBSD 是 NetBSD基金會的註冊商標。 - Motif, OSF/1, and UNIX are registered trademarks and IT DialTone and The Open Group 是 The Open Group 在美國和其他國家的商標。 - Silicon Graphics, SGI, 和 OpenGL 是 Silicon Graphics, Inc. 在美國和/或其他國家的註冊商標。 - Sun, Sun Microsystems, Java, Java Virtual Machine, JDK, JRE, JSP, JVM, Netra, OpenJDK, Solaris, StarOffice, SunOS and VirtualBox 是 Sun Microsystems, Inc. 在美國和其他國家的註冊商標。 - 許多製造商和經銷商使用一些稱為商標的圖案或文字設計來彰顯自己的產品。 本文中出現的眾多商標,以及 FreeBSD Project 本身廣所人知的商標,後面將以® 符號來標註。 - - - $FreeBSD$ - - - 這份文件是 FreeBSD 12.X 和 11.X 常見問答集 ( (FAQ) )。我們盡可能地讓這份 FAQ 提供有用的資訊 ; 如果您有任何改善建議,請寄到 FreeBSD 文件計畫郵件論壇。 - - 本文件的最新版本可由 FreeBSD 網站取得。 也可以由 FreeBSD FTP 伺服器 以 HTTP 下載單一大型 HTML 檔或是其他格式的檔案。 - - - - - 前言 - - - - - 什麼是 FreeBSD? - - - - FreeBSD 是一個使用於桌機、筆電、伺服器與嵌入式系統平台的現代作業系統,支援多種平台。 - - 它是根據 U.C. Berkeley 所開發出來的 4.4BSD-Lite ,並加上了許多 4.4BSD-Lite2 的增強功能。它同時也間接使用了 U.C. Berkeley 所開發出來並由 William Jolitz 移植到 i386Net/2,也就是 386BSD,不過現在 386BSD 的程式碼只剩下極少數還留 存在 FreeBSD 中。 - - FreeBSD 已被廣泛地被世界各地的公司行號、ISP、研究人員、電腦 專家、學生,以及家庭用戶所使用,用在工作、教育以及娛樂上。 - - 如果想看關於 FreeBSD 更深入的資料,請看 FreeBSD 使用手冊。 - - - - - - 發展 FreeBSD 計畫的目的是什麼? - - - - FreeBSD 計畫的目的是提供可以任意使用且沒有限制的穩定快速與一般用途的作業系統。 - - - - - - FreeBSD 版權有任何限制嗎? - - - - 有的。但是這並不是限制你怎麼去使用這些程式碼,而是你怎麼看待 FreeBSD 這個計畫。可以在此閱讀 版權本文,簡單來說總結如下: - - - - 請勿宣稱是您寫了這個程式。 - - - - 如果它出問題了,不要控告我們。 - - - - 不要移除和修改版權 - - - - 我們許多人在這個計畫投入很多心血,並不會介意獲得一些財務上的報酬,但是我們並沒有堅持一定要有。我們相信我們首要的任務是將程式碼提供給所有使用者,無論他們有任何的目的,這麼一來,這些程式碼才能被用在最多地方,也才能發揮它們最大的利益。我們相信這就是自由軟體最基本的目標之一,而且我們會盡全力去支持它。 - - 在我們 source tree 中有部份的程式碼是採用所謂的GNU General Public License (GPL) 或 GNU Library General Public License (LGPL)版權宣告,雖然這些版權宣告是用來保障而非限制使用者的權 利,畢竟是不那麼自由了些。由於這些 GPL 的軟體在商業使用上會引起 非常複雜的版權問題,因此只要有機會,我們會盡量以採用比較鬆的 FreeBSD 版權 的軟體來取代這些 GPL 版權宣告的軟體。 - - - - - - FreeBSD 可以取代我現在在用的作業系統嗎? - - - - 對大部份的人來說是這樣沒錯,但事實上這問題並沒有這麼好回答。 - - 大部份的人並不是真正在使用一個作業系統。他們使用的是應用程式 ;而那些應用程式才是真正用到作業系統的東西。FreeBSD 是設計用來提供一個強韌且功能完整的作業環境給應用程式來執行。它支援了多種瀏覽器,辦公室套件軟體,電子郵件閱讀軟體,繪圖程式,程式設計環境,網路伺服器軟體,以及幾乎所有你想要的東西。大部份的程式都可以靠 Ports Collection 來管理。 - - 但是如果你想要使用的應用程式只能在某個特定的作業系統上面執行 的話,你就不能輕易地把它換掉,或者指望在 FreeBSD 上有很相似的應用程式才有機會。如果你想要的是一個強健的辦公室或是網路伺服器,或是一部穩定的工作站,FreeBSD 無疑是您的最佳選擇。世界各地有很多使用者,包括初學或資深的 UNIX 管理人員都選用 FreeBSD 當他們唯一的桌上作業系統。 - - 如果你是從其他的 UNIX-like 環境轉換到 FreeBSD 的話會很熟悉。 Windows 或是 Mac OS 的使用者可能會對 TrueOS 有興趣,他是基於 FreeBSD 的一個桌面環境發行版,非UNIX 使用者可能就要多花一點時間來學習怎麼用 UNIX 的 方法來做事。你可以從這份 FAQFreeBSD 使用手冊 來入門。 - - - - - - 為什麼要叫做 FreeBSD? - - - - - - 您可以免費使用它,即使是用於商業用途。 - - - - 整個 FreeBSD 作業系統完整的原始程式都可以免費取得,而且不管是在使用,散佈或是整合進其他程式等各方面也只受到最小的限制 (不論是否用於商業用途)。 - - - - 任何人都可以自由地把他對系統的改良或錯誤修正的程式碼加入 source tree 之中 (當然要符合幾個先決條件)。 - - - - 特別值得注意的是這裡的 “free” 出現了兩次,而且它們 的意思是不一樣的:一種代表 “免費”,另一種代表 “自由”。您可以拿 FreeBSD 去做任何您想要做的事,除了一些例外,例如您宣稱 FreeBSD 是您寫的。 - - - - - - FreeBSD 及 NetBSD, OpenBSD 以及其他 open source BSD 作業系統之間有何不同之處呢? - - - - James Howard 寫了一篇關於不同計畫的差異和歷史淵源的好文章叫 The BSD Family Tree 可以回答這個問題。雖然有些資訊有點過時,但是關於歷史淵源的部份仍是相當正確的。 - - 時至今日,大部分的 BSD 家族仍是共用修補和程式碼的。這些 BSD 家族有著共同的祖先。 - - FreeBSD 的設計目的如 所述。其他 BSD 家族的設計目的如下所述: - - - - OpenBSD 目標在作業系統的安全性。OpenBSD團隊寫的 ssh1pf4 都移植到了 FreeBSD。 - - - - NetBSD 目標在易於移植到其他的硬體平台。 - - - - DragonFly BSD 是 FreeBSD 4.8 的一個分支,發展出許多有趣的特色,包括 HAMMER 檔案系統和支援 vkernels 使用者模式。 - - - - - - - - 最新版的 FreeBSD 是那一版? - - - - 在 FreeBSD 開發的任何時間點,都有多個平行的分支。12.X releases 是從 12-STABLE 分支而來,而 11.X releases 是從 11-STABLE 分支而來。 - - 在 9.0 之前,11.X 系列仍屬 -STABLE分支。 然而從13.X 發行開始,11.X 將只著重在重大問題上(比如:漏洞修補、安全維護)以及所謂的 extended support - - Version 12.0 - is the latest release from the 12-STABLE branch; it was - released in December 2018. Version 10.4 - is the latest release from the 11-STABLE branch; it - was released in October 2017. - - Releases 版 每幾個月 才會發行一次。 雖然如此,有很多人和 FreeBSD 原始碼同步更新 (詳見 FreeBSD-CURRENT 和 FreeBSD-STABLE的相關問題) ,但因為原始碼是一直不斷地在變動的,所以如果要這麼做的話得要花上更多的精力。 - - 其他更多相關 FreeBSD 發行情報,可由 FreeBSD 網站上的 Release Engineering 頁面 和 release7得知。 - - - - - - 什麼是 FreeBSD-CURRENT? - - - - FreeBSD-CURRENT 指的是正在發展中的作業系統版本,它終將在適當的時機成為 FreeBSD-STABLE 分支。它實在是只適合給系統發展者以及有毅力的業餘愛好者使用 。如果想要得到有關如何使用-CURRENT的深入資訊,請參考使用手冊的相關部份。 - - 如果您對 FreeBSD 本身並不是很熟悉那麼您就不應該使用FreeBSD-CURRENT。 這個分支的程式碼有時候變動得很快,而且可能會因此 而使您有好幾天的時間無法更新您的系統。我們假設使用 FreeBSD-CURRENT 的使用者都有能力去分析他們所遇到的問題,除錯,並且回報問題。 - - 我們每天都會根據目前 -CURRENT-STABLE 的狀況對這兩個分支各發行一個 snapshot 版。發表這些 snapshot 的目的在於: - - - - 測試最新版的安裝程式。 - - - - 提供一個簡單的方法給那些喜歡使用 -CURRENT 或是 -STABLE 但是沒有時間和頻寬去每天昇級的使用者。 - - - - 為了替我們發展中的程式保留一個固定的參考點,以防止我們未來不幸搞砸了。(雖然一般而言 Subversion 可以防止類似這種的可怕事件) - - - - 為了確保所有需要測試的新功能或修正都可以得到最多的測試。 - - - - 我們不對 -CURRENT snapshot 做任何目的的 品質保證 。如果你想要的是一個穩定且經過充分測試過的系統的話, 最好選擇使用完整 releases. - - 您可以直接從 snapshot 取得 -CURRENT 的 snapshot release。 - - 對每個有在活動的分支而言,都會定期產生一次 snapshots。 - - - - - - 什麼是 FreeBSD-STABLE ? - - - - 回溯到 FreeBSD 2.0.5 剛發表的時候,我們決定把 FreeBSD 的發展 分成兩支。一支叫做 -STABLE,另一支叫 -CURRENT。主要發行版是由FreeBSD-STABLE 這個開發分支而來。他的變動較慢,而且一般來說假設他們都已經先在FreeBSD-CURRENT測試過了。然而在任何時候,FreeBSD-STABLE的原始碼仍有可能不一定適合一般用途,因為他可能包含在 FreeBSD-CURRENT 沒有發現到的錯誤。沒有能力和資源的使用者應該改使用 FreeBSD 正式發行版。FreeBSD-CURRENT 從2.0開始就是另一個分支,一直到12.0-RELEASE和之後的版本都還是。更多關於開發分支的資訊請見 FreeBSD Release Engineering: Creating the Release Branch ,分支的開發狀態和接下來的發行計畫時間表可以在 Release Engineering 資訊 找到。 - - 12.0-STABLE 是目前正在發展中的 -STABLE 分支。最新的 12.0-STABLE 是在 2018年12月發行的 12.0-RELEASE。 - - 12-CURRENT 這個分支是 FreeBSD 的 -CURRENT 分支,仍然不斷地在發展當中。 如果想要知道更多關於這個分支的資訊的話,請參考 什麼是 FreeBSD-CURRENT? 。 - - - - - - 每次新的 FreeBSD 將於什麼時候推出? - - - - 一般而言,Release Engineering Team re@FreeBSD.org 約每18個月發行一次主要發行版本,約平均每8個月發行一次次要發行版本。每次新版本的發表時程都會事先公告, 相關的開發人員就會知道,什麼時候該先把手邊的計劃完成並且測試過, 此外,這些更動都已經完整地測試過,確保新功能不會影響系統的穩定度。 雖然,等這些好東西進入-STABLE 的時間令人等得有些不耐煩, 但是大多數的使用者都認為這種謹慎的態度是 FreeBSD 最好的優點之一。 - - 有關發行情報的更多細節部分(包括 release 的行程表、進度),都可在 FreeBSD 網站上的 發行情報 上面獲得。 - - 為了滿足那些需要 (或想要) 新鮮刺激感的使用者, 上面已經提到我們每周都會發行 snapshots 版可供使用。 - - - - - - 誰負責 FreeBSD 的發展? - - - - 如果是一些有關 FreeBSD 計畫的關鍵性決定,像是整個計畫的走向 或是決定誰可以改 source tree 裡的程式碼這類的事,是由一個由 9 個 人所組成的 core team 來決定。而有另一群超過 350 個人的 committers 有權利可以直接修改 FreeBSD 的 source tree。 - - 無論如何,大多數的改變都會事前在 郵件論壇先討論過,而且不分角色,每個人都可以參與討論。 - - - - - - 我要如何取得 FreeBSD? - - - - Every significant release of FreeBSD is available via - anonymous FTP from the FreeBSD - FTP site: - - - - The latest 12-STABLE release, - 12.0-RELEASE can be found in the 12.0-RELEASE - directory. - - - - -CURRENT 和 -STABLE 分支的Snapshot版本通常每個月會做一次, 主要是為了提供給那些熱心的測試者和開發人員。 - - - - The latest 11-STABLE release, - 10.4-RELEASE can be found in the 10.4-RELEASE - directory. - - - - FreeBSD 的 CD、DVD,還有其他取得方式可以在 the Handbook 中找到解答。 - - - - - - 我要如何去查詢、提交問題回報(Problem Report,簡稱PR)資料庫呢? - - - - 所有使用者的變更要求都可以經由網頁版的 PR 查詢 界面來察看。 - - 可以使用瀏覽器經由網頁版的 PR 界面 來傳送問題回報 - - 然而,在您回報問題之前,請先閱讀 如何撰寫 FreeBSD 的問題回報單,這是一篇告訴你怎樣才能寫出一篇真正有用的問題回報單。 - - - - - - - 文件與技術支援 - - - - - 有哪些 FreeBSD 相關的好書呢? - - - - FreeBSD 文件計畫已陸續發表了相當廣泛範圍的文件,可在 https://www.FreeBSD.org/docs.html 取得。除此之外,也可以參閱使用手冊的 參考書目建議的其他書籍。 - - - - - - 這些文件有其他格式的嗎?像是:純文字(ASCII)或 PostScript 之類的格式? - - - - 有的。這些文件都分別以不同格式儲存以及壓縮處理並放在 FTP 上面,可以從各個 FreeBSD FTP 站的 /pub/FreeBSD/doc/ 目錄內找到你要的。 - - 文件以幾種不同的方式分類。包括: - - - - 文件名稱,例如:faq (常見問答集)或是 handbook (FreeBSD 使用手冊)等等。 - - - - 文件的語言與編碼。他們是基於 FreeBSD 系統中 /usr/share/locale 裡所見到的語系名稱。目前包含的語言與編碼如下: - - - - - - 語系名稱 - - 說明 - - - - - - en_US.ISO8859-1 - - 英文 (美國) - - - - bn_BD.ISO10646-1 - - 孟加拉文 (孟加拉) - - - - da_DK.ISO8859-1 - - 丹麥文 (丹麥) - - - - de_DE.ISO8859-1 - - 德文 (德國) - - - - el_GR.ISO8859-7 - - 希臘文 (希臘) - - - - es_ES.ISO8859-1 - - 西班牙文 (西班牙) - - - - fr_FR.ISO8859-1 - - 法文 (法國) - - - - hu_HU.ISO8859-2 - - 匈牙利文 (匈牙利) - - - - it_IT.ISO8859-15 - - 義大利文 (義大利) - - - - ja_JP.eucJP - - 日文 (日本, EUC 編碼) - - - - ko_KR.UTF-8 - - 韓文 (韓國, UTF-8 編碼) - - - - mn_MN.UTF-8 - - 蒙古文 (蒙古, UTF-8 編碼) - - - - nl_NL.ISO8859-1 - - 荷蘭文 (荷蘭) - - - - pl_PL.ISO8859-2 - - 波蘭文 (波蘭) - - - - pt_BR.ISO8859-1 - - 葡萄牙文 (巴西) - - - - ru_RU.KOI8-R - - 俄文 (俄羅斯, KOI8-R 編碼) - - - - tr_TR.ISO8859-9 - - 土耳其文 (土耳其) - - - - zh_CN.UTF-8 - - 簡體中文 (中國, UTF-8 編碼) - - - - zh_TW.UTF-8 - - 正體中文 (台灣, UTF-8 編碼) - - - - - - - 上列的各國翻譯語系文件中,並非所有文件都有翻譯。 - - - - - 文件的格式。我們的每份文件都提供許多不同的格式,每種格式各有利弊, 有些格式適合線上閱讀,有些則適合列印出美觀的文件。 這些不同格式的文件能夠確保我們的讀者們,無論是在螢幕上閱讀或是列印成紙本,都能夠閱讀他們感興趣的內容,目前有提供的格式如下: - - - - - - 格式 - - 說明 - - - - - - html-split - - 依章節區分成多個小的、互相連結的 HTML 檔案 - - - - html - - 所有內容包含在單一個 HTML 檔案 - - - - pdf - - Adobe's PDF 格式 - - - - ps - - PostScript - - - - rtf - - Microsoft 的 RTF 格式 - - - - txt - - 純文字 - - - - - - - 當用 Word 讀取 RTF 格式時,頁碼並不會被自動更新。在開啟檔案後按下CtrlA, CtrlEnd, F9 來更新頁碼。 - - - - - 壓縮和打包方式 - - - - 當採用 html-split 格式時,檔案先透過 tar1 工具來進行打包。接著再將產生出來的 .tar 檔接透過第二點所述的壓縮方式壓縮。 - - - - 其他的格式都是單一個檔案。例如 article.pdfbook.html ,以此類推。 - - 這些檔案接著透過 zipbz2 來壓縮。 tar1 工具可用來解壓縮這些檔案。 - - 因此 PostScript 版本的手冊經過 bzip2 壓縮後會存成一個叫做 book.ps.bz2 的檔案,並位於 handbook/ 資料夾。 - - - - - - 在選取格式與壓縮方式後,下載壓縮後的檔案並解壓縮,再把文件複製到想要的地方。 - - 舉例來說,透過 bzip21 壓縮的英文問與答的章節分割 HTML 版本,可以在 doc/en_US.ISO8859-1/books/faq/book.html-split.tar.bz2 中找到。若要下載並解壓縮這個檔案,請輸入 - - # fetch https://download.freebsd.org/ftp/doc/en_US.ISO8859-1/books/faq/book.html-split.tar.bz2 -# tar xvf book.html-split.tar.bz2 - - 如果檔案被壓縮過的話,tar 會自動偵測正確的格式並解壓縮出一堆 .html 檔案。主要的檔案是 index.html,包含了主目錄跟介紹以及連接到文件其他部份的連結。 - - - - - - 哪裡有關於 FreeBSD 的郵遞論壇(mailing lists)呢? 有哪些可以使用的 FreeBSD 新聞群組(news groups)呢? - - - - 請參考FreeBSD 使用手冊上的 郵件論壇 (mailing-lists) 。 - - - - - - 有 FreeBSD IRC (Internet Relay Chat)頻道嗎? - - - - 有的,大部分的 IRC 主機都有 FreeBSD 聊天頻道: - - - - EFNet 上的 #FreeBSDhelp 頻道專門用來幫助 FreeBSD 使用著 - - - - Freenode 上的 #FreeBSD 頻道是一個有許多使用者的一般求助頻道。這個頻道時常聊一些題外話,但主要還是讓使用者問 FreeBSD 相關問題的地方。其他使用者可以協助解答一些基本的問題,並請盡量提供使用手冊的參考或是提供連結來提供更深入的資訊。雖然這個頻道有來自世界各地的使用者,但這是一個英文為主的頻道。非母語人士應該以英文提問,並在必要的時候移駕到 ##freebsd-lang 頻道。 - - - - DALNET 的#FreeBSD 頻道,可由 irc.dal.net (位於美國)及irc.eu.dal.net (位於歐洲)進入。 - - - - UNDERNET 上的 #FreeBSD 頻道可由 us.undernet.org(位於美國)及 eu.undernet.org (位於歐洲)進入。由於這是個輔助新手用的頻道, 請記得閱讀別人向你提及的連結或檔案。 - - - - RUSNET 上的 #FreeBSD 頻道是俄語國家的 FreeBSD 使用者頻道。 這裡同時也是一般交流的討論好去處。 - - - - Freenode 上的 #bsdchat 頻道是一個正體中文(UTF-8 編碼)頻道專門用來幫助 FreeBSD 使用著。這裡也歡迎一般非技術的交流討論。 - - - - The FreeBSD wiki has a good - list of IRC channels. - - 每個頻道都是不同且互相獨立的。因為他們的聊天風格不同,您可以每個都試試看來找到適合您的頻道。 - - - - - - 有沒有任何網頁形式的 FreeBSD 論壇呢? - - - 官方的 FreeBSD 論壇位於 https://forums.FreeBSD.org/。 - - - - - - 可以從哪邊獲得商業化的 FreeBSD 的教育課程及技術支援呢? - - - - iXsystems, Inc., FreeBSD 商城的母公司,提供 FreeBSD 開發與調校解決方案與 FreeBSD 與 TrueOS 的軟體 支援。 - - BSD Certification Group, Inc. 提供 DragonFly BSD、FreeBSD、NetBSD 與 OpenBSD 的系統管理認證。請參閱 他們的網站 來獲得更多資訊。 - - 如果有其他組織提供技術訓練或技術支援,請聯絡 FreeBSD 計畫來加入以上清單。 - - - - - - - - 安裝 - - - - Nik - Clayton - - -
- nik@FreeBSD.org -
-
-
-
- - - - - - Which platform should I download? I have a 64 - bit capable Intel CPU, - but I only see amd64. - - - - amd64 is the term FreeBSD uses for 64-bit - compatible x86 architectures (also known as "x86-64" or - "x64"). Most modern computers should use amd64. - Older hardware should use i386. When installing - on a non-x86-compatible architecture, select the - platform which best matches the hardware. - - - - - - Which file do I download to get FreeBSD? - - - - On the Getting - FreeBSD page, select [iso] next - to the architecture that matches the hardware. - - Any of the following can be used: - - - - - - 檔案 - 描述 - - - - - - disc1.iso - Contains enough to install FreeBSD and - a minimal set of packages. - - - - dvd1.iso - Similar to disc1.iso - but with additional packages. - - - - memstick.img - A bootable image sufficient for writing to a - USB stick. - - - - bootonly.iso - A minimal image that requires network access - during installation to completely install - FreeBSD. - - - - - - Full instructions on this procedure and a little bit - more about installation issues in general can be found in - the Handbook - entry on installing FreeBSD. - - - - - - What do I do if the install image does not - boot? - - - - This can be caused by not downloading the image in - binary mode when using - FTP. - - Some FTP clients default their transfer mode to - ascii and attempt to change any - end-of-line characters received to match the - conventions used by the client's system. This will - almost invariably corrupt the boot image. Check the - SHA-256 checksum of the downloaded boot image: if it - is not exactly that on the - server, then the download process is suspect. - - When using a command line FTP client, type - binary at the FTP command prompt - after getting connected to the server and before - starting the download of the image. - - - - - - 可以在哪邊找到安裝 FreeBSD 的解說步驟呢? - - - - 安裝說明可以在 使用手冊的安裝 FreeBSD 找到。 - - - - - - 要跑 FreeBSD 至少需要什麼樣的配備呢? - - - - FreeBSD 需要 486 以上的 PC,64 MB 以上的 RAM,和至少 1.1 GB 的硬碟空間。 - - - - - - 要怎樣才能自行打造專用的安裝磁片呢? - - - - 可以透過編譯客製化發行版本來建立客製化的 FreeBSD 安裝媒體。請參閱 Release Engineering 文章的說明。 - - - - - - Windows 可以與 FreeBSD 共存嗎? - - - - 如果 Windows 先安裝,那就可以。 FreeBSD 的開機管理程式將會管理 Windows 和 FreeBSD 的開機啟動。 如果 Windows 後安裝,它將覆蓋開機管理程式。如果發生這種情況,請見下一小節。 - - - - - - Another operating system destroyed my Boot Manager. - How do I get it back? - - - - This depends upon the boot manager. - The FreeBSD boot selection menu can be reinstalled using - boot0cfg8. For example, to restore the boot menu - onto the disk ada0: - - # boot0cfg -B ada0 - - The non-interactive MBR bootloader can be installed - using gpart8: - - # gpart bootcode -b /boot/mbr ada0 - - For more complex situations, including GPT disks, see - gpart8. - - - - - - 我需要安裝完整的原始碼嗎? - - - - In general, no. There is nothing in the base system - which requires the presence of the source to operate. - Some ports, like sysutils/lsof, will - not build unless the source is installed. In particular, - if the port builds a kernel module or directly operates on - kernel structures, the source must be installed. - - - - - - 需要重新 build kernel 嗎? - - - - Usually not. The supplied GENERIC - kernel contains the drivers an ordinary computer will - need. freebsd-update8, the FreeBSD binary upgrade - tool, cannot upgrade custom kernels, another reason to - stick with the GENERIC kernel when - possible. For computers with very limited RAM, such as - embedded systems, it may be worthwhile to build a smaller - custom kernel containing just the required drivers. - - - - - - Should I use DES, Blowfish, or MD5 passwords and how - do I specify which form my users receive? - - - - FreeBSD uses - SHA512 by - default. DES - passwords are still available for backwards compatibility - with operating systems that still - use the less secure password format. FreeBSD also supports - the Blowfish and MD5 password formats. Which - password format to use for new passwords is controlled by - the passwd_format login capability in - /etc/login.conf, which takes values - of des, blf (if - these are available) or md5. See the - login.conf5 manual page for more information about - login capabilities. - - - - - - What are the limits for FFS file systems? - - - - For FFS file systems, the largest file system is - practically limited by the amount of memory required to - fsck8 the file system. fsck8 requires one - bit per fragment, which with the default fragment size of - 4 KB equates to 32 MB of memory per TB of disk. - This does mean that on architectures which limit userland - processes to 2 GB (e.g., i386), the maximum - fsck8'able filesystem is ~60 TB. - - If there was not a fsck8 memory limit the - maximum filesystem size would be 2 ^ 64 (blocks) - * 32 KB => 16 Exa * 32 KB => 512 - ZettaBytes. - - The maximum size of a single FFS file is approximately - 2 PB with the default block size of 32 KB. Each - 32 KB block can point to 4096 blocks. With triple - indirect blocks, the calculation is 32 KB * 12 + - 32 KB * 4096 + 32 KB * 4096^2 + 32 KB * - 4096^3. Increasing the block size to 64 KB will - increase the max file size by a factor of 16. - - - - - - Why do I get an error message, readin - failed after compiling and booting a new - kernel? - - - - The world and kernel are out of sync. This - is not supported. Be sure to use make - buildworld and make - buildkernel to update the kernel. - - Boot the system by specifying the kernel directly at - the second stage, pressing any key when the - | shows up before loader is - started. - - - - - - 是否有工具可以執行安裝後的設定工作嗎? - - - - 是的。bsdconfig 提供很棒的介面來進行 FreeBSD 安裝後設定。 - - - -
- - - 硬體相容性 - - - 一般問題 - - - - - I want to get a piece of hardware for my FreeBSD - system. Which model/brand/type is best? - - - - This is discussed continually on the FreeBSD mailing - lists but is to be expected since hardware changes so - quickly. Read through the Hardware Notes - for FreeBSD 12.0 - or 10.4 - and search the mailing list archives - before asking about the latest and greatest hardware. - Chances are a discussion about that type of hardware - took place just last week. - - Before purchasing a laptop, check the archives for - FreeBSD laptop computer mailing list and FreeBSD general questions mailing list, or possibly a specific - mailing list for a particular hardware type. - - - - - - What are the limits for memory? Does FreeBSD support - more than 4 GB of memory - (RAM)? More than 16 GB? More than - 48 GB? - - - - FreeBSD as an operating system generally supports - as much physical memory (RAM) as the platform it is - running on does. Keep in mind that different platforms - have different limits for memory; for example i386 - without PAE supports at most - 4 GB of memory (and usually less than that because - of PCI address space) and i386 with PAE supports at - most 64 GB memory. As of FreeBSD 10, AMD64 - platforms support up to 4 TB of physical - memory. - - - - - - Why does FreeBSD report less than 4 GB memory when - installed on an i386 machine? - - - - The total address space on i386 machines is - 32-bit, meaning that at most 4 GB of memory is - addressable (can be accessed). Furthermore, some - addresses in this range are reserved by hardware for - different purposes, for example for using and - controlling PCI devices, for accessing video memory, and - so on. Therefore, the total amount of memory usable by - the operating system for its kernel and applications is - limited to significantly less than 4 GB. Usually, - 3.2 GB to 3.7 GB is the maximum usable - physical memory in this configuration. - - To access more than 3.2 GB to 3.7 GB of - installed memory (meaning up to 4 GB but also more - than 4 GB), a special tweak called - PAE must be used. PAE stands for - Physical Address Extension and is a way for 32-bit x86 - CPUs to address more than 4 GB of memory. It - remaps the memory that would otherwise be overlaid by - address reservations for hardware devices above the - 4 GB range and uses it as additional physical - memory (see pae4). Using PAE has some drawbacks; - this mode of memory access is a little bit slower than - the normal (without PAE) mode and loadable modules (see - kld4) are not supported. This means all drivers - must be compiled into the kernel. - - The most common way to enable PAE is to build a new - kernel with the special ready-provided kernel - configuration file called PAE, - which is already configured to build a safe kernel. - Note that some entries in this kernel configuration file - are too conservative and some drivers marked as unready - to be used with PAE are actually usable. A rule of - thumb is that if the driver is usable on 64-bit - architectures (like AMD64), it is also usable with PAE. - When creating a custom kernel configuration - file, PAE can be enabled by adding the following - line: - - options PAE - - PAE is not much used nowadays because most new x86 - hardware also supports running in 64-bit mode, known as - AMD64 or Intel 64. It has a much larger address - space and does not need such tweaks. FreeBSD supports - AMD64 and it is recommended that this version of FreeBSD be - used instead of the i386 version if 4 GB or more - memory is required. - - - - - - - Architectures and Processors - - - - - Does FreeBSD support architectures other than the - x86? - - - - Yes. FreeBSD divides support into multiple tiers. - Tier 1 architectures, such as i386 or amd64; are fully - supported. Tiers 2 and 3 are supported on a - best-effort basis. A full explanation of the tier - system is available in the Committer's - Guide. - - A complete list of supported architectures can be - found on the platforms - page. - - - - - - Does FreeBSD support Symmetric Multiprocessing - (SMP)? - - - - FreeBSD supports symmetric multi-processor (SMP) on all - non-embedded platforms (e.g, i386, amd64, - etc.). SMP is also supported in arm and MIPS kernels, - although some CPUs may not support this. FreeBSD's SMP - implementation uses fine-grained locking, and - performance scales nearly linearly with number of - CPUs. - - smp4 has more details. - - - - - - What is microcode? - How do I install Intel CPU microcode updates? - - - - Microcode is a method of programmatically - implementing hardware level instructions. This allows - for CPU bugs to be fixed without replacing the on board - chip. - - Install sysutils/devcpu-data, - then add: - - microcode_update_enable="YES" - - to /etc/rc.conf - - - - - - - Hard Drives, Tape Drives, and CD and DVD Drives - - - - - What kind of hard drives does FreeBSD support? - - - - FreeBSD supports EIDE, SATA, SCSI, and SAS drives (with - a compatible controller; see the next section), and all - drives using the original Western Digital - interface (MFM, RLL, ESDI, and of course IDE). A few - ESDI controllers that use proprietary interfaces may not - work: stick to WD1002/3/6/7 interfaces and - clones. - - - - - - Which SCSI or SAS controllers are supported? - - - - See the complete list in the Hardware Notes for FreeBSD - 12.0 - or 10.4. - - - - - - What types of tape drives are supported? - - - - FreeBSD supports all standard SCSI tape - interfaces. - - - - - - Does FreeBSD support tape changers? - - - - FreeBSD supports SCSI changers using the ch4 - device and the chio1 command. The details of how - to control the changer can be found in - chio1. - - While - AMANDA and some other - products already understands changers, other - applications only know how to move a tape from one point - to another. In this case, keep track of which slot a - tape is in and which slot the tape currently in the - drive needs to go back to. - - - - - - Which CD-ROM and CD-RW drives are supported by - FreeBSD? - - - - Any SCSI drive connected to a supported controller - is supported. Most ATAPI compatible IDE CD-ROMs are - supported. - - FreeBSD supports any ATAPI-compatible IDE CD-R or CD-RW - drive. - - FreeBSD also supports any SCSI CD-R or CD-RW drives. - Install the sysutils/cdrtools port or - package, then use cdrecord. - - - - - - - Keyboards and Mice - - - - - Is it possible to use a mouse outside the - X Window system? - - - - The default console driver, - syscons4, provides the ability to use a mouse - pointer in text consoles to cut & paste text. Run - the mouse daemon, moused8, and turn on the mouse - pointer in the virtual console: - - # moused -p /dev/xxxx -t yyyy -# vidcontrol -m on - - Where xxxx is the mouse - device name and yyyy is a - protocol type for the mouse. The mouse daemon can - automatically determine the protocol type of most mice, - except old serial mice. Specify the - auto protocol to invoke automatic - detection. If automatic detection does not work, see - the moused8 manual page for a list of supported - protocol types. - - For a PS/2 mouse, add - moused_enable="YES" to - /etc/rc.conf to start the mouse - daemon at boot time. Additionally, to - use the mouse daemon on all virtual terminals instead of - just the console, add allscreens_flags="-m - on" to - /etc/rc.conf. - - When the mouse daemon is running, access to the - mouse must be coordinated between the mouse daemon and - other programs such as X Windows. Refer to the - FAQ - Why does my mouse not work - with X? for more details on this issue. - - - - - - How do I cut and paste text with a mouse in the text - console? - - - - It is not possible to remove data using the mouse. - However, it is possible to copy and paste. Once the - mouse daemon is running as described in the previous question, hold down - button 1 (left button) and move the mouse to select a - region of text. Then, press button 2 (middle button) to - paste it at the text cursor. Pressing button 3 (right - button) will extend the selected region - of text. - - If the mouse does not have a middle button, it is - possible to emulate one or remap buttons using mouse - daemon options. See the moused8 manual page for - details. - - - - - - My mouse has a fancy wheel and buttons. Can I use - them in FreeBSD? - - - - The answer is, unfortunately, It - depends. These mice with additional features - require specialized driver in most cases. Unless the - mouse device driver or the user program has specific - support for the mouse, it will act just like a standard - two, or three button mouse. - - For the possible usage of wheels in the X Window - environment, refer to that section. - - - - - - How do I use my delete key in sh - and csh? - - - - For the Bourne Shell, add - the following lines to ~/.shrc. - See sh1 and editrc5. - - bind ^? ed-delete-next-char # for console -bind ^[[3~ ed-delete-next-char # for xterm - - For the C Shell, add the - following lines to ~/.cshrc. - See csh1. - - bindkey ^? delete-char # for console -bindkey ^[[3~ delete-char # for xterm - - For more information, see this - page. - - - - - - - Other Hardware - - - - - Workarounds for no sound from my pcm4 sound - card? - - - - Some sound cards set their output volume to 0 at - every boot. Run the following command every time the - machine boots: - - # mixer pcm 100 vol 100 cd 100 - - - - - - Does FreeBSD support power management on my - laptop? - - - - FreeBSD supports the ACPI features - found in modern hardware. Further information can be - found in acpi4. - - - - - - - - Troubleshooting - - - - - Why is FreeBSD finding the wrong amount of memory on - i386 hardware? - - - - The most likely reason is the difference between - physical memory addresses and virtual addresses. - - The convention for most PC hardware is to use the - memory area between 3.5 GB and 4 GB for a - special purpose (usually for PCI). This address space is - used to access PCI hardware. As a result real, physical - memory cannot be accessed by that address space. - - What happens to the memory that should appear in that - location is hardware dependent. Unfortunately, - some hardware does nothing and the ability to use that - last 500 MB of RAM is entirely lost. - - Luckily, most hardware remaps the memory to a higher - location so that it can still be used. However, this can - cause some confusion when watching the boot - messages. - - On a 32-bit version of FreeBSD, the memory appears lost, - since it will be remapped above 4 GB, which a 32-bit - kernel is unable to access. In this case, the solution is - to build a PAE enabled kernel. See the entry on memory - limits for more information. - - On a 64-bit version of FreeBSD, or when running a - PAE-enabled kernel, FreeBSD will correctly detect and remap - the memory so it is usable. During boot, however, it may - seem as if FreeBSD is detecting more memory than the system - really has, due to the described remapping. This is - normal and the available memory will be corrected as the - boot process completes. - - - - - - Why do my programs occasionally die with - Signal 11 errors? - - - - Signal 11 errors are caused when a process has - attempted to access memory which the operating system has - not granted it access to. If something like this is - happening at seemingly random intervals, - start investigating the cause. - - These problems can usually be attributed to - either: - - - - If the problem is occurring only in a specific - custom application, it is - probably a bug in the code. - - - - If it is a problem with part of the base FreeBSD - system, it may also be buggy code, but more often than - not these problems are found and fixed long before us - general FAQ readers get to use - these bits of code (that is what -CURRENT is - for). - - - - It is probably - not a FreeBSD bug if the - problem occurs compiling a program, but the activity - that the compiler is carrying out changes each - time. - - For example, if make - buildworld fails while trying - to compile ls.c into - ls.o and, when run again, it fails - in the same place, this is a broken build. Try - updating source and try again. If the compile fails - elsewhere, it is almost certainly due to hardware. - - In the first case, use a debugger such as - gdb1 to find the point in the program which is - attempting to access a bogus address and fix - it. - - In the second case, verify which piece of - hardware is at fault. - - Common causes of this include: - - - - The hard disks might be overheating: Check that - the fans are still working, as the disk and - other hardware might be overheating. - - - - The processor running is overheating: This might - be because the processor has been overclocked, or the - fan on the processor might have died. In either case, - ensure that the hardware is running at - what it is specified to run at, at least while trying - to solve this problem. If it is not, clock it back - to the default settings.) - - Regarding overclocking, it is far - cheaper to have a slow system than a fried system that - needs replacing! Also the community is not - sympathetic to problems on overclocked systems. - - - - Dodgy memory: if multiple memory - SIMMS/DIMMS are installed, pull them all out and try - running the machine with each SIMM or DIMM - individually to narrow the problem down to either the - problematic DIMM/SIMM or perhaps even a - combination. - - - - Over-optimistic motherboard settings: the BIOS - settings, and some motherboard jumpers, provide - options to set various timings. The defaults - are often sufficient, but sometimes setting the wait - states on RAM too low, or setting the RAM - Speed: Turbo option - will cause strange behavior. A possible idea is to - set to BIOS defaults, after noting - the current settings first. - - - - Unclean or insufficient power to the motherboard. - Remove any unused I/O boards, hard disks, or - CD-ROMs, - or disconnect the power cable from them, to see if - the power supply can manage a smaller load. Or try - another power supply, preferably one with a little - more power. For instance, if the current power supply - is rated at 250 Watts, try one rated at - 300 Watts. - - - - Read the section on - Signal 11 for a further - explanation and a discussion on how memory testing - software or hardware can still pass faulty memory. There - is an extensive FAQ on this at the SIG11 - problem FAQ. - - Finally, if none of this has helped, it is possibly - a bug in FreeBSD. - Follow these instructions - to send a problem report. - - - - - - My system crashes with either Fatal trap - 12: page fault in kernel mode, or - panic:, and spits out a bunch of - information. What should I do? - - - - The FreeBSD developers are interested in these - errors, but need more information than just the error - message. Copy the full crash message. Then consult the - FAQ section on kernel - panics, build a debugging kernel, and get a - backtrace. This might sound difficult, but does not - require any programming skills. Just follow the - instructions. - - - - - - What is the meaning of the error maxproc - limit exceeded by uid %i, please see tuning(7) and - login.conf(5)? - - - - The FreeBSD kernel will only allow a certain number of - processes to exist at one time. The number is based on - the kern.maxusers sysctl8 - variable. kern.maxusers also affects - various other in-kernel limits, such as network buffers. - If the machine is heavily loaded, - increase kern.maxusers. This will - increase these other system limits in addition to the - maximum number of processes. - - To adjust the kern.maxusers value, - see the File/Process - Limits section of the Handbook. While that - section refers to open files, the same limits apply to - processes. - - If the machine is lightly loaded but running a very - large number of processes, adjust the - kern.maxproc tunable by defining it in - /boot/loader.conf. The tunable will - not get adjusted until the system is rebooted. For more - information about tuning tunables, see - loader.conf5. If these processes are being run by - a single user, adjust - kern.maxprocperuid to be one less than - the new kern.maxproc value. It must - be at least one less because one system program, - init8, must always be running. - - - - - - Why do full screen applications on remote machines - misbehave? - - - - The remote machine may be setting the terminal type to - something other than xterm which is - required by the FreeBSD console. Alternatively the kernel - may have the wrong values for the width and height of the - terminal. - - Check the value of the TERM - environment variable is xterm. If the - remote machine does not support that try - vt100. - - Run stty -a to check what the - kernel thinks the terminal dimensions are. If they are - incorrect, they can be changed by running - stty rows RR cols - CC. - - Alternatively, if the client machine has - x11/xterm installed, then running - resize will query the terminal for the - correct dimensions and set them. - - - - - - Why does it take so long to connect to my computer via - ssh or - telnet? - - - - The symptom: there is a long delay between the time - the TCP connection is established and the time when the - client software asks for a password (or, in - telnet1's case, when a login prompt - appears). - - The problem: more likely than not, the delay is caused - by the server software trying to resolve the client's IP - address into a hostname. Many servers, including the - Telnet and - SSH servers that come with - FreeBSD, do this to store the hostname in a log file for - future reference by the administrator. - - The remedy: if the problem occurs whenever connecting - the client computer to any server, the problem - is with the client. If the problem only occurs - when someone connects to the server computer, the - problem is with the server. - - If the problem is with the client, the only remedy is - to fix the DNS so the server can resolve it. If this is - on a local network, consider it a server problem and keep - reading. If this is on the Internet, - contact your ISP. - - If the problem is with the server on a - local network, configure the server - to resolve address-to-hostname queries for the local - address range. See hosts5 and named8 - for more information. If this is on the - Internet, the problem may be that the local server's - resolver is not functioning correctly. To check, try to - look up another host such as - www.yahoo.com. If it does not - work, that is the problem. - - Following a fresh install of FreeBSD, it is also possible - that domain and name server information is missing from - /etc/resolv.conf. This will often - cause a delay in SSH, as the - option UseDNS is set to - yes by default in - /etc/ssh/sshd_config. If this is - causing the problem, either fill in the - missing information in - /etc/resolv.conf or set - UseDNS to no in - sshd_config as a temporary - workaround. - - - - - - Why does file: table is full - show up repeatedly in dmesg8? - - - - This error message indicates that the number of - available file descriptors have been exhausted on the - system. Refer to the kern.maxfiles - section of the Tuning - Kernel Limits section of the Handbook for a - discussion and solution. - - - - - - Why does the clock on my computer keep incorrect - time? - - - - The computer has two or more clocks, and FreeBSD has - chosen to use the wrong one. - - Run dmesg8, and check for lines that contain - Timecounter. The one with the highest - quality value that FreeBSD chose. - - # dmesg | grep Timecounter -Timecounter "i8254" frequency 1193182 Hz quality 0 -Timecounter "ACPI-fast" frequency 3579545 Hz quality 1000 -Timecounter "TSC" frequency 2998570050 Hz quality 800 -Timecounters tick every 1.000 msec - - Confirm this by checking the - kern.timecounter.hardware - sysctl3. - - # sysctl kern.timecounter.hardware -kern.timecounter.hardware: ACPI-fast - - It may be a broken ACPI timer. The simplest solution - is to disable the ACPI timer in - /boot/loader.conf: - - debug.acpi.disabled="timer" - - Or the BIOS may modify the TSC clock—perhaps to - change the speed of the processor when running from - batteries, or going into a power saving mode, but FreeBSD is - unaware of these adjustments, and appears to gain or lose - time. - - In this example, the i8254 clock is - also available, and can be selected by writing its name to - the kern.timecounter.hardware - sysctl3. - - # sysctl kern.timecounter.hardware=i8254 -kern.timecounter.hardware: TSC -> i8254 - - The computer should now start keeping more accurate - time. - - To have this change automatically run at boot time, - add the following line to - /etc/sysctl.conf: - - kern.timecounter.hardware=i8254 - - - - - - What does the error swap_pager: indefinite - wait buffer: mean? - - - - This means that a process is trying to page memory - from - disk, and the page attempt has hung trying to access the - disk for more than 20 seconds. It might be caused by bad - blocks on the disk drive, disk wiring, cables, or any - other disk I/O-related hardware. If the drive itself is - bad, disk errors will appear in - /var/log/messages and in the output - of dmesg. Otherwise, check the cables - and connections. - - - - - - What is a lock order - reversal? - - - - The FreeBSD kernel uses a number of resource locks to - arbitrate contention for certain resources. When multiple - kernel threads try to obtain multiple resource locks, - there's always the potential for a deadlock, where two - threads have each obtained one of the locks and blocks - forever waiting for the other thread to release one of the - other locks. This sort of locking problem can be avoided - if all threads obtain the locks in the same order. - - A run-time lock diagnostic system called - witness4, enabled in FreeBSD-CURRENT and disabled by - default for stable branches and releases, detects the - potential for deadlocks due to locking errors, including - errors caused by obtaining multiple resource locks with a - different order from different parts of the kernel. The - witness4 framework tries to detect this problem as - it happens, and reports it by printing a message to the - system console about a lock order - reversal (often referred to also as - LOR). - - It is possible to get false positives, as - witness4 is conservative. A true positive report - does not mean that a system is - dead-locked; instead it should be understood as a warning - that a deadlock could have happened here. - - - Problematic LORs tend to get - fixed quickly, so check the FreeBSD-CURRENT mailing list before posting - to it. - - - - - - - What does Called ... with the following - non-sleepable locks held mean? - - - - This means that a function that may sleep was called - while a mutex (or other unsleepable) lock was held. - - The reason this is an error is because mutexes are not - intended to be held for long periods of time; they are - supposed to only be held to maintain short periods of - synchronization. This programming contract allows device - drivers to use mutexes to synchronize with the rest of the - kernel during interrupts. Interrupts (under FreeBSD) may not - sleep. Hence it is imperative that no subsystem in the - kernel block for an extended period while holding a - mutex. - - To catch such errors, assertions may be added to the - kernel that interact with the witness4 subsystem to - emit a warning or fatal error (depending on the system - configuration) when a potentially blocking call is made - while holding a mutex. - - In summary, such warnings are non-fatal, however with - unfortunate timing they could cause undesirable effects - ranging from a minor blip in the system's responsiveness - to a complete system lockup. - - For additional information about locking in FreeBSD see - locking9. - - - - - - Why does - buildworld/installworld - die with the message touch: not - found? - - - - This error does not mean that the touch1 - utility is missing. The error is instead probably due to - the dates of the files being set sometime in the future. - If the CMOS clock is set to local time, run - adjkerntz -i to adjust - the kernel clock when booting into single-user - mode. - - - - - - - User Applications - - - - - Where are all the user applications? - - - - Refer to the ports - page for info on software packages ported to - FreeBSD. The list currently tops 24,000 and is - growing daily, so come back to check often or subscribe to - the FreeBSD announcements mailing list for periodic updates on new - entries. - - Most ports should work on all supported versions of - FreeBSD. Those that do not are specifically marked as such. - Each time a FreeBSD release is made, a snapshot of the ports - tree at the time of release in also included in the - ports/ directory. - - FreeBSD supports compressed binary packages to easily - install and uninstall ports. Use pkg7 to control - the installation of packages. - - - - - - How do I download the Ports tree? Should I be using - Subversion? - - - - Any of the methods listed here work: - - - - Use portsnap for most use cases. Refer to Using - the Ports Collection for instructions on how to - use this tool. - - - Use Subversion if custom patches to the - ports tree are needed. Refer to Using - Subversion for details. - - - - - - - - Does FreeBSD support Java? - - - - Yes. Refer to https://www.FreeBSD.org/java/ - for more information. - - - - - - Why can I not build this port on my - 11.X -, or - 12.X -STABLE machine? - - - - If the installed FreeBSD version lags significantly - behind -CURRENT or - -STABLE, update the Ports Collection - using the instructions in Using - the Ports Collection. If the system is - up-to-date, someone might have committed a change to the - port which works for -CURRENT but - which broke the port for -STABLE. - Submit - a bug report, since the Ports Collection is supposed to - work for both the -CURRENT and - -STABLE branches. - - - - - - I just tried to build INDEX using - make index, and it failed. Why? - - - - First, make sure that the Ports Collection is - up-to-date. Errors that affect building - INDEX from an up-to-date copy of the - Ports Collection are high-visibility and are thus almost - always fixed immediately. - - There are rare cases where INDEX - will not build due to odd cases involving - OPTIONS_SET - being set in make.conf. If - you suspect that this is the case, try to make - INDEX with those variables - turned off before reporting it to FreeBSD ports mailing list. - - - - - - I updated the sources, now how do I update my - installed ports? - - - - FreeBSD does not include a port upgrading tool, but it - does have some tools to make the upgrade process somewhat - easier. Additional tools are available to simplify - port handling and are described the Upgrading - Ports section in the FreeBSD Handbook. - - - - - - Do I need to recompile every port each time I perform - a major version update? - - - - Yes! While a recent system will run with - software compiled under an older release, - things will randomly crash and fail to work once - other ports are installed or updated. - - When the system is upgraded, various shared libraries, - loadable modules, and other parts of the system will be - replaced with newer versions. Applications linked against - the older versions may fail to start or, in other cases, - fail to function properly. - - For more information, see the - section on upgrades in the FreeBSD Handbook. - - - - - - Do I need to recompile every port each time I perform - a minor version update? - - - - In general, no. FreeBSD developers do their utmost to - guarantee binary compatibility across all releases with - the same major version number. Any exceptions will be - documented in the Release Notes, and advice given there - should be followed. - - - - - - Why is /bin/sh so minimal? Why - does FreeBSD not use bash or another - shell? - - - - Many people need to write shell scripts which will be - portable across many systems. That is why POSIX - specifies the shell and utility commands in great detail. - Most scripts are written in Bourne shell (sh1), and - because several important programming interfaces - (make1, system3, popen3, and - analogues in higher-level scripting languages like Perl - and Tcl) are specified to use the Bourne shell to - interpret commands. Because the Bourne shell is so often - and widely used, it is important for it to be quick to - start, be deterministic in its behavior, and have a small - memory footprint. - - The existing implementation is our best effort at - meeting as many of these requirements simultaneously as we - can. To keep /bin/sh small, we have - not provided many of the convenience features that other - shells have. That is why other more featureful shells - like bash, scsh, - tcsh1, and zsh are available. - Compare the memory utilization of - these shells by looking at the VSZ and - RSS columns in a ps -u - listing. - - - - - - How do I create audio CDs from my MIDI files? - - - - To create audio CDs from MIDI files, first install - audio/timidity++ from ports then - install manually the GUS patches set by Eric A. Welsh, - available at http://alleg.sourceforge.net/digmid.html. - After TiMidity++ has been - installed properly, MIDI files may be converted to WAV - files with the following command line: - - % timidity -Ow -s 44100 -o /tmp/juke/01.wav 01.mid - - The WAV files can then be converted to other formats - or burned onto audio CDs, as described in the FreeBSD - Handbook. - - - - - - - Kernel Configuration - - - - - I would like to customize my kernel. Is it - difficult? - - - - Not at all! Check out the kernel - config section of the Handbook. - - - The new kernel will be - installed to the /boot/kernel - directory along with its modules, while the old kernel - and its modules will be moved to the - /boot/kernel.old directory. If - a mistake is made in the - configuration, simply boot the previous version of the - kernel. - - - - - - - Why is my kernel so big? - - - - GENERIC kernels shipped with FreeBSD - are compiled in debug mode. - Kernels built in debug mode contain debug data in - separate files that are used for debugging. - FreeBSD releases prior to 11.0 store these debug files in - the same directory as the kernel itself, - /boot/kernel/. - In FreeBSD 11.0 and later the debug files are stored in - /usr/lib/debug/boot/kernel/. - Note that there will be little or no performance loss from - running a debug kernel, and it is useful to keep one - around in case of a system panic. - - When running low on disk space, there - are different options to reduce the size of - /boot/kernel/ and - /usr/lib/debug/. - - To not install the symbol files, - make sure the following line exists in - /etc/src.conf: - - WITHOUT_KERNEL_SYMBOLS=yes - - For more information see src.conf5. - - If you want to avoid building debug files altogether, - make sure that both of the following are true: - - - - This line does not exist in the kernel - configuration file: - - makeoptions DEBUG=-g - - - - Do not run config8 with - . - - - - Either of the above settings will cause the kernel to - be built in debug mode. - - To build and install only the specified modules, list - them in - /etc/make.conf: - - MODULES_OVERRIDE= accf_http ipfw - - Replace accf_httpd ipfw with a - list of needed modules. Only the listed modules will be - built. This reduces the size of the kernel - directory and decreases the amount of time needed to - build the kernel. For more information, read - /usr/share/examples/etc/make.conf. - - Unneeded devices can be removed from the kernel - to further reduce the size. See for more information. - - To put any of these options into effect, follow the - instructions to build - and install the new kernel. - - For reference, the FreeBSD 11 amd64 kernel - (/boot/kernel/kernel) is - approximately 25 MB. - - - - - - Why does every kernel I try to build fail to compile, - even GENERIC? - - - - There are a number of possible causes for this - problem: - - - - The source - tree is different from the one used to build the - currently running system. When attempting an upgrade, - read /usr/src/UPDATING, paying - particular attention to the COMMON - ITEMS section at the end. - - - - The make buildkernel did not - complete successfully. The make - buildkernel target relies on files - generated by the make buildworld - target to complete its job correctly. - - - - Even when building FreeBSD-STABLE, it is possible - that the source tree was fetched at a time when it was - either being modified or it was broken. - Only releases are guaranteed to be - buildable, although FreeBSD-STABLE builds fine the - majority of the time. Try re-fetching the source tree - and see if the problem goes away. Try using a - different mirror in case the previous one is having - problems. - - - - - - - - Which scheduler is in use on a - running system? - - - - The name of the scheduler currently being used is - directly available as the value of the - kern.sched.name sysctl: - - % sysctl kern.sched.name -kern.sched.name: ULE - - - - - - What is kern.sched.quantum? - - - - kern.sched.quantum is the maximum - number of ticks a process can run without being preempted - in the 4BSD scheduler. - - - - - - - Disks, File Systems, and Boot Loaders - - - - - How can I add my new hard disk to my FreeBSD - system? - - - - See the Adding - Disks section in the FreeBSD Handbook. - - - - - - How do I move my system over to my huge new - disk? - - - - The best way is to reinstall the operating system on - the new disk, then move the user data over. This is - highly recommended when tracking - -STABLE for more than one release or - when updating a release instead of installing a new one. - Install booteasy on both disks with boot0cfg8 and - dual boot until you are happy with the new configuration. - Skip the next paragraph to find out how to move the data - after doing this. - - Alternatively, partition and label the new disk with - either sade8 or gpart8. If the disks are - MBR-formatted, booteasy can be installed on both disks - with boot0cfg8 so that the computer can dual boot - to the old or new system after the copying is done. - - Once the new disk set up, - the data cannot just be copied. Instead, use tools that - understand device files and system flags, such as - dump8. Although it is recommended - to move the data while in single-user mode, it - is not required. - - When the disks are formatted with - UFS, never use anything but - dump8 and restore8 to move the root file - system. These commands should also be used when moving a - single partition to another empty partition. The sequence - of steps to use dump to move the data - from one UFS partitions to a new - partition is: - - - - newfs the new partition. - - - - mount it on a temporary mount - point. - - - - cd to that directory. - - - - dump the old partition, piping - output to the new one. - - - - For example, to move - /dev/ada1s1a with - /mnt as the temporary mount point, - type: - - # newfs /dev/ada1s1a -# mount /dev/ada1s1a /mnt -# cd /mnt -# dump 0af - / | restore rf - - - Rearranging partitions with - dump takes a bit more work. To merge a - partition like /var into its parent, - create the new partition large enough for both, move the - parent partition as described above, then move the child - partition into the empty directory that the first move - created: - - # newfs /dev/ada1s1a -# mount /dev/ada1s1a /mnt -# cd /mnt -# dump 0af - / | restore rf - -# cd var -# dump 0af - /var | restore rf - - - To split a directory from its parent, say putting - /var on its own partition when it was - not before, create both partitions, then mount the child - partition on the appropriate directory in the temporary - mount point, then move the old single partition: - - # newfs /dev/ada1s1a -# newfs /dev/ada1s1d -# mount /dev/ada1s1a /mnt -# mkdir /mnt/var -# mount /dev/ada1s1d /mnt/var -# cd /mnt -# dump 0af - / | restore rf - - - The cpio1 and pax1 utilities are also - available for moving user data. These are known to lose - file flag information, so use them with caution. - - - - - - Which partitions can safely use Soft Updates? I have - heard that Soft Updates on / can - cause problems. What about Journaled Soft Updates? - - - - Short answer: Soft Updates can usually be safely used - on all partitions. - - Long answer: Soft Updates has two characteristics - that may be undesirable on certain partitions. First, a - Soft Updates partition has a small chance of losing data - during a system crash. The partition will not be - corrupted as the data will simply be lost. Second, Soft - Updates can cause temporary space shortages. - - When using Soft Updates, the kernel can take up to - thirty seconds to write changes to the physical disk. - When a large file is deleted the file still resides on - disk until the kernel actually performs the deletion. - This can cause a very simple race condition. Suppose - one large file is deleted and another large file is - immediately created. The first large file is not yet - actually removed from the physical disk, so the disk might - not have enough room for the second large file. This will - produce an error that the partition does not have enough - space, even though a large chunk of space has just been - released. A few seconds later, the file creation works as - expected. - - If a system should crash after the kernel accepts a - chunk of data for writing to disk, but before that data is - actually written out, data could be lost. This risk is - extremely small, but generally manageable. - - These issues affect all partitions using Soft Updates. - So, what does this mean for the root partition? - - Vital information on the root partition changes very - rarely. If the system crashed during the thirty-second - window after such a change is made, it is possible that - data could be lost. This risk is negligible for most - applications, but be aware that it exists. If - the system cannot tolerate this much risk, do not use - Soft Updates on the root file system! - - / is traditionally one of the - smallest partitions. If - /tmp is on - /, there may be intermittent - space problems. Symlinking /tmp to - /var/tmp will solve this - problem. - - Finally, dump8 does not work in live mode (-L) - on a filesystem, with Journaled Soft Updates - (SU+J). - - - - - - Can I mount other foreign file systems under - FreeBSD? - - - - FreeBSD supports a variety of other file systems. - - - - UFS - - - UFS CD-ROMs can be mounted directly on FreeBSD. - Mounting disk partitions from Digital UNIX and other - systems that support UFS may be more complex, - depending on the details of the disk partitioning - for the operating system in question. - - - - - ext2/ext3 - - - FreeBSD supports ext2fs and - ext3fs partitions. See - ext2fs5 for more information. - - - - - NTFS - - - FUSE based NTFS support is available as a port - (sysutils/fusefs-ntfs). For more - information see ntfs-3g. - - - - - FAT - - - FreeBSD includes a read-write FAT driver. For more - information, see mount_msdosfs8. - - - - - ZFS - - - FreeBSD 包含由 Sun 移植過來的 ZFS 驅動程式。 目前的建議是僅在記憶體充足的 amd64 平臺上使用它。有關更詳細資訊, 請參閱 zfs8 - - - - - FreeBSD includes the Network File System - NFS and the FreeBSD Ports Collection - provides several FUSE applications to support many other - file systems. - - - - - - How do I mount a secondary DOS partition? - - - - The secondary DOS partitions are found after - all the primary partitions. For - example, if E is the - second DOS partition on the second SCSI drive, there will - be a device file for slice 5 in - /dev. To mount it: - - # mount -t msdosfs /dev/da1s5 /dos/e - - - - - - Is there a cryptographic file system for FreeBSD? - - - - Yes, gbde8 and geli8. - See the Encrypting - Disk Partitions section of the FreeBSD - Handbook. - - - - - - How do I boot FreeBSD and Linux using - GRUB? - - - - To boot FreeBSD using GRUB, - add the following to either - /boot/grub/menu.lst or - /boot/grub/grub.conf, depending upon - which is used by the Linux distribution. - - title FreeBSD 9.1 - root (hd0,a) - kernel /boot/loader - - Where hd0,a points to the - root partition on the first disk. To specify - the slice number, use something like this - (hd0,2,a). By default, if the - slice number is omitted, GRUB - searches the first slice - which has the a partition. - - - - - - How do I boot FreeBSD and Linux using - BootEasy? - - - - Install LILO at the start of the Linux boot - partition instead of in the Master Boot Record. You can - then boot LILO from - BootEasy. - - This is recommended when running Windows and Linux - as it makes it simpler to get Linux booting again if - Windows is reinstalled. - - - - - - How do I change the boot prompt from - ??? to something more - meaningful? - - - - This cannot be accomplished with the standard boot - manager without rewriting it. There are a number of other - boot managers in the sysutils - category of the Ports Collection. - - - - - - How do I use a new removable drive? - - - - If the drive already has a file system on it, - use a command like this: - - # mount -t msdosfs /dev/da0s1 /mnt - - If the drive will only be used with FreeBSD systems, - partition it with UFS or - ZFS. This will provide long filename - support, improvement in performance, and stability. If - the drive will be used by other operating systems, a more - portable choice, such as msdosfs, is better. - - # dd if=/dev/zero of=/dev/da0 count=2 -# gpart create -s GPT /dev/da0 -# gpart add -t freebsd-ufs /dev/da0 - - Finally, create a new file system: - - # newfs /dev/da0p1 - - and mount it: - - # mount /dev/da0s1 /mnt - - It is a good idea to add a line to - /etc/fstab (see fstab5) so you - can just type mount /mnt in the - future: - - /dev/da0p1 /mnt ufs rw,noauto 0 0 - - - - - - Why do I get Incorrect super - block when mounting a CD? - - - - The type of device to mount must be specified. This - is described in the Handbook section on Using - Data CDs. - - - - - - Why do I get Device not - configured when mounting a CD? - - - - This generally means that there is no CD in the - drive, or the drive is not visible on the bus. - Refer to the Using - Data CDs section of the Handbook for a detailed - discussion of this issue. - - - - - - Why do all non-English characters in filenames show up - as ? on my CDs when mounted in FreeBSD? - - - - The CD probably uses the Joliet - extension for storing information about files and - directories. This is discussed in the Handbook section on - Using - Data CD-ROMs. - - - - - - A CD burned under FreeBSD cannot be read - under any other operating system. Why? - - - - This means a raw file was burned to the CD, rather - than creating an ISO 9660 file system. Take a look - at the Handbook section on Using - Data CDs. - - - - - - How can I create an image of a data CD? - - - - This is discussed in the Handbook section on Writing - Data to an ISO File System. - For more on working with CD-ROMs, see the Creating - CDs Section in the Storage chapter in the - Handbook. - - - - - - Why can I not mount an audio - CD? - - - - Trying to mount an audio CD will produce an error - like cd9660: /dev/cd0: Invalid - argument. This is because - mount only works on file systems. - Audio CDs do not have file systems; they just have data. - Instead, use a program that reads audio CDs, such as the - audio/xmcd package or port. - - - - - - How do I mount a multi-session - CD? - - - - By default, mount8 will attempt to mount the - last data track (session) of a CD. To - load an earlier session, use the - command line argument. Refer to - mount_cd96608 for specific examples. - - - - - - How do I let ordinary users mount CD-ROMs, DVDs, - USB drives, and other removable media? - - - - As root set - the sysctl variable vfs.usermount to - 1. - - # sysctl vfs.usermount=1 - - To make this persist across reboots, add the line - vfs.usermount=1 to - /etc/sysctl.conf so that it is reset - at system boot time. - - Users can only mount devices they have read - permissions to. To allow users to mount a device - permissions must be set in - /etc/devfs.conf. - - For example, to allow users to mount the first USB - drive add: - - # Allow all users to mount a USB drive. - own /dev/da0 root:operator - perm /dev/da0 0666 - - All users can now mount devices they could read onto a - directory that they own: - - % mkdir ~/my-mount-point -% mount -t msdosfs /dev/da0 ~/my-mount-point - - Unmounting the device is simple: - - % umount ~/my-mount-point - - Enabling vfs.usermount, however, - has negative security implications. A better way to - access MS-DOS formatted media is to use the - emulators/mtools package in the Ports - Collection. - - - The device name used in the previous examples must - be changed according to the configuration. - - - - - - - The du and df - commands show different amounts of disk space available. - What is going on? - - - - This is due to how these commands actually work. - du goes through the directory tree, - measures how large each file is, and presents the totals. - df just asks the file system how much - space it has left. They seem to be the same thing, but a - file without a directory entry will affect - df but not - du. - - When a program is using a file, and the file is - deleted, the file is not really removed from the file - system until the program stops using it. The file is - immediately deleted from the directory listing, however. - As an example, consider a file large enough - to affect the output of - du and df. A - file being viewed with more can be - deleted wihout causing an error. - The entry is - removed from the directory so no other program or user can - access it. However, du shows that it - is gone as it has walked the directory tree and the - file is not listed. df shows that it - is still there, as the file system knows that - more is still using that space. Once - the more session ends, - du and df will - agree. - - This situation is common on web servers. Many people - set up a FreeBSD web server and forget to rotate the log - files. The access log fills up /var. - The new administrator deletes the file, but the system - still complains that the partition is full. Stopping and - restarting the web server program would free the file, - allowing the system to release the disk space. To prevent - this from happening, set up newsyslog8. - - Note that Soft Updates can delay the freeing of disk - space and it can take up to 30 seconds for the - change to be visible. - - - - - - How can I add more swap space? - - - - This section of - the Handbook describes how to do this. - - - - - - Why does FreeBSD see my disk as smaller than the - manufacturer says it is? - - - - Disk manufacturers calculate gigabytes as a billion - bytes each, whereas FreeBSD calculates them as - 1,073,741,824 bytes each. This explains why, for - example, FreeBSD's boot messages will report a disk that - supposedly has 80 GB as holding - 76,319 MB. - - Also note that FreeBSD will (by default) reserve 8% of the - disk space. - - - - - - How is it possible for a partition to be more than - 100% full? - - - - A portion of each UFS partition (8%, by default) is - reserved for use by the operating system and the - root user. - df1 does not count that space when calculating the - Capacity column, so it can exceed 100%. - Notice that the Blocks - column is always greater than the sum of the - Used and Avail - columns, usually by a factor of 8%. - - For more details, look up in - tunefs8. - - - - - - - - ZFS - - - - - 使用 ZFS 最少需要多少記憶體? - - - - 至少需要 4GB 的記憶體才能跑得順,但不同的工作負載可能會造成相當大的差異。 - - - - - - ZIL 是什麼而又何時會被使用? - - - - The ZIL (ZFS 動向日誌) 是一個紀錄日誌,用以實現系統當機時 POSIX 寫入保證的語義,多個正常 ZFS 寫入動作會被分成多個交易處理群組,並在交易處理群組被填滿時寫入磁碟 (Transaction Group Commit)。然而像 fsync2 這樣的系統呼叫,會要求該系統呼叫在返回前,能承諾已將資料寫入磁碟,ZIL 就是用來紀錄確認為已執行寫入的資料,但其實尚未存在於磁碟上,即尚未完成交易處理,交易處理群組具有時間戳記,在系統當機後,找到 ZIL 最後一個有效的時間戳記,即將遺失的資料再舍併至磁碟上。 - - - - - - 我需要用固態硬碟 (SSD) 來存 ZIL 嗎? - - - - ZFS 預設將 ZIL 儲存在包含所有資料的 zpool 中,如果應用程式的寫入負載很重,將 ZIL 儲存在同步速度非常快的獨立設備中,藉由循序寫入效能的提高可以改善整個系統的效能,對於其他類型的工作負載, 固態硬碟就不會有太大的助益。 - - - - - - L2ARC 是什麼? - - - - The L2ARC (Second Level Adaptive Replacement Cache) 是存於快速儲存設備 SSD 上的讀取快取,此快取在重新開機後會消失,請注意記憶體是第一層的快取,只有在記憶體不足的情況下才需要 L2ARC。 - - L2ARC 需要 ARC 的空間來為其製作索引,因此,有一種反常的情況,如果有一種工作集 (working set) 可以完美地剛好放入 ARC,一旦系統使用 L2ARC,該工作集的運作將不再完美,因為 ARC 需要用一部分空間來保存 L2ARC 的索引,以至於必須將工作集的一部分存入比記憶體慢的 L2ARC。 - - - - - - 建議啟用去冗餘 (deduplication) 嗎? - - - - 一般而言,不建議這麼做。 - - 去冗餘需要相當多的記憶體,而且會讓讀寫磁碟所需的時間變長,除非磁碟上儲存了非常多重複的資料,例如:虛擬機的映像檔或者是使用者的備份資料,否則開啟去冗餘可能弊大於利。另一個需要考量的狀況是:啟用去冗餘功能之後再將其關閉,無法將磁碟上去冗餘的狀態立即逆轉,必須等到下次修改了之前被去冗餘的資料,變更的區塊才會再被複製一份。 - - 去冗餘也可能會導致某些非預期的情況,特別是刪除檔案時可能會慢很多。 - - - - - - 在我建立的 ZFS pool 中無法刪除和新增檔案,應該怎麼修復? - - - - 這很有可能是該 pool 的空間使用率已達 100% 滿了,因 ZFS 需要儲存空間以將紀錄交易處理的輔助資料 (metadata) 寫入,為了讓該 pool 回復至可用狀態,必須用檔案切除的方法 (truncate 命令) 刪除不重要的檔案: - - % truncate -s 0 unimportant-file - - 因為檔案切除不需要建立交易處理紀錄,並能釋放出可使用的磁碟區塊。 - - - 如果系統曾進行過額外的 ZFS dataset 調校,例如:去冗餘,釋放出來的空間也許不會立即可得。 - - - - - - - ZFS 支援固態硬碟 (SSD) 的 TRIM 功能嗎? - - - - 自 FreeBSD 10-CURRENT 修定 r240868 開始,就支援 ZFS TRIM。ZFS TRIM 的支援分別已在 r252162 和 r251419 的修訂,加進所有 FreeBSD-STABLE 分支。 - - ZFS TRIM 預設就已開啟,也可以將其關閉,只要加入一行設定到 /etc/sysctl.conf: - - vfs.zfs.trim.enabled=0 - - - ZFS TRIM 也可能某些設定中會無效,例如:在採用 GELI 裝置上的 ZFS 檔案系統。 - - - - - - - - System Administration - - - - - Where are the system start-up configuration - files? - - - - The primary configuration file is - /etc/defaults/rc.conf which is - described in rc.conf5. System startup scripts - such as /etc/rc and - /etc/rc.d, which are described in - rc8, include this file. Do not edit this - file! Instead, to edit an entry in - /etc/defaults/rc.conf, copy the line - into /etc/rc.conf and change it - there. - - For example, if to start named8, the - included DNS server: - - # echo 'named_enable="YES"' >> /etc/rc.conf - - To start up local services, place shell scripts in the - /usr/local/etc/rc.d directory. These - shell scripts should be set executable, the default file - mode is 555. - - - - - - How do I add a user easily? - - - - Use the adduser8 command, or the pw8 - command for more complicated situations. - - To remove the user, use the rmuser8 command or, - if necessary, pw8. - - - - - - Why do I keep getting messages like root: - not found after editing - /etc/crontab? - - - - This is normally caused by editing the system crontab. - This is not the correct way to do things as the system - crontab has a different format to the per-user crontabs. - The system - crontab has an extra field, specifying which user to run - the command as. cron8 assumes this user is the - first word of the command to execute. Since no such - command exists, this error message is displayed. - - To delete the extra, incorrect crontab: - - # crontab -r - - - - - - Why do I get the error, you are not in the - correct group to su root when I try to - su to root? - - - - This is a security feature. In order to - su to - root, or any - other account with superuser privileges, the user account - must be a member of the - wheel group. - If this feature were not there, anybody with an - account on a system who also found out root's password would be - able to gain superuser level access to the system. - - To allow someone to su to - root, put - them in the wheel group using - pw: - - # pw groupmod wheel -m lisa - - The above example will add user lisa to the group - wheel. - - - - - - I made a mistake in rc.conf, or - another startup file, and now I cannot edit it because the - file system is read-only. What should I do? - - - - Restart the system using boot - -s at the loader prompt to enter single-user - mode. When prompted for a shell pathname, press - Enter and run mount -urw - / to re-mount the root file system in - read/write mode. You may also need to run mount - -a -t ufs to mount the file system where your - favorite editor is defined. If that editor is on a - network file system, either configure the network manually - before mounting the network file systems, or use an editor - which resides on a local file system, such as - ed1. - - In order to use a full screen editor such as - vi1 or emacs1, run - export TERM=xterm - so that these editors can load the correct data from the - termcap5 database. - - After performing these steps, edit - /etc/rc.conf to - fix the syntax error. The error message displayed - immediately after the kernel boot messages should indicate - the number of the line in the file which is at - fault. - - - - - - Why am I having trouble setting up my printer? - - - - See the Handbook - entry on printing for troubleshooting - tips. - - - - - - How can I correct the keyboard mappings for my - system? - - - - Refer to the Handbook section on using - localization, specifically the section on console - setup. - - - - - - Why can I not get user quotas to work properly? - - - - - - It is possible that the kernel is not configured - to use quotas. In this case, - add the following line to the kernel configuration - file and recompile the kernel: - - options QUOTA - - Refer to the Handbook - entry on quotas for full details. - - - - Do not turn on quotas on - /. - - - - Put the quota file on the file system that the - quotas are to be enforced on: - - - - - - File System - - Quota file - - - - - - /usr - - /usr/admin/quotas - - - - /home - - /home/admin/quotas - - - - - - - - - - - - - - - - - - Does FreeBSD support System V IPC primitives? - - - - Yes, FreeBSD supports System V-style IPC, including - shared memory, messages and semaphores, in the - GENERIC kernel. With a custom - kernel, support may be loaded with the - sysvshm.ko, - sysvsem.ko and - sysvmsg.ko kernel modules, or - enabled in the custom kernel by adding the following lines - to the kernel configuration file: - - options SYSVSHM # enable shared memory -options SYSVSEM # enable for semaphores -options SYSVMSG # enable for messaging - - Recompile and install the kernel. - - - - - - What other mail-server software can I use instead of - Sendmail? - - - - The Sendmail - server is the default mail-server software for FreeBSD, but - it can be replaced with another - MTA installed from the Ports Collection. Available ports - include mail/exim, - mail/postfix, and - mail/qmail. Search the mailing lists - for discussions regarding the advantages and disadvantages - of the available MTAs. - - - - - - I have forgotten the root password! What do I - do? - - - - Do not panic! Restart the system, type - boot -s at the - Boot: prompt to enter single-user mode. - At the question about the shell to use, hit - Enter which will display a - # prompt. Enter mount - -urw / to remount the root file system - read/write, then run mount -a to - remount all the file systems. Run passwd - root to change the root password then run - exit1 to continue booting. - - - If you are still prompted to give the root password when - entering the single-user mode, it means that the console - has been marked as insecure in - /etc/ttys. In this case, it will - be required to boot from a FreeBSD installation disk, - choose the Live CD or - Shell at the beginning of the - install process and issue the commands mentioned above. - Mount the specific partition in this - case and then chroot to it. For example, replace - mount -urw / with - mount /dev/ada0p1 /mnt; chroot /mnt - for a system on - ada0p1. - - - - If the root partition cannot be mounted from - single-user mode, it is possible that the partitions are - encrypted and it is impossible to mount them without the - access keys. For more information see the section - about encrypted disks in the FreeBSD Handbook. - - - - - - - How do I keep ControlAltDelete - from rebooting the system? - - - - When using syscons4, the default console - driver, build and install a new kernel with this line in - the configuration file: - - options SC_DISABLE_REBOOT - - This can also be done by setting the following - sysctl8 which does not require a reboot or kernel - recompile: - - # sysctl hw.syscons.kbd_reboot=0 - - - The above two methods are exclusive: The - sysctl8 does not exist if the kernel is compiled - with SC_DISABLE_REBOOT. - - - - - - - How do I reformat DOS text files to UNIX - ones? - - - - Use this perl1 command: - - % perl -i.bak -npe 's/\r\n/\n/g' file(s) - - where file(s) is one or - more files to process. The modification is done in-place, - with the original file stored with a - .bak extension. - - Alternatively, use tr1: - - % tr -d '\r' < dos-text-file > unix-file - - dos-text-file is the file - containing DOS text while - unix-file will contain the - converted output. This can be quite a bit faster than - using perl. - - Yet another way to reformat DOS text files is to use - the converters/dosunix port from the - Ports Collection. Consult its documentation about the - details. - - - - - - How do I re-read /etc/rc.conf and - re-start /etc/rc without a - reboot? - - - - Go into single-user mode and then back to multi-user - mode: - - # shutdown now -# return -# exit - - - - - - I tried to update my system to the latest - -STABLE, but got - -BETAx, - -RC or - -PRERELEASE! What is going - on? - - - - Short answer: it is just a name. - RC stands for Release - Candidate. It signifies that a release is - imminent. In FreeBSD, -PRERELEASE is - typically synonymous with the code freeze before a - release. (For some releases, the - -BETA label was used in the same way - as -PRERELEASE.) - - Long answer: FreeBSD derives its releases from one of two - places. Major, dot-zero, releases, such as 9.0-RELEASE - are branched from the head of the development stream, - commonly referred to as -CURRENT. Minor releases, such - as 6.3-RELEASE or 5.2-RELEASE, have been snapshots of the - active -STABLE branch. - Starting with 4.3-RELEASE, each release also now has its - own branch which can be tracked by people requiring an - extremely conservative rate of development (typically only - security advisories). - - When a release is about to be made, the branch from - which it will be derived from has to undergo a certain - process. Part of this process is a code freeze. When a - code freeze is initiated, the name of the branch is - changed to reflect that it is about to become a release. - For example, if the branch used to be called 6.2-STABLE, - its name will be changed to 6.3-PRERELEASE to signify the - code freeze and signify that extra pre-release testing - should be happening. Bug fixes can still be committed to - be part of the release. When the source code is in shape - for the release the name will be changed to 6.3-RC to - signify that a release is about to be made from it. Once - in the RC stage, only the most critical bugs found can be - fixed. Once the release (6.3-RELEASE in this example) and - release branch have been made, the branch will be renamed - to 6.3-STABLE. - - For more information on version numbers and the - various Subversion branches, refer to the Release - Engineering article. - - - - - - I tried to install a new kernel, and the - chflags1 failed. How do I get around this? - - - - Short answer: the security level is - greater than 0. Reboot directly to single-user mode to - install the kernel. - - Long answer: FreeBSD disallows changing system flags at - security levels greater than 0. To check the current - security level: - - # sysctl kern.securelevel - - The security level cannot be lowered in multi-user - mode, so boot to single-user mode to install the kernel, - or change the security level in - /etc/rc.conf then reboot. See the - init8 manual page for details on - securelevel, and see - /etc/defaults/rc.conf and the - rc.conf5 manual page for more information on - rc.conf. - - - - - - I cannot change the time on my system by more than one - second! How do I get around this? - - - - Short answer: the system is at a security level - greater than 1. Reboot directly to single-user mode to - change the date. - - Long answer: FreeBSD disallows changing the time by more - that one second at security levels greater than 1. To - check the security level: - - # sysctl kern.securelevel - - The security level cannot be lowered in multi-user - mode. Either boot to single-user mode to change the date - or change the security level in - /etc/rc.conf and reboot. See the - init8 manual page for details on - securelevel, and see - /etc/defaults/rc.conf and the - rc.conf5 manual page for more information on - rc.conf. - - - - - - Why is rpc.statd using 256 MB - of memory? - - - - No, there is no memory leak, and it is not using - 256 MB of memory. For convenience, - rpc.statd maps an obscene amount of - memory into its address space. There is nothing terribly - wrong with this from a technical standpoint; it just - throws off things like top1 and ps1. - - rpc.statd8 maps its status file (resident on - /var) into its address space; to save - worrying about remapping the status file later when it - needs to grow, it maps the status file with a generous - size. This is very evident from the source code, where - one can see that the length argument to mmap2 is - 0x10000000, or one sixteenth of the - address space on an IA32, or exactly 256 MB. - - - - - - Why can I not unset the schg file - flag? - - - - The system is running at securelevel greater than 0. - Lower the securelevel and try again. For more - information, see the - FAQ entry on securelevel and - the init8 manual page. - - - - - - What is vnlru? - - - - vnlru flushes and frees vnodes when - the system hits the kern.maxvnodes - limit. This kernel thread sits mostly idle, and only - activates when there is a huge amount of RAM and users are - accessing tens of thousands of tiny files. - - - - - - What do the various memory states displayed by - top mean? - - - - - - - Active: pages recently - statistically used. - - - - Inactive: pages recently - statistically unused. - - - - Cache: (most often) pages that - have percolated from inactive to a status where they - maintain their data, but can often be immediately - reused (either with their old association, or reused - with a new association). There can be certain - immediate transitions from active - to cache state if the page is known - to be clean (unmodified), but that transition is a - matter of policy, depending upon the algorithm choice - of the VM system maintainer. - - - - Free: pages without data - content, and can be immediately used in certain - circumstances where cache pages might be ineligible. - Free pages can be reused at interrupt or process - state. - - - - Wired: pages that are fixed - into memory, usually for kernel purposes, but also - sometimes for special use in processes. - - - - Pages are most often written to disk (sort of a VM - sync) when they are in the inactive state, but active - pages can also be synced. This depends upon the CPU - tracking of the modified bit being available, and in - certain situations there can be an advantage for a block - of VM pages to be synced, whether they are active or - inactive. In most common cases, it is best to think of - the inactive queue to be a queue of relatively unused - pages that might or might not be in the process of being - written to disk. Cached pages are already synced, not - mapped, but available for immediate process use with their - old association or with a new association. Free pages are - available at interrupt level, but cached or free pages can - be used at process state for reuse. Cache pages are not - adequately locked to be available at interrupt - level. - - There are some other flags (e.g., busy flag or busy - count) that might modify some of the described - rules. - - - - - - How much free memory is available? - - - - - There are a couple of kinds of free - memory. One kind is the amount of memory - immediately available without paging anything else out. - That is approximately the size of cache queue + size of - free queue (with a derating factor, depending upon system - tuning). Another kind of free memory is - the total amount of VM space. That can - be complex, but is dependent upon the amount of swap space - and memory. Other kinds of free memory - descriptions are also possible, but it is relatively - useless to define these, but rather it is important to - make sure that the paging rate is kept low, and to avoid - running out of swap space. - - - - - - What is /var/empty? - - - - /var/empty is a directory that - the sshd8 program uses when performing privilege - separation. The /var/empty - directory is empty, owned by root and has the - schg flag set. This directory should - not be deleted. - - - - - - I just changed - /etc/newsyslog.conf. How can I check - if it does what I expect? - - - - To see what newsyslog8 will do, use the - following: - - % newsyslog -nrvv - - - - - - My time is wrong, how can I change the - timezone? - - - - Use tzsetup8. - - - - - - - The X Window System and Virtual Consoles - - - - - What is the X Window System? - - - - The X Window System (commonly X11) - is the most widely available windowing system capable of - running on UNIX or UNIX like systems, including - FreeBSD. The X.Org - Foundation administers the X - protocol standards, with the current reference - implementation, version 11 release 7.7, so - references are often shortened to - X11. - - Many implementations are available for different - architectures and operating systems. An implementation of - the server-side code is properly known as an X - server. - - - - - - I want to run Xorg, how do I go about it? - - - - To install Xorg do one of the following: - - Use the x11/xorg - meta-port, which builds and installs every Xorg - component. - - Use x11/xorg-minimal, which builds - and installs only the necessary Xorg components. - - Install Xorg from FreeBSD packages: - - # pkg install xorg - - After the installation of Xorg, follow the - instructions from the X11 - Configuration section of the FreeBSD - Handbook. - - - - - - I tried to run X, but I get a - No devices detected. error when I - type startx. What do I do now? - - - - The system is probably running at a raised - securelevel. It is not possible to - start X at a raised securelevel because - X requires write access to io4. For more - information, see at the init8 manual page. - - There are two solutions to the problem: set the - securelevel back down to zero or run - xdm1 (or an alternative display manager) at boot - time before the securelevel is - raised. - - See for more information - about running xdm1 at boot time. - - - - - - Why does my mouse not work with X? - - - - When using syscons4, the default console - driver, FreeBSD can be configured to support a mouse pointer - on each virtual screen. To avoid conflicting with X, - syscons4 supports a virtual device called - /dev/sysmouse. All mouse events - received from the real mouse device are written to the - sysmouse4 device via moused8. To use the - mouse on one or more virtual consoles, - and use X, see and set up - moused8. - - Then edit /etc/X11/xorg.conf and - make sure the following lines exist: - - Section "InputDevice" - Option "Protocol" "SysMouse" - Option "Device" "/dev/sysmouse" -..... - - Starting with Xorg version 7.4, the - InputDevice sections in - xorg.conf are ignored in favor of - autodetected devices. To restore the old behavior, add - the following line to the ServerLayout - or ServerFlags section: - - Option "AutoAddDevices" "false" - - Some people prefer to use - /dev/mouse under X. To make this - work, /dev/mouse should be linked - to /dev/sysmouse (see - sysmouse4) by adding the following line to - /etc/devfs.conf (see - devfs.conf5): - - link sysmouse mouse - - This link can be created by restarting devfs5 - with the following command (as root): - - # service devfs restart - - - - - - My mouse has a fancy wheel. Can I use it in X? - - - - Yes, if X is configured for a 5 button mouse. To - do this, add the lines Buttons 5 - and ZAxisMapping 4 5 to the - InputDevice section of - /etc/X11/xorg.conf, as seen in this - example: - - Section "InputDevice" - Identifier "Mouse1" - Driver "mouse" - Option "Protocol" "auto" - Option "Device" "/dev/sysmouse" - Option "Buttons" "5" - Option "ZAxisMapping" "4 5" -EndSection - - The mouse can be enabled in - Emacsby adding these - lines to ~/.emacs: - - ;; wheel mouse -(global-set-key [mouse-4] 'scroll-down) -(global-set-key [mouse-5] 'scroll-up) - - - - - - My laptop has a Synaptics touchpad. Can I use it in - X? - - - - Yes, after configuring a few things to make - it work. - - In order to use the Xorg synaptics driver, - first remove moused_enable from - rc.conf. - - To enable synaptics, add the following line to - /boot/loader.conf: - - hw.psm.synaptics_support="1" - - Add the following to - /etc/X11/xorg.conf: - - Section "InputDevice" -Identifier "Touchpad0" -Driver "synaptics" -Option "Protocol" "psm" -Option "Device" "/dev/psm0" -EndSection - - And be sure to add the following into the - ServerLayout section: - - InputDevice "Touchpad0" "SendCoreEvents" - - - - - - How do I use remote X displays? - - - - For security reasons, the default setting is to not - allow a machine to remotely open a window. - - To enable this feature, start - X with the optional - argument: - - % startx -listen_tcp - - - - - - What is a virtual console and how do I make - more? - - - - Virtual consoles provide - several simultaneous sessions on the same machine without - doing anything complicated like setting up a network or - running X. - - When the system starts, it will display a login prompt - on the monitor after displaying all the boot messages. - Type in your login name and password to - start working on the first virtual - console. - - To start another - session, perhaps to look at documentation for a program - or to read mail while waiting for an - FTP transfer to finish, - hold down Alt and press - F2. This will display the login prompt - for the second virtual - console. To go back to the - original session, press AltF1. - - The default FreeBSD installation has eight virtual - consoles enabled. AltF1, - AltF2, - AltF3, - and so on will switch between these virtual - consoles. - - To enable more of virtual consoles, edit - /etc/ttys (see ttys5) and add - entries for ttyv8 to - ttyvc, after the comment on - Virtual terminals: - - # Edit the existing entry for ttyv8 in /etc/ttys and change -# "off" to "on". -ttyv8 "/usr/libexec/getty Pc" xterm on secure -ttyv9 "/usr/libexec/getty Pc" xterm on secure -ttyva "/usr/libexec/getty Pc" xterm on secure -ttyvb "/usr/libexec/getty Pc" xterm on secure - - The more virtual - terminals, the more resources that are used. This can be - problematic on systems with 8 MB RAM or less. - Consider changing secure to - insecure. - - - In order to run an X server, at least one virtual - terminal must be left to off for it - to use. This means that only eleven of the Alt-function - keys can be used as virtual consoles so that one is left - for the X server. - - - For example, to run X and eleven virtual consoles, the - setting for virtual terminal 12 should be: - - ttyvb "/usr/libexec/getty Pc" xterm off secure - - The easiest way to activate the - virtual consoles is to reboot. - - - - - - How do I access the virtual consoles from X? - - - - Use CtrlAltFn - to switch back to a virtual console. Press CtrlAltF1 - to return to the first virtual console. - - Once at a text console, use - AltFn - to move between them. - - To return to the X session, switch to the - virtual console running X. If X was started from the - command line using startx, - the X session will attach to the next unused virtual - console, not the text console from which it was invoked. - For eight active virtual terminals, X will - run on the ninth, so use AltF9. - - - - - - How do I start XDM on - boot? - - - - There are two schools of thought on how to start - xdm1. One school starts xdm - from /etc/ttys (see ttys5) - using the supplied example, while the other runs - xdm from - rc.local (see rc8) or from an - X script in - /usr/local/etc/rc.d. Both are - equally valid, and one may work in situations where the - other does not. In both cases the result is the same: X - will pop up a graphical login prompt. - - The ttys5 method has the advantage of - documenting which vty X will start on and passing the - responsibility of restarting the X server on logout to - init8. The rc8 method makes it easy to - kill xdm if there is - a problem starting the X server. - - If loaded from rc8, xdm - should be started without any arguments. - xdm must start - after getty8 runs, or else - getty and xdm will - conflict, locking out the console. The best way around - this is to have the script sleep 10 seconds or so then - launch xdm. - - When starting xdm from - /etc/ttys, there still is a chance of - conflict between xdm and getty8. - One way to avoid this is to add the vt - number in - /usr/local/lib/X11/xdm/Xservers: - - :0 local /usr/local/bin/X vt4 - - The above example will direct the X server to run in - /dev/ttyv3. Note the number is - offset by one. The X server counts the vty from one, - whereas the FreeBSD kernel numbers the vty from zero. - - - - - - Why do I get Couldn't open - console when I run - xconsole? - - - - When X is started with - startx, the permissions on - /dev/console will - not get changed, resulting in things - like xterm -C and - xconsole not working. - - This is because of the way console permissions are set - by default. On a multi-user system, one does not - necessarily want just any user to be able to write on the - system console. For users who are logging directly onto a - machine with a VTY, the fbtab5 file exists to solve - such problems. - - In a nutshell, make sure an uncommented line of the - form is in /etc/fbtab (see - fbtab5): - - /dev/ttyv0 0600 /dev/console - - It will ensure that whomever logs in on - /dev/ttyv0 will own the - console. - - - - - - Why does my PS/2 mouse misbehave under X? - - - - The mouse and the mouse driver may have become out of - synchronization. In rare cases, the driver may also - erroneously report synchronization errors: - - psmintr: out of sync (xxxx != yyyy) - - If this happens, disable the synchronization check - code by setting the driver flags for the PS/2 mouse driver - to 0x100. This can be easiest achieved - by adding hint.psm.0.flags="0x100" to - /boot/loader.conf and - rebooting. - - - - - - How do I reverse the mouse buttons? - - - - Type - xmodmap -e "pointer = 3 2 1". Add this - command to ~/.xinitrc or - ~/.xsession to make it happen - automatically. - - - - - - How do I install a splash screen and where do I find - them? - - - - The detailed answer for this question can be found in - the Boot - Time Splash Screens section of the FreeBSD - Handbook. - - - - - - Can I use the Windows keys on my - keyboard in X? - - - - Yes. Use xmodmap1 to - define which functions the keys should perform. - - Assuming all Windows keyboards are - standard, the keycodes for these three keys are the - following: - - - - 115 — - Windows key, between the left-hand - Ctrl and Alt - keys - - - - 116 — - Windows key, to the right of - AltGr - - - - 117 — - Menu, to the left of the right-hand - Ctrl - - - - To have the left Windows key print a - comma, try this. - - # xmodmap -e "keycode 115 = comma" - - To have the Windows key-mappings - enabled automatically every time X is started, either put - the xmodmap commands in - ~/.xinitrc or, preferably, create - a ~/.xmodmaprc and include the - xmodmap options, one per line, then add - the following line to - ~/.xinitrc: - - xmodmap $HOME/.xmodmaprc - - For example, to map the 3 keys to be - F13, F14, and - F15, respectively. This would make it - easy to map them to useful functions within applications - or the window manager. - - To do this, put the following in - ~/.xmodmaprc. - - keycode 115 = F13 -keycode 116 = F14 -keycode 117 = F15 - - For the x11-wm/fvwm2 desktop - manager, one could map the keys so that - F13 iconifies or de-iconifies the - window the cursor is in, F14 brings the - window the cursor is in to the front or, if it is already - at the front, pushes it to the back, and - F15 pops up the main Workplace - menu even if the cursor is not on the - desktop, which is useful when no part of - the desktop is visible. - - The following entries in - ~/.fvwmrc implement the - aforementioned setup: - - Key F13 FTIWS A Iconify -Key F14 FTIWS A RaiseLower -Key F15 A A Menu Workplace Nop - - - - - - How can I get 3D hardware acceleration for - OpenGL? - - - - The availability of 3D acceleration depends on the - version of Xorg and the type of video - chip. For an nVidia chip, use - the binary drivers provided for FreeBSD by installing one of - the following ports: - - The latest versions of nVidia cards are supported - by the x11/nvidia-driver - port. - - Older drivers are available as - x11/nvidia-driver-### - - nVidia provides detailed information on which - card is supported by which driver on their web site: http://www.nvidia.com/object/IO_32667.html. - - For Matrox G200/G400, check the - x11-drivers/xf86-video-mga - port. - - For ATI Rage 128 and Radeon see - ati4, r1284 and radeon4. - - - - - - - Networking - - - - - Where can I get information on diskless - booting? - - - - Diskless booting means that the FreeBSD - box is booted over a network, and reads the necessary - files from a server instead of its hard disk. For full - details, see the - Handbook entry on diskless booting. - - - - - - Can a FreeBSD box be used as a dedicated network - router? - - - - Yes. Refer to the Handbook entry on advanced - networking, specifically the section on routing - and gateways. - - - - - - Can I connect my Windows box to the Internet via - FreeBSD? - - - - Typically, people who ask this question have two PCs - at home, one with FreeBSD and one with some version of - Windows the idea is to use the FreeBSD box to connect to - the Internet and then be able to access the Internet from - the Windows box through the FreeBSD box. This is really - just a special case of the previous question and works - perfectly well. - - Dialup users must use - and set gateway_enable to - YES in - /etc/rc.conf. For more information, - refer to ppp8 or the Handbook - entry on user PPP. - - If the connection to the Internet is over Ethernet, - use natd8. A tutorial can be found in the natd - section of the Handbook. - - - - - - Does FreeBSD support PPP? - - - - Yes. ppp8 provides support for both incoming - and outgoing connections. - - For more information on how to use this, refer to - the Handbook - chapter on PPP. - - - - - - Does FreeBSD support NAT or Masquerading? - - - - Yes. For instructions on how to use NAT over a PPP - connection, see the Handbook - entry on PPP. To use NAT over - some other sort of network connection, look at the - natd - section of the Handbook. - - - - - - How can I set up Ethernet aliases? - - - - If the alias is on the same subnet as an address - already configured on the interface, add - netmask 0xffffffff to this - command: - - # ifconfig ed0 alias 192.0.2.2 netmask 0xffffffff - - Otherwise, specify the network address and - netmask as usual: - - # ifconfig ed0 alias 172.16.141.5 netmask 0xffffff00 - - More information can be found in the FreeBSD Handbook. - - - - - - Why can I not NFS-mount from a Linux box? - - - - Some versions of the Linux NFS code only accept - mount requests from a privileged port; try to issue the - following command: - - # mount -o -P linuxbox:/blah /mnt - - - - - - Why does mountd keep telling me it - can't change attributes and that I - have a bad exports list on my FreeBSD - NFS server? - - - - The most frequent problem is not understanding the - correct format of /etc/exports. - Review exports5 and the NFS - entry in the Handbook, especially the section on configuring - NFS. - - - - - - How do I enable IP multicast support? - - - - Install the net/mrouted package - or port and add - mrouted_enable="YES" to - /etc/rc.conf start this service at - boot time. - - - - - - Why do I have to use the FQDN for hosts on my - site? - - - - See the answer in the FreeBSD Handbook. - - - - - - Why do I get an error, Permission - denied, for all networking - operations? - - - - If the kernel is compiled with the - IPFIREWALL option, be aware - that the default policy is to deny all packets that are - not explicitly allowed. - - If the firewall is unintentionally misconfigured, - restore network operability by - typing the following as root: - - # ipfw add 65534 allow all from any to any - - Consider setting - firewall_type="open" in - /etc/rc.conf. - - For further information on configuring this - firewall, see the Handbook - chapter. - - - - - - Why is my ipfw fwd - rule to redirect a service to another machine not - working? - - - - Possibly because network address translation (NAT) is - needed instead of just forwarding packets. A - fwd rule only forwards packets, it does not - actually change the data inside the packet. Consider this - rule: - - 01000 fwd 10.0.0.1 from any to foo 21 - - When a packet with a destination address of - foo arrives at the machine with - this rule, the packet is forwarded to - 10.0.0.1, but it still has the - destination address of foo. - The destination address of the packet is - not changed to - 10.0.0.1. Most machines would - probably drop a packet that they receive with a - destination address that is not their own. Therefore, - using a fwd rule does not often work the - way the user expects. This behavior is a feature and not - a bug. - - See the FAQ about - redirecting services, the natd8 manual, or - one of the several port redirecting utilities in the Ports - Collection for a correct way to do this. - - - - - - How can I redirect service requests from one machine - to another? - - - - FTP and other service requests can be redirected with - the sysutils/socket package or port. - Replace the entry for the service in - /etc/inetd.conf to call - socket, as seen in this example for - ftpd: - - ftp stream tcp nowait nobody /usr/local/bin/socket socket ftp.example.com ftp - - where ftp.example.com and - ftp are the host and port to - redirect to, respectively. - - - - - - Where can I get a bandwidth management tool? - - - - There are three bandwidth management tools available - for FreeBSD. dummynet4 is integrated into FreeBSD as - part of ipfw4. ALTQ - has been integrated into FreeBSD as part of pf4. - Bandwidth Manager from Emerging - Technologies is a commercial product. - - - - - - Why do I get /dev/bpf0: device not - configured? - - - - The running application requires the Berkeley - Packet Filter (bpf4), but it was removed from a - custom kernel. Add this to the kernel config file and - build a new kernel: - - device bpf # Berkeley Packet Filter - - - - - - How do I mount a disk from a Windows machine that is - on my network, like smbmount in Linux? - - - - Use the SMBFS toolset. It - includes a set of kernel modifications and a set of - userland programs. The programs and information are - available as mount_smbfs8 in the base - system. - - - - - - What are these messages about: Limiting - icmp/open port/closed port response in my - log files? - - - - This kernel message indicates that some activity is - provoking it to send a large amount of ICMP or TCP reset - (RST) responses. ICMP responses are - often generated as a result of attempted connections to - unused UDP ports. TCP resets are generated as a result of - attempted connections to unopened TCP ports. Among - others, these are the kinds of activities which may cause - these messages: - - - - Brute-force denial of service (DoS) attacks (as - opposed to single-packet attacks which exploit a - specific vulnerability). - - - - Port scans which attempt to connect to a large - number of ports (as opposed to only trying a few - well-known ports). - - - - The first number in the message indicates how many - packets the kernel would have sent if the limit was not in - place, and the second indicates the limit. This limit - is controlled using - net.inet.icmp.icmplim. This example - sets the limit to 300 - packets per second: - - # sysctl net.inet.icmp.icmplim=300 - - To disable these messages - without disabling response - limiting, use - net.inet.icmp.icmplim_output - to disable the output: - - # sysctl net.inet.icmp.icmplim_output=0 - - Finally, to disable response limiting completely, - set net.inet.icmp.icmplim to - 0. Disabling response limiting is - discouraged for the reasons listed above. - - - - - - What are these arp: unknown hardware - address format error messages? - - - - This means that some device on the local Ethernet is - using a MAC address in a format that FreeBSD does not - recognize. This is probably caused by someone - experimenting with an Ethernet card somewhere else on the - network. This is most commonly seen on cable modem - networks. It is harmless, and should not affect the - performance of the FreeBSD system. - - - - - - Why do I keep seeing messages like: - 192.168.0.10 is on - fxp1 but got reply from 00:15:17:67:cf:82 on - rl0, and how do I disable it? - - - - Because a packet is coming from outside the network - unexpectedly. To disable them, set - net.link.ether.inet.log_arp_wrong_iface - to 0. - - - - - - How do I compile an IPv6 only kernel? - - - - Configure your kernel with these settings: - - include GENERIC -ident GENERIC-IPV6ONLY -makeoptions MKMODULESENV+="WITHOUT_INET_SUPPORT=" -nooptions INET -nodevice gre - - - - - - - Security - - - - - What is a sandbox? - - - Sandbox is a security term. It can - mean two things: - - - - A process which is placed inside a set of virtual - walls that are designed to prevent someone who breaks - into the process from being able to break into the - wider system. - - The process is only able to run inside the walls. - Since nothing the process does in regards to executing - code is supposed to be able to breach the walls, a - detailed audit of its code is not needed in order to - be able to say certain things about its - security. - - The walls might be a user ID, for example. - This is the definition used in the security7 - and named8 man pages. - - Take the ntalk service, for - example (see inetd8). This service used to run - as user ID root. Now it runs as - user ID tty. The tty user is a sandbox - designed to make it more difficult for someone who has - successfully hacked into the system via - ntalk from being able to hack - beyond that user ID. - - - - A process which is placed inside a simulation of - the machine. It means that someone who is able to - break into the process may believe that he can break - into the wider machine but is, in fact, only breaking - into a simulation of that machine and not modifying - any real data. - - The most common way to accomplish this is to build - a simulated environment in a subdirectory and then run - the processes in that directory chrooted so that - / for that process is this - directory, not the real / of the - system). - - Another common use is to mount an underlying file - system read-only and then create a file system layer - on top of it that gives a process a seemingly - writeable view into that file system. The process may - believe it is able to write to those files, but only - the process sees the effects — other processes - in the system do not, necessarily. - - An attempt is made to make this sort of sandbox so - transparent that the user (or hacker) does not realize - that he is sitting in it. - - - - UNIX implements two core sandboxes. One is at the - process level, and one is at the userid level. - - Every UNIX process is completely firewalled off from - every other UNIX process. One process cannot modify the - address space of another. - - A UNIX process is owned by a particular userid. If - the user ID is not the root user, it serves to - firewall the process off from processes owned by other - users. The user ID is also used to firewall off - on-disk data. - - - - - - What is securelevel? - - - - securelevel is a security - mechanism implemented in the kernel. When the securelevel - is positive, the kernel restricts certain tasks; not even - the superuser (root) is allowed to do - them. The securelevel mechanism limits the ability - to: - - - - Unset certain file flags, such as - schg (the system immutable - flag). - - - - Write to kernel memory via - /dev/mem and - /dev/kmem. - - - - Load kernel modules. - - - - Alter firewall rules. - - - - To check the status of the securelevel on a running - system: - - # sysctl -n kern.securelevel - - The output contains the current value of the - securelevel. If it is greater than 0, at - least some of the securelevel's protections are - enabled. - - The securelevel of a running system cannot be lowered - as this would defeat its purpose. If a task requires that - the securelevel be non-positive, change the - kern_securelevel and - kern_securelevel_enable variables in - /etc/rc.conf and reboot. - - For more information on securelevel and the specific - things all the levels do, consult init8. - - - Securelevel is not a silver bullet; it has many - known deficiencies. More often than not, it provides a - false sense of security. - - One of its biggest problems is that in order for it - to be at all effective, all files used in the boot - process up until the securelevel is set must be - protected. If an attacker can get the system to execute - their code prior to the securelevel being set (which - happens quite late in the boot process since some things - the system must do at start-up cannot be done at an - elevated securelevel), its protections are invalidated. - While this task of protecting all files used in the boot - process is not technically impossible, if it is - achieved, system maintenance will become a nightmare - since one would have to take the system down, at least - to single-user mode, to modify a configuration - file. - - This point and others are often discussed on the - mailing lists, particularly the FreeBSD security mailing list. - Search the archives here - for an extensive discussion. A more fine-grained - mechanism is preferred. - - - - - - - BIND9 - (named) is listening on some - high-numbered ports. What is going on? - - - - BIND uses a random high-numbered port for outgoing - queries. Recent versions of it choose a new, random UDP - port for each query. This may cause problems for some - network configurations, especially if a firewall blocks - incoming UDP packets on particular ports. To - get past that firewall, try the - avoid-v4-udp-ports and - avoid-v6-udp-ports options to avoid - selecting random port numbers within a blocked - range. - - - If a port number (like 53) is specified via the - query-source or - query-source-v6 options in - /usr/local/etc/namedb/named.conf, - randomized - port selection will not be used. It is strongly - recommended that these options not be used to specify - fixed port numbers. - - - Congratulations, by the way. It is good practice to - read sockstat1 output and notice odd - things! - - - - - - The Sendmail daemon is - listening on port 587 as well as the standard port 25! - What is going on? - - - - Recent versions of Sendmail - support a mail submission feature that runs over port 587. - This is not yet widely supported, but is growing in - popularity. - - - - - - What is this UID 0 toor account? Have I been - compromised? - - - - Do not worry. toor is an - alternative superuser account, where toor - is root spelled backwards. It is intended to be used with - a non-standard shell so the default shell for root does not need to - change. This is important as shells which are not part of - the base distribution, but are instead installed from - ports or packages, are installed in - /usr/local/bin which, by default, - resides on a different file system. If root's shell is located in - /usr/local/bin and the - file system - containing /usr/local/bin) is not - mounted, root will not be able to - log in to fix a problem and will have to reboot into - single-user mode in order to enter the path to a - shell. - - Some people use toor for day-to-day - root tasks with - a non-standard shell, leaving root, with a standard - shell, for single-user mode or emergencies. By default, a - user cannot log in using toor as it does not have a - password, so log in as root and set a password - for toor before - using it to login. - - - - - - - PPP - - - - - I cannot make ppp8 work. What am I doing - wrong? - - - - First, read ppp8 and - the PPP - section of the Handbook. To assist in - troubleshooting, enable logging with the - following command: - - set log Phase Chat Connect Carrier lcp ipcp ccp command - - This command may be typed at the ppp8 command - prompt or it may be entered at the start of the - default section - in /etc/ppp/ppp.conf. Make sure that - /etc/syslog.conf contains the lines - below and the file /var/log/ppp.log - exists: - - !ppp -*.* /var/log/ppp.log - - A lot about what is going can be learned from the log - file. Do not worry if it does not all make sense as - it may make sense to someone else. - - - - - - Why does ppp8 hang when I run it? - - - - This is usually because the hostname will not - resolve. The best way to fix this is to make sure that - /etc/hosts is read first by the - by ensuring that the hosts line is - listed first in /etc/host.conf. - Then, put an entry in /etc/hosts for - the local machine. If there is no local network, change - the localhost line: - - 127.0.0.1 foo.example.com foo localhost - - Otherwise, add another entry for the host. - Consult the relevant manual pages for more details. - - When finished, verify that this command is successful: - ping -c1 `hostname`. - - - - - - Why will ppp8 not dial in - -auto mode? - - - - First, check that a default route exists. This - command should display two entries: - - Destination Gateway Flags Refs Use Netif Expire -default 10.0.0.2 UGSc 0 0 tun0 -10.0.0.2 10.0.0.1 UH 0 0 tun0 - - If - a default route is not listed, make sure that the - HISADDR line has been added to - /etc/ppp/ppp.conf. - - Another reason for the default route line being - missing is that a default - route has been added to /etc/rc.conf - and this line is missing - from /etc/ppp/ppp.conf: - - delete ALL - - If this is the case, go back to the Final - System Configuration section of the - Handbook. - - - - - - What does No route to host - mean? - - - - This error is usually because the following section - is missing in - /etc/ppp/ppp.linkup: - - MYADDR: - delete ALL - add 0 0 HISADDR - - This is only necessary for a dynamic IP address or - when the address of the default gateway is unknown. When - using interactive mode, the following can be typed in - after entering packet mode. Packet mode - is indicated by the capitalized PPP in - the prompt: - - delete ALL -add 0 0 HISADDR - - Refer to the PPP - and Dynamic IP addresses section of the Handbook - for further details. - - - - - - Why does my connection drop after about 3 - minutes? - - - - The default PPP timeout is 3 minutes. This can be - adjusted with the following line: - - set timeout NNN - - where NNN is the number of - seconds of inactivity before the connection is closed. If - NNN is zero, the connection is - never closed due to a timeout. It is possible to put this - command in ppp.conf, or to type it at - the prompt in interactive mode. It is also possible to - adjust it on the fly while the line is active by - connecting to ppp's server - socket using telnet1 or pppctl8. Refer to - the ppp8 man page for further details. - - - - - - Why does my connection drop under heavy load? - - - - If Link Quality Reporting (LQR) is - configured, it is possible that too many - LQR packets are lost between the FreeBSD - system and the peer. ppp8 deduces that the line - must therefore be bad, and disconnects. - LQR is disabled by default and can be - enabled with the following line: - - enable lqr - - - - - - Why does my connection drop after a random amount of - time? - - - - Sometimes, on a noisy phone line or even on a line - with call waiting enabled, the modem may hang up because - it incorrectly thinks that it lost carrier. - - There is a setting on most modems for determining how - tolerant it should be to temporary losses of carrier. - Refer to the modem manual for details. - - - - - - Why does my connection hang after a random amount of - time? - - - - Many people experience hung connections with no - apparent explanation. The first thing to establish is - which side of the link is hung. - - When using an external modem, try - using ping8 to see if the TD - light is flashing when data is transmitted. If it flashes - but the RD light does not, the - problem is with the remote end. If TD - does not flash, the problem is local. With an internal - modem, use the set - server command in - ppp.conf. When the hang occurs, - connect to ppp8 using pppctl8. If the - network connection suddenly revives due to the activity on - the diagnostic socket, or if it will not - connect but the set socket - command succeeded at startup time, the problem is local. - If it can connect but things are still hung, enable local - logging with set log local async - and use ping8 from another window or terminal to - make use of the link. The async logging will show the - data being transmitted and received on the link. If data - is going out and not coming back, the problem is - remote. - - Having established whether the problem is local or - remote, there are now two possibilities: - - - - If the problem is remote, read on entry . - - - - If the problem is local, read on entry . - - - - - - - - The remote end is not responding. What can I - do? - - - - There is very little that can be done about this. - Many ISPs will refuse to help users not running a - Microsoft OS. Add enable lqr to - /etc/ppp/ppp.conf, allowing - ppp8 to detect the remote failure and hang up. - This detection is relatively slow and therefore not that - useful. - - First, try disabling all local compression by adding - the following to the configuration: - - disable pred1 deflate deflate24 protocomp acfcomp shortseq vj -deny pred1 deflate deflate24 protocomp acfcomp shortseq vj - - Then reconnect to ensure that this makes no - difference. If things improve or if the problem is solved - completely, determine which setting makes the difference - through trial and error. This is good information for - the ISP, although it may make - it apparent that it is not a Microsoft system. - - Before contacting the ISP, enable async logging - locally and wait until the connection hangs again. This - may use up quite a bit of disk space. The last data read - from the port may be of interest. It is usually ASCII - data, and may even describe the problem (Memory - fault, Core - dumped). - - If the ISP is helpful, they should be able to enable - logging on their end, then when the next link drop occurs, - they may be able to tell why their side is having a - problem. - - - - - - ppp8 has hung. What can I do? - - - - In this case, rebuild ppp8 with - debugging information, and then use gdb1 to grab a - stack trace from the ppp - process that is stuck. To rebuild the - ppp utility with debugging - information, type: - - # cd /usr/src/usr.sbin/ppp -# env DEBUG_FLAGS='-g' make clean -# env DEBUG_FLAGS='-g' make install - - Then, restart ppp - and wait until it hangs again. When the debug build of - ppp hangs, start - gdb on the stuck process by - typing: - - # gdb ppp `pgrep ppp` - - At the gdb prompt, - use the bt or where - commands to get a stack trace. Save the output of the - gdb session, and - detach from the running process by typing - quit. - - - - - - I keep seeing errors about magic being the same. What - does it mean? - - - - Occasionally, just after connecting, there may be - messages in the log that say Magic is - same. Sometimes, these messages are - harmless, and sometimes one side or the other exits. Most - PPP implementations cannot survive this problem, and even - if the link seems to come up, there will be repeated - configure requests and configure acknowledgments in the - log file until ppp8 eventually gives up and closes - the connection. - - This normally happens on server machines with slow - disks that are spawning a getty8 on the port, and - executing ppp8 from a login script or program after - login. There were reports of it happening consistently - when using slirp. The reason is that in the time taken - between getty8 exiting and ppp8 starting, - the client-side ppp8 starts sending Line Control - Protocol (LCP) packets. Because ECHO is still switched on - for the port on the server, the client ppp8 sees - these packets reflect back. - - One part of the LCP negotiation is to establish a - magic number for each side of the link so that - reflections can be detected. The protocol - says that when the peer tries to negotiate the same magic - number, a NAK should be sent and a new magic number should - be chosen. During the period that the server port has - ECHO turned on, the client ppp8 sends LCP packets, - sees the same magic in the reflected packet and NAKs it. - It also sees the NAK reflect (which also means ppp8 - must change its magic). This produces a potentially - enormous number of magic number changes, all of which are - happily piling into the server's tty buffer. As soon as - ppp8 starts on the server, it is flooded with magic - number changes and almost immediately decides it has tried - enough to negotiate LCP and gives up. Meanwhile, the - client, who no longer sees the reflections, becomes happy - just in time to see a hangup from the server. - - This can be avoided by allowing the peer to start - negotiating with the following line in - ppp.conf: - - set openmode passive - - This tells ppp8 to wait for the server to - initiate LCP negotiations. Some servers however may never - initiate negotiations. In this case, try - something like: - - set openmode active 3 - - This tells ppp8 to be passive for 3 seconds, - and then to start sending LCP requests. If the peer - starts sending requests during this period, ppp8 - will immediately respond rather than waiting for the full - 3 second period. - - - - - - LCP negotiations continue until the connection is - closed. What is wrong? - - - - There is currently an implementation mis-feature in - ppp8 where it does not associate LCP, CCP & - IPCP responses with their original requests. As a result, - if one PPP implementation is more than 6 seconds slower - than the other side, the other side will send two - additional LCP configuration requests. This is - fatal. - - Consider two implementations, - A and B. - A starts sending LCP requests - immediately after connecting and - B takes 7 seconds to start. When - B starts, - A has sent 3 LCP REQs. We are - assuming the line has ECHO switched off, otherwise we - would see magic number problems as described in the - previous section. B sends a REQ, - then an ACK to the first of A's - REQs. This results in A entering - the OPENED state and sending and ACK - (the first) back to B. In the - meantime, B sends back two more - ACKs in response to the two additional REQs sent by - A before - B started up. - B then receives the first ACK - from A and enters the - OPENED state. - A receives the second ACK from - B and goes back to the - REQ-SENT state, sending another (forth) - REQ as per the RFC. It then receives the third ACK and - enters the OPENED state. In the - meantime, B receives the forth - REQ from A, resulting in it - reverting to the ACK-SENT state and - sending another (second) REQ and (forth) ACK as per the - RFC. A gets the REQ, goes into - REQ-SENT and sends another REQ. It - immediately receives the following ACK and enters - OPENED. - - This goes on until one side figures out that they are - getting nowhere and gives up. - - The best way to avoid this is to configure one side to - be passive — that is, make one - side wait for the other to start negotiating. This can be - done with the following command: - - set openmode passive - - Care should be taken with this option. This command - can also be used to limit the amount of time that - ppp8 waits for the peer to begin - negotiations: - - set stopped N - - Alternatively, the following command (where - N is the number of seconds to - wait before starting negotiations) can be used: - - set openmode active N - - Check the manual page for details. - - - - - - Why does ppp8 lock up when I shell out to test - it? - - - - When using shell or - !, ppp8 executes a shell - or the passed arguments. The - ppp program will wait for the - command to complete before continuing. Any attempt to - use the PPP link while running the command will appear as - a frozen link. This is because ppp8 is - waiting for the command to complete. - - To execute commands like this, use - !bg instead. This will execute the - given command in the background, and ppp8 can - continue to service the link. - - - - - - Why does ppp8 over a null-modem cable never - exit? - - - - There is no way for ppp8 to automatically - determine that a direct connection has been dropped. This - is due to the lines that are used in a null-modem serial - cable. When using this sort of connection, LQR should - always be enabled with the following line: - - enable lqr - - LQR is accepted by default if negotiated by the - peer. - - - - - - Why does ppp8 dial for no reason in - mode? - - - - If ppp8 is dialing unexpectedly, - determine the cause, and set up dial filters to - prevent such dialing. - - To determine the cause, use the following line: - - set log +tcp/ip - - This will log all traffic through the connection. The - next time the line comes up unexpectedly, the - reason will be logged with a convenient timestamp next to - it. - - Next, disable dialing under these circumstances. - Usually, this sort of problem arises due to DNS lookups. - To prevent DNS lookups from establishing a connection - (this will not prevent ppp8 - from passing the packets through an established - connection), use the following: - - set dfilter 1 deny udp src eq 53 -set dfilter 2 deny udp dst eq 53 -set dfilter 3 permit 0/0 0/0 - - This is not always suitable, as it will effectively - break demand-dial capabilities. Most programs - will need a DNS lookup before doing any other network - related things. - - In the DNS case, try to determine what is actually - trying to resolve a host name. A lot of the time, - Sendmail is the culprit. Make - sure to configure Sendmail not - to do any DNS lookups in its configuration file. See the - section on using - email with a dialup connection in the FreeBSD - Handbook for details. You may - also want to add the following line to - .mc: - - define(`confDELIVERY_MODE', `d')dnl - - This will make Sendmail - queue everything until the queue is run, usually, - every 30 minutes, or until a sendmail - -q is done, perhaps from - /etc/ppp/ppp.linkup. - - - - - - What do these CCP errors mean? - - - - I keep seeing the following errors in my log - file: - - CCP: CcpSendConfigReq -CCP: Received Terminate Ack (1) state = Req-Sent (6) - - This is because ppp8 is trying to negotiate - Predictor1 compression, but the peer does not want to - negotiate any compression at all. The messages are - harmless, but can be silenced by disabling the - compression: - - disable pred1 - - - - - - Why does ppp8 not log my connection - speed? - - - - To log all lines of the modem - conversation, enable the - following: - - set log +connect - - This will make ppp8 log everything up until the - last requested expect string. - - To see the connect speed when using - PAP or CHAP, - make sure to configure ppp8 to - expect the whole CONNECT line, using something - like this: - - set dial "ABORT BUSY ABORT NO\\sCARRIER TIMEOUT 4 \ - \"\" ATZ OK-ATZ-OK ATDT\\T TIMEOUT 60 CONNECT \\c \\n" - - This gets the CONNECT, sends nothing, then expects a - line-feed, forcing ppp8 to read the whole CONNECT - response. - - - - - - Why does ppp8 ignore the \ - character in my chat script? - - - - The ppp utility parses each - line in its configuration files so that it can interpret - strings such as set phone "123 456 789" - correctly and realize that the number is actually only - one argument. To specify a - " character, escape it - using a backslash (\). - - When the chat interpreter parses each argument, it - re-interprets the argument to find any special escape - sequences such as \P or - \T. As a result - of this double-parsing, remember to use the - correct number of escapes. - - To actually send a \ - character, do something - like: - - set dial "\"\" ATZ OK-ATZ-OK AT\\\\X OK" - - It will result in the following sequence: - - ATZ -OK -AT\X -OK - - Or: - - set phone 1234567 -set dial "\"\" ATZ OK ATDT\\T" - - It will result in the following sequence: - - ATZ -OK -ATDT1234567 - - - - - - What are FCS errors? - - - - FCS stands for Frame Check Sequence. Each PPP packet - has a checksum attached to ensure that the data being - received is the data being sent. If the FCS of an - incoming packet is incorrect, the packet is dropped and - the HDLC FCS count is increased. The HDLC error values - can be displayed using the show hdlc - command. - - If the link is bad or if the serial driver is dropping - packets, it will produce the occasional FCS error. - This is not usually worth worrying about although it does - slow down the compression protocols substantially. - - If the link freezes as soon as it connects and - produces a large number of FCS errors, make sure the modem - is not using software flow control (XON/XOFF). If the - link must use software flow control, use - set accmap 0x000a0000 to - tell ppp8 to escape the ^Q and - ^S characters. - - Another reason for too many FCS errors may be - that the remote end has stopped talking - PPP. In this case, enable - async logging to - determine if the incoming data is actually a login or - shell prompt. If it is a shell prompt at the remote - end, it is possible to terminate ppp8 without - dropping the line by using close lcp - followed by term) to reconnect to - the shell on the remote machine. - - If nothing in the log file indicates why the link - was terminated, ask the remote - administrator or ISP why the session was - terminated. - - - - - - None of this helps — I am desperate! What can I - do? - - - - If all else fails, send the details of the error, the - configuration files, how ppp8 is being started, the - relevant parts of the log file, and the - output of netstat -rn, before and after - connecting, to the FreeBSD general questions mailing list. - - - - - - - Serial Communications - - This section answers common questions about serial - communications with FreeBSD. PPP is covered in the Networking section. - - - - - Which multi-port serial cards are supported by - FreeBSD? - - - - There is a list of these in the Serial - Communications chapter of the Handbook. - - Most multi-port PCI cards that are based on 16550 or - clones are supported with no extra effort. - - Some unnamed clone cards have also been known to work, - especially those that claim to be AST compatible. - - Check uart4 and sio4 to get more - information on configuring such cards. - - - - - - How do I get the boot: prompt to show on the serial - console? - - - - See this - section of the Handbook. - - - - - - How do I tell if FreeBSD found my serial ports or modem - cards? - - - - As the FreeBSD kernel boots, it will probe for the serial - ports for which the kernel is configured. - Either watch the boot messages closely - or run this command after the system is up and - running: - - % grep -E '^(sio|uart)[0-9]' < /var/run/dmesg.boot -sio0: <16550A-compatible COM port> port 0x3f8-0x3ff irq 4 flags 0x10 on acpi0 -sio0: type 16550A -sio1: <16550A-compatible COM port> port 0x2f8-0x2ff irq 3 on acpi0 -sio1: type 16550A - - This example shows two serial ports. The first is on - IRQ4, port address - 0x3f8, and has a 16550A-type UART chip. - The second uses the same kind of chip but is on - IRQ3 and is at port address - 0x2f8. Internal modem cards are - treated just like serial ports, except that they - always have a modem attached to the - port. - - The GENERIC kernel includes - support for two serial ports using the same IRQ and port - address settings in the above example. If these settings - are not right for the system, or if there are more modem - cards or serial ports than the kernel is - configured for, reconfigure using the instructions in - building a kernel - for more details. - - - - - - How do I access the serial ports on FreeBSD? - - - - The third serial port, sio2, - or COM3, - is on /dev/cuad2 for dial-out - devices, and on /dev/ttyd2 for - dial-in devices. What is the difference between these two - classes of devices? - - When - opening /dev/ttydX in blocking mode, - a process will wait for the corresponding - cuadX device to become inactive, and - then wait for the carrier detect line to go active. When - the cuadX device is opened, it makes - sure the serial port is not already in use by the - ttydX device. If the port is - available, it steals it from the - ttydX device. Also, the - cuadX device does not care about - carrier detect. With this scheme and an auto-answer - modem, remote users can log in and local users can still - dial out with the same modem and the system will take care - of all the conflicts. - - - - - - How do I enable support for a multi-port serial - card? - - - - The section on kernel configuration provides - information about configuring the kernel. For a - multi-port serial card, place an sio4 line for each - serial port on the card in the device.hints5 file. - But place the IRQ specifiers on only one of the entries. - All of the ports on the card should share one IRQ. For - consistency, use the last serial port to specify the IRQ. - Also, specify the following option in the kernel - configuration file: - - options COM_MULTIPORT - - The following /boot/device.hints - example is for an AST 4-port serial card on - IRQ 12: - - hint.sio.4.at="isa" -hint.sio.4.port="0x2a0" -hint.sio.4.flags="0x701" -hint.sio.5.at="isa" -hint.sio.5.port="0x2a8" -hint.sio.5.flags="0x701" -hint.sio.6.at="isa" -hint.sio.6.port="0x2b0" -hint.sio.6.flags="0x701" -hint.sio.7.at="isa" -hint.sio.7.port="0x2b8" -hint.sio.7.flags="0x701" -hint.sio.7.irq="12" - - The flags indicate that the master port has minor - number 7 (0x700), - and all the ports share an IRQ - (0x001). - - - - - - Can I set the default serial parameters for a - port? - - - - See the Serial - Communications section in the FreeBSD - Handbook. - - - - - - How can I enable dialup logins on my modem? - - - - Refer to the section about Dial-in - Services in the FreeBSD Handbook. - - - - - - How can I connect a dumb terminal to my FreeBSD - box? - - - - This information is in the Terminals - section of the FreeBSD Handbook. - - - - - - Why can I not run tip or - cu? - - - - The built-in tip1 and - cu1 utilities can only access the - /var/spool/lock directory via user - uucp and group - dialer. - Use the dialer group to control - who has access to the modem or remote systems by adding - user accounts to dialer. - - Alternatively, everyone can be configured to run - tip1 and cu1 by typing: - - # chmod 4511 /usr/bin/cu -# chmod 4511 /usr/bin/tip - - - - - - - Miscellaneous Questions - - - - - FreeBSD uses a lot of swap space even when the computer - has free memory left. Why? - - - - FreeBSD will proactively move entirely idle, unused pages - of main memory into swap in order to make more main memory - available for active use. This heavy use of swap is - balanced by using the extra free memory for - caching. - - Note that while FreeBSD is proactive in this regard, it - does not arbitrarily decide to swap pages when the system - is truly idle. Thus, the system will not be all - paged out after leaving it - idle overnight. - - - - - - Why does top show very little free - memory even when I have very few programs running? - - - - The simple answer is that free memory is wasted - memory. Any memory that programs do not actively - allocate is used within the FreeBSD kernel as disk cache. - The values shown by top1 labeled as - Inact and Laundry - are cached data at different - aging levels. This cached data means the system does not - have to access a slow disk again for data it has accessed - recently, thus increasing overall performance. In - general, a low value shown for Free - memory in top1 is good, provided it is not - very low. - - - - - - Why will chmod not change the - permissions on symlinks? - - - - Symlinks do not have permissions, and by default, - chmod1 will follow symlinks to change the - permissions on the source file, if possible. For - the file, foo with a symlink named - bar, this command - will always succeed. - - % chmod g-w bar - - However, the permissions on bar - will not have changed. - - When changing modes of the file hierarchies rooted in - the files instead of the files themselves, use - either or together - with to make this work. See - chmod1 and symlink7 for more - information. - - - does a - recursive chmod1. Be - careful about specifying directories or symlinks to - directories to chmod1. To change the - permissions of a directory referenced by a symlink, use - chmod1 without any options and follow the symlink - with a trailing slash (/). For - example, if foo is a symlink to - directory bar, to - change the permissions of foo - (actually bar), do - something like: - - % chmod 555 foo/ - - With the trailing slash, chmod1 will follow - the symlink, foo, to change the - permissions of the directory, - bar. - - - - - - - Can I run DOS binaries under FreeBSD? - - - - Yes. A DOS emulation program, - emulators/doscmd, is available in the - FreeBSD Ports Collection. - - If doscmd will not suffice, - emulators/pcemu - emulates an 8088 and enough BIOS services to run many DOS - text-mode applications. It requires the X Window - System. - - The Ports Collection also has - emulators/dosbox. The main focus of - this application is emulating old DOS games using the - local file system for files. - - - - - - What do I need to do to translate a FreeBSD document into - my native language? - - - - See the Translation - FAQ in the FreeBSD Documentation - Project Primer. - - - - - - Why does my email to any address at FreeBSD.org - bounce? - - - - The FreeBSD.org mail - system implements some Postfix - checks on incoming mail and rejects mail that is either - from misconfigured relays or otherwise appears likely to - be spam. Some of the specific requirements are: - - - - The IP address of the SMTP client must - "reverse-resolve" to a forward confirmed - hostname. - - - - The fully-qualified hostname given in the - SMTP conversation (either HELO or EHLO) must resolve - to the IP address of the client. - - - - Other advice to help mail reach its destination - include: - - - - Mail should be sent in plain text, and messages - sent to mailing lists should generally be no more than - 200KB in length. - - - - Avoid excessive cross posting. Choose - one mailing list which seems most - relevant and send it there. - - - - If you still have trouble with email infrastructure at - FreeBSD.org, - send a note with the details to - postmaster@freebsd.org; Include a - date/time interval so that logs may be reviewed — - and note that we only keep one week's worth of mail logs. - (Be sure to specify the time zone or offset from - UTC.) - - - - - - Where can I find a free FreeBSD account? - - - - While FreeBSD does not provide open access to any of - their servers, others do provide open access UNIX - systems. The charge varies and limited services may be - available. - - Arbornet, - Inc, also known as M-Net, - has been providing open access to UNIX systems since - 1983. Starting on an Altos running System III, the site - switched to BSD/OS in 1991. In June of 2000, the site - switched again to FreeBSD. M-Net can be - accessed via telnet and - SSH and provides basic access - to the entire FreeBSD software suite. However, network - access is limited to members and patrons who donate to the - system, which is run as a non-profit organization. - M-Net also provides an bulletin board - system and interactive chat. - - - - - - What is the cute little red guy's name? - - - - He does not have one, and is just called the - BSD daemon. If you insist upon using a name, - call him beastie. Note that - beastie is pronounced - BSD. - - More about the BSD daemon is available on his home - page. - - - - - - Can I use the BSD daemon image? - - - - Perhaps. The BSD daemon is copyrighted by Marshall - Kirk McKusick. Check his Statement - on the Use of the BSD Daemon Figure for detailed - usage terms. - - In summary, the image can be used in a tasteful - manner, for personal use, so long as appropriate credit - is given. Before using the logo commercially, contact - Kirk McKusick mckusick@FreeBSD.org for permission. More details are - available on the BSD - Daemon's home page. - - - - - - Do you have any BSD daemon images I could use? - - - - Xfig and eps drawings are available under - /usr/share/examples/BSD_daemon/. - - - - - - I have seen an acronym or other term on the mailing - lists and I do not understand what it means. Where should - I look? - - - - Refer to the FreeBSD - Glossary. - - - - - - Why should I care what color the bikeshed is? - - - - The really, really short answer is that you should - not. The somewhat longer answer is that just because you - are capable of building a bikeshed does not mean you - should stop others from building one just because you do - not like the color they plan to paint it. This is a - metaphor indicating that you need not argue about every - little feature just because you know enough to do so. - Some people have commented that the amount of noise - generated by a change is inversely proportional to the - complexity of the change. - - The longer and more complete answer is that after a - very long argument about whether sleep1 should take - fractional second arguments, Poul-Henning Kamp phk@FreeBSD.org posted a long - message entitled A - bike shed (any color will do) on greener - grass.... The appropriate portions of - that message are quoted below. - -
- Poul-Henning Kamp phk@FreeBSD.org on freebsd-hackers, October 2, - 1999 - - What is it about this bike shed? - Some of you have asked me. - - It is a long story, or rather it is an old story, - but it is quite short actually. C. Northcote Parkinson - wrote a book in the early 1960s, called - Parkinson's Law, which contains a lot of - insight into the dynamics of management. - - [snip a bit of commentary on the - book] - - In the specific example involving the bike shed, the - other vital component is an atomic power-plant, I guess - that illustrates the age of the book. - - Parkinson shows how you can go into the board of - directors and get approval for building a multi-million - or even billion dollar atomic power plant, but if you - want to build a bike shed you will be tangled up in - endless discussions. - - Parkinson explains that this is because an atomic - plant is so vast, so expensive and so complicated that - people cannot grasp it, and rather than try, they fall - back on the assumption that somebody else checked all - the details before it got this far. Richard P. Feynmann - gives a couple of interesting, and very much to the - point, examples relating to Los Alamos in his - books. - - A bike shed on the other hand. Anyone can build one - of those over a weekend, and still have time to watch - the game on TV. So no matter how well prepared, no - matter how reasonable you are with your proposal, - somebody will seize the chance to show that he is doing - his job, that he is paying attention, that he is - here. - - In Denmark we call it setting your - fingerprint. It is about personal pride and - prestige, it is about being able to point somewhere and - say There! I did - that. It is a strong trait in politicians, but - present in most people given the chance. Just think - about footsteps in wet cement. -
-
-
-
-
- - - The FreeBSD Funnies - - - - - How cool is FreeBSD? - - - - Q. Has anyone done any temperature testing while - running FreeBSD? I know Linux runs cooler than DOS, but - have never seen a mention of FreeBSD. It seems to run really - hot. - - A. No, but we have done numerous taste tests on - blindfolded volunteers who have also had 250 micrograms of - LSD-25 administered beforehand. 35% of the volunteers - said that FreeBSD tasted sort of orange, whereas Linux - tasted like purple haze. Neither group mentioned any - significant variances in temperature. We eventually had - to throw the results of this survey out entirely anyway - when we found that too many volunteers were wandering out - of the room during the tests, thus skewing the results. - We think most of the volunteers are at Apple now, working - on their new scratch and sniff GUI. It is - a funny old business we are in! - - Seriously, FreeBSD uses the HLT (halt) - instruction when the system is idle thus lowering its - energy consumption and therefore the heat it generates. - Also if you have ACPI (Advanced - Configuration and Power Interface) configured, then FreeBSD - can also put the CPU into a low power mode. - - - - - - Who is scratching in my memory banks?? - - - - Q. Is there anything odd that FreeBSD - does when compiling the kernel which would cause the - memory to make a scratchy sound? When compiling (and for - a brief moment after recognizing the floppy drive upon - startup, as well), a strange scratchy sound emanates from - what appears to be the memory banks. - - A. Yes! You will see frequent references to - daemons in the BSD documentation, and what - most people do not know is that this refers to genuine, - non-corporeal entities that now possess your computer. - The scratchy sound coming from your memory is actually - high-pitched whispering exchanged among the daemons as - they best decide how to deal with various system - administration tasks. - - If the noise gets to you, a good fdisk - /mbr from DOS will get rid of them, but do not - be surprised if they react adversely and try to stop you. - In fact, if at any point during the exercise you hear the - satanic voice of Bill Gates coming from the built-in - speaker, take off running and do not ever look back! - Freed from the counterbalancing influence of the BSD - daemons, the twin demons of DOS and Windows are often - able to re-assert total control over your machine to the - eternal damnation of your soul. Now that you know, given - a choice you would probably prefer to get used to the - scratchy noises, no? - - - - - - How many FreeBSD hackers does it take to change a - lightbulb? - - - - One thousand, one hundred and sixty-nine: - - Twenty-three to complain to -CURRENT about the lights - being out; - - Four to claim that it is a configuration problem, and - that such matters really belong on -questions; - - Three to submit PRs about it, one of which is misfiled - under doc and consists only of it's - dark; - - One to commit an untested lightbulb which breaks - buildworld, then back it out five minutes later; - - Eight to flame the PR originators for not including - patches in their PRs; - - Five to complain about buildworld being broken; - - Thirty-one to answer that it works for them, and they - must have updated at a bad time; - - One to post a patch for a new lightbulb to - -hackers; - - One to complain that he had patches for this three - years ago, but when he sent them to -CURRENT they were - just ignored, and he has had bad experiences with the PR - system; besides, the proposed new lightbulb is - non-reflexive; - - Thirty-seven to scream that lightbulbs do not belong - in the base system, that committers have no right to do - things like this without consulting the Community, and - WHAT IS -CORE DOING ABOUT IT!? - - Two hundred to complain about the color of the bicycle - shed; - - Three to point out that the patch breaks - style9; - - Seventeen to complain that the proposed new lightbulb - is under GPL; - - Five hundred and eighty-six to engage in a flame war - about the comparative advantages of the GPL, the BSD - license, the MIT license, the NPL, and the personal - hygiene of unnamed FSF founders; - - Seven to move various portions of the thread to -chat - and -advocacy; - - One to commit the suggested lightbulb, even though it - shines dimmer than the old one; - - Two to back it out with a furious flame of a commit - message, arguing that FreeBSD is better off in the dark than - with a dim lightbulb; - - Forty-six to argue vociferously about the backing out - of the dim lightbulb and demanding a statement from - -core; - - Eleven to request a smaller lightbulb so it will fit - their Tamagotchi if we ever decide to port FreeBSD to that - platform; - - Seventy-three to complain about the SNR on -hackers - and -chat and unsubscribe in protest; - - Thirteen to post unsubscribe, - How do I unsubscribe?, or Please - remove me from the list, followed by the usual - footer; - - One to commit a working lightbulb while everybody is - too busy flaming everybody else to notice; - - Thirty-one to point out that the new lightbulb would - shine 0.364% brighter if compiled with TenDRA (although it - will have to be reshaped into a cube), and that FreeBSD - should therefore switch to TenDRA instead of GCC; - - One to complain that the new lightbulb lacks - fairings; - - Nine (including the PR originators) to ask what - is MFC?; - - Fifty-seven to complain about the lights being out two - weeks after the bulb has been changed. - - Nik Clayton nik@FreeBSD.org adds: - - I was laughing quite hard at - this. - - And then I thought, Hang on, - shouldn't there be '1 to document it.' in that list - somewhere? - - And then I was enlightened - :-) - - Thomas Abthorpe tabthorpe@FreeBSD.org says: - None, real FreeBSD hackers are - not afraid of the dark! - - - - - - Where does data written to - /dev/null go? - - - - It goes into a special data sink in the CPU where it - is converted to heat which is vented through the heatsink - / fan assembly. This is why CPU cooling is increasingly - important; as people get used to faster processors, they - become careless with their data and more and more of it - ends up in /dev/null, overheating - their CPUs. If you delete /dev/null - (which effectively disables the CPU data sink) your CPU - may run cooler but your system will quickly become - constipated with all that excess data and start to behave - erratically. If you have a fast network connection you - can cool down your CPU by reading data out of - /dev/random and sending it off - somewhere; however you run the risk of overheating your - network connection and / or angering - your ISP, as most of the data will end up getting - converted to heat by their equipment, but they generally - have good cooling, so if you do not overdo it you should - be OK. - - Paul Robinson adds: - - There are other methods. As every good sysadmin - knows, it is part of standard practice to send data to the - screen of interesting variety to keep all the pixies that - make up your picture happy. Screen pixies (commonly - mis-typed or re-named as pixels) are - categorized by the type of hat they wear (red, green or - blue) and will hide or appear (thereby showing the color - of their hat) whenever they receive a little piece of - food. Video cards turn data into pixie-food, and then - send them to the pixies — the more expensive the - card, the better the food, so the better behaved the - pixies are. They also need constant stimulation — - this is why screen savers exist. - - To take your suggestions further, you could just throw - the random data to console, thereby letting the pixies - consume it. This causes no heat to be produced at all, - keeps the pixies happy and gets rid of your data quite - quickly, even if it does make things look a bit messy on - your screen. - - Incidentally, as an ex-admin of a large ISP who - experienced many problems attempting to maintain a stable - temperature in a server room, I would strongly discourage - people sending the data they do not want out to the - network. The fairies who do the packet switching and - routing get annoyed by it as well. - - - - - - My colleague sits at the computer too much, how - can I prank her? - - - - Install games/sl and - wait for her to mistype sl for - ls. - - - - - - - Advanced Topics - - - - - How can I learn more about FreeBSD's internals? - - - - See the FreeBSD - Architecture Handbook. - - Additionally, much general UNIX knowledge is - directly applicable to FreeBSD. - - - - - - How can I contribute to FreeBSD? What can I do to - help? - - - - We accept all types of contributions: documentation, - code, and even art. See the article on Contributing - to FreeBSD for specific advice on how to do - this. - - And thanks for the thought! - - - - - - What are snapshots and releases? - - - - There are currently 2 active/semi-active - branches in the FreeBSD Subversion - Repository. (Earlier branches are only changed - very rarely, which is why there are only 2 - active branches of development): - - - - stable/11/ AKA - 11-STABLE - - - - stable/12/ AKA - 12-STABLE - - - - head/ AKA - -CURRENT AKA - 12-CURRENT - - - - HEAD is not an actual branch tag. - It is a symbolic constant for - the current, non-branched development - stream known as - -CURRENT. - - Right now, -CURRENT is the - 13.X development stream; the 12-STABLE - branch, stable/12/, forked off from - -CURRENT in December 2018 and the - 11-STABLE branch, stable/11/, forked off from - -CURRENT in October 2016. - - - - - - How can I make the most of the data I see when my - kernel panics? - - - - Here is typical kernel panic: - - Fatal trap 12: page fault while in kernel mode -fault virtual address = 0x40 -fault code = supervisor read, page not present -instruction pointer = 0x8:0xf014a7e5 -stack pointer = 0x10:0xf4ed6f24 -frame pointer = 0x10:0xf4ed6f28 -code segment = base 0x0, limit 0xfffff, type 0x1b - = DPL 0, pres 1, def32 1, gran 1 -processor eflags = interrupt enabled, resume, IOPL = 0 -current process = 80 (mount) -interrupt mask = -trap number = 12 -panic: page fault - - This message is not enough. While the instruction - pointer value is important, it is also configuration - dependent as it varies depending on the kernel image. - If it is a GENERIC kernel - image from one of the snapshots, it is possible for - somebody else to track down the offending function, but - for a custom kernel, only you can tell us where the fault - occurred. - - To proceed: - - - - Write down the instruction pointer value. Note - that the 0x8: part at the beginning - is not significant in this case: it is the - 0xf0xxxxxx part that we - want. - - - - When the system reboots, do the following: - - % nm -n kernel.that.caused.the.panic | grep f0xxxxxx - - where f0xxxxxx is the - instruction pointer value. The odds are you will not - get an exact match since the symbols in the kernel - symbol table are for the entry points of functions and - the instruction pointer address will be somewhere - inside a function, not at the start. If you do not - get an exact match, omit the last digit from the - instruction pointer value and try again: - - % nm -n kernel.that.caused.the.panic | grep f0xxxxx - - If that does not yield any results, chop off - another digit. Repeat until there is some sort of - output. The result will be a possible list of - functions which caused the panic. This is a less than - exact mechanism for tracking down the point of - failure, but it is better than nothing. - - - - However, the best way to track down the cause of a - panic is by capturing a crash dump, then using - kgdb1 to generate a stack trace on the crash - dump. - - In any case, the method is this: - - - - Make sure that the following line is included in - the kernel configuration file: - - makeoptions DEBUG=-g # Build kernel with gdb(1) debug symbols - - - - Change to the /usr/src - directory: - - # cd /usr/src - - - - Compile the kernel: - - # make buildkernel KERNCONF=MYKERNEL - - - - Wait for make1 to finish compiling. - - - - # make installkernel KERNCONF=MYKERNEL - - - - Reboot. - - - - - If KERNCONF is not included, - the GENERIC kernel will instead - be built and installed. - - - The make1 process will have built two kernels. - /usr/obj/usr/src/sys/MYKERNEL/kernel - and - /usr/obj/usr/src/sys/MYKERNEL/kernel.debug. - kernel was installed as - /boot/kernel/kernel, while - kernel.debug can be used as the - source of debugging symbols for kgdb1. - - To capture a crash dump, edit - /etc/rc.conf and set - dumpdev to point to either the swap - partition or AUTO. This will cause the - rc8 scripts to use the dumpon8 command to - enable crash dumps. This command can also be run - manually. After a panic, the crash dump can be recovered - using savecore8; if dumpdev is - set in /etc/rc.conf, the rc8 - scripts will run savecore8 automatically and put - the crash dump in /var/crash. - - - FreeBSD crash dumps are usually the same size as - physical RAM. Therefore, make sure there is enough - space in /var/crash to hold the - dump. Alternatively, run savecore8 manually - and have it recover the crash dump to another directory - with more room. It is possible to limit the - size of the crash dump by using options - MAXMEM=N where - N is the size of kernel's - memory usage in KBs. For example, for 1 GB - of RAM, limit the kernel's memory usage to - 128 MB, so that the crash dump size - will be 128 MB instead of 1 GB. - - - Once the crash dump has been recovered , get a - stack trace as follows: - - % kgdb /usr/obj/usr/src/sys/MYKERNEL/kernel.debug /var/crash/vmcore.0 -(kgdb) backtrace - - Note that there may be several screens worth of - information. Ideally, use script1 to - capture all of them. Using the unstripped kernel image - with all the debug symbols should show the exact line of - kernel source code where the panic occurred. The stack - trace is usually read from the bottom up to trace - the exact sequence of events that lead to the crash. - kgdb1 can also be used to print out the contents of - various variables or structures to examine the system - state at the time of the crash. - - - If a second computer is available, kgdb1 can - be configured to do remote debugging, including setting - breakpoints and single-stepping through the kernel - code. - - - - If DDB is enabled and the - kernel drops into the debugger, a panic - and a crash dump can be forced by typing - panic at the ddb - prompt. It may stop in the debugger again during the - panic phase. If it does, type - continue and it will finish the crash - dump. - - - - - - - Why has dlsym() stopped working - for ELF executables? - - - - The ELF toolchain does not, by default, make the - symbols defined in an executable visible to the dynamic - linker. Consequently dlsym() - searches on handles obtained from calls to - dlopen(NULL, flags) will fail to find - such symbols. - - To search, using - dlsym(), for symbols present in the - main executable of a process, link the - executable using the - option to the ELF linker (ld1). - - - - - - How can I increase or reduce the kernel address space - on i386? - - - - By default, the kernel address space is 1 GB - (2 GB for PAE) for i386. When running a - network-intensive server or using - ZFS, this will probably not be - enough. - - Add the following line to the kernel configuration - file to increase available space and rebuild the - kernel: - - options KVA_PAGES=N - - To find the correct value of - N, divide the desired address - space size (in megabytes) by four. (For example, it is - 512 for 2 GB.) - - - - - - - Acknowledgments - - This innocent little Frequently Asked Questions document has - been written, rewritten, edited, folded, spindled, mutilated, - eviscerated, contemplated, discombobulated, cogitated, - regurgitated, rebuilt, castigated, and reinvigorated over the - last decade, by a cast of hundreds if not thousands. - Repeatedly. - - We wish to thank every one of the people responsible, and we - encourage you to join - them in making this FAQ even - better. - -
diff --git a/zh_TW.UTF-8/books/faq/zh_TW.po b/zh_TW.UTF-8/books/faq/zh_TW.po deleted file mode 100644 index fd4dd53bad..0000000000 --- a/zh_TW.UTF-8/books/faq/zh_TW.po +++ /dev/null @@ -1,7846 +0,0 @@ -# $FreeBSD$ -msgid "" -msgstr "" -"Project-Id-Version: \n" -"POT-Creation-Date: 2019-10-03 17:21+0800\n" -"PO-Revision-Date: 2019-10-31 22:30+0800\n" -"Last-Translator: \n" -"Language-Team: \n" -"Language: zh_TW\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"X-Generator: Poedit 2.2.4\n" - -#. Put one translator per line, in the form NAME , YEAR1, YEAR2 -msgctxt "_" -msgid "translator-credits" -msgstr "translator-credits" - -#. (itstool) path: info/title -#: book.translate.xml:19 -msgid "Frequently Asked Questions for FreeBSD 11.X and 12.X" -msgstr "FreeBSD 11.X and 12.X 常見問答集" - -#. (itstool) path: info/author -#: book.translate.xml:22 -msgid "The FreeBSD Documentation Project" -msgstr "FreeBSD 文件計畫" - -#. (itstool) path: info/copyright -#: book.translate.xml:24 -msgid "" -"1995 1996 1997 1998 1999 2000 2001 2002 " -"2003 2004 2005 2006 2007 2008 2009 2010 " -"2011 2012 2013 2014 2015 2016 2017 2018 " -"2019 The FreeBSD Documentation Project" -msgstr "" -"1995 1996 1997 1998 1999 2000 2001 2002 " -"2003 2004 2005 2006 2007 2008 2009 2010 " -"2011 2012 2013 2014 2015 2016 2017 2018 " -"2019 The FreeBSD Documentation Project" - -#. (itstool) path: legalnotice/title -#: book.translate.xml:56 -msgid "Copyright" -msgstr "版權所有" - -#. (itstool) path: legalnotice/para -#: book.translate.xml:58 -msgid "" -"Redistribution and use in source (XML DocBook) and 'compiled' forms (XML, HTML, PDF, PostScript, RTF and so forth) with or without modification, are " -"permitted provided that the following conditions are met:" -msgstr "" - -#. (itstool) path: listitem/para -#: book.translate.xml:65 -msgid "" -"Redistributions of source code (XML DocBook) must retain the above copyright notice, this list of conditions and the following disclaimer as the first " -"lines of this file unmodified." -msgstr "" - -#. (itstool) path: listitem/para -#: book.translate.xml:71 -msgid "" -"Redistributions in compiled form (transformed to other DTDs, converted to PDF, PostScript, RTF and other formats) must reproduce the above copyright " -"notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution." -msgstr "" - -#. (itstool) path: important/para -#: book.translate.xml:80 -msgid "" -"THIS DOCUMENTATION IS PROVIDED BY THE FREEBSD DOCUMENTATION PROJECT \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE " -"IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FREEBSD DOCUMENTATION PROJECT BE " -"LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE " -"GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT " -"LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS DOCUMENTATION, EVEN IF ADVISED OF THE POSSIBILITY OF " -"SUCH DAMAGE." -msgstr "" - -#. (itstool) path: legalnotice/para -#: book.translate.xml:97 -msgid "FreeBSD is a registered trademark of the FreeBSD Foundation." -msgstr "FreeBSD 是 FreeBSD基金會的註冊商標。" - -#. (itstool) path: legalnotice/para -#: book.translate.xml:99 -msgid "" -"Adobe, Acrobat, Acrobat Reader, Flash and PostScript are either registered trademarks or trademarks of Adobe Systems Incorporated in the United States " -"and/or other countries." -msgstr "Adobe, Acrobat, Acrobat Reader, 以及 PostScript 是 Adobe Systems Incorporated 在美國和/或其他國家的商標或註冊商標。" - -#. (itstool) path: legalnotice/para -#: book.translate.xml:103 -msgid "" -"IBM, AIX, OS/2, PowerPC, PS/2, S/390, and ThinkPad are trademarks of International Business Machines Corporation in the United States, other countries, " -"or both." -msgstr "IBM, AIX, OS/2, PowerPC, PS/2, S/390, 和 ThinkPad 是 國際商用機器公司在美國和其他國家的註冊商標或商標。" - -#. (itstool) path: legalnotice/para -#: book.translate.xml:107 -msgid "IEEE, POSIX, and 802 are registered trademarks of Institute of Electrical and Electronics Engineers, Inc. in the United States." -msgstr "IEEE, POSIX, 和 802 是 Institute of Electrical and Electronics Engineers, Inc. 在美國的註冊商標。" - -#. (itstool) path: legalnotice/para -#: book.translate.xml:110 -msgid "" -"Intel, Celeron, Centrino, Core, EtherExpress, i386, i486, Itanium, Pentium, and Xeon are trademarks or registered trademarks of Intel Corporation or " -"its subsidiaries in the United States and other countries." -msgstr "" -"Intel, Celeron, Centrino, Core, EtherExpress, i386, i486, Itanium, Pentium, 和 Xeon 是 Intel Corporation 及其分支機構在美國和其他國家的商標或註冊商標。" - -#. (itstool) path: legalnotice/para -#: book.translate.xml:114 -msgid "Linux is a registered trademark of Linus Torvalds." -msgstr "Linux 是 Linus Torvalds 的註冊商標。" - -#. (itstool) path: legalnotice/para -#: book.translate.xml:116 -msgid "" -"Microsoft, IntelliMouse, MS-DOS, Outlook, Windows, Windows Media and Windows NT are either registered trademarks or trademarks of Microsoft Corporation " -"in the United States and/or other countries." -msgstr "Microsoft, IntelliMouse, MS-DOS, Outlook, Windows, Windows Media, 和 Windows NT 是 Microsoft Corporation 在美國和/或其他國家的商標或註冊商標。" - -#. (itstool) path: legalnotice/para -#: book.translate.xml:120 -msgid "NetBSD is a registered trademark of the NetBSD Foundation." -msgstr "NetBSD 是 NetBSD基金會的註冊商標。" - -#. (itstool) path: legalnotice/para -#: book.translate.xml:122 -msgid "" -"Motif, OSF/1, and UNIX are registered trademarks and IT DialTone and The Open Group are trademarks of The Open Group in the United States and other " -"countries." -msgstr "Motif, OSF/1, and UNIX are registered trademarks and IT DialTone and The Open Group 是 The Open Group 在美國和其他國家的商標。" - -#. (itstool) path: legalnotice/para -#: book.translate.xml:126 -msgid "Silicon Graphics, SGI, and OpenGL are registered trademarks of Silicon Graphics, Inc., in the United States and/or other countries worldwide." -msgstr "Silicon Graphics, SGI, 和 OpenGL 是 Silicon Graphics, Inc. 在美國和/或其他國家的註冊商標。" - -#. (itstool) path: legalnotice/para -#: book.translate.xml:129 -msgid "" -"Sun, Sun Microsystems, Java, Java Virtual Machine, JDK, JRE, JSP, JVM, Netra, OpenJDK, Solaris, StarOffice, SunOS and VirtualBox are trademarks or " -"registered trademarks of Sun Microsystems, Inc. in the United States and other countries." -msgstr "" -"Sun, Sun Microsystems, Java, Java Virtual Machine, JDK, JRE, JSP, JVM, Netra, OpenJDK, Solaris, StarOffice, SunOS and VirtualBox 是 Sun Microsystems, " -"Inc. 在美國和其他國家的註冊商標。" - -#. (itstool) path: legalnotice/para -#: book.translate.xml:134 -msgid "" -"Many of the designations used by manufacturers and sellers to distinguish their products are claimed as trademarks. Where those designations appear in " -"this document, and the FreeBSD Project was aware of the trademark claim, the designations have been followed by the or the ® symbol." -msgstr "" -"許多製造商和經銷商使用一些稱為商標的圖案或文字設計來彰顯自己的產品。 本文中出現的眾多商標,以及 FreeBSD Project 本身廣所人知的商標,後面將以® 符號來標註。" - -#. (itstool) path: info/releaseinfo -#: book.translate.xml:142 -msgid "$FreeBSD$" -msgstr "" - -#. (itstool) path: abstract/para -#: book.translate.xml:145 -msgid "" -"This is the Frequently Asked Questions (FAQ) for FreeBSD versions 12.X and 11.X. Every effort has been made to make this FAQ as informative as possible; if you have any suggestions as to how it may " -"be improved, send them to the FreeBSD documentation project mailing list." -msgstr "" -"這份文件是 FreeBSD 12.X 和 11.X 常見問答集 ( (FAQ) )。我們盡可能地讓這份 " -"FAQ 提供有用的資訊 ; 如果您有任何改善建議,請寄到 FreeBSD " -"文件計畫郵件論壇。" - -#. (itstool) path: abstract/para -#: book.translate.xml:152 -msgid "" -"The latest version of this document is always available from the FreeBSD website. It may also be downloaded as one large HTML file with HTTP or as a variety of other " -"formats from the FreeBSD FTP server." -msgstr "" -"本文件的最新版本可由 FreeBSD 網站取得。 也可以由 FreeBSD FTP 伺服器 以 HTTP 下載單一大型 HTML 檔或是其他格" -"式的檔案。" - -#. (itstool) path: chapter/title -#: book.translate.xml:162 -msgid "Introduction" -msgstr "前言" - -#. (itstool) path: question/para -#: book.translate.xml:167 -msgid "What is FreeBSD?" -msgstr "什麼是 FreeBSD?" - -#. (itstool) path: answer/para -#: book.translate.xml:171 -msgid "" -"FreeBSD is a modern operating system for desktops, laptops, servers, and embedded systems with support for a large number of platforms." -msgstr "" -"FreeBSD 是一個使用於桌機、筆電、伺服器與嵌入式系統平台的現代作業系統,支援多種平台。" - -#. (itstool) path: answer/para -#: book.translate.xml:175 -msgid "" -"It is based on U.C. Berkeley's 4.4BSD-Lite release, with some 4.4BSD-Lite2 enhancements. It is also based indirectly on " -"William Jolitz's port of U.C. Berkeley's Net/2 to the i386, known as 386BSD, though very little of " -"the 386BSD code remains." -msgstr "" -"它是根據 U.C. Berkeley 所開發出來的 4.4BSD-Lite ,並加上了許多 4.4BSD-Lite2 的增強功能。它同時也間接使用了 U.C. Berkeley " -"所開發出來並由 William Jolitz 移植到 i386Net/2,也就是 386BSD,不過現在 386BSD 的程式碼只剩下極" -"少數還留 存在 FreeBSD 中。" - -#. (itstool) path: answer/para -#: book.translate.xml:183 -msgid "" -"FreeBSD is used by companies, Internet Service Providers, researchers, computer professionals, students and home users all over the world in their " -"work, education and recreation." -msgstr "FreeBSD 已被廣泛地被世界各地的公司行號、ISP、研究人員、電腦 專家、學生,以及家庭用戶所使用,用在工作、教育以及娛樂上。" - -#. (itstool) path: answer/para -#: book.translate.xml:188 -msgid "" -"For more detailed information on FreeBSD, refer to the FreeBSD " -"Handbook." -msgstr "" -"如果想看關於 FreeBSD 更深入的資料,請看 FreeBSD 使用手冊。" - -#. (itstool) path: question/para -#: book.translate.xml:196 -msgid "What is the goal of the FreeBSD Project?" -msgstr "發展 FreeBSD 計畫的目的是什麼?" - -#. (itstool) path: answer/para -#: book.translate.xml:200 -msgid "" -"The goal of the FreeBSD Project is to provide a stable and fast general purpose operating system that may be used for any purpose without strings " -"attached." -msgstr "FreeBSD 計畫的目的是提供可以任意使用且沒有限制的穩定快速與一般用途的作業系統。" - -#. (itstool) path: question/para -#: book.translate.xml:208 -msgid "Does the FreeBSD license have any restrictions?" -msgstr "FreeBSD 版權有任何限制嗎?" - -#. (itstool) path: answer/para -#: book.translate.xml:212 -msgid "" -"Yes. Those restrictions do not control how the code is used, but how to treat the FreeBSD Project itself. The license itself is available at license and can be summarized like this:" -msgstr "" -"有的。但是這並不是限制你怎麼去使用這些程式碼,而是你怎麼看待 FreeBSD 這個計畫。可以在此閱讀 版權本文,簡單來說總結如下:" - -#. (itstool) path: listitem/para -#: book.translate.xml:220 -msgid "Do not claim that you wrote this." -msgstr "請勿宣稱是您寫了這個程式。" - -#. (itstool) path: listitem/para -#: book.translate.xml:224 -msgid "Do not sue us if it breaks." -msgstr "如果它出問題了,不要控告我們。" - -#. (itstool) path: listitem/para -#: book.translate.xml:228 -msgid "Do not remove or modify the license." -msgstr "不要移除和修改版權" - -#. (itstool) path: answer/para -#: book.translate.xml:232 -msgid "" -"Many of us have a significant investment in the project and would certainly not mind a little financial compensation now and then, but we definitely do " -"not insist on it. We believe that our first and foremost mission is to provide code to any and all comers, and for whatever purpose, so " -"that the code gets the widest possible use and provides the widest possible benefit. This, we believe, is one of the most fundamental goals of Free " -"Software and one that we enthusiastically support." -msgstr "" -"我們許多人在這個計畫投入很多心血,並不會介意獲得一些財務上的報酬,但是我們並沒有堅持一定要有。我們相信我們首要的任務是將程式碼提供給所有" -"使用者,無論他們有任何的目的,這麼一來,這些程式碼才能被用在最多地方,也才能發揮它們最大的利益。我們相信這就是自由軟體最基本的目標之一,而且我們會盡全力" -"去支持它。" - -#. (itstool) path: answer/para -#: book.translate.xml:243 -msgid "" -"Code in our source tree which falls under the GNU General Public License (GPL) or " -"GNU Library General Public License (LGPL) comes with slightly more strings " -"attached, though at least on the side of enforced access rather than the usual opposite. Due to the additional complexities that can evolve in the " -"commercial use of GPL software, we do, however, endeavor to replace such software with submissions under the more relaxed FreeBSD license whenever possible." -msgstr "" -"在我們 source tree 中有部份的程式碼是採用所謂的GNU General Public License (GPL) " -"或 GNU Library General Public License (LGPL)版權宣告,雖然這些版權宣告是用來保" -"障而非限制使用者的權 利,畢竟是不那麼自由了些。由於這些 GPL 的軟體在商業使用上會引起 非常複雜的版權問題,因此只要有機會,我們會盡量以採用比較鬆的 FreeBSD 版權 的軟體來取代這些 GPL 版權宣告的軟體。" - -#. (itstool) path: question/para -#: book.translate.xml:258 -msgid "Can FreeBSD replace my current operating system?" -msgstr "FreeBSD 可以取代我現在在用的作業系統嗎?" - -#. (itstool) path: answer/para -#: book.translate.xml:262 -msgid "For most people, yes. But this question is not quite that cut-and-dried." -msgstr "對大部份的人來說是這樣沒錯,但事實上這問題並沒有這麼好回答。" - -#. (itstool) path: answer/para -#: book.translate.xml:265 -msgid "" -"Most people do not actually use an operating system. They use applications. The applications are what really use the operating system. FreeBSD is " -"designed to provide a robust and full-featured environment for applications. It supports a wide variety of web browsers, office suites, email readers, " -"graphics programs, programming environments, network servers, and much more. Most of these applications can be managed through the Ports Collection." -msgstr "" -"大部份的人並不是真正在使用一個作業系統。他們使用的是應用程式 ;而那些應用程式才是真正用到作業系統的東西。FreeBSD 是設計用來提供一個強韌且功能完整的作業" -"環境給應用程式來執行。它支援了多種瀏覽器,辦公室套件軟體,電子郵件閱讀軟體,繪圖程式,程式設計環境,網路伺服器軟體,以及幾乎所有你想要的東西。大部份的程" -"式都可以靠 Ports Collection 來管理。" - -#. (itstool) path: answer/para -#: book.translate.xml:276 -msgid "" -"If an application is only available on one operating system, that operating system cannot just be replaced. Chances are, there is a very similar " -"application on FreeBSD, however. As a solid office or Internet server or a reliable workstation, FreeBSD will almost certainly do everything you need. " -"Many computer users across the world, including both novices and experienced UNIX administrators, use " -"FreeBSD as their only desktop operating system." -msgstr "" -"但是如果你想要使用的應用程式只能在某個特定的作業系統上面執行 的話,你就不能輕易地把它換掉,或者指望在 FreeBSD 上有很相似的應用程式才有機會。如果你想要的" -"是一個強健的辦公室或是網路伺服器,或是一部穩定的工作站,FreeBSD 無疑是您的最佳選擇。世界各地有很多使用者,包括初學或資深的 UNIX 管理人員都選用 FreeBSD 當他們唯一的桌上作業系統。" - -#. (itstool) path: answer/para -#: book.translate.xml:286 -msgid "" -"Users migrating to FreeBSD from another UNIX-like environment will find FreeBSD to be similar. Windows and Mac OS users may be interested in instead using TrueOS, a FreeBSD-based desktop distribution. Non-UNIX users should " -"expect to invest some additional time learning the UNIX way of doing things. This FAQ " -"and the FreeBSD Handbook are excellent places to start." -msgstr "" -"如果你是從其他的 UNIX-like 環境轉換到 FreeBSD 的話會很熟悉。 Windows 或是 Mac OS 的使用者可能會對 TrueOS 有興趣,他" -"是基於 FreeBSD 的一個桌面環境發行版,非UNIX 使用者可能就要多花一點時間來學習怎麼用 UNIX 的 方法來做事。你可以從這份 FAQFreeBSD 使用手冊 來入門。" - -#. (itstool) path: question/para -#: book.translate.xml:300 -msgid "Why is it called FreeBSD?" -msgstr "為什麼要叫做 FreeBSD?" - -#. (itstool) path: listitem/para -#: book.translate.xml:306 -msgid "It may be used free of charge, even by commercial users." -msgstr "您可以免費使用它,即使是用於商業用途。" - -#. (itstool) path: listitem/para -#: book.translate.xml:311 -msgid "" -"Full source for the operating system is freely available, and the minimum possible restrictions have been placed upon its use, distribution and " -"incorporation into other work (commercial or non-commercial)." -msgstr "整個 FreeBSD 作業系統完整的原始程式都可以免費取得,而且不管是在使用,散佈或是整合進其他程式等各方面也只受到最小的限制 (不論是否用於商業用途)。" - -#. (itstool) path: listitem/para -#: book.translate.xml:319 -msgid "" -"Anyone who has an improvement or bug fix is free to submit their code and have it added to the source tree (subject to one or two obvious provisions)." -msgstr "任何人都可以自由地把他對系統的改良或錯誤修正的程式碼加入 source tree 之中 (當然要符合幾個先決條件)。" - -#. (itstool) path: answer/para -#: book.translate.xml:326 -msgid "" -"It is worth pointing out that the word free is being used in two ways here: one meaning at no cost and the other meaning " -"do whatever you like. Apart from one or two things you cannot do with the FreeBSD code, for example pretending you " -"wrote it, you can really do whatever you like with it." -msgstr "" -"特別值得注意的是這裡的 “free” 出現了兩次,而且它們 的意思是不一樣的:一種代表 “免費”,另一種代表 “自由”。您可以拿 FreeBSD 去做任何您想要做的事,除了一些" -"例外,例如您宣稱 FreeBSD 是您寫的。" - -#. (itstool) path: question/para -#: book.translate.xml:338 -msgid "What are the differences between FreeBSD and NetBSD, OpenBSD, and other open source BSD operating systems?" -msgstr "FreeBSD 及 NetBSD, OpenBSD 以及其他 open source BSD 作業系統之間有何不同之處呢?" - -#. (itstool) path: answer/para -#: book.translate.xml:344 -msgid "" -"James Howard wrote a good explanation of the history and differences between the various projects, called The BSD Family Tree which goes a fair way to answering this question. Some of the information is out of date, but " -"the history portion in particular remains accurate." -msgstr "" -"James Howard 寫了一篇關於不同計畫的差異和歷史淵源的好文章叫 The BSD Family " -"Tree 可以回答這個問題。雖然有些資訊有點過時,但是關於歷史淵源的部份仍是相當正確的。" - -#. (itstool) path: answer/para -#: book.translate.xml:351 -msgid "Most of the BSDs share patches and code, even today. All of the BSDs have common ancestry." -msgstr "時至今日,大部分的 BSD 家族仍是共用修補和程式碼的。這些 BSD 家族有著共同的祖先。" - -#. (itstool) path: answer/para -#: book.translate.xml:354 -msgid "" -"The design goals of FreeBSD are described in , above. The design goals of the other most popular BSDs may be " -"summarized as follows:" -msgstr " FreeBSD 的設計目的如 所述。其他 BSD 家族的設計目的如下所述:" - -#. (itstool) path: listitem/para -#: book.translate.xml:360 -msgid "" -"OpenBSD aims for operating system security above all else. The OpenBSD team wrote ssh1 and pf4, which have both been ported to " -"FreeBSD." -msgstr "" -"OpenBSD 目標在作業系統的安全性。OpenBSD團隊寫的 ssh1 和 " -"pf4 都移植到了 FreeBSD。" - -#. (itstool) path: listitem/para -#: book.translate.xml:367 -msgid "NetBSD aims to be easily ported to other hardware platforms." -msgstr "NetBSD 目標在易於移植到其他的硬體平台。" - -#. (itstool) path: listitem/para -#: book.translate.xml:372 -msgid "" -"DragonFly BSD is a fork of FreeBSD 4.8 that has since developed many interesting features of its own, including the HAMMER file system and support for " -"user-mode vkernels." -msgstr "DragonFly BSD 是 FreeBSD 4.8 的一個分支,發展出許多有趣的特色,包括 HAMMER 檔案系統和支援 vkernels 使用者模式。" - -#. (itstool) path: question/para -#: book.translate.xml:383 -msgid "What is the latest version of FreeBSD?" -msgstr "最新版的 FreeBSD 是那一版?" - -#. (itstool) path: answer/para -#: book.translate.xml:387 -msgid "" -"At any point in the development of FreeBSD, there can be multiple parallel branches. 12.X releases are made from the " -"12-STABLE branch, and 11.X releases are made from the 11-STABLE branch." -msgstr "" -"在 FreeBSD 開發的任何時間點,都有多個平行的分支。12.X releases 是從 12-STABLE 分支而來,而 11." -"X releases 是從 11-STABLE 分支而來。" - -#. (itstool) path: answer/para -#: book.translate.xml:392 -msgid "" -"Up until the release of 9.0, the 11.X series was the one known as -STABLE. However, as of 13." -"X, the 11.X branch will be designated for an extended support status and receive " -"only fixes for major problems, such as security-related fixes." -msgstr "" -"在 9.0 之前,11.X 系列仍屬 -STABLE分支。 然而從13.X 發行開始,11." -"X 將只著重在重大問題上(比如:漏洞修補、安全維護)以及所謂的 extended support 。" - -#. (itstool) path: answer/para -#: book.translate.xml:403 -msgid "" -"Version 12.0 is the latest release from the " -"12-STABLE branch; it was released in December 2018. Version 11.2 is the latest release from the 11-STABLE branch; it was released in June 2018." -msgstr "" -"於 2018年12月所發行的 12.0 是目前最新的 12-" -"STABLE 分支。 於 2019年7月所發行的 11.3是目前" -"最新的 11-STABLE 分支。" - -#. (itstool) path: answer/para -#: book.translate.xml:409 -msgid "" -"Releases are made every few months. While many people stay more up-to-date with the FreeBSD sources (see the " -"questions on FreeBSD-CURRENT and FreeBSD-STABLE) than that, doing so is more of a " -"commitment, as the sources are a moving target." -msgstr "" -"Releases 版 每幾個月 才會發行一次。 雖然如此,有很多人和 FreeBSD 原始碼同步更新 (詳見 FreeBSD-CURRENT 和 FreeBSD-STABLE的相關問題) ,但因為原始碼是一直不斷地在變動的,所以如果要這麼做的話得要花上" -"更多的精力。" - -#. (itstool) path: answer/para -#: book.translate.xml:416 -msgid "" -"More information on FreeBSD releases can be found on the Release " -"Engineering page and in release7." -msgstr "" -"其他更多相關 FreeBSD 發行情報,可由 FreeBSD 網站上的 Release Engineering " -"頁面 和 release7得知。" - -#. (itstool) path: question/para -#: book.translate.xml:424 -msgid "What is FreeBSD-CURRENT?" -msgstr "什麼是 FreeBSD-CURRENT?" - -#. (itstool) path: answer/para -#: book.translate.xml:428 -msgid "" -"FreeBSD-CURRENT is the development version " -"of the operating system, which will in due course become the new FreeBSD-STABLE branch. As such, it is really only of interest to developers working on " -"the system and die-hard hobbyists. See the relevant section in the Handbook for details on " -"running -CURRENT." -msgstr "" -"FreeBSD-CURRENT 指的是正在發展中的作業系統版" -"本,它終將在適當的時機成為 FreeBSD-STABLE 分支。它實在是只適合給系統發展者以及有毅力的業餘愛好者使用 。如果想要得到有關如何使用-CURRENT的深入資訊,請參考使用手冊的相關部份。" - -#. (itstool) path: answer/para -#: book.translate.xml:437 -msgid "" -"Users not familiar with FreeBSD should not use FreeBSD-CURRENT. This branch sometimes evolves quite quickly and due to mistake can be un-buildable at " -"times. People that use FreeBSD-CURRENT are expected to be able to analyze, debug, and report problems." -msgstr "" -"如果您對 FreeBSD 本身並不是很熟悉那麼您就不應該使用FreeBSD-CURRENT。 這個分支的程式碼有時候變動得很快,而且可能會因此 而使您有好幾天的時間無法更新您的系" -"統。我們假設使用 FreeBSD-CURRENT 的使用者都有能力去分析他們所遇到的問題,除錯,並且回報問題。" - -#. (itstool) path: answer/para -#: book.translate.xml:443 -msgid "" -"FreeBSD snapshot releases are made based on the current state of the -CURRENT and -STABLE branches. The goals behind each snapshot release are:" -msgstr "" -"我們每天都會根據目前 -CURRENT-STABLE 的狀況對這兩個分支各發行一個 snapshot 版。發表這些 snapshot 的目的在於:" - -#. (itstool) path: listitem/para -#: book.translate.xml:451 -msgid "To test the latest version of the installation software." -msgstr "測試最新版的安裝程式。" - -#. (itstool) path: listitem/para -#: book.translate.xml:456 -msgid "" -"To give people who would like to run -CURRENT or -STABLE but who do not have the time or bandwidth to follow " -"it on a day-to-day basis an easy way of bootstrapping it onto their systems." -msgstr "提供一個簡單的方法給那些喜歡使用 -CURRENT 或是 -STABLE 但是沒有時間和頻寬去每天昇級的使用者。" - -#. (itstool) path: listitem/para -#: book.translate.xml:465 -msgid "" -"To preserve a fixed reference point for the code in question, just in case we break something really badly later. (Although Subversion normally " -"prevents anything horrible like this happening.)" -msgstr "為了替我們發展中的程式保留一個固定的參考點,以防止我們未來不幸搞砸了。(雖然一般而言 Subversion 可以防止類似這種的可怕事件)" - -#. (itstool) path: listitem/para -#: book.translate.xml:472 -msgid "To ensure that all new features and fixes in need of testing have the greatest possible number of potential testers." -msgstr "為了確保所有需要測試的新功能或修正都可以得到最多的測試。" - -#. (itstool) path: answer/para -#: book.translate.xml:478 -msgid "" -"No claims are made that any -CURRENT snapshot can be considered production quality for any purpose. If a stable and " -"fully tested system is needed, stick to full releases." -msgstr "" -"我們不對 -CURRENT snapshot 做任何目的的 品質保證 。如果你想要的是一個穩定且經過充分測試過的系統的話, 最好選擇使用完" -"整 releases." - -#. (itstool) path: answer/para -#: book.translate.xml:484 -msgid "Snapshot releases are directly available from snapshot." -msgstr "您可以直接從 snapshot 取得 -CURRENT 的 snapshot release。" - -#. (itstool) path: answer/para -#: book.translate.xml:486 -msgid "Official snapshots are generated on a regular basis for all actively developed branches." -msgstr "對每個有在活動的分支而言,都會定期產生一次 snapshots。" - -#. (itstool) path: question/para -#: book.translate.xml:493 -msgid "What is the FreeBSD-STABLE concept?" -msgstr "什麼是 FreeBSD-STABLE ?" - -#. (itstool) path: answer/para -#: book.translate.xml:498 -msgid "" -"Back when FreeBSD 2.0.5 was released, FreeBSD development branched in two. One branch was named -STABLE, one -CURRENT. FreeBSD-STABLE is the development branch from which major releases are made. " -"Changes go into this branch at a slower pace and with the general assumption that they have first been tested in FreeBSD-CURRENT. However, at any given " -"time, the sources for FreeBSD-STABLE may or may not be suitable for general use, as it may uncover bugs and corner cases that were not yet found in " -"FreeBSD-CURRENT. Users who do not have the resources to perform testing should instead run the most recent release of FreeBSD. FreeBSD-" -"CURRENT, on the other hand, has been one unbroken line since 2.0 was released, leading towards 12.0-RELEASE and beyond. For more detailed " -"information on branches see FreeBSD " -"Release Engineering: Creating the Release Branch, the status of the branches and the upcoming release schedule can be found on the Release Engineering Information page." -msgstr "" -"回溯到 FreeBSD 2.0.5 剛發表的時候,我們決定把 FreeBSD 的發展 分成兩支。一支叫做 -STABLE,另一支叫 -CURRENT。主要發行版是由FreeBSD-STABLE 這個開發分支而來。他的變動較慢,而且一般來說假設他們都已經先在FreeBSD-" -"CURRENT測試過了。然而在任何時候,FreeBSD-STABLE的原始碼仍有可能不一定適合一般用途,因為他可能包含在 FreeBSD-CURRENT 沒有發現到的錯誤。沒有能力和資源的使" -"用者應該改使用 FreeBSD 正式發行版。FreeBSD-CURRENT 從2.0開始就是另一個分支,一直到12.0-RELEASE和之後的版本都還是。更多關於開發分支" -"的資訊請見 FreeBSD Release Engineering: " -"Creating the Release Branch ,分支的開發狀態和接下來的發行計畫時間表可以在 Release " -"Engineering 資訊 找到。" - -#. (itstool) path: answer/para -#: book.translate.xml:520 -msgid "" -"12.0-STABLE is the actively developed -STABLE branch. The latest release on the 12.0-STABLE branch is 12.0-RELEASE, which was " -"released in December 2018." -msgstr "12.0-STABLE 是目前正在發展中的 -STABLE 分支。最新的 12.0-STABLE 是在 2018年12月發行的 12.0-RELEASE。" - -#. (itstool) path: answer/para -#: book.translate.xml:526 -msgid "" -"The 12-CURRENT branch is the actively developed -CURRENT branch toward the next generation of FreeBSD. See " -"What is FreeBSD-CURRENT? for more information on this branch." -msgstr "" -"12-CURRENT 這個分支是 FreeBSD 的 -CURRENT 分支,仍然不斷地在發展當中。 如果想要知道更多關於這個分支的資訊的" -"話,請參考 什麼是 FreeBSD-CURRENT? 。" - -#. (itstool) path: question/para -#: book.translate.xml:536 -msgid "When are FreeBSD releases made?" -msgstr "每次新的 FreeBSD 將於什麼時候推出?" - -#. (itstool) path: answer/para -#: book.translate.xml:540 -msgid "" -"The Release Engineering Team re@FreeBSD.org releases a new major version of FreeBSD about every 18 months and a new minor version about " -"every 8 months, on average. Release dates are announced well in advance, so that the people working on the system know when their projects need to be " -"finished and tested. A testing period precedes each release, to ensure that the addition of new features does not compromise the stability of the " -"release. Many users regard this caution as one of the best things about FreeBSD, even though waiting for all the latest goodies to reach -" -"STABLE can be a little frustrating." -msgstr "" -"一般而言,Release Engineering Team re@FreeBSD.org 約每18個月發行一次主要發行版本,約平均每8個月發行一次次要發行版本。每次新版本的發表時程" -"都會事先公告, 相關的開發人員就會知道,什麼時候該先把手邊的計劃完成並且測試過, 此外,這些更動都已經完整地測試過,確保新功能不會影響系統的穩定度。 雖" -"然,等這些好東西進入-STABLE 的時間令人等得有些不耐煩, 但是大多數的使用者都認為這種謹慎的態度是 FreeBSD 最好的優點之一。" - -#. (itstool) path: answer/para -#: book.translate.xml:552 -msgid "" -"More information on the release engineering process (including a schedule of upcoming releases) can be found on the release engineering pages on the FreeBSD Web site." -msgstr "" -"有關發行情報的更多細節部分(包括 release 的行程表、進度),都可在 FreeBSD 網站上的 發行情報" -" 上面獲得。" - -#. (itstool) path: answer/para -#: book.translate.xml:557 -msgid "For people who need or want a little more excitement, binary snapshots are made weekly as discussed above." -msgstr "為了滿足那些需要 (或想要) 新鮮刺激感的使用者, 上面已經提到我們每周都會發行 snapshots 版可供使用。" - -#. (itstool) path: question/para -#: book.translate.xml:565 -msgid "Who is responsible for FreeBSD?" -msgstr "誰負責 FreeBSD 的發展?" - -#. (itstool) path: answer/para -#: book.translate.xml:569 -msgid "" -"The key decisions concerning the FreeBSD project, such as the overall direction of the project and who is allowed to add code to the source tree, are " -"made by a core team of 9 people. There is a much larger team of more than 350 " -"committers who are authorized to " -"make changes directly to the FreeBSD source tree." -msgstr "" -"如果是一些有關 FreeBSD 計畫的關鍵性決定,像是整個計畫的走向 或是決定誰可以改 source tree 裡的程式碼這類的事,是由一個由 9 個 人所組成的 core team 來決定。而有另一群超過 350 個人的 committers 有權利可以直接修改 FreeBSD 的 source tree。" - -#. (itstool) path: answer/para -#: book.translate.xml:577 -msgid "" -"However, most non-trivial changes are discussed in advance in the mailing lists, and there are no restrictions on who " -"may take part in the discussion." -msgstr "無論如何,大多數的改變都會事前在 郵件論壇先討論過,而且不分角色,每個人都可以參與討論。" - -#. (itstool) path: question/para -#: book.translate.xml:586 -msgid "Where can I get FreeBSD?" -msgstr "我要如何取得 FreeBSD?" - -#. (itstool) path: answer/para -#: book.translate.xml:590 -msgid "" -"Every significant release of FreeBSD is available via anonymous FTP from the FreeBSD " -"FTP site:" -msgstr "每個 FreeBSD 的重要版本都可以經由匿名 FTP 從 FreeBSD FTP 站 取得:" - -#. (itstool) path: listitem/para -#: book.translate.xml:596 -msgid "" -"The latest 12-STABLE release, 12.0-RELEASE can be found in the 12.0-RELEASE directory." -msgstr "" -"最新版 12-STABLE , 也就是 12.0-RELEASE 請到 12.0-RELEASE 這個目錄。" - -#. (itstool) path: listitem/para -#: book.translate.xml:602 -msgid "" -"Snapshot releases are made monthly for the -CURRENT and -STABLE branch, these being of service purely to bleeding-edge testers and developers." -msgstr "" -"-CURRENT 和 -STABLE 分支的Snapshot版本通常每個月會做一次, 主要是為了提供給那些熱心的測試者和開發人員。" - -#. (itstool) path: listitem/para -#: book.translate.xml:609 -msgid "" -"The latest 11-STABLE release, 11.2-RELEASE can be found in the 11.2-RELEASE directory." -msgstr "" -"最新版 11-STABLE , 也就是11.2-RELEASE 請到 11.2-RELEASE 這個目錄。" - -#. (itstool) path: answer/para -#: book.translate.xml:615 -msgid "" -"Information about obtaining FreeBSD on CD, DVD, and other media can be found in the Handbook." -msgstr "" -"FreeBSD 的 CD、DVD,還有其他取得方式可以在 the Handbook 中找到" -"解答。" - -#. (itstool) path: question/para -#: book.translate.xml:623 -msgid "How do I access the Problem Report database?" -msgstr "我要如何去查詢、提交問題回報(Problem Report,簡稱PR)資料庫呢?" - -#. (itstool) path: answer/para -#: book.translate.xml:627 -msgid "" -"The Problem Report database of all user change requests may be queried by using our web-based PR query interface." -msgstr "所有使用者的變更要求都可以經由網頁版的 PR 查詢 界面來察看。" - -#. (itstool) path: answer/para -#: book.translate.xml:631 -msgid "" -"The web-based problem report submission interface can be used to submit problem " -"reports through a web browser." -msgstr "可以使用瀏覽器經由網頁版的 PR 界面 來傳送問題回報" - -#. (itstool) path: answer/para -#: book.translate.xml:635 -msgid "" -"Before submitting a problem report, read Writing " -"FreeBSD Problem Reports, an article on how to write good problem reports." -msgstr "" -"然而,在您回報問題之前,請先閱讀 如何撰寫 FreeBSD 的問" -"題回報單,這是一篇告訴你怎樣才能寫出一篇真正有用的問題回報單。" - -#. (itstool) path: chapter/title -#: book.translate.xml:644 -msgid "Documentation and Support" -msgstr "文件與技術支援" - -#. (itstool) path: question/para -#: book.translate.xml:649 -msgid "What good books are there about FreeBSD?" -msgstr "有哪些 FreeBSD 相關的好書呢?" - -#. (itstool) path: answer/para -#: book.translate.xml:653 -msgid "" -"The project produces a wide range of documentation, available online from this link: https://www." -"FreeBSD.org/docs.html. In addition, the the " -"bibliography in the Handbook reference other recommended books." -msgstr "" -"FreeBSD 文件計畫已陸續發表了相當廣泛範圍的文件,可在 https://www.FreeBSD.org/docs.html 取" -"得。除此之外,也可以參閱使用手冊的 參考書目建議的其他" -"書籍。" - -#. (itstool) path: question/para -#: book.translate.xml:663 -msgid "Is the documentation available in other formats, such as plain text (ASCII), or PostScript?" -msgstr "這些文件有其他格式的嗎?像是:純文字(ASCII)或 PostScript 之類的格式?" - -#. (itstool) path: answer/para -#: book.translate.xml:668 -msgid "" -"Yes. The documentation is available in a number of different formats and compression schemes on the FreeBSD FTP site, in the /pub/FreeBSD/doc/ directory." -msgstr "" -"有的。這些文件都分別以不同格式儲存以及壓縮處理並放在 FTP 上面,可以從各個 FreeBSD FTP 站的 /" -"pub/FreeBSD/doc/ 目錄內找到你要的。" - -#. (itstool) path: answer/para -#: book.translate.xml:673 -msgid "The documentation is categorized in a number of different ways. These include:" -msgstr "文件以幾種不同的方式分類。包括:" - -#. (itstool) path: listitem/para -#: book.translate.xml:678 -msgid "The document's name, such as faq, or handbook." -msgstr "文件名稱,例如:faq (常見問答集)或是 handbook (FreeBSD 使用手冊)等等。" - -#. (itstool) path: listitem/para -#: book.translate.xml:684 -msgid "" -"The document's language and encoding. These are based on the locale names found under /usr/share/locale on a FreeBSD system. The " -"current languages and encodings are as follows:" -msgstr "文件的語言與編碼。他們是基於 FreeBSD 系統中 /usr/share/locale 裡所見到的語系名稱。目前包含的語言與編碼如下:" - -#. (itstool) path: row/entry -#: book.translate.xml:694 -msgid "Name" -msgstr "語系名稱" - -#. (itstool) path: row/entry -#: book.translate.xml:696 book.translate.xml:846 -msgid "Meaning" -msgstr "說明" - -#. (itstool) path: row/entry -#: book.translate.xml:702 -msgid "en_US.ISO8859-1" -msgstr "en_US.ISO8859-1" - -#. (itstool) path: row/entry -#: book.translate.xml:704 -msgid "English (United States)" -msgstr "英文 (美國)" - -#. (itstool) path: row/entry -#: book.translate.xml:708 -msgid "bn_BD.ISO10646-1" -msgstr "bn_BD.ISO10646-1" - -#. (itstool) path: row/entry -#: book.translate.xml:710 -msgid "Bengali or Bangla (Bangladesh)" -msgstr "孟加拉文 (孟加拉)" - -#. (itstool) path: row/entry -#: book.translate.xml:714 -msgid "da_DK.ISO8859-1" -msgstr "da_DK.ISO8859-1" - -#. (itstool) path: row/entry -#: book.translate.xml:716 -msgid "Danish (Denmark)" -msgstr "丹麥文 (丹麥)" - -#. (itstool) path: row/entry -#: book.translate.xml:720 -msgid "de_DE.ISO8859-1" -msgstr "de_DE.ISO8859-1" - -#. (itstool) path: row/entry -#: book.translate.xml:722 -msgid "German (Germany)" -msgstr "德文 (德國)" - -#. (itstool) path: row/entry -#: book.translate.xml:726 -msgid "el_GR.ISO8859-7" -msgstr "el_GR.ISO8859-7" - -#. (itstool) path: row/entry -#: book.translate.xml:728 -msgid "Greek (Greece)" -msgstr "希臘文 (希臘)" - -#. (itstool) path: row/entry -#: book.translate.xml:732 -msgid "es_ES.ISO8859-1" -msgstr "es_ES.ISO8859-1" - -#. (itstool) path: row/entry -#: book.translate.xml:734 -msgid "Spanish (Spain)" -msgstr "西班牙文 (西班牙)" - -#. (itstool) path: row/entry -#: book.translate.xml:738 -msgid "fr_FR.ISO8859-1" -msgstr "fr_FR.ISO8859-1" - -#. (itstool) path: row/entry -#: book.translate.xml:740 -msgid "French (France)" -msgstr "法文 (法國)" - -#. (itstool) path: row/entry -#: book.translate.xml:744 -msgid "hu_HU.ISO8859-2" -msgstr "hu_HU.ISO8859-2" - -#. (itstool) path: row/entry -#: book.translate.xml:746 -msgid "Hungarian (Hungary)" -msgstr "匈牙利文 (匈牙利)" - -#. (itstool) path: row/entry -#: book.translate.xml:750 -msgid "it_IT.ISO8859-15" -msgstr "it_IT.ISO8859-15" - -#. (itstool) path: row/entry -#: book.translate.xml:752 -msgid "Italian (Italy)" -msgstr "義大利文 (義大利)" - -#. (itstool) path: row/entry -#: book.translate.xml:756 -msgid "ja_JP.eucJP" -msgstr "ja_JP.eucJP" - -#. (itstool) path: row/entry -#: book.translate.xml:758 -msgid "Japanese (Japan, EUC encoding)" -msgstr "日文 (日本, EUC 編碼)" - -#. (itstool) path: row/entry -#: book.translate.xml:762 -msgid "ko_KR.UTF-8" -msgstr "ko_KR.UTF-8" - -#. (itstool) path: row/entry -#: book.translate.xml:764 -msgid "Korean (Korea, UTF-8 encoding)" -msgstr "韓文 (韓國, UTF-8 編碼)" - -#. (itstool) path: row/entry -#: book.translate.xml:768 -msgid "mn_MN.UTF-8" -msgstr "mn_MN.UTF-8" - -#. (itstool) path: row/entry -#: book.translate.xml:770 -msgid "Mongolian (Mongolia, UTF-8 encoding)" -msgstr "蒙古文 (蒙古, UTF-8 編碼)" - -#. (itstool) path: row/entry -#: book.translate.xml:775 -msgid "nl_NL.ISO8859-1" -msgstr "nl_NL.ISO8859-1" - -#. (itstool) path: row/entry -#: book.translate.xml:777 -msgid "Dutch (Netherlands)" -msgstr "荷蘭文 (荷蘭)" - -#. (itstool) path: row/entry -#: book.translate.xml:781 -msgid "pl_PL.ISO8859-2" -msgstr "pl_PL.ISO8859-2" - -#. (itstool) path: row/entry -#: book.translate.xml:783 -msgid "Polish (Poland)" -msgstr "波蘭文 (波蘭)" - -#. (itstool) path: row/entry -#: book.translate.xml:787 -msgid "pt_BR.ISO8859-1" -msgstr "pt_BR.ISO8859-1" - -#. (itstool) path: row/entry -#: book.translate.xml:789 -msgid "Portuguese (Brazil)" -msgstr "葡萄牙文 (巴西)" - -#. (itstool) path: row/entry -#: book.translate.xml:793 -msgid "ru_RU.KOI8-R" -msgstr "ru_RU.KOI8-R" - -#. (itstool) path: row/entry -#: book.translate.xml:795 -msgid "Russian (Russia, KOI8-R encoding)" -msgstr "俄文 (俄羅斯, KOI8-R 編碼)" - -#. (itstool) path: row/entry -#: book.translate.xml:799 -msgid "tr_TR.ISO8859-9" -msgstr "tr_TR.ISO8859-9" - -#. (itstool) path: row/entry -#: book.translate.xml:801 -msgid "Turkish (Turkey)" -msgstr "土耳其文 (土耳其)" - -#. (itstool) path: row/entry -#: book.translate.xml:805 -msgid "zh_CN.UTF-8" -msgstr "zh_CN.UTF-8" - -#. (itstool) path: row/entry -#: book.translate.xml:807 -msgid "Simplified Chinese (China, UTF-8 encoding)" -msgstr "簡體中文 (中國, UTF-8 編碼)" - -#. (itstool) path: row/entry -#: book.translate.xml:812 -msgid "zh_TW.UTF-8" -msgstr "zh_TW.UTF-8" - -#. (itstool) path: row/entry -#: book.translate.xml:814 -msgid "Traditional Chinese (Taiwan, UTF-8 encoding)" -msgstr "正體中文 (台灣, UTF-8 編碼)" - -#. (itstool) path: note/para -#: book.translate.xml:822 -msgid "Some documents may not be available in all languages." -msgstr "上列的各國翻譯語系文件中,並非所有文件都有翻譯。" - -#. (itstool) path: listitem/para -#: book.translate.xml:828 -msgid "" -"The document's format. We produce the documentation in a number of different output formats. Each format has its own advantages and disadvantages. Some " -"formats are better suited for online reading, while others are meant to be aesthetically pleasing when printed on paper. Having the documentation " -"available in any of these formats ensures that our readers will be able to read the parts they are interested in, either on their monitor, or on paper " -"after printing the documents. The currently available formats are:" -msgstr "" -"文件的格式。我們的每份文件都提供許多不同的格式,每種格式各有利弊, 有些格式適合線上閱讀,有些則適合列印出美觀的文件。 這些不同格式的文件能夠確保我們的讀" -"者們,無論是在螢幕上閱讀或是列印成紙本,都能夠閱讀他們感興趣的內容,目前有提供的格式如下:" - -#. (itstool) path: row/entry -#: book.translate.xml:844 -msgid "Format" -msgstr "格式" - -#. (itstool) path: row/entry -#: book.translate.xml:852 -msgid "html-split" -msgstr "html-split" - -#. (itstool) path: row/entry -#: book.translate.xml:854 -msgid "A collection of small, linked, HTML files." -msgstr "依章節區分成多個小的、互相連結的 HTML 檔案" - -#. (itstool) path: row/entry -#: book.translate.xml:859 -msgid "html" -msgstr "html" - -#. (itstool) path: row/entry -#: book.translate.xml:861 -msgid "One large HTML file containing the entire document" -msgstr "所有內容包含在單一個 HTML 檔案" - -#. (itstool) path: row/entry -#: book.translate.xml:866 -msgid "pdf" -msgstr "pdf" - -#. (itstool) path: row/entry -#: book.translate.xml:868 -msgid "Adobe's Portable Document Format" -msgstr " \tAdobe's PDF 格式" - -#. (itstool) path: row/entry -#: book.translate.xml:872 -msgid "ps" -msgstr "ps" - -#. (itstool) path: row/entry -#: book.translate.xml:874 -msgid "PostScript" -msgstr "PostScript" - -#. (itstool) path: row/entry -#: book.translate.xml:878 -msgid "rtf" -msgstr "rtf" - -#. (itstool) path: row/entry -#: book.translate.xml:880 -msgid "Microsoft's Rich Text Format" -msgstr "Microsoft 的 RTF 格式" - -#. (itstool) path: row/entry -#: book.translate.xml:884 -msgid "txt" -msgstr "txt" - -#. (itstool) path: row/entry -#: book.translate.xml:886 -msgid "Plain text" -msgstr "純文字" - -#. (itstool) path: note/para -#: book.translate.xml:893 -msgid "" -"Page numbers are not automatically updated when loading Rich Text Format into Word. Press CtrlA, CtrlEnd, F9 after loading the document, to " -"update the page numbers." -msgstr "" -"當用 Word 讀取 RTF 格式時,頁碼並不會被自動更新。在開啟檔案後按下CtrlA, " -"CtrlEnd, F9 來更新頁碼。" - -#. (itstool) path: listitem/para -#: book.translate.xml:902 -msgid "The compression and packaging scheme." -msgstr "壓縮和打包方式" - -#. (itstool) path: listitem/para -#: book.translate.xml:906 -msgid "" -"Where the format is html-split, the files are bundled up using tar1. The resulting .tar is then compressed using the compression schemes detailed in the next point." -msgstr "" -"當採用 html-split 格式時,檔案先透過 tar1 工具來進" -"行打包。接著再將產生出來的 .tar 檔接透過第二點所述的壓縮方式壓縮。" - -#. (itstool) path: listitem/para -#: book.translate.xml:915 -msgid "All the other formats generate one file. For example, article.pdf, book.html, and so on." -msgstr "其他的格式都是單一個檔案。例如 article.pdfbook.html ,以此類推。" - -#. (itstool) path: listitem/para -#: book.translate.xml:920 -msgid "" -"These files are then compressed using either the zip or bz2 compression schemes. " -"tar1 can be used to uncompress these files." -msgstr "" -"這些檔案接著透過 zipbz2 來壓縮。 tar1 工具可用來解壓縮這些檔案。" - -#. (itstool) path: listitem/para -#: book.translate.xml:926 -msgid "" -"So the PostScript version of the Handbook, compressed using bzip2 will be stored in a " -"file called book.ps.bz2 in the handbook/ directory." -msgstr "" -"因此 PostScript 版本的手冊經過 bzip2 壓縮後會存成一個叫做 book.ps.bz2 的檔案,並位於 handbook/ 資料夾。" - -#. (itstool) path: answer/para -#: book.translate.xml:936 -msgid "" -"After choosing the format and compression mechanism, download the compressed files, uncompress them, and then copy the appropriate documents into place." -msgstr "在選取格式與壓縮方式後,下載壓縮後的檔案並解壓縮,再把文件複製到想要的地方。" - -#. (itstool) path: answer/para -#: book.translate.xml:941 -msgid "" -"For example, the split HTML version of the FAQ, compressed using bzip21, can be found in doc/en_US.ISO8859-1/books/faq/book.html-split.tar.bz2 To download and uncompress that " -"file, type:" -msgstr "" -"舉例來說,透過 bzip21 壓縮的英文問與答的章節分割 HTML 版本,可以在 " -"doc/en_US.ISO8859-1/books/faq/book.html-split.tar.bz2 中找到。若要下載並解壓縮這個檔案,請輸入" - -#. (itstool) path: answer/screen -#: book.translate.xml:947 -#, no-wrap -msgid "" -"# fetch https://download.freebsd.org/ftp/doc/en_US.ISO8859-1/books/faq/book.html-split.tar.bz2\n" -"# tar xvf book.html-split.tar.bz2" -msgstr "" -"# fetch https://download.freebsd.org/ftp/doc/en_US.ISO8859-1/books/faq/book.html-split.tar.bz2\n" -"# tar xvf book.html-split.tar.bz2" - -#. (itstool) path: answer/para -#: book.translate.xml:950 -msgid "" -"If the file is compressed, tar will automatically detect the appropriate format and decompress it correctly, resulting in a " -"collection of .html files. The main one is called index.html, which will contain the table of contents, " -"introductory material, and links to the other parts of the document." -msgstr "" -"如果檔案被壓縮過的話,tar 會自動偵測正確的格式並解壓縮出一堆 .html 檔案。主要的檔案是 index." -"html,包含了主目錄跟介紹以及連接到文件其他部份的連結。" - -#. (itstool) path: question/para -#: book.translate.xml:963 -msgid "Where do I find info on the FreeBSD mailing lists? What FreeBSD news groups are available?" -msgstr "哪裡有關於 FreeBSD 的郵遞論壇(mailing lists)呢? 有哪些可以使用的 FreeBSD 新聞群組(news groups)呢?" - -#. (itstool) path: answer/para -#: book.translate.xml:968 -msgid "" -"Refer to the Handbook entry on mailing-lists and the Handbook entry on newsgroups." -msgstr "" -"請參考FreeBSD 使用手冊上的 郵件論壇 (mailing-" -"lists) 。" - -#. (itstool) path: question/para -#: book.translate.xml:976 -msgid "Are there FreeBSD IRC (Internet Relay Chat) channels?" -msgstr "有 FreeBSD IRC (Internet Relay Chat)頻道嗎?" - -#. (itstool) path: answer/para -#: book.translate.xml:981 -msgid "Yes, most major IRC networks host a FreeBSD chat channel:" -msgstr "有的,大部分的 IRC 主機都有 FreeBSD 聊天頻道:" - -#. (itstool) path: listitem/para -#: book.translate.xml:986 -msgid "" -"Channel #FreeBSDhelp on EFNet is a channel dedicated to helping FreeBSD " -"users." -msgstr "EFNet 上的 #FreeBSDhelp 頻道專門用來幫助 FreeBSD 使用著" - -#. (itstool) path: listitem/para -#: book.translate.xml:991 -msgid "" -"Channel #FreeBSD on Freenode is a general help channel with many users at any time. " -"The conversations have been known to run off-topic for a while, but priority is given to users with FreeBSD questions. Other users can help with the " -"basics, referring to the Handbook whenever possible and providing links for learning more about a particular topic. This is primarily an English " -"speaking channel, though it does have users from all over the world. Non-native English speakers should try to ask the question in English first and " -"then relocate to ##freebsd-lang as appropriate." -msgstr "" -"Freenode 上的 #FreeBSD 頻道是一個有許多使用者的一般求助頻道。這個頻道時常聊一些題外" -"話,但主要還是讓使用者問 FreeBSD 相關問題的地方。其他使用者可以協助解答一些基本的問題,並請盡量提供使用手冊的參考或是提供連結來提供更深入的資訊。雖然這" -"個頻道有來自世界各地的使用者,但這是一個英文為主的頻道。非母語人士應該以英文提問,並在必要的時候移駕到 ##freebsd-lang 頻道。" - -#. (itstool) path: listitem/para -#: book.translate.xml:1007 -msgid "" -"Channel #FreeBSD on DALNET is available at irc.dal.net in " -"the US and irc.eu.dal.net in Europe." -msgstr "" -"DALNET 的#FreeBSD 頻道,可由 irc.dal.net (位於美國)及" -"irc.eu.dal.net (位於歐洲)進入。" - -#. (itstool) path: listitem/para -#: book.translate.xml:1014 -msgid "" -"Channel #FreeBSD on UNDERNET is available at us.undernet.org in the US and eu.undernet.org in Europe. Since it is a help channel, be prepared to read the documents you are " -"referred to." -msgstr "" -"UNDERNET 上的 #FreeBSD 頻道可由 us.undernet.org(位於美" -"國)及 eu.undernet.org (位於歐洲)進入。由於這是個輔助新手用的頻道, 請記得閱讀別人向你提及的連結或檔案。" - -#. (itstool) path: listitem/para -#: book.translate.xml:1023 -msgid "" -"Channel #FreeBSD on RUSNET is a Russian language channel dedicated to helping " -"FreeBSD users. This is also good place for non-technical discussions." -msgstr "" -"RUSNET 上的 #FreeBSD 頻道是俄語國家的 FreeBSD 使用者頻道。 這裡同時也是一般交流" -"的討論好去處。" - -#. (itstool) path: listitem/para -#: book.translate.xml:1030 -msgid "" -"Channel #bsdchat on Freenode is a Traditional Chinese (UTF-8 encoding) language " -"channel dedicated to helping FreeBSD users. This is also good place for non-technical discussions." -msgstr "" -"Freenode 上的 #bsdchat 頻道是一個正體中文(UTF-8 編碼)頻道專門用來幫助 FreeBSD 使用" -"著。這裡也歡迎一般非技術的交流討論。" - -#. (itstool) path: answer/para -#: book.translate.xml:1038 -#, fuzzy -msgid "The FreeBSD wiki has a good list of IRC channels." -msgstr "FreeBSD 的維基百科有一份 IRC 頻道的 完整清單。" - -#. (itstool) path: answer/para -#: book.translate.xml:1041 -msgid "" -"Each of these channels are distinct and are not connected to each other. Since their chat styles differ, try each to find one suited to your chat style." -msgstr "每個頻道都是不同且互相獨立的。因為他們的聊天風格不同,您可以每個都試試看來找到適合您的頻道。" - -#. (itstool) path: question/para -#: book.translate.xml:1050 -msgid "Are there any web based forums to discuss FreeBSD?" -msgstr "有沒有任何網頁形式的 FreeBSD 論壇呢?" - -#. (itstool) path: answer/para -#: book.translate.xml:1053 -msgid "The official FreeBSD forums are located at https://forums.FreeBSD.org/." -msgstr "官方的 FreeBSD 論壇位於 https://forums.FreeBSD.org/。" - -#. (itstool) path: question/para -#: book.translate.xml:1059 -msgid "Where can I get commercial FreeBSD training and support?" -msgstr "可以從哪邊獲得商業化的 FreeBSD 的教育課程及技術支援呢?" - -#. (itstool) path: answer/para -#: book.translate.xml:1064 -msgid "" -"iXsystems, Inc., parent company of the FreeBSD " -"Mall, provides commercial FreeBSD and TrueOS software support, in addition to " -"FreeBSD development and tuning solutions." -msgstr "" -"iXsystems, Inc., FreeBSD 商城的母公司,提" -"供 FreeBSD 開發與調校解決方案與 FreeBSD 與 TrueOS 的軟體 支援。" - -#. (itstool) path: answer/para -#: book.translate.xml:1071 -msgid "" -"BSD Certification Group, Inc. provides system administration certifications for DragonFly BSD, FreeBSD, NetBSD, and OpenBSD. Refer to their site for more information." -msgstr "" -"BSD Certification Group, Inc. 提供 DragonFly BSD、FreeBSD、NetBSD 與 OpenBSD 的系統管理認證。請參閱 他們的網站 來獲得更多資訊。" - -#. (itstool) path: answer/para -#: book.translate.xml:1076 -msgid "Any other organizations providing training and support should contact the Project to be listed here." -msgstr "如果有其他組織提供技術訓練或技術支援,請聯絡 FreeBSD 計畫來加入以上清單。" - -#. (itstool) path: info/title -#: book.translate.xml:1085 -msgid "Installation" -msgstr "安裝" - -#. (itstool) path: affiliation/address -#: book.translate.xml:1093 -#, no-wrap -msgid "" -"\n" -"\t nik@FreeBSD.org\n" -"\t " -msgstr "" -"\n" -"\t nik@FreeBSD.org\n" -"\t " - -#. (itstool) path: info/author -#: book.translate.xml:1087 -msgid " Nik Clayton <_:address-1/> " -msgstr "" - -#. (itstool) path: question/para -#: book.translate.xml:1104 -msgid "" -"Which platform should I download? I have a 64 bit capable Intel CPU, but I only see amd64." -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:1110 -msgid "" -"amd64 is the term FreeBSD uses for 64-bit compatible x86 architectures (also known as \"x86-64\" or \"x64\"). Most modern computers should use amd64. " -"Older hardware should use i386. When installing on a non-x86-compatible architecture, select the platform which best matches the hardware." -msgstr "" - -#. (itstool) path: question/para -#: book.translate.xml:1121 -msgid "Which file do I download to get FreeBSD?" -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:1125 -msgid "" -"On the Getting FreeBSD page, select [iso] next to the architecture " -"that matches the hardware." -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:1129 -msgid "Any of the following can be used:" -msgstr "" - -#. (itstool) path: row/entry -#: book.translate.xml:1135 -msgid "file" -msgstr "檔案" - -#. (itstool) path: row/entry -#: book.translate.xml:1136 -msgid "description" -msgstr "描述" - -#. (itstool) path: row/entry -#: book.translate.xml:1142 -msgid "disc1.iso" -msgstr "disc1.iso" - -#. (itstool) path: row/entry -#: book.translate.xml:1143 -msgid "Contains enough to install FreeBSD and a minimal set of packages." -msgstr "" - -#. (itstool) path: row/entry -#: book.translate.xml:1148 -msgid "dvd1.iso" -msgstr "dvd1.iso" - -#. (itstool) path: row/entry -#: book.translate.xml:1149 -msgid "Similar to disc1.iso but with additional packages." -msgstr "" - -#. (itstool) path: row/entry -#: book.translate.xml:1154 -msgid "memstick.img" -msgstr "memstick.img" - -#. (itstool) path: row/entry -#: book.translate.xml:1155 -msgid "A bootable image sufficient for writing to a USB stick." -msgstr "" - -#. (itstool) path: row/entry -#: book.translate.xml:1160 -msgid "bootonly.iso" -msgstr "bootonly.iso" - -#. (itstool) path: row/entry -#: book.translate.xml:1161 -msgid "A minimal image that requires network access during installation to completely install FreeBSD." -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:1169 -msgid "" -"Full instructions on this procedure and a little bit more about installation issues in general can be found in the Handbook entry on installing FreeBSD." -msgstr "" - -#. (itstool) path: question/para -#: book.translate.xml:1178 -msgid "What do I do if the install image does not boot?" -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:1183 -msgid "This can be caused by not downloading the image in binary mode when using FTP." -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:1187 -msgid "" -"Some FTP clients default their transfer mode to ascii and attempt to change any end-of-line characters received to match the " -"conventions used by the client's system. This will almost invariably corrupt the boot image. Check the SHA-256 checksum of the downloaded boot image: " -"if it is not exactly that on the server, then the download process is suspect." -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:1196 -msgid "" -"When using a command line FTP client, type binary at the FTP command prompt after getting connected to the server and before " -"starting the download of the image." -msgstr "" - -#. (itstool) path: question/para -#: book.translate.xml:1205 -msgid "Where are the instructions for installing FreeBSD?" -msgstr "可以在哪邊找到安裝 FreeBSD 的解說步驟呢?" - -#. (itstool) path: answer/para -#: book.translate.xml:1209 -msgid "" -"Installation instructions can be found at Handbook entry on " -"installing FreeBSD." -msgstr "安裝說明可以在 使用手冊的安裝 FreeBSD 找到。" - -#. (itstool) path: question/para -#: book.translate.xml:1217 -msgid "What are the minimum requirements to run FreeBSD?" -msgstr "要跑 FreeBSD 至少需要什麼樣的配備呢?" - -#. (itstool) path: answer/para -#: book.translate.xml:1221 -msgid "FreeBSD requires a 486 or better PC, 64 MB or more of RAM, and at least 1.1 GB of hard disk space." -msgstr "FreeBSD 需要 486 以上的 PC,64 MB 以上的 RAM,和至少 1.1 GB 的硬碟空間。" - -#. (itstool) path: question/para -#: book.translate.xml:1229 -msgid "How can I make my own custom release or install disk?" -msgstr "要怎樣才能自行打造專用的安裝磁片呢?" - -#. (itstool) path: answer/para -#: book.translate.xml:1234 -msgid "" -"Customized FreeBSD installation media can be created by building a custom release. Follow the instructions in the Release Engineering article." -msgstr "" -"可以透過編譯客製化發行版本來建立客製化的 FreeBSD 安裝媒體。請參閱 Release Engineering 文章的說明。" - -#. (itstool) path: question/para -#: book.translate.xml:1243 -msgid "Can Windows co-exist with FreeBSD?" -msgstr "Windows 可以與 FreeBSD 共存嗎?" - -#. (itstool) path: answer/para -#: book.translate.xml:1247 -msgid "" -"If Windows is installed first, then yes. FreeBSD's boot manager will then manage to boot Windows and FreeBSD. If Windows is installed afterwards, it will overwrite the " -"boot manager. If that happens, see the next section." -msgstr "" -"如果 Windows 先安裝,那就可以。 FreeBSD 的開機管理程式將會管理 Windows 和 FreeBSD 的開機啟動。 如果 Windows 後安裝,它將覆蓋開機管理程式。如果發生這種情況,請見下一小" -"節。" - -#. (itstool) path: question/para -#: book.translate.xml:1257 -msgid "Another operating system destroyed my Boot Manager. How do I get it back?" -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:1262 -msgid "" -"This depends upon the boot manager. The FreeBSD boot selection menu can be reinstalled using boot0cfg8. For example, to restore the boot menu onto the disk ada0:" -msgstr "" - -#. (itstool) path: answer/screen -#: book.translate.xml:1267 -#, no-wrap -msgid "# boot0cfg -B ada0" -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:1269 -msgid "" -"The non-interactive MBR bootloader can be installed using gpart8:" -msgstr "" - -#. (itstool) path: answer/screen -#: book.translate.xml:1272 -#, no-wrap -msgid "# gpart bootcode -b /boot/mbr ada0" -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:1274 -msgid "For more complex situations, including GPT disks, see gpart8." -msgstr "" - -#. (itstool) path: question/para -#: book.translate.xml:1281 -msgid "Do I need to install the source?" -msgstr "我需要安裝完整的原始碼嗎?" - -#. (itstool) path: answer/para -#: book.translate.xml:1285 -msgid "" -"In general, no. There is nothing in the base system which requires the presence of the source to operate. Some ports, like sysutils/lsof, will not build unless the source is installed. In particular, if the port builds a kernel module or directly operates on kernel structures, " -"the source must be installed." -msgstr "" - -#. (itstool) path: question/para -#: book.translate.xml:1296 -msgid "Do I need to build a kernel?" -msgstr "需要重新 build kernel 嗎?" - -#. (itstool) path: answer/para -#: book.translate.xml:1300 -msgid "" -"Usually not. The supplied GENERIC kernel contains the drivers an ordinary computer will need. freebsd-" -"update8, the FreeBSD binary upgrade tool, cannot upgrade custom kernels, another reason to stick " -"with the GENERIC kernel when possible. For computers with very limited RAM, such as embedded systems, it may be worthwhile to build " -"a smaller custom kernel containing just the required drivers." -msgstr "" - -#. (itstool) path: question/para -#: book.translate.xml:1313 -msgid "Should I use DES, Blowfish, or MD5 passwords and how do I specify which form my users receive?" -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:1318 -msgid "" -"FreeBSD uses SHA512 by default. DES passwords are still available for backwards compatibility with operating systems that still " -"use the less secure password format. FreeBSD also supports the Blowfish and MD5 password formats. Which password format to use for new passwords is " -"controlled by the passwd_format login capability in /etc/login.conf, which takes values of des, blf (if these are available) or md5. See the login.conf5 manual page for more information about login capabilities." -msgstr "" - -#. (itstool) path: question/para -#: book.translate.xml:1337 -msgid "What are the limits for FFS file systems?" -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:1341 -msgid "" -"For FFS file systems, the largest file system is practically limited by the amount of memory required to fsck8 the file system. fsck8 requires one bit per fragment, which with the default fragment size of 4 KB equates to 32 MB of memory per TB of disk. This does mean " -"that on architectures which limit userland processes to 2 GB (e.g., i386), the maximum fsck8'able filesystem is ~60 TB." -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:1350 -msgid "" -"If there was not a fsck8 memory limit the maximum filesystem size " -"would be 2 ^ 64 (blocks) * 32 KB => 16 Exa * 32 KB => 512 ZettaBytes." -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:1355 -msgid "" -"The maximum size of a single FFS file is approximately 2 PB with the default block size of 32 KB. Each 32 KB block can point to 4096 blocks. With " -"triple indirect blocks, the calculation is 32 KB * 12 + 32 KB * 4096 + 32 KB * 4096^2 + 32 KB * 4096^3. Increasing the block size to 64 KB will " -"increase the max file size by a factor of 16." -msgstr "" - -#. (itstool) path: question/para -#: book.translate.xml:1367 -msgid "Why do I get an error message, readin failed after compiling and booting a new kernel?" -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:1373 -msgid "" -"The world and kernel are out of sync. This is not supported. Be sure to use make buildworld and make buildkernel " -"to update the kernel." -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:1378 -msgid "" -"Boot the system by specifying the kernel directly at the second stage, pressing any key when the | shows up before loader is started." -msgstr "" - -#. (itstool) path: question/para -#: book.translate.xml:1387 -msgid "Is there a tool to perform post-installation configuration tasks?" -msgstr "是否有工具可以執行安裝後的設定工作嗎?" - -#. (itstool) path: answer/para -#: book.translate.xml:1392 -msgid "Yes. bsdconfig provides a nice interface to configure FreeBSD post-installation." -msgstr "是的。bsdconfig 提供很棒的介面來進行 FreeBSD 安裝後設定。" - -#. (itstool) path: chapter/title -#: book.translate.xml:1400 -msgid "Hardware Compatibility" -msgstr "硬體相容性" - -#. (itstool) path: sect1/title -#: book.translate.xml:1403 -msgid "General" -msgstr "一般問題" - -#. (itstool) path: question/para -#: book.translate.xml:1408 -msgid "I want to get a piece of hardware for my FreeBSD system. Which model/brand/type is best?" -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:1413 -msgid "" -"This is discussed continually on the FreeBSD mailing lists but is to be expected since hardware changes so quickly. Read through the Hardware Notes for " -"FreeBSD 12.0 or 11.2 and search the mailing list archives before asking about the latest and greatest hardware. Chances are a discussion about that type of hardware took place just last week." -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:1423 -msgid "" -"Before purchasing a laptop, check the archives for FreeBSD laptop " -"computer mailing list and FreeBSD general questions mailing " -"list, or possibly a specific mailing list for a particular hardware type." -msgstr "" - -#. (itstool) path: question/para -#: book.translate.xml:1431 -msgid "What are the limits for memory? Does FreeBSD support more than 4 GB of memory (RAM)? More than 16 GB? More than 48 GB?" -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:1438 -msgid "" -"FreeBSD as an operating system generally supports as much physical memory (RAM) as the platform it is running on does. Keep in mind that different " -"platforms have different limits for memory; for example i386 without PAE supports at most 4 GB of memory (and " -"usually less than that because of PCI address space) and i386 with PAE supports at most 64 GB memory. As of FreeBSD 10, AMD64 " -"platforms support up to 4 TB of physical memory." -msgstr "" - -#. (itstool) path: question/para -#: book.translate.xml:1453 -msgid "Why does FreeBSD report less than 4 GB memory when installed on an i386 machine?" -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:1458 -msgid "" -"The total address space on i386 machines is 32-bit, meaning that at most 4 GB of memory is addressable (can be accessed). " -"Furthermore, some addresses in this range are reserved by hardware for different purposes, for example for using and controlling PCI devices, for " -"accessing video memory, and so on. Therefore, the total amount of memory usable by the operating system for its kernel and applications is limited to " -"significantly less than 4 GB. Usually, 3.2 GB to 3.7 GB is the maximum usable physical memory in this configuration." -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:1470 -msgid "" -"To access more than 3.2 GB to 3.7 GB of installed memory (meaning up to 4 GB but also more than 4 GB), a special tweak called PAE " -"must be used. PAE stands for Physical Address Extension and is a way for 32-bit x86 CPUs to address more than 4 GB of memory. It remaps the memory that " -"would otherwise be overlaid by address reservations for hardware devices above the 4 GB range and uses it as additional physical memory (see " -"pae4). Using PAE has some drawbacks; this mode of memory access is a " -"little bit slower than the normal (without PAE) mode and loadable modules (see kld4) are not supported. This means all drivers must be compiled into the kernel." -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:1485 -msgid "" -"The most common way to enable PAE is to build a new kernel with the special ready-provided kernel configuration file called PAE, " -"which is already configured to build a safe kernel. Note that some entries in this kernel configuration file are too conservative and some drivers " -"marked as unready to be used with PAE are actually usable. A rule of thumb is that if the driver is usable on 64-bit architectures (like AMD64), it is " -"also usable with PAE. When creating a custom kernel configuration file, PAE can be enabled by adding the following line:" -msgstr "" - -#. (itstool) path: answer/programlisting -#: book.translate.xml:1498 -#, no-wrap -msgid "options PAE" -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:1500 -msgid "" -"PAE is not much used nowadays because most new x86 hardware also supports running in 64-bit mode, known as AMD64 or Intel 64. It has a much larger address space and does not need such tweaks. FreeBSD supports AMD64 and it is recommended that this " -"version of FreeBSD be used instead of the i386 version if 4 GB or more memory is required." -msgstr "" - -#. (itstool) path: sect1/title -#: book.translate.xml:1513 -msgid "Architectures and Processors" -msgstr "" - -#. (itstool) path: question/para -#: book.translate.xml:1518 -msgid "Does FreeBSD support architectures other than the x86?" -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:1523 -msgid "" -"Yes. FreeBSD divides support into multiple tiers. Tier 1 architectures, such as i386 or amd64; are fully supported. Tiers 2 and 3 are supported on a " -"best-effort basis. A full explanation of the tier system is available in the Committer's Guide." -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:1530 -msgid "A complete list of supported architectures can be found on the platforms page." -msgstr "" - -#. (itstool) path: question/para -#: book.translate.xml:1538 -msgid "Does FreeBSD support Symmetric Multiprocessing (SMP)?" -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:1543 -msgid "" -"FreeBSD supports symmetric multi-processor (SMP) on all non-embedded platforms (e.g, i386, amd64, etc.). SMP is also supported in arm and MIPS kernels, " -"although some CPUs may not support this. FreeBSD's SMP implementation uses fine-grained locking, and performance scales nearly linearly with number of " -"CPUs." -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:1551 -msgid "smp4 has more details." -msgstr "" - -#. (itstool) path: question/para -#: book.translate.xml:1557 -msgid "What is microcode? How do I install Intel CPU microcode updates?" -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:1562 -msgid "" -"Microcode is a method of programmatically implementing hardware level instructions. This allows for CPU bugs to be fixed without replacing the on board " -"chip." -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:1567 -msgid "Install sysutils/devcpu-data, then add:" -msgstr "" - -#. (itstool) path: answer/programlisting -#: book.translate.xml:1570 -#, no-wrap -msgid "microcode_update_enable=\"YES\"" -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:1572 -msgid "to /etc/rc.conf" -msgstr "" - -#. (itstool) path: sect1/title -#: book.translate.xml:1579 -msgid "Hard Drives, Tape Drives, and CD and DVD Drives" -msgstr "" - -#. (itstool) path: question/para -#: book.translate.xml:1584 -msgid "What kind of hard drives does FreeBSD support?" -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:1588 -msgid "" -"FreeBSD supports EIDE, SATA, SCSI, and SAS drives (with a compatible controller; see the next section), and all drives using the original " -"Western Digital interface (MFM, RLL, ESDI, and of course IDE). A few ESDI controllers that use proprietary interfaces may not work: " -"stick to WD1002/3/6/7 interfaces and clones." -msgstr "" - -#. (itstool) path: question/para -#: book.translate.xml:1600 -msgid "Which SCSI or SAS controllers are supported?" -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:1604 -msgid "" -"See the complete list in the Hardware Notes for FreeBSD 12.0 or 11.2." -msgstr "" - -#. (itstool) path: question/para -#: book.translate.xml:1612 -msgid "What types of tape drives are supported?" -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:1616 -msgid "FreeBSD supports all standard SCSI tape interfaces." -msgstr "" - -#. (itstool) path: question/para -#: book.translate.xml:1623 -msgid "Does FreeBSD support tape changers?" -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:1627 -msgid "" -"FreeBSD supports SCSI changers using the ch4 device and the " -"chio1 command. The details of how to control the changer can be " -"found in chio1." -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:1632 -msgid "" -"While AMANDA and some other products already understands changers, other applications only know how to move a tape from one " -"point to another. In this case, keep track of which slot a tape is in and which slot the tape currently in the drive needs to go back to." -msgstr "" - -#. (itstool) path: question/para -#: book.translate.xml:1644 -msgid "Which CD-ROM and CD-RW drives are supported by FreeBSD?" -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:1649 -msgid "Any SCSI drive connected to a supported controller is supported. Most ATAPI compatible IDE CD-ROMs are supported." -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:1653 -msgid "FreeBSD supports any ATAPI-compatible IDE CD-R or CD-RW drive." -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:1656 -msgid "" -"FreeBSD also supports any SCSI CD-R or CD-RW drives. Install the sysutils/cdrtools port or package, then use cdrecord." -msgstr "" - -#. (itstool) path: sect1/title -#: book.translate.xml:1665 -msgid "Keyboards and Mice" -msgstr "" - -#. (itstool) path: question/para -#: book.translate.xml:1670 -msgid "Is it possible to use a mouse outside the X Window system?" -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:1675 -msgid "" -"The default console driver, syscons4, provides the ability to use a " -"mouse pointer in text consoles to cut & paste text. Run the mouse daemon, moused8, and turn on the mouse pointer in the virtual console:" -msgstr "" - -#. (itstool) path: answer/screen -#: book.translate.xml:1681 -#, no-wrap -msgid "" -"# moused -p /dev/xxxx -t yyyy\n" -"# vidcontrol -m on" -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:1684 -msgid "" -"Where xxxx is the mouse device name and yyyy is a protocol type for the mouse. The mouse daemon " -"can automatically determine the protocol type of most mice, except old serial mice. Specify the auto protocol to invoke automatic " -"detection. If automatic detection does not work, see the moused8 " -"manual page for a list of supported protocol types." -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:1694 -msgid "" -"For a PS/2 mouse, add moused_enable=\"YES\" to /etc/rc.conf to start the mouse daemon at boot time. " -"Additionally, to use the mouse daemon on all virtual terminals instead of just the console, add allscreens_flags=\"-m on\" to " -"/etc/rc.conf." -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:1703 -msgid "" -"When the mouse daemon is running, access to the mouse must be coordinated between the mouse daemon and other programs such as X Windows. Refer to the " -"FAQ Why does my mouse not work with X? for more details on this issue." -msgstr "" - -#. (itstool) path: question/para -#: book.translate.xml:1714 -msgid "How do I cut and paste text with a mouse in the text console?" -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:1719 -msgid "" -"It is not possible to remove data using the mouse. However, it is possible to copy and paste. Once the mouse daemon is running as described in the " -"previous question, hold down button 1 (left button) and move the mouse to select a region of text. Then, press button 2 " -"(middle button) to paste it at the text cursor. Pressing button 3 (right button) will extend the selected region of text." -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:1728 -msgid "" -"If the mouse does not have a middle button, it is possible to emulate one or remap buttons using mouse daemon options. See the " -"moused8 manual page for details." -msgstr "" - -#. (itstool) path: question/para -#: book.translate.xml:1737 -msgid "My mouse has a fancy wheel and buttons. Can I use them in FreeBSD?" -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:1742 -msgid "" -"The answer is, unfortunately, It depends. These mice with additional features require specialized driver in most cases. Unless the mouse " -"device driver or the user program has specific support for the mouse, it will act just like a standard two, or three button mouse." -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:1749 -msgid "For the possible usage of wheels in the X Window environment, refer to that section." -msgstr "" - -#. (itstool) path: question/para -#: book.translate.xml:1756 -msgid "How do I use my delete key in sh and csh?" -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:1761 -msgid "" -"For the Bourne Shell, add the following lines to ~/.shrc. See sh1 and editrc5." -msgstr "" - -#. (itstool) path: answer/programlisting -#: book.translate.xml:1765 -#, no-wrap -msgid "" -"bind ^? ed-delete-next-char # for console\n" -"bind ^[[3~ ed-delete-next-char # for xterm" -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:1768 -msgid "" -"For the C Shell, add the following lines to ~/.cshrc. See csh1." -msgstr "" - -#. (itstool) path: answer/programlisting -#: book.translate.xml:1772 -#, no-wrap -msgid "" -"bindkey ^? delete-char # for console\n" -"bindkey ^[[3~ delete-char # for xterm" -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:1775 -msgid "For more information, see this page." -msgstr "" - -#. (itstool) path: sect1/title -#: book.translate.xml:1783 -msgid "Other Hardware" -msgstr "" - -#. (itstool) path: question/para -#: book.translate.xml:1788 -msgid "Workarounds for no sound from my pcm4 sound card?" -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:1793 -msgid "Some sound cards set their output volume to 0 at every boot. Run the following command every time the machine boots:" -msgstr "" - -#. (itstool) path: answer/screen -#: book.translate.xml:1797 -#, no-wrap -msgid "# mixer pcm 100 vol 100 cd 100" -msgstr "" - -#. (itstool) path: question/para -#: book.translate.xml:1803 -msgid "Does FreeBSD support power management on my laptop?" -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:1808 -msgid "" -"FreeBSD supports the ACPI features found in modern hardware. Further information can be found in acpi4." -msgstr "" - -#. (itstool) path: chapter/title -#: book.translate.xml:1818 -msgid "Troubleshooting" -msgstr "" - -#. (itstool) path: question/para -#: book.translate.xml:1823 -msgid "Why is FreeBSD finding the wrong amount of memory on i386 hardware?" -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:1828 -msgid "The most likely reason is the difference between physical memory addresses and virtual addresses." -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:1831 -msgid "" -"The convention for most PC hardware is to use the memory area between 3.5 GB and 4 GB for a special purpose (usually for PCI). This address space is " -"used to access PCI hardware. As a result real, physical memory cannot be accessed by that address space." -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:1837 -msgid "" -"What happens to the memory that should appear in that location is hardware dependent. Unfortunately, some hardware does nothing and the ability to use " -"that last 500 MB of RAM is entirely lost." -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:1842 -msgid "" -"Luckily, most hardware remaps the memory to a higher location so that it can still be used. However, this can cause some confusion when watching the " -"boot messages." -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:1847 -msgid "" -"On a 32-bit version of FreeBSD, the memory appears lost, since it will be remapped above 4 GB, which a 32-bit kernel is unable to access. In this case, " -"the solution is to build a PAE enabled kernel. See the entry on memory limits for more information." -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:1853 -msgid "" -"On a 64-bit version of FreeBSD, or when running a PAE-enabled kernel, FreeBSD will correctly detect and remap the memory so it is usable. During boot, " -"however, it may seem as if FreeBSD is detecting more memory than the system really has, due to the described remapping. This is normal and the " -"available memory will be corrected as the boot process completes." -msgstr "" - -#. (itstool) path: question/para -#: book.translate.xml:1865 -msgid "Why do my programs occasionally die with Signal 11 errors?" -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:1870 -msgid "" -"Signal 11 errors are caused when a process has attempted to access memory which the operating system has not granted it access to. If something like " -"this is happening at seemingly random intervals, start investigating the cause." -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:1876 -msgid "These problems can usually be attributed to either:" -msgstr "" - -#. (itstool) path: listitem/para -#: book.translate.xml:1881 -msgid "If the problem is occurring only in a specific custom application, it is probably a bug in the code." -msgstr "" - -#. (itstool) path: listitem/para -#: book.translate.xml:1887 -msgid "" -"If it is a problem with part of the base FreeBSD system, it may also be buggy code, but more often than not these problems are found and fixed long " -"before us general FAQ readers get to use these bits of code (that is what -CURRENT is for)." -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:1896 -msgid "It is probably not a FreeBSD bug if the problem occurs compiling a program, but the activity that the compiler is carrying out changes each time." -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:1902 -msgid "" -"For example, if make buildworld fails while trying to compile ls.c into ls.o and, when run " -"again, it fails in the same place, this is a broken build. Try updating source and try again. If the compile fails elsewhere, it is almost certainly " -"due to hardware." -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:1910 -msgid "" -"In the first case, use a debugger such as gdb1 to find the point in " -"the program which is attempting to access a bogus address and fix it." -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:1915 -msgid "In the second case, verify which piece of hardware is at fault." -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:1918 -msgid "Common causes of this include:" -msgstr "" - -#. (itstool) path: listitem/para -#: book.translate.xml:1922 -msgid "The hard disks might be overheating: Check that the fans are still working, as the disk and other hardware might be overheating." -msgstr "" - -#. (itstool) path: listitem/para -#: book.translate.xml:1928 -msgid "" -"The processor running is overheating: This might be because the processor has been overclocked, or the fan on the processor might have died. In either " -"case, ensure that the hardware is running at what it is specified to run at, at least while trying to solve this problem. If it is not, clock it back " -"to the default settings.)" -msgstr "" - -#. (itstool) path: listitem/para -#: book.translate.xml:1936 -msgid "" -"Regarding overclocking, it is far cheaper to have a slow system than a fried system that needs replacing! Also the community is not sympathetic to " -"problems on overclocked systems." -msgstr "" - -#. (itstool) path: listitem/para -#: book.translate.xml:1943 -msgid "" -"Dodgy memory: if multiple memory SIMMS/DIMMS are installed, pull them all out and try running the machine with each SIMM or DIMM individually to narrow " -"the problem down to either the problematic DIMM/SIMM or perhaps even a combination." -msgstr "" - -#. (itstool) path: listitem/para -#: book.translate.xml:1952 -msgid "" -"Over-optimistic motherboard settings: the BIOS settings, and some motherboard jumpers, provide options to set various timings. The defaults are often " -"sufficient, but sometimes setting the wait states on RAM too low, or setting the RAM Speed: Turbo option will cause strange behavior. A " -"possible idea is to set to BIOS defaults, after noting the current settings first." -msgstr "" - -#. (itstool) path: listitem/para -#: book.translate.xml:1964 -msgid "" -"Unclean or insufficient power to the motherboard. Remove any unused I/O boards, hard disks, or CD-ROMs, or disconnect the power cable from them, to see " -"if the power supply can manage a smaller load. Or try another power supply, preferably one with a little more power. For instance, if the current power " -"supply is rated at 250 Watts, try one rated at 300 Watts." -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:1976 -msgid "" -"Read the section on Signal 11 for a further explanation and a discussion on how memory testing software or hardware " -"can still pass faulty memory. There is an extensive FAQ on this at the SIG11 " -"problem FAQ." -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:1983 -msgid "" -"Finally, if none of this has helped, it is possibly a bug in FreeBSD. Follow these instructions to send a problem " -"report." -msgstr "" - -#. (itstool) path: question/para -#: book.translate.xml:1992 -msgid "" -"My system crashes with either Fatal trap 12: page fault in kernel mode, or panic:, and spits out a bunch " -"of information. What should I do?" -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:1999 -msgid "" -"The FreeBSD developers are interested in these errors, but need more information than just the error message. Copy the full crash message. Then consult " -"the FAQ section on kernel panics, build a debugging kernel, and get a " -"backtrace. This might sound difficult, but does not require any programming skills. Just follow the instructions." -msgstr "" - -#. (itstool) path: question/para -#: book.translate.xml:2012 -msgid "What is the meaning of the error maxproc limit exceeded by uid %i, please see tuning(7) and login.conf(5)?" -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:2018 -msgid "" -"The FreeBSD kernel will only allow a certain number of processes to exist at one time. The number is based on the kern.maxusers " -"sysctl8 variable. kern.maxusers also affects " -"various other in-kernel limits, such as network buffers. If the machine is heavily loaded, increase kern.maxusers. This will " -"increase these other system limits in addition to the maximum number of processes." -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:2028 -msgid "" -"To adjust the kern.maxusers value, see the File/Process Limits section of the Handbook. While that section refers to open files, the same limits apply " -"to processes." -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:2034 -msgid "" -"If the machine is lightly loaded but running a very large number of processes, adjust the kern.maxproc tunable by defining it in " -"/boot/loader.conf. The tunable will not get adjusted until the system is rebooted. For more information about tuning tunables, see " -"loader.conf5. If these processes are being run by a single user, " -"adjust kern.maxprocperuid to be one less than the new kern.maxproc value. It must be at least one less because " -"one system program, init8, must always be running." -msgstr "" - -#. (itstool) path: question/para -#: book.translate.xml:2051 -msgid "Why do full screen applications on remote machines misbehave?" -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:2056 -msgid "" -"The remote machine may be setting the terminal type to something other than xterm which is required by the FreeBSD console. " -"Alternatively the kernel may have the wrong values for the width and height of the terminal." -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:2062 -msgid "" -"Check the value of the TERM environment variable is xterm. If the remote machine does not support that try " -"vt100." -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:2067 -msgid "" -"Run stty -a to check what the kernel thinks the terminal dimensions are. If they are incorrect, they can be changed by running " -"stty rows RR cols CC." -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:2073 -msgid "" -"Alternatively, if the client machine has x11/xterm installed, then running resize will query the terminal for the " -"correct dimensions and set them." -msgstr "" - -#. (itstool) path: question/para -#: book.translate.xml:2082 -msgid "Why does it take so long to connect to my computer via ssh or telnet?" -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:2088 -msgid "" -"The symptom: there is a long delay between the time the TCP connection is established and the time when the client software asks for a password (or, in " -"telnet1's case, when a login prompt appears)." -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:2094 -msgid "" -"The problem: more likely than not, the delay is caused by the server software trying to resolve the client's IP address into a hostname. Many servers, " -"including the Telnet and SSH servers that come with FreeBSD, do this to store the hostname in a " -"log file for future reference by the administrator." -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:2102 -msgid "" -"The remedy: if the problem occurs whenever connecting the client computer to any server, the problem is with the client. If the problem only occurs " -"when someone connects to the server computer, the problem is with the server." -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:2108 -msgid "" -"If the problem is with the client, the only remedy is to fix the DNS so the server can resolve it. If this is on a local network, consider it a server " -"problem and keep reading. If this is on the Internet, contact your ISP." -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:2114 -msgid "" -"If the problem is with the server on a local network, configure the server to resolve address-to-hostname queries for the local address range. See " -"hosts5 and named8 for more information. If this is on the Internet, the problem may be that the local server's " -"resolver is not functioning correctly. To check, try to look up another host such as www.yahoo.com. If it does not work, that " -"is the problem." -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:2125 -msgid "" -"Following a fresh install of FreeBSD, it is also possible that domain and name server information is missing from /etc/resolv.conf. This will often cause a delay in SSH, as the option UseDNS is set to yes by " -"default in /etc/ssh/sshd_config. If this is causing the problem, either fill in the missing information in /etc/resolv." -"conf or set UseDNS to no in sshd_config as a temporary workaround." -msgstr "" - -#. (itstool) path: question/para -#: book.translate.xml:2143 -msgid "" -"Why does file: table is full show up repeatedly in dmesg8?" -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:2148 -msgid "" -"This error message indicates that the number of available file descriptors have been exhausted on the system. Refer to the kern.maxfiles section of the Tuning Kernel Limits section of the Handbook for a " -"discussion and solution." -msgstr "" - -#. (itstool) path: question/para -#: book.translate.xml:2159 -msgid "Why does the clock on my computer keep incorrect time?" -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:2164 -msgid "The computer has two or more clocks, and FreeBSD has chosen to use the wrong one." -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:2167 -msgid "" -"Run dmesg8, and check for lines that contain Timecounter. The one with the highest quality value that FreeBSD chose." -msgstr "" - -#. (itstool) path: answer/screen -#: book.translate.xml:2171 -#, no-wrap -msgid "" -"# dmesg | grep Timecounter\n" -"Timecounter \"i8254\" frequency 1193182 Hz quality 0\n" -"Timecounter \"ACPI-fast\" frequency 3579545 Hz quality 1000\n" -"Timecounter \"TSC\" frequency 2998570050 Hz quality 800\n" -"Timecounters tick every 1.000 msec" -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:2177 -msgid "" -"Confirm this by checking the kern.timecounter.hardware sysctl3." -msgstr "" - -#. (itstool) path: answer/screen -#: book.translate.xml:2181 -#, no-wrap -msgid "" -"# sysctl kern.timecounter.hardware\n" -"kern.timecounter.hardware: ACPI-fast" -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:2184 -msgid "It may be a broken ACPI timer. The simplest solution is to disable the ACPI timer in /boot/loader.conf:" -msgstr "" - -#. (itstool) path: answer/programlisting -#: book.translate.xml:2188 -#, no-wrap -msgid "debug.acpi.disabled=\"timer\"" -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:2190 -msgid "" -"Or the BIOS may modify the TSC clock—perhaps to change the speed of the processor when running from batteries, or going into a power saving mode, but " -"FreeBSD is unaware of these adjustments, and appears to gain or lose time." -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:2196 -msgid "" -"In this example, the i8254 clock is also available, and can be selected by writing its name to the kern.timecounter." -"hardware sysctl3." -msgstr "" - -#. (itstool) path: answer/screen -#: book.translate.xml:2201 -#, no-wrap -msgid "" -"# sysctl kern.timecounter.hardware=i8254\n" -"kern.timecounter.hardware: TSC -> i8254" -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:2204 -msgid "The computer should now start keeping more accurate time." -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:2207 -msgid "To have this change automatically run at boot time, add the following line to /etc/sysctl.conf:" -msgstr "" - -#. (itstool) path: answer/programlisting -#: book.translate.xml:2211 -#, no-wrap -msgid "kern.timecounter.hardware=i8254" -msgstr "" - -#. (itstool) path: question/para -#: book.translate.xml:2217 -msgid "What does the error swap_pager: indefinite wait buffer: mean?" -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:2222 -msgid "" -"This means that a process is trying to page memory from disk, and the page attempt has hung trying to access the disk for more than 20 seconds. It " -"might be caused by bad blocks on the disk drive, disk wiring, cables, or any other disk I/O-related hardware. If the drive itself is bad, disk errors " -"will appear in /var/log/messages and in the output of dmesg. Otherwise, check the cables and connections." -msgstr "" - -#. (itstool) path: question/para -#: book.translate.xml:2237 -msgid "What is a lock order reversal?" -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:2242 -msgid "" -"The FreeBSD kernel uses a number of resource locks to arbitrate contention for certain resources. When multiple kernel threads try to obtain multiple " -"resource locks, there's always the potential for a deadlock, where two threads have each obtained one of the locks and blocks forever waiting for the " -"other thread to release one of the other locks. This sort of locking problem can be avoided if all threads obtain the locks in the same order." -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:2251 -msgid "" -"A run-time lock diagnostic system called witness4, enabled in " -"FreeBSD-CURRENT and disabled by default for stable branches and releases, detects the potential for deadlocks due to locking errors, including errors " -"caused by obtaining multiple resource locks with a different order from different parts of the kernel. The witness4 framework tries to detect this problem as it happens, and reports it by printing a message to the " -"system console about a lock order reversal (often referred to also as LOR)." -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:2263 -msgid "" -"It is possible to get false positives, as witness4 is conservative. " -"A true positive report does not mean that a system is dead-locked; instead it should be understood as a warning that a deadlock " -"could have happened here." -msgstr "" - -#. (itstool) path: note/para -#: book.translate.xml:2270 -msgid "" -"Problematic LORs tend to get fixed quickly, so check the FreeBSD-CURRENT mailing list before posting to it." -msgstr "" - -#. (itstool) path: question/para -#: book.translate.xml:2279 -msgid "What does Called ... with the following non-sleepable locks held mean?" -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:2284 -msgid "This means that a function that may sleep was called while a mutex (or other unsleepable) lock was held." -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:2287 -msgid "" -"The reason this is an error is because mutexes are not intended to be held for long periods of time; they are supposed to only be held to maintain " -"short periods of synchronization. This programming contract allows device drivers to use mutexes to synchronize with the rest of the kernel during " -"interrupts. Interrupts (under FreeBSD) may not sleep. Hence it is imperative that no subsystem in the kernel block for an extended period while holding " -"a mutex." -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:2297 -msgid "" -"To catch such errors, assertions may be added to the kernel that interact with the witness4 subsystem to emit a warning or fatal error (depending on the system configuration) when a potentially blocking call is made " -"while holding a mutex." -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:2303 -msgid "" -"In summary, such warnings are non-fatal, however with unfortunate timing they could cause undesirable effects ranging from a minor blip in the system's " -"responsiveness to a complete system lockup." -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:2308 -msgid "" -"For additional information about locking in FreeBSD see locking9." -msgstr "" - -#. (itstool) path: para/buildtarget -#: book.translate.xml:2316 -msgid "buildworld" -msgstr "" - -#. (itstool) path: para/buildtarget -#: book.translate.xml:2316 -msgid "installworld" -msgstr "" - -#. (itstool) path: question/para -#: book.translate.xml:2315 -msgid "Why does <_:buildtarget-1/>/<_:buildtarget-2/> die with the message touch: not found?" -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:2322 -msgid "" -"This error does not mean that the touch1 utility is missing. The " -"error is instead probably due to the dates of the files being set sometime in the future. If the CMOS clock is set to local time, run " -"adjkerntz -i to adjust the kernel clock when booting into single-user mode." -msgstr "" - -#. (itstool) path: chapter/title -#: book.translate.xml:2335 -msgid "User Applications" -msgstr "" - -#. (itstool) path: question/para -#: book.translate.xml:2340 -msgid "Where are all the user applications?" -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:2344 -msgid "" -"Refer to the ports page for info on software packages ported to FreeBSD. The list " -"currently tops 24,000 and is growing daily, so come back to check often or subscribe to the FreeBSD announcements mailing list for periodic updates on new entries." -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:2351 -msgid "" -"Most ports should work on all supported versions of FreeBSD. Those that do not are specifically marked as such. Each time a FreeBSD release is made, a " -"snapshot of the ports tree at the time of release in also included in the ports/ directory." -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:2357 -msgid "" -"FreeBSD supports compressed binary packages to easily install and uninstall ports. Use pkg7 to control the installation of packages." -msgstr "" - -#. (itstool) path: question/para -#: book.translate.xml:2365 -msgid "How do I download the Ports tree? Should I be using Subversion?" -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:2370 -msgid "Any of the methods listed here work:" -msgstr "" - -#. (itstool) path: listitem/para -#: book.translate.xml:2374 -msgid "" -"Use portsnap for most use cases. Refer to Using the Ports " -"Collection for instructions on how to use this tool." -msgstr "" - -#. (itstool) path: listitem/para -#: book.translate.xml:2379 -#, fuzzy -msgid "" -"Use Subversion if custom patches to the ports tree are needed. Refer to Using Subversion for details." -msgstr "" -"如果想看關於 FreeBSD 更深入的資料,請看 FreeBSD 使用手冊。" - -#. (itstool) path: question/para -#: book.translate.xml:2389 -msgid "Does FreeBSD support Java?" -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:2393 -msgid "Yes. Refer to https://www.FreeBSD.org/java/ for more information." -msgstr "" - -#. (itstool) path: question/para -#: book.translate.xml:2400 -#, fuzzy -msgid "Why can I not build this port on my 11.X -, or 12.X -STABLE machine?" -msgstr "FreeBSD 10.X and 11.X 常見問答集" - -#. (itstool) path: answer/para -#: book.translate.xml:2406 -msgid "" -"If the installed FreeBSD version lags significantly behind -CURRENT or -STABLE, update the Ports Collection " -"using the instructions in Using the Ports Collection. " -"If the system is up-to-date, someone might have committed a change to the port which works for -CURRENT but which broke the port " -"for -STABLE. Submit a bug report, since the Ports Collection is " -"supposed to work for both the -CURRENT and -STABLE branches." -msgstr "" - -#. (itstool) path: question/para -#: book.translate.xml:2423 -msgid "I just tried to build INDEX using make index, and it failed. Why?" -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:2428 -msgid "" -"First, make sure that the Ports Collection is up-to-date. Errors that affect building INDEX from an up-to-date copy of the Ports " -"Collection are high-visibility and are thus almost always fixed immediately." -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:2434 -msgid "" -"There are rare cases where INDEX will not build due to odd cases involving OPTIONS_SET being set in " -"make.conf. If you suspect that this is the case, try to make INDEX with those variables turned off before " -"reporting it to FreeBSD ports mailing list." -msgstr "" - -#. (itstool) path: question/para -#: book.translate.xml:2446 -msgid "I updated the sources, now how do I update my installed ports?" -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:2451 -msgid "" -"FreeBSD does not include a port upgrading tool, but it does have some tools to make the upgrade process somewhat easier. Additional tools are available " -"to simplify port handling and are described the Upgrading " -"Ports section in the FreeBSD Handbook." -msgstr "" - -#. (itstool) path: question/para -#: book.translate.xml:2461 -msgid "Do I need to recompile every port each time I perform a major version update?" -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:2466 -msgid "" -"Yes! While a recent system will run with software compiled under an older release, things will randomly crash and fail to work once other ports are " -"installed or updated." -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:2471 -msgid "" -"When the system is upgraded, various shared libraries, loadable modules, and other parts of the system will be replaced with newer versions. " -"Applications linked against the older versions may fail to start or, in other cases, fail to function properly." -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:2477 -msgid "" -"For more information, see the section on upgrades in the FreeBSD Handbook." -msgstr "" - -#. (itstool) path: question/para -#: book.translate.xml:2484 -msgid "Do I need to recompile every port each time I perform a minor version update?" -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:2489 -msgid "" -"In general, no. FreeBSD developers do their utmost to guarantee binary compatibility across all releases with the same major version number. Any " -"exceptions will be documented in the Release Notes, and advice given there should be followed." -msgstr "" - -#. (itstool) path: question/para -#: book.translate.xml:2499 -msgid "Why is /bin/sh so minimal? Why does FreeBSD not use bash or another shell?" -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:2505 -msgid "" -"Many people need to write shell scripts which will be portable across many systems. That is why POSIX " -"specifies the shell and utility commands in great detail. Most scripts are written in Bourne shell (sh1), and because several important programming interfaces (make1, system3, " -"popen3, and analogues in higher-level scripting languages like Perl " -"and Tcl) are specified to use the Bourne shell to interpret commands. Because the Bourne shell is so often and widely used, it is important for it to " -"be quick to start, be deterministic in its behavior, and have a small memory footprint." -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:2518 -msgid "" -"The existing implementation is our best effort at meeting as many of these requirements simultaneously as we can. To keep /bin/sh " -"small, we have not provided many of the convenience features that other shells have. That is why other more featureful shells like bash, scsh, tcsh1, and zsh " -"are available. Compare the memory utilization of these shells by looking at the VSZ and RSS columns in a ps -u listing." -msgstr "" - -#. (itstool) path: question/para -#: book.translate.xml:2534 -msgid "How do I create audio CDs from my MIDI files?" -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:2538 -msgid "" -"To create audio CDs from MIDI files, first install audio/timidity++ from ports then install manually the GUS patches set by Eric A. " -"Welsh, available at http://alleg.sourceforge.net/digmid.html. After " -"TiMidity++ has been installed properly, MIDI files may be converted to WAV files with the following command line:" -msgstr "" - -#. (itstool) path: answer/screen -#: book.translate.xml:2546 -#, no-wrap -msgid "% timidity -Ow -s 44100 -o /tmp/juke/01.wav 01.mid" -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:2548 -msgid "" -"The WAV files can then be converted to other formats or burned onto audio CDs, as described in the FreeBSD Handbook." -msgstr "" - -#. (itstool) path: chapter/title -#: book.translate.xml:2557 -msgid "Kernel Configuration" -msgstr "" - -#. (itstool) path: question/para -#: book.translate.xml:2562 -msgid "I would like to customize my kernel. Is it difficult?" -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:2567 -msgid "" -"Not at all! Check out the kernel config section of the " -"Handbook." -msgstr "" - -#. (itstool) path: note/para -#: book.translate.xml:2571 -msgid "" -"The new kernel will be installed to the /boot/kernel directory along with its modules, while the old kernel " -"and its modules will be moved to the /boot/kernel.old directory. If a mistake is made in the configuration, simply boot the " -"previous version of the kernel." -msgstr "" - -#. (itstool) path: question/para -#: book.translate.xml:2585 -msgid "Why is my kernel so big?" -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:2589 -msgid "" -"GENERIC kernels shipped with FreeBSD are compiled in debug mode. Kernels built in debug mode contain debug data " -"in separate files that are used for debugging. FreeBSD releases prior to 11.0 store these debug files in the same directory as the kernel itself, " -"/boot/kernel/. In FreeBSD 11.0 and later the debug files are stored in /usr/lib/debug/boot/kernel/. Note that " -"there will be little or no performance loss from running a debug kernel, and it is useful to keep one around in case of a system panic." -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:2602 -msgid "" -"When running low on disk space, there are different options to reduce the size of /boot/kernel/ and /usr/lib/debug/." -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:2607 -msgid "To not install the symbol files, make sure the following line exists in /etc/src.conf:" -msgstr "" - -#. (itstool) path: answer/programlisting -#: book.translate.xml:2611 -#, no-wrap -msgid "WITHOUT_KERNEL_SYMBOLS=yes" -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:2613 -msgid "For more information see src.conf5." -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:2615 -msgid "If you want to avoid building debug files altogether, make sure that both of the following are true:" -msgstr "" - -#. (itstool) path: listitem/para -#: book.translate.xml:2620 -msgid "This line does not exist in the kernel configuration file:" -msgstr "" - -#. (itstool) path: listitem/programlisting -#: book.translate.xml:2623 -#, no-wrap -msgid "makeoptions DEBUG=-g" -msgstr "" - -#. (itstool) path: listitem/para -#: book.translate.xml:2627 -msgid "Do not run config8 with ." -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:2632 -msgid "Either of the above settings will cause the kernel to be built in debug mode." -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:2635 -msgid "To build and install only the specified modules, list them in /etc/make.conf:" -msgstr "" - -#. (itstool) path: answer/programlisting -#: book.translate.xml:2639 -#, no-wrap -msgid "MODULES_OVERRIDE= accf_http ipfw" -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:2641 -msgid "" -"Replace accf_httpd ipfw with a list of needed modules. Only the listed modules will be built. This reduces the size of the kernel " -"directory and decreases the amount of time needed to build the kernel. For more information, read /usr/share/examples/etc/make.conf." -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:2648 -msgid "Unneeded devices can be removed from the kernel to further reduce the size. See for more information." -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:2651 -msgid "" -"To put any of these options into effect, follow the instructions to build and install the new kernel." -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:2655 -msgid "For reference, the FreeBSD 11 amd64 kernel (/boot/kernel/kernel) is approximately 25 MB." -msgstr "" - -#. (itstool) path: question/para -#: book.translate.xml:2663 -msgid "Why does every kernel I try to build fail to compile, even GENERIC?" -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:2668 -msgid "There are a number of possible causes for this problem:" -msgstr "" - -#. (itstool) path: listitem/para -#: book.translate.xml:2673 -msgid "" -"The source tree is different from the one used to build the currently running system. When attempting an upgrade, read /usr/src/UPDATING, paying particular attention to the COMMON ITEMS section at the end." -msgstr "" - -#. (itstool) path: listitem/para -#: book.translate.xml:2682 -msgid "" -"The make buildkernel did not complete successfully. The make buildkernel target relies on files generated by the " -"make buildworld target to complete its job correctly." -msgstr "" - -#. (itstool) path: listitem/para -#: book.translate.xml:2690 -msgid "" -"Even when building FreeBSD-STABLE, it is possible that the source tree was fetched at a time when it was either being " -"modified or it was broken. Only releases are guaranteed to be buildable, although FreeBSD-STABLE builds fine the " -"majority of the time. Try re-fetching the source tree and see if the problem goes away. Try using a different mirror in case the previous one is having " -"problems." -msgstr "" - -#. (itstool) path: question/para -#: book.translate.xml:2706 -msgid "Which scheduler is in use on a running system?" -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:2711 -msgid "The name of the scheduler currently being used is directly available as the value of the kern.sched.name sysctl:" -msgstr "" - -#. (itstool) path: answer/screen -#: book.translate.xml:2715 -#, no-wrap -msgid "" -"% sysctl kern.sched.name\n" -"kern.sched.name: ULE" -msgstr "" - -#. (itstool) path: question/para -#: book.translate.xml:2722 -msgid "What is kern.sched.quantum?" -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:2726 -msgid "kern.sched.quantum is the maximum number of ticks a process can run without being preempted in the 4BSD scheduler." -msgstr "" - -#. (itstool) path: chapter/title -#: book.translate.xml:2735 -msgid "Disks, File Systems, and Boot Loaders" -msgstr "" - -#. (itstool) path: question/para -#: book.translate.xml:2740 -msgid "How can I add my new hard disk to my FreeBSD system?" -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:2745 -msgid "" -"See the Adding Disks section in the FreeBSD Handbook." -msgstr "" - -#. (itstool) path: question/para -#: book.translate.xml:2752 -msgid "How do I move my system over to my huge new disk?" -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:2757 -msgid "" -"The best way is to reinstall the operating system on the new disk, then move the user data over. This is highly recommended when tracking -" -"STABLE for more than one release or when updating a release instead of installing a new one. Install booteasy on both disks with " -"boot0cfg8 and dual boot until you are happy with the new " -"configuration. Skip the next paragraph to find out how to move the data after doing this." -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:2767 -msgid "" -"Alternatively, partition and label the new disk with either sade8 or " -"gpart8. If the disks are MBR-formatted, booteasy can be installed on " -"both disks with boot0cfg8 so that the computer can dual boot to the " -"old or new system after the copying is done." -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:2773 -msgid "" -"Once the new disk set up, the data cannot just be copied. Instead, use tools that understand device files and system flags, such as " -"dump8. Although it is recommended to move the data while in single-" -"user mode, it is not required." -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:2780 -msgid "" -"When the disks are formatted with UFS, never use anything but dump8 and restore8 to move the root file system. " -"These commands should also be used when moving a single partition to another empty partition. The sequence of steps to use dump to " -"move the data from one UFS partitions to a new partition is:" -msgstr "" - -#. (itstool) path: step/para -#: book.translate.xml:2791 -msgid "newfs the new partition." -msgstr "" - -#. (itstool) path: step/para -#: book.translate.xml:2795 -msgid "mount it on a temporary mount point." -msgstr "" - -#. (itstool) path: step/para -#: book.translate.xml:2800 -msgid "cd to that directory." -msgstr "" - -#. (itstool) path: step/para -#: book.translate.xml:2804 -msgid "dump the old partition, piping output to the new one." -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:2809 -msgid "For example, to move /dev/ada1s1a with /mnt as the temporary mount point, type:" -msgstr "" - -#. (itstool) path: answer/screen -#: book.translate.xml:2814 -#, no-wrap -msgid "" -"# newfs /dev/ada1s1a\n" -"# mount /dev/ada1s1a /mnt\n" -"# cd /mnt\n" -"# dump 0af - / | restore rf -" -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:2819 -msgid "" -"Rearranging partitions with dump takes a bit more work. To merge a partition like /var into its parent, create " -"the new partition large enough for both, move the parent partition as described above, then move the child partition into the empty directory that the " -"first move created:" -msgstr "" - -#. (itstool) path: answer/screen -#: book.translate.xml:2827 -#, no-wrap -msgid "" -"# newfs /dev/ada1s1a\n" -"# mount /dev/ada1s1a /mnt\n" -"# cd /mnt\n" -"# dump 0af - / | restore rf -\n" -"# cd var\n" -"# dump 0af - /var | restore rf -" -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:2834 -msgid "" -"To split a directory from its parent, say putting /var on its own partition when it was not before, create both partitions, then " -"mount the child partition on the appropriate directory in the temporary mount point, then move the old single partition:" -msgstr "" - -#. (itstool) path: answer/screen -#: book.translate.xml:2840 -#, no-wrap -msgid "" -"# newfs /dev/ada1s1a\n" -"# newfs /dev/ada1s1d\n" -"# mount /dev/ada1s1a /mnt\n" -"# mkdir /mnt/var\n" -"# mount /dev/ada1s1d /mnt/var\n" -"# cd /mnt\n" -"# dump 0af - / | restore rf -" -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:2848 -msgid "" -"The cpio1 and pax1 utilities are also available for moving user data. These are known to lose file flag information, " -"so use them with caution." -msgstr "" - -#. (itstool) path: question/para -#: book.translate.xml:2856 -msgid "" -"Which partitions can safely use Soft Updates? I have heard that Soft Updates on / can cause problems. What about Journaled Soft " -"Updates?" -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:2862 -msgid "Short answer: Soft Updates can usually be safely used on all partitions." -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:2865 -msgid "" -"Long answer: Soft Updates has two characteristics that may be undesirable on certain partitions. First, a Soft Updates partition has a small chance of " -"losing data during a system crash. The partition will not be corrupted as the data will simply be lost. Second, Soft Updates can cause temporary space " -"shortages." -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:2872 -msgid "" -"When using Soft Updates, the kernel can take up to thirty seconds to write changes to the physical disk. When a large file is deleted the file still " -"resides on disk until the kernel actually performs the deletion. This can cause a very simple race condition. Suppose one large file is deleted and " -"another large file is immediately created. The first large file is not yet actually removed from the physical disk, so the disk might not have enough " -"room for the second large file. This will produce an error that the partition does not have enough space, even though a large chunk of space has just " -"been released. A few seconds later, the file creation works as expected." -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:2886 -msgid "" -"If a system should crash after the kernel accepts a chunk of data for writing to disk, but before that data is actually written out, data could be " -"lost. This risk is extremely small, but generally manageable." -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:2891 -msgid "These issues affect all partitions using Soft Updates. So, what does this mean for the root partition?" -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:2894 -msgid "" -"Vital information on the root partition changes very rarely. If the system crashed during the thirty-second window after such a change is made, it is " -"possible that data could be lost. This risk is negligible for most applications, but be aware that it exists. If the system cannot tolerate this much " -"risk, do not use Soft Updates on the root file system!" -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:2902 -msgid "" -"/ is traditionally one of the smallest partitions. If /tmp is on /, there may be " -"intermittent space problems. Symlinking /tmp to /var/tmp will solve this problem." -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:2910 -msgid "" -"Finally, dump8 does not work in live mode (-L) on a filesystem, with " -"Journaled Soft Updates (SU+J)." -msgstr "" - -#. (itstool) path: question/para -#: book.translate.xml:2918 -msgid "Can I mount other foreign file systems under FreeBSD?" -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:2923 -msgid "FreeBSD supports a variety of other file systems." -msgstr "" - -#. (itstool) path: varlistentry/term -#: book.translate.xml:2927 -msgid "UFS" -msgstr "" - -#. (itstool) path: listitem/para -#: book.translate.xml:2930 -msgid "" -"UFS CD-ROMs can be mounted directly on FreeBSD. Mounting disk partitions from Digital UNIX and other systems that support UFS may be more complex, " -"depending on the details of the disk partitioning for the operating system in question." -msgstr "" - -#. (itstool) path: varlistentry/term -#: book.translate.xml:2939 -msgid "ext2/ext3" -msgstr "" - -#. (itstool) path: listitem/para -#: book.translate.xml:2942 -msgid "" -"FreeBSD supports ext2fs and ext3fs partitions. See ext2fs5 for more information." -msgstr "" - -#. (itstool) path: varlistentry/term -#: book.translate.xml:2949 -msgid "NTFS" -msgstr "" - -#. (itstool) path: listitem/para -#: book.translate.xml:2952 -msgid "" -"FUSE based NTFS support is available as a port (sysutils/fusefs-ntfs). For more information see ntfs-3g." -msgstr "" - -#. (itstool) path: varlistentry/term -#: book.translate.xml:2959 -msgid "FAT" -msgstr "" - -#. (itstool) path: listitem/para -#: book.translate.xml:2962 -msgid "" -"FreeBSD includes a read-write FAT driver. For more information, see mount_msdosfs8." -msgstr "" - -#. (itstool) path: varlistentry/term -#. (itstool) path: chapter/title -#: book.translate.xml:2968 book.translate.xml:3379 -msgid "ZFS" -msgstr "" - -#. (itstool) path: listitem/para -#: book.translate.xml:2971 -msgid "" -"FreeBSD includes a port of Sun's ZFS driver. The current recommendation is to use it only on amd64 platforms with sufficient " -"memory. For more information, see zfs8." -msgstr "" -"FreeBSD 包含由 Sun 移植過來的 ZFS 驅動程式。 目前的建議是僅在記憶體充足的 amd64 平臺上使用它。有關更詳細資訊, 請參閱 " -"zfs8。" - -#. (itstool) path: answer/para -#: book.translate.xml:2979 -msgid "" -"FreeBSD includes the Network File System NFS and the FreeBSD Ports Collection provides several FUSE applications to support many " -"other file systems." -msgstr "" - -#. (itstool) path: question/para -#: book.translate.xml:2988 -msgid "How do I mount a secondary DOS partition?" -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:2992 -msgid "" -"The secondary DOS partitions are found after all the primary partitions. For example, if E is the second DOS " -"partition on the second SCSI drive, there will be a device file for slice 5 in /dev. To mount it:" -msgstr "" - -#. (itstool) path: answer/screen -#: book.translate.xml:2999 -#, no-wrap -msgid "# mount -t msdosfs /dev/da1s5 /dos/e" -msgstr "" - -#. (itstool) path: question/para -#: book.translate.xml:3005 -msgid "Is there a cryptographic file system for FreeBSD?" -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:3009 -msgid "" -"Yes, gbde8 and geli8. See the Encrypting Disk Partitions section of the FreeBSD Handbook." -msgstr "" - -#. (itstool) path: question/para -#: book.translate.xml:3018 -msgid "How do I boot FreeBSD and Linux using GRUB?" -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:3023 -msgid "" -"To boot FreeBSD using GRUB, add the following to either /boot/grub/menu.lst or /boot/grub/" -"grub.conf, depending upon which is used by the Linux distribution." -msgstr "" - -#. (itstool) path: answer/programlisting -#: book.translate.xml:3029 -#, no-wrap -msgid "" -"title FreeBSD 9.1\n" -"\troot (hd0,a)\n" -"\tkernel /boot/loader" -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:3033 -msgid "" -"Where hd0,a points to the root partition on the first disk. To specify the slice number, use something like this " -"(hd0,2,a). By default, if the slice number is omitted, GRUB searches the first slice which has " -"the a partition." -msgstr "" - -#. (itstool) path: question/para -#: book.translate.xml:3045 -msgid "How do I boot FreeBSD and Linux using BootEasy?" -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:3050 -msgid "" -"Install LILO at the start of the Linux boot partition instead of in the Master Boot Record. You can then " -"boot LILO from BootEasy." -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:3055 -msgid "" -"This is recommended when running Windows and Linux as it makes " -"it simpler to get Linux booting again if Windows is reinstalled." -msgstr "" - -#. (itstool) path: question/para -#: book.translate.xml:3063 -msgid "How do I change the boot prompt from ??? to something more meaningful?" -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:3069 -msgid "" -"This cannot be accomplished with the standard boot manager without rewriting it. There are a number of other boot managers in the sysutils category of the Ports Collection." -msgstr "" - -#. (itstool) path: question/para -#: book.translate.xml:3078 -msgid "How do I use a new removable drive?" -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:3082 -msgid "If the drive already has a file system on it, use a command like this:" -msgstr "" - -#. (itstool) path: answer/screen -#: book.translate.xml:3085 -#, no-wrap -msgid "# mount -t msdosfs /dev/da0s1 /mnt" -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:3087 -msgid "" -"If the drive will only be used with FreeBSD systems, partition it with UFS or ZFS. This will provide long " -"filename support, improvement in performance, and stability. If the drive will be used by other operating systems, a more portable choice, such as " -"msdosfs, is better." -msgstr "" - -#. (itstool) path: answer/screen -#: book.translate.xml:3094 -#, no-wrap -msgid "" -"# dd if=/dev/zero of=/dev/da0 count=2\n" -"# gpart create -s GPT /dev/da0\n" -"# gpart add -t freebsd-ufs /dev/da0" -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:3098 -msgid "Finally, create a new file system:" -msgstr "" - -#. (itstool) path: answer/screen -#: book.translate.xml:3100 -#, no-wrap -msgid "# newfs /dev/da0p1" -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:3102 -msgid "and mount it:" -msgstr "" - -#. (itstool) path: answer/screen -#: book.translate.xml:3104 -#, no-wrap -msgid "# mount /dev/da0s1 /mnt" -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:3106 -msgid "" -"It is a good idea to add a line to /etc/fstab (see fstab5) so you can just type mount /mnt in the future:" -msgstr "" - -#. (itstool) path: answer/programlisting -#: book.translate.xml:3111 -#, no-wrap -msgid "/dev/da0p1 /mnt ufs rw,noauto 0 0" -msgstr "" - -#. (itstool) path: question/para -#: book.translate.xml:3117 -msgid "Why do I get Incorrect super block when mounting a CD?" -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:3122 -msgid "" -"The type of device to mount must be specified. This is described in the Handbook section on Using Data CDs." -msgstr "" - -#. (itstool) path: question/para -#: book.translate.xml:3130 -msgid "Why do I get Device not configured when mounting a CD?" -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:3135 -msgid "" -"This generally means that there is no CD in the drive, or the drive is not visible on the bus. Refer to the Using Data CDs section of the Handbook for a detailed discussion of this issue." -msgstr "" - -#. (itstool) path: question/para -#: book.translate.xml:3145 -msgid "Why do all non-English characters in filenames show up as ? on my CDs when mounted in FreeBSD?" -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:3150 -msgid "" -"The CD probably uses the Joliet extension for storing information about files and directories. This is discussed in the Handbook section " -"on Using Data CD-ROMs." -msgstr "" - -#. (itstool) path: question/para -#: book.translate.xml:3160 -msgid "A CD burned under FreeBSD cannot be read under any other operating system. Why?" -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:3165 -msgid "" -"This means a raw file was burned to the CD, rather than creating an ISO 9660 file system. Take a look at the Handbook section on Using Data CDs." -msgstr "" - -#. (itstool) path: question/para -#: book.translate.xml:3174 -msgid "How can I create an image of a data CD?" -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:3178 -msgid "" -"This is discussed in the Handbook section on Writing Data to an ISO File System. For more on working with CD-ROMs, see the Creating CDs Section in the Storage chapter in the Handbook." -msgstr "" - -#. (itstool) path: question/para -#: book.translate.xml:3188 -msgid "Why can I not mount an audio CD?" -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:3193 -msgid "" -"Trying to mount an audio CD will produce an error like cd9660: /dev/cd0: Invalid argument. This is because mount only works on file systems. Audio CDs do not have file systems; they just have data. Instead, use a program that reads audio CDs, such as the " -"audio/xmcd package or port." -msgstr "" - -#. (itstool) path: question/para -#: book.translate.xml:3205 -msgid "How do I mount a multi-session CD?" -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:3210 -msgid "" -"By default, mount8 will attempt to mount the last data track " -"(session) of a CD. To load an earlier session, use the command line argument. Refer to mount_cd96608 for specific examples." -msgstr "" - -#. (itstool) path: question/para -#: book.translate.xml:3220 -msgid "How do I let ordinary users mount CD-ROMs, DVDs, USB drives, and other removable media?" -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:3225 -msgid "As root set the sysctl variable vfs.usermount to 1." -msgstr "" - -#. (itstool) path: answer/screen -#: book.translate.xml:3229 -#, no-wrap -msgid "# sysctl vfs.usermount=1" -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:3231 -msgid "" -"To make this persist across reboots, add the line vfs.usermount=1 to /etc/sysctl.conf so that it is reset at " -"system boot time." -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:3236 -msgid "" -"Users can only mount devices they have read permissions to. To allow users to mount a device permissions must be set in /etc/devfs.conf." -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:3241 -msgid "For example, to allow users to mount the first USB drive add:" -msgstr "" - -#. (itstool) path: answer/programlisting -#: book.translate.xml:3244 -#, no-wrap -msgid "" -"# Allow all users to mount a USB drive.\n" -"\t own /dev/da0 root:operator\n" -"\t perm /dev/da0 0666" -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:3248 -msgid "All users can now mount devices they could read onto a directory that they own:" -msgstr "" - -#. (itstool) path: answer/screen -#: book.translate.xml:3251 -#, no-wrap -msgid "" -"% mkdir ~/my-mount-point\n" -"% mount -t msdosfs /dev/da0 ~/my-mount-point" -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:3254 -msgid "Unmounting the device is simple:" -msgstr "" - -#. (itstool) path: answer/screen -#: book.translate.xml:3256 -#, no-wrap -msgid "% umount ~/my-mount-point" -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:3258 -msgid "" -"Enabling vfs.usermount, however, has negative security implications. A better way to access MS-DOS formatted media is to use the emulators/mtools package in the Ports Collection." -msgstr "" - -#. (itstool) path: note/para -#: book.translate.xml:3265 -msgid "The device name used in the previous examples must be changed according to the configuration." -msgstr "" - -#. (itstool) path: question/para -#: book.translate.xml:3273 -msgid "The du and df commands show different amounts of disk space available. What is going on?" -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:3279 -msgid "" -"This is due to how these commands actually work. du goes through the directory tree, measures how large each file is, and presents " -"the totals. df just asks the file system how much space it has left. They seem to be the same thing, but a file without a directory " -"entry will affect df but not du." -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:3288 -msgid "" -"When a program is using a file, and the file is deleted, the file is not really removed from the file system until the program stops using it. The file " -"is immediately deleted from the directory listing, however. As an example, consider a file large enough to affect the output of du " -"and df. A file being viewed with more can be deleted wihout causing an error. The entry is removed from the " -"directory so no other program or user can access it. However, du shows that it is gone as it has walked the directory tree and the " -"file is not listed. df shows that it is still there, as the file system knows that more is still using that " -"space. Once the more session ends, du and df will agree." -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:3308 -msgid "" -"This situation is common on web servers. Many people set up a FreeBSD web server and forget to rotate the log files. The access log fills up /" -"var. The new administrator deletes the file, but the system still complains that the partition is full. Stopping and restarting the web " -"server program would free the file, allowing the system to release the disk space. To prevent this from happening, set up " -"newsyslog8." -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:3317 -msgid "Note that Soft Updates can delay the freeing of disk space and it can take up to 30 seconds for the change to be visible." -msgstr "" - -#. (itstool) path: question/para -#: book.translate.xml:3325 -msgid "How can I add more swap space?" -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:3329 -msgid "" -"This section of the Handbook describes how to " -"do this." -msgstr "" - -#. (itstool) path: question/para -#: book.translate.xml:3336 -msgid "Why does FreeBSD see my disk as smaller than the manufacturer says it is?" -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:3341 -msgid "" -"Disk manufacturers calculate gigabytes as a billion bytes each, whereas FreeBSD calculates them as 1,073,741,824 bytes each. This explains why, for " -"example, FreeBSD's boot messages will report a disk that supposedly has 80 GB as holding 76,319 MB." -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:3348 -msgid "Also note that FreeBSD will (by default) reserve 8% of the disk space." -msgstr "" - -#. (itstool) path: question/para -#: book.translate.xml:3355 -msgid "How is it possible for a partition to be more than 100% full?" -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:3360 -msgid "" -"A portion of each UFS partition (8%, by default) is reserved for use by the operating system and the root " -"user. df1 does not count that space when calculating the " -"Capacity column, so it can exceed 100%. Notice that the Blocks column is always greater than the sum of the " -"Used and Avail columns, usually by a factor of 8%." -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:3370 -msgid "For more details, look up in tunefs8." -msgstr "" - -#. (itstool) path: question/para -#: book.translate.xml:3384 -msgid "What is the minimum amount of RAM one should have to run ZFS?" -msgstr "使用 ZFS 最少需要多少記憶體?" - -#. (itstool) path: answer/para -#: book.translate.xml:3389 -msgid "A minimum of 4GB of RAM is required for comfortable usage, but individual workloads can vary widely." -msgstr "至少需要 4GB 的記憶體才能跑得順,但不同的工作負載可能會造成相當大的差異。" - -#. (itstool) path: question/para -#: book.translate.xml:3396 -msgid "What is the ZIL and when does it get used?" -msgstr "ZIL 是什麼而又何時會被使用?" - -#. (itstool) path: answer/para -#: book.translate.xml:3400 -msgid "" -"The ZIL (ZFS intent log) is a write log used to implement posix write commitment semantics across crashes. " -"Normally writes are bundled up into transaction groups and written to disk when filled (Transaction Group Commit). However syscalls like " -"fsync2 require a commitment that the data is written to stable " -"storage before returning. The ZIL is needed for writes that have been acknowledged as written but which are not yet on disk as part of a transaction. " -"The transaction groups are timestamped. In the event of a crash the last valid timestamp is found and missing data is merged in from the ZIL." -msgstr "" -"The ZIL (ZFS 動向日誌) 是一個紀錄日誌,用以實現系統當機時 POSIX 寫入保證的語義,多個正常 ZFS 寫入動作會被分成多個" -"交易處理群組,並在交易處理群組被填滿時寫入磁碟 (Transaction Group Commit)。然而像 fsync2 這樣的系統呼叫,會要求該系統呼叫在返回前,能承諾已將資料寫入磁碟,ZIL 就是用來紀錄確認為已執行寫入" -"的資料,但其實尚未存在於磁碟上,即尚未完成交易處理,交易處理群組具有時間戳記,在系統當機後,找到 ZIL 最後一個有效的時間戳記,即將遺失的資料再舍併至磁碟" -"上。" - -#. (itstool) path: question/para -#: book.translate.xml:3418 -msgid "Do I need a SSD for ZIL?" -msgstr "我需要用固態硬碟 (SSD) 來存 ZIL 嗎?" - -#. (itstool) path: answer/para -#: book.translate.xml:3422 -msgid "" -"By default, ZFS stores the ZIL in the pool with all the data. If an application has a heavy write load, storing the ZIL in a separate device that has " -"very fast synchronous, sequential write performance can improve overall system. For other workloads, a SSD is unlikely to make much of an improvement." -msgstr "" -"ZFS 預設將 ZIL 儲存在包含所有資料的 zpool 中,如果應用程式的寫入負載很重,將 ZIL 儲存在同步速度非常快的獨立設備中,藉由循序寫入效能的提高可以改善整個系" -"統的效能,對於其他類型的工作負載, 固態硬碟就不會有太大的助益。" - -#. (itstool) path: question/para -#: book.translate.xml:3433 -msgid "What is the L2ARC?" -msgstr "L2ARC 是什麼?" - -#. (itstool) path: answer/para -#: book.translate.xml:3437 -msgid "" -"The L2ARC is a read cache stored on a fast device such as an SSD. This cache is not persistent across reboots. " -"Note that RAM is used as the first layer of cache and the L2ARC is only needed if there is insufficient RAM." -msgstr "" -"The L2ARC (Second Level Adaptive Replacement Cache) 是存於快速儲存設備 SSD 上的讀取快取,此快取在重新開機後會消" -"失,請注意記憶體是第一層的快取,只有在記憶體不足的情況下才需要 L2ARC。" - -#. (itstool) path: answer/para -#: book.translate.xml:3443 -msgid "" -"L2ARC needs space in the ARC to index it. So, perversely, a working set that fits perfectly in the ARC will not fit perfectly any more if a L2ARC is " -"used because part of the ARC is holding the L2ARC index, pushing part of the working set into the L2ARC which is slower than RAM." -msgstr "" -"L2ARC 需要 ARC 的空間來為其製作索引,因此,有一種反常的情況,如果有一種工作集 (working set) 可以完美地剛好放入 ARC,一旦系統使用 L2ARC,該工作集的運作將" -"不再完美,因為 ARC 需要用一部分空間來保存 L2ARC 的索引,以至於必須將工作集的一部分存入比記憶體慢的 L2ARC。" - -#. (itstool) path: question/para -#: book.translate.xml:3454 -msgid "Is enabling deduplication advisable?" -msgstr "建議啟用去冗餘 (deduplication) 嗎?" - -#. (itstool) path: answer/para -#: book.translate.xml:3458 -msgid "Generally speaking, no." -msgstr "一般而言,不建議這麼做。" - -#. (itstool) path: answer/para -#: book.translate.xml:3460 -msgid "" -"Deduplication takes up a significant amount of RAM and may slow down read and write disk access times. Unless one is storing data that is very heavily " -"duplicated, such as virtual machine images or user backups, it is possible that deduplication will do more harm than good. Another consideration is the " -"inability to revert deduplication status. If data is written when deduplication is enabled, disabling dedup will not cause those blocks which were " -"deduplicated to be replicated until they are next modified." -msgstr "" -"去冗餘需要相當多的記憶體,而且會讓讀寫磁碟所需的時間變長,除非磁碟上儲存了非常多重複的資料,例如:虛擬機的映像檔或者是使用者的備份資料,否則開啟去冗餘可" -"能弊大於利。另一個需要考量的狀況是:啟用去冗餘功能之後再將其關閉,無法將磁碟上去冗餘的狀態立即逆轉,必須等到下次修改了之前被去冗餘的資料,變更的區塊才會" -"再被複製一份。" - -#. (itstool) path: answer/para -#: book.translate.xml:3471 -msgid "Deduplication can also lead to some unexpected situations. In particular, deleting files may become much slower." -msgstr "去冗餘也可能會導致某些非預期的情況,特別是刪除檔案時可能會慢很多。" - -#. (itstool) path: question/para -#: book.translate.xml:3479 -msgid "I cannot delete or create files on my ZFS pool. How can I fix this?" -msgstr "在我建立的 ZFS pool 中無法刪除和新增檔案,應該怎麼修復?" - -#. (itstool) path: answer/para -#: book.translate.xml:3484 -msgid "" -"This could happen because the pool is 100% full. ZFS requires space on the disk to write transaction metadata. To restore the pool to a usable state, " -"truncate the file to delete:" -msgstr "" -"這很有可能是該 pool 的空間使用率已達 100% 滿了,因 ZFS 需要儲存空間以將紀錄交易處理的輔助資料 (metadata) 寫入,為了讓該 pool 回復至可用狀態,必須用檔案" -"切除的方法 (truncate 命令) 刪除不重要的檔案:" - -#. (itstool) path: answer/screen -#: book.translate.xml:3489 -#, no-wrap -msgid "% truncate -s 0 unimportant-file" -msgstr "% truncate -s 0 unimportant-file" - -#. (itstool) path: answer/para -#: book.translate.xml:3491 -msgid "File truncation works because a new transaction is not started, new spare blocks are created instead." -msgstr "因為檔案切除不需要建立交易處理紀錄,並能釋放出可使用的磁碟區塊。" - -#. (itstool) path: note/para -#: book.translate.xml:3495 -msgid "On systems with additional ZFS dataset tuning, such as deduplication, the space may not be immediately available" -msgstr "如果系統曾進行過額外的 ZFS dataset 調校,例如:去冗餘,釋放出來的空間也許不會立即可得。" - -#. (itstool) path: question/para -#: book.translate.xml:3504 -msgid "Does ZFS support TRIM for Solid State Drives?" -msgstr "ZFS 支援固態硬碟 (SSD) 的 TRIM 功能嗎?" - -#. (itstool) path: answer/para -#: book.translate.xml:3508 -msgid "" -"ZFS TRIM support was added to FreeBSD 10-CURRENT with revision r240868. ZFS TRIM support was added to all FreeBSD-STABLE " -"branches in r252162 and r251419, respectively." -msgstr "" -"自 FreeBSD 10-CURRENT 修定 r240868 開始,就支援 ZFS TRIM。ZFS TRIM 的支援分別已在 r252162 和 " -"r251419 的修訂,加進所有 FreeBSD-STABLE 分支。" - -#. (itstool) path: answer/para -#: book.translate.xml:3514 -msgid "ZFS TRIM is enabled by default, and can be turned off by adding this line to /etc/sysctl.conf:" -msgstr "ZFS TRIM 預設就已開啟,也可以將其關閉,只要加入一行設定到 /etc/sysctl.conf:" - -#. (itstool) path: answer/programlisting -#: book.translate.xml:3518 -#, no-wrap -msgid "vfs.zfs.trim.enabled=0" -msgstr "vfs.zfs.trim.enabled=0" - -#. (itstool) path: note/para -#: book.translate.xml:3521 -msgid "ZFS TRIM may not work with all configurations, such as a ZFS filesystem on a GELI-backed device." -msgstr "ZFS TRIM 也可能某些設定中會無效,例如:在採用 GELI 裝置上的 ZFS 檔案系統。" - -#. (itstool) path: chapter/title -#: book.translate.xml:3530 -msgid "System Administration" -msgstr "" - -#. (itstool) path: question/para -#: book.translate.xml:3535 -msgid "Where are the system start-up configuration files?" -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:3540 -msgid "" -"The primary configuration file is /etc/defaults/rc.conf which is described in rc.conf5. System startup scripts such as /etc/rc and /etc/rc.d, " -"which are described in rc8, include this file. Do not edit " -"this file! Instead, to edit an entry in /etc/defaults/rc.conf, copy the line into /etc/rc.conf and " -"change it there." -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:3551 -msgid "For example, if to start named8, the included DNS server:" -msgstr "" - -#. (itstool) path: answer/screen -#: book.translate.xml:3554 -#, no-wrap -msgid "# echo 'named_enable=\"YES\"' >> /etc/rc.conf" -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:3556 -msgid "" -"To start up local services, place shell scripts in the /usr/local/etc/rc.d directory. These shell scripts should be set " -"executable, the default file mode is 555." -msgstr "" - -#. (itstool) path: question/para -#: book.translate.xml:3565 -msgid "How do I add a user easily?" -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:3569 -msgid "" -"Use the adduser8 command, or the pw8 command for more complicated situations." -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:3572 -msgid "" -"To remove the user, use the rmuser8 command or, if necessary, " -"pw8." -msgstr "" - -#. (itstool) path: question/para -#: book.translate.xml:3579 -msgid "Why do I keep getting messages like root: not found after editing /etc/crontab?" -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:3585 -msgid "" -"This is normally caused by editing the system crontab. This is not the correct way to do things as the system crontab has a different format to the per-" -"user crontabs. The system crontab has an extra field, specifying which user to run the command as. cron8 assumes this user is the first word of the command to execute. Since no such command exists, this " -"error message is displayed." -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:3594 -msgid "To delete the extra, incorrect crontab:" -msgstr "" - -#. (itstool) path: answer/screen -#: book.translate.xml:3596 -#, no-wrap -msgid "# crontab -r" -msgstr "" - -#. (itstool) path: question/para -#: book.translate.xml:3602 -msgid "" -"Why do I get the error, you are not in the correct group to su root when I try to su to root?" -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:3608 -msgid "" -"This is a security feature. In order to su to root, or any other account with superuser " -"privileges, the user account must be a member of the wheel group. If this feature were not there, anybody " -"with an account on a system who also found out root's password would be able to gain superuser level access " -"to the system." -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:3618 -msgid "" -"To allow someone to su to root, put them in the wheel group using pw:" -msgstr "" - -#. (itstool) path: answer/screen -#: book.translate.xml:3623 -#, no-wrap -msgid "# pw groupmod wheel -m lisa" -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:3625 -msgid "The above example will add user lisa to the group wheel." -msgstr "" - -#. (itstool) path: question/para -#: book.translate.xml:3632 -msgid "" -"I made a mistake in rc.conf, or another startup file, and now I cannot edit it because the file system is read-only. What should I " -"do?" -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:3638 -msgid "" -"Restart the system using boot -s at the loader prompt to enter single-user mode. When prompted for a shell pathname, press " -"Enter and run mount -urw / to re-mount the root file system in read/write mode. You may also need to run " -"mount -a -t ufs to mount the file system where your favorite editor is defined. If that editor is on a network file system, either " -"configure the network manually before mounting the network file systems, or use an editor which resides on a local file system, such as " -"ed1." -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:3651 -msgid "" -"In order to use a full screen editor such as vi1 or emacs1, run export TERM=xterm so that these " -"editors can load the correct data from the termcap5 database." -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:3657 -msgid "" -"After performing these steps, edit /etc/rc.conf to fix the syntax error. The error message displayed immediately after the kernel " -"boot messages should indicate the number of the line in the file which is at fault." -msgstr "" - -#. (itstool) path: question/para -#: book.translate.xml:3668 -msgid "Why am I having trouble setting up my printer?" -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:3672 -msgid "" -"See the Handbook entry on printing for troubleshooting " -"tips." -msgstr "" - -#. (itstool) path: question/para -#: book.translate.xml:3680 -msgid "How can I correct the keyboard mappings for my system?" -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:3685 -msgid "" -"Refer to the Handbook section on using localization, specifically the section on console setup." -msgstr "" - -#. (itstool) path: question/para -#: book.translate.xml:3693 -msgid "Why can I not get user quotas to work properly?" -msgstr "" - -#. (itstool) path: listitem/para -#: book.translate.xml:3699 -msgid "" -"It is possible that the kernel is not configured to use quotas. In this case, add the following line to the kernel configuration file and recompile the " -"kernel:" -msgstr "" - -#. (itstool) path: listitem/programlisting -#: book.translate.xml:3704 -#, no-wrap -msgid "options QUOTA" -msgstr "" - -#. (itstool) path: listitem/para -#: book.translate.xml:3706 -msgid "" -"Refer to the Handbook entry on quotas for full details." -msgstr "" - -#. (itstool) path: listitem/para -#: book.translate.xml:3711 -msgid "Do not turn on quotas on /." -msgstr "" - -#. (itstool) path: listitem/para -#: book.translate.xml:3716 -msgid "Put the quota file on the file system that the quotas are to be enforced on:" -msgstr "" - -#. (itstool) path: row/entry -#: book.translate.xml:3723 -msgid "File System" -msgstr "" - -#. (itstool) path: row/entry -#: book.translate.xml:3725 -msgid "Quota file" -msgstr "" - -#. (itstool) path: row/entry -#: book.translate.xml:3731 -msgid "/usr" -msgstr "" - -#. (itstool) path: row/entry -#: book.translate.xml:3733 -msgid "/usr/admin/quotas" -msgstr "" - -#. (itstool) path: row/entry -#: book.translate.xml:3737 -msgid "/home" -msgstr "" - -#. (itstool) path: row/entry -#: book.translate.xml:3739 -msgid "/home/admin/quotas" -msgstr "" - -#. (itstool) path: row/entry -#: book.translate.xml:3743 book.translate.xml:3745 -msgid "…" -msgstr "" - -#. (itstool) path: question/para -#: book.translate.xml:3757 -msgid "Does FreeBSD support System V IPC primitives?" -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:3761 -msgid "" -"Yes, FreeBSD supports System V-style IPC, including shared memory, messages and semaphores, in the GENERIC kernel. With a custom " -"kernel, support may be loaded with the sysvshm.ko, sysvsem.ko and sysvmsg.ko kernel " -"modules, or enabled in the custom kernel by adding the following lines to the kernel configuration file:" -msgstr "" - -#. (itstool) path: answer/programlisting -#: book.translate.xml:3771 -#, no-wrap -msgid "" -"options SYSVSHM # enable shared memory\n" -"options SYSVSEM # enable for semaphores\n" -"options SYSVMSG # enable for messaging" -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:3775 -msgid "Recompile and install the kernel." -msgstr "" - -#. (itstool) path: question/para -#: book.translate.xml:3781 -msgid "What other mail-server software can I use instead of Sendmail?" -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:3786 -msgid "" -"The Sendmail server is the default mail-server software for FreeBSD, " -"but it can be replaced with another MTA installed from the Ports Collection. Available ports include mail/exim, mail/" -"postfix, and mail/qmail. Search the mailing lists for discussions regarding the advantages and disadvantages of the " -"available MTAs." -msgstr "" - -#. (itstool) path: question/para -#: book.translate.xml:3800 -msgid "I have forgotten the root password! What do I do?" -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:3805 -msgid "" -"Do not panic! Restart the system, type boot -s at the Boot: prompt to enter single-user mode. At the question " -"about the shell to use, hit Enter which will display a # prompt. Enter mount -urw / to remount the " -"root file system read/write, then run mount -a to remount all the file systems. Run passwd root to change the " -"root password then run exit1 to continue booting." -msgstr "" - -#. (itstool) path: note/para -#: book.translate.xml:3818 -msgid "" -"If you are still prompted to give the root password when entering the single-user mode, it means that the " -"console has been marked as insecure in /etc/ttys. In this case, it will be required to boot from a FreeBSD " -"installation disk, choose the Live CD or Shell at the beginning of the install process and issue " -"the commands mentioned above. Mount the specific partition in this case and then chroot to it. For example, replace mount -urw / " -"with mount /dev/ada0p1 /mnt; chroot /mnt for a system on ada0p1." -msgstr "" - -#. (itstool) path: note/para -#: book.translate.xml:3835 -msgid "" -"If the root partition cannot be mounted from single-user mode, it is possible that the partitions are encrypted and it is impossible to mount them " -"without the access keys. For more information see the section about encrypted disks in the FreeBSD Handbook." -msgstr "" - -#. (itstool) path: question/para -#: book.translate.xml:3846 -msgid "How do I keep ControlAltDelete from rebooting the system?" -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:3851 -msgid "" -"When using syscons4, the default console driver, build and install a " -"new kernel with this line in the configuration file:" -msgstr "" - -#. (itstool) path: answer/programlisting -#: book.translate.xml:3855 -#, no-wrap -msgid "options SC_DISABLE_REBOOT" -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:3857 -msgid "" -"This can also be done by setting the following sysctl8 which does " -"not require a reboot or kernel recompile:" -msgstr "" - -#. (itstool) path: answer/screen -#: book.translate.xml:3861 -#, no-wrap -msgid "# sysctl hw.syscons.kbd_reboot=0" -msgstr "" - -#. (itstool) path: note/para -#: book.translate.xml:3864 -msgid "" -"The above two methods are exclusive: The sysctl8 does not exist if " -"the kernel is compiled with SC_DISABLE_REBOOT." -msgstr "" - -#. (itstool) path: question/para -#: book.translate.xml:3873 -msgid "How do I reformat DOS text files to UNIX ones?" -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:3878 -msgid "Use this perl1 command:" -msgstr "" - -#. (itstool) path: answer/screen -#: book.translate.xml:3880 -#, no-wrap -msgid "% perl -i.bak -npe 's/\\r\\n/\\n/g' file(s)" -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:3882 -msgid "" -"where file(s) is one or more files to process. The modification is done in-place, with the original file stored with a " -".bak extension." -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:3887 -msgid "Alternatively, use tr1:" -msgstr "" - -#. (itstool) path: answer/screen -#: book.translate.xml:3889 -#, no-wrap -msgid "% tr -d '\\r' < dos-text-file > unix-file" -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:3891 -msgid "" -"dos-text-file is the file containing DOS text while unix-file will contain the converted output. " -"This can be quite a bit faster than using perl." -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:3897 -msgid "" -"Yet another way to reformat DOS text files is to use the converters/dosunix port from the Ports Collection. Consult its " -"documentation about the details." -msgstr "" - -#. (itstool) path: question/para -#: book.translate.xml:3906 -msgid "How do I re-read /etc/rc.conf and re-start /etc/rc without a reboot?" -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:3912 -msgid "Go into single-user mode and then back to multi-user mode:" -msgstr "" - -#. (itstool) path: answer/screen -#: book.translate.xml:3915 -#, no-wrap -msgid "" -"# shutdown now\n" -"# return\n" -"# exit" -msgstr "" - -#. (itstool) path: question/para -#: book.translate.xml:3923 -msgid "" -"I tried to update my system to the latest -STABLE, but got -BETAx, -RC or -PRERELEASE! What is going on?" -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:3932 -msgid "" -"Short answer: it is just a name. RC stands for Release Candidate. It signifies that a release is imminent. In " -"FreeBSD, -PRERELEASE is typically synonymous with the code freeze before a release. (For some releases, the -BETA label was used in the same way as -PRERELEASE.)" -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:3941 -msgid "" -"Long answer: FreeBSD derives its releases from one of two places. Major, dot-zero, releases, such as 9.0-RELEASE are branched from the head of the " -"development stream, commonly referred to as -CURRENT. Minor releases, such as 6.3-RELEASE or 5.2-RELEASE, have been " -"snapshots of the active -STABLE branch. Starting with 4.3-RELEASE, each release also now has its own branch which can " -"be tracked by people requiring an extremely conservative rate of development (typically only security advisories)." -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:3952 -msgid "" -"When a release is about to be made, the branch from which it will be derived from has to undergo a certain process. Part of this process is a code " -"freeze. When a code freeze is initiated, the name of the branch is changed to reflect that it is about to become a release. For example, if the branch " -"used to be called 6.2-STABLE, its name will be changed to 6.3-PRERELEASE to signify the code freeze and signify that extra pre-release testing should " -"be happening. Bug fixes can still be committed to be part of the release. When the source code is in shape for the release the name will be changed to " -"6.3-RC to signify that a release is about to be made from it. Once in the RC stage, only the most critical bugs found can be fixed. Once the release " -"(6.3-RELEASE in this example) and release branch have been made, the branch will be renamed to 6.3-STABLE." -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:3969 -msgid "" -"For more information on version numbers and the various Subversion branches, refer to the Release Engineering article." -msgstr "" - -#. (itstool) path: question/para -#: book.translate.xml:3977 -msgid "" -"I tried to install a new kernel, and the chflags1 failed. How do I " -"get around this?" -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:3982 -msgid "Short answer: the security level is greater than 0. Reboot directly to single-user mode to install the kernel." -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:3986 -msgid "Long answer: FreeBSD disallows changing system flags at security levels greater than 0. To check the current security level:" -msgstr "" - -#. (itstool) path: answer/screen -#: book.translate.xml:3990 book.translate.xml:4019 -#, no-wrap -msgid "# sysctl kern.securelevel" -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:3992 -msgid "" -"The security level cannot be lowered in multi-user mode, so boot to single-user mode to install the kernel, or change the security level in /" -"etc/rc.conf then reboot. See the init8 manual page for " -"details on securelevel, and see /etc/defaults/rc.conf and the rc.conf5 manual page for more information on rc.conf." -msgstr "" - -#. (itstool) path: question/para -#: book.translate.xml:4006 -msgid "I cannot change the time on my system by more than one second! How do I get around this?" -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:4011 -msgid "Short answer: the system is at a security level greater than 1. Reboot directly to single-user mode to change the date." -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:4015 -msgid "Long answer: FreeBSD disallows changing the time by more that one second at security levels greater than 1. To check the security level:" -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:4021 -msgid "" -"The security level cannot be lowered in multi-user mode. Either boot to single-user mode to change the date or change the security level in /" -"etc/rc.conf and reboot. See the init8 manual page for " -"details on securelevel, and see /etc/defaults/rc.conf and the rc.conf5 manual page for more information on rc.conf." -msgstr "" - -#. (itstool) path: question/para -#: book.translate.xml:4035 -msgid "Why is rpc.statd using 256 MB of memory?" -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:4040 -msgid "" -"No, there is no memory leak, and it is not using 256 MB of memory. For convenience, rpc.statd maps an obscene amount of memory into " -"its address space. There is nothing terribly wrong with this from a technical standpoint; it just throws off things like " -"top1 and ps1." -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:4047 -msgid "" -"rpc.statd8 maps its status file (resident on /var) into its address space; to save worrying about remapping the status file later when it needs to grow, it maps the status file with a " -"generous size. This is very evident from the source code, where one can see that the length argument to mmap2 is 0x10000000, or one sixteenth of the address space on an IA32, or exactly " -"256 MB." -msgstr "" - -#. (itstool) path: question/para -#: book.translate.xml:4060 -msgid "Why can I not unset the schg file flag?" -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:4065 -msgid "" -"The system is running at securelevel greater than 0. Lower the securelevel and try again. For more information, see the " -"FAQ entry on securelevel and the init8 " -"manual page." -msgstr "" - -#. (itstool) path: question/para -#: book.translate.xml:4075 -msgid "What is vnlru?" -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:4079 -msgid "" -"vnlru flushes and frees vnodes when the system hits the kern.maxvnodes limit. This kernel thread sits mostly " -"idle, and only activates when there is a huge amount of RAM and users are accessing tens of thousands of tiny files." -msgstr "" - -#. (itstool) path: question/para -#: book.translate.xml:4089 -msgid "What do the various memory states displayed by top mean?" -msgstr "" - -#. (itstool) path: listitem/para -#: book.translate.xml:4097 -msgid "Active: pages recently statistically used." -msgstr "" - -#. (itstool) path: listitem/para -#: book.translate.xml:4102 -msgid "Inactive: pages recently statistically unused." -msgstr "" - -#. (itstool) path: listitem/para -#: book.translate.xml:4107 -msgid "" -"Cache: (most often) pages that have percolated from inactive to a status where they maintain their data, but can often be " -"immediately reused (either with their old association, or reused with a new association). There can be certain immediate transitions from " -"active to cache state if the page is known to be clean (unmodified), but that transition is a matter of policy, " -"depending upon the algorithm choice of the VM system maintainer." -msgstr "" - -#. (itstool) path: listitem/para -#: book.translate.xml:4120 -msgid "" -"Free: pages without data content, and can be immediately used in certain circumstances where cache pages might be ineligible. Free " -"pages can be reused at interrupt or process state." -msgstr "" - -#. (itstool) path: listitem/para -#: book.translate.xml:4128 -msgid "Wired: pages that are fixed into memory, usually for kernel purposes, but also sometimes for special use in processes." -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:4134 -msgid "" -"Pages are most often written to disk (sort of a VM sync) when they are in the inactive state, but active pages can also be synced. This depends upon " -"the CPU tracking of the modified bit being available, and in certain situations there can be an advantage for a block of VM pages to be synced, whether " -"they are active or inactive. In most common cases, it is best to think of the inactive queue to be a queue of relatively unused pages that might or " -"might not be in the process of being written to disk. Cached pages are already synced, not mapped, but available for immediate process use with their " -"old association or with a new association. Free pages are available at interrupt level, but cached or free pages can be used at process state for " -"reuse. Cache pages are not adequately locked to be available at interrupt level." -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:4151 -msgid "There are some other flags (e.g., busy flag or busy count) that might modify some of the described rules." -msgstr "" - -#. (itstool) path: question/para -#: book.translate.xml:4159 -msgid "How much free memory is available?" -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:4164 -msgid "" -"There are a couple of kinds of free memory. One kind is the amount of memory immediately available without paging anything else out. " -"That is approximately the size of cache queue + size of free queue (with a derating factor, depending upon system tuning). Another kind of free " -"memory is the total amount of VM space. That can be complex, but is dependent upon the amount of swap space and memory. " -"Other kinds of free memory descriptions are also possible, but it is relatively useless to define these, but rather it is important to " -"make sure that the paging rate is kept low, and to avoid running out of swap space." -msgstr "" - -#. (itstool) path: question/para -#: book.translate.xml:4182 -msgid "What is /var/empty?" -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:4186 -msgid "" -"/var/empty is a directory that the sshd8 " -"program uses when performing privilege separation. The /var/empty directory is empty, owned by root and has the schg flag set. This directory should not be deleted." -msgstr "" - -#. (itstool) path: question/para -#: book.translate.xml:4197 -msgid "I just changed /etc/newsyslog.conf. How can I check if it does what I expect?" -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:4203 -msgid "To see what newsyslog8 will do, use the following:" -msgstr "" - -#. (itstool) path: answer/screen -#: book.translate.xml:4206 -#, no-wrap -msgid "% newsyslog -nrvv" -msgstr "" - -#. (itstool) path: question/para -#: book.translate.xml:4212 -msgid "My time is wrong, how can I change the timezone?" -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:4217 -msgid "Use tzsetup8." -msgstr "" - -#. (itstool) path: chapter/title -#: book.translate.xml:4224 -msgid "The X Window System and Virtual Consoles" -msgstr "" - -#. (itstool) path: question/para -#: book.translate.xml:4229 -msgid "What is the X Window System?" -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:4233 -msgid "" -"The X Window System (commonly X11) is the most widely available windowing system capable of running on UNIX or UNIX like systems, including FreeBSD. The X.Org Foundation administers the X protocol standards, with the current reference implementation, version 11 release 7.7, so references are often shortened to X11." -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:4243 -msgid "" -"Many implementations are available for different architectures and operating systems. An implementation of the server-side code is properly known as an " -"X server." -msgstr "" - -#. (itstool) path: question/para -#: book.translate.xml:4252 -msgid "I want to run Xorg, how do I go about it?" -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:4256 -msgid "To install Xorg do one of the following:" -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:4258 -msgid "Use the x11/xorg meta-port, which builds and installs every Xorg component." -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:4262 -msgid "Use x11/xorg-minimal, which builds and installs only the necessary Xorg components." -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:4265 -msgid "Install Xorg from FreeBSD packages:" -msgstr "" - -#. (itstool) path: answer/screen -#: book.translate.xml:4267 -#, no-wrap -msgid "# pkg install xorg" -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:4269 -msgid "" -"After the installation of Xorg, follow the instructions from the X11 Configuration section of the FreeBSD Handbook." -msgstr "" - -#. (itstool) path: question/para -#: book.translate.xml:4278 -msgid "" -"I tried to run X, but I get a No devices detected. error when I type startx. What do I " -"do now?" -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:4284 -msgid "" -"The system is probably running at a raised securelevel. It is not possible to start X at a raised securelevel " -"because X requires write access to io4. For more information, see at " -"the init8 manual page." -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:4290 -msgid "" -"There are two solutions to the problem: set the securelevel back down to zero or run xdm1 (or an alternative display manager) at boot time before the " -"securelevel is raised." -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:4296 -msgid "" -"See for more information about running xdm1 at boot time." -msgstr "" - -#. (itstool) path: question/para -#: book.translate.xml:4303 -msgid "Why does my mouse not work with X?" -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:4307 -msgid "" -"When using syscons4, the default console driver, FreeBSD can be " -"configured to support a mouse pointer on each virtual screen. To avoid conflicting with X, syscons4 supports a virtual device called /dev/sysmouse. All mouse events received " -"from the real mouse device are written to the sysmouse4 device via " -"moused8. To use the mouse on one or more virtual consoles, " -"and use X, see and set up moused8." -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:4318 -msgid "Then edit /etc/X11/xorg.conf and make sure the following lines exist:" -msgstr "" - -#. (itstool) path: answer/programlisting -#: book.translate.xml:4321 -#, no-wrap -msgid "" -"Section \"InputDevice\"\n" -" Option \"Protocol\" \"SysMouse\"\n" -" Option \"Device\" \"/dev/sysmouse\"\n" -"....." -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:4326 -msgid "" -"Starting with Xorg version 7.4, the InputDevice sections in xorg.conf are ignored in favor of autodetected " -"devices. To restore the old behavior, add the following line to the ServerLayout or ServerFlags section:" -msgstr "" - -#. (itstool) path: answer/programlisting -#: book.translate.xml:4333 -#, no-wrap -msgid "Option \"AutoAddDevices\" \"false\"" -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:4335 -msgid "" -"Some people prefer to use /dev/mouse under X. To make this work, /dev/mouse should be linked to /" -"dev/sysmouse (see sysmouse4) by adding the following line " -"to /etc/devfs.conf (see devfs.conf5):" -msgstr "" - -#. (itstool) path: answer/programlisting -#: book.translate.xml:4343 -#, no-wrap -msgid "link sysmouse mouse" -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:4345 -msgid "" -"This link can be created by restarting devfs5 " -"with the following command (as root):" -msgstr "" - -#. (itstool) path: answer/screen -#: book.translate.xml:4348 -#, no-wrap -msgid "# service devfs restart" -msgstr "" - -#. (itstool) path: question/para -#: book.translate.xml:4354 -msgid "My mouse has a fancy wheel. Can I use it in X?" -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:4358 -msgid "" -"Yes, if X is configured for a 5 button mouse. To do this, add the lines Buttons 5 and ZAxisMapping 4 5 to the " -"InputDevice section of /etc/X11/xorg.conf, as seen in this example:" -msgstr "" - -#. (itstool) path: answer/programlisting -#: book.translate.xml:4365 -#, no-wrap -msgid "" -"Section \"InputDevice\"\n" -" Identifier \"Mouse1\"\n" -" Driver \"mouse\"\n" -" Option \"Protocol\" \"auto\"\n" -" Option \"Device\" \"/dev/sysmouse\"\n" -" Option \"Buttons\" \"5\"\n" -" Option \"ZAxisMapping\" \"4 5\"\n" -"EndSection" -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:4374 -msgid "The mouse can be enabled in Emacsby adding these lines to ~/.emacs:" -msgstr "" - -#. (itstool) path: answer/programlisting -#: book.translate.xml:4378 -#, no-wrap -msgid "" -";; wheel mouse\n" -"(global-set-key [mouse-4] 'scroll-down)\n" -"(global-set-key [mouse-5] 'scroll-up)" -msgstr "" - -#. (itstool) path: question/para -#: book.translate.xml:4386 -msgid "My laptop has a Synaptics touchpad. Can I use it in X?" -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:4391 -msgid "Yes, after configuring a few things to make it work." -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:4394 -msgid "In order to use the Xorg synaptics driver, first remove moused_enable from rc.conf." -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:4398 -msgid "To enable synaptics, add the following line to /boot/loader.conf:" -msgstr "" - -#. (itstool) path: answer/programlisting -#: book.translate.xml:4401 -#, no-wrap -msgid "hw.psm.synaptics_support=\"1\"" -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:4403 -msgid "Add the following to /etc/X11/xorg.conf:" -msgstr "" - -#. (itstool) path: answer/programlisting -#: book.translate.xml:4406 -#, no-wrap -msgid "" -"Section \"InputDevice\"\n" -"Identifier \"Touchpad0\"\n" -"Driver \"synaptics\"\n" -"Option \"Protocol\" \"psm\"\n" -"Option \"Device\" \"/dev/psm0\"\n" -"EndSection" -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:4413 -msgid "And be sure to add the following into the ServerLayout section:" -msgstr "" - -#. (itstool) path: answer/programlisting -#: book.translate.xml:4416 -#, no-wrap -msgid "InputDevice \"Touchpad0\" \"SendCoreEvents\"" -msgstr "" - -#. (itstool) path: question/para -#: book.translate.xml:4422 -msgid "How do I use remote X displays?" -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:4426 -msgid "For security reasons, the default setting is to not allow a machine to remotely open a window." -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:4429 -msgid "To enable this feature, start X with the optional argument:" -msgstr "" - -#. (itstool) path: answer/screen -#: book.translate.xml:4433 -#, no-wrap -msgid "% startx -listen_tcp" -msgstr "" - -#. (itstool) path: question/para -#: book.translate.xml:4439 -msgid "What is a virtual console and how do I make more?" -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:4444 -msgid "" -"Virtual consoles provide several simultaneous sessions on the same machine without doing anything complicated like setting up a network or running X." -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:4449 -msgid "" -"When the system starts, it will display a login prompt on the monitor after displaying all the boot messages. Type in your login name and password to " -"start working on the first virtual console." -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:4455 -msgid "" -"To start another session, perhaps to look at documentation for a program or to read mail while waiting for an FTP transfer to finish, hold down " -"Alt and press F2. This will display the login prompt for the second virtual console. To go back to the original " -"session, press AltF1." -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:4465 -msgid "" -"The default FreeBSD installation has eight virtual consoles enabled. AltF1, " -"AltF2, AltF3, and so on will switch between these virtual consoles." -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:4472 -msgid "" -"To enable more of virtual consoles, edit /etc/ttys (see ttys5) and add entries for ttyv8 to ttyvc, after the comment on Virtual terminals:" -msgstr "" - -#. (itstool) path: answer/programlisting -#: book.translate.xml:4478 -#, no-wrap -msgid "" -"# Edit the existing entry for ttyv8 in /etc/ttys and change\n" -"# \"off\" to \"on\".\n" -"ttyv8 \"/usr/libexec/getty Pc\" xterm on secure\n" -"ttyv9 \"/usr/libexec/getty Pc\" xterm on secure\n" -"ttyva \"/usr/libexec/getty Pc\" xterm on secure\n" -"ttyvb \"/usr/libexec/getty Pc\" xterm on secure" -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:4485 -msgid "" -"The more virtual terminals, the more resources that are used. This can be problematic on systems with 8 MB RAM or less. Consider changing " -"secure to insecure." -msgstr "" - -#. (itstool) path: important/para -#: book.translate.xml:4492 -msgid "" -"In order to run an X server, at least one virtual terminal must be left to off for it to use. This means that only eleven of the Alt-" -"function keys can be used as virtual consoles so that one is left for the X server." -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:4499 -msgid "For example, to run X and eleven virtual consoles, the setting for virtual terminal 12 should be:" -msgstr "" - -#. (itstool) path: answer/programlisting -#: book.translate.xml:4502 -#, no-wrap -msgid "ttyvb \"/usr/libexec/getty Pc\" xterm off secure" -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:4504 -msgid "The easiest way to activate the virtual consoles is to reboot." -msgstr "" - -#. (itstool) path: question/para -#: book.translate.xml:4511 -msgid "How do I access the virtual consoles from X?" -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:4515 -msgid "" -"Use CtrlAltFn to switch back to a " -"virtual console. Press CtrlAltF1 to return to the first " -"virtual console." -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:4519 -msgid "" -"Once at a text console, use AltFn to move between " -"them." -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:4523 -msgid "" -"To return to the X session, switch to the virtual console running X. If X was started from the command line using startx, the X " -"session will attach to the next unused virtual console, not the text console from which it was invoked. For eight active virtual terminals, X will run " -"on the ninth, so use AltF9." -msgstr "" - -#. (itstool) path: question/para -#: book.translate.xml:4535 -msgid "How do I start XDM on boot?" -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:4540 -msgid "" -"There are two schools of thought on how to start xdm1. One school starts xdm from /etc/ttys (see ttys5) using the supplied example, while the other runs xdm from rc.local (see rc8) or from an X script in " -"/usr/local/etc/rc.d. Both are equally valid, and one may work in situations where the other does not. In both cases the result is " -"the same: X will pop up a graphical login prompt." -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:4552 -msgid "" -"The ttys5 method has the advantage of documenting which vty X will " -"start on and passing the responsibility of restarting the X server on logout to init8. The rc8 method makes it easy to " -"kill xdm if there is a problem starting the X server." -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:4559 -msgid "" -"If loaded from rc8, xdm should be started without " -"any arguments. xdm must start after getty8 runs, or else getty and xdm will conflict, locking out the console. The best way around this is to " -"have the script sleep 10 seconds or so then launch xdm." -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:4568 -msgid "" -"When starting xdm from /etc/ttys, there still is a chance of conflict between xdm and " -"getty8. One way to avoid this is to add the vt " -"number in /usr/local/lib/X11/xdm/Xservers:" -msgstr "" - -#. (itstool) path: answer/programlisting -#: book.translate.xml:4575 -#, no-wrap -msgid ":0 local /usr/local/bin/X vt4" -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:4577 -msgid "" -"The above example will direct the X server to run in /dev/ttyv3. Note the number is offset by one. The X server counts the vty " -"from one, whereas the FreeBSD kernel numbers the vty from zero." -msgstr "" - -#. (itstool) path: question/para -#: book.translate.xml:4586 -msgid "Why do I get Couldn't open console when I run xconsole?" -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:4592 -msgid "" -"When X is started with startx, the permissions on /dev/console will not get changed, resulting in things like xterm -C and xconsole not working." -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:4599 -msgid "" -"This is because of the way console permissions are set by default. On a multi-user system, one does not necessarily want just any user to be able to " -"write on the system console. For users who are logging directly onto a machine with a VTY, the fbtab5 file exists to solve such problems." -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:4606 -msgid "" -"In a nutshell, make sure an uncommented line of the form is in /etc/fbtab (see fbtab5):" -msgstr "" - -#. (itstool) path: answer/programlisting -#: book.translate.xml:4610 -#, no-wrap -msgid "/dev/ttyv0 0600 /dev/console" -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:4612 -msgid "It will ensure that whomever logs in on /dev/ttyv0 will own the console." -msgstr "" - -#. (itstool) path: question/para -#: book.translate.xml:4620 -msgid "Why does my PS/2 mouse misbehave under X?" -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:4624 -msgid "" -"The mouse and the mouse driver may have become out of synchronization. In rare cases, the driver may also erroneously report synchronization errors:" -msgstr "" - -#. (itstool) path: answer/programlisting -#: book.translate.xml:4628 -#, no-wrap -msgid "psmintr: out of sync (xxxx != yyyy)" -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:4630 -msgid "" -"If this happens, disable the synchronization check code by setting the driver flags for the PS/2 mouse driver to 0x100. This can be " -"easiest achieved by adding hint.psm.0.flags=\"0x100\" to /boot/loader.conf and rebooting." -msgstr "" - -#. (itstool) path: question/para -#: book.translate.xml:4641 -msgid "How do I reverse the mouse buttons?" -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:4645 -msgid "" -"Type xmodmap -e \"pointer = 3 2 1\". Add this command to ~/.xinitrc or ~/.xsession to make " -"it happen automatically." -msgstr "" - -#. (itstool) path: question/para -#: book.translate.xml:4655 -msgid "How do I install a splash screen and where do I find them?" -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:4660 -msgid "" -"The detailed answer for this question can be found in the Boot Time Splash Screens section of the FreeBSD Handbook." -msgstr "" - -#. (itstool) path: question/para -#: book.translate.xml:4669 -msgid "Can I use the Windows keys on my keyboard in X?" -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:4674 -msgid "" -"Yes. Use xmodmap1 to define which functions the " -"keys should perform." -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:4677 -msgid "Assuming all Windows keyboards are standard, the keycodes for these three keys are the following:" -msgstr "" - -#. (itstool) path: listitem/para -#: book.translate.xml:4683 -msgid "115Windows key, between the left-hand Ctrl and Alt keys" -msgstr "" - -#. (itstool) path: listitem/para -#: book.translate.xml:4690 -msgid "116Windows key, to the right of AltGr" -msgstr "" - -#. (itstool) path: listitem/para -#: book.translate.xml:4696 -msgid "117Menu, to the left of the right-hand Ctrl" -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:4702 -msgid "To have the left Windows key print a comma, try this." -msgstr "" - -#. (itstool) path: answer/screen -#: book.translate.xml:4705 -#, no-wrap -msgid "# xmodmap -e \"keycode 115 = comma\"" -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:4707 -msgid "" -"To have the Windows key-mappings enabled automatically every time X is started, either put the xmodmap commands in " -"~/.xinitrc or, preferably, create a ~/.xmodmaprc and include the xmodmap options, one per " -"line, then add the following line to ~/.xinitrc:" -msgstr "" - -#. (itstool) path: answer/programlisting -#: book.translate.xml:4716 -#, no-wrap -msgid "xmodmap $HOME/.xmodmaprc" -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:4718 -msgid "" -"For example, to map the 3 keys to be F13, F14, and F15, respectively. This would make it easy to map " -"them to useful functions within applications or the window manager." -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:4724 -msgid "To do this, put the following in ~/.xmodmaprc." -msgstr "" - -#. (itstool) path: answer/programlisting -#: book.translate.xml:4727 -#, no-wrap -msgid "" -"keycode 115 = F13\n" -"keycode 116 = F14\n" -"keycode 117 = F15" -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:4731 -msgid "" -"For the x11-wm/fvwm2 desktop manager, one could map the keys so that F13 iconifies or de-iconifies the window the " -"cursor is in, F14 brings the window the cursor is in to the front or, if it is already at the front, pushes it to the back, and " -"F15 pops up the main Workplace menu even if the cursor is not on the desktop, which is useful when no part of the desktop is visible." -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:4742 -msgid "The following entries in ~/.fvwmrc implement the aforementioned setup:" -msgstr "" - -#. (itstool) path: answer/programlisting -#: book.translate.xml:4746 -#, no-wrap -msgid "" -"Key F13 FTIWS A Iconify\n" -"Key F14 FTIWS A RaiseLower\n" -"Key F15 A A Menu Workplace Nop" -msgstr "" - -#. (itstool) path: question/para -#: book.translate.xml:4754 -msgid "How can I get 3D hardware acceleration for OpenGL?" -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:4759 -msgid "" -"The availability of 3D acceleration depends on the version of Xorg and the type of video chip. For an nVidia chip, use the binary drivers provided for " -"FreeBSD by installing one of the following ports:" -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:4765 -msgid "The latest versions of nVidia cards are supported by the x11/nvidia-driver port." -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:4769 -msgid "Older drivers are available as x11/nvidia-driver-###" -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:4772 -msgid "" -"nVidia provides detailed information on which card is supported by which driver on their web site: http://www.nvidia.com/object/IO_32667.html." -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:4775 -msgid "For Matrox G200/G400, check the x11-drivers/xf86-video-mga port." -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:4779 -msgid "" -"For ATI Rage 128 and Radeon see ati4, r1284 and radeon4." -msgstr "" - -#. (itstool) path: chapter/title -#: book.translate.xml:4787 -msgid "Networking" -msgstr "" - -#. (itstool) path: question/para -#: book.translate.xml:4792 -msgid "Where can I get information on diskless booting?" -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:4797 -msgid "" -"Diskless booting means that the FreeBSD box is booted over a network, and reads the necessary files from a server instead of its hard " -"disk. For full details, see the Handbook entry on " -"diskless booting." -msgstr "" - -#. (itstool) path: question/para -#: book.translate.xml:4807 -msgid "Can a FreeBSD box be used as a dedicated network router?" -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:4812 -msgid "" -"Yes. Refer to the Handbook entry on advanced " -"networking, specifically the section on routing " -"and gateways." -msgstr "" - -#. (itstool) path: question/para -#: book.translate.xml:4820 -msgid "Can I connect my Windows box to the Internet via FreeBSD?" -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:4825 -msgid "" -"Typically, people who ask this question have two PCs at home, one with FreeBSD and one with some version of Windows the idea is to use the FreeBSD box to connect to the Internet and then be able to access the Internet from the Windows box through the FreeBSD box. This is really just a special case of the previous question and works perfectly well." -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:4833 -msgid "" -"Dialup users must use and set gateway_enable to YES in /etc/rc.conf. " -"For more information, refer to ppp8 or the Handbook entry on user PPP." -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:4840 -msgid "" -"If the connection to the Internet is over Ethernet, use natd8. A " -"tutorial can be found in the natd " -"section of the Handbook." -msgstr "" - -#. (itstool) path: question/para -#: book.translate.xml:4848 -msgid "Does FreeBSD support PPP?" -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:4852 -msgid "" -"Yes. ppp8 provides support for both incoming and outgoing " -"connections." -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:4855 -msgid "" -"For more information on how to use this, refer to the Handbook chapter on PPP." -msgstr "" - -#. (itstool) path: question/para -#: book.translate.xml:4863 -msgid "Does FreeBSD support NAT or Masquerading?" -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:4867 -msgid "" -"Yes. For instructions on how to use NAT over a PPP connection, see the Handbook entry on PPP. To use NAT over some other sort of network connection, look at the natd section of the Handbook." -msgstr "" - -#. (itstool) path: question/para -#: book.translate.xml:4878 -msgid "How can I set up Ethernet aliases?" -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:4882 -msgid "If the alias is on the same subnet as an address already configured on the interface, add netmask 0xffffffff to this command:" -msgstr "" - -#. (itstool) path: answer/screen -#: book.translate.xml:4887 -#, no-wrap -msgid "# ifconfig ed0 alias 192.0.2.2 netmask 0xffffffff" -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:4889 -msgid "Otherwise, specify the network address and netmask as usual:" -msgstr "" - -#. (itstool) path: answer/screen -#: book.translate.xml:4892 -#, no-wrap -msgid "# ifconfig ed0 alias 172.16.141.5 netmask 0xffffff00" -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:4894 -msgid "" -"More information can be found in the FreeBSD Handbook." -msgstr "" - -#. (itstool) path: question/para -#: book.translate.xml:4900 -msgid "Why can I not NFS-mount from a Linux box?" -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:4904 -msgid "" -"Some versions of the Linux NFS code only accept mount requests from a privileged port; try to issue the " -"following command:" -msgstr "" - -#. (itstool) path: answer/screen -#: book.translate.xml:4908 -#, no-wrap -msgid "# mount -o -P linuxbox:/blah /mnt" -msgstr "" - -#. (itstool) path: question/para -#: book.translate.xml:4914 -msgid "" -"Why does mountd keep telling me it can't change attributes and that I have a bad exports list on my FreeBSD NFS server?" -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:4921 -msgid "" -"The most frequent problem is not understanding the correct format of /etc/exports. Review exports5 and the NFS entry in the Handbook, especially the section on configuring NFS." -msgstr "" - -#. (itstool) path: question/para -#: book.translate.xml:4931 -msgid "How do I enable IP multicast support?" -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:4935 -msgid "" -"Install the net/mrouted package or port and add mrouted_enable=\"YES\" to /etc/rc.conf start " -"this service at boot time." -msgstr "" - -#. (itstool) path: question/para -#: book.translate.xml:4945 -msgid "Why do I have to use the FQDN for hosts on my site?" -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:4950 -msgid "See the answer in the FreeBSD Handbook." -msgstr "" - -#. (itstool) path: question/para -#: book.translate.xml:4956 -msgid "Why do I get an error, Permission denied, for all networking operations?" -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:4962 -msgid "" -"If the kernel is compiled with the IPFIREWALL option, be aware that the default policy is to deny all packets that are not " -"explicitly allowed." -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:4967 -msgid "" -"If the firewall is unintentionally misconfigured, restore network operability by typing the following as root:" -msgstr "" - -#. (itstool) path: answer/screen -#: book.translate.xml:4971 -#, no-wrap -msgid "# ipfw add 65534 allow all from any to any" -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:4973 -msgid "Consider setting firewall_type=\"open\" in /etc/rc.conf." -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:4977 -msgid "" -"For further information on configuring this firewall, see the Handbook chapter." -msgstr "" - -#. (itstool) path: question/para -#: book.translate.xml:4985 -msgid "Why is my ipfw fwd rule to redirect a service to another machine not working?" -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:4991 -msgid "" -"Possibly because network address translation (NAT) is needed instead of just forwarding packets. A fwd rule only forwards packets, it " -"does not actually change the data inside the packet. Consider this rule:" -msgstr "" - -#. (itstool) path: answer/screen -#: book.translate.xml:4997 -#, no-wrap -msgid "01000 fwd 10.0.0.1 from any to foo 21" -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:4999 -msgid "" -"When a packet with a destination address of foo arrives at the machine with this rule, the packet is forwarded to " -"10.0.0.1, but it still has the destination address of foo. The destination address of the packet " -"is not changed to 10.0.0.1. Most machines would probably drop a packet that they receive with a destination address that is " -"not their own. Therefore, using a fwd rule does not often work the way the user expects. This behavior is a feature and not a bug." -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:5013 -msgid "" -"See the FAQ about redirecting services, the natd8 manual, or one of the several port redirecting utilities in the Ports Collection for a correct way to do this." -msgstr "" - -#. (itstool) path: question/para -#: book.translate.xml:5022 -msgid "How can I redirect service requests from one machine to another?" -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:5027 -msgid "" -"FTP and other service requests can be redirected with the sysutils/socket package or port. Replace the entry for the service in " -"/etc/inetd.conf to call socket, as seen in this example for ftpd:" -msgstr "" - -#. (itstool) path: answer/programlisting -#: book.translate.xml:5034 -#, no-wrap -msgid "ftp stream tcp nowait nobody /usr/local/bin/socket socket ftp.example.com ftp" -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:5036 -msgid "where ftp.example.com and ftp are the host and port to redirect to, respectively." -msgstr "" - -#. (itstool) path: question/para -#: book.translate.xml:5044 -msgid "Where can I get a bandwidth management tool?" -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:5048 -msgid "" -"There are three bandwidth management tools available for FreeBSD. dummynet4 is integrated into FreeBSD as part of ipfw4. ALTQ has been integrated into FreeBSD as part of " -"pf4. Bandwidth Manager from Emerging Technologies is a commercial product." -msgstr "" - -#. (itstool) path: question/para -#: book.translate.xml:5059 -msgid "Why do I get /dev/bpf0: device not configured?" -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:5064 -msgid "" -"The running application requires the Berkeley Packet Filter (bpf4), " -"but it was removed from a custom kernel. Add this to the kernel config file and build a new kernel:" -msgstr "" - -#. (itstool) path: answer/programlisting -#: book.translate.xml:5069 -#, no-wrap -msgid "device bpf # Berkeley Packet Filter" -msgstr "" - -#. (itstool) path: question/para -#: book.translate.xml:5075 -msgid "" -"How do I mount a disk from a Windows machine that is on my network, like smbmount in Linux?" -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:5080 -msgid "" -"Use the SMBFS toolset. It includes a set of kernel modifications and a set of userland programs. The programs and " -"information are available as mount_smbfs8 in the base system." -msgstr "" - -#. (itstool) path: question/para -#: book.translate.xml:5090 -msgid "What are these messages about: Limiting icmp/open port/closed port response in my log files?" -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:5096 -msgid "" -"This kernel message indicates that some activity is provoking it to send a large amount of ICMP or TCP reset (RST) responses. ICMP responses are often " -"generated as a result of attempted connections to unused UDP ports. TCP resets are generated as a result of attempted connections to unopened TCP " -"ports. Among others, these are the kinds of activities which may cause these messages:" -msgstr "" - -#. (itstool) path: listitem/para -#: book.translate.xml:5107 -msgid "Brute-force denial of service (DoS) attacks (as opposed to single-packet attacks which exploit a specific vulnerability)." -msgstr "" - -#. (itstool) path: listitem/para -#: book.translate.xml:5113 -msgid "Port scans which attempt to connect to a large number of ports (as opposed to only trying a few well-known ports)." -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:5119 -msgid "" -"The first number in the message indicates how many packets the kernel would have sent if the limit was not in place, and the second indicates the " -"limit. This limit is controlled using net.inet.icmp.icmplim. This example sets the limit to 300 packets per " -"second:" -msgstr "" - -#. (itstool) path: answer/screen -#: book.translate.xml:5127 -#, no-wrap -msgid "# sysctl net.inet.icmp.icmplim=300" -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:5129 -msgid "To disable these messages without disabling response limiting, use net.inet.icmp.icmplim_output to disable the output:" -msgstr "" - -#. (itstool) path: answer/screen -#: book.translate.xml:5135 -#, no-wrap -msgid "# sysctl net.inet.icmp.icmplim_output=0" -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:5137 -msgid "" -"Finally, to disable response limiting completely, set net.inet.icmp.icmplim to 0. Disabling response limiting is " -"discouraged for the reasons listed above." -msgstr "" - -#. (itstool) path: question/para -#: book.translate.xml:5146 -msgid "What are these arp: unknown hardware address format error messages?" -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:5151 -msgid "" -"This means that some device on the local Ethernet is using a MAC address in a format that FreeBSD does not recognize. This is probably caused by " -"someone experimenting with an Ethernet card somewhere else on the network. This is most commonly seen on cable modem networks. It is harmless, and " -"should not affect the performance of the FreeBSD system." -msgstr "" - -#. (itstool) path: question/para -#: book.translate.xml:5163 -msgid "" -"Why do I keep seeing messages like: 192.168.0.10 is on fxp1 but got reply from 00:15:17:67:cf:82 on rl0, and how do I disable it?" -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:5170 -msgid "" -"Because a packet is coming from outside the network unexpectedly. To disable them, set net.link.ether.inet.log_arp_wrong_iface to " -"0." -msgstr "" - -#. (itstool) path: question/para -#: book.translate.xml:5179 -msgid "How do I compile an IPv6 only kernel?" -msgstr "" - -#. (itstool) path: para/screen -#: book.translate.xml:5185 -#, no-wrap -msgid "" -"include GENERIC\n" -"ident GENERIC-IPV6ONLY\n" -"makeoptions MKMODULESENV+=\"WITHOUT_INET_SUPPORT=\"\n" -"nooptions INET\n" -"nodevice gre" -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:5183 -msgid "Configure your kernel with these settings: <_:screen-1/>" -msgstr "" - -#. (itstool) path: chapter/title -#: book.translate.xml:5196 -msgid "Security" -msgstr "" - -#. (itstool) path: question/para -#: book.translate.xml:5201 -msgid "What is a sandbox?" -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:5204 -msgid "Sandbox is a security term. It can mean two things:" -msgstr "" - -#. (itstool) path: listitem/para -#: book.translate.xml:5209 -msgid "" -"A process which is placed inside a set of virtual walls that are designed to prevent someone who breaks into the process from being able to break into " -"the wider system." -msgstr "" - -#. (itstool) path: listitem/para -#: book.translate.xml:5214 -msgid "" -"The process is only able to run inside the walls. Since nothing the process does in regards to executing code is supposed to be able to breach the " -"walls, a detailed audit of its code is not needed in order to be able to say certain things about its security." -msgstr "" - -#. (itstool) path: listitem/para -#: book.translate.xml:5221 -msgid "" -"The walls might be a user ID, for example. This is the definition used in the security7 and named8 man pages." -msgstr "" - -#. (itstool) path: listitem/para -#: book.translate.xml:5225 -msgid "" -"Take the ntalk service, for example (see inetd8). " -"This service used to run as user ID root. Now it runs as user ID tty. The tty user is a sandbox designed to make it more difficult for someone who has successfully " -"hacked into the system via ntalk from being able to hack beyond that user ID." -msgstr "" - -#. (itstool) path: listitem/para -#: book.translate.xml:5236 -msgid "" -"A process which is placed inside a simulation of the machine. It means that someone who is able to break into the process may believe that he can break " -"into the wider machine but is, in fact, only breaking into a simulation of that machine and not modifying any real data." -msgstr "" - -#. (itstool) path: listitem/para -#: book.translate.xml:5243 -msgid "" -"The most common way to accomplish this is to build a simulated environment in a subdirectory and then run the processes in that directory chrooted so " -"that / for that process is this directory, not the real / of the system)." -msgstr "" - -#. (itstool) path: listitem/para -#: book.translate.xml:5250 -msgid "" -"Another common use is to mount an underlying file system read-only and then create a file system layer on top of it that gives a process a seemingly " -"writeable view into that file system. The process may believe it is able to write to those files, but only the process sees the effects — other " -"processes in the system do not, necessarily." -msgstr "" - -#. (itstool) path: listitem/para -#: book.translate.xml:5258 -msgid "An attempt is made to make this sort of sandbox so transparent that the user (or hacker) does not realize that he is sitting in it." -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:5264 -msgid "UNIX implements two core sandboxes. One is at the process level, and one is at the userid level." -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:5267 -msgid "" -"Every UNIX process is completely firewalled off from every other UNIX process. One process cannot modify the address space of another." -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:5271 -msgid "" -"A UNIX process is owned by a particular userid. If the user ID is not the root user, it serves to firewall the process off from processes owned by other users. The user ID is also used to firewall off on-disk " -"data." -msgstr "" - -#. (itstool) path: question/para -#: book.translate.xml:5281 -msgid "What is securelevel?" -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:5285 -msgid "" -"securelevel is a security mechanism implemented in the kernel. When the securelevel is positive, the kernel restricts certain tasks; " -"not even the superuser (root) is allowed to do them. The securelevel mechanism limits the ability to:" -msgstr "" - -#. (itstool) path: listitem/para -#: book.translate.xml:5294 -msgid "Unset certain file flags, such as schg (the system immutable flag)." -msgstr "" - -#. (itstool) path: listitem/para -#: book.translate.xml:5300 -msgid "Write to kernel memory via /dev/mem and /dev/kmem." -msgstr "" - -#. (itstool) path: listitem/para -#: book.translate.xml:5306 -msgid "Load kernel modules." -msgstr "" - -#. (itstool) path: listitem/para -#: book.translate.xml:5310 -msgid "Alter firewall rules." -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:5314 -msgid "To check the status of the securelevel on a running system:" -msgstr "" - -#. (itstool) path: answer/screen -#: book.translate.xml:5317 -#, no-wrap -msgid "# sysctl -n kern.securelevel" -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:5319 -msgid "The output contains the current value of the securelevel. If it is greater than 0, at least some of the securelevel's protections are enabled." -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:5324 -msgid "" -"The securelevel of a running system cannot be lowered as this would defeat its purpose. If a task requires that the securelevel be non-positive, change " -"the kern_securelevel and kern_securelevel_enable variables in /etc/rc.conf and reboot." -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:5331 -msgid "" -"For more information on securelevel and the specific things all the levels do, consult init8." -msgstr "" - -#. (itstool) path: warning/para -#: book.translate.xml:5335 -msgid "Securelevel is not a silver bullet; it has many known deficiencies. More often than not, it provides a false sense of security." -msgstr "" - -#. (itstool) path: warning/para -#: book.translate.xml:5339 -msgid "" -"One of its biggest problems is that in order for it to be at all effective, all files used in the boot process up until the securelevel is set must be " -"protected. If an attacker can get the system to execute their code prior to the securelevel being set (which happens quite late in the boot process " -"since some things the system must do at start-up cannot be done at an elevated securelevel), its protections are invalidated. While this task of " -"protecting all files used in the boot process is not technically impossible, if it is achieved, system maintenance will become a nightmare since one " -"would have to take the system down, at least to single-user mode, to modify a configuration file." -msgstr "" - -#. (itstool) path: warning/para -#: book.translate.xml:5354 -msgid "" -"This point and others are often discussed on the mailing lists, particularly the FreeBSD security mailing list. Search the archives here for an " -"extensive discussion. A more fine-grained mechanism is preferred." -msgstr "" - -#. (itstool) path: question/para -#: book.translate.xml:5365 -msgid "BIND9 (named) is listening on some high-numbered ports. What is going on?" -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:5371 -msgid "" -"BIND uses a random high-numbered port for outgoing queries. Recent versions of it choose a new, random UDP port for each query. This may cause problems " -"for some network configurations, especially if a firewall blocks incoming UDP packets on particular ports. To get past that firewall, try the " -"avoid-v4-udp-ports and avoid-v6-udp-ports options to avoid selecting random port numbers within a blocked range." -msgstr "" - -#. (itstool) path: warning/para -#: book.translate.xml:5383 -msgid "" -"If a port number (like 53) is specified via the query-source or query-source-v6 options in /usr/local/" -"etc/namedb/named.conf, randomized port selection will not be used. It is strongly recommended that these options not be used to specify " -"fixed port numbers." -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:5393 -msgid "" -"Congratulations, by the way. It is good practice to read sockstat1 " -"output and notice odd things!" -msgstr "" - -#. (itstool) path: question/para -#: book.translate.xml:5401 -msgid "The Sendmail daemon is listening on port 587 as well as the standard port 25! What is going on?" -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:5407 -msgid "" -"Recent versions of Sendmail support a mail submission feature that runs over port 587. This is not yet widely supported, but " -"is growing in popularity." -msgstr "" - -#. (itstool) path: question/para -#: book.translate.xml:5416 -msgid "What is this UID 0 toor account? Have I been compromised?" -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:5421 -msgid "" -"Do not worry. toor is an alternative superuser account, where toor is root spelled " -"backwards. It is intended to be used with a non-standard shell so the default shell for root does not need " -"to change. This is important as shells which are not part of the base distribution, but are instead installed from ports or packages, are installed in " -"/usr/local/bin which, by default, resides on a different file system. If root's shell " -"is located in /usr/local/bin and the file system containing /usr/local/bin) is not mounted, root will not be able to log in to fix a problem and will have to reboot into single-user mode in order to enter the path to " -"a shell." -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:5438 -msgid "" -"Some people use toor for day-to-day root tasks with a non-" -"standard shell, leaving root, with a standard shell, for single-user mode or emergencies. By default, a " -"user cannot log in using toor as it does not have a password, so log in as root and set a password for toor before using it to login." -msgstr "" - -#. (itstool) path: chapter/title -#: book.translate.xml:5452 -msgid "PPP" -msgstr "" - -#. (itstool) path: question/para -#: book.translate.xml:5457 -msgid "I cannot make ppp8 work. What am I doing wrong?" -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:5462 -msgid "" -"First, read ppp8 and the PPP section of the Handbook. To assist in troubleshooting, enable logging with the " -"following command:" -msgstr "" - -#. (itstool) path: answer/programlisting -#: book.translate.xml:5468 -#, no-wrap -msgid "set log Phase Chat Connect Carrier lcp ipcp ccp command" -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:5470 -msgid "" -"This command may be typed at the ppp8 command prompt or it may be " -"entered at the start of the default section in /etc/ppp/ppp.conf. Make sure that /etc/syslog.conf contains the lines below and the file /var/log/ppp.log exists:" -msgstr "" - -#. (itstool) path: answer/programlisting -#: book.translate.xml:5478 -#, no-wrap -msgid "" -"!ppp\n" -"*.* /var/log/ppp.log" -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:5481 -msgid "A lot about what is going can be learned from the log file. Do not worry if it does not all make sense as it may make sense to someone else." -msgstr "" - -#. (itstool) path: question/para -#: book.translate.xml:5489 -msgid "Why does ppp8 hang when I run it?" -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:5493 -msgid "" -"This is usually because the hostname will not resolve. The best way to fix this is to make sure that /etc/hosts is read first by " -"the by ensuring that the hosts line is listed first in /etc/host.conf. Then, put an entry in /etc/" -"hosts for the local machine. If there is no local network, change the localhost line:" -msgstr "" - -#. (itstool) path: answer/programlisting -#: book.translate.xml:5502 -#, no-wrap -msgid "127.0.0.1 foo.example.com foo localhost" -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:5504 -msgid "Otherwise, add another entry for the host. Consult the relevant manual pages for more details." -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:5507 -msgid "When finished, verify that this command is successful: ping -c1 `hostname`." -msgstr "" - -#. (itstool) path: question/para -#: book.translate.xml:5514 -msgid "Why will ppp8 not dial in -auto mode?" -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:5519 -msgid "First, check that a default route exists. This command should display two entries:" -msgstr "" - -#. (itstool) path: answer/programlisting -#: book.translate.xml:5522 -#, no-wrap -msgid "" -"Destination Gateway Flags Refs Use Netif Expire\n" -"default 10.0.0.2 UGSc 0 0 tun0\n" -"10.0.0.2 10.0.0.1 UH 0 0 tun0" -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:5526 -msgid "If a default route is not listed, make sure that the HISADDR line has been added to /etc/ppp/ppp.conf." -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:5531 -msgid "" -"Another reason for the default route line being missing is that a default route has been added to /etc/rc.conf and this line is " -"missing from /etc/ppp/ppp.conf:" -msgstr "" - -#. (itstool) path: answer/programlisting -#: book.translate.xml:5537 -#, no-wrap -msgid "delete ALL" -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:5539 -msgid "" -"If this is the case, go back to the Final System " -"Configuration section of the Handbook." -msgstr "" - -#. (itstool) path: question/para -#: book.translate.xml:5547 -msgid "What does No route to host mean?" -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:5552 -msgid "This error is usually because the following section is missing in /etc/ppp/ppp.linkup:" -msgstr "" - -#. (itstool) path: answer/programlisting -#: book.translate.xml:5556 -#, no-wrap -msgid "" -"MYADDR:\n" -" delete ALL\n" -" add 0 0 HISADDR" -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:5560 -msgid "" -"This is only necessary for a dynamic IP address or when the address of the default gateway is unknown. When using interactive mode, the following can " -"be typed in after entering packet mode. Packet mode is indicated by the capitalized PPP in the prompt:" -msgstr "" - -#. (itstool) path: answer/programlisting -#: book.translate.xml:5567 -#, no-wrap -msgid "" -"delete ALL\n" -"add 0 0 HISADDR" -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:5570 -msgid "" -"Refer to the PPP and Dynamic IP addresses section of the Handbook for further details." -msgstr "" - -#. (itstool) path: question/para -#: book.translate.xml:5578 -msgid "Why does my connection drop after about 3 minutes?" -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:5583 -msgid "The default PPP timeout is 3 minutes. This can be adjusted with the following line:" -msgstr "" - -#. (itstool) path: answer/programlisting -#: book.translate.xml:5586 -#, no-wrap -msgid "set timeout NNN" -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:5588 -msgid "" -"where NNN is the number of seconds of inactivity before the connection is closed. If NNN is zero, " -"the connection is never closed due to a timeout. It is possible to put this command in ppp.conf, or to type it at the prompt in " -"interactive mode. It is also possible to adjust it on the fly while the line is active by connecting to ppp's server socket " -"using telnet1 or pppctl8. Refer to the ppp8 man page for further details." -msgstr "" - -#. (itstool) path: question/para -#: book.translate.xml:5603 -msgid "Why does my connection drop under heavy load?" -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:5607 -msgid "" -"If Link Quality Reporting (LQR) is configured, it is possible that too many LQR packets are lost between the " -"FreeBSD system and the peer. ppp8 deduces that the line must " -"therefore be bad, and disconnects. LQR is disabled by default and can be enabled with the following line:" -msgstr "" - -#. (itstool) path: answer/programlisting -#: book.translate.xml:5615 book.translate.xml:5941 -#, no-wrap -msgid "enable lqr" -msgstr "" - -#. (itstool) path: question/para -#: book.translate.xml:5621 -msgid "Why does my connection drop after a random amount of time?" -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:5626 -msgid "" -"Sometimes, on a noisy phone line or even on a line with call waiting enabled, the modem may hang up because it incorrectly thinks that it lost carrier." -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:5630 -msgid "There is a setting on most modems for determining how tolerant it should be to temporary losses of carrier. Refer to the modem manual for details." -msgstr "" - -#. (itstool) path: question/para -#: book.translate.xml:5638 -msgid "Why does my connection hang after a random amount of time?" -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:5643 -msgid "Many people experience hung connections with no apparent explanation. The first thing to establish is which side of the link is hung." -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:5647 -msgid "" -"When using an external modem, try using ping8 to see if the " -"TD light is flashing when data is transmitted. If it flashes but the RD light does not, the problem is with the " -"remote end. If TD does not flash, the problem is local. With an internal modem, use the set server command in " -"ppp.conf. When the hang occurs, connect to ppp8 " -"using pppctl8. If the network connection suddenly revives due to the " -"activity on the diagnostic socket, or if it will not connect but the set socket command succeeded at startup time, the problem is " -"local. If it can connect but things are still hung, enable local logging with set log local async and use " -"ping8 from another window or terminal to make use of the link. The " -"async logging will show the data being transmitted and received on the link. If data is going out and not coming back, the problem is remote." -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:5669 -msgid "Having established whether the problem is local or remote, there are now two possibilities:" -msgstr "" - -#. (itstool) path: listitem/para -#: book.translate.xml:5674 -msgid "If the problem is remote, read on entry ." -msgstr "" - -#. (itstool) path: listitem/para -#: book.translate.xml:5678 -msgid "If the problem is local, read on entry ." -msgstr "" - -#. (itstool) path: question/para -#: book.translate.xml:5686 -msgid "The remote end is not responding. What can I do?" -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:5691 -msgid "" -"There is very little that can be done about this. Many ISPs will refuse to help users not running a Microsoft OS. Add enable lqr to /etc/ppp/ppp.conf, allowing ppp8 to detect the remote failure and hang up. This detection is relatively slow and therefore not " -"that useful." -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:5699 -msgid "First, try disabling all local compression by adding the following to the configuration:" -msgstr "" - -#. (itstool) path: answer/programlisting -#: book.translate.xml:5702 -#, no-wrap -msgid "" -"disable pred1 deflate deflate24 protocomp acfcomp shortseq vj\n" -"deny pred1 deflate deflate24 protocomp acfcomp shortseq vj" -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:5705 -msgid "" -"Then reconnect to ensure that this makes no difference. If things improve or if the problem is solved completely, determine which setting makes the " -"difference through trial and error. This is good information for the ISP, although it may make it apparent that it is not a Microsoft system." -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:5712 -msgid "" -"Before contacting the ISP, enable async logging locally and wait until the connection hangs again. This may use up quite a bit of disk space. The last " -"data read from the port may be of interest. It is usually ASCII data, and may even describe the problem (Memory fault, " -"Core dumped)." -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:5720 -msgid "" -"If the ISP is helpful, they should be able to enable logging on their end, then when the next link drop occurs, they may be able to tell why their side " -"is having a problem." -msgstr "" - -#. (itstool) path: question/para -#: book.translate.xml:5729 -msgid "ppp8 has hung. What can I do?" -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:5733 -msgid "" -"In this case, rebuild ppp8 with debugging information, and then use " -"gdb1 to grab a stack trace from the ppp " -"process that is stuck. To rebuild the ppp utility with debugging information, type:" -msgstr "" - -#. (itstool) path: answer/screen -#: book.translate.xml:5740 -#, no-wrap -msgid "" -"# cd /usr/src/usr.sbin/ppp\n" -"# env DEBUG_FLAGS='-g' make clean\n" -"# env DEBUG_FLAGS='-g' make install" -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:5744 -msgid "" -"Then, restart ppp and wait until it hangs again. When the debug build of ppp hangs, start " -"gdb on the stuck process by typing:" -msgstr "" - -#. (itstool) path: answer/screen -#: book.translate.xml:5750 -#, no-wrap -msgid "# gdb ppp `pgrep ppp`" -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:5752 -msgid "" -"At the gdb prompt, use the bt or where commands to get a stack trace. Save the output " -"of the gdb session, and detach from the running process by typing quit." -msgstr "" - -#. (itstool) path: question/para -#: book.translate.xml:5763 -msgid "I keep seeing errors about magic being the same. What does it mean?" -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:5768 -msgid "" -"Occasionally, just after connecting, there may be messages in the log that say Magic is same. Sometimes, these messages are " -"harmless, and sometimes one side or the other exits. Most PPP implementations cannot survive this problem, and even if the link seems to come up, there " -"will be repeated configure requests and configure acknowledgments in the log file until ppp8 eventually gives up and closes the connection." -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:5778 -msgid "" -"This normally happens on server machines with slow disks that are spawning a getty8 on the port, and executing ppp8 from a " -"login script or program after login. There were reports of it happening consistently when using slirp. The reason is that in the time taken between " -"getty8 exiting and ppp8 starting, the client-side ppp8 starts sending Line Control Protocol (LCP) packets. Because ECHO is still switched on for the port on the server, the client " -"ppp8 sees these packets reflect back." -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:5789 -msgid "" -"One part of the LCP negotiation is to establish a magic number for each side of the link so that reflections can be detected. The " -"protocol says that when the peer tries to negotiate the same magic number, a NAK should be sent and a new magic number should be chosen. During the " -"period that the server port has ECHO turned on, the client ppp8 " -"sends LCP packets, sees the same magic in the reflected packet and NAKs it. It also sees the NAK reflect (which also means " -"ppp8 must change its magic). This produces a potentially enormous " -"number of magic number changes, all of which are happily piling into the server's tty buffer. As soon as ppp8 starts on the server, it is flooded with magic number changes and almost immediately decides it " -"has tried enough to negotiate LCP and gives up. Meanwhile, the client, who no longer sees the reflections, becomes happy just in time to see a hangup " -"from the server." -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:5807 -msgid "This can be avoided by allowing the peer to start negotiating with the following line in ppp.conf:" -msgstr "" - -#. (itstool) path: answer/programlisting -#: book.translate.xml:5811 book.translate.xml:5886 -#, no-wrap -msgid "set openmode passive" -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:5813 -msgid "" -"This tells ppp8 to wait for the server to initiate LCP negotiations. " -"Some servers however may never initiate negotiations. In this case, try something like:" -msgstr "" - -#. (itstool) path: answer/programlisting -#: book.translate.xml:5818 -#, no-wrap -msgid "set openmode active 3" -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:5820 -msgid "" -"This tells ppp8 to be passive for 3 seconds, and then to start " -"sending LCP requests. If the peer starts sending requests during this period, ppp8 will immediately respond rather than waiting for the full 3 second period." -msgstr "" - -#. (itstool) path: question/para -#: book.translate.xml:5830 -msgid "LCP negotiations continue until the connection is closed. What is wrong?" -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:5835 -msgid "" -"There is currently an implementation mis-feature in ppp8 where it " -"does not associate LCP, CCP & IPCP responses with their original requests. As a result, if one PPP implementation is more than 6 seconds slower " -"than the other side, the other side will send two additional LCP configuration requests. This is fatal." -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:5843 -msgid "" -"Consider two implementations, A and B. A starts sending LCP requests " -"immediately after connecting and B takes 7 seconds to start. When B starts, A has sent 3 LCP REQs. We are assuming the line has ECHO switched off, otherwise we would see magic number problems as described in the " -"previous section. B sends a REQ, then an ACK to the first of A's REQs. This results in A entering the OPENED state and sending and ACK (the first) back to B. In the meantime, " -"B sends back two more ACKs in response to the two additional REQs sent by A before B started up. B then receives the first ACK from A and enters the OPENED " -"state. A receives the second ACK from B and goes back to the REQ-SENT state, " -"sending another (forth) REQ as per the RFC. It then receives the third ACK and enters the OPENED state. In the meantime, " -"B receives the forth REQ from A, resulting in it reverting to the ACK-SENT state " -"and sending another (second) REQ and (forth) ACK as per the RFC. A gets the REQ, goes into REQ-SENT and " -"sends another REQ. It immediately receives the following ACK and enters OPENED." -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:5878 -msgid "This goes on until one side figures out that they are getting nowhere and gives up." -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:5881 -msgid "" -"The best way to avoid this is to configure one side to be passive — that is, make one side wait for the other to start negotiating. " -"This can be done with the following command:" -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:5888 -msgid "" -"Care should be taken with this option. This command can also be used to limit the amount of time that ppp8 waits for the peer to begin negotiations:" -msgstr "" - -#. (itstool) path: answer/programlisting -#: book.translate.xml:5893 -#, no-wrap -msgid "set stopped N" -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:5895 -msgid "" -"Alternatively, the following command (where N is the number of seconds to wait before starting negotiations) can be used:" -msgstr "" - -#. (itstool) path: answer/programlisting -#: book.translate.xml:5899 -#, no-wrap -msgid "set openmode active N" -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:5901 -msgid "Check the manual page for details." -msgstr "" - -#. (itstool) path: question/para -#: book.translate.xml:5907 -msgid "Why does ppp8 lock up when I shell out to test it?" -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:5912 -msgid "" -"When using shell or !, ppp8 " -"executes a shell or the passed arguments. The ppp program will wait for the command to complete before continuing. Any " -"attempt to use the PPP link while running the command will appear as a frozen link. This is because ppp8 is waiting for the command to complete." -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:5921 -msgid "" -"To execute commands like this, use !bg instead. This will execute the given command in the background, and " -"ppp8 can continue to service the link." -msgstr "" - -#. (itstool) path: question/para -#: book.translate.xml:5930 -msgid "Why does ppp8 over a null-modem cable never exit?" -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:5935 -msgid "" -"There is no way for ppp8 to automatically determine that a direct " -"connection has been dropped. This is due to the lines that are used in a null-modem serial cable. When using this sort of connection, LQR should always " -"be enabled with the following line:" -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:5943 -msgid "LQR is accepted by default if negotiated by the peer." -msgstr "" - -#. (itstool) path: question/para -#: book.translate.xml:5950 -msgid "" -"Why does ppp8 dial for no reason in mode?" -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:5955 -msgid "" -"If ppp8 is dialing unexpectedly, determine the cause, and set up " -"dial filters to prevent such dialing." -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:5959 -msgid "To determine the cause, use the following line:" -msgstr "" - -#. (itstool) path: answer/programlisting -#: book.translate.xml:5961 -#, no-wrap -msgid "set log +tcp/ip" -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:5963 -msgid "" -"This will log all traffic through the connection. The next time the line comes up unexpectedly, the reason will be logged with a convenient timestamp " -"next to it." -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:5968 -msgid "" -"Next, disable dialing under these circumstances. Usually, this sort of problem arises due to DNS lookups. To prevent DNS lookups from establishing a " -"connection (this will not prevent ppp8 from " -"passing the packets through an established connection), use the following:" -msgstr "" - -#. (itstool) path: answer/programlisting -#: book.translate.xml:5975 -#, no-wrap -msgid "" -"set dfilter 1 deny udp src eq 53\n" -"set dfilter 2 deny udp dst eq 53\n" -"set dfilter 3 permit 0/0 0/0" -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:5979 -msgid "" -"This is not always suitable, as it will effectively break demand-dial capabilities. Most programs will need a DNS lookup before doing any other network " -"related things." -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:5984 -msgid "" -"In the DNS case, try to determine what is actually trying to resolve a host name. A lot of the time, Sendmail is the " -"culprit. Make sure to configure Sendmail not to do any DNS lookups in its configuration file. See the section on using email with a dialup connection in the FreeBSD Handbook for " -"details. You may also want to add the following line to .mc:" -msgstr "" - -#. (itstool) path: answer/programlisting -#: book.translate.xml:5995 -#, no-wrap -msgid "define(`confDELIVERY_MODE', `d')dnl" -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:5997 -msgid "" -"This will make Sendmail queue everything until the queue is run, usually, every 30 minutes, or until a sendmail -q is done, perhaps from /etc/ppp/ppp.linkup." -msgstr "" - -#. (itstool) path: question/para -#: book.translate.xml:6007 -msgid "What do these CCP errors mean?" -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:6011 -msgid "I keep seeing the following errors in my log file:" -msgstr "" - -#. (itstool) path: answer/programlisting -#: book.translate.xml:6014 -#, no-wrap -msgid "" -"CCP: CcpSendConfigReq\n" -"CCP: Received Terminate Ack (1) state = Req-Sent (6)" -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:6017 -msgid "" -"This is because ppp8 is trying to negotiate Predictor1 compression, " -"but the peer does not want to negotiate any compression at all. The messages are harmless, but can be silenced by disabling the compression:" -msgstr "" - -#. (itstool) path: answer/programlisting -#: book.translate.xml:6023 -#, no-wrap -msgid "disable pred1" -msgstr "" - -#. (itstool) path: question/para -#: book.translate.xml:6029 -msgid "Why does ppp8 not log my connection speed?" -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:6034 -msgid "To log all lines of the modem conversation, enable the following:" -msgstr "" - -#. (itstool) path: answer/programlisting -#: book.translate.xml:6038 -#, no-wrap -msgid "set log +connect" -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:6040 -msgid "" -"This will make ppp8 log everything up until the last requested " -"expect string." -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:6043 -msgid "" -"To see the connect speed when using PAP or CHAP, make sure to configure ppp8 to expect the whole CONNECT line, using something like this:" -msgstr "" - -#. (itstool) path: answer/programlisting -#: book.translate.xml:6049 -#, no-wrap -msgid "" -"set dial \"ABORT BUSY ABORT NO\\\\sCARRIER TIMEOUT 4 \\\n" -" \\\"\\\" ATZ OK-ATZ-OK ATDT\\\\T TIMEOUT 60 CONNECT \\\\c \\\\n\"" -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:6052 -msgid "" -"This gets the CONNECT, sends nothing, then expects a line-feed, forcing ppp8 to read the whole CONNECT response." -msgstr "" - -#. (itstool) path: question/para -#: book.translate.xml:6060 -msgid "" -"Why does ppp8 ignore the \\ character in my chat " -"script?" -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:6065 -msgid "" -"The ppp utility parses each line in its configuration files so that it can interpret strings such as set phone " -"\"123 456 789\" correctly and realize that the number is actually only one argument. To specify a \" character, escape it " -"using a backslash (\\)." -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:6073 -msgid "" -"When the chat interpreter parses each argument, it re-interprets the argument to find any special escape sequences such as \\P or " -"\\T. As a result of this double-parsing, remember to use the correct number of escapes." -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:6080 -msgid "To actually send a \\ character, do something like:" -msgstr "" - -#. (itstool) path: answer/programlisting -#: book.translate.xml:6084 -#, no-wrap -msgid "set dial \"\\\"\\\" ATZ OK-ATZ-OK AT\\\\\\\\X OK\"" -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:6086 book.translate.xml:6098 -msgid "It will result in the following sequence:" -msgstr "" - -#. (itstool) path: answer/programlisting -#: book.translate.xml:6088 -#, no-wrap -msgid "" -"ATZ\n" -"OK\n" -"AT\\X\n" -"OK" -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:6093 -msgid "Or:" -msgstr "" - -#. (itstool) path: answer/programlisting -#: book.translate.xml:6095 -#, no-wrap -msgid "" -"set phone 1234567\n" -"set dial \"\\\"\\\" ATZ OK ATDT\\\\T\"" -msgstr "" - -#. (itstool) path: answer/programlisting -#: book.translate.xml:6100 -#, no-wrap -msgid "" -"ATZ\n" -"OK\n" -"ATDT1234567" -msgstr "" - -#. (itstool) path: question/para -#: book.translate.xml:6108 -msgid "What are FCS errors?" -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:6112 -msgid "" -"FCS stands for Frame Check Sequence. Each PPP packet has a checksum attached to ensure that the data being received is the data being sent. If the FCS " -"of an incoming packet is incorrect, the packet is dropped and the HDLC FCS count is increased. The HDLC error values can be displayed using the " -"show hdlc command." -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:6120 -msgid "" -"If the link is bad or if the serial driver is dropping packets, it will produce the occasional FCS error. This is not usually worth worrying about " -"although it does slow down the compression protocols substantially." -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:6125 -msgid "" -"If the link freezes as soon as it connects and produces a large number of FCS errors, make sure the modem is not using software flow control (XON/" -"XOFF). If the link must use software flow control, use set accmap 0x000a0000 to tell ppp8 to escape the ^Q and ^S characters." -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:6133 -msgid "" -"Another reason for too many FCS errors may be that the remote end has stopped talking PPP. In this case, enable async logging to determine if the incoming data is actually a login or shell prompt. If it is a shell prompt at the remote end, it is possible to " -"terminate ppp8 without dropping the line by using close " -"lcp followed by term) to reconnect to the shell on the remote machine." -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:6144 -msgid "If nothing in the log file indicates why the link was terminated, ask the remote administrator or ISP why the session was terminated." -msgstr "" - -#. (itstool) path: question/para -#: book.translate.xml:6153 -msgid "None of this helps — I am desperate! What can I do?" -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:6158 -msgid "" -"If all else fails, send the details of the error, the configuration files, how ppp8 is being started, the relevant parts of the log file, and the output of netstat -rn, before and after " -"connecting, to the FreeBSD general questions mailing list." -msgstr "" - -#. (itstool) path: chapter/title -#: book.translate.xml:6169 -msgid "Serial Communications" -msgstr "" - -#. (itstool) path: chapter/para -#: book.translate.xml:6171 -msgid "" -"This section answers common questions about serial communications with FreeBSD. PPP is covered in the Networking " -"section." -msgstr "" - -#. (itstool) path: question/para -#: book.translate.xml:6177 -msgid "Which multi-port serial cards are supported by FreeBSD?" -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:6182 -msgid "" -"There is a list of these in the Serial Communications " -"chapter of the Handbook." -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:6185 -msgid "Most multi-port PCI cards that are based on 16550 or clones are supported with no extra effort." -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:6188 -msgid "Some unnamed clone cards have also been known to work, especially those that claim to be AST compatible." -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:6191 -msgid "" -"Check uart4 and sio4 to get more information on configuring such cards." -msgstr "" - -#. (itstool) path: question/para -#: book.translate.xml:6198 -msgid "How do I get the boot: prompt to show on the serial console?" -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:6203 -msgid "See this section of the Handbook." -msgstr "" - -#. (itstool) path: question/para -#: book.translate.xml:6210 -msgid "How do I tell if FreeBSD found my serial ports or modem cards?" -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:6215 -msgid "" -"As the FreeBSD kernel boots, it will probe for the serial ports for which the kernel is configured. Either watch the boot messages closely or run this " -"command after the system is up and running:" -msgstr "" - -#. (itstool) path: answer/screen -#: book.translate.xml:6221 -#, no-wrap -msgid "" -"% grep -E '^(sio|uart)[0-9]' < /var/run/dmesg.boot\n" -"sio0: <16550A-compatible COM port> port 0x3f8-0x3ff irq 4 flags 0x10 on acpi0\n" -"sio0: type 16550A\n" -"sio1: <16550A-compatible COM port> port 0x2f8-0x2ff irq 3 on acpi0\n" -"sio1: type 16550A" -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:6227 -msgid "" -"This example shows two serial ports. The first is on IRQ4, port address 0x3f8, and has a 16550A-type UART chip. The second uses the " -"same kind of chip but is on IRQ3 and is at port address 0x2f8. Internal modem cards are treated just like serial ports, except that " -"they always have a modem attached to the port." -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:6237 -msgid "" -"The GENERIC kernel includes support for two serial ports using the same IRQ and port address settings in the above example. If " -"these settings are not right for the system, or if there are more modem cards or serial ports than the kernel is configured for, reconfigure using the " -"instructions in building a kernel for more details." -msgstr "" - -#. (itstool) path: question/para -#: book.translate.xml:6250 -msgid "How do I access the serial ports on FreeBSD?" -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:6254 -msgid "" -"The third serial port, sio2, or COM3, is on /dev/cuad2 for dial-out devices, and on " -"/dev/ttyd2 for dial-in devices. What is the difference between these two classes of devices?" -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:6261 -msgid "" -"When opening /dev/ttydX in blocking mode, a process will wait for the corresponding cuadX device to become " -"inactive, and then wait for the carrier detect line to go active. When the cuadX device is opened, it makes sure the serial port " -"is not already in use by the ttydX device. If the port is available, it steals it from the ttydX device. " -"Also, the cuadX device does not care about carrier detect. With this scheme and an auto-answer modem, remote users can log in and " -"local users can still dial out with the same modem and the system will take care of all the conflicts." -msgstr "" - -#. (itstool) path: question/para -#: book.translate.xml:6281 -msgid "How do I enable support for a multi-port serial card?" -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:6286 -msgid "" -"The section on kernel configuration provides information about configuring the kernel. For a multi-port serial card, place an " -"sio4 line for each serial port on the card in the device.hints5 file. But place the IRQ specifiers on only one of " -"the entries. All of the ports on the card should share one IRQ. For consistency, use the last serial port to specify the IRQ. Also, specify the " -"following option in the kernel configuration file:" -msgstr "" - -#. (itstool) path: answer/programlisting -#: book.translate.xml:6296 -#, no-wrap -msgid "options COM_MULTIPORT" -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:6298 -msgid "The following /boot/device.hints example is for an AST 4-port serial card on IRQ 12:" -msgstr "" - -#. (itstool) path: answer/programlisting -#: book.translate.xml:6302 -#, no-wrap -msgid "" -"hint.sio.4.at=\"isa\"\n" -"hint.sio.4.port=\"0x2a0\"\n" -"hint.sio.4.flags=\"0x701\"\n" -"hint.sio.5.at=\"isa\"\n" -"hint.sio.5.port=\"0x2a8\"\n" -"hint.sio.5.flags=\"0x701\"\n" -"hint.sio.6.at=\"isa\"\n" -"hint.sio.6.port=\"0x2b0\"\n" -"hint.sio.6.flags=\"0x701\"\n" -"hint.sio.7.at=\"isa\"\n" -"hint.sio.7.port=\"0x2b8\"\n" -"hint.sio.7.flags=\"0x701\"\n" -"hint.sio.7.irq=\"12\"" -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:6316 -msgid "" -"The flags indicate that the master port has minor number 7 (0x700), and all the ports share an IRQ " -"(0x001)." -msgstr "" - -#. (itstool) path: question/para -#: book.translate.xml:6325 -msgid "Can I set the default serial parameters for a port?" -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:6330 -msgid "" -"See the Serial Communications section in " -"the FreeBSD Handbook." -msgstr "" - -#. (itstool) path: question/para -#: book.translate.xml:6338 -msgid "How can I enable dialup logins on my modem?" -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:6342 -msgid "" -"Refer to the section about Dial-in Services in the FreeBSD " -"Handbook." -msgstr "" - -#. (itstool) path: question/para -#: book.translate.xml:6349 -msgid "How can I connect a dumb terminal to my FreeBSD box?" -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:6354 -msgid "" -"This information is in the Terminals section of the FreeBSD " -"Handbook." -msgstr "" - -#. (itstool) path: question/para -#: book.translate.xml:6361 -msgid "Why can I not run tip or cu?" -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:6366 -msgid "" -"The built-in tip1 and cu1 utilities can only access the /var/spool/lock directory via user uucp and group dialer. Use the dialer group to control who has access to the modem or remote systems by adding user accounts to dialer." -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:6375 -msgid "" -"Alternatively, everyone can be configured to run tip1 and " -"cu1 by typing:" -msgstr "" - -#. (itstool) path: answer/screen -#: book.translate.xml:6378 -#, no-wrap -msgid "" -"# chmod 4511 /usr/bin/cu\n" -"# chmod 4511 /usr/bin/tip" -msgstr "" - -#. (itstool) path: chapter/title -#: book.translate.xml:6386 -msgid "Miscellaneous Questions" -msgstr "" - -#. (itstool) path: question/para -#: book.translate.xml:6391 -msgid "FreeBSD uses a lot of swap space even when the computer has free memory left. Why?" -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:6396 -msgid "" -"FreeBSD will proactively move entirely idle, unused pages of main memory into swap in order to make more main memory available for active use. This " -"heavy use of swap is balanced by using the extra free memory for caching." -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:6402 -msgid "" -"Note that while FreeBSD is proactive in this regard, it does not arbitrarily decide to swap pages when the system is truly idle. Thus, the system will " -"not be all paged out after leaving it idle overnight." -msgstr "" - -#. (itstool) path: question/para -#: book.translate.xml:6412 -msgid "Why does top show very little free memory even when I have very few programs running?" -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:6417 -msgid "" -"The simple answer is that free memory is wasted memory. Any memory that programs do not actively allocate is used within the FreeBSD kernel as disk " -"cache. The values shown by top1 labeled as Inact " -"and Laundry are cached data at different aging levels. This cached data means the system does not have to access a slow disk again " -"for data it has accessed recently, thus increasing overall performance. In general, a low value shown for Free memory in " -"top1 is good, provided it is not very low." -msgstr "" - -#. (itstool) path: question/para -#: book.translate.xml:6434 -msgid "Why will chmod not change the permissions on symlinks?" -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:6439 -msgid "" -"Symlinks do not have permissions, and by default, chmod1 will follow " -"symlinks to change the permissions on the source file, if possible. For the file, foo with a symlink named bar, this command will always succeed." -msgstr "" - -#. (itstool) path: answer/screen -#: book.translate.xml:6446 -#, no-wrap -msgid "% chmod g-w bar" -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:6448 -msgid "However, the permissions on bar will not have changed." -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:6451 -msgid "" -"When changing modes of the file hierarchies rooted in the files instead of the files themselves, use either or " -"together with to make this work. See chmod1 and " -"symlink7 for more information." -msgstr "" - -#. (itstool) path: warning/para -#: book.translate.xml:6459 -msgid "" -" does a recursive chmod1. Be " -"careful about specifying directories or symlinks to directories to chmod1. To change the permissions of a directory referenced by a symlink, use chmod1 without any options and follow the symlink with a trailing slash (/). For example, if foo is a symlink to directory bar, to change the permissions of foo (actually bar), do something like:" -msgstr "" - -#. (itstool) path: warning/screen -#: book.translate.xml:6472 -#, no-wrap -msgid "% chmod 555 foo/" -msgstr "" - -#. (itstool) path: warning/para -#: book.translate.xml:6474 -msgid "" -"With the trailing slash, chmod1 will follow the symlink, " -"foo, to change the permissions of the directory, bar." -msgstr "" - -#. (itstool) path: question/para -#: book.translate.xml:6484 -msgid "Can I run DOS binaries under FreeBSD?" -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:6488 -msgid "Yes. A DOS emulation program, emulators/doscmd, is available in the FreeBSD Ports Collection." -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:6492 -msgid "" -"If doscmd will not suffice, emulators/pcemu emulates an 8088 and enough BIOS services to run many DOS " -"text-mode applications. It requires the X Window System." -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:6498 -msgid "" -"The Ports Collection also has emulators/dosbox. The main focus of this application is emulating old DOS games using the local file " -"system for files." -msgstr "" - -#. (itstool) path: question/para -#: book.translate.xml:6507 -msgid "What do I need to do to translate a FreeBSD document into my native language?" -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:6512 -msgid "" -"See the Translation FAQ in the " -"FreeBSD Documentation Project Primer." -msgstr "" - -#. (itstool) path: question/para -#: book.translate.xml:6520 -msgid "Why does my email to any address at FreeBSD.org bounce?" -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:6525 -msgid "" -"The FreeBSD.org mail system implements some Postfix checks on incoming mail " -"and rejects mail that is either from misconfigured relays or otherwise appears likely to be spam. Some of the specific requirements are:" -msgstr "" - -#. (itstool) path: listitem/para -#: book.translate.xml:6533 -msgid "The IP address of the SMTP client must \"reverse-resolve\" to a forward confirmed hostname." -msgstr "" - -#. (itstool) path: listitem/para -#: book.translate.xml:6539 -msgid "The fully-qualified hostname given in the SMTP conversation (either HELO or EHLO) must resolve to the IP address of the client." -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:6545 -msgid "Other advice to help mail reach its destination include:" -msgstr "" - -#. (itstool) path: listitem/para -#: book.translate.xml:6550 -msgid "Mail should be sent in plain text, and messages sent to mailing lists should generally be no more than 200KB in length." -msgstr "" - -#. (itstool) path: listitem/para -#: book.translate.xml:6556 -msgid "Avoid excessive cross posting. Choose one mailing list which seems most relevant and send it there." -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:6562 -msgid "" -"If you still have trouble with email infrastructure at FreeBSD.org, send a note with the details to " -"postmaster@freebsd.org; Include a date/time interval so that logs may be reviewed — and note that we only keep one week's worth of mail " -"logs. (Be sure to specify the time zone or offset from UTC.)" -msgstr "" - -#. (itstool) path: question/para -#: book.translate.xml:6575 -msgid "Where can I find a free FreeBSD account?" -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:6579 -msgid "" -"While FreeBSD does not provide open access to any of their servers, others do provide open access UNIX " -"systems. The charge varies and limited services may be available." -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:6584 -msgid "" -"Arbornet, Inc, also known as M-Net, has been providing open access to " -"UNIX systems since 1983. Starting on an Altos running System III, the site switched to BSD/OS in 1991. In " -"June of 2000, the site switched again to FreeBSD. M-Net can be accessed via telnet and " -"SSH and provides basic access to the entire FreeBSD software suite. However, network access is limited to members and " -"patrons who donate to the system, which is run as a non-profit organization. M-Net also provides an bulletin board system and " -"interactive chat." -msgstr "" - -#. (itstool) path: question/para -#: book.translate.xml:6602 -msgid "What is the cute little red guy's name?" -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:6606 -msgid "" -"He does not have one, and is just called the BSD daemon. If you insist upon using a name, call him beastie. Note that " -"beastie is pronounced BSD." -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:6612 -msgid "More about the BSD daemon is available on his home page." -msgstr "" - -#. (itstool) path: question/para -#: book.translate.xml:6619 -msgid "Can I use the BSD daemon image?" -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:6623 -msgid "" -"Perhaps. The BSD daemon is copyrighted by Marshall Kirk McKusick. Check his Statement on the Use of the BSD Daemon Figure for detailed usage terms." -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:6628 -msgid "" -"In summary, the image can be used in a tasteful manner, for personal use, so long as appropriate credit is given. Before using the logo commercially, " -"contact Kirk McKusick mckusick@FreeBSD.org for permission. More details are available on the BSD Daemon's home page." -msgstr "" - -#. (itstool) path: question/para -#: book.translate.xml:6639 -msgid "Do you have any BSD daemon images I could use?" -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:6643 -msgid "Xfig and eps drawings are available under /usr/share/examples/BSD_daemon/." -msgstr "" - -#. (itstool) path: question/para -#: book.translate.xml:6650 -msgid "I have seen an acronym or other term on the mailing lists and I do not understand what it means. Where should I look?" -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:6656 -msgid "Refer to the FreeBSD Glossary." -msgstr "" - -#. (itstool) path: question/para -#: book.translate.xml:6663 -msgid "Why should I care what color the bikeshed is?" -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:6667 -msgid "" -"The really, really short answer is that you should not. The somewhat longer answer is that just because you are capable of building a bikeshed does not " -"mean you should stop others from building one just because you do not like the color they plan to paint it. This is a metaphor indicating that you need " -"not argue about every little feature just because you know enough to do so. Some people have commented that the amount of noise generated by a change " -"is inversely proportional to the complexity of the change." -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:6678 -msgid "" -"The longer and more complete answer is that after a very long argument about whether sleep1 should take fractional second arguments, Poul-Henning Kamp phk@FreeBSD.org posted a long message entitled " -"A bike shed (any color will do) on greener grass.... The appropriate portions of " -"that message are quoted below." -msgstr "" - -#. (itstool) path: blockquote/attribution -#: book.translate.xml:6687 -msgid "" -"Poul-Henning Kamp phk@FreeBSD.org on freebsd-hackers, October 2, 1999" -msgstr "" - -#. (itstool) path: blockquote/para -#: book.translate.xml:6690 -msgid "What is it about this bike shed? Some of you have asked me." -msgstr "" - -#. (itstool) path: blockquote/para -#: book.translate.xml:6693 -msgid "" -"It is a long story, or rather it is an old story, but it is quite short actually. C. Northcote Parkinson wrote a book in the early 1960s, called " -"Parkinson's Law, which contains a lot of insight into the dynamics of management." -msgstr "" - -#. (itstool) path: blockquote/para -#: book.translate.xml:6699 -msgid "[snip a bit of commentary on the book]" -msgstr "" - -#. (itstool) path: blockquote/para -#: book.translate.xml:6702 -msgid "In the specific example involving the bike shed, the other vital component is an atomic power-plant, I guess that illustrates the age of the book." -msgstr "" - -#. (itstool) path: blockquote/para -#: book.translate.xml:6706 -msgid "" -"Parkinson shows how you can go into the board of directors and get approval for building a multi-million or even billion dollar atomic power plant, but " -"if you want to build a bike shed you will be tangled up in endless discussions." -msgstr "" - -#. (itstool) path: blockquote/para -#: book.translate.xml:6712 -msgid "" -"Parkinson explains that this is because an atomic plant is so vast, so expensive and so complicated that people cannot grasp it, and rather than try, " -"they fall back on the assumption that somebody else checked all the details before it got this far. Richard P. Feynmann gives a couple of interesting, " -"and very much to the point, examples relating to Los Alamos in his books." -msgstr "" - -#. (itstool) path: blockquote/para -#: book.translate.xml:6721 -msgid "" -"A bike shed on the other hand. Anyone can build one of those over a weekend, and still have time to watch the game on TV. So no matter how well " -"prepared, no matter how reasonable you are with your proposal, somebody will seize the chance to show that he is doing his job, that he is paying " -"attention, that he is here." -msgstr "" - -#. (itstool) path: blockquote/para -#: book.translate.xml:6729 -msgid "" -"In Denmark we call it setting your fingerprint. It is about personal pride and prestige, it is about being able to point somewhere and " -"say There! I did that. It is a strong trait in politicians, but present in most people given the chance. Just think " -"about footsteps in wet cement." -msgstr "" - -#. (itstool) path: chapter/title -#: book.translate.xml:6743 -msgid "The FreeBSD Funnies" -msgstr "" - -#. (itstool) path: question/para -#: book.translate.xml:6748 -msgid "How cool is FreeBSD?" -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:6752 -msgid "" -"Q. Has anyone done any temperature testing while running FreeBSD? I know Linux runs cooler than DOS, but " -"have never seen a mention of FreeBSD. It seems to run really hot." -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:6757 -msgid "" -"A. No, but we have done numerous taste tests on blindfolded volunteers who have also had 250 micrograms of LSD-25 administered beforehand. 35% of the " -"volunteers said that FreeBSD tasted sort of orange, whereas Linux tasted like purple haze. Neither group " -"mentioned any significant variances in temperature. We eventually had to throw the results of this survey out entirely anyway when we found that too " -"many volunteers were wandering out of the room during the tests, thus skewing the results. We think most of the volunteers are at Apple now, working on " -"their new scratch and sniff GUI. It is a funny old business we are in!" -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:6770 -msgid "" -"Seriously, FreeBSD uses the HLT (halt) instruction when the system is idle thus lowering its energy consumption and therefore the " -"heat it generates. Also if you have ACPI (Advanced Configuration and Power Interface) configured, then FreeBSD can also put the CPU " -"into a low power mode." -msgstr "" - -#. (itstool) path: question/para -#: book.translate.xml:6781 -msgid "Who is scratching in my memory banks??" -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:6785 -msgid "" -"Q. Is there anything odd that FreeBSD does when compiling the kernel which would cause the memory to make a scratchy sound? When " -"compiling (and for a brief moment after recognizing the floppy drive upon startup, as well), a strange scratchy sound emanates from what appears to be " -"the memory banks." -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:6792 -msgid "" -"A. Yes! You will see frequent references to daemons in the BSD documentation, and what most people do not know is that this refers to " -"genuine, non-corporeal entities that now possess your computer. The scratchy sound coming from your memory is actually high-pitched whispering " -"exchanged among the daemons as they best decide how to deal with various system administration tasks." -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:6801 -msgid "" -"If the noise gets to you, a good fdisk /mbr from DOS will get rid of them, but do not be surprised if they react adversely and try " -"to stop you. In fact, if at any point during the exercise you hear the satanic voice of Bill Gates coming from the built-in speaker, take off running " -"and do not ever look back! Freed from the counterbalancing influence of the BSD daemons, the twin demons of DOS and Windows are often able to re-assert total control over your machine to the eternal damnation of your soul. Now that you know, given a " -"choice you would probably prefer to get used to the scratchy noises, no?" -msgstr "" - -#. (itstool) path: question/para -#: book.translate.xml:6818 -msgid "How many FreeBSD hackers does it take to change a lightbulb?" -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:6823 -msgid "One thousand, one hundred and sixty-nine:" -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:6825 -msgid "Twenty-three to complain to -CURRENT about the lights being out;" -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:6828 -msgid "Four to claim that it is a configuration problem, and that such matters really belong on -questions;" -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:6831 -msgid "Three to submit PRs about it, one of which is misfiled under doc and consists only of it's dark;" -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:6835 -msgid "One to commit an untested lightbulb which breaks buildworld, then back it out five minutes later;" -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:6838 -msgid "Eight to flame the PR originators for not including patches in their PRs;" -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:6841 -msgid "Five to complain about buildworld being broken;" -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:6843 -msgid "Thirty-one to answer that it works for them, and they must have updated at a bad time;" -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:6846 -msgid "One to post a patch for a new lightbulb to -hackers;" -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:6849 -msgid "" -"One to complain that he had patches for this three years ago, but when he sent them to -CURRENT they were just ignored, and he has had bad experiences " -"with the PR system; besides, the proposed new lightbulb is non-reflexive;" -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:6855 -msgid "" -"Thirty-seven to scream that lightbulbs do not belong in the base system, that committers have no right to do things like this without consulting the " -"Community, and WHAT IS -CORE DOING ABOUT IT!?" -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:6860 -msgid "Two hundred to complain about the color of the bicycle shed;" -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:6863 -msgid "Three to point out that the patch breaks style9;" -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:6866 -msgid "Seventeen to complain that the proposed new lightbulb is under GPL;" -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:6869 -msgid "" -"Five hundred and eighty-six to engage in a flame war about the comparative advantages of the GPL, the BSD license, the MIT license, the NPL, and the " -"personal hygiene of unnamed FSF founders;" -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:6874 -msgid "Seven to move various portions of the thread to -chat and -advocacy;" -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:6877 -msgid "One to commit the suggested lightbulb, even though it shines dimmer than the old one;" -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:6880 -msgid "Two to back it out with a furious flame of a commit message, arguing that FreeBSD is better off in the dark than with a dim lightbulb;" -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:6884 -msgid "Forty-six to argue vociferously about the backing out of the dim lightbulb and demanding a statement from -core;" -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:6888 -msgid "Eleven to request a smaller lightbulb so it will fit their Tamagotchi if we ever decide to port FreeBSD to that platform;" -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:6892 -msgid "Seventy-three to complain about the SNR on -hackers and -chat and unsubscribe in protest;" -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:6895 -msgid "" -"Thirteen to post unsubscribe, How do I unsubscribe?, or Please remove me from the list, followed by the " -"usual footer;" -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:6900 -msgid "One to commit a working lightbulb while everybody is too busy flaming everybody else to notice;" -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:6903 -msgid "" -"Thirty-one to point out that the new lightbulb would shine 0.364% brighter if compiled with TenDRA (although it will have to be reshaped into a cube), " -"and that FreeBSD should therefore switch to TenDRA instead of GCC;" -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:6908 -msgid "One to complain that the new lightbulb lacks fairings;" -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:6911 -msgid "Nine (including the PR originators) to ask what is MFC?;" -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:6914 -msgid "Fifty-seven to complain about the lights being out two weeks after the bulb has been changed." -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:6917 -msgid "Nik Clayton nik@FreeBSD.org adds:" -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:6919 -msgid "I was laughing quite hard at this." -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:6922 -msgid "And then I thought, Hang on, shouldn't there be '1 to document it.' in that list somewhere?" -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:6926 -msgid "And then I was enlightened :-)" -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:6929 -msgid "" -"Thomas Abthorpe tabthorpe@FreeBSD.org says: None, real FreeBSD hackers are not afraid " -"of the dark!" -msgstr "" - -#. (itstool) path: question/para -#: book.translate.xml:6937 -msgid "Where does data written to /dev/null go?" -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:6942 -msgid "" -"It goes into a special data sink in the CPU where it is converted to heat which is vented through the heatsink / fan assembly. This is why CPU cooling " -"is increasingly important; as people get used to faster processors, they become careless with their data and more and more of it ends up in /" -"dev/null, overheating their CPUs. If you delete /dev/null (which effectively disables the CPU data sink) your CPU may " -"run cooler but your system will quickly become constipated with all that excess data and start to behave erratically. If you have a fast network " -"connection you can cool down your CPU by reading data out of /dev/random and sending it off somewhere; however you run the risk of " -"overheating your network connection and / or angering your ISP, as most of the data will end up getting converted to heat by their " -"equipment, but they generally have good cooling, so if you do not overdo it you should be OK." -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:6962 -msgid "Paul Robinson adds:" -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:6964 -msgid "" -"There are other methods. As every good sysadmin knows, it is part of standard practice to send data to the screen of interesting variety to keep all " -"the pixies that make up your picture happy. Screen pixies (commonly mis-typed or re-named as pixels) are categorized by the type of hat " -"they wear (red, green or blue) and will hide or appear (thereby showing the color of their hat) whenever they receive a little piece of food. Video " -"cards turn data into pixie-food, and then send them to the pixies — the more expensive the card, the better the food, so the better behaved the pixies " -"are. They also need constant stimulation — this is why screen savers exist." -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:6978 -msgid "" -"To take your suggestions further, you could just throw the random data to console, thereby letting the pixies consume it. This causes no heat to be " -"produced at all, keeps the pixies happy and gets rid of your data quite quickly, even if it does make things look a bit messy on your screen." -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:6985 -msgid "" -"Incidentally, as an ex-admin of a large ISP who experienced many problems attempting to maintain a stable temperature in a server room, I would " -"strongly discourage people sending the data they do not want out to the network. The fairies who do the packet switching and routing get annoyed by it " -"as well." -msgstr "" - -#. (itstool) path: question/para -#: book.translate.xml:6996 -msgid "My colleague sits at the computer too much, how can I prank her?" -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:7001 -msgid "Install games/sl and wait for her to mistype sl for ls." -msgstr "" - -#. (itstool) path: chapter/title -#: book.translate.xml:7010 -msgid "Advanced Topics" -msgstr "" - -#. (itstool) path: question/para -#: book.translate.xml:7015 -msgid "How can I learn more about FreeBSD's internals?" -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:7019 -msgid "See the FreeBSD Architecture Handbook." -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:7022 -msgid "Additionally, much general UNIX knowledge is directly applicable to FreeBSD." -msgstr "" - -#. (itstool) path: question/para -#: book.translate.xml:7029 -msgid "How can I contribute to FreeBSD? What can I do to help?" -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:7034 -#, fuzzy -msgid "" -"We accept all types of contributions: documentation, code, and even art. See the article on Contributing to FreeBSD for specific advice on how to do this." -msgstr "" -"然而,在您回報問題之前,請先閱讀 如何撰寫 FreeBSD 的問" -"題回報單,這是一篇告訴你怎樣才能寫出一篇真正有用的問題回報單。" - -#. (itstool) path: answer/para -#: book.translate.xml:7039 -msgid "And thanks for the thought!" -msgstr "" - -#. (itstool) path: question/para -#: book.translate.xml:7045 -msgid "What are snapshots and releases?" -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:7049 -msgid "" -"There are currently 2 active/semi-active branches in the FreeBSD Subversion Repository. " -"(Earlier branches are only changed very rarely, which is why there are only 2 active branches of development):" -msgstr "" - -#. (itstool) path: listitem/para -#: book.translate.xml:7057 -msgid "stable/11/ AKA 11-STABLE" -msgstr "" - -#. (itstool) path: listitem/para -#: book.translate.xml:7062 -msgid "stable/12/ AKA 12-STABLE" -msgstr "" - -#. (itstool) path: listitem/para -#: book.translate.xml:7067 -msgid "head/ AKA -CURRENT AKA 12-CURRENT" -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:7073 -msgid "" -"HEAD is not an actual branch tag. It is a symbolic constant for the current, non-branched development stream known as -" -"CURRENT." -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:7079 -msgid "" -"Right now, -CURRENT is the 13.X development stream; the 12-STABLE branch, " -"stable/12/, forked off from -CURRENT in December 2018 and the 11-STABLE branch, " -"stable/11/, forked off from -CURRENT in October 2016." -msgstr "" - -#. (itstool) path: question/para -#: book.translate.xml:7090 -msgid "How can I make the most of the data I see when my kernel panics?" -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:7095 -msgid "Here is typical kernel panic:" -msgstr "" - -#. (itstool) path: answer/programlisting -#: book.translate.xml:7097 -#, no-wrap -msgid "" -"Fatal trap 12: page fault while in kernel mode\n" -"fault virtual address = 0x40\n" -"fault code = supervisor read, page not present\n" -"instruction pointer = 0x8:0xf014a7e5\n" -"stack pointer = 0x10:0xf4ed6f24\n" -"frame pointer = 0x10:0xf4ed6f28\n" -"code segment = base 0x0, limit 0xfffff, type 0x1b\n" -" = DPL 0, pres 1, def32 1, gran 1\n" -"processor eflags = interrupt enabled, resume, IOPL = 0\n" -"current process = 80 (mount)\n" -"interrupt mask =\n" -"trap number = 12\n" -"panic: page fault" -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:7111 -msgid "" -"This message is not enough. While the instruction pointer value is important, it is also configuration dependent as it varies depending on the kernel " -"image. If it is a GENERIC kernel image from one of the snapshots, it is possible for somebody else to track down the offending " -"function, but for a custom kernel, only you can tell us where the fault occurred." -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:7120 -msgid "To proceed:" -msgstr "" - -#. (itstool) path: step/para -#: book.translate.xml:7124 -msgid "" -"Write down the instruction pointer value. Note that the 0x8: part at the beginning is not significant in this case: it is the " -"0xf0xxxxxx part that we want." -msgstr "" - -#. (itstool) path: step/para -#: book.translate.xml:7132 -msgid "When the system reboots, do the following:" -msgstr "" - -#. (itstool) path: step/screen -#: book.translate.xml:7134 -#, no-wrap -msgid "% nm -n kernel.that.caused.the.panic | grep f0xxxxxx" -msgstr "" - -#. (itstool) path: step/para -#: book.translate.xml:7136 -msgid "" -"where f0xxxxxx is the instruction pointer value. The odds are you will not get an exact match since the symbols in the kernel symbol " -"table are for the entry points of functions and the instruction pointer address will be somewhere inside a function, not at the start. If you do not " -"get an exact match, omit the last digit from the instruction pointer value and try again:" -msgstr "" - -#. (itstool) path: step/screen -#: book.translate.xml:7145 -#, no-wrap -msgid "% nm -n kernel.that.caused.the.panic | grep f0xxxxx" -msgstr "" - -#. (itstool) path: step/para -#: book.translate.xml:7147 -msgid "" -"If that does not yield any results, chop off another digit. Repeat until there is some sort of output. The result will be a possible list of functions " -"which caused the panic. This is a less than exact mechanism for tracking down the point of failure, but it is better than nothing." -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:7156 -msgid "" -"However, the best way to track down the cause of a panic is by capturing a crash dump, then using kgdb1 to generate a stack trace on the crash dump." -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:7161 -msgid "In any case, the method is this:" -msgstr "" - -#. (itstool) path: step/para -#: book.translate.xml:7165 -msgid "Make sure that the following line is included in the kernel configuration file:" -msgstr "" - -#. (itstool) path: step/programlisting -#: book.translate.xml:7168 -#, no-wrap -msgid "makeoptions DEBUG=-g # Build kernel with gdb(1) debug symbols" -msgstr "" - -#. (itstool) path: step/para -#: book.translate.xml:7172 -msgid "Change to the /usr/src directory:" -msgstr "" - -#. (itstool) path: step/screen -#: book.translate.xml:7175 -#, no-wrap -msgid "# cd /usr/src" -msgstr "" - -#. (itstool) path: step/para -#: book.translate.xml:7179 -msgid "Compile the kernel:" -msgstr "" - -#. (itstool) path: step/screen -#: book.translate.xml:7181 -#, no-wrap -msgid "# make buildkernel KERNCONF=MYKERNEL" -msgstr "" - -#. (itstool) path: step/para -#: book.translate.xml:7185 -msgid "Wait for make1 to finish compiling." -msgstr "" - -#. (itstool) path: step/screen -#: book.translate.xml:7189 -#, no-wrap -msgid "# make installkernel KERNCONF=MYKERNEL" -msgstr "" - -#. (itstool) path: step/para -#: book.translate.xml:7193 -msgid "Reboot." -msgstr "" - -#. (itstool) path: note/para -#: book.translate.xml:7198 -msgid "If KERNCONF is not included, the GENERIC kernel will instead be built and installed." -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:7203 -msgid "" -"The make1 process will have built two kernels. /usr/obj/" -"usr/src/sys/MYKERNEL/kernel and /usr/obj/usr/src/sys/MYKERNEL/kernel.debug. kernel was installed " -"as /boot/kernel/kernel, while kernel.debug can be used as the source of debugging symbols for " -"kgdb1." -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:7212 -msgid "" -"To capture a crash dump, edit /etc/rc.conf and set dumpdev to point to either the swap partition or " -"AUTO. This will cause the rc8 scripts to use the " -"dumpon8 command to enable crash dumps. This command can also be run " -"manually. After a panic, the crash dump can be recovered using savecore8; if dumpdev is set in /etc/rc.conf, the rc8 scripts will run savecore8 automatically and put the crash dump in /var/crash." -msgstr "" - -#. (itstool) path: note/para -#: book.translate.xml:7225 -msgid "" -"FreeBSD crash dumps are usually the same size as physical RAM. Therefore, make sure there is enough space in /var/crash to hold " -"the dump. Alternatively, run savecore8 manually and have it recover " -"the crash dump to another directory with more room. It is possible to limit the size of the crash dump by using options MAXMEM=N " -"where N is the size of kernel's memory usage in KBs. For example, for 1 GB of RAM, limit the kernel's memory usage to " -"128 MB, so that the crash dump size will be 128 MB instead of 1 GB." -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:7240 -msgid "Once the crash dump has been recovered , get a stack trace as follows:" -msgstr "" - -#. (itstool) path: answer/screen -#: book.translate.xml:7243 -#, no-wrap -msgid "" -"% kgdb /usr/obj/usr/src/sys/MYKERNEL/kernel.debug /var/crash/vmcore.0\n" -"(kgdb) backtrace" -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:7246 -msgid "" -"Note that there may be several screens worth of information. Ideally, use script1 to capture all of them. Using the unstripped kernel image with all the debug symbols should show the exact line of kernel source code " -"where the panic occurred. The stack trace is usually read from the bottom up to trace the exact sequence of events that lead to the crash. " -"kgdb1 can also be used to print out the contents of various " -"variables or structures to examine the system state at the time of the crash." -msgstr "" - -#. (itstool) path: tip/para -#: book.translate.xml:7258 -msgid "" -"If a second computer is available, kgdb1 can be configured to do " -"remote debugging, including setting breakpoints and single-stepping through the kernel code." -msgstr "" - -#. (itstool) path: note/para -#: book.translate.xml:7265 -msgid "" -"If DDB is enabled and the kernel drops into the debugger, a panic and a crash dump can be forced by typing panic " -"at the ddb prompt. It may stop in the debugger again during the panic phase. If it does, type continue and it " -"will finish the crash dump." -msgstr "" - -#. (itstool) path: question/para -#: book.translate.xml:7279 -msgid "Why has dlsym() stopped working for ELF executables?" -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:7284 -msgid "" -"The ELF toolchain does not, by default, make the symbols defined in an executable visible to the dynamic linker. Consequently dlsym() searches on handles obtained from calls to dlopen(NULL, flags) will fail to find such symbols." -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:7291 -msgid "" -"To search, using dlsym(), for symbols present in the main executable of a process, link the executable using the option to the ELF linker (ld1)." -msgstr "" - -#. (itstool) path: question/para -#: book.translate.xml:7301 -msgid "How can I increase or reduce the kernel address space on i386?" -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:7306 -msgid "" -"By default, the kernel address space is 1 GB (2 GB for PAE) for i386. When running a network-intensive server or using ZFS, this will probably not be " -"enough." -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:7312 -msgid "Add the following line to the kernel configuration file to increase available space and rebuild the kernel:" -msgstr "" - -#. (itstool) path: answer/programlisting -#: book.translate.xml:7316 -#, no-wrap -msgid "options KVA_PAGES=N" -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:7318 -msgid "" -"To find the correct value of N, divide the desired address space size (in megabytes) by four. (For example, it is " -"512 for 2 GB.)" -msgstr "" - -#. (itstool) path: chapter/title -#: book.translate.xml:7328 -msgid "Acknowledgments" -msgstr "" - -#. (itstool) path: chapter/para -#: book.translate.xml:7330 -msgid "" -"This innocent little Frequently Asked Questions document has been written, rewritten, edited, folded, spindled, mutilated, eviscerated, contemplated, " -"discombobulated, cogitated, regurgitated, rebuilt, castigated, and reinvigorated over the last decade, by a cast of hundreds if not thousands. " -"Repeatedly." -msgstr "" - -#. (itstool) path: chapter/para -#: book.translate.xml:7337 -msgid "" -"We wish to thank every one of the people responsible, and we encourage you to join them in making this FAQ even better." -msgstr "" diff --git a/zh_TW.UTF-8/books/fdp-primer/Makefile b/zh_TW.UTF-8/books/fdp-primer/Makefile deleted file mode 100644 index dd1e2b1398..0000000000 --- a/zh_TW.UTF-8/books/fdp-primer/Makefile +++ /dev/null @@ -1,37 +0,0 @@ -# -# $FreeBSD$ -# -# Build the FreeBSD Documentation Project Primer. -# - -MAINTAINER=doc@FreeBSD.org - -DOC?= book - -FORMATS?= html-split html - -INSTALL_COMPRESSED?= gz -INSTALL_ONLY_COMPRESSED?= - -# -# SRCS lists the individual XML files that make up the document. Changes -# to any of these files will force a rebuild -# - -# XML content -SRCS= book.xml - -# Images from the cross-document image library -IMAGES_LIB= callouts/1.png -IMAGES_LIB+= callouts/2.png -IMAGES_LIB+= callouts/3.png -IMAGES_LIB+= callouts/4.png -IMAGES_LIB+= callouts/5.png - -URL_RELPREFIX?= ../../../.. -DOC_PREFIX?= ${.CURDIR}/../../.. - -# Fixme! -DOCBOOK_DEPS_DISABLE=YES - -.include "${DOC_PREFIX}/share/mk/doc.project.mk" diff --git a/zh_TW.UTF-8/books/fdp-primer/book.xml b/zh_TW.UTF-8/books/fdp-primer/book.xml deleted file mode 100644 index 63c867bcb7..0000000000 --- a/zh_TW.UTF-8/books/fdp-primer/book.xml +++ /dev/null @@ -1,8465 +0,0 @@ - - - - - - - - - - - - - - - - - - -]> - - - 給新貢獻人員的 FreeBSD 說明文件計畫入門書 - - - FreeBSD 說明文件計劃 - - 1998 1999 2000 2001 2002 2003 2004 2005 2006 2007 2008 2009 2010 2011 2012 2013 2014 DocEng - - $FreeBSD$ - - $FreeBSD$ - - - - 版權 - - Redistribution and use in source (XML DocBook) and 'compiled' - forms (XML, HTML, PDF, PostScript, RTF and so forth) with or without - modification, are permitted provided that the following conditions are - met: - - - - Redistributions of source code (XML DocBook) must retain the - above copyright notice, this list of conditions and the following - disclaimer as the first lines of this file unmodified. - - - - Redistributions in compiled form (transformed to other DTDs, - converted to PDF, PostScript, RTF and other formats) must - reproduce the above copyright notice, this list of conditions and - the following disclaimer in the documentation and/or other - materials provided with the distribution. - - - - - THIS DOCUMENTATION IS PROVIDED BY THE FREEBSD DOCUMENTATION - PROJECT "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, - BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND - FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL - THE FREEBSD DOCUMENTATION PROJECT BE LIABLE FOR ANY DIRECT, INDIRECT, - INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, - BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS - OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR - TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE - USE OF THIS DOCUMENTATION, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH - DAMAGE. - - - - - - 感謝您參與 FreeBSD 說明文件計劃,您的點滴貢獻,都相當寶貴。 - - 本入手書內容包括:如何開始著手貢獻 FreeBSD 說明文件計劃 (FreeBSD Documentation Project, FDP) 的各項細節,以及會用到的一些工具、軟體,以及文件計畫的宗旨。 - - 本入門書仍在持續撰寫中。任何修正或新增內容的建議都非常歡迎。 - - - - - - - - Shell 提示符號 - - 下表顯示出一般使用者帳號與 root 的提示符號,在所有的文件例子中會用提示符號 (Prompt),來提醒您該用哪種帳號才對。 - - - - - - 帳號 - 提示符號 - - - - - - 一般使用者 - % - - - - root - # - - - - - - - - 書中所用的編排風格 - - 下表為本書中所使用編排風格方式 - - - - - - 代表意義 - 範例 - - - - - - 指令 - 使用 ls -l 來列出所有的檔案。 - - - - 檔名 - 編輯 .login - - - - 螢幕上會出現的訊息 - You have mail. - - - - 輸入指令後,螢幕上會出現的對應內容。 - - % date +"The time is %H:%M" -The time is 09:18 - - - - 要參考的線上手冊 - 使用 su1 來切換帳號。 - - - - 使用者名稱和群組名稱 - 只有 root 才可以做這件事。 - - - - 語氣的強調。 - 使用者必須這樣做 - - - - 打指令時,可替換的部份 - - 要搜尋線上手冊的關鍵字,請輸入 man -k 關鍵字 - - - - 環境變數。 - $HOME 是指帳號的家目錄所在處。 - - - - - - - - 注意、提示、重要、警告與範例 - - 出現在本文中的注意、警告、與範例。 - - - 注意:表示需要注意的事項,其中包括您需要注意的事情,因為這些事情可能會影響到操作結果。 - - - - 提示:提供可能對您有用的資訊,例如簡化操作方式的技巧說明。 - - - - 重要:表示要特別注意的事情。一般來說,它們會包括操作指令時需要加的額外參數。 - - - - 警告:表示警告事項,比如如果您不則可能導致的損失。這些損失可能是對您或硬體造成實際傷害,也可能是無法估計的損害,例如一時疏忽而刪除重要檔案...。 - - - - 範例的範本 - - 這是舉例說明而已,通常包含應遵循的指令範例,或顯示某些特定動作所可能發生的結果。 - - - - - 感謝 - - 在此要感謝 Sue Blake, Patrick Durusau, Jon Hamilton, Peter Flynn, Christopher Maden 這些人的協助與閱讀初期草稿,並提供許多寶貴的潤稿意見與評論。 - - - - - - - 概論 - - 歡迎參與 FreeBSD 說明文件計劃 (FreeBSD Documentation Project, FDP)。維持優秀質量的文件對 FreeBSD 的成功來說十分重要,您的點滴貢獻都是十分寶貴的。 - - 本文件描述:『 FDP 的架構有哪些』、『如何撰寫並提交文件』、 『如何有效運用工具來協助撰稿』。 - - 歡迎大家對 FDP 做出貢獻。唯一的成員要求就有貢獻的意願。 - - 本入門書指出如何: - - - - 瞭解有哪些文件是由 FDP 所維護的。 - - - - 安裝所需的說明文件工具和檔案。 - - - - 修改說明文件。 - - - - 提交修改以供審核並納入 FreeBSD 說明文件。 - - - - - 快速上手 - - 在編輯 FreeBSD 說明文件之前,有一些準備工作要做。首先,請訂閱 FreeBSD 文件計劃郵件論壇。有些團隊成員也會出現在 EFnet 的#bsddocs IRC 頻道。這些人可以幫忙解決文件相關的問題。 - - - - 安裝 textproc/docproj 套件或 Port。這個 meta-port 會安裝所有編輯和建置 FreeBSD 說明文件需要的軟體。 - - - - ~/doc 安裝 FreeBSD 說明文件檔案庫的本地端工作副本 (請見 )。 - - % svn checkout https://svn.FreeBSD.org/doc/head ~/doc - - - - 設定文字編輯器: - - - - 自動換行 (Word wrap) 設為 70 個字元。 - - - - Tab 定位點 (Tab stops) 設成 2。 - - - - 將行首每 8 個空白取代成 1 個 Tab。 - - - - 特定編輯器的設定方式列於 - - - - 更新本地端工作副本 - - % svn up ~/doc - - - - 編輯需要修改的說明文件檔案。如果檔案需要大幅度的編修,請先諮詢郵件論壇。 - - 標籤 (Tag) 和 Entity 的使用方式可以參考 - - - - 編輯完後,執行以下指令來檢查是否有問題: - - % igor -R filename.xml | less -RS - - 檢查輸出並重新編輯檔案來修正顯示的錯誤,然後重新執行指令來找出剩下的問題。重複執行直到所有錯誤都解決完。 - - - - 永遠要送出修正前請先做建置測試 (Build-test) 。在編輯的說明文件目錄最頂層執行 make,將會產生分頁的 HTML 格式 (Split HTML) 的文件。例如要建置 HTML 格式的英文版使用手冊,請在 en_US.ISO8859-1/books/handbook/ 目錄執行 make - - - - 修改並測試完後,產生 diff 檔 - - % cd ~/doc -% svn diff > bsdinstall.diff.txt - - 設一個可辨識的檔名。如上例中,是使用手冊的 bsdinstall 部份的修改。 - - - - 使用網頁版 問題回報 系統提交 diff 檔。如果使用網頁版,請輸入 [patch] 問題簡短描述 的概要 。選擇 docs 分類和 doc-bug類別。在訊息的主體中,輸入修正的簡短描述和其他相關的重要的細節。使用 [ Browse... ] 按鈕來附加 diff 檔。 - - - - - - FreeBSD 說明文件集 - - FDP 負責四類 FreeBSD 說明文件。 - - - - 使用手冊 (Handbook):使用手冊主要是給 FreeBSD 使用者提供詳盡的線上參考資料。 - - - - 常見問答集 (FAQ):主要是收集在各郵件論壇或論壇會常問到或有可能會問到的 FreeBSD 相關問題與答案。(簡單講,就是『問答集』格式) 通常會擺在這裡面的問答格式,不會放太長的詳細內容。 - - - - 操作手冊 (Manual page):英文版的系統手冊並不是由 FDP 所撰寫的,因為它們是屬於基礎系統 (Base system) 的部份。然而,FDP 可以修改這些文件,來讓這些文件寫得更清楚,甚至是勘正錯誤的地方。 - - - - 網站:這是 FreeBSD 在網路上的主要部份,位於 http://www.FreeBSD.org/ 以及許多其他鏡像站 (Mirror)。這網站是許多人第一次接觸 FreeBSD 的地方 - - - - 翻譯團隊負責翻譯使用手冊和網站到不同的語言。線上手冊目前並未翻譯 - - FreeBSD 網站、使用手冊、和 FAQ 的文件原始碼可以在 https://svn.FreeBSD.org/doc/ 的文件檔案庫取得。 - - 線上手冊的原始碼則是在 https://svn.FreeBSD.org/base/ 的原始碼庫可以取得。 - - 說明文件提交訊息可以用 svn log 察看。提交訊息也會封存在 http://lists.FreeBSD.org/mailman/listinfo/svn-doc-all - - 這些儲存庫的網頁版位於 - - 許多人會寫 FreeBSD 的教學文件或是 how-to 文章。有些保存在 FDP 的檔案中。其他一些說明文件則是作者希望放在他處。FDP 會盡力提供這些說明文件的連結。 - - - - - - - 工具 - - 有些工具軟體用來管理 FreeBSD 說明文件,並將他轉換成不同的輸出格式。有些則是在使用接下來章節的範例之前一定要安裝。有些工具是選擇性安裝的,但是裝了之後會更容易進行文件製作工作。 - - - 必備工具 - - 從 Port 套件集安裝 textproc/docproj。這個 meta-port 會安裝處理 FreeBSD 說明文件需要的所有應用程式。以下列出特定元件的進一步說明。 - - - <acronym>DTD</acronym>s 與 <acronym>Entities</acronym> - - FreeBSD 說明文件使用幾種文件類型定義 (DTDs) 與 XML entities 集合。這些都會經由 textproc/docproj Port 來安裝。 - - - - XHTML DTD (textproc/xhtml) - - - XHTML 是全球資訊網的一種標記語言,也是整個 FreeBSD 網站所使用的格式。 - - - - - DocBook DTD (textproc/docbook-xml) - - - DocBook 設計來製作技術說明文件的標記語言版本。FreeBSD 說明文件是以 DocBook 來撰寫。 - - - - - ISO 8879 entities (textproc/iso8879) - - - 在 ISO 8879:1986 之中的 entity 被許多 DTD 所大量使用,包括了數學符號、拉丁字母符號(尖重音等音節符號也是)以及希臘符號。 - - - - - - - - 選用工具 - - 以下應用程式並非必要,但有了可讓在說明文件的作業上更簡單或提升能力。 - - - 軟體 - - - - - Vim (editors/vim) - - - 一個很受歡迎的編輯器,可以處理 XML 和他的衍生相關文件,例如 DocBook XML - - - - - EmacsXEmacs (editors/emacseditors/xemacs) - - - 這兩個編輯器都包含特別模式來編輯用 XML DTD 標記的文件。這個模式包含指令來減少打字量,並可以幫忙減少錯誤的發生。 - - - - - - - - - - - 工作副本 - - 工作副本 (Working copy) 指的是已下載到本地電腦的 FreeBSD 說明文件樹檔案庫,所有對工作副本的更改會經過測試後再以修補檔 (Patch) 的格式提交到主要檔案庫。 - - 完整的說明文件樹副本會佔據 700 MB 的磁碟空間,要有空間能夠儲存暫存檔及各種輸出格式的測試版本需要 1 GB 的空間。 - - FreeBSD 說明文件檔案使用 Subversion 來管理,由於 Subversiontextproc/docproj 的必要應用程式之一,所以會隨著 textproc/docproj 一併安裝。 - - - 說明文件與操作手冊 - - FreeBSD 說明文件不只有書籍與文章,還有所有指令與設定檔的操作手冊 (Manual page) 也是文件的一部份,其中也有一部份是 FDP 的地盤。相關的檔案庫有兩個:doc 中有書籍與文章,而 base 中有作業系統以及操作手冊。要編輯操作手冊則必須另外取出 (Checkout) base 檔案庫。 - - 檔案庫中可能會含有數個版本的說明文件與原始碼。新的修改幾乎都只對最新版本 head 做更新。 - - - - 選擇一個目錄 - - FreeBSD 說明文件一般會儲存在 /usr/doc/,而系統原始碼及操作手冊則會存在 /usr/src/。這些目錄樹可改放在其他地方,有些使用者可能會為了避免與現有在主要目錄的資料搞混,把工作副本放在其他的地方。以下的例子會放在 ~/doc 以及 ~/src 兩個在使用者家目錄下的目錄。 - - - - 取出一份副本 - - 從檔案庫下載工作副本的動作稱作 取出 (Checkout),使用 svn checkout 來完成。本範例會取出主要說明文件樹最新版本的副本: - - % svn checkout https://svn.FreeBSD.org/doc/head ~/doc - - 取出原始碼編輯操作手冊的動作也很相似: - - % svn checkout https://svn.FreeBSD.org/base/head ~/src - - - - 更新工作副本 - - 在 FreeBSD 檔案庫中的文件與檔案每天都會更改,人們會修改檔案與提交變更的頻率非常快,即使取出 (Checkout) 只過小一段時間,本地的工作副本可能就與主要 FreeBSD 檔案庫有差異了。要更新本地版本以同步對主要檔案庫的變更可在有本地工作副本的目錄下使用 svn update - - % svn update ~/doc - - 養成良好的習慣在編輯文件檔前先執行 svn update,由於可能會有其他人最近才編輯完該檔案,若未更新本地工作副則不會有最新變更的內容,比其還要將舊版本地檔案與新版檔案庫檔案合併的動作來說,直接編輯最新版本的檔案要簡單多了。 - - - - 還原變更 - - 有時才做完的變更可能就變的不需要了,或者作者剛想要重新搛寫。檔案可使以使用 svn revert重設成尚未被修改過的狀態,舉例來說,要清除所有對 chapter.xml 的修改然後還原到未修改的版本可: - - % svn revert chapter.xml - - - - 比對差異 - - 在編輯一個檔案或數個檔案完成之後,需將本地工作副本與 FreeBSD 檔案庫的差異儲存到一個檔案然後提交。這些 差異 (Diff) 檔可透過將 svn diff 的輸出轉向到檔案來建立: - - % cd ~/doc -% svn diff > doc-fix-spelling.diff - - 給檔案取一個有意義的名字來辨識這次修改的內容,上述範例為例則是要修正整個說明文件樹的拼寫。 - - 若 diff 檔要使用網站的 Submit a FreeBSD problem report 介面來提交,請加上 .txt 副檔名來給認真又單純的網頁表單可以辨識其內容為純文字的線索。 - - 請小心:svn diff 會產生所有在目前目錄及其子目錄的變更差異,若在該工作副本中有已經編輯過的檔案還沒有要提交,請列出需要比較差異的檔案清單: - - % cd ~/doc -% svn diff disks/chapter.xml printers/chapter.xml > disks-printers.diff - - - - <application>Subversion</application> 參考文獻 - - 以下範例會示範 Subversion 的基本用法,要取得更多資訊可至 Subversion Book 與 Subversion 說明文件。 - - - - - - - 說明文件目錄結構 - - doc/ 樹中的檔案與目錄需要遵守特定結構是因為: - - - - 讓自動轉換說明文件到各種格式更簡單。 - - - - 促進不同說明文件組織之間的一致性,以便更輕鬆的在不同說明文件之間切換。 - - - - 可以很容易的決定新的說明文件應該放在文件樹中的哪個位置。 - - - - 除此之外,說明文件樹必須能容納各種不同語言與編碼的說明文件。很重要的一點是,說明文件樹結構不應強制任何特定默認或文化的偏好。 - - - 最上層,<filename>doc/</filename> - - doc/ 底下有兩種類型的目錄,兩種都有非常明確的目錄名稱與意義。 - - - - - - 目錄 - 用途 - - - - - - - share - - 含有未特定用於各說明文件翻譯與編碼的檔案。其子目錄更進一步將不同資訊的分類,例如,構成 make1 基礎設施的檔案放置於 share/mk,而額外的 XML 支援檔 (如 FreeBSD 延伸的 DocBook DTD) 則放在 share/xml - - - - - lang.encoding - - 每一個目錄代表可用的說明文件翻譯與編碼,例如 en_US.ISO8859-1/zh_TW.UTF-8/。名稱雖然長,但完整表達語言與編碼可以避免未來當一個翻譯團隊要以不同編碼提供同一個語言的說明文件造成的問題,這也同時避免往後要切換成萬國碼 (Unicode) 可能造成的問題。 - - - - - - - - <filename><replaceable>lang</replaceable>.<replaceable>encoding</replaceable>/</filename> 目錄 - - 這些目錄中含有說明文件。在此階層說明文件分成三個分類,使用不同的目錄名稱來代表。 - - - - - - 目錄 - 用途 - - - - - - - articles - - 以 DocBook article (或同等級) 標記的說明文件。非常短,且會分成幾個小節,通常取得時只會有一個 XHTML 檔案。 - - - - books - - 以 DocBook book (或同等級) 標記的說明文件。有跟書籍一樣的長度,會分成數個章。通常取得時會包含一個大型的 XHTML 檔 (供有較快連線速度的人使用,或者那些想直接在瀏覽器列印的人) 與數個連結的較小的檔案。 - - - - - man - - 供系統操作手冊 (Manual page) 翻譯使用。這個目錄會包含一個或多個 mann 目錄來對應已經翻譯的章節。 - - - - - - 並非所有 lang.encoding 的目錄都會有這些子目錄,這要看該翻譯團隊已經完成了多少翻譯來決定。 - - - - 文件特定資訊 - - 本節內含有關由 FDP 所管理的特定文件的特定注意事項。 - - - 使用手冊 (Handbook) - - books/handbook/ - - 操作手冊是以使用 FreeBSD DocBook 擴充 DTD 的 DocBook XML 所撰寫。 - - 使用手冊使用 DocBook book 來組織,整個手冊區分成數個部份 (part),每個部份中內含數個章 (chapter),而章 (chapter) 又更進一步的細分成數個節 (sect1) 與小節 (sect2, sect3) 以此類推。 - - - 實體組織結構 - - handbook 目錄中有數個檔案及目錄。 - - - 使用手冊的組織結構可能會隨時改變,本文件所詳述的組織結構可能會與現況不盡相同。有關使用手冊組織結構的問題可張貼到 FreeBSD documentation project mailing list。 - - - - <filename>Makefile</filename> - - Makefile 定義了一些會影響 XML 原始碼要如何轉換至其他格式的變數,並列出產生使用手冊所需的各原始檔,接著會引用可處理在各種文件格式轉換的標準 doc.project.mk 程式碼。 - - - - <filename>book.xml</filename> - - 此為使用手冊的最上層文件,其中包含了使用手冊的 DOCTYPE 宣告以及用來描述使用手冊結構的元素。 - - book.xml 會使用 參數 Entities 來載入 .ent 副檔名的檔案。這些檔案 (稍後會詳述) 接著會定義使用手冊剩下篇幅會使用的 一般 Entities。 - - - - <filename role="directory"><replaceable>directory</replaceable>/chapter.xml</filename> - - 每個在使用手冊的章會儲存成名稱為 chapter.xml 的檔案,分別放在不同的目錄中。每個目錄均是以在 chapter 元素中 id 屬性中的值來命名。 - - 例如,若有一章的檔案內容為: - - chapter id="kernelconfig" -... -chapter - - 那麼放置這個 chapter.xml 的目錄則會命名為 kernelconfig。一般來說一章的所有內容會存放在這一個檔案。 - - 當有 XHTML 版本的使用手冊之後,會用該檔產出 kernelconfig.html,而這個名稱也是根據 id 的值而定,與目錄名稱無關。 - - 在早期版本的使用手冊,檔案皆儲存在與 book.xml 相同的目錄中,而名稱會以 chapter 元素中的 id 屬性的值來命名。現在可在每個章節之中引用圖片,每個使用手冊章節的圖片會儲存在 share/images/books/handbook,而在地化版本的圖片應放在與每個章節 XML 原始碼相同的目錄。命名空間會衝突是必然的,但以目錄多、檔案少與目錄少、檔案多的結構相比,目錄多、檔案少會較容易處理命名空間衝突的問題。 - - 簡單來說會有很多個內含 chapter.xml 檔案的目錄,例如 basics/chapter.xml, introduction/chapter.xml 以及 printing/chapter.xml - - - 請勿以在使用手冊中的章節順序來命名章節或目錄,因為順序是會隨使用手冊重新組織後的內容改變的。重新組織結構應不需要去重新命名檔案,除非整個章節的階層被提升或下降。 - - - chapter.xml 檔案並不是可以被單獨建置的完整 XML 文件,只能結合成整本使用手冊之後再一併建置。 - - - - - - - - - - 說明文件建置流程 - - 本章內容涵蓋了說明文件建置流程以及如何使用 make1 來控制如何建置。 - - - 繪製 Docbook 為其他格式 - - 從單一個 DocBook 原始檔可以產生各種不同類型的輸出,想要輸出的類型可用 FORMATS 變數來設定。已知的格式清單列在 KNOWN_FORMATS 中: - - % cd ~/doc/en_US.ISO8859-1/books/handbook -% make -V KNOWN_FORMATS - - - 常見輸出格式 - - - - - FORMATS - 檔案類型 - 說明 - - - - - - html - HTML,單檔 - 單一 book.htmlarticle.html - - - - html-split - HTML,多檔 - 多個 HTML 檔案,每個章或節一個檔案,供一般網站使用。 - - - - pdf - PDF - 可攜的文件格式 - - - -
- - 預設輸出的格式會依文件而有所不同,但同常是 html-split。其他格式可設定 FORMATS 為特定值來選擇。在 FORMATS 設定所需格式的清單可一次輸出多個格式。 - - - 建置單頁 HTML 輸出檔 - - % cd ~/doc/en_US.ISO8859-1/books/handbook -% make FORMATS=html - - - - 建置分頁 HTML 及 <acronym>PDF</acronym> 輸出檔 - - % cd ~/doc/en_US.ISO8859-1/books/handbook -% make FORMATS="html-split pdf" - -
- - - FreeBSD 說明文件建置工具集 - - 建置與安裝 FDP 說明文件會使用到以下工具。 - - - - 主要的建置工具為 make1,特別是 Berkeley Make - - - - 套件建置會使用 FreeBSD 的 pkg-create8 來處理。 - - - - gzip1 用來建立壓縮版的文件,也支援 bzip21 封存。tar1 則用在套件建置。 - - - - install1 用來安裝說明文件。 - - - - - - - 了解在說明文件樹中的 <filename>Makefile</filename> - - 在 FreeBSD 說明文件計劃樹底下的 Makefile 主要有三個類型。 - - - - 子目錄的 Makefile 傳遞指令給在其所在目錄底下的目錄。 - - - - 說明文件的 Makefiles 用來描述要如何在其所在目錄產生文件。 - - - - Make 引用檔 會連結一些產生文件所需的程式,通常為 doc.xxx.mk - - - - - 子目錄的 <filename>Makefile</filename> - - 這種 Makefile 通常採用的格式為: - - SUBDIR =articles -SUBDIR+=books - -COMPAT_SYMLINK = en - -DOC_PREFIX?= ${.CURDIR}/.. -.include "${DOC_PREFIX}/share/mk/doc.project.mk" - - 前四行非空白的行用來定義 make1 的變數 SUBDIR, COMPAT_SYMLINKDOC_PREFIX - - SUBDIR 敘述與 COMPAT_SYMLINK 敘述示範了如何指派數值到一個變數,覆蓋先前的值。 - - SUBDIR 的第二行敘述示範如何將數值附加到目前的變數值之後,SUBDIR 變數現在變成了 articles books - - DOC_PREFIX 指派式示範了如何只在變數尚未定義時才指派數值給變數。這個功能在當 DOC_PREFIX 不在 Makefile 所認為的地方時,使用者可以覆蓋這個值,並提供正確的值。 - - 這所有的敘述實際代表什麼意思呢? SUBDIR 會列出接下來建置流程應傳遞作業到那些子目錄。 - - COMPAT_SYMLINK 是一個用來指定語言官方編碼的相容性符號連結 (doc/en 會指向 en_US.ISO-8859-1)。 - - DOC_PREFIX 是到 FreeBSD 說明文件計劃樹根目錄的路徑。這並非每一次都可以很輕易找到,為了增加彈性,要改寫也很簡單。.CURDIR 是一個 make1 內建的變數,代表目前目錄的路徑。 - - 最後一行會引用 FreeBSD 說明文件計劃的全專案 make1 系統檔 doc.project.mk,用來轉換這些變數成為建置的指令。 - - - - 說明文件的 <filename>Makefile</filename> - - 這些 Makefile 用來設定 make1 變數來描述要如何建置在該目錄中的說明文件。 - - 這裡有一個例子: - - MAINTAINER=nik@FreeBSD.org - -DOC?= book - -FORMATS?= html-split html - -INSTALL_COMPRESSED?= gz -INSTALL_ONLY_COMPRESSED?= - -# SGML content -SRCS= book.xml - -DOC_PREFIX?= ${.CURDIR}/../../.. - -.include "$(DOC_PREFIX)/share/mk/docproj.docbook.mk" - - MAINTAINER 變數讓提交者可以聲明文件在 FreeBSD 說明文件計劃中的所有權,並負責維護該文件。 - - DOC 是由此目錄會建立的主要文件的名稱 (不需要 .xml 副檔名)。SRCS 會列出產生文件所需的各別檔案,此處也應引用要在重新建置 (Rebuild) 使用的重要的檔案。 - - FORMATS 用來指定此份文件建置時預設應採用的格式。INSTALL_COMPRESSED 是為在文件建置時預設要使用的壓縮技術清單。INSTALL_ONLY_COMPRESS 預設為空值的,若在建置時只想要產生壓縮後的文件則改成非空值。 - - DOC_PREFIX 以及 include 敘述句應不需再說明了。 - - - - - FreeBSD 說明文件計劃 <application>Make</application> 引用檔 - - make1 includes are best explained by inspection of - the code. Here are the system include files: - - - - doc.project.mk is the main project - include file, which includes all the following include - files, as necessary. - - - - doc.subdir.mk handles traversing of - the document tree during the build and install - processes. - - - - doc.install.mk provides variables - that affect ownership and installation of documents. - - - - doc.docbook.mk is included if - DOCFORMAT is docbook - and DOC is set. - - - - - <filename>doc.project.mk</filename> - - By inspection: - - DOCFORMAT?= docbook -MAINTAINER?= doc@FreeBSD.org - -PREFIX?= /usr/local -PRI_LANG?= en_US.ISO8859-1 - -.if defined(DOC) -.if ${DOCFORMAT} == "docbook" -.include "doc.docbook.mk" -.endif -.endif - -.include "doc.subdir.mk" -.include "doc.install.mk" - - - - 變數 - - DOCFORMAT and - MAINTAINER are assigned default values, - if these are not set by the document make file. - - PREFIX is the prefix under which the - documentation building tools - are installed. For normal package and port installation, - this is /usr/local. - - PRI_LANG should be set to whatever - language and encoding is natural amongst users these - documents are being built for. US English is the - default. - - - PRI_LANG does not affect which - documents can, or even will, be built. Its main use is - creating links to commonly referenced documents into the - FreeBSD documentation install root. - - - - - 條件 - - The .if defined(DOC) line is an - example of a make1 conditional which, like in other - programs, defines behavior if some condition is true or if - it is false. defined is a function which - returns whether the variable given is defined or not. - - .if ${DOCFORMAT} == "docbook", next, - tests whether the DOCFORMAT variable is - "docbook", and in this case, includes - doc.docbook.mk. - - The two .endifs close the two above - conditionals, marking the end of their application. - - - - - <filename>doc.subdir.mk</filename> - - This file is too long to explain in detail. These notes - describe the most important features. - - - 變數 - - - - SUBDIR is a list of - subdirectories that the build process should go further - down into. - - - - ROOT_SYMLINKS is the name of - directories that should be linked to the document - install root from their actual locations, if the current - language is the primary language (specified by - PRI_LANG). - - - - COMPAT_SYMLINK is described in - the - Subdirectory Makefile - section. - - - - - - 目標與巨集 - - Dependencies are described by - target: - dependency1 dependency2 - ... tuples, where to build - target, the given - dependencies must be built first. - - After that descriptive tuple, instructions on how to - build the target may be given, if the conversion process - between the target and its dependencies are not previously - defined, or if this particular conversion is not the same as - the default conversion method. - - A special dependency .USE defines - the equivalent of a macro. - - _SUBDIRUSE: .USE -.for entry in ${SUBDIR} - @${ECHO} "===> ${DIRPRFX}${entry}" - @(cd ${.CURDIR}/${entry} && \ - ${MAKE} ${.TARGET:S/realpackage/package/:S/realinstall/install/} DIRPRFX=${DIRPRFX}${entry}/ ) -.endfor - - In the above, _SUBDIRUSE is now - a macro which will execute the given commands when it is - listed as a dependency. - - What sets this macro apart from other targets? - Basically, it is executed after the - instructions given in the build procedure it is listed as a - dependency to, and it does not adjust - .TARGET, which is the variable which - contains the name of the target currently being - built. - - clean: _SUBDIRUSE - rm -f ${CLEANFILES} - - In the above, clean will use - the _SUBDIRUSE macro after it has - executed the instruction - rm -f ${CLEANFILES}. In effect, this - causes clean to go further and - further down the directory tree, deleting built files as it - goes down, not on the way back - up. - - - 已提供的目標 - - - - install and - package both go down the - directory tree calling the real versions of themselves - in the subdirectories - (realinstall and - realpackage - respectively). - - - - clean removes files - created by the build process (and goes down the - directory tree too). - cleandir does the same, and - also removes the object directory, if any. - - - - - - - 更多條件 - - - - exists is another condition - function which returns true if the given file - exists. - - - - empty returns true if the given - variable is empty. - - - - target returns true if the given - target does not already exist. - - - - - - 在 <command>make (.for)</command> 中的迴圈結構 - - .for provides a way to repeat a set - of instructions for each space-separated element in a - variable. It does this by assigning a variable to contain - the current element in the list being examined. - - _SUBDIRUSE: .USE -.for entry in ${SUBDIR} - @${ECHO} "===> ${DIRPRFX}${entry}" - @(cd ${.CURDIR}/${entry} && \ - ${MAKE} ${.TARGET:S/realpackage/package/:S/realinstall/install/} DIRPRFX=${DIRPRFX}${entry}/ ) -.endfor - - In the above, if SUBDIR is empty, no - action is taken; if it has one or more elements, the - instructions between .for and - .endfor would repeat for every element, - with entry being replaced with the value - of the current element. - - - -
- - - - - 網站 - - FreeBSD 網站是 FreeBSD 文件的一部份。網站的檔案儲存在文件樹目錄,此例中是 ~/doc,的 en_US.ISO8859-1/htdocs 子目錄。 - - - 環境變數 - - Several environment variables control which parts of the - web site are built or installed, and to which - directories. - - - The web build system uses make1, and considers - variables to be set when they have been defined, even if they - are empty. The examples here show the recommended ways of - defining and using these variables. Setting or defining these - variables with other values or methods might lead to - unexpected surprises. - - - - - DESTDIR - - - DESTDIR specifies the path where the web site files - are to be installed. - - This variable is best set with env1 or the user - shell's method of setting environment variables, - setenv for csh1 or - export for sh1. - - - - - - - ENGLISH_ONLY - - - Default: undefined. Build and include all - translations. - - ENGLISH_ONLY=yes: use only - the English documents and ignore all translations. - - - - - WEB_ONLY - - - Default: undefined. Build both the web site - and all the books and articles. - - WEB_ONLY=yes: build or install - only HTML pages from the - en_US.ISO8859-1/htdocs directory. - Other directories and documents, including books and - articles, will be ignored. - - - - - WEB_LANG - - - Default: undefined. Build and include all the - available languages on the web site. - - Set to a space-separated list of languages to be - included in the build - or install. The formats are the same as the directory - names in the document root directory. For example, to - include the German and French documents: - - WEB_LANG="de_DE.ISO8859-1 fr_FR.ISO8859-1" - - - - - WEB_ONLY, WEB_LANG, - and ENGLISH_ONLY are make1 variables - and can be set in /etc/make.conf, - Makefile.inc, as environment variables on - the command line, or in dot files. - - - - 建置並安裝網頁 - - Having obtained the documentation and web site source files, - the web site can be built. - - An actual installation of the web site is run as the root - user because the permissions on the web server directory will - not allow files to be installed by an unprivileged user. - For testing, it can be useful to install the files as a normal - user to a temporary directory. - - In these examples, the web site files are built by user - jru in their home - directory, ~/doc, with a full path of - /usr/home/jru/doc. - - - The web site build uses the INDEX - from the Ports Collection and might fail if that file or - /usr/ports is not - present. The simplest approach is to install the Ports - Collection. - - - - 建置完整網站與所有說明文件 - - Build the web site and all documents. The resulting files - are left in the document tree: - - % cd ~/doc/en_US.ISO8859-1/htdocs/ -% make all - - - - 只建置英文版網站 - - Build the web site only, in English, as user - jru, and install - the resulting files into /tmp/www for - testing: - - % cd ~/doc/en_US.ISO8859-1/htdocs/ -% env DESTDIR=/tmp/www make ENGLISH_ONLY=yes WEB_ONLY=yes all install - - Changes to static files can usually be tested by viewing - the modified files directly with a web browser. If the site - has been built as shown above, a modified main page can be - viewed with: - - % firefox /tmp/www/data/index.html - - Modifications to dynamic files can be tested with a web - server running on the local system. After building the site - as shown above, this - /usr/local/etc/apache24/httpd.conf can be - used with www/apache24: - - # httpd.conf for testing the FreeBSD website -Define TestRoot "/tmp/www/data" - -# directory for configuration files -ServerRoot "/usr/local" - -Listen 80 - -# minimum required modules -LoadModule authz_core_module libexec/apache24/mod_authz_core.so -LoadModule mime_module libexec/apache24/mod_mime.so -LoadModule unixd_module libexec/apache24/mod_unixd.so -LoadModule cgi_module libexec/apache24/mod_cgi.so -LoadModule dir_module libexec/apache24/mod_dir.so - -# run the webserver as user and group -User www -Group www - -ServerAdmin you@example.com -ServerName fbsdtest - -# deny access to all files -<Directory /> - AllowOverride none - Require all denied -</Directory> - -# allow access to the website directory -DocumentRoot "${TestRoot}" -<Directory "${TestRoot}"> - Options Indexes FollowSymLinks - AllowOverride None - Require all granted -</Directory> - -# prevent access to .htaccess and .htpasswd files -<Files ".ht*"> - Require all denied -</Files> - -ErrorLog "/var/log/httpd-error.log" -LogLevel warn - -# set up the CGI script directory -<Directory "${TestRoot}/cgi"> - AllowOverride None - Options None - Require all granted - Options +ExecCGI - AddHandler cgi-script .cgi -</Directory> - -Include etc/apache24/Includes/*.conf - - Start the web server with - - # service apache24 onestart - - The web site can be viewed at - . Be aware that many - links refer to the real FreeBSD site by name, and those links - will still go to the external site instead of the local test - version. Fully testing the local site will require - temporarily setting DNS so - www.FreeBSD.org resolves to - localhost or the local - IP address. - - - - 建置並安裝網站 - - Build the web site and all documents as user - jru. Install the - resulting files as - root into the - default directory, - /root/public_html: - - % cd ~/doc/en_US.ISO8859-1/htdocs -% make all -% su - -Password: -# cd /usr/home/jru/doc/en_US.ISO8859-1/htdocs -# make install - - - The install process does not delete any old or outdated - files that existed previously in the same directory. If a new - copy of the site is built and installed every day, this command - will find and delete all files that have not been updated in - three days: - - # find /usr/local/www -ctime 3 -delete - - - - - - - XML 入門 - - Most FDP documentation is written with - markup languages based on XML. This chapter - explains what that means, how to read and understand the - documentation source, and the XML techniques - used. - - Portions of this section were inspired by Mark Galassi's - Get - Going With DocBook. - - - 概論 - - In the original days of computers, electronic text was - simple. There were a few character sets like - ASCII or EBCDIC, but that - was about it. Text was text, and what you saw really was what - you got. No frills, no formatting, no intelligence. - - Inevitably, this was not enough. When text is in a - machine-usable format, machines are expected to be able to use - and manipulate it intelligently. Authors want to indicate that - certain phrases should be emphasized, or added to a glossary, or - made into hyperlinks. Filenames could be shown in a - typewriter style font for viewing on screen, but - as italics when printed, or any of a myriad of - other options for presentation. - - It was once hoped that Artificial Intelligence (AI) would - make this easy. The computer would read the document and - automatically identify key phrases, filenames, text that the - reader should type in, examples, and more. Unfortunately, real - life has not happened quite like that, and computers still - require assistance before they can meaningfully process - text. - - More precisely, they need help identifying what is what. - Consider this text: - -
- To remove /tmp/foo, use - rm1. - - % rm /tmp/foo -
- - It is easy to see which parts are filenames, which are - commands to be typed in, which parts are references to manual - pages, and so on. But the computer processing the document - cannot. For this we need markup. - - Markup is commonly used to describe - adding value or increasing cost. - The term takes on both these meanings when applied to text. - Markup is additional text included in the document, - distinguished from the document's content in some way, so that - programs that process the document can read the markup and use - it when making decisions about the document. Editors can hide - the markup from the user, so the user is not distracted by - it. - - The extra information stored in the markup - adds value to the document. Adding the - markup to the document must typically be done by a - person—after all, if computers could recognize the text - sufficiently well to add the markup then there would be no need - to add it in the first place. This - increases the cost (the effort required) to - create the document. - - The previous example is actually represented in this - document like this: - - paraTo remove filename/tmp/foofilename, use &man.rm.1;.para - -screen&prompt.user; userinputrm /tmp/foouserinputscreen - - The markup is clearly separate from the content. - - Markup languages define what the markup means and how it - should be interpreted. - - Of course, one markup language might not be enough. A - markup language for technical documentation has very different - requirements than a markup language that is intended for cookery - recipes. This, in turn, would be very different from a markup - language used to describe poetry. What is really needed is a - first language used to write these other markup languages. A - meta markup language. - - This is exactly what the eXtensible Markup - Language (XML) is. Many markup languages - have been written in XML, including the two - most used by the FDP, - XHTML and DocBook. - - Each language definition is more properly called a grammar, - vocabulary, schema or Document Type Definition - (DTD). There are various languages to - specify an XML grammar, or - schema. - - A schema is a - complete specification of all the elements - that are allowed to appear, the order in which they should - appear, which elements are mandatory, which are optional, and so - forth. This makes it possible to write an - XML parser which reads - in both the schema and a document which claims to conform to the - schema. The parser can then confirm whether or not all the - elements required by the vocabulary are in the document in the - right order, and whether there are any errors in the markup. - This is normally referred to as - validating the document. - - - Validation confirms that the choice of - elements, their ordering, and so on, conforms to that listed - in the grammar. It does not check - whether appropriate markup has been used - for the content. If all the filenames in a document were - marked up as function names, the parser would not flag this as - an error (assuming, of course, that the schema defines - elements for filenames and functions, and that they are - allowed to appear in the same place). - - - Most contributions to the Documentation - Project will be content marked up in either - XHTML or DocBook, rather than alterations to - the schemas. For this reason, this book will not touch on how - to write a vocabulary. -
- - - 元素、標籤與屬性 - - All the vocabularies written in XML share - certain characteristics. This is hardly surprising, as the - philosophy behind XML will inevitably show - through. One of the most obvious manifestations of this - philosophy is that of content and - elements. - - Documentation, whether it is a single web page, or a lengthy - book, is considered to consist of content. This content is then - divided and further subdivided into elements. The purpose of - adding markup is to name and identify the boundaries of these - elements for further processing. - - For example, consider a typical book. At the very top - level, the book is itself an element. This book - element obviously contains chapters, which can be considered to - be elements in their own right. Each chapter will contain more - elements, such as paragraphs, quotations, and footnotes. Each - paragraph might contain further elements, identifying content - that was direct speech, or the name of a character in the - story. - - It may be helpful to think of this as - chunking content. At the very top level is one - chunk, the book. Look a little deeper, and there are more - chunks, the individual chapters. These are chunked further into - paragraphs, footnotes, character names, and so on. - - Notice how this differentiation between different elements - of the content can be made without resorting to any - XML terms. It really is surprisingly - straightforward. This could be done with a highlighter pen and - a printout of the book, using different colors to indicate - different chunks of content. - - Of course, we do not have an electronic highlighter pen, so - we need some other way of indicating which element each piece of - content belongs to. In languages written in - XML (XHTML, DocBook, et - al) this is done by means of tags. - - A tag is used to identify where a particular element starts, - and where the element ends. The tag is not part of - the element itself. Because each grammar was - normally written to mark up specific types of information, each - one will recognize different elements, and will therefore have - different names for the tags. - - For an element called - element-name the start tag will - normally look like element-name. - The corresponding closing tag for this element is element-name. - - - 使用元素 (開始與結束標籤) - - XHTML has an element for indicating - that the content enclosed by the element is a paragraph, - called p. - - pThis is a paragraph. It starts with the start tag for - the 'p' element, and it will end with the end tag for the 'p' - element.p - -pThis is another paragraph. But this one is much shorter.p - - - Some elements have no content. For example, in - XHTML, a horizontal line can be included in - the document. For these empty elements, - XML introduced a shorthand form that is - completely equivalent to the two-tag version: - - - 使用沒有內容的元素 - - XHTML has an element for indicating a - horizontal rule, called hr. This element - does not wrap content, so it looks like this: - - pOne paragraph.p -hrhr - -pThis is another paragraph. A horizontal rule separates this - from the previous paragraph.p - - The shorthand version consists of a single tag: - - pOne paragraph.p -hr - -pThis is another paragraph. A horizontal rule separates this - from the previous paragraph.p - - - As shown above, elements can contain other elements. In the - book example earlier, the book element contained all the chapter - elements, which in turn contained all the paragraph elements, - and so on. - - - 在元素中的元素; <tag>em</tag> - - pThis is a simple emparagraphem where some - of the emwordsem have been ememphasizedem.p - - - The grammar consists of rules that describe which elements - can contain other elements, and exactly what they can - contain. - - - People often confuse the terms tags and elements, and use - the terms as if they were interchangeable. They are - not. - - An element is a conceptual part of your document. An - element has a defined start and end. The tags mark where the - element starts and ends. - - When this document (or anyone else knowledgeable about - XML) refers to - the p tag - they mean the literal text consisting of the three characters - <, p, and - >. But the phrase - the p element refers to the - whole element. - - This distinction is very subtle. But - keep it in mind. - - - Elements can have attributes. An attribute has a name and a - value, and is used for adding extra information to the element. - This might be information that indicates how the content should - be rendered, or might be something that uniquely identifies that - occurrence of the element, or it might be something else. - - An element's attributes are written - inside the start tag for that element, and - take the form - attribute-name="attribute-value". - - In XHTML, the p - element has an attribute called - align, which suggests an - alignment (justification) for the paragraph to the program - displaying the XHTML. - - The align attribute can - take one of four defined values, left, - center, right and - justify. If the attribute is not specified - then the default is left. - - - 使用元素的屬性 - - p align="left"The inclusion of the align attribute - on this paragraph was superfluous, since the default is left.p - -p align="center"This may appear in the center.p - - - Some attributes only take specific values, such as - left or justify. Others - allow any value. - - - 屬性的單引號 - - p align='right'I am on the right!p - - - Attribute values in XML must be enclosed - in either single or double quotes. Double quotes are - traditional. Single quotes are useful when the attribute value - contains double quotes. - - Information about attributes, elements, and tags is stored - in catalog files. The Documentation Project uses standard - DocBook catalogs and includes additional catalogs for - FreeBSD-specific features. Paths to the catalog files are defined - in an environment variable so they can be found by the document - build tools. - - - 待辦事項... - - Before running the examples in this document, install - textproc/docproj from - the FreeBSD Ports Collection. This is a - meta-port that downloads and installs - the standard programs and supporting files needed by the - Documentation Project. csh1 users must use - rehash for the shell to recognize new - programs after they have been installed, or log out - and then log back in again. - - - - Create example.xml, and enter - this text: - - !DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd" - -html xmlns="http://www.w3.org/1999/xhtml" - head - titleAn Example XHTML Filetitle - head - - body - pThis is a paragraph containing some text.p - - pThis paragraph contains some more text.p - - p align="right"This paragraph might be right-justified.p - body -html - - - - Try to validate this file using an - XML parser. - - textproc/docproj - includes the xmllint - validating - parser. - - Use xmllint to validate the - document: - - % xmllint --valid --noout example.xml - - xmllint returns without displaying - any output, showing that the document validated - successfully. - - - - See what happens when required elements are omitted. - Delete the line with the - title and - title tags, and re-run - the validation. - - % xmllint --valid --noout example.xml -example.xml:5: element head: validity error : Element head content does not follow the DTD, expecting ((script | style | meta | link | object | isindex)* , ((title , (script | style | meta | link | object | isindex)* , (base , (script | style | meta | link | object | isindex)*)?) | (base , (script | style | meta | link | object | isindex)* , title , (script | style | meta | link | object | isindex)*))), got () - - This shows that the validation error comes from the - fifth line of the - example.xml file and that the - content of the head is - the part which does not follow the rules of the - XHTML grammar. - - Then xmllint shows the line where - the error was found and marks the exact character position - with a ^ sign. - - - - Replace the title element. - - - - - - - DOCTYPE 宣告 - - The beginning of each document can specify the name of the - DTD to which the document conforms. This - DOCTYPE declaration is used by XML parsers to - identify the DTD and ensure that the document - does conform to it. - - A typical declaration for a document written to conform with - version 1.0 of the XHTML - DTD looks like this: - - !DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd" - - That line contains a number of different components. - - - - <! - - - The indicator shows - this is an XML declaration. - - - - - DOCTYPE - - - Shows that this is an XML - declaration of the document type. - - - - - html - - - Names the first - element that - will appear in the document. - - - - - PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" - - - Lists the Formal Public Identifier - (FPI) - - Formal Public Identifier - - for the DTD to which this document - conforms. The XML parser uses this to - find the correct DTD when processing - this document. - - PUBLIC is not a part of the - FPI, but indicates to the - XML processor how to find the - DTD referenced in the - FPI. Other ways of telling the - XML parser how to find the - DTD are shown later. - - - - - "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd" - - - A local filename or a URL to find - the DTD. - - - - - > - - - Ends the declaration and returns to the - document. - - - - - - 正式公用識別碼 (<acronym>FPI</acronym>) - - - Formal Public Identifier - - - - It is not necessary to know this, but it is useful - background, and might help debug problems when the - XML processor can not locate the - DTD. - - - FPIs must follow a specific - syntax: - - "Owner//Keyword Description//Language" - - - - Owner - - - The owner of the FPI. - - The beginning of the string identifies the owner of - the FPI. For example, the - FPI - "ISO 8879:1986//ENTITIES Greek - Symbols//EN" lists - ISO 8879:1986 as being the owner for - the set of entities for Greek symbols. - ISO 8879:1986 is the International - Organization for Standardization - (ISO) number for the - SGML standard, the predecessor (and a - superset) of XML. - - Otherwise, this string will either look like - -//Owner - or - +//Owner - (notice the only difference is the leading - + or -). - - If the string starts with - then - the owner information is unregistered, with a - + identifying it as - registered. - - ISO 9070:1991 defines how - registered names are generated. It might be derived - from the number of an ISO - publication, an ISBN code, or an - organization code assigned according to - ISO 6523. Additionally, a - registration authority could be created in order to - assign registered names. The ISO - council delegated this to the American National - Standards Institute (ANSI). - - Because the FreeBSD Project has not been registered, - the owner string is -//FreeBSD. As seen - in the example, the W3C are not a - registered owner either. - - - - - Keyword - - - There are several keywords that indicate the type of - information in the file. Some of the most common - keywords are DTD, - ELEMENT, ENTITIES, - and TEXT. DTD is - used only for DTD files, - ELEMENT is usually used for - DTD fragments that contain only - entity or element declarations. TEXT - is used for XML content (text and - tags). - - - - - Description - - - Any description can be given for the contents - of this file. This may include version numbers or any - short text that is meaningful and unique for the - XML system. - - - - - Language - - - An ISO two-character code that - identifies the native language for the file. - EN is used for English. - - - - - - <filename>catalog</filename> 檔案 - - With the syntax above, an XML - processor needs to have some way of turning the - FPI into the name of the file containing - the DTD. A catalog file (typically - called catalog) contains lines that map - FPIs to filenames. For example, if the - catalog file contained the line: - - - - PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "1.0/transitional.dtd" - - The XML processor knows that the - DTD is called - transitional.dtd in the - 1.0 subdirectory of the directory that - held catalog. - - Examine the contents of - /usr/local/share/xml/dtd/xhtml/catalog.xml. - This is the catalog file for the XHTML - DTDs that were installed as part of the - textproc/docproj port. - - - - - <acronym>FPI</acronym> 的替代方案 - - Instead of using an FPI to indicate the - DTD to which the document conforms (and - therefore, which file on the system contains the - DTD), the filename can be explicitly - specified. - - The syntax is slightly different: - - !DOCTYPE html SYSTEM "/path/to/file.dtd" - - The SYSTEM keyword indicates that the - XML processor should locate the - DTD in a system specific fashion. This - typically (but not always) means the DTD - will be provided as a filename. - - Using FPIs is preferred for reasons of - portability. If the SYSTEM identifier is - used, then the DTD must be provided and - kept in the same location for everyone. - - - - - 跳脫回 <acronym>XML</acronym> - - Some of the underlying XML syntax can be - useful within documents. For example, comments can be included - in the document, and will be ignored by the parser. Comments - are entered using XML syntax. Other uses for - XML syntax will be shown later. - - XML sections begin with a - <! tag and end with a - >. These sections contain instructions - for the parser rather than elements of the document. Everything - between these tags is XML syntax. The - DOCTYPE - declaration shown earlier is an example of - XML syntax included in the document. - - - - - 註解 - - An XML document may contain comments. - They may appear anywhere as long as they are not inside tags. - They are even allowed in some locations inside the - DTD (e.g., between entity - declarations). - - XML comments start with the string - <!-- and end with the - string -->. - - Here are some examples of valid XML - comments: - - - <acronym>XML</acronym> 通用註解 - - <!-- This is inside the comment --> - -<!--This is another comment--> - -<!-- This is how you - write multiline comments --> - -<p>A simple <!-- Comment inside an element's content --> paragraph.</p> - - - XML comments may contain any strings - except --: - - - 錯誤的<acronym>XML</acronym> 註解 - - <!-- This comment--is wrong --> - - - - 待辦事項... - - - - Add some comments to - example.xml, and check that the file - still validates using xmllint. - - - - Add some invalid comments to - example.xml, and see the error - messages that xmllint gives when it - encounters an invalid comment. - - - - - - - Entities - - Entities are a mechanism for assigning names to chunks of - content. As an XML parser processes a - document, any entities it finds are replaced by the content of - the entity. - - This is a good way to have re-usable, easily changeable - chunks of content in XML documents. It is - also the only way to include one marked up file inside another - using XML. - - There are two types of entities for two different - situations: general entities and - parameter entities. - - - 一般 Entities - - General entities are used to assign names to reusable - chunks of text. These entities can only be used in the - document. They cannot be used in an - XML context. - - To include the text of a general entity in the document, - include - &entity-name; - in the text. For example, consider a general entity called - current.version which expands to the - current version number of a product. To use it in the - document, write: - - paraThe current version of our product is - &current.version;.para - - When the version number changes, edit the definition of - the general entity, replacing the value. Then reprocess the - document. - - General entities can also be used to enter characters that - could not otherwise be included in an XML - document. For example, < and - & cannot normally appear in an - XML document. The XML - parser sees the < symbol as the start of - a tag. Likewise, when the & symbol is - seen, the next text is expected to be an entity name. - - These symbols can be included by using two predefined - general entities: &lt; and - &amp;. - - General entities can only be defined within an - XML context. Such definitions are usually - done immediately after the DOCTYPE declaration. - - - 定義一般 Entities - - <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" -"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd" [ -<!ENTITY current.version "3.0-RELEASE"> -<!ENTITY last.version "2.2.7-RELEASE"> -]> - - The DOCTYPE declaration has been extended by adding a - square bracket at the end of the first line. The two - entities are then defined over the next two lines, the - square bracket is closed, and then the DOCTYPE declaration - is closed. - - The square brackets are necessary to indicate that the - DTD indicated by the DOCTYPE declaration is being - extended. - - - - - 參數 Entities - - Parameter entities, like - general - entities, are used to assign names to reusable chunks - of text. But parameter entities can only be used within an - XML - context. - - Parameter entity definitions are similar to those for - general entities. However, parameter entries are included - with - %entity-name;. - The definition also includes the % between - the ENTITY keyword and the name of the - entity. - - For a mnemonic, think - Parameter entities use the - Percent symbol. - - - 定義參數 Entities - - <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" -"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd" [ -<!ENTITY % param.some "some"> -<!ENTITY % param.text "text"> -<!ENTITY % param.new "%param.some more %param.text"> - -<!-- %param.new now contains "some more text" --> -]> - - - - - 待辦事項... - - - - Add a general entity to - example.xml. - - <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" -"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd" [ -<!ENTITY version "1.1"> -]> - -html xmlns="http://www.w3.org/1999/xhtml" - head - titleAn Example XHTML Filetitle - head - - <!-- There may be some comments in here as well --> - - body - pThis is a paragraph containing some text.p - - pThis paragraph contains some more text.p - - p align="right"This paragraph might be right-justified.p - - pThe current version of this document is: &version;p - body -html - - - - Validate the document using - xmllint. - - - - Load example.xml into a web - browser. It may have to be copied to - example.html before the browser - recognizes it as an XHTML - document. - - Older browsers with simple parsers may not render this - file as expected. The entity reference - &version; may not be replaced by - the version number, or the XML context - closing ]> may not be recognized and - instead shown in the output. - - - - The solution is to normalize the - document with an XML normalizer. The - normalizer reads valid XML and writes - equally valid XML which has been - transformed in some way. One way the normalizer - transforms the input is by expanding all the entity - references in the document, replacing the entities with - the text that they represent. - - xmllint can be used for this. It - also has an option to drop the initial - DTD section so that the closing - ]> does not confuse browsers: - - % xmllint --noent --dropdtd example.xml > example.html - - A normalized copy of the document with entities - expanded is produced in example.html, - ready to load into a web browser. - - - - - - - 在引用檔使用 Entities - - Both - general and - parameter - entities are particularly useful for including one file inside - another. - - - 在引用檔使用一般 Entities - - Consider some content for an XML book - organized into files, one file per chapter, called - chapter1.xml, - chapter2.xml, and so forth, with a - book.xml that will contain these - chapters. - - In order to use the contents of these files as the values - for entities, they are declared with the - SYSTEM keyword. This directs the - XML parser to include the contents of the - named file as the value of the entity. - - - 在引用檔使用一般 Entities - - <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" -"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd" [ -<!ENTITY chapter.1 SYSTEM "chapter1.xml"> -<!ENTITY chapter.2 SYSTEM "chapter2.xml"> -<!ENTITY chapter.3 SYSTEM "chapter3.xml"> -<!-- And so forth --> -]> - -html xmlns="http://www.w3.org/1999/xhtml" - <!-- Use the entities to load in the chapters --> - - &chapter.1; - &chapter.2; - &chapter.3; -html - - - - When using general entities to include other files - within a document, the files being included - (chapter1.xml, - chapter2.xml, and so on) - must not start with a DOCTYPE - declaration. This is a syntax error because entities are - low-level constructs and they are resolved before any - parsing happens. - - - - - 在引用檔使用參數 Entities - - Parameter entities can only be used inside an - XML context. Including a file in an - XML context can be used - to ensure that general entities are reusable. - - Suppose that there are many chapters in the document, and - these chapters were reused in two different books, each book - organizing the chapters in a different fashion. - - The entities could be listed at the top of each book, but - that quickly becomes cumbersome to manage. - - Instead, place the general entity definitions inside one - file, and use a parameter entity to include that file within - the document. - - - 在引用檔使用參數 Entities - - Place the entity definitions in a separate file - called chapters.ent and - containing this text: - - <!ENTITY chapter.1 SYSTEM "chapter1.xml"> -<!ENTITY chapter.2 SYSTEM "chapter2.xml"> -<!ENTITY chapter.3 SYSTEM "chapter3.xml"> - - Create a parameter entity to refer to the contents - of the file. Then use the parameter entity to load the file - into the document, which will then make all the general - entities available for use. Then use the general entities - as before: - - <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" -"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd" [ -<!-- Define a parameter entity to load in the chapter general entities --> -<!ENTITY % chapters SYSTEM "chapters.ent"> - -<!-- Now use the parameter entity to load in this file --> -%chapters; -]> - -html xmlns="http://www.w3.org/1999/xhtml" - &chapter.1; - &chapter.2; - &chapter.3; -html - - - - - 待辦事項... - - - 在引用檔使用一般 Entities - - - - Create three files, para1.xml, - para2.xml, and - para3.xml. - - Put content like this in each file: - - pThis is the first paragraph.p - - - - Edit example.xml so that it - looks like this: - - <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" -"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd" [ -<!ENTITY version "1.1"> -<!ENTITY para1 SYSTEM "para1.xml"> -<!ENTITY para2 SYSTEM "para2.xml"> -<!ENTITY para3 SYSTEM "para3.xml"> -]> - -html xmlns="http://www.w3.org/1999/xhtml" - head - titleAn Example XHTML Filetitle - head - - body - pThe current version of this document is: &version;p - - &para1; - &para2; - &para3; - body -html - - - - Produce example.html by - normalizing example.xml. - - % xmllint --dropdtd --noent example.xml > example.html - - - - Load example.html into the web - browser and confirm that the - paran.xml - files have been included in - example.html. - - - - - - 在引用檔使用參數 Entities - - - The previous steps must have completed before this - step. - - - - - Edit example.xml so that it - looks like this: - - <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" -"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd" [ -<!ENTITY % entities SYSTEM "entities.ent"> %entities; -]> - -html xmlns="http://www.w3.org/1999/xhtml" - head - titleAn Example XHTML Filetitle - head - - body - pThe current version of this document is: &version;p - - &para1; - &para2; - &para3; - body -html - - - - Create a new file called - entities.ent with this - content: - - <!ENTITY version "1.1"> -<!ENTITY para1 SYSTEM "para1.xml"> -<!ENTITY para2 SYSTEM "para2.xml"> -<!ENTITY para3 SYSTEM "para3.xml"> - - - - Produce example.html by - normalizing example.xml. - - % xmllint --dropdtd --noent example.xml > example.html - - - - Load example.html into the web - browser and confirm that the - paran.xml - files have been included in - example.html. - - - - - - - - 已標記小節 - - XML provides a mechanism to indicate that - particular pieces of the document should be processed in a - special way. These are called - marked sections. - - - 已標記的結構 - - <![KEYWORD[ - Contents of marked section -]]> - - - As expected of an XML construct, a marked - section starts with <!. - - The first square bracket begins the marked section. - - KEYWORD describes how this marked - section is to be processed by the parser. - - The second square bracket indicates the start of the - marked section's content. - - The marked section is finished by closing the two square - brackets, and then returning to the document context from the - XML context with - >. - - - 已標記關鍵字 - - - <literal>CDATA</literal> - - These keywords denote the marked sections - content model, and allow you to change - it from the default. - - When an XML parser is processing a - document, it keeps track of the - content model. - - The content model describes the - content the parser is expecting to see and what it will do - with that content. - - The CDATA content model is one of the - most useful. - - CDATA is for - Character Data. When the parser is in this - content model, it expects to see only characters. In this - model the < and - & symbols lose their special status, - and will be treated as ordinary characters. - - - When using CDATA in examples of - text marked up in XML, remember that - the content of CDATA is not validated. - The included text must be check with other means. For - example, the content could be written in another document, - validated, and then pasted into the - CDATA section. - - - - 使用 <literal>CDATA</literal> 已標記小節 - - paraHere is an example of how to include some text that contains - many literal&lt;literal and literal&amp;literal - symbols. The sample text is a fragment of - acronymXHTMLacronym. The surrounding text (para and - programlisting) are from DocBook.para - -programlisting<![CDATA[pThis is a sample that shows some of the - elements within acronymXHTMLacronym. Since the angle - brackets are used so many times, it is simpler to say the whole - example is a CDATA marked section than to use the entity names for - the left and right angle brackets throughout.p - - ul - liThis is a listitemli - liThis is a second listitemli - liThis is a third listitemli - ul - - pThis is the end of the example.p]]>programlisting - - - - - <literal>INCLUDE</literal> 與 <literal>IGNORE</literal> - - When the keyword is INCLUDE, then the - contents of the marked section will be processed. When the - keyword is IGNORE, the marked section - is ignored and will not be processed. It will not appear in - the output. - - - 在已標記小節中使用 <literal>INCLUDE</literal> 及 <literal>IGNORE</literal> - - <![INCLUDE[ - This text will be processed and included. -]]> - -<![IGNORE[ - This text will not be processed or included. -]]> - - - By itself, this is not too useful. Text to be - removed from the document could be cut out, or wrapped - in comments. - - It becomes more useful when controlled by - parameter - entities, yet this usage is limited - to entity files. - - For example, suppose that documentation was produced in - a hard-copy version and an electronic version. Some extra - text is desired in the electronic version content that was - not to appear in the hard-copy. - - Create an entity file that defines general entities to - include each chapter and guard these definitions with a - parameter entity that can be set to either - INCLUDE or IGNORE to - control whether the entity is defined. After these - conditional general entity definitions, place one more - definition for each general entity to set them to an empty - value. This technique makes use of the fact that entity - definitions cannot be overridden but the first definition - always takes effect. So the inclusion of the chapter is - controlled with the corresponding parameter entity. Set to - INCLUDE, the first general entity - definition will be read and the second one will be ignored. - Set to IGNORE, the first definition will - be ignored and the second one will take effect. - - - 使用參數 Entities 來控制已標記小節 - - <!ENTITY % electronic.copy "INCLUDE"> - -<![%electronic.copy;[ -<!ENTITY chap.preface SYSTEM "preface.xml"> -]]> - -<!ENTITY chap.preface ""> - - When producing the hard-copy version, change the - parameter entity's definition to: - - <!ENTITY % electronic.copy "IGNORE"> - - - - - - 待辦事項... - - - - Modify entities.ent to - contain the following: - - <!ENTITY version "1.1"> -<!ENTITY % conditional.text "IGNORE"> - -<![%conditional.text;[ -<!ENTITY para1 SYSTEM "para1.xml"> -]]> - -<!ENTITY para1 ""> - -<!ENTITY para2 SYSTEM "para2.xml"> -<!ENTITY para3 SYSTEM "para3.xml"> - - - - Normalize example.xml - and notice that the conditional text is not present in the - output document. Set the parameter entity - guard to INCLUDE and regenerate the - normalized document and the text will appear again. - This method makes sense if there are more - conditional chunks depending on the same condition. For - example, to control generating printed or online - text. - - - - - - - 結論 - - That is the conclusion of this XML - primer. For reasons of space and complexity, several things - have not been covered in depth (or at all). However, the - previous sections cover enough XML to - introduce the organization of the FDP - documentation. - -
- - - - - <acronym>XHTML</acronym> 標籤 - - - 簡介 - - This chapter describes usage of the XHTML - markup language used for the FreeBSD web site. - - XHTML is the XML - version of the HyperText Markup Language, the markup language of - choice on the World Wide Web. More information can be found at - http://www.w3.org/. - - XHTML is used to mark up pages on the - FreeBSD web site. It is usually not used to mark up other - documentation, since DocBook offers a far richer set of elements - from which to choose. Consequently, XHTML - pages will normally only be encountered when writing for the web - site. - - HTML has gone through a number of - versions. The XML-compliant version - described here is called XHTML. The latest - widespread version is XHTML 1.0, available in - both strict and - transitional variants. - - The XHTML DTDs are - available from the Ports Collection in - textproc/xhtml. They are - automatically installed by the textproc/docproj port. - - - This is not an exhaustive list of - elements, since that would just repeat the documentation for - XHTML. The aim is to list those elements - most commonly used. Please post questions about elements or - uses not covered here to the FreeBSD documentation project mailing list. - - - - Inline Versus Block - - In the remainder of this document, when describing - elements, inline means that the element - can occur within a block element, and does not cause a line - break. A block element, by comparison, - will cause a line break (and other processing) when it is - encountered. - - - - - 正式公用識別碼 (<acronym>FPI</acronym>) - - There are a number of XHTML - FPIs, depending upon the version, or - level of XHTML to which - a document conforms. Most XHTML documents on - the FreeBSD web site comply with the transitional version of - XHTML 1.0. - - PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" - - - - 分節元素 - - An XHTML document is normally split into - two sections. The first section, called the - head, contains meta-information about the - document, such as its title, the name of the author, the parent - document, and so on. The second section, the - body, contains content that will be - displayed to the user. - - These sections are indicated with head - and body elements respectively. These - elements are contained within the top-level - html element. - - - 一般的 <acronym>XHTML</acronym> 文件結構 - - html xmlns="http://www.w3.org/1999/xhtml" - head - titleThe Document's Titletitle - head - - body - - … - - body -html - - - - - 區塊元素 - - - 標題 - - XHTML has tags to denote headings in - the document at up to six different levels. - - The largest and most prominent heading is - h1, then h2, - continuing down to h6. - - The element's content is the text of the heading. - - - <tag>h1</tag>, <tag>h2</tag>, 以及其他標題標籤 - - 用法: - - h1First sectionh1 - -<!-- Document introduction goes here --> - -h2This is the heading for the first sectionh2 - -<!-- Content for the first section goes here --> - -h3This is the heading for the first sub-sectionh3 - -<!-- Content for the first sub-section goes here --> - -h2This is the heading for the second sectionh2 - -<!-- Content for the second section goes here --> - - - Generally, an XHTML page should have - one first level heading (h1). This can - contain many second level headings (h2), - which can in turn contain many third level headings. Do not - leave gaps in the numbering. - - - - 段落 - - XHTML supports a single paragraph - element, p. - - - <tag>p</tag> 範例 - - 用法: - - pThis is a paragraph. It can contain just about any - other element.p - - - - - 區塊引言 - - A block quotation is an extended quotation from another - document that will appear in a separate paragraph. - - - <tag>blockquote</tag> 範例 - - 用法: - - pA small excerpt from the US Constitution:p - -blockquoteWe the People of the United States, in Order to form - a more perfect Union, establish Justice, insure domestic - Tranquility, provide for the common defence, promote the general - Welfare, and secure the Blessings of Liberty to ourselves and our - Posterity, do ordain and establish this Constitution for the - United States of America.blockquote - - - - - 清單 - - XHTML can present the user with three - types of lists: ordered, unordered, and definition. - - Entries in an ordered list will be numbered, while entries - in an unordered list will be preceded by bullet points. - Definition lists have two sections for each entry. The first - section is the term being defined, and the second section is - the definition. - - Ordered lists are indicated by the ol - element, unordered lists by the ul - element, and definition lists by the dl - element. - - Ordered and unordered lists contain listitems, indicated - by the li element. A listitem can - contain textual content, or it may be further wrapped in one - or more p elements. - - Definition lists contain definition terms - (dt) and definition descriptions - (dd). A definition term can only contain - inline elements. A definition description can contain other - block elements. - - - <tag>ul</tag> 與 <tag>ol</tag> 範例 - - 用法: - - pAn unordered list. Listitems will probably be - preceded by bullets.p - -ul - liFirst itemli - - liSecond itemli - - liThird itemli -ul - -pAn ordered list, with list items consisting of multiple - paragraphs. Each item (note: not each paragraph) will be - numbered.p - -ol - lipThis is the first item. It only has one paragraph.pli - - lipThis is the first paragraph of the second item.p - - pThis is the second paragraph of the second item.pli - - lipThis is the first and only paragraph of the third - item.pli -ol - - - - 使用 <tag>dl</tag> 列定義清單 - - 用法: - - dl - dtTerm 1dt - - ddpParagraph 1 of definition 1.p - - pParagraph 2 of definition 1.pdd - - dtTerm 2dt - - ddpParagraph 1 of definition 2.pdd - - dtTerm 3dt - - ddpParagraph 1 of definition 3.pdd -dl - - - - - 已預排文字 - - Pre-formatted text is shown to the user exactly as it is - in the file. Text is shown in a fixed font. Multiple spaces - and line breaks are shown exactly as they are in the - file. - - Wrap pre-formatted text in the pre - element. - - - <tag>pre</tag> 範例 - - For example, the pre tags could be - used to mark up an email message: - - pre From: nik@FreeBSD.org - To: freebsd-doc@FreeBSD.org - Subject: New documentation available - - There is a new copy of my primer for contributors to the FreeBSD - Documentation Project available at - - &lt;URL:http://people.FreeBSD.org/~nik/primer/index.html&gt; - - Comments appreciated. - - Npre - - Keep in mind that < and - & still are recognized as special - characters in pre-formatted text. This is why the example - shown had to use &lt; instead of - <. For consistency, - &gt; was used in place of - >, too. Watch out for the special - characters that may appear in text copied from a plain-text - source, like an email message or program code. - - - - - 表格 - - Mark up tabular information using the - table element. A table consists of one or - more table rows (tr), each containing one - or more cells of table data (td). Each - cell can contain other block elements, such as paragraphs or - lists. It can also contain another table (this nesting can - repeat indefinitely). If the cell only contains one paragraph - then the pelement is not needed. - - - <tag>table</tag> 的簡單用法 - - 用法: - - pThis is a simple 2x2 table.p - -table - tr - tdTop left celltd - - tdTop right celltd - tr - - tr - tdBottom left celltd - - tdBottom right celltd - tr -table - - - A cell can span multiple rows and columns by adding the - rowspan or - colspan attributes with - values for the number of rows or columns to be spanned. - - - 使用 <tag class="attribute">rowspan</tag> - - 用法: - - pOne tall thin cell on the left, two short cells next to - it on the right.p - -table - tr - td rowspan="2"Long and thintd - tr - - tr - tdTop celltd - - tdBottom celltd - tr -table - - - - 使用 <tag class="attribute">colspan</tag> - - 用法: - - pOne long cell on top, two short cells below it.p - -table - tr - td colspan="2"Top celltd - tr - - tr - tdBottom left celltd - - tdBottom right celltd - tr -table - - - - <tag class="attribute">rowspan</tag> 與 <tag class="attribute">colspan</tag> 一起使用 - - 用法: - - pOn a 3x3 grid, the top left block is a 2x2 set of - cells merged into one. The other cells are normal.p - -table - tr - td colspan="2" rowspan="2"Top left large celltd - - tdTop right celltd - tr - - tr - <!-- Because the large cell on the left merges into - this row, the first <td> will occur on its - right --> - - tdMiddle right celltd - tr - - tr - tdBottom left celltd - - tdBottom middle celltd - - tdBottom right celltd - tr -table - - - - - - 行內元素 - - - 強調資訊 - - Two levels of emphasis are available in - XHTML, em and - strong. em is for a - normal level of emphasis and strong - indicates stronger emphasis. - - em is typically rendered in italic - and strong is rendered in bold. This is - not always the case, and should not be relied upon. According - to best practices, web pages only hold structural and - semantical information, and stylesheets are later applied to - them. Think of semantics, not formatting, when using these - tags. - - - <tag>em</tag> 與 <tag>strong</tag> 範例 - - 用法: - - pemThisem has been emphasized, while - strongthisstrong has been strongly emphasized.p - - - - - 標示等寬文字 - - Content that should be rendered in a fixed pitch - (typewriter) typeface is tagged with tt - (for teletype). - - - <tag>tt</tag> 範例 - - 用法: - - pMany system settings are stored in - tt/etctt.p - - - - - 連結 - - - Links are also inline elements. - - - - 連結在網站上的其他文件 - - A link points to the URL of a - document on the web. The link is indicated with - a, and the - href attribute contains - the URL of the target document. The - content of the element becomes the link, indicated to the - user by showing it in a different color or with an - underline. - - - 使用 <tag class="starttag">a href="..."</tag> - - 用法: - - pMore information is available at the - a href="http://www.&os;.org/"&os; web sitea.p - - - This link always takes the user to the top of the linked - document. - - - - 連結說明文件的特定章節 - - To link to a specific point within a document, that - document must include an anchor at the - desired point. Anchors are included by setting the - id attribute of an - element to a name. This example creates an anchor by - setting the id - attribute of a p - element. - - - 建立錨點 - - 用法: - - p id="samplepara"This paragraph can be referenced - in other links with the name ttsampleparatt.p - - - Links to anchors are similar to plain links, but include - a # symbol and the anchor's - ID at the end of the - URL. - - - 連結到另一份文件中已命名的段落 - - The samplepara example is part of a - document called foo.html. A link to - that specific paragraph in the document is constructed in - this example. - - pMore information can be found in the - a href="foo.html#samplepara"sample paragrapha of - ttfoo.htmltt.p - - - To link to a named anchor within the same document, omit - the document's URL, and just use the - # symbol followed by the name of the - anchor. - - - 連結到同一份文件已命名的段茖 - - The samplepara example - resides in this document. To link to it: - - pMore information can be found in the - a href="#samplepara"sample paragrapha of this - document.p - - - - - - - - - - - - DocBook 標籤 - - - 簡介 - - This chapter is an introduction to DocBook as it is used for - FreeBSD documentation. DocBook is a large and complex markup - system, but the subset described here covers the parts that are - most widely used for FreeBSD documentation. While a moderate - subset is covered, it is impossible to anticipate every - situation. Please post questions that this document does - not answer to the FreeBSD documentation project mailing list. - - DocBook was originally developed by HaL Computer Systems and - O'Reilly & Associates to be a Document Type Definition - (DTD) for writing technical documentation - A short history can be found under http://www.oasis-open.org/docbook/intro.shtml#d0e41.. - Since 1998 it is maintained by the - DocBook Technical Committee. As such, and unlike - LinuxDoc and XHTML, DocBook is very heavily - oriented towards markup that describes what - something is, rather than describing how it - should be presented. - - The DocBook DTD is available from the - Ports Collection in the - textproc/docbook-xml - port. It is automatically installed as part of the - textproc/docproj - port. - - - Formal Versus Informal - - Some elements may exist in two forms, - formal and informal. - Typically, the formal version of the element will consist of a - title followed by the informal version of the element. The - informal version will not have a title. - - - - Inline Versus Block - - In the remainder of this document, when describing - elements, inline means that the element - can occur within a block element, and does not cause a line - break. A block element, by comparison, - will cause a line break (and other processing) when it is - encountered. - - - - - FreeBSD 擴充項目 - - The FreeBSD Documentation Project has extended the DocBook - DTD with additional elements and entities. - These additions serve to make some of the markup easier or more - precise. - - Throughout the rest of this document, the term - DocBook is used to mean the FreeBSD-extended - DocBook DTD. - - - Most of these extensions are not unique to FreeBSD, it was - just felt that they were useful enhancements for this - particular project. Should anyone from any of the other *nix - camps (NetBSD, OpenBSD, Linux, …) be interested in - collaborating on a standard DocBook extension set, please - contact Documentation Engineering Team doceng@FreeBSD.org. - - - - FreeBSD 元素 - - The additional FreeBSD elements are not (currently) in the - Ports Collection. They are stored in the FreeBSD Subversion - tree, as head/share/xml/freebsd.dtd. - - FreeBSD-specific elements used in the examples below are - clearly marked. - - - - FreeBSD Entities - - This table shows some of the most useful entities - available in the FDP. For a complete list, - see the *.ent files in - doc/share/xml. - - - - - - - - - - - - - - - - - FreeBSD - Name Entities - - - - &os; - FreeBSD - - - - - &os.stable; - FreeBSD-STABLE - - - - - &os.current; - FreeBSD-CURRENT - - - - - - - - - - - Manual Page - Entities - - - - &man.ls.1; - ls1 - Usage: &man.ls.1; is the manual page - for - <command>ls</command>. - - - - &man.cp.1; - cp1 - Usage: The manual page for - <command>cp</command> is - &man.cp.1;. - - - - &man.command.sectionnumber; - link to - command manual page in - section - sectionnumber - Entities are defined for all the - FreeBSD manual - pages. - - - - - - - - - - FreeBSD Mailing List - Entities - - - - &a.doc; - FreeBSD documentation project mailing list - Usage: A link to the - &a.doc;. - - - - &a.questions; - FreeBSD general questions mailing list - Usage: A link to the - &a.questions;. - - - - &a.listname; - link to - listname - Entities are defined for all the FreeBSD - mailing lists. - - - - - - - - - - FreeBSD Document - Link Entities - - - - &url.books.handbook; - @@URL_RELPREFIX@@/doc/en_US.ISO8859-1/books/handbook - Usage: A link to the <link - xlink:href="&url.books.handbook;/advanced-networking.html">Advanced - Networking</link> chapter of the - Handbook. - - - - &url.books.bookname; - relative path to - bookname - Entities are defined for all the FreeBSD - books. - - - - &url.articles.committers-guide; - @@URL_RELPREFIX@@/doc/en_US.ISO8859-1/articles/committers-guide - Usage: A link to the <link - xlink:href="&url.articles.committers-guide;">Committer's - Guide</link> - article. - - - - &url.articles.articlename; - relative path to - articlename - Entities are defined for all the FreeBSD - articles. - - - - - - - - - - Other Operating - System Name Entities - - - - &linux; - Linux - The Linux operating system. - - - - &unix; - UNIX - The UNIX operating system. - - - - &windows; - Windows - The Windows operating system. - - - - - - - - - - Miscellaneous - Entities - - - - &prompt.root; - # - The root user - prompt. - - - - &prompt.user; - % - A prompt for an unprivileged user. - - - - &postscript; - PostScript - The - PostScript programming language. - - - - &tex; - TeX - The - TeX typesetting language. - - - - &xorg; - Xorg - The Xorg open source X - Window System. - - - - - - - - - 正式公用識別碼 (FPI) - - In compliance with the DocBook guidelines for writing - FPIs for DocBook customizations, the - FPI for the FreeBSD extended DocBook - DTD is: - - PUBLIC "-//FreeBSD//DTD DocBook V4.2-Based Extension//EN" - - - - 文件結構 - - DocBook allows structuring documentation in several ways. - The FreeBSD Documentation Project uses two primary types of DocBook - document: the book and the article. - - Books are organized into chapters. - This is a mandatory requirement. There may be - parts between the book and the chapter to - provide another layer of organization. For example, the - Handbook is arranged in this way. - - A chapter may (or may not) contain one or more sections. - These are indicated with the sect1 element. - If a section contains another section then use the - sect2 element, and so on, up to - sect5. - - Chapters and sections contain the remainder of the - content. - - An article is simpler than a book, and does not use - chapters. Instead, the content of an article is organized into - one or more sections, using the same sect1 - (and sect2 and so on) elements that are used - in books. - - The nature of the document being written should be used to - determine whether it is best marked up as a book or an article. - Articles are well suited to information that does not need to be - broken down into several chapters, and that is, relatively - speaking, quite short, at up to 20-25 pages of content. Books - are best suited to information that can be broken up into - several chapters, possibly with appendices and similar content - as well. - - The FreeBSD - tutorials are all marked up as articles, while this - document, the FAQ, - and the Handbook are all marked up as books, for - example. - - - 開始撰寫書籍 - - The content of a book is contained within the - book element. As well as containing - structural markup, this element can contain elements that - include additional information about the book. This is either - meta-information, used for reference purposes, or additional - content used to produce a title page. - - This additional information is contained within - info. - - - 使用 <tag>info</tag> 的 <tag>book</tag> 樣板 - - - - book - info - titleYour Title Heretitle - - author - personname - firstnameYour first namefirstname - surnameYour surnamesurname - personname - - affiliation - address - emailYour email addressemail - address - affiliation - author - - copyright - year1998year - holder role="mailto:your email address"Your nameholder - copyright - - releaseinfo$FreeBSD$releaseinfo - - abstract - paraInclude an abstract of the book's contents here.para - abstract - info - - … - -book - - - - - 開始撰寫文章 - - The content of the article is contained within the - article element. As well as containing - structural markup, this element can contain elements that - include additional information about the article. This is - either meta-information, used for reference purposes, or - additional content used to produce a title page. - - This additional information is contained within - info. - - - 使用 <tag>info</tag> 的 <tag>article</tag> 樣板 - - - - article - info - titleYour title heretitle - - author - personname - firstnameYour first namefirstname - surnameYour surnamesurname - personname - - affiliation - address - emailYour email addressemailaddress - address - affiliation - author - - copyright - year1998year - holder role="mailto:your email address"Your nameholder - copyright - - releaseinfo$FreeBSD$releaseinfo - - abstract - paraInclude an abstract of the article's contents here.para - abstract - info - - … - -article - - - - - 標示章節 - - Use chapter to mark up your chapters. - Each chapter has a mandatory title. - Articles do not contain chapters, they are reserved for - books. - - - 簡單的章節 - - chapter - titleThe Chapter's Titletitle - - ... -chapter - - - A chapter cannot be empty; it must contain elements in - addition to title. If you need to - include an empty chapter then just use an empty - paragraph. - - - 空白章節 - - chapter - titleThis is An Empty Chaptertitle - - parapara -chapter - - - - - 章底下的小節 - - In books, chapters may (but do not need to) be broken up - into sections, subsections, and so on. In articles, sections - are the main structural element, and each article must contain - at least one section. Use the - sectn element. - The n indicates the section number, - which identifies the section level. - - The first - sectn is - sect1. You can have one or more of these - in a chapter. They can contain one or more - sect2 elements, and so on, down to - sect5. - - - 章中的小節 - - chapter - titleA Sample Chaptertitle - - paraSome text in the chapter.para - - sect1 - titleFirst Sectiontitle - - … - sect1 - - sect1 - titleSecond Sectiontitle - - sect2 - titleFirst Sub-Sectiontitle - - sect3 - titleFirst Sub-Sub-Sectiontitle - - … - sect3 - sect2 - - sect2 - titleSecond Sub-Section (1.2.2)title - - … - sect2 - sect1 -chapter - - - - Section numbers are automatically generated and - prepended to titles when the document is rendered to an - output format. The generated section numbers and titles - from the example above will be: - - - - 1.1. First Section - - - - 1.2. Second Section - - - - 1.2.1. First Sub-Section - - - - 1.2.1.1. First Sub-Sub-Section - - - - 1.2.2. Second Sub-Section - - - - - - - 使用 <tag>part</tag> 元素來分部 - - parts introduce another level of - organization between book and - chapter with one or more - parts. This cannot be done in an - article. - - part - titleIntroductiontitle - - chapter - titleOverviewtitle - - ... - chapter - - chapter - titleWhat is FreeBSD?title - - ... - chapter - - chapter - titleHistorytitle - - ... - chapter -part - - - - - 區塊元素 - - - 段落 - - DocBook supports three types of paragraphs: - formalpara, para, and - simpara. - - Almost all paragraphs in FreeBSD documentation use - para. formalpara - includes a title element, and - simpara disallows some elements from - within para. Stick with - para. - - - <tag>para</tag> 範例 - - 用法: - - paraThis is a paragraph. It can contain just about any - other element.para - - 輸出結果: - - This is a paragraph. It can contain just about any - other element. - - - - - 區塊引言 - - A block quotation is an extended quotation from another - document that should not appear within the current paragraph. - These are rarely needed. - - Blockquotes can optionally contain a title and an - attribution (or they can be left untitled and - unattributed). - - - <tag>blockquote</tag> 範例 - - 用法: - - paraA small excerpt from the US Constitution:para - -blockquote - titlePreamble to the Constitution of the United Statestitle - - attributionCopied from a web site somewhereattribution - - paraWe the People of the United States, in Order to form a more - perfect Union, establish Justice, insure domestic Tranquility, - provide for the common defence, promote the general Welfare, and - secure the Blessings of Liberty to ourselves and our Posterity, do - ordain and establish this Constitution for the United States of - America.para -blockquote - - 輸出結果: - - A small excerpt from the US Constitution: - -
- Preamble to the Constitution of the United - States - - Copied from a web site - somewhere - - We the People of the United States, in Order to form - a more perfect Union, establish Justice, insure domestic - Tranquility, provide for the common defence, promote the - general Welfare, and secure the Blessings of Liberty to - ourselves and our Posterity, do ordain and establish - this Constitution for the United States of - America. -
-
-
- - - 提示、注意、警告、注意事項及重要資訊 - - Extra information may need to be separated from - the main body of the text. Typically this is - meta information of which the user should be - aware. - - Several types of admonitions are available: - tip, note, - warning, caution, and - important. - - Which admonition to choose depends on the situation. - The DocBook - documentation suggests: - - - - Note is for information that should be heeded by - all readers. - - - - Important is a variation on Note. - - - - Caution is for information regarding possible data - loss or software damage. - - - - Warning is for information regarding possible - hardware damage or injury to life or limb. - - - - - <tag>tip</tag> 與 <tag>important</tag> 範例 - - 用法: - - tip - para&os; may reduce stress.para -tip - -important - paraPlease use admonitions sparingly. Too many admonitions - are visually jarring and can have the opposite of the - intended effect.para -important - - - 輸出結果: - - - FreeBSD may reduce stress. - - - - Please use admonitions sparingly. Too many admonitions - are visually jarring and can have the opposite of the - intended effect. - - - - - 範例 - - Examples can be shown with example. - - - <tag>example</tag> 原始碼 - - 用法: - - example - paraEmpty files can be created easily:para - - screen&prompt.user; userinputtouch file1 file2 file3userinputscreen -example - - - - 輸出結果: - - - <tag>example</tag> 的結果 - - Empty files can be created easily: - - % touch file1 file2 file3 - - - - - 清單與步驟 - - Information often needs to be presented as lists, or as a - number of steps that must be carried out in order to - accomplish a particular goal. - - To do this, use itemizedlist, - orderedlist, variablelist, or - procedure. There are other types of list - elements in DocBook, but we will not cover them here. - - itemizedlist and - orderedlist are similar to their - counterparts in HTML, ul - and ol. Each one consists of one or more - listitem elements, and each - listitem contains one or more block - elements. The listitem elements are - analogous to HTML's li - tags. However, unlike HTML, they are required. - - - <tag>itemizedlist</tag> 與 <tag>orderedlist</tag> 範例 - - 用法: - - itemizedlist - listitem - paraThis is the first itemized item.para - listitem - - listitem - paraThis is the second itemized item.para - listitem -itemizedlist - -orderedlist - listitem - paraThis is the first ordered item.para - listitem - - listitem - paraThis is the second ordered item.para - listitem -orderedlist - - 輸出結果: - - - - This is the first itemized item. - - - - This is the second itemized item. - - - - - - This is the first ordered item. - - - - This is the second ordered item. - - - - - An alternate and often - useful way of presenting information is the - variablelist. These are lists where each entry has - a term and a description. They are well suited for many types - of descriptions, and present information in a form that is - often easier for the reader than sections and - subsections. - - A variablelist has a title, and then - pairs of term and listitem - entries. - - - <tag>variablelist</tag> 範例 - - 用法: - - variablelist - varlistentry - termParallelterm - - listitem - paraIn parallel communications, groups of bits arrive - at the same time over multiple communications - channels.para - listitem - varlistentry - - varlistentry - termSerialterm - - listitem - paraIn serial communications, bits arrive one at a - time over a single communications - channel.para - listitem - varlistentry -variablelist - - 輸出結果: - - - - Parallel - - - In parallel communications, groups of bits arrive - at the same time over multiple communications - channels. - - - - - Serial - - - In serial communications, bits arrive one at a - time over a single communications channel. - - - - - - A procedure shows a series of - steps, which may in turn - consist of more steps or - substeps. Each step - contains block elements and may include an optional title. - - Sometimes, steps are not sequential, but present a choice: - do this or do that, - but not both. For these alternative choices, use - stepalternatives. - - - <tag>procedure</tag> 範例 - - 用法: - - procedure - step - paraDo this.para - step - - step - paraThen do this.para - step - - step - paraAnd now do this.para - step - - step - paraFinally, do one of these.para - - stepalternatives - step - paraGo left.para - step - - step - paraGo right.para - step - stepalternatives - step -procedure - - 輸出結果: - - - - Do this. - - - - Then do this. - - - - And now do this. - - - - Finally, do one of these: - - - - Go left. - - - - Go right. - - - - - - - - - 顯示檔案範本 - - Fragments of a file (or perhaps a complete file) are shown - by wrapping them in the programlisting - element. - - White space and line breaks within - programlisting are - significant. In particular, this means that the opening tag - should appear on the same line as the first line of the - output, and the closing tag should appear on the same line - as the last line of the output, otherwise spurious blank - lines may be included. - - - <tag>programlisting</tag> 範例 - - 用法: - - paraWhen finished, the program will look like - this:para - -programlisting#include &lt;stdio.h&gt; - -int -main(void) -{ - printf("hello, world\n"); -}programlisting - - Notice how the angle brackets in the - #include line need to be referenced by - their entities instead of being included literally. - - 輸出結果: - - When finished, the program will look like this: - - #include <stdio.h> - -int -main(void) -{ - printf("hello, world\n"); -} - - - - - 標註 - - A callout is a visual marker for referring to a - piece of text or specific position within an - example. - - Callouts are marked with the co - element. Each element must have a unique - id assigned to it. After the example, - include a calloutlist that describes each - callout. - - - <tag>co</tag> 與 <tag>calloutlist</tag> 範例 - - paraWhen finished, the program will look like - this:para - -programlisting#include &lt;stdio.h&gt; co xml:id="co-ex-include" - -int co xml:id="co-ex-return" -main(void) -{ - printf("hello, world\n"); co xml:id="co-ex-printf" -}programlisting - -calloutlist - callout arearefs="co-ex-include" - paraIncludes the standard IO header file.para - callout - - callout arearefs="co-ex-return" - paraSpecifies that functionmain()function returns an - int.para - callout - - callout arearefs="co-ex-printf" - paraThe functionprintf()function call that writes - literalhello, worldliteral to standard output.para - callout -calloutlist - - 輸出結果: - - When finished, the program will look like this: - - #include <stdio.h> - -int -main(void) -{ - printf("hello, world\n"); -} - - - - Includes the standard IO header file. - - - - Specifies that main() returns - an int. - - - - The printf() call that writes - hello, world to standard - output. - - - - - - - 表格 - - Unlike HTML, DocBook does not need - tables for layout purposes, as the stylesheet handles those - issues. Instead, just use tables for marking up tabular - data. - - In general terms (and see the DocBook documentation for - more detail) a table (which can be either formal or informal) - consists of a table element. This contains - at least one tgroup element, which - specifies (as an attribute) the number of columns in this - table group. Within the tablegroup there is one - thead element, which contains elements for - the table headings (column headings), and one - tbody which contains the body of the - table. - - Both tgroup and - thead contain row - elements, which in turn contain entry - elements. Each entry element specifies - one cell in the table. - - - <tag>informaltable</tag> 範例 - - 用法: - - informaltable pgwide="1" - tgroup cols="2" - thead - row - entryThis is Column Head 1entry - entryThis is Column Head 2entry - row - thead - - tbody - row - entryRow 1, column 1entry - entryRow 1, column 2entry - row - - row - entryRow 2, column 1entry - entryRow 2, column 2entry - row - tbody - tgroup -informaltable - - 輸出結果: - - - - - - This is Column Head 1 - This is Column Head 2 - - - - - - Row 1, column 1 - Row 1, column 2 - - - - Row 2, column 1 - Row 2, column 2 - - - - - - - Always use the pgwide attribute with - a value of 1 with the - informaltable element. A bug in Internet - Explorer can cause the table to render incorrectly if this - is omitted. - - Table borders can be suppressed by setting the - frame attribute to none - in the informaltable element. For example, - informaltable frame="none". - - - 表格使用 <literal>frame="none"</literal> 範例 - - 輸出結果: - - - - - - This is Column Head 1 - This is Column Head 2 - - - - - - Row 1, column 1 - Row 1, column 2 - - - - Row 2, column 1 - Row 2, column 2 - - - - - - - - - 給使用者遵循的範例 - - Examples for the user to follow are often necessary. - Typically, these will consist of dialogs with the computer; - the user types in a command, the user gets a response back, - the user types another command, and so on. - - A number of distinct elements and entities come into - play here. - - - - screen - - - Everything the user sees in this example will be - on the computer screen, so the next element is - screen. - - Within screen, white space is - significant. - - - - - prompt, - &prompt.root; and - &prompt.user; - - - Some of the things the user will be seeing on the - screen are prompts from the computer (either from the - operating system, command shell, or application). These - should be marked up using - prompt. - - As a special case, the two shell prompts for the - normal user and the root user have been provided as - entities. To indicate the user is at a shell prompt, - use one of &prompt.root; and - &prompt.user; as necessary. They - do not need to be inside - prompt. - - - &prompt.root; and - &prompt.user; are FreeBSD - extensions to DocBook, and are not part of the - original DTD. - - - - - - userinput - - - When displaying text that the user should type in, - wrap it in userinput tags. It will - be displayed differently than system output text. - - - - - - <tag>screen</tag>, <tag>prompt</tag> 與 <tag>userinput</tag> 範例 - - 用法: - - screen&prompt.user; userinputls -1userinput -foo1 -foo2 -foo3 -&prompt.user; userinputls -1 | grep foo2userinput -foo2 -&prompt.user; userinputsuuserinput -promptPassword: prompt -&prompt.root; userinputcat foo2userinput -This is the file called 'foo2'screen - - 輸出結果: - - % ls -1 -foo1 -foo2 -foo3 -% ls -1 | grep foo2 -foo2 -% su -Password: -# cat foo2 -This is the file called 'foo2' - - - - Even though we are displaying the contents of the file - foo2, it is not - marked up as programlisting. Reserve - programlisting for showing fragments of - files outside the context of user actions. - - -
- - - 行內元素 - - - 強調資訊 - - To emphasize a particular word or phrase, use - emphasis. This may be presented as - italic, or bold, or might be spoken differently with a - text-to-speech system. - - There is no way to change the presentation of the - emphasis within the document, no equivalent of - HTML's b and - i. If the information being presented is - important, then consider presenting it in - important rather than - emphasis. - - - <tag>emphasis</tag> 範例 - - 用法: - - para&os; is without doubt emphasistheemphasis - premiere &unix;-like operating system for the Intel - architecture.para - - 輸出結果: - - FreeBSD is without doubt the - premiere UNIX-like operating system for the Intel - architecture. - - - - - 縮寫 - - Many computer terms are acronyms, - words formed from the first letter of each word in a - phrase. Acronyms are marked up into - acronym elements. It is helpful to the - reader when an acronym is defined on the first use, as shown - in the example below. - - - <tag>acronym</tag> 範例 - - 用法: - - paraRequest For Comments (acronymRFCacronym) 1149 - defined the use of avian carriers for transmission of - Internet Protocol (acronymIPacronym) data. The - quantity of acronymIPacronym data currently - transmitted in that manner is unknown.para - - 輸出結果: - - Request For Comments (RFC) 1149 - defined the use of avian carriers for transmission of - Internet Protocol (IP) data. The - quantity of IP data currently - transmitted in that manner is unknown. - - - - - 引言 - - To quote text from another document or source, or to - denote a phrase that is used figuratively, use - quote. Most of the markup tags available - for normal text are also available from within a - quote. - - - <tag>quote</tag> 範例 - - 用法: - - paraHowever, make sure that the search does not go beyond the - quoteboundary between local and public administrationquote, - as acronymRFCacronym 1535 calls it.para - - 輸出結果: - - However, make sure that the search does not go beyond - the boundary between local and public - administration, as RFC 1535 - calls it. - - - - - 鍵盤按鍵、滑鼠按鍵及組合鍵 - - To refer to a specific key on the keyboard, use - keycap. To refer to a mouse button, use - mousebutton. And to refer to - combinations of key presses or mouse clicks, wrap them all - in keycombo. - - keycombo has an attribute called - action, which may be one of - click, double-click, - other, press, - seq, or simul. The - last two values denote whether the keys or buttons should be - pressed in sequence, or simultaneously. - - The stylesheets automatically add any connecting - symbols, such as +, between the key - names, when wrapped in keycombo. - - - 鍵盤按鍵、滑鼠案件及組合鍵範例 - - 用法: - - paraTo switch to the second virtual terminal, press - keycombo action="simul"keycapAltkeycap - keycapF1keycapkeycombo.para - -paraTo exit commandvicommand without saving changes, type - keycombo action="seq"keycapEsckeycapkeycap:keycap - keycapqkeycapkeycap!keycapkeycombo.para - -paraMy window manager is configured so that - keycombo action="simul"keycapAltkeycap - mousebuttonrightmousebutton - keycombo mouse button is used to move windows.para - - 輸出結果: - - To switch to the second virtual terminal, press - Alt - F1. - - To exit vi without saving changes, - type - Esc - : - q - !. - - My window manager is configured so that - - Alt - right mouse button - is used to move windows. - - - - - 應用程式、指令、選項與引用 - - Both applications and commands are frequently referred to - when writing documentation. The distinction between them is - that an application is the name of a program or suite of - programs that fulfill a particular task. A command is the - filename of a program that the user can type and run at a - command line. - - It is often necessary to show some of the options that a - command might take. - - Finally, it is often useful to list a command with its - manual section number, in the command(number) - format so common in Unix manuals. - - Mark up application names with - application. - - To list a command with its manual section - number (which should be most of the time) the DocBook - element is citerefentry. This will - contain a further two elements, - refentrytitle and - manvolnum. The content of - refentrytitle is the name of the command, - and the content of manvolnum is the - manual page section. - - This can be cumbersome to write, and so a series of - general - entities have been created to make this easier. - Each entity takes the form - &man.manual-page.manual-section;. - - The file that contains these entities is in - doc/share/xml/man-refs.ent, and can be - referred to using this FPI: - - PUBLIC "-//FreeBSD//ENTITIES DocBook Manual Page Entities//EN" - - Therefore, the introduction to FreeBSD documentation will - usually include this: - - <!DOCTYPE book PUBLIC "-//FreeBSD//DTD DocBook V4.1-Based Extension//EN" [ - -<!ENTITY % man PUBLIC "-//FreeBSD//ENTITIES DocBook Manual Page Entities//EN"> -%man; - -… - -]> - - Use command to include a command - name in-line but present it as something the - user should type. - - Use option to mark up the options - which will be passed to a command. - - When referring to the same command multiple times in - close proximity, it is preferred to use the - &man.command.section; - notation to markup the first reference and use - command to markup subsequent references. - This makes the generated output, especially - HTML, appear visually better. - - - 應用程式、指令、選項範例 - - 用法: - - paraapplicationSendmailapplication is the most - widely used Unix mail application.para - -paraapplicationSendmailapplication includes the - citerefentry - refentrytitlesendmailrefentrytitle - manvolnum8manvolnum - citerefentry, &man.mailq.1;, and &man.newaliases.1; - programs.para - -paraOne of the command line parameters to citerefentry - refentrytitlesendmailrefentrytitle - manvolnum8manvolnum - citerefentry, option-bpoption, will display the current - status of messages in the mail queue. Check this on the command - line by running commandsendmail -bpcommand.para - - 輸出結果: - - Sendmail is the most widely - used Unix mail application. - - Sendmail includes the - - sendmail - 8 - , mailq1, and newaliases1 - programs. - - One of the command line parameters to - - sendmail - 8 - , , will display the - current status of messages in the mail queue. Check this - on the command line by running - sendmail -bp. - - - - Notice how the - &man.command.section; - notation is easier to follow. - - - - - 檔案、目錄、副檔名、裝置名稱 - - To refer to the name of a file, a directory, a file - extension, or a device name, use filename. - - - <tag>filename</tag> 範例 - - 用法: - - paraThe source for the Handbook in English is found in - filename/usr/doc/en_US.ISO8859-1/books/handbook/filename. - The main file is called filenamebook.xmlfilename. - There is also a filenameMakefilefilename and a - number of files with a filename.entfilename extension.para - -parafilenamekbd0filename is the first keyboard detected - by the system, and appears in - filename/devfilename.para - - 輸出結果: - - The source for the Handbook in English is found in - /usr/doc/en_US.ISO8859-1/books/handbook/. - The main file is called book.xml. - There is also a Makefile and a number - of files with a .ent extension. - - kbd0 is the first keyboard detected - by the system, and appears in - /dev. - - - - - Port 名稱 - - - FreeBSD Extension - - These elements are part of the FreeBSD extension to - DocBook, and do not exist in the original DocBook - DTD. - - - To include the name of a program from the FreeBSD - Ports Collection in the document, use the package - tag. Since the Ports Collection can be installed in any - number of locations, only include the category and the port - name; do not include /usr/ports. - - By default, package refers to a binary package. - To refer to a port that will be built from source, set the - role attribute to - port. - - - <tag>package</tag> 範例 - - 用法: - - paraInstall the packagenet/wiresharkpackage binary - package to view network traffic.para - -parapackage role="port"net/wiresharkpackage can also be - built and installed from the Ports Collection.para - - 輸出結果: - - Install the net/wireshark binary - package to view network traffic. - - net/wireshark can also be - built and installed from the Ports Collection. - - - - - 主機、網域、IP 位址、使用名稱、群組名稱及其他系統項目 - - - FreeBSD Extension - - These elements are part of the FreeBSD extension to - DocBook, and do not exist in the original DocBook - DTD. - - - Information for system items is marked up - with systemitem. The class - attribute is used to identify the particular type of - information shown. - - - - class="domainname" - - - The text is a domain name, such as - FreeBSD.org or - ngo.org.uk. There is no hostname - component. - - - - - class="etheraddress" - - - The text is an Ethernet MAC - address, expressed as a series of 2 digit hexadecimal - numbers separated by colons. - - - - - class="fqdomainname" - - - The text is a Fully Qualified Domain Name, with - both hostname and domain name parts. - - - - - class="ipaddress" - - - The text is an IP address, - probably expressed as a dotted quad. - - - - - class="netmask" - - - The text is a network mask, which might be - expressed as a dotted quad, a hexadecimal string, or as - a / followed by a number - (CIDR notation). - - - - - class="systemname" - - - With class="systemname" - the marked up information is the simple hostname, such - as freefall or - wcarchive. - - - - - class="username" - - - The text is a username, like - root. - - - - - class="groupname" - - - The text is a groupname, like - wheel. - - - - - - <tag>systemitem</tag> 與類別 (Class) 範例 - - 用法: - - paraThe local machine can always be referred to by the - name systemitem class="systemname"localhostsystemitem, which will have the IP - address systemitem class="ipaddress"127.0.0.1systemitem.para - -paraThe systemitem class="domainname"FreeBSD.orgsystemitem - domain contains a number of different hosts, including - systemitem class="fqdomainname"freefall.FreeBSD.orgsystemitem and - systemitem class="fqdomainname"bento.FreeBSD.orgsystemitem.para - -paraWhen adding an acronymIPacronym alias to an - interface (using commandifconfigcommand) - emphasisalwaysemphasis use a netmask of - systemitem class="netmask"255.255.255.255systemitem (which can - also be expressed as - systemitem class="netmask"0xffffffffsystemitem).para - -paraThe acronymMACacronym address uniquely identifies - every network card in existence. A typical - acronymMACacronym address looks like - systemitem class="etheraddress"08:00:20:87:ef:d0systemitem.para - -paraTo carry out most system administration functions - requires logging in as systemitem class="username"rootsystemitem.para - - 輸出結果: - - The local machine can always be referred to by the name - localhost, which will have the IP - address - 127.0.0.1. - - The - FreeBSD.org - domain contains a number of different hosts, including - freefall.FreeBSD.org and - bento.FreeBSD.org. - - When adding an IP alias to an - interface (using ifconfig) - always use a netmask of - 255.255.255.255 - (which can also be expressed as - 0xffffffff). - - The MAC address uniquely identifies - every network card in existence. A typical - MAC address looks like 08:00:20:87:ef:d0. - - To carry out most system administration functions - requires logging in as - root. - - - - - 統一資源識別碼 (<acronym>URI</acronym>) - - Occasionally it is useful to show a - Uniform Resource Identifier (URI) without - making it an active hyperlink. The uri element - makes this possible: - - - <tag>uri</tag> 範例 - - 用法: - - paraThis URL shows only as text: - urihttps://www.FreeBSD.orguri. It does not - create a link.para - - 輸出結果: - - This URL shows only as text: - https://www.FreeBSD.org. It does not - create a link. - - - To create links, see - . - - - - 郵件地址 - - Email addresses are marked up as email - elements. In the HTML output format, the - wrapped text becomes a hyperlink to the email address. Other - output formats that support hyperlinks may also make the email - address into a link. - - - 有超連結的 <tag>email</tag> 範例 - - 用法: - - paraAn email address that does not actually exist, like - emailnotreal@example.comemail, can be used as an - example.para - - 輸出結果: - - An email address that does not actually exist, like - notreal@example.com, can be used as an - example. - - - A FreeBSD-specific extension allows setting the - role attribute to nolink - to prevent the creation of the hyperlink to the email - address. - - - 沒有超連結的 <tag>email</tag> 範例 - - 用法: - - paraSometimes a link to an email address like - email role="nolink"notreal@example.comemail is not - desired.para - - 輸出結果: - - Sometimes a link to an email address like - notreal@example.com is not - desired. - - - - - 說明 <filename>Makefile</filename> - - - FreeBSD Extension - - These elements are part of the FreeBSD extension to - DocBook, and do not exist in the original DocBook - DTD. - - - Two elements exist to describe parts of - Makefiles, buildtarget - and varname. - - buildtarget identifies a build target - exported by a Makefile that can be - given as a parameter to make. - varname identifies a variable that can be - set (in the environment, on the command line with - make, or within the - Makefile) to influence the - process. - - - <tag>buildtarget</tag> 與 <tag>varname</tag> 範例 - - 用法: - - paraTwo common targets in a filenameMakefilefilename - are buildtargetallbuildtarget and - buildtargetcleanbuildtarget.para - -paraTypically, invoking buildtargetallbuildtarget will - rebuild the application, and invoking - buildtargetcleanbuildtarget will remove the temporary - files (filename.ofilename for example) created by the - build process.para - -parabuildtargetcleanbuildtarget may be controlled by a - number of variables, including varnameCLOBBERvarname - and varnameRECURSEvarname.para - - 輸出結果: - - Two common targets in a Makefile - are all and - clean. - - Typically, invoking all will - rebuild the application, and invoking - clean will remove the temporary - files (.o for example) created by the - build process. - - clean may be controlled by a - number of variables, including CLOBBER - and RECURSE. - - - - - 實際文字 (Literal) - - Literal text, or text which should be entered verbatim, is - often needed in documentation. This is text that is excerpted - from another file, or which should be copied exactly as shown - from the documentation into another file. - - Some of the time, programlisting will - be sufficient to denote this text. But - programlisting is not always appropriate, - particularly when you want to include a portion of a file - in-line with the rest of the - paragraph. - - On these occasions, use - literal. - - - <tag>literal</tag> 範例 - - 用法: - - paraThe literalmaxusers 10literal line in the kernel - configuration file determines the size of many system tables, and is - a rough guide to how many simultaneous logins the system will - support.para - - 輸出結果: - - The maxusers 10 line in the kernel - configuration file determines the size of many system - tables, and is a rough guide to how many simultaneous - logins the system will support. - - - - - 顯示使用者<emphasis>必填</emphasis>的項目 - - There will often be times when the user is shown - what to do, or referred to a file or command line, but - cannot simply copy the example provided. Instead, they - must supply some information themselves. - - replaceable is designed for this - eventuality. Use it inside other - elements to indicate parts of that element's content that - the user must replace. - - - <tag>replaceable</tag> 範例 - - 用法: - - screen&prompt.user; userinputman replaceablecommandreplaceableuserinputscreen - - 輸出結果: - - - % man command - - - replaceable can be used in many - different elements, including literal. - This example also shows that replaceable - should only be wrapped around the content that the user - is meant to provide. The other content - should be left alone. - - 用法: - - paraThe literalmaxusers replaceablenreplaceableliteral - line in the kernel configuration file determines the size of many system - tables, and is a rough guide to how many simultaneous logins the system will - support.para - -paraFor a desktop workstation, literal32literal is a good value - for replaceablenreplaceable.para - - 輸出結果: - - The - maxusers n - line in the kernel configuration file determines the size - of many system tables, and is a rough guide to how many - simultaneous logins the system will support. - - For a desktop workstation, 32 is a - good value for n. - - - - - 顯示 <acronym>GUI</acronym> 按鈕 - - Buttons presented by a graphical user interface are marked - with guibutton. To make the text look more - like a graphical button, brackets and non-breaking spaces are - added surrounding the text. - - - <tag>guibutton</tag> 範例 - - 用法: - - paraEdit the file, then click - guibutton[&nbsp;Save&nbsp;]guibutton to save the - changes.para - - 輸出結果: - - Edit the file, then click - [ Save ] to save the - changes. - - - - - 引用系統錯誤 - - System errors generated by FreeBSD are marked with - errorname. This indicates the exact error - that appears. - - - <tag>errorname</tag> 範例 - - 用法: - - screenerrornamePanic: cannot mount rooterrornamescreen - - 輸出結果: - - - Panic: cannot mount root - - - - - - - 圖片 - - - Image support in the documentation is somewhat - experimental. The mechanisms described here are unlikely to - change, but that is not guaranteed. - - To provide conversion between different image formats, the - graphics/ImageMagick - port must be installed. This port is not included in the - textproc/docproj meta - port, and must be installed separately. - - A good example of the use of images is the - doc/en_US.ISO8859-1/articles/vm-design/ - document. Examine the files in that directory to see how - these elements are used together. Build different output - formats to see how the format determines what images are shown - in the rendered document. - - - - 圖片格式 - - The following image formats are currently supported. An - image file will automatically be converted to bitmap or vector - image depending on the output document format. - - These are the only formats in which - images should be committed to the documentation - repository. - - - - EPS (Encapsulated - Postscript) - - - Images that are primarily vector based, such as - network diagrams, time lines, and similar, should be in - this format. These images have a - .eps extension. - - - - - PNG (Portable Network - Graphic) - - - For bitmaps, such as screen captures, use this - format. These images have the .png - extension. - - - - - PIC (PIC graphics language) - - - PIC is a language for drawing - simple vector-based figures used in the pic1 - utility. These images have the - .pic extension. - - - - - SCR (SCReen capture) - - - This format is specific to screenshots of console - output. The following command generates an SCR file - shot.scr from video buffer of - /dev/ttyv0: - - # vidcontrol -p < /dev/ttyv0 > shot.scr - - This is preferable to PNG format - for screenshots because the SCR file - contains plain text of the command lines so that it can - be converted to a PNG image or a - plain text depending on the output document - format. - - - - - Use the appropriate format for each image. Documentation - will often have a mix of EPS and - PNG images. The - Makefiles ensure that the correct format - image is chosen depending on the output format used. - Do not commit the same image to the repository in - two different formats. - - - The Documentation Project may eventually switch to using - the SVG (Scalable Vector Graphic) format - for vector images. However, the current state of - SVG capable editing tools makes this - impractical. - - - - - 圖片檔案位置 - - Image files can be stored in one of several locations, - depending on the document and image: - - - - In the same directory as the document itself, usually - done for articles and small books that keep all their - files in a single directory. - - - - In a subdirectory of the main document. Typically - done when a large book uses separate subdirectories to - organize individual chapters. - - When images are stored in a subdirectory of the - main document directory, the subdirectory name must be - included in their paths in the - Makefile and the - imagedata element. - - - - In a subdirectory of - doc/share/images named after the - document. For example, images for the Handbook are stored - in doc/share/images/books/handbook. - Images that work for multiple translations are stored in - this upper level of the documentation file tree. - Generally, these are images that can be used unchanged in - non-English translations of the document. - - - - - - 圖片標籤 - - Images are included as part of a mediaobject. - The mediaobject can contain other, more specific - objects. We are concerned with two, the - imageobject and the textobject. - - Include one imageobject, and two - textobject elements. The imageobject - will point to the name of the image file without the - extension. The textobject elements contain - information that will be presented to the user as well as, or - instead of, the image itself. - - Text elements are shown to the reader in several - situations. When the document is viewed in - HTML, text elements are shown while the - image is loading, or if the mouse pointer is hovered over the - image, or if a text-only browser is being used. In formats - like plain text where graphics are not possible, the text - elements are shown instead of the graphical ones. - - This example shows how to include an image called - fig1.png in a document. The image is a - rectangle with an A inside it: - - mediaobject - imageobject - imagedata fileref="fig1" - imageobject - - textobject - literallayout class="monospaced"+---------------+ -| A | -+---------------+literallayout - textobject - - textobject - phraseA picturephrase - textobject -mediaobject - - - - Include an imagedata element - inside the imageobject element. The - fileref attribute should contain the - filename of the image to include, without the extension. - The stylesheets will work out which extension should be - added to the filename automatically. - - - - - The first textobject contains a - literallayout element, where the - class attribute is set to - monospaced. This is an opportunity to - demonstrate ASCII art skills. This - content will be used if the document is converted to plain - text. - - Notice how the first and last lines of the content - of the literallayout element butt up - next to the element's tags. This ensures no extraneous - white space is included. - - - - The second textobject contains a - single phrase element. The contents of - this phrase will become the alt - attribute for the image when this document is converted to - HTML. - - - - - - 圖片 <filename>Makefile</filename> 項目 - - Images must be listed in the Makefile - in the IMAGES variable. This variable must - contain the names of all the source - images. For example, if there are three figures, - fig1.eps, fig2.png, - fig3.png, then the - Makefile should have lines like this in - it. - - … -IMAGES= fig1.eps fig2.png fig3.png -… - - or - - … -IMAGES= fig1.eps -IMAGES+= fig2.png -IMAGES+= fig3.png -… - - Again, the Makefile will work out the - complete list of images it needs to build the source document, - you only need to list the image files you - provided. - - - - 在子目錄中的圖片與章節 - - Be careful when separating documentation into smaller - files in different directories (see ). - - Suppose there is a book with three chapters, and the - chapters are stored in their own directories, called - chapter1/chapter.xml, - chapter2/chapter.xml, and - chapter3/chapter.xml. If each chapter - has images associated with it, place those images in each - chapter's subdirectory (chapter1/, - chapter2/, and - chapter3/). - - However, doing this requires including the directory - names in the IMAGES variable in the - Makefile, and - including the directory name in the imagedata - element in the document. - - For example, if the book has - chapter1/fig1.png, then - chapter1/chapter.xml should - contain: - - mediaobject - imageobject - imagedata fileref="chapter1/fig1" - imageobject - - … - -mediaobject - - - - The directory name must be included in the - fileref attribute. - - - - The Makefile must contain: - - … -IMAGES= chapter1/fig1.png -… - - - - - 連結 - - - Links are also in-line elements. To show a - URI without creating a link, see - . - - - - <literal>xml:id</literal> 屬性 - - Most DocBook elements accept an xml:id - attribute to give that part of the document a unique name. - The xml:id can be used as a target for a - crossreference or link. - - Any portion of the document that will be a link target - must have an xml:id attribute. Assigning - an xml:id to all chapters and sections, - even if there are no current plans to link to them, is a good - idea. These xml:ids can be used as unique - reference points by anyone referring to the - HTML version of the document. - - - 在章與節上加 <literal>xml:id</literal> 的範例 - - chapter xml:id="introduction" - titleIntroductiontitle - - paraThis is the introduction. It contains a subsection, - which is identified as well.para - - sect1 xml:id="introduction-moredetails" - titleMore Detailstitle - - paraThis is a subsection.para - sect1 -chapter - - - Use descriptive values for xml:id - names. The values must be unique within the entire document, - not just in a single file. In the example, the subsection - xml:id is constructed by appending text to - the chapter xml:id. This ensures that the - xml:ids are unique. It also helps both - reader and anyone editing the document to see where the link - is located within the document, similar to a directory path to - a file. - - - - 使用 <literal>xref</literal> 交叉參照 - - xref provides the reader with a link to jump to - another section of the document. The target - xml:id is specified in the - linkend attribute, and xref - generates the link text automatically. - - - <tag>xref</tag> 範例 - - Assume that this fragment appears somewhere in a - document that includes the xml:id - example shown above: - - paraMore information can be found - in xref linkend="introduction".para - -paraMore specific information can be found - in xref linkend="introduction-moredetails".para - - The link text will be generated automatically, looking - like (emphasized text indicates the - link text): - -
- More information can be found in Chapter - 1, Introduction. - - More specific information can be found in - Section 1.1, - More Details. -
-
- - The link text is generated automatically from the chapter - and section number and title - elements. -
- - - 連結在網站上的其他文件 - - The link element described here allows the writer to - define the link text. When link text is used, it is very important to be descriptive - to give the reader an idea of where the link goes. - Remember that DocBook can be rendered to multiple - types of media. The reader might be looking at a printed book - or other form of media where there are no links. If the link - text is not descriptive enough, the reader might not be able to - locate the linked section. - - The xlink:href attribute - is the URL of the page, - and the content of the element is the text that - will be displayed for the user to activate. - - In many situations, it is preferable to show the actual - URL rather than text. This can be done by - leaving out the element text entirely. - - - <tag>link</tag> 到 FreeBSD 說明文件網頁範例 - - Link to the book or article URL - entity. To link to a specific chapter in a book, add a - slash and the chapter file name, followed by an optional - anchor within the chapter. For articles, link to the - article URL entity, followed by an - optional anchor within the article. - URL entities can be found in - doc/share/xml/urls.ent. - - Usage for FreeBSD book links: - - paraRead the link - xlink:href="&url.books.handbook;/svn.html#svn-intro"SVN - introductionlink, then pick the nearest mirror from - the list of link - xlink:href="&url.books.handbook;/svn.html#svn-mirrors"Subversion - mirror siteslink.para - - 輸出結果: - - Read the SVN - introduction, then pick the nearest mirror from - the list of Subversion - mirror sites. - - Usage for FreeBSD article links: - - paraRead this - link xlink:href="&url.articles.bsdl-gpl;"article - about the BSD licenselink, or just the - link xlink:href="&url.articles.bsdl-gpl;#intro"introductionlink.para - - 輸出結果: - - Read this - article - about the BSD license, or just the introduction. - - - - <tag>link</tag> 到 FreeBSD 網頁範例 - - 用法: - - paraOf course, you could stop reading this document and go to the - link xlink:href="&url.base;/index.html"FreeBSD home pagelink instead.para - - 輸出結果: - - Of course, you could stop reading this document and go - to the FreeBSD - home page instead. - - - - <tag>link</tag> 到外部網頁範例 - - 用法: - - paraWikipedia has an excellent reference on - link - xlink:href="http://en.wikipedia.org/wiki/GUID_Partition_Table"GUID - Partition Tableslink.para - - 輸出結果: - - Wikipedia has an excellent reference on GUID - Partition Tables. - - The link text can be omitted to show the actual - URL: - - paraWikipedia has an excellent reference on - GUID Partition Tables: link - xlink:href="http://en.wikipedia.org/wiki/GUID_Partition_Table"link.para - - The same link can be entered using shorter - notation instead of a separate ending tag: - - paraWikipedia has an excellent reference on - GUID Partition Tables: link - xlink:href="http://en.wikipedia.org/wiki/GUID_Partition_Table".para - - The two methods are equivalent. Appearance: - - Wikipedia has an excellent reference on GUID Partition - Tables: http://en.wikipedia.org/wiki/GUID_Partition_Table. - - -
-
- - - - - 樣式表 - - XML is concerned with content, and says - nothing about how that content should be presented to the reader - or rendered on paper. Multiple style sheet - languages have been developed to describe visual layout, including - Extensible Stylesheet Language Transformation - (XSLT), Document Style Semantics and - Specification Language (DSSSL), and Cascading - Style Sheets (CSS). - - The FDP documents use - XSLT stylesheets to transform DocBook into - XHTML, and then CSS - formatting is applied to the XHTML pages. - Printable output is currently rendered with legacy - DSSSL stylesheets, but this will probably - change in the future. - - - <acronym>CSS</acronym> - - Cascading Style Sheets (CSS) are a - mechanism for attaching style information (font, weight, size, - color, and so forth) to elements in an XHTML - document without abusing XHTML to do - so. - - - DocBook 文件 - - The FreeBSD XSLT and - DSSSL stylesheets refer to - docbook.css, which is expected to be - present in the same directory as the XHTML - files. The project-wide CSS file is copied - from doc/share/misc/docbook.css when - documents are converted to XHTML, and is - installed automatically. - - - - - - - - 翻譯 - - 本章節是供要翻譯 FreeBSD 說明文件 (常見問答集 (FAQ)、使用手冊 (Handbook)、教學 (Tutorial)、操作手冊 (Manual page) 等) 到各種語言的常見問答集 (FAQ)。 - - 本文件 主要 是以 FreeBSD 德文說明文件計劃的翻譯常見問答集為母本而來的,原始撰稿者為 Frank Gründer elwood@mc5sys.in-berlin.de,並由 Bernd Warken bwarken@mayn.de 再翻譯回英文版。 - - 本常見問答集是由文件工程團隊 Documentation Engineering Team doceng@FreeBSD.org 所維護。 - - - - - i18nl10n 代表的是什麼意思? - - - - i18n 指的是國際化 (Internationalization) 而 l10n 指的是在地化 (Localization)。這些都是為了書寫方便而用的簡寫。 - - i18n 就是開頭為 i 後面有 18 個字母,最後接 n。同樣地,l10n 是開頭為 l 後面有 10 個字母,最後接 n - - - - - - 有給翻譯人員參與討論的郵遞論壇 (Mailing list) 嗎? - - - - 有的,不同的語系翻譯人員都各自有自屬的郵遞論壇。這份 翻譯計劃清單 有列出各翻譯計劃的詳細 mailing lists 及相關網站。此外,有一般翻譯討論的freebsd-translators@freebsd.org郵件論壇。 - - - - - - 需要更多人一起參與翻譯嗎? - - - - 當然囉,越多人參與翻譯,那麼就能夠越快翻完,而且英文版說明文件若有增減、更新的話,各翻譯版也可以儘快同步囉。 - - 不一定得是專業譯者,才能參與翻譯的。 - - - - - - 有要求哪些語言能力呢 - - - - 理論上,必須要對英文非常熟稔,而且很明顯地,對想翻譯的語言必須要能運用自如。 - - 英文也並非一定要會的。比如說,可以把西班牙文 (Spanish) 的 FAQ 翻譯為匈牙利文 (Hungarian)。 - - - - - - 該學會哪些程式的使用呢? - - - - 強烈建議在自己機器上也建立 FreeBSD Subversion 檔案庫的備份 (至少要有說明文件的部分),這可以執行: - - % svn checkout https://svn.FreeBSD.org/doc/head/ head - - svn.FreeBSD.org 是公共的 SVN 伺服器。可以從 Subversion 鏡像站 清單檢查認證的伺服器。 - - - 這需要安裝 devel/subversion 套件。 - - - 你可以很自在地使用 svn。他可以讓你察看說明文件檔案不同版本之間的修改差異。 - - 例如你要看 en_US.ISO8859-1/books/fdp-primer/book.xml 版本r33733r33734 的差異,請執行: - - % svn diff -r33733:33734 en_US.ISO8859-1/books/fdp-primer/book.xml - - - - - - 要怎麼找出來還有誰要跟我一起翻譯的呢? - - - - 說明文件計劃翻譯頁 列了目前已知的各翻譯者成果,如果已經有其他人也在做跟你一樣的翻譯工作,那麼請不要重複浪費人力,請與他們聯繫看看還有哪些地方可以幫上忙的。 - - 若上面並未列出你母語的翻譯,或是也有人要翻譯但還未公開宣布的話,那麼就寄信到 FreeBSD 說明文件計劃郵遞論壇 。 - - - - - - 都沒人翻譯為我所使用的語言,該怎麼辦? - - - - 恭喜啊,你剛好踏上 FreeBSD 您的語言 說明文件翻譯計劃的啟程之路,歡迎登船。 - - 首先呢,先判斷是否有妥善規劃時間,因為你只有一個人在翻而已,因此,相關翻譯成果的公布、與其他可能會幫忙的志工們聯繫這些工作都是你的職責所在。 - - 寫信到文件計劃郵遞論壇 (Documentation Project mailing list) 向大家宣布你正準備要翻譯,然後文件計劃的翻譯部分就會更新相關資料。 - - 若你的國家已經有人提供 FreeBSD 的鏡像站 (Mirror) 服務的話,那麼就先跟他們聯繫,並詢問你是否在上面可以有網頁空間來放相關計劃資料,以及是否可以有提供電子郵件帳號或郵遞論壇服務。 - - 然後,就開始翻文件囉,一開始翻譯的時候,先找些篇幅較短的文件會比較容易些 —— 像是 FAQ 啦,或是如何上手之類的說明文章。 - - - - - - 已經翻好一些說明文件了,該寄到哪呢? - - - - 這要看情況而定。若你是在翻譯團隊內做的話 (像是日本團隊、德國團隊),他們會有自己內部流程來決定翻譯文件怎麼送,這些大致流程會在他們網頁上面有寫。 - - 若你是某語系的唯一翻譯者 (或你是負責某翻譯計劃,並想把成果回饋給 FreeBSD 計劃),那麼你就應該把自己的翻譯成果寄給 FreeBSD 計劃。(細節請看下個問題) - - - - - - 我是該語系的唯一翻譯者,該怎麼把翻譯成果寄出去呢? - - or - - 我們是翻譯團隊,該怎麼把我們成員翻譯成果寄出去呢? - - - - 首先,請先確定你的翻譯成果組織條理分明,並可正確編譯,也就是說: 把它擺到現有說明文件樹內是可以正確編譯成功的。 - - 目前,FreeBSD 說明文件都是放在最上層的 head/ 目錄內。而該目錄下的則根據其 ISO639 所定義的語系代碼來做分類命名的 (在 1999/1/20 之後的 FreeBSD 版本中的 /usr/share/misc/iso639)。 - - 若你這個語系可能會有不同編碼方式 (像是:中文) 那麼就應該會像下面這樣,來依你所使用的編碼方式細分。 - - 最後,你應該建立好各文件的目錄了。 - - 舉例來說,假設有瑞典文 (Swedish) 版的翻譯,那麼應該會長像: - - head/ - sv_SE.ISO8859-1/ - Makefile - htdocs/ - docproj/ - books/ - faq/ - Makefile - book.xml - - sv_SE.ISO8859-1是依照 語系 (Lang).編碼 (Encoding) 的規則來建立的譯名。請注意:其中有兩個 Makefile 檔,它們是用來建置說明文件的。 - - 然後請用 tar1gzip1 來把你的說明文件壓縮起來,並寄到本計劃來。 - - % cd doc -% tar cf swedish-docs.tar sv_SE.ISO8859-1 -% gzip -9 swedish-docs.tar - - 接著,把 swedish-docs.tar.gz 放到網頁空間上,若你沒有自己網頁空間的話 (ISP 不提供),那麼可以該檔寄到文件工程團隊 Documentation Engineering Team doceng@FreeBSD.org 來。 - - 還有,記得用 Bugzilla 提交一個回報來通知大家你已經提交說明文件了,還有,若有人可以幫忙檢閱、複審文件的話,對翻譯品質較好,因為這也有助於提升翻譯品質的流暢度。 - - 最後,會有人 (可能是文件計劃管理者,或是文件工程團隊 Documentation Engineering Team doceng@FreeBSD.org 成員) 會檢閱你的翻譯文件,並確認是否可正常編譯。此外,他們會特別注意下列幾點: - - - - 你的檔案是否都有用 RCS tag (像是 "ID" 之類的)? - - - - sv_SE.ISO8859-1 是否可以順利make all 編譯呢? - - - - make install 是否結果有正確 - - - - 若有問題的話,那麼檢閱者會叮嚀你,來讓這些翻譯成果可以正確使用。 - - 若沒問題的話,那麼就會很快把你的翻譯成果提交。 - - - - - - 可以加入某語系或某國家才有的東西到翻譯內容內嗎? - - - - 我們希望不要這麼做。 - - 舉例來說,假設你正準備把使用手冊 (Handbook) 翻譯為韓文版,並希望把韓國零售商也加到你翻譯的韓文版使用手冊內。 - - 我們想不出來有啥原因,為什麼不把這些資訊提供給英文版呢?(或是德文、西班牙文、日文等 …) 因為,有可能英語讀者跑去韓國時,會想買 FreeBSD 相關產品。此外,這也可以提升 FreeBSD 的可見度,很顯然的,這並不是件壞事啊。 - - 若你有某國才有的資料,請提供給英文版使用手冊以作為修訂 (用 Bugzilla),然後再把英文版的修訂部分翻為你要翻譯的使用手冊吧。 - - 謝謝。 - - - - - - 要怎麼把該語系特有的字元寫進去翻譯內容呢? - - - - 說明文件內所有的非 ASCII (Non-ASCII) 的字元,都要使用 SGML entities 才能寫進去。 - - 簡單來說,長相一開頭會是 and 符號 (&),然後是該 Entity 名稱,最後接上分號 (;)。 - - 這些 Entity 名稱都是 ISO8879 所制訂的,其在 Port 樹內的 textproc/iso8879 - - 以下舉一些例子: - - - Entity 名稱 - - 外觀 - - 說明 - - - &eacute; - é - e,並帶尖、重音 (Acute accent) - - - - &Eacute; - É - E,並帶尖、重音 (Acute accent) - - - - &uuml; - ü - u,並帶日耳曼語系中的母音變化 (Umlaut) - - - - 在裝了 iso8879 這個 Port 之後,就可以在 /usr/local/share/xml/iso8879 找到這些的詳細列表。 - - - - - - 如何稱呼讀者呢? - - - - 在英文文件內,讀者都是以 you 來稱呼,而有些語言並沒有正式/非正式的區隔。 - - 若你所要翻的語言可以區別這些差異,那麼請用該語系在一般技術說明文件上所使用的稱呼吧。如果容易造成困惑的話,那麼請改用較中性的稱呼來取代。 - - - - - - 翻譯成果內要不要附上一些其他訊息呢? - - - - 要。 - - 每份英文版原稿的開頭,通常會有像下面的內容: - - <!-- - The FreeBSD Documentation Project - - $FreeBSD$ ---> - - 實際上的內容可能稍有不同,但每份原稿都會附上 $FreeBSD$ 這一行以及 The FreeBSD Documentation Project 宣告。請注意:$FreeBSD$ 開頭的這行是會由 Subversion 隨著每次異動而自動更改的,所以新檔案的話請保持原狀 (也就是只要寫 $FreeBSD$ 就好了)。 - - 翻譯文件中,必須都要有 $FreeBSD$ 這行,並且把 FreeBSD Documentation Project 這行改為 The FreeBSD language Documentation Project - - 此外,還必須加上第三行來指出你所翻譯的,到底是以英文版原稿的哪一版本為母本所做的翻譯。 - - 因此呢,西班牙文版 (Spanish) 的檔案開頭應該是長像這樣: - - <!-- - The FreeBSD Spanish Documentation Project - - $FreeBSD$ - Original revision: r38674 ---> - - - - - - - - - - <acronym>PO</acronym> 翻譯 - - - 簡介 - - GNU gettext 系統提供翻譯者一個簡單的方法來建立和維護文件的翻譯。翻譯的字串從原始文件題取出來到 PO (Portable Object) 檔。字串的翻譯用另外的編輯器輸入。翻譯的字串可以直接使用,或是編譯成原始文件的完整翻譯版本。 - - - - 快速上手 - - 我們會假設您已做過在 中的步驟,除此之外還必須打開 textproc/docproj Port 中的 TRANSLATOR 選項。如果沒有打開這個選項,請打開選項後重新安裝 Port。 - - # cd /usr/ports/textproc/docproj -# make config -# make clean deinstall install clean - - 這個範例示範如何建立 Leap Seconds 短文的西班牙文翻譯。 - - - 安裝 <acronym>PO</acronym> 編輯器 - - - 編輯翻譯檔案需要 PO 編輯器。這個範例使用 editors/poedit - - # cd /usr/ports/editors/poedit -# make install clean - - - - - 初始設定 - - 第一次建立新的翻譯時,目錄結構和 Makefile 必須建立或是從英文版複製過來。 - - - 建立新翻譯的目錄。英文文章原始碼位於 ~/doc/en_US.ISO8859-1/articles/leap-seconds/ 。西班牙文翻譯將會放在 ~/doc/es_ES.ISO8859-1/articles/leap-seconds/ 。除了語系目錄的名稱外,其他路徑相同。 - - % svn mkdir --parents ~/doc/es_ES.ISO8859-1/articles/leap-seconds/ - - - - 從原始文件處將 Makefile 複製到翻譯目錄。 - - % svn cp ~/doc/en_US.ISO8859-1/articles/leap-seconds/Makefile \ - ~/doc/es_ES.ISO8859-1/articles/leap-seconds/ - - - - - 翻譯 - - 翻譯文件公有兩個步驟:將可翻譯的字串從原始文件提去出來,然後翻譯這些字串。重複這些步驟,直到翻譯者認為文件的翻譯部份已經足夠用來產生可讀的翻譯文件。 - - - 從英文的原始文件提取字串到 PO 檔: - - % cd ~/doc/es_ES.ISO8859-1/articles/leap-seconds/ -% make po - - - - 使用 PO 編輯器將翻譯輸入 PO 檔。有幾個不同的編輯器可以使用。這裡用的是 editors/poeditpoedit - - PO 檔名是兩個字元的語系碼後面接底線和兩個字元的區域碼。以西班牙語來說,檔名是 es_ES.po - - % poedit es_ES.po - - - - - 產生翻譯文件 - - - 產生翻譯文件 - - % cd ~/doc/es_ES.ISO8859-1/articles/leap-seconds/ -% make tran - - 產生的文件名稱與英文原始文件名稱相符,文章通常是 article.xml,書籍是 book.xml - - - - 可以轉換成 HTML 來檢查產生的檔案,並用瀏覽器來察看。 - - % make FORMATS=html -% firefox article.html - - - - - - 建立新翻譯 - - 建立新翻譯文件的第一步是找到或建立一個目錄來放它。FreeBSD 將翻譯文件放在子目錄,用語系和區域以 語系 (lang)_區域 (REGION) 來命名。語系 (lang) 是小寫的兩個字元碼,接著是底線和兩個字元的大寫 REGION 碼。 - - - 語系名稱 - - - - - 語言 - 地區 - 翻譯目錄名稱 - PO 檔名稱 - 字元集 - - - - - - 英文 - 美國 - en_US.ISO8859-1 - en_US.po - ISO 8859-1 - - - - 孟加拉文 - 孟加拉 - bn_BD.UTF-8 - bn_BD.po - UTF-8 - - - - 丹麥文 - 丹麥 - da_DK.ISO8859-1 - da_DK.po - ISO 8859-1 - - - - 德文 - 德國 - de_DE.ISO8859-1 - de_DE.po - ISO 8859-1 - - - - 希臘文 - 希臘 - el_GR.ISO8859-7 - el_GR.po - ISO 8859-7 - - - - 西班牙文 - 西班牙 - es_ES.ISO8859-1 - es_ES.po - ISO 8859-1 - - - - 法文 - 法國 - fr_FR.ISO8859-1 - fr_FR.po - ISO 8859-1 - - - - 匈牙利文 - 匈牙利 - hu_HU.ISO8859-2 - hu_HU.po - ISO 8859-2 - - - - 義大利文 - 義大利 - it_IT.ISO8859-15 - it_IT.po - ISO 8859-15 - - - - 日文 - 日本 - ja_JP.eucJP - ja_JP.po - EUC JP - - - - 韓文 - 韓國 - ko_KR.UTF-8 - ko_KR.po - UTF-8 - - - - 蒙古文 - 蒙古 - mn_MN.UTF-8 - mn_MN.po - UTF-8 - - - - 荷蘭文 - 荷蘭 - nl_NL.ISO8859-1 - nl_NL.po - ISO 8859-1 - - - - 挪威文 - 挪威 - no_NO.ISO8859-1 - no_NO.po - ISO 8859-1 - - - - 波蘭文 - 波蘭 - pl_PL.ISO8859-2 - pl_PL.po - ISO 8859-2 - - - - 葡萄牙文 - 巴西 - pt_BR.ISO8859-1 - pt_BR.po - ISO 8859-1 - - - - 俄文 - 俄羅斯 - ru_RU.KOI8-R - ru_RU.po - KOI8-R - - - - 賽爾維亞 - 賽爾維亞文 - sr_YU.ISO8859-2 - sr_YU.po - ISO 8859-2 - - - - 土耳其文 - 土耳其 - tr_TR.ISO8859-9 - tr_TR.po - ISO 8859-9 - - - - 中文 - 中國 - zh_CN.UTF-8 - zh_CN.po - UTF-8 - - - - 中文 - 台灣 - zh_TW.UTF-8 - zh_TW.po - UTF-8 - - - -
- - 翻譯位於主要說明文件目錄的子目錄,這裡假設如 所示,是 ~/doc/。例如德文位於 ~/doc/de_DE.ISO8859-1/,法文位於 ~/doc/fr_FR.ISO8859-1/ - - 每個語系目錄包含不同文件類型的子目錄,通常是 articles/books/ - - 將目錄名稱組合起來就是文章或書的完整路徑。例如,NanoBSD 文章的法語翻譯在 ~/doc/fr_FR.ISO8859-1/articles/nanobsd/ 。而使用手冊的蒙古文翻譯在~/doc/mn_MN.UTF-8/books/handbook/ - - 當翻譯到一個新語系時必須建立一個新的語系目錄。如果語系目錄已經存在,那只需要有 articles/books/ 的子目錄。 - - FreeBSD 說明文件的編譯是由同一個目錄的 Makefile 控制。簡單的文章可以從原始的英語目錄直接複製 Makefile 過來。書籍的翻譯流程結合多個獨立的 book.xmlchapter.xml 成為一個檔案,所以書籍翻譯的 Makefile 必須複製並修改。 - - - 建立 Porter 手冊的西班牙語翻譯 - - 建立 Porter 手冊 的西班牙文翻譯。原文是位於 ~/doc/en_US.ISO8859-1/books/porters-handbook/ 的書籍。 - - - - 西班牙文 books 目錄 ~/doc/es_ES.ISO8859-1/books/ 已經存在,所以只要建立 Porter 手冊的子目錄: - % cd ~/doc/es_ES.ISO8859-1/books/ -% svn mkdir porters-handbook -A porters-handbook - - - - 從原始文件的目錄複製 Makefile - - % cd ~/doc/es_ES.ISO8859-1/books/porters-handbook -% svn cp ~/doc/en_US.ISO8859-1/books/porters-handbook/Makefile . -A Makefile - - 修改 Makefile 內容以產生單一的 book.xml - - # -# $FreeBSD$ -# -# Build the FreeBSD Porter's Handbook. -# - -MAINTAINER=doc@FreeBSD.org - -DOC?= book - -FORMATS?= html-split - -INSTALL_COMPRESSED?= gz -INSTALL_ONLY_COMPRESSED?= - -# XML content -SRCS= book.xml - -# Images from the cross-document image library -IMAGES_LIB+= callouts/1.png -IMAGES_LIB+= callouts/2.png -IMAGES_LIB+= callouts/3.png -IMAGES_LIB+= callouts/4.png -IMAGES_LIB+= callouts/5.png -IMAGES_LIB+= callouts/6.png -IMAGES_LIB+= callouts/7.png -IMAGES_LIB+= callouts/8.png -IMAGES_LIB+= callouts/9.png -IMAGES_LIB+= callouts/10.png -IMAGES_LIB+= callouts/11.png -IMAGES_LIB+= callouts/12.png -IMAGES_LIB+= callouts/13.png -IMAGES_LIB+= callouts/14.png -IMAGES_LIB+= callouts/15.png -IMAGES_LIB+= callouts/16.png -IMAGES_LIB+= callouts/17.png -IMAGES_LIB+= callouts/18.png -IMAGES_LIB+= callouts/19.png -IMAGES_LIB+= callouts/20.png -IMAGES_LIB+= callouts/21.png - -URL_RELPREFIX?= ../../../.. -DOC_PREFIX?= ${.CURDIR}/../../.. - -.include "${DOC_PREFIX}/share/mk/doc.project.mk" - - 現在文件結構已經準備好讓翻譯者執行 make po 開始翻譯。 - - - - - - 建立 <acronym>PGP</acronym> 金鑰文章的法語翻譯。 - - 建立 PGP 金鑰文章 的法文翻譯。原文是位於 ~/doc/en_US.ISO8859-1/articles/pgpkeys/ 的文章。 - - - - 法文文章目錄 ~/doc/fr_FR.ISO8859-1/articles/ 已經存在,所以只要建立 PGP 金鑰文章的子目錄: - % cd ~/doc/fr_FR.ISO8859-1/articles/ -% svn mkdir pgpkeys -A pgpkeys - - - - 從原始文件的目錄複製 Makefile - - % cd ~/doc/fr_FR.ISO8859-1/articles/pgpkeys -% svn cp ~/doc/en_US.ISO8859-1/articles/pgpkeys/Makefile . -A Makefile - - 檢查 Makefile 的內容。因為這是簡單的文章,此例的 Makefile 不用修改。第二行的 $FreeBSD...$ 版本字串將會在檔案提交時被版本控制系統替換掉。 - - # -# $FreeBSD$ -# -# Article: PGP Keys - -DOC?= article - -FORMATS?= html -WITH_ARTICLE_TOC?= YES - -INSTALL_COMPRESSED?= gz -INSTALL_ONLY_COMPRESSED?= - -SRCS= article.xml - -# To build with just key fingerprints, set FINGERPRINTS_ONLY. - -URL_RELPREFIX?= ../../../.. -DOC_PREFIX?= ${.CURDIR}/../../.. - -.include "${DOC_PREFIX}/share/mk/doc.project.mk" - - 文章結構處理好後,可以執行建立 make po 建立 PO 檔。 - - - -
- - - 翻譯 - - gettext 系統大幅減少翻譯者要追蹤的事情。字串從原始文件提取到 PO 檔。再用 PO 檔編輯器輸入字串的翻譯。 - - FreeBSD PO 翻譯系統不會覆蓋掉 PO 檔。所以提取步驟可以在任何時候重複執行來更新 PO 檔。 - - PO 檔編輯器來編輯檔案。此例是用 editors/poedit,因為它很簡單而且系統需求低。其他的 PO 檔編輯器提供一些特點,能使翻譯工作更輕鬆。Port 套件集裡有數個編輯器,包括 devel/gtranslator - - 保留 PO 檔是很重要的。它包含所有的翻譯成果。 - - - 翻譯 Porter 手冊到西班牙文 - - 輸入 Porter 手冊的西班牙文內容 - - - - 切換到西班牙文 Porter 手冊的目錄並更新 PO 檔。產生的 PO 檔如 所示,名叫 es_ES.po - - % cd ~/doc/es_ES.ISO8859-1/books/porters-handbook -% make po - - - - 使用 PO 檔編輯器輸入翻譯: - - % poedit es_ES.po - - - - - - - 給翻譯者的提示 - - - 保留 <acronym>XML</acronym> 標籤 - - 保留在英文原文的 XML 標籤。 - - - 保留 <acronym>XML</acronym> 標籤 - - 英文原文: - - If acronymNTPacronym is not being used - - 西班牙文翻譯: - - Si acronymNTPacronym no se utiliza - - - - - 保留空白 - - 保留要翻譯字串前後的空白,翻譯過的版本也需要有這些空白。 - - - - 不要翻譯的標籤 - - 有些標籤的內容要一字不差地保留,不要翻譯。 - - - - citerefentry - - - - command - - - - filename - - - - literal - - - - manvolnum - - - - orgname - - - - package - - - - programlisting - - - - prompt - - - - refentrytitle - - - - screen - - - - userinput - - - - varname - - - - - - <literal>$FreeBSD$</literal> 字串 - - 在檔案中使用到的 $FreeBSD$ 版本字串都需要特別處理,例如在 ,使用這些字串的用意並非要展開成版本。英文的說明文件會使用 &dollar; Entity 來避免在檔案中用到錢字符號: - - &dollar;FreeBSD&dollar; - - 版本控制符號不會把 &dollar; entities 看成金錢符號,所以不會把字串展開成版本字串。 - - PO 檔建立之後,在範例中使用到的 &dollar; Entity 會被取代成實際的錢字符號,這會使的 $FreeBSD$ 字串在提交時錯誤的被版本控制系統展開成版本字串。 - - 在英文文件上使用的方法也可以用在翻譯上,翻譯時在 PO 編輯器用 &dollar; 來取代金錢符號: - - &dollar;FreeBSD&dollar; - - - - - - - 編譯翻譯的文件 - - 原文的翻譯版本可以在任何時候被建立。未翻譯的部份會以英文呈獻。大部份 PO 編輯器有指標可以顯示翻譯完成度。這讓翻譯者更容易看翻譯好的字串是否足夠來編譯最終的文件。 - - - 編譯西班牙文 Porter 手冊 - - 編譯和預覽之前範例翻譯的西班牙文版 Porter 手冊 - - - - 編譯翻譯好的文件。因為原文是書籍,所以產生的文件是 book.xml - - % cd ~/doc/es_ES.ISO8859-1/books/porters-handbook -% make tran - - - - 轉換翻譯好的 book.xmlHTML 並用 Firefox 來瀏覽。這和英文版是相同的步驟,其他 FORMATS 也可以這樣做。請見 - - % make FORMATS=html -% firefox book.html - - - - - - - 提交新翻譯 - - 準備要提交的新翻譯。這包含新增檔案到版本控制系統,對檔案設定額外的屬性,並建立 diff 來提交。 - - 範例中產生的 diff 檔可以被附加到 文件問題回報 (Documentation bug report) 或 程式碼審查 (Code review) 。 - - - NanoBSD 文章的西班牙文翻譯 - - - - 增加 FreeBSD 版本字串註解到 PO 檔的第一行: - - #$FreeBSD$ - - - - 增加 MakefilePO 檔和產生的 XML 翻譯到版本控制系統: - - % cd ~/doc/es_ES.ISO8859-1/articles/nanobsd/ -% ls -Makefile article.xml es_ES.po -% svn add Makefile article.xml es_ES.po -A Makefile -A article.xml -A es_ES.po - - - - 在這些檔案設定 Subversion svn:keywords 屬性為 FreeBSD=%H$FreeBSD$ 字串可以在提交時被展開成為路徑、修訂、日期以及作者: - - % svn propset svn:keywords FreeBSD=%H Makefile article.xml es_ES.po -property 'svn:keywords' set on 'Makefile' -property 'svn:keywords' set on 'article.xml' -property 'svn:keywords' set on 'es_ES.po' - - - - 設定檔案的 MIME 類型。書籍和文章是 text/xmlPO 檔是 text/x-gettext-translation - - % svn propset svn:mime-type text/x-gettext-translation es_ES.po -property 'svn:mime-type' set on 'es_ES.po' -% svn propset svn:mime-type text/xml article.xml -property 'svn:mime-type' set on 'article.xml' - - - - ~/doc/ 建立這些新檔案的 diff,讓檔名顯示完整的路徑。這可以幫助提交者辨識目標語系目錄。 - - % cd ~/doc -svn diff es_ES.ISO8859-1/articles/nanobsd/ > /tmp/es_nanobsd.diff - - - - - - Explaining-BSD 文章的韓文 <acronym>UTF-8</acronym> 翻譯 - - - - 增加 FreeBSD 版本字串註解到 PO 檔的第一行: - - #$FreeBSD$ - - - - 增加 MakefilePO 檔和產生的 XML 翻譯到版本控制系統: - - % cd ~/doc/ko_KR.UTF-8/articles/explaining-bsd/ -% ls -Makefile article.xml ko_KR.po -% svn add Makefile article.xml ko_KR.po -A Makefile -A article.xml -A ko_KR.po - - - - 在這些檔案設定 Subversion svn:keywords 屬性為 FreeBSD=%H$FreeBSD$ 字串可以在提交時被展開成為路徑、修訂、日期以及作者: - - % svn propset svn:keywords FreeBSD=%H Makefile article.xml ko_KR.po -property 'svn:keywords' set on 'Makefile' -property 'svn:keywords' set on 'article.xml' -property 'svn:keywords' set on 'ko_KR.po' - - - - 設定檔案的 MIME 類型。因為這些檔案使用 UTF-8 字元集,這也需要指定。為了防止版本控制系統將這些檔案誤認為二進位資料,fbsd:notbinary 屬性也需要設定。 - - % svn propset svn:mime-type 'text/x-gettext-translation;charset=UTF-8' ko_KR.po -property 'svn:mime-type' set on 'ko_KR.po' -% svn propset fbsd:notbinary yes ko_KR.po -property 'fbsd:notbinary' set on 'ko_KR.po' -% svn propset svn:mime-type 'text/xml;charset=UTF-8' article.xml -property 'svn:mime-type' set on 'article.xml' -% svn propset fbsd:notbinary yes article.xml -property 'fbsd:notbinary' set on 'article.xml' - - - - ~/doc/ 建立這些新檔案的 diff。 - - % cd ~/doc -svn diff ko_KR.UTF-8/articles/explaining-bsd > /tmp/ko-explaining.diff - - - - -
- - - - - 寫作風格 - - - 叮嚀 - - Technical documentation can be improved by consistent use of - several principles. Most of these can be classified into three - goals: be clear, - be complete, and - be concise. These goals can conflict with - each other. Good writing consists of a balance between - them. - - - 要明瞭 - - Clarity is extremely important. The reader may be a - novice, or reading the document in a second language. Strive - for simple, uncomplicated text that clearly explains the - concepts. - - Avoid flowery or embellished speech, jokes, or colloquial - expressions. Write as simply and clearly as possible. Simple - text is easier to understand and translate. - - Keep explanations as short, simple, and clear as possible. - Avoid empty phrases like in order to, which - usually just means to. Avoid potentially - patronizing words like basically. Avoid Latin - terms like i.e. or cf., which - may be unknown outside of academic or scientific - groups. - - Write in a formal style. Avoid addressing the reader - as you. For example, say - copy the file to /tmp - rather than you can copy the file to - /tmp. - - Give clear, correct, tested examples. - A trivial example is better than no example. A good example - is better yet. Do not give bad examples, identifiable by - apologies or sentences like but really it should never - be done that way. Bad examples are worse than no - examples. Give good examples, because even when - warned not to use the example as shown, the - reader will usually just use the example as shown. - - Avoid weasel words like - should, might, - try, or could. These words - imply that the speaker is unsure of the facts, and - create doubt in the reader. - - Similarly, give instructions as imperative commands: not - you should do this, but merely - do this. - - - - 要完整 - - Do not make assumptions about the reader's abilities or - skill level. Tell them what they need to know. Give links to - other documents to provide background information without - having to recreate it. Put yourself in the reader's place, - anticipate the questions they will ask, and answer - them. - - - - 要簡潔 - - While features should be documented completely, sometimes - there is so much information that the reader cannot easily - find the specific detail needed. The balance between being - complete and being concise is a challenge. One approach is to - have an introduction, then a quick start - section that describes the most common situation, followed by - an in-depth reference section. - - - - - 準則 - - To promote consistency between the myriad authors of the - FreeBSD documentation, some guidelines have been drawn up for - authors to follow. - - - - 使用美式英語拼寫 - - - There are several variants of English, with different - spellings for the same word. Where spellings differ, use - the American English variant. color, not - colour, rationalize, not - rationalise, and so on. - - - The use of British English may be accepted in the - case of a contributed article, however the spelling must - be consistent within the whole document. The other - documents such as books, web site, manual pages, etc. - will have to use American English. - - - - - - 不要使用縮寫式 - - - Do not use contractions. Always spell the phrase out - in full. Don't use contractions is - wrong. - - Avoiding contractions makes for a more formal tone, is - more precise, and is slightly easier for - translators. - - - - - 使用逗號串行 - - - In a list of items within a paragraph, separate each - item from the others with a comma. Separate the last item - from the others with a comma and the word - and. - - For example: - -
- This is a list of one, two and three items. -
- - Is this a list of three items, one, - two, and three, or a list of - two items, one and two and - three? - - It is better to be explicit and include a serial - comma: - -
- This is a list of one, two, and three items. -
-
-
- - - 避免多餘的語句 - - - Do not use redundant phrases. In particular, - the command, the file, and - man command are often redundant. - - For example, commands: - - - Wrong: Use the svn command to - update sources. - - - - Right: Use svn to update - sources. - - - Filenames: - - - Wrong: … in the filename - /etc/rc.local - - - - Right: … in - /etc/rc.local - - - Manual page references (the second example uses - citerefentry with the - &man.csh.1; entity):. - - - Wrong: See man csh for more - information. - - - - Right: See csh1. - - - - - - 在句子之間空兩個空白 - - - Always use two spaces between sentences, as it - improves readability and eases use of tools such as - Emacs. - - A period and spaces followed by a capital letter - does not always mark a new sentence, especially in names. - Jordan K. Hubbard is a good example. It - has a capital H following a period and - a space, and is certainly not a new sentence. - - -
- - For more information about writing style, see Elements of - Style, by William Strunk. -
- - - 風格指南 - - 由於說明文件是由眾多作者所維護,為了保持寫作風格的一貫性,請遵守下列撰寫風格慣例。 - - - 大小寫 - - Tag 的部份都是用小寫字母,譬如是用 para而非PARA - - 而 SGML 內文則是用大寫字母表示,像是: <!ENTITY…><!DOCTYPE…>而不是 <!entity…><!doctype…> - - - - 縮寫 - - 縮寫字 (Acronym) 通常在書中第一次提到時,必須同時列出完整拼法,比如:Network Time Protocol (NTP)。定義縮寫字之後,應該儘量只使用該縮寫字(而非完整詞彙,除非使用完整詞彙可以更能表達語意)來表達即可。通常每本書只會第一次提到時,才會列出完整詞彙,但若您高興也可以在每章第一次提到時又列出完整詞彙。 - - 所有縮寫要包在acronym標籤內。 - - - - 縮排 - - 無論檔案縮排設定為何,每個檔案的第一行都不縮排。 - - 未完的標籤會以多兩個空白來增加縮排,結尾的標籤則少兩個空白來縮減縮排。若已達 8 個空白,則以 tab 取代之。此外,在 tab 前面不要再用空白,也不要在每行後面加上空白。每個 tag 的內文若超過一行的話,則接下來的就多兩個空白以做縮排。 - - 舉個例子,這節所用的寫法大致是下面這樣: - - chapter - title...title - - sect1 - title...title - - sect2 - titleIndentationtitle - - paraThe first line in each file starts with no indentation, - emphasisregardlessemphasis of the indentation level of - the file which might contain the current file.para - - ... - sect2 - sect1 -chapter - - 有長屬性的標籤也是遵循一樣的原則。遵守縮排規則可以幫助編輯和作者了解哪些內容在標籤內: - - paraSee the link - linkend="gmirror-troubleshooting"Troubleshootinglink - section if there are problems booting. Powering down and - disconnecting the original filenameada0filename disk - will allow it to be kept as an offline backup.para - -paraIt is also possible to journal the boot disk of a &os; - system. Refer to the article link - xlink:href="&url.articles.gjournal-desktop;"Implementing UFS - Journaling on a Desktop PClink for detailed - instructions.para - - When an element is too long to fit on the remainder of a - line without wrapping, moving the start tag to the next line - can make the source easier to read. In this example, the - systemitem element has been moved to the - next line to avoid wrapping and indenting: - - paraWith file flags, even - systemitem class="username"rootsystemitem can be - prevented from removing or altering files.para - - Configurations to help various text editors conform to - these guidelines can be found in - . - - - - 標籤風格 - - - 標籤間距 - - 同一縮排階層的標籤要以空一行來做區隔,而不同縮排階層的則不必。比如: - - - article lang='en' - articleinfo - titleNIStitle - - pubdateOctober 1999pubdate - - abstract - para... - ... - ...para - abstract - articleinfo - - sect1 - title...title - - para...para - sect1 - - sect1 - title...title - - para...para - sect1 -article - - - - - 分隔標籤 - - 像是 itemizedlist 這類的標籤事實上本身不含任何文字資料,必須得由其他標籤來補充內文。這類的標籤會獨用一整行。 - - 另外,像是 paraterm 這類的標籤並不需搭配其他標籤,就可附上文字資料,並且在標籤後面的同一行內即可立即寫上這些內文。 - - 當然,這兩類的標籤結尾時也是跟上面道理相同。 - - 不過,當上述這兩種標籤混用時,會有很明顯的困擾。 - - 當第一類標籤的後面接上第二類標籤的話,那麼要把這兩類標籤各自分行來寫。後者標籤的段落,也是需要做適當縮排調整。 - - 而第二類標籤結尾時,可以與第一類標籤的結尾放在同一行。 - - - - - 空白變更 - - 在提交修改時,請別在修改內容的同時也一起更改編排格式 - - 如此一來,像是翻譯團隊才能迅速找出你改了哪些內容,而不用費心思去判斷該行的改變,是由於格式重排或者內容異動。 - - 舉例說明,若要在某段加上兩個句子,如此一來該段落的某行勢必會超出 80 縱列,這時請先 commmit 修改。接著,再修飾過長行落的換行,然後再次 commit 之。而第二次的 commit 紀錄,請明確說明這只是 whitespace-only (修改空白而已) 的更改,如此一來,翻譯團隊就可以忽略第二次 commit 了 。 - - - - 不斷行空白 - - 請避免一些情況下的斷行:造成版面醜醜的、或是須連貫表達的同一句子。斷行的情況會隨所閱讀的工具不同而有所不同。尤其是透過純文字瀏覽器來看 HTML 說明文件時會更明顯看到類似下面這樣不好的編排段落: - - Data capacity ranges from 40 MB to 15 -GB. Hardware compression … - - 請使用 &nbsp; 以避免同句子之間的斷行,以下示範如何使用不斷行空白: - - - - 在數字與單位之間: - 57600&nbsp;bps - - - - 在程式名稱與版號之間: - &os;&nbsp;9.2 - - - - 多個單字的名稱之間 (在套用到如 The FreeBSD Brazilian Portuguese Documentation Project 這種由三到四個字所組成的名稱時請小心): - Sun&nbsp;Microsystems - - - - - - - 詞彙表 - - 以下詞彙表列出使用在 FreeBSD 文件的正確拼法和大小寫。若找不到要找的詞彙,請詢問 FreeBSD documentation project mailing list 。 - - - - - - 字詞 - XML 程式碼 - 備註 - - - - - - CD-ROM - - acronymCD-ROMacronym - - - - DoS (Denial of Service) - acronymDoSacronym - - - - email - - - - file system - - - - IPsec - - - - Internet - - - - manual page - - - - mail server - - - - name server - - - - Ports Collection - - - - read-only - - - - Soft Updates - - - - stdin - varnamestdinvarname - - - - stdout - varnamestdoutvarname - - - - stderr - varnamestderrvarname - - - - Subversion - - applicationSubversionapplication - 不要用大寫 SVN 來表示 Subversion 應用程式。若要表示指令,請使用 commandsvncommand - - - - UNIX - &unix; - - - - userland - - 指那些要會用在使用者空間 (User space) 而非核心的東西。 - - - - web server - - - - - -
- - - - - - 編輯器設定 - - Adjusting text editor configuration can make working on - document files quicker and easier, and help documents conform to - FDP guidelines. - - - <application>Vim</application> - - Install from editors/vim or - editors/vim-lite, then follow the - configuration instructions in - . - - - 使用 - - Press P to reformat paragraphs or text - that has been selected in Visual mode. Press - T to replace groups of eight spaces with a - tab. - - - - 設置 - - Edit ~/.vimrc, adding these - lines to the end of the file: - - if has("autocmd") - au BufNewFile,BufRead *.sgml,*.ent,*.xsl,*.xml call Set_SGML() - au BufNewFile,BufRead *.[1-9] call ShowSpecial() -endif " has(autocmd) - -function Set_Highlights() - "match ExtraWhitespace /^\s* \s*\|\s\+$/ - highlight default link OverLength ErrorMsg - match OverLength /\%71v.\+/ - return 0 -endfunction - -function ShowSpecial() - setlocal list listchars=tab:>>,trail:*,eol:$ - hi def link nontext ErrorMsg - return 0 -endfunction " ShowSpecial() - -function Set_SGML() - setlocal number - syn match sgmlSpecial "&[^;]*;" - setlocal syntax=sgml - setlocal filetype=xml - setlocal shiftwidth=2 - setlocal textwidth=70 - setlocal tabstop=8 - setlocal softtabstop=2 - setlocal formatprg="fmt -p" - setlocal autoindent - setlocal smartindent - " Rewrap paragraphs - noremap P gqj - " Replace spaces with tabs - noremap T :s/ /\t/<CR> - call ShowSpecial() - call Set_Highlights() - return 0 -endfunction " Set_SGML() - - - - - <application>Emacs</application> - - Install from editors/emacs or - editors/emacs-devel. - - - 檢驗 - - Emacs's nxml-mode uses compact relax NG schemas for - validating XML. A compact relax NG schema for FreeBSD's - extension to DocBook 5.0 is included in the documentation - repository. To configure nxml-mode to validate using this - schema, create - ~/.emacs.d/schema/schemas.xml and add - these lines to the file: - - locatingRules xmlns="http://thaiopensource.com/ns/locating-rules/1.0" - documentElement localName="section" typeId="DocBook" - documentElement localName="chapter" typeId="DocBook" - documentElement localName="article" typeId="DocBook" - documentElement localName="book" typeId="DocBook" - typeId id="DocBook" uri="/usr/local/share/xml/docbook/5.0/rng/docbook.rnc" -locatingRules - - - - - 使用 Flycheck 和 Igor 自動化校對 - - The Flycheck package is available from Milkypostman's - Emacs Lisp Package Archive (MELPA). If - MELPA is not already in Emacs's - packages-archives, it can be added by evaluating - - (add-to-list 'package-archives '("melpa" . "http://stable.melpa.org/packages/") t) - - Add the line to Emacs's initialization file (one of - ~/.emacs, - ~/.emacs.el, or - ~.emacs.d/init.el) to make this change - permanent. - - To install Flycheck, evaluate - - (package-install 'flycheck) - - Create a Flycheck checker for - textproc/igor by evaluating - - (flycheck-define-checker igor - "FreeBSD Documentation Project sanity checker. - -See URLs http://www.freebsd.org/docproj/ and -http://www.freshports.org/textproc/igor/." - :command ("igor" "-X" source-inplace) - :error-parser flycheck-parse-checkstyle - :modes (nxml-mode) - :standard-input t) - - (add-to-list 'flycheck-checkers 'igor 'append) - - Again, add these lines to Emacs's initialization file to - make the changes permanent. - - - - FreeBSD 說明文件特定的設定 - - To apply settings specific to the FreeBSD documentation - project, create .dir-locals.el in the - root directory of the documentation repository and add these - lines to the file: - - ;;; Directory Local Variables -;;; For more information see (info "(emacs) Directory Variables") - -((nxml-mode - (eval . (turn-on-auto-fill)) - (fill-column . 70) - (eval . (require 'flycheck)) - (eval . (flycheck-mode 1)) - (flycheck-checker . igor) - (eval . (add-to-list 'rng-schema-locating-files "~/.emacs.d/schema/schemas.xml")))) - - - - - <application>nano</application> - - Install from - editors/nano or - editors/nano-devel. - - - 設置 - - Copy the sample XML syntax highlight - file to the user's home directory: - - % cp /usr/local/share/nano/xml.nanorc ~/.nanorc - - Add these lines to the new - ~/.nanorc. - - syntax "xml" "\.([jrs]html?|xml|xslt?)$" -# trailing whitespace -color ,blue "[[:space:]]+$" -# multiples of eight spaces at the start a line -# (after zero or more tabs) should be a tab -color ,blue "^([TAB]*[ ]{8})+" -# tabs after spaces -color ,yellow "( )+TAB" -# highlight indents that have an odd number of spaces -color ,red "^(([ ]{2})+|(TAB+))*[ ]{1}[^ ]{1}" -# lines longer than 70 characters -color ,yellow "^(.{71})|(TAB.{63})|(TAB{2}.{55})|(TAB{3}.{47}).+$" - - Process the file to create embedded tabs: - - % perl -i'' -pe 's/TAB/\t/g' ~/.nanorc - - - - 使用 - - Specify additional helpful options when running the - editor: - - % nano -AKipwz -r 70 -T8 chapter.xml - - Users of csh1 can define an alias in - ~/.cshrc to automate these - options: - - alias nano "nano -AKipwz -r 70 -T8" - - After the alias is defined, the options will be added - automatically: - - % nano chapter.xml - - - - - - - - 他山之石 - - This document is deliberately not an exhaustive discussion of - XML, the DTDs listed, and the FreeBSD Documentation Project. For - more information about these, you are encouraged to see the - following web sites. - - - FreeBSD 說明文件計劃 - - - - FreeBSD 說明文件計劃網頁 - - - - FreeBSD 使用手冊 - - - - - - XML - - - - W3C's XML 網頁 SGML/XML 網頁 - - - - - - HTML - - - - 全球資訊網協會 - - - - The HTML 4.0 規格表 - - - - - - DocBook - - - - The DocBook 技術委員會,DocBook DTD的維護者 - - - - DocBook:The Definitive Guide,DocBook DTD 的線上說明文件。 - - - - The DocBook - Open Repository contains DSSSL stylesheets and - other resources for people using DocBook - - - - - - - - - - - - 範例 - - These examples are not exhaustive—they do not contain - all the elements that might be desirable to use, particularly in a - document's front matter. For more examples of DocBook markup, - examine the XML source for this and other - documents available in the Subversion - doc repository, or available online starting at - http://svnweb.FreeBSD.org/doc/. - - - DocBook <tag>book</tag> - - - DocBook <tag>book</tag> - - <!DOCTYPE book PUBLIC "-//FreeBSD//DTD DocBook XML V5.0-Based Extension//EN" - "http://www.FreeBSD.org/XML/share/xml/freebsd50.dtd"> - -book xmlns="http://docbook.org/ns/docbook" - xmlns:xlink="http://www.w3.org/1999/xlink" version="5.0" - xml:lang="en" - - info - titleAn Example Booktitle - - author - personname - firstnameYour first namefirstname - surnameYour surnamesurname - personname - - affiliation - address - emailfoo@example.comemail - address - affiliation - author - - copyright - year2000year - holderCopyright string hereholder - copyright - - abstract - paraIf your book has an abstract then it should go here.para - abstract - info - - preface - titlePrefacetitle - - paraYour book may have a preface, in which case it should be placed - here.para - preface - - chapter - titleMy First Chaptertitle - - paraThis is the first chapter in my book.para - - sect1 - titleMy First Sectiontitle - - paraThis is the first section in my book.para - sect1 - chapter -book - - - - - DocBook <tag>article</tag> - - - DocBook <tag>article</tag> - - <!DOCTYPE article PUBLIC "-//FreeBSD//DTD DocBook XML V5.0-Based Extension//EN" - "http://www.FreeBSD.org/XML/share/xml/freebsd50.dtd"> - -article xmlns="http://docbook.org/ns/docbook" - xmlns:xlink="http://www.w3.org/1999/xlink" version="5.0" - xml:lang="en" - - info - titleAn Example Articletitle - - author - personname - firstnameYour first namefirstname - surnameYour surnamesurname - personname - - affiliation - address - emailfoo@example.comemail - address - affiliation - author - - copyright - year2000year - holderCopyright string hereholder - copyright - - abstract - paraIf your article has an abstract then it should go here.para - abstract - info - - sect1 - titleMy First Sectiontitle - - paraThis is the first section in my article.para - - sect2 - titleMy First Sub-Sectiontitle - - paraThis is the first sub-section in my article.para - sect2 - sect1 -article - - - - - - -
diff --git a/zh_TW.UTF-8/books/fdp-primer/zh_TW.po b/zh_TW.UTF-8/books/fdp-primer/zh_TW.po deleted file mode 100644 index 23e0f5daa5..0000000000 --- a/zh_TW.UTF-8/books/fdp-primer/zh_TW.po +++ /dev/null @@ -1,12718 +0,0 @@ -# $FreeBSD$ -msgid "" -msgstr "" -"Project-Id-Version: \n" -"POT-Creation-Date: 2017-03-26 08:08+0800\n" -"PO-Revision-Date: 2017-03-26 23:25+0800\n" -"Last-Translator: Chien Wei Lin \n" -"Language-Team: Chinese \n" -"Language: zh_TW\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"Plural-Forms: nplurals=1; plural=0;\n" -"X-Generator: Poedit 1.8.12\n" - -#. Put one translator per line, in the form NAME , YEAR1, YEAR2 -msgctxt "_" -msgid "translator-credits" -msgstr "translator-credits" - -#. (itstool) path: info/title -#: book.translate.xml:62 -msgid "FreeBSD Documentation Project Primer for New Contributors" -msgstr "給新貢獻人員的 FreeBSD 說明文件計畫入門書" - -#. (itstool) path: info/author -#: book.translate.xml:66 -msgid "The FreeBSD Documentation Project" -msgstr "FreeBSD 說明文件計劃" - -#. (itstool) path: info/copyright -#: book.translate.xml:68 -msgid "" -"1998 1999 2000 2001 " -"2002 2003 2004 2005 " -"2006 2007 2008 2009 " -"2010 2011 2012 2013 " -"2014 DocEng" -msgstr "" -"1998 1999 2000 2001 " -"2002 2003 2004 2005 " -"2006 2007 2008 2009 " -"2010 2011 2012 2013 " -"2014 DocEng" - -#. (itstool) path: info/pubdate -#. (itstool) path: info/releaseinfo -#: book.translate.xml:89 book.translate.xml:91 -msgid "" -"$FreeBSD: head/en_US.ISO8859-1/books/fdp-primer/book.xml 47339 2015-09-02 " -"20:30:53Z wblock $" -msgstr "" - -#. (itstool) path: legalnotice/title -#: book.translate.xml:95 -msgid "Copyright" -msgstr "版權" - -#. (itstool) path: legalnotice/para -#: book.translate.xml:97 -msgid "" -"Redistribution and use in source (XML DocBook) and 'compiled' forms (XML, " -"HTML, PDF, PostScript, RTF and so forth) with or without modification, are " -"permitted provided that the following conditions are met:" -msgstr "" - -#. (itstool) path: listitem/para -#: book.translate.xml:104 -msgid "" -"Redistributions of source code (XML DocBook) must retain the above copyright " -"notice, this list of conditions and the following disclaimer as the first " -"lines of this file unmodified." -msgstr "" - -#. (itstool) path: listitem/para -#: book.translate.xml:110 -msgid "" -"Redistributions in compiled form (transformed to other DTDs, converted to " -"PDF, PostScript, RTF and other formats) must reproduce the above copyright " -"notice, this list of conditions and the following disclaimer in the " -"documentation and/or other materials provided with the distribution." -msgstr "" - -#. (itstool) path: important/para -#: book.translate.xml:119 -msgid "" -"THIS DOCUMENTATION IS PROVIDED BY THE FREEBSD DOCUMENTATION PROJECT \"AS IS" -"\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE " -"IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE " -"ARE DISCLAIMED. IN NO EVENT SHALL THE FREEBSD DOCUMENTATION PROJECT BE " -"LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR " -"CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF " -"SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS " -"INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN " -"CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) " -"ARISING IN ANY WAY OUT OF THE USE OF THIS DOCUMENTATION, EVEN IF ADVISED OF " -"THE POSSIBILITY OF SUCH DAMAGE." -msgstr "" - -#. (itstool) path: abstract/para -#: book.translate.xml:136 -msgid "" -"Thank you for becoming a part of the FreeBSD Documentation Project. Your " -"contribution is extremely valuable, and we appreciate it." -msgstr "感謝您參與 FreeBSD 說明文件計劃,您的點滴貢獻,都相當寶貴。" - -#. (itstool) path: abstract/para -#: book.translate.xml:140 -msgid "" -"This primer covers details needed to start contributing to the FreeBSD " -"Documentation Project, or FDP, including tools, software, " -"and the philosophy behind the Documentation Project." -msgstr "" -"本入手書內容包括:如何開始著手貢獻 FreeBSD 說明文件計劃 (FreeBSD " -"Documentation Project, FDP) 的各項細節,以及會用到的一些工" -"具、軟體,以及文件計畫的宗旨。" - -#. (itstool) path: abstract/para -#: book.translate.xml:146 -msgid "" -"This is a work in progress. Corrections and additions are always welcome." -msgstr "本入門書仍在持續撰寫中。任何修正或新增內容的建議都非常歡迎。" - -#. (itstool) path: preface/title -#: book.translate.xml:152 -msgid "Preface" -msgstr "序" - -#. (itstool) path: sect1/title -#: book.translate.xml:155 -msgid "Shell Prompts" -msgstr "Shell 提示符號" - -#. (itstool) path: sect1/para -#: book.translate.xml:157 -msgid "" -"This table shows the default system prompt and superuser prompt. The " -"examples use these prompts to indicate which type of user is running the " -"example." -msgstr "" -"下表顯示出一般使用者帳號與 root 的提示符號,在所有的文件例子中會用提示符號 " -"(Prompt),來提醒您該用哪種帳號才對。" - -#. (itstool) path: row/entry -#: book.translate.xml:165 -msgid "User" -msgstr "帳號" - -#. (itstool) path: row/entry -#: book.translate.xml:166 -msgid "Prompt" -msgstr "提示符號" - -#. (itstool) path: row/entry -#: book.translate.xml:172 -msgid "Normal user" -msgstr "一般使用者" - -#. (itstool) path: row/entry -#: book.translate.xml:173 book.translate.xml:4353 -msgid "%" -msgstr "%" - -#. (itstool) path: row/entry -#: book.translate.xml:177 -msgid "root" -msgstr "root" - -#. (itstool) path: row/entry -#: book.translate.xml:178 book.translate.xml:4346 -msgid "#" -msgstr "#" - -#. (itstool) path: sect1/title -#: book.translate.xml:186 -msgid "Typographic Conventions" -msgstr "書中所用的編排風格" - -#. (itstool) path: sect1/para -#: book.translate.xml:188 -msgid "This table describes the typographic conventions used in this book." -msgstr "下表為本書中所使用編排風格方式" - -#. (itstool) path: row/entry -#: book.translate.xml:195 -msgid "Meaning" -msgstr "代表意義" - -#. (itstool) path: row/entry -#. (itstool) path: sect2/title -#. (itstool) path: appendix/title -#: book.translate.xml:196 book.translate.xml:4853 book.translate.xml:9225 -msgid "Examples" -msgstr "範例" - -#. (itstool) path: row/entry -#: book.translate.xml:202 -msgid "The names of commands." -msgstr "指令" - -#. (itstool) path: row/entry -#: book.translate.xml:203 -msgid "Use ls -l to list all files." -msgstr "使用 ls -l 來列出所有的檔案。" - -#. (itstool) path: row/entry -#: book.translate.xml:208 -msgid "The names of files." -msgstr "檔名" - -#. (itstool) path: row/entry -#: book.translate.xml:209 -msgid "Edit .login." -msgstr "編輯 .login 。" - -#. (itstool) path: row/entry -#: book.translate.xml:213 -msgid "On-screen computer output." -msgstr "螢幕上會出現的訊息" - -#. (itstool) path: entry/screen -#: book.translate.xml:214 -#, no-wrap -msgid "You have mail." -msgstr "You have mail." - -#. (itstool) path: row/entry -#: book.translate.xml:218 -msgid "What the user types, contrasted with on-screen computer output." -msgstr "輸入指令後,螢幕上會出現的對應內容。" - -#. (itstool) path: entry/screen -#: book.translate.xml:221 -#, no-wrap -msgid "" -"% date +\"The time is %H:%M\"\n" -"The time is 09:18" -msgstr "" -"% date +\"The time is %H:%M\"\n" -"The time is 09:18" - -#. (itstool) path: row/entry -#: book.translate.xml:226 -msgid "Manual page references." -msgstr "要參考的線上手冊" - -#. (itstool) path: row/entry -#: book.translate.xml:227 -msgid "" -"Use su1 to change user identity." -msgstr "" -"使用 su1 來切換帳號。" - -#. (itstool) path: row/entry -#: book.translate.xml:231 -msgid "User and group names." -msgstr "使用者名稱和群組名稱" - -#. (itstool) path: row/entry -#: book.translate.xml:232 -msgid "Only root can do this." -msgstr "只有 root 才可以做這件事。" - -#. (itstool) path: row/entry -#: book.translate.xml:237 -msgid "Emphasis." -msgstr "語氣的強調。" - -#. (itstool) path: row/entry -#: book.translate.xml:238 -msgid "The user must do this." -msgstr "使用者必須這樣做" - -#. (itstool) path: row/entry -#: book.translate.xml:243 -msgid "Text that the user is expected to replace with the actual text." -msgstr "打指令時,可替換的部份" - -#. (itstool) path: row/entry -#: book.translate.xml:246 -msgid "" -"To search for a keyword in the manual pages, type man -k " -"keyword" -msgstr "" -"要搜尋線上手冊的關鍵字,請輸入 man -k 關鍵字" - -#. (itstool) path: row/entry -#: book.translate.xml:252 -msgid "Environment variables." -msgstr "環境變數。" - -#. (itstool) path: row/entry -#: book.translate.xml:253 -msgid "$HOME is set to the user's home directory." -msgstr "$HOME 是指帳號的家目錄所在處。" - -#. (itstool) path: sect1/title -#: book.translate.xml:262 -msgid "Notes, Tips, Important Information, Warnings, and Examples" -msgstr "注意、提示、重要、警告與範例" - -#. (itstool) path: sect1/para -#: book.translate.xml:265 -msgid "Notes, warnings, and examples appear within the text." -msgstr "出現在本文中的注意、警告、與範例。" - -#. (itstool) path: note/para -#: book.translate.xml:269 -msgid "" -"Notes are represented like this, and contain information to take note of, as " -"it may affect what the user does." -msgstr "" -"注意:表示需要注意的事項,其中包括您需要注意的事情,因為這些事情可能會影響到" -"操作結果。" - -#. (itstool) path: tip/para -#: book.translate.xml:275 -msgid "" -"Tips are represented like this, and contain information helpful to the user, " -"like showing an easier way to do something." -msgstr "提示:提供可能對您有用的資訊,例如簡化操作方式的技巧說明。" - -#. (itstool) path: important/para -#: book.translate.xml:281 -msgid "" -"Important information is represented like this. Typically, these show extra " -"steps the user may need to take." -msgstr "" -"重要:表示要特別注意的事情。一般來說,它們會包括操作指令時需要加的額外參數。" - -#. (itstool) path: warning/para -#: book.translate.xml:287 -msgid "" -"Warnings are represented like this, and contain information warning about " -"possible damage if the instructions are not followed. This damage may be " -"physical, to the hardware or the user, or it may be non-physical, such as " -"the inadvertent deletion of important files." -msgstr "" -"警告:表示警告事項,比如如果您不則可能導致的損失。這些損失可能是對您或硬體造" -"成實際傷害,也可能是無法估計的損害,例如一時疏忽而刪除重要檔案...。" - -#. (itstool) path: example/title -#: book.translate.xml:295 -msgid "A Sample Example" -msgstr "範例的範本" - -#. (itstool) path: example/para -#: book.translate.xml:297 -msgid "" -"Examples are represented like this, and typically contain examples showing a " -"walkthrough, or the results of a particular action." -msgstr "" -"這是舉例說明而已,通常包含應遵循的指令範例,或顯示某些特定動作所可能發生的結" -"果。" - -#. (itstool) path: sect1/title -#: book.translate.xml:304 -msgid "Acknowledgments" -msgstr "感謝" - -#. (itstool) path: sect1/para -#: book.translate.xml:306 -msgid "" -"My thanks to Sue Blake, Patrick Durusau, Jon Hamilton, Peter Flynn, and " -"Christopher Maden, who took the time to read early drafts of this document " -"and offer many valuable comments and criticisms." -msgstr "" -"在此要感謝 Sue Blake, Patrick Durusau, Jon Hamilton, Peter Flynn, " -"Christopher Maden 這些人的協助與閱讀初期草稿,並提供許多寶貴的潤稿意見與評" -"論。" - -#. (itstool) path: chapter/title -#. (itstool) path: sect1/title -#: book.translate.xml:346 book.translate.xml:2052 -msgid "Overview" -msgstr "概論" - -#. (itstool) path: chapter/para -#: book.translate.xml:348 -msgid "" -"Welcome to the FreeBSD Documentation Project (FDP). " -"Quality documentation is crucial to the success of FreeBSD, and we value " -"your contributions very highly." -msgstr "" -"歡迎參與 FreeBSD 說明文件計劃 (FreeBSD Documentation Project, FDP)。維持優秀質量的文件對 FreeBSD 的成功來說十分重要,您的點滴貢獻都是" -"十分寶貴的。" - -#. (itstool) path: chapter/para -#: book.translate.xml:353 -msgid "" -"This document describes how the FDP is organized, how to " -"write and submit documentation, and how to effectively use the available " -"tools." -msgstr "" -"本文件描述:『 FDP 的架構有哪些』、『如何撰寫並提交文" -"件』、 『如何有效運用工具來協助撰稿』。" - -#. (itstool) path: chapter/para -#: book.translate.xml:357 -msgid "" -"Everyone is welcome to contribute to the FDP. Willingness " -"to contribute is the only membership requirement." -msgstr "" -"歡迎大家對 FDP 做出貢獻。唯一的成員要求就有貢獻的意願。" - -#. (itstool) path: chapter/para -#: book.translate.xml:361 -msgid "This primer shows how to:" -msgstr "本入門書指出如何:" - -#. (itstool) path: listitem/para -#: book.translate.xml:365 -msgid "" -"Identify which parts of FreeBSD are maintained by the FDP." -msgstr "瞭解有哪些文件是由 FDP 所維護的。" - -#. (itstool) path: listitem/para -#: book.translate.xml:370 -msgid "Install the required documentation tools and files." -msgstr "安裝所需的說明文件工具和檔案。" - -#. (itstool) path: listitem/para -#: book.translate.xml:374 -msgid "Make changes to the documentation." -msgstr "修改說明文件。" - -#. (itstool) path: listitem/para -#: book.translate.xml:378 -msgid "" -"Submit changes back for review and inclusion in the FreeBSD documentation." -msgstr "提交修改以供審核並納入 FreeBSD 說明文件。" - -#. (itstool) path: sect1/title -#: book.translate.xml:384 book.translate.xml:7321 -msgid "Quick Start" -msgstr "快速上手" - -#. (itstool) path: sect1/para -#: book.translate.xml:386 -msgid "" -"Some preparatory steps must be taken before editing the FreeBSD " -"documentation. First, subscribe to the FreeBSD documentation project " -"mailing list. Some team members also interact on the " -"#bsddocs IRC channel on EFnet. These people can help with " -"questions or problems involving the documentation." -msgstr "" -"在編輯 FreeBSD 說明文件之前,有一些準備工作要做。首先,請訂閱 FreeBSD 文件計" -"劃郵件論壇。有些團隊成員也會出現在 EFnet 的#bsddocs IRC 頻道。這些人可以幫忙解決文件相關的問題。" - -#. (itstool) path: step/para -#: book.translate.xml:396 -msgid "" -"Install the textproc/docproj package or port. This meta-" -"port installs all of the software needed to edit and build FreeBSD " -"documentation." -msgstr "" -"安裝 textproc/docproj 套件或 Port。這個 meta-port 會安裝所" -"有編輯和建置 FreeBSD 說明文件需要的軟體。" - -#. (itstool) path: step/para -#: book.translate.xml:403 -msgid "" -"Install a local working copy of the documentation from the FreeBSD " -"repository in ~/doc (see )." -msgstr "" -"在 ~/doc 安裝 FreeBSD 說明文件檔案庫的本地端工作副本 (請" -"見 )。" - -#. (itstool) path: step/screen -#. (itstool) path: sect1/screen -#: book.translate.xml:408 book.translate.xml:798 -#, no-wrap -msgid "% svn checkout https://svn.FreeBSD.org/doc/head ~/doc" -msgstr "% svn checkout https://svn.FreeBSD.org/doc/head ~/doc" - -#. (itstool) path: step/para -#: book.translate.xml:412 -msgid "Configure the text editor:" -msgstr "設定文字編輯器:" - -#. (itstool) path: listitem/para -#: book.translate.xml:416 -msgid "Word wrap set to 70 characters." -msgstr "自動換行 (Word wrap) 設為 70 個字元。" - -#. (itstool) path: listitem/para -#: book.translate.xml:420 -msgid "Tab stops set to 2." -msgstr "Tab 定位點 (Tab stops) 設成 2。" - -#. (itstool) path: listitem/para -#: book.translate.xml:424 -msgid "Replace each group of 8 leading spaces with a single tab." -msgstr "將行首每 8 個空白取代成 1 個 Tab。" - -#. (itstool) path: step/para -#: book.translate.xml:429 -msgid "" -"Specific editor configurations are listed in ." -msgstr "特定編輯器的設定方式列於 。" - -#. (itstool) path: step/para -#: book.translate.xml:434 -msgid "Update the local working copy:" -msgstr "更新本地端工作副本" - -#. (itstool) path: step/screen -#: book.translate.xml:436 -#, no-wrap -msgid "% svn up ~/doc" -msgstr "% svn up ~/doc" - -#. (itstool) path: step/para -#: book.translate.xml:440 -msgid "" -"Edit the documentation files that require changes. If a file needs major " -"changes, consult the mailing list for input." -msgstr "" -"編輯需要修改的說明文件檔案。如果檔案需要大幅度的編修,請先諮詢郵件論壇。" - -#. (itstool) path: step/para -#: book.translate.xml:444 -msgid "" -"References to tag and entity usage can be found in and ." -msgstr "" -"標籤 (Tag) 和 Entity 的使用方式可以參考 和 " -"。" - -#. (itstool) path: step/para -#: book.translate.xml:450 -msgid "After editing, check for problems by running:" -msgstr "編輯完後,執行以下指令來檢查是否有問題:" - -#. (itstool) path: step/screen -#: book.translate.xml:452 -#, no-wrap -msgid "% igor -R filename.xml | less -RS" -msgstr "% igor -R filename.xml | less -RS" - -#. (itstool) path: step/para -#: book.translate.xml:454 -msgid "" -"Review the output and edit the file to fix any problems shown, then rerun " -"the command to find any remaining problems. Repeat until all of the errors " -"are resolved." -msgstr "" -"檢查輸出並重新編輯檔案來修正顯示的錯誤,然後重新執行指令來找出剩下的問題。重" -"複執行直到所有錯誤都解決完。" - -#. (itstool) path: step/para -#: book.translate.xml:461 -msgid "" -"Always build-test changes before submitting them. " -"Running make in the top-level directory of the " -"documentation being edited will generate that documentation in split HTML " -"format. For example, to build the English version of the Handbook in " -"HTML, run make in the en_US." -"ISO8859-1/books/handbook/ directory." -msgstr "" -"永遠要送出修正前請先做建置測試 (Build-test) 。在編輯的說" -"明文件目錄最頂層執行 make,將會產生分頁的 HTML 格式 " -"(Split HTML) 的文件。例如要建置 HTML 格式的英文版使用手" -"冊,請在 en_US.ISO8859-1/books/handbook/ 目錄執行 " -"make 。" - -#. (itstool) path: step/para -#: book.translate.xml:472 -msgid "" -"When changes are complete and tested, generate a diff file:" -msgstr "修改並測試完後,產生 diff 檔:" - -#. (itstool) path: step/screen -#: book.translate.xml:475 -#, no-wrap -msgid "" -"% cd ~/doc\n" -"% svn diff > bsdinstall.diff.txt" -msgstr "" -"% cd ~/doc\n" -"% svn diff > bsdinstall.diff.txt" - -#. (itstool) path: step/para -#: book.translate.xml:478 -msgid "" -"Give the diff file a descriptive name. In the example above, changes have " -"been made to the bsdinstall portion of the Handbook." -msgstr "" -"設一個可辨識的檔名。如上例中,是使用手冊的 bsdinstall 部" -"份的修改。" - -#. (itstool) path: step/para -#: book.translate.xml:485 -msgid "" -"Submit the diff file using the web-based Problem Report system. If " -"using the web form, enter a synopsis of [patch] short " -"description of problem. Select the category " -"docs and the class doc-bug. In the " -"body of the message, enter a short description of the changes and any " -"important details about them. Use the [ Browse... ] " -"button to attach the diff file." -msgstr "" -"使用網頁版 問題回報" -" 系統提交 diff 檔。如果使用網頁版,請輸入 [patch] " -"問題簡短描述 的概要 。選擇 " -"docs 分類和 doc-bug類別。在訊息的主體" -"中,輸入修正的簡短描述和其他相關的重要的細節。使用 [ Browse... ] 按鈕來附加 diff 檔。" - -#. (itstool) path: sect1/title -#: book.translate.xml:502 -msgid "The FreeBSD Documentation Set" -msgstr "FreeBSD 說明文件集" - -#. (itstool) path: sect1/para -#: book.translate.xml:504 -msgid "" -"The FDP is responsible for four categories of FreeBSD " -"documentation." -msgstr "FDP 負責四類 FreeBSD 說明文件。" - -#. (itstool) path: listitem/para -#: book.translate.xml:509 -msgid "" -"Handbook: The Handbook is the comprehensive online " -"resource and reference for FreeBSD users." -msgstr "" -"使用手冊 (Handbook):使用手冊主要是給 FreeBSD 使用者提供" -"詳盡的線上參考資料。" - -#. (itstool) path: listitem/para -#: book.translate.xml:515 -msgid "" -"FAQ: The FAQ uses a short question " -"and answer format to address questions that are frequently asked on the " -"various mailing lists and forums devoted to FreeBSD. This format does not " -"permit long and comprehensive answers." -msgstr "" -"常見問答集 (FAQ):主要是收集在各郵件論壇或論壇會常問到或" -"有可能會問到的 FreeBSD 相關問題與答案。(簡單講,就是『問答集』格式) 通常會擺" -"在這裡面的問答格式,不會放太長的詳細內容。" - -#. (itstool) path: listitem/para -#: book.translate.xml:523 -msgid "" -"Manual pages: The English language system manual pages " -"are usually not written by the FDP, as they are part of " -"the base system. However, the FDP can reword parts of " -"existing manual pages to make them clearer or to correct inaccuracies." -msgstr "" -"操作手冊 (Manual page):英文版的系統手冊並不是由 " -"FDP 所撰寫的,因為它們是屬於基礎系統 (Base system) 的部" -"份。然而,FDP 可以修改這些文件,來讓這些文件寫得更清楚,甚" -"至是勘正錯誤的地方。" - -#. (itstool) path: listitem/para -#: book.translate.xml:532 -msgid "" -"Web site: This is the main FreeBSD presence on the web, " -"visible at http://www." -"FreeBSD.org/ and many mirrors around the world. The web site is " -"typically a new user's first exposure to FreeBSD." -msgstr "" -"網站:這是 FreeBSD 在網路上的主要部份,位於 http://www.FreeBSD.org/ 以" -"及許多其他鏡像站 (Mirror)。這網站是許多人第一次接觸 FreeBSD 的地方" - -#. (itstool) path: sect1/para -#: book.translate.xml:539 -msgid "" -"Translation teams are responsible for translating the Handbook and web site " -"into different languages. Manual pages are not translated at present." -msgstr "翻譯團隊負責翻譯使用手冊和網站到不同的語言。線上手冊目前並未翻譯" - -#. (itstool) path: sect1/para -#: book.translate.xml:543 -msgid "" -"Documentation source for the FreeBSD web site, Handbook, and FAQ is available in the documentation repository at https://" -"svn.FreeBSD.org/doc/." -msgstr "" -"FreeBSD 網站、使用手冊、和 FAQ 的文件原始碼可以在 " -"https://svn.FreeBSD.org/doc/ 的文件檔案庫取得。" - -#. (itstool) path: sect1/para -#: book.translate.xml:548 -msgid "" -"Source for manual pages is available in a separate source repository located " -"at https://svn.FreeBSD.org/base/." -msgstr "" -"線上手冊的原始碼則是在 https://svn.FreeBSD.org/base/ 的原" -"始碼庫可以取得。" - -#. (itstool) path: sect1/para -#: book.translate.xml:552 -msgid "" -"Documentation commit messages are visible with svn log. " -"Commit messages are also archived at http://lists.FreeBSD.org/mailman/listinfo/" -"svn-doc-all." -msgstr "" -"說明文件提交訊息可以用 svn log 察看。提交訊息也會封存在 " -"http://lists.FreeBSD.org/mailman/listinfo/svn-doc-all。" - -#. (itstool) path: sect1/para -#: book.translate.xml:556 -msgid "" -"Web frontends to both of these repositories are available at and ." -msgstr "" -"這些儲存庫的網頁版位於 。" - -#. (itstool) path: sect1/para -#: book.translate.xml:558 -msgid "" -"Many people have written tutorials or how-to articles about FreeBSD. Some " -"are stored as part of the FDP files. In other cases, the " -"author has decided to keep the documentation separate. The FDP endeavors to provide links to as much of this external " -"documentation as possible." -msgstr "" -"許多人會寫 FreeBSD 的教學文件或是 how-to 文章。有些保存在 FDP 的檔案中。其他一些說明文件則是作者希望放在他處。FDP 會盡力提供這些說明文件的連結。" - -#. (itstool) path: chapter/title -#: book.translate.xml:600 -msgid "Tools" -msgstr "工具" - -#. (itstool) path: chapter/para -#: book.translate.xml:602 -msgid "" -"Several software tools are used to manage the FreeBSD documentation and " -"render it to different output formats. Some of these tools are required and " -"must be installed before working through the examples in the following " -"chapters. Some are optional, adding capabilities or making the job of " -"creating documentation less demanding." -msgstr "" -"有些工具軟體用來管理 FreeBSD 說明文件,並將他轉換成不同的輸出格式。有些則是在" -"使用接下來章節的範例之前一定要安裝。有些工具是選擇性安裝的,但是裝了之後會更" -"容易進行文件製作工作。" - -#. (itstool) path: sect1/title -#: book.translate.xml:610 -msgid "Required Tools" -msgstr "必備工具" - -#. (itstool) path: sect1/para -#: book.translate.xml:612 -msgid "" -"Install textproc/docproj from the Ports Collection. This " -"meta-port installs all the applications required to do " -"useful work with the FreeBSD documentation. Some further notes on particular " -"components are given below." -msgstr "" -"從 Port 套件集安裝 textproc/docproj。這個 meta-" -"port 會安裝處理 FreeBSD 說明文件需要的所有應用程式。以下列出特定元" -"件的進一步說明。" - -#. (itstool) path: sect2/title -#: book.translate.xml:620 -msgid "DTDs and Entities" -msgstr "DTDs 與 Entities" - -#. (itstool) path: sect2/para -#: book.translate.xml:623 -msgid "" -"FreeBSD documentation uses several Document Type Definitions (DTDs) and sets of XML entities. These are all " -"installed by the textproc/docproj port." -msgstr "" -"FreeBSD 說明文件使用幾種文件類型定義 (DTDs) 與 " -"XML entities 集合。這些都會經由 textproc/" -"docproj Port 來安裝。" - -#. (itstool) path: varlistentry/term -#: book.translate.xml:631 -msgid "" -"XHTML DTD (textproc/xhtml)" -msgstr "" -"XHTML DTD (textproc/xhtml)" - -#. (itstool) path: listitem/para -#: book.translate.xml:635 -msgid "" -"XHTML is the markup language of choice for the World Wide " -"Web, and is used throughout the FreeBSD web site." -msgstr "" -"XHTML 是全球資訊網的一種標記語言,也是整個 FreeBSD 網站所" -"使用的格式。" - -#. (itstool) path: varlistentry/term -#: book.translate.xml:642 -#, fuzzy -msgid "" -"DocBook DTD (textproc/docbook-xml)" -msgstr "" -"DocBook DTD (textproc/docbook-xml-450)" - -#. (itstool) path: listitem/para -#: book.translate.xml:645 -msgid "" -"DocBook is designed for marking up technical documentation. Most of the " -"FreeBSD documentation is written in DocBook." -msgstr "" -"DocBook 設計來製作技術說明文件的標記語言版本。FreeBSD 說明文件是以 DocBook 來" -"撰寫。" - -#. (itstool) path: varlistentry/term -#: book.translate.xml:652 -msgid "ISO 8879 entities (textproc/iso8879)" -msgstr "ISO 8879 entities (textproc/iso8879)" - -#. (itstool) path: listitem/para -#: book.translate.xml:656 -msgid "" -"Character entities from the ISO 8879:1986 standard used by many " -"DTDs. Includes named mathematical symbols, additional " -"characters in the Latin character set (accents, diacriticals, and so on), " -"and Greek symbols." -msgstr "" -"在 ISO 8879:1986 之中的 entity 被許多 DTD 所大量使用,包括" -"了數學符號、拉丁字母符號(尖重音等音節符號也是)以及希臘符號。" - -#. (itstool) path: sect1/title -#: book.translate.xml:668 -msgid "Optional Tools" -msgstr "選用工具" - -#. (itstool) path: sect1/para -#: book.translate.xml:670 -msgid "" -"These applications are not required, but can make working on the " -"documentation easier or add capabilities." -msgstr "以下應用程式並非必要,但有了可讓在說明文件的作業上更簡單或提升能力。" - -#. (itstool) path: sect2/title -#: book.translate.xml:674 -msgid "Software" -msgstr "軟體" - -#. (itstool) path: varlistentry/term -#: book.translate.xml:679 -msgid "Vim (editors/vim)" -msgstr "Vim (editors/vim)" - -#. (itstool) path: listitem/para -#: book.translate.xml:683 -msgid "" -"A popular editor for working with XML and derived " -"documents, like DocBook XML." -msgstr "" -"一個很受歡迎的編輯器,可以處理 XML 和他的衍生相關文件,例" -"如 DocBook XML。" - -#. (itstool) path: varlistentry/term -#: book.translate.xml:690 -msgid "" -"Emacs or XEmacs " -"(editors/emacs or editors/xemacs)" -msgstr "" -"EmacsXEmacs " -"(editors/emacseditors/xemacs)" - -#. (itstool) path: listitem/para -#: book.translate.xml:696 -msgid "" -"Both of these editors include a special mode for editing documents marked up " -"according to an XML DTD. This mode " -"includes commands to reduce the amount of typing needed, and help reduce the " -"possibility of errors." -msgstr "" -"這兩個編輯器都包含特別模式來編輯用 XML DTD 標記的文件。這個模式包含指令來減少打字量,並可以幫忙減少錯誤的發生。" - -#. (itstool) path: chapter/title -#: book.translate.xml:739 -msgid "The Working Copy" -msgstr "工作副本" - -#. (itstool) path: chapter/para -#: book.translate.xml:741 -msgid "" -"The working copy is a copy of the FreeBSD repository " -"documentation tree downloaded onto the local computer. Changes are made to " -"the local working copy, tested, and then submitted as patches to be " -"committed to the main repository." -msgstr "" -"工作副本 (Working copy) 指的是已下載到本地電腦的 " -"FreeBSD 說明文件樹檔案庫,所有對工作副本的更改會經過測試後再以修補檔 (Patch) " -"的格式提交到主要檔案庫。" - -#. (itstool) path: chapter/para -#: book.translate.xml:747 -msgid "" -"A full copy of the documentation tree can occupy 700 megabytes of disk " -"space. Allow for a full gigabyte of space to have room for temporary files " -"and test versions of various output formats." -msgstr "" -"完整的說明文件樹副本會佔據 700 MB 的磁碟空間,要有空間能夠儲存暫存檔及各種輸" -"出格式的測試版本需要 1 GB 的空間。" - -#. (itstool) path: chapter/para -#: book.translate.xml:752 -msgid "" -"Subversion is used to manage the " -"FreeBSD documentation files. It is installed by textproc/docproj as one of the required applications." -msgstr "" -"FreeBSD 說明文件檔案使用 Subversion 來管理,由於 Subversion 為 " -"textproc/docproj 的必要應用程式之一,所以會隨著 " -"textproc/docproj 一併安裝。" - -#. (itstool) path: sect1/title -#: book.translate.xml:758 -msgid "Documentation and Manual Pages" -msgstr "說明文件與操作手冊" - -#. (itstool) path: sect1/para -#: book.translate.xml:760 -msgid "" -"FreeBSD documentation is not just books and articles. Manual pages for all " -"the commands and configuration files are also part of the documentation, and " -"part of the FDP's territory. Two repositories are " -"involved: doc for the books and articles, and " -"base for the operating system and manual pages. To edit " -"manual pages, the base repository must be checked out " -"separately." -msgstr "" -"FreeBSD 說明文件不只有書籍與文章,還有所有指令與設定檔的操作手冊 (Manual " -"page) 也是文件的一部份,其中也有一部份是 FDP 的地盤。相關" -"的檔案庫有兩個:doc 中有書籍與文章,而 base 中有作業系統以及操作手冊。要編輯操作手冊則必須另外取出 (Checkout) " -"base 檔案庫。" - -#. (itstool) path: sect1/para -#: book.translate.xml:769 -msgid "" -"Repositories may contain multiple versions of documentation and source code. " -"New modifications are almost always made only to the latest version, called " -"head." -msgstr "" -"檔案庫中可能會含有數個版本的說明文件與原始碼。新的修改幾乎都只對最新版本 " -"head 做更新。" - -#. (itstool) path: sect1/title -#: book.translate.xml:775 -msgid "Choosing a Directory" -msgstr "選擇一個目錄" - -#. (itstool) path: sect1/para -#: book.translate.xml:777 -msgid "" -"FreeBSD documentation is traditionally stored in /usr/doc/, and system source code with manual pages in /usr/src/. These directory trees are relocatable, and users may want to put " -"the working copies in other locations to avoid interfering with existing " -"information in the main directories. The examples that follow use " -"~/doc and ~/src, both " -"subdirectories of the user's home directory." -msgstr "" -"FreeBSD 說明文件一般會儲存在 /usr/doc/,而系統原始碼及操" -"作手冊則會存在 /usr/src/。這些目錄樹可改放在其他地方,有" -"些使用者可能會為了避免與現有在主要目錄的資料搞混,把工作副本放在其他的地方。" -"以下的例子會放在 ~/doc 以及 ~/src " -"兩個在使用者家目錄下的目錄。" - -#. (itstool) path: sect1/title -#: book.translate.xml:790 -msgid "Checking Out a Copy" -msgstr "取出一份副本" - -#. (itstool) path: sect1/para -#: book.translate.xml:792 -msgid "" -"A download of a working copy from the repository is called a " -"checkout, and done with svn checkout. This example checks out a copy of the latest version " -"(head) of the main documentation tree:" -msgstr "" -"從檔案庫下載工作副本的動作稱作 取出 (Checkout),使用 " -"svn checkout 來完成。本範例會取出主要說明文件樹最新版本的" -"副本:" - -#. (itstool) path: sect1/para -#: book.translate.xml:800 -msgid "A checkout of the source code to work on manual pages is very similar:" -msgstr "取出原始碼編輯操作手冊的動作也很相似:" - -#. (itstool) path: sect1/screen -#: book.translate.xml:803 -#, no-wrap -msgid "% svn checkout https://svn.FreeBSD.org/base/head ~/src" -msgstr "" - -#. (itstool) path: sect1/title -#: book.translate.xml:807 -msgid "Updating a Working Copy" -msgstr "更新工作副本" - -#. (itstool) path: sect1/para -#: book.translate.xml:809 -msgid "" -"The documents and files in the FreeBSD repository change daily. People " -"modify files and commit changes frequently. Even a short time after an " -"initial checkout, there will already be differences between the local " -"working copy and the main FreeBSD repository. To update the local version " -"with the changes that have been made to the main repository, use " -"svn update on the directory containing the local working " -"copy:" -msgstr "" -"在 FreeBSD 檔案庫中的文件與檔案每天都會更改,人們會修改檔案與提交變更的頻率非" -"常快,即使取出 (Checkout) 只過小一段時間,本地的工作副本可能就與主要 FreeBSD " -"檔案庫有差異了。要更新本地版本以同步對主要檔案庫的變更可在有本地工作副本的目" -"錄下使用 svn update:" - -#. (itstool) path: sect1/screen -#: book.translate.xml:818 -#, no-wrap -msgid "% svn update ~/doc" -msgstr "% svn update ~/doc" - -#. (itstool) path: sect1/para -#: book.translate.xml:820 -msgid "" -"Get in the protective habit of using svn update before " -"editing document files. Someone else may have edited that file very " -"recently, and the local working copy will not include the latest changes " -"until it has been updated. Editing the newest version of a file is much " -"easier than trying to combine an older, edited local file with the newer " -"version from the repository." -msgstr "" -"養成良好的習慣在編輯文件檔前先執行 svn update,由於可能會" -"有其他人最近才編輯完該檔案,若未更新本地工作副則不會有最新變更的內容,比其還" -"要將舊版本地檔案與新版檔案庫檔案合併的動作來說,直接編輯最新版本的檔案要簡單" -"多了。" - -#. (itstool) path: sect1/title -#: book.translate.xml:830 -msgid "Reverting Changes" -msgstr "還原變更" - -#. (itstool) path: sect1/para -#: book.translate.xml:832 -msgid "" -"Sometimes it turns out that changes were not necessary after all, or the " -"writer just wants to start over. Files can be reset to their " -"unchanged form with svn revert. For example, to erase the " -"edits made to chapter.xml and reset it to unmodified " -"form:" -msgstr "" -"有時才做完的變更可能就變的不需要了,或者作者剛想要重新搛寫。檔案可使以使用 " -"svn revert重設成尚未被修改過的狀態,舉例" -"來說,要清除所有對 chapter.xml 的修改然後還原到未修改的" -"版本可:" - -#. (itstool) path: sect1/screen -#: book.translate.xml:839 -#, no-wrap -msgid "% svn revert chapter.xml" -msgstr "" - -#. (itstool) path: sect1/title -#: book.translate.xml:843 -msgid "Making a Diff" -msgstr "比對差異" - -#. (itstool) path: sect1/para -#: book.translate.xml:845 -msgid "" -"After edits to a file or group of files are completed, the differences " -"between the local working copy and the version on the FreeBSD repository " -"must be collected into a single file for submission. These diff files are produced by redirecting the output of svn diff into a file:" -msgstr "" -"在編輯一個檔案或數個檔案完成之後,需將本地工作副本與 FreeBSD 檔案庫的差異儲存" -"到一個檔案然後提交。這些 差異 (Diff) 檔可透過將 " -"svn diff 的輸出轉向到檔案來建立: " - -#. (itstool) path: sect1/screen -#: book.translate.xml:852 -#, no-wrap -msgid "" -"% cd ~/doc\n" -"% svn diff > doc-fix-spelling.diff" -msgstr "" - -#. (itstool) path: sect1/para -#: book.translate.xml:855 -msgid "" -"Give the file a meaningful name that identifies the contents. The example " -"above is for spelling fixes to the whole documentation tree." -msgstr "" -"給檔案取一個有意義的名字來辨識這次修改的內容,上述範例為例則是要修正整個說明" -"文件樹的拼寫。" - -#. (itstool) path: sect1/para -#: book.translate.xml:859 -msgid "" -"If the diff file is to be submitted with the web Submit a FreeBSD problem " -"report interface, add a .txt extension " -"to give the earnest and simple-minded web form a clue that the contents are " -"plain text." -msgstr "" -"若 diff 檔要使用網站的 Submit a FreeBSD problem report 介面" -"來提交,請加上 .txt 副檔名來給認真又單純的網頁表單可以辨" -"識其內容為純文字的線索。" - -#. (itstool) path: sect1/para -#: book.translate.xml:866 -msgid "" -"Be careful: svn diff includes all changes made in the " -"current directory and any subdirectories. If there are files in the working " -"copy with edits that are not ready to be submitted yet, provide a list of " -"only the files that are to be included:" -msgstr "" -"請小心:svn diff 會產生所有在目前目錄及其子目錄的變更差" -"異,若在該工作副本中有已經編輯過的檔案還沒有要提交,請列出需要比較差異的檔案" -"清單:" - -#. (itstool) path: sect1/screen -#: book.translate.xml:872 -#, no-wrap -msgid "" -"% cd ~/doc\n" -"% svn diff disks/chapter.xml printers/chapter.xml > disks-printers.diff" -msgstr "" - -#. (itstool) path: sect1/title -#: book.translate.xml:877 -msgid "Subversion References" -msgstr "Subversion 參考文獻" - -#. (itstool) path: sect1/para -#: book.translate.xml:879 -msgid "" -"These examples show very basic usage of Subversion. More detail is available in the Subversion Book and the Subversion documentation." -msgstr "" -"以下範例會示範 Subversion 的基本用法,要取得更多資" -"訊可至 Subversion BookSubversion " -"說明文件。" - -#. (itstool) path: chapter/title -#: book.translate.xml:920 -msgid "Documentation Directory Structure" -msgstr "說明文件目錄結構" - -#. (itstool) path: chapter/para -#: book.translate.xml:922 -msgid "" -"Files and directories in the doc/ tree follow a " -"structure meant to:" -msgstr "在 doc/ 樹中的檔案與目錄需要遵守特定結構是因為:" - -#. (itstool) path: listitem/para -#: book.translate.xml:928 -msgid "Make it easy to automate converting the document to other formats." -msgstr "讓自動轉換說明文件到各種格式更簡單。" - -#. (itstool) path: listitem/para -#: book.translate.xml:933 -msgid "" -"Promote consistency between the different documentation organizations, to " -"make it easier to switch between working on different documents." -msgstr "促進不同說明文件組織之間的一致性,以便更輕鬆的在不同說明文件之間切換。" - -#. (itstool) path: listitem/para -#: book.translate.xml:939 -msgid "" -"Make it easy to decide where in the tree new documentation should be placed." -msgstr "可以很容易的決定新的說明文件應該放在文件樹中的哪個位置。" - -#. (itstool) path: chapter/para -#: book.translate.xml:944 -msgid "" -"In addition, the documentation tree must accommodate documents in many " -"different languages and encodings. It is important that the documentation " -"tree structure does not enforce any particular defaults or cultural " -"preferences." -msgstr "" -"除此之外,說明文件樹必須能容納各種不同語言與編碼的說明文件。很重要的一點是," -"說明文件樹結構不應強制任何特定默認或文化的偏好。" - -#. (itstool) path: sect1/title -#: book.translate.xml:950 -msgid "The Top Level, doc/" -msgstr "最上層,doc/" - -#. (itstool) path: sect1/para -#: book.translate.xml:953 -msgid "" -"There are two types of directory under doc/, each with " -"very specific directory names and meanings." -msgstr "" -"在 doc/ 底下有兩種類型的目錄,兩種都有非常明確的目錄名稱" -"與意義。" - -#. (itstool) path: row/entry -#: book.translate.xml:961 book.translate.xml:1015 -msgid "Directory" -msgstr "目錄" - -#. (itstool) path: row/entry -#: book.translate.xml:962 book.translate.xml:1016 -msgid "Usage" -msgstr "用途" - -#. (itstool) path: row/entry -#: book.translate.xml:968 -msgid "share" -msgstr "" - -#. (itstool) path: row/entry -#: book.translate.xml:971 -msgid "" -"Contains files that are not specific to the various translations and " -"encodings of the documentation. Contains subdirectories to further " -"categorize the information. For example, the files that comprise the " -"make1 infrastructure are in share/mk, while the " -"additional XML support files (such as the FreeBSD " -"extended DocBook DTD) are in share/xml." -msgstr "" -"含有未特定用於各說明文件翻譯與編碼的檔案。其子目錄更進一步將不同資訊的分類," -"例如,構成 make1 基礎設施的檔案放置於 share/mk,而額外的 XML 支援檔 (如 FreeBSD 延伸的 DocBook " -"DTD) 則放在 share/xml。" - -#. (itstool) path: row/entry -#: book.translate.xml:983 -msgid "" -"lang.encoding" -msgstr "" - -#. (itstool) path: row/entry -#: book.translate.xml:986 -msgid "" -"One directory exists for each available translation and encoding of the " -"documentation, for example en_US.ISO8859-1/ and " -"zh_TW.UTF-8/. The names are long, but by fully " -"specifying the language and encoding we prevent any future headaches when a " -"translation team wants to provide documentation in the same language but in " -"more than one encoding. This also avoids problems that might be caused by a " -"future switch to Unicode." -msgstr "" -"每一個目錄代表可用的說明文件翻譯與編碼,例如 en_US.ISO8859-1/zh_TW.UTF-8/。名稱雖然長,但完整表達語言與" -"編碼可以避免未來當一個翻譯團隊要以不同編碼提供同一個語言的說明文件造成的問" -"題,這也同時避免往後要切換成萬國碼 (Unicode) 可能造成的問題。" - -#. (itstool) path: sect1/title -#: book.translate.xml:1003 -msgid "" -"The lang.encoding/ Directories" -msgstr "" -"lang.encoding/ 目錄" - -#. (itstool) path: sect1/para -#: book.translate.xml:1007 -msgid "" -"These directories contain the documents themselves. The documentation is " -"split into up to three more categories at this level, indicated by the " -"different directory names." -msgstr "" -"這些目錄中含有說明文件。在此階層說明文件分成三個分類,使用不同的目錄名稱來代" -"表。" - -#. (itstool) path: row/entry -#: book.translate.xml:1022 -msgid "articles" -msgstr "" - -#. (itstool) path: row/entry -#: book.translate.xml:1025 -msgid "" -"Documentation marked up as a DocBook article (or equivalent). " -"Reasonably short, and broken up into sections. Normally only available as " -"one XHTML file." -msgstr "" -"以 DocBook article (或同等級) 標記的說明文件。非常短,且會分成幾個" -"小節,通常取得時只會有一個 XHTML 檔案。" - -#. (itstool) path: row/entry -#: book.translate.xml:1032 -msgid "books" -msgstr "" - -#. (itstool) path: row/entry -#: book.translate.xml:1034 -msgid "" -"Documentation marked up as a DocBook book (or equivalent). Book " -"length, and broken up into chapters. Normally available as both one large " -"XHTML file (for people with fast connections, or who want " -"to print it easily from a browser) and as a collection of linked, smaller " -"files." -msgstr "" -"以 DocBook book (或同等級) 標記的說明文件。有跟書籍一樣的長度,會" -"分成數個章。通常取得時會包含一個大型的 XHTML 檔 (供有較快" -"連線速度的人使用,或者那些想直接在瀏覽器列印的人) 與數個連結的較小的檔案。" - -#. (itstool) path: row/entry -#: book.translate.xml:1044 -msgid "man" -msgstr "" - -#. (itstool) path: row/entry -#: book.translate.xml:1047 -msgid "" -"For translations of the system manual pages. This directory will contain one " -"or more mann directories, corresponding to the sections that have been " -"translated." -msgstr "" -"供系統操作手冊 (Manual page) 翻譯使用。這個目錄會包含一個或多個 mann 目錄來對應已經" -"翻譯的章節。" - -#. (itstool) path: sect1/para -#: book.translate.xml:1056 -msgid "" -"Not every lang." -"encoding directory will have all of " -"these subdirectories. It depends on how much translation has been " -"accomplished by that translation team." -msgstr "" -"並非所有 lang." -"encoding 的目錄都會有這些子目錄,這要看" -"該翻譯團隊已經完成了多少翻譯來決定。" - -#. (itstool) path: sect1/title -#: book.translate.xml:1063 -msgid "Document-Specific Information" -msgstr "文件特定資訊" - -#. (itstool) path: sect1/para -#: book.translate.xml:1065 -msgid "" -"This section contains specific notes about particular documents managed by " -"the FDP." -msgstr "本節內含有關由 FDP 所管理的特定文件的特定注意事項。" - -#. (itstool) path: sect2/title -#: book.translate.xml:1069 -msgid "The Handbook" -msgstr "使用手冊 (Handbook)" - -#. (itstool) path: sect2/subtitle -#: book.translate.xml:1071 -msgid "books/handbook/" -msgstr "" - -#. (itstool) path: sect2/para -#: book.translate.xml:1073 -msgid "" -"The Handbook is written in DocBook XML using the FreeBSD " -"DocBook extended DTD." -msgstr "" -"操作手冊是以使用 FreeBSD DocBook 擴充 DTD 的 DocBook " -"XML 所撰寫。" - -#. (itstool) path: sect2/para -#: book.translate.xml:1076 -msgid "" -"The Handbook is organized as a DocBook book. The book is divided " -"into parts, each of which contains several chapters. " -"chapters are further subdivided into sections (sect1) " -"and subsections (sect2, sect3) and so on." -msgstr "" -"使用手冊使用 DocBook book 來組織,整個手冊區分成數個部份 " -"(part),每個部份中內含數個章 (chapter),而章 " -"(chapter) 又更進一步的細分成數個節 (sect1) 與小節 " -"(sect2, sect3) 以此類推。" - -#. (itstool) path: sect3/title -#: book.translate.xml:1085 -msgid "Physical Organization" -msgstr "實體組織結構" - -#. (itstool) path: sect3/para -#: book.translate.xml:1087 -msgid "" -"There are a number of files and directories within the handbook directory." -msgstr "在 handbook 目錄中有數個檔案及目錄。" - -#. (itstool) path: note/para -#: book.translate.xml:1091 -msgid "" -"The Handbook's organization may change over time, and this document may lag " -"in detailing the organizational changes. Post questions about Handbook " -"organization to the FreeBSD documentation project mailing list." -msgstr "" -"使用手冊的組織結構可能會隨時改變,本文件所詳述的組織結構可能會與現況不盡相" -"同。有關使用手冊組織結構的問題可張貼到 FreeBSD documentation project " -"mailing list。" - -#. (itstool) path: sect4/title -#: book.translate.xml:1098 -msgid "Makefile" -msgstr "" - -#. (itstool) path: sect4/para -#: book.translate.xml:1100 -msgid "" -"The Makefile defines some variables that affect how the " -"XML source is converted to other formats, and lists the " -"various source files that make up the Handbook. It then includes the " -"standard doc.project.mk, to bring in the rest of the " -"code that handles converting documents from one format to another." -msgstr "" -"Makefile 定義了一些會影響 XML 原始碼" -"要如何轉換至其他格式的變數,並列出產生使用手冊所需的各原始檔,接著會引用可處" -"理在各種文件格式轉換的標準 doc.project.mk 程式碼。" - -#. (itstool) path: sect4/title -#: book.translate.xml:1110 -msgid "book.xml" -msgstr "" - -#. (itstool) path: sect4/para -#: book.translate.xml:1112 -msgid "" -"This is the top level document in the Handbook. It contains the Handbook's " -"DOCTYPE declaration, " -"as well as the elements that describe the Handbook's structure." -msgstr "" -"此為使用手冊的最上層文件,其中包含了使用手冊的 DOCTYPE 宣告以及用來描述使用手冊結構的元素。" - -#. (itstool) path: sect4/para -#: book.translate.xml:1117 -msgid "" -"book.xml uses parameter entities to load in the files with the " -".ent extension. These files (described later) then " -"define general entities " -"that are used throughout the rest of the Handbook." -msgstr "" -"book.xml 會使用 參數 Entities 來載入 .ent 副檔名的檔" -"案。這些檔案 (稍後會詳述) 接著會定義使用手冊剩下篇幅會使用的 一般 Entities。" - -#. (itstool) path: sect4/title -#: book.translate.xml:1126 -msgid "" -"directory/chapter." -"xml" -msgstr "" - -#. (itstool) path: sect4/para -#: book.translate.xml:1128 -msgid "" -"Each chapter in the Handbook is stored in a file called chapter." -"xml in a separate directory from the other chapters. Each " -"directory is named after the value of the id attribute on " -"the chapter element." -msgstr "" -"每個在使用手冊的章會儲存成名稱為 chapter.xml 的檔案,分" -"別放在不同的目錄中。每個目錄均是以在 chapter 元素中 id 屬性中的值來命名。" - -#. (itstool) path: sect4/para -#: book.translate.xml:1135 -msgid "For example, if one of the chapter files contains:" -msgstr "例如,若有一章的檔案內容為:" - -#. (itstool) path: sect4/programlisting -#: book.translate.xml:1138 -#, no-wrap -msgid "" -"chapter id=\"kernelconfig\"\n" -"...\n" -"chapter" -msgstr "" - -#. (itstool) path: sect4/para -#: book.translate.xml:1142 -msgid "" -"Then it will be called chapter.xml in the " -"kernelconfig directory. In general, the entire contents " -"of the chapter are in this one file." -msgstr "" -"那麼放置這個 chapter.xml 的目錄則會命名為 " -"kernelconfig。一般來說一章的所有內容會存放在這一個檔案。" - -#. (itstool) path: sect4/para -#: book.translate.xml:1148 -msgid "" -"When the XHTML version of the Handbook is produced, this " -"will yield kernelconfig.html. This is because of the " -"id value, and is not related to the name of the directory." -msgstr "" -"當有 XHTML 版本的使用手冊之後,會用該檔產出 " -"kernelconfig.html,而這個名稱也是根據 id 的值而定,與目錄名稱無關。" - -#. (itstool) path: sect4/para -#: book.translate.xml:1154 -msgid "" -"In earlier versions of the Handbook, the files were stored in the same " -"directory as book.xml, and named after the value of the " -"id attribute on the file's chapter element. " -"Now, it is possible to include images in each chapter. Images for each " -"Handbook chapter are stored within share/images/books/handbook. The localized version of these images should be placed in the " -"same directory as the XML sources for each chapter. " -"Namespace collisions are inevitable, and it is easier to work with several " -"directories with a few files in them than it is to work with one directory " -"that has many files in it." -msgstr "" -"在早期版本的使用手冊,檔案皆儲存在與 book.xml 相同的目錄" -"中,而名稱會以 chapter 元素中的 id 屬性的值來命" -"名。現在可在每個章節之中引用圖片,每個使用手冊章節的圖片會儲存在 " -"share/images/books/handbook,而在地化版本的圖片應放在與" -"每個章節 XML 原始碼相同的目錄。命名空間會衝突是必然的,但" -"以目錄多、檔案少與目錄少、檔案多的結構相比,目錄多、檔案少會較容易處理命名空" -"間衝突的問題。" - -#. (itstool) path: sect4/para -#: book.translate.xml:1168 -msgid "" -"A brief look will show that there are many directories with individual " -"chapter.xml files, including basics/chapter." -"xml, introduction/chapter.xml, and " -"printing/chapter.xml." -msgstr "" -"簡單來說會有很多個內含 chapter.xml 檔案的目錄,例如 " -"basics/chapter.xml, introduction/chapter.xml 以及 printing/chapter.xml。" - -#. (itstool) path: important/para -#: book.translate.xml:1175 -msgid "" -"Do not name chapters or directories after their ordering within the " -"Handbook. This ordering can change as the content within the Handbook is " -"reorganized. Reorganization should be possible without renaming files, " -"unless entire chapters are being promoted or demoted within the hierarchy." -msgstr "" -"請勿以在使用手冊中的章節順序來命名章節或目錄,因為順序是會隨使用手冊重新組織" -"後的內容改變的。重新組織結構應不需要去重新命名檔案,除非整個章節的階層被提升" -"或下降。" - -#. (itstool) path: sect4/para -#: book.translate.xml:1183 -msgid "" -"The chapter.xml files are not complete XML documents that can be built individually. They can only be built as " -"parts of the whole Handbook." -msgstr "" -"chapter.xml 檔案並不是可以被單獨建置的完整 " -"XML 文件,只能結合成整本使用手冊之後再一併建置。" - -#. (itstool) path: chapter/title -#: book.translate.xml:1226 -msgid "The Documentation Build Process" -msgstr "說明文件建置流程" - -#. (itstool) path: chapter/para -#: book.translate.xml:1228 -msgid "" -"This chapter covers organization of the documentation build process and how " -"make1 is used to control it." -msgstr "" -"本章內容涵蓋了說明文件建置流程以及如何使用 " -"make1 來控制如何建置。" - -#. (itstool) path: sect1/title -#: book.translate.xml:1232 -msgid "Rendering DocBook into Output" -msgstr "繪製 Docbook 為其他格式" - -#. (itstool) path: sect1/para -#: book.translate.xml:1234 -msgid "" -"Different types of output can be produced from a single DocBook source file. " -"The type of output desired is set with the FORMATS " -"variable. A list of known formats is stored in KNOWN_FORMATS:" -msgstr "" -"從單一個 DocBook 原始檔可以產生各種不同類型的輸出,想要輸出的類型可用 " -"FORMATS 變數來設定。已知的格式清單列在 " -"KNOWN_FORMATS 中:" - -#. (itstool) path: sect1/screen -#. (itstool) id: book.translate.xml#doc-build-rendering-known-formats -#: book.translate.xml:1239 -#, no-wrap -msgid "" -"% cd ~/doc/en_US.ISO8859-1/books/handbook\n" -"% make -V KNOWN_FORMATS" -msgstr "" - -#. (itstool) path: table/title -#: book.translate.xml:1243 -msgid "Common Output Formats" -msgstr "常見輸出格式" - -#. (itstool) path: row/entry -#: book.translate.xml:1248 -msgid "FORMATS Value" -msgstr "FORMATS 值" - -#. (itstool) path: row/entry -#: book.translate.xml:1249 -msgid "File Type" -msgstr "檔案類型" - -#. (itstool) path: row/entry -#. (itstool) path: segmentedlist/segtitle -#: book.translate.xml:1250 book.translate.xml:7206 -msgid "Description" -msgstr "說明" - -#. (itstool) path: row/entry -#. (itstool) path: varlistentry/term -#: book.translate.xml:1256 book.translate.xml:2485 -msgid "html" -msgstr "" - -#. (itstool) path: row/entry -#: book.translate.xml:1257 -msgid "HTML, one file" -msgstr "HTML,單檔" - -#. (itstool) path: row/entry -#: book.translate.xml:1258 -msgid "" -"A single book.html or article.html." -msgstr "" -"單一 book.htmlarticle.html。" - -#. (itstool) path: row/entry -#: book.translate.xml:1263 -msgid "html-split" -msgstr "" - -#. (itstool) path: row/entry -#: book.translate.xml:1264 -msgid "HTML, multiple files" -msgstr "HTML,多檔" - -#. (itstool) path: row/entry -#: book.translate.xml:1265 -msgid "" -"Multiple HTML files, one for each chapter or section, for " -"use on a typical web site." -msgstr "" -"多個 HTML 檔案,每個章或節一個檔案,供一般網站使用。" - -#. (itstool) path: row/entry -#: book.translate.xml:1271 -msgid "pdf" -msgstr "" - -#. (itstool) path: row/entry -#: book.translate.xml:1272 -msgid "PDF" -msgstr "" - -#. (itstool) path: row/entry -#: book.translate.xml:1273 -msgid "Portable Document Format" -msgstr "可攜的文件格式" - -#. (itstool) path: sect1/para -#: book.translate.xml:1279 -msgid "" -"The default output format can vary by document, but is usually html-" -"split. Other formats are chosen by setting FORMATS to a specific value. Multiple output formats can be created at a " -"single time by setting FORMATS to a list of formats." -msgstr "" -"預設輸出的格式會依文件而有所不同,但同常是 html-split。其" -"他格式可設定 FORMATS 為特定值來選擇。在 FORMATS 設定所需格式的清單可一次輸出多個格式。" - -#. (itstool) path: example/title -#: book.translate.xml:1286 -msgid "Build a Single HTML Output File" -msgstr "建置單頁 HTML 輸出檔" - -#. (itstool) path: example/screen -#: book.translate.xml:1288 -#, no-wrap -msgid "" -"% cd ~/doc/en_US.ISO8859-1/books/handbook\n" -"% make FORMATS=html" -msgstr "" - -#. (itstool) path: example/title -#: book.translate.xml:1293 -msgid "Build HTML-Split and PDF Output Files" -msgstr "建置分頁 HTML 及 PDF 輸出檔" - -#. (itstool) path: example/screen -#: book.translate.xml:1296 -#, no-wrap -msgid "" -"% cd ~/doc/en_US.ISO8859-1/books/handbook\n" -"% make FORMATS=\"html-split pdf\"" -msgstr "" - -#. (itstool) path: sect1/title -#: book.translate.xml:1302 -msgid "The FreeBSD Documentation Build Toolset" -msgstr "FreeBSD 說明文件建置工具集" - -#. (itstool) path: sect1/para -#: book.translate.xml:1304 -msgid "" -"These are the tools used to build and install the FDP " -"documentation." -msgstr "建置與安裝 FDP 說明文件會使用到以下工具。" - -#. (itstool) path: listitem/para -#: book.translate.xml:1309 -msgid "" -"The primary build tool is make1, specifically " -"Berkeley Make." -msgstr "" -"主要的建置工具為 make1,特別是 " -"Berkeley Make。" - -#. (itstool) path: listitem/para -#: book.translate.xml:1314 -msgid "" -"Package building is handled by FreeBSD's pkg-" -"create8." -msgstr "" -"套件建置會使用 FreeBSD 的 pkg-create8 來處理。" - -#. (itstool) path: listitem/para -#: book.translate.xml:1319 -msgid "" -"gzip1 is used to create compressed versions of the document. " -"bzip21 archives are also supported. tar1 is used for package " -"building." -msgstr "" -"gzip1 用來建立壓縮版的文件,也支援 " -"bzip21 封存。tar1 則用在套件建置。" - -#. (itstool) path: listitem/para -#: book.translate.xml:1325 -msgid "" -"install1 is used to install the documentation." -msgstr "" -"install1 用來安裝說明文件。" - -#. (itstool) path: sect1/title -#: book.translate.xml:1333 -msgid "Understanding Makefiles in the Documentation Tree" -msgstr "了解在說明文件樹中的 Makefile" - -#. (itstool) path: sect1/para -#: book.translate.xml:1336 -msgid "" -"There are three main types of Makefiles in the FreeBSD " -"Documentation Project tree." -msgstr "" -"在 FreeBSD 說明文件計劃樹底下的 Makefile 主要有三個類" -"型。" - -#. (itstool) path: listitem/para -#: book.translate.xml:1341 -msgid "" -"Subdirectory Makefiles simply pass commands to those directories below them." -msgstr "" -"子目錄的 Makefile 傳遞" -"指令給在其所在目錄底下的目錄。" - -#. (itstool) path: listitem/para -#: book.translate.xml:1347 -msgid "" -"Documentation Makefiles describe the documents that are produced from this directory." -msgstr "" -"說明文件的 Makefiles " -"用來描述要如何在其所在目錄產生文件。" - -#. (itstool) path: listitem/para -#: book.translate.xml:1354 -msgid "" -"Make includes are the glue that perform the document production, and are usually of " -"the form doc.xxx.mk." -msgstr "" -"Make 引用檔 會連結一些產生文件所需的程式,通常為 doc.xxx.mk。" - -#. (itstool) path: sect2/title -#: book.translate.xml:1362 -msgid "Subdirectory Makefiles" -msgstr "子目錄的 Makefile" - -#. (itstool) path: sect2/para -#: book.translate.xml:1364 -msgid "These Makefiles usually take the form of:" -msgstr "這種 Makefile 通常採用的格式為:" - -#. (itstool) path: sect2/programlisting -#: book.translate.xml:1367 -#, no-wrap -msgid "" -"SUBDIR =articles\n" -"SUBDIR+=books\n" -"\n" -"COMPAT_SYMLINK = en\n" -"\n" -"DOC_PREFIX?= ${.CURDIR}/..\n" -".include \"${DOC_PREFIX}/share/mk/doc.project.mk\"" -msgstr "" - -#. (itstool) path: sect2/para -#: book.translate.xml:1375 -msgid "" -"The first four non-empty lines define the make1 variables " -"SUBDIR, COMPAT_SYMLINK, and " -"DOC_PREFIX." -msgstr "" -"前四行非空白的行用來定義 make1 的變數 " -"SUBDIR, COMPAT_SYMLINK 及 " -"DOC_PREFIX。" - -#. (itstool) path: sect2/para -#: book.translate.xml:1380 -msgid "" -"The SUBDIR statement and COMPAT_SYMLINK statement show how to assign a value to a variable, overriding any " -"previous value." -msgstr "" -"SUBDIR 敘述與 COMPAT_SYMLINK 敘述示範了" -"如何指派數值到一個變數,覆蓋先前的值。" - -#. (itstool) path: sect2/para -#: book.translate.xml:1385 -msgid "" -"The second SUBDIR statement shows how a value is appended " -"to the current value of a variable. The SUBDIR variable " -"is now articles books." -msgstr "" -"SUBDIR 的第二行敘述示範如何將數值附加到目前的變數值之後," -"SUBDIR 變數現在變成了 articles books。" - -#. (itstool) path: sect2/para -#: book.translate.xml:1390 -msgid "" -"The DOC_PREFIX assignment shows how a value is assigned " -"to the variable, but only if it is not already defined. This is useful if " -"DOC_PREFIX is not where this Makefile thinks it is - the user can override this and provide the correct " -"value." -msgstr "" -"DOC_PREFIX 指派式示範了如何只在變數尚未定義時才指派數值給" -"變數。這個功能在當 DOC_PREFIX 不在 Makefile 所認為的地方時,使用者可以覆蓋這個值,並提供正確的值。" - -#. (itstool) path: sect2/para -#: book.translate.xml:1397 -msgid "" -"What does it all mean? SUBDIR mentions which " -"subdirectories below this one the build process should pass any work on to." -msgstr "" -"這所有的敘述實際代表什麼意思呢? SUBDIR 會列出接下來建置流" -"程應傳遞作業到那些子目錄。" - -#. (itstool) path: sect2/para -#: book.translate.xml:1401 -msgid "" -"COMPAT_SYMLINK is specific to compatibility symlinks " -"(amazingly enough) for languages to their official encoding (doc/" -"en would point to en_US.ISO-8859-1)." -msgstr "" -"COMPAT_SYMLINK 是一個用來指定語言官方編碼的相容性符號連結 " -"(doc/en 會指向 en_US.ISO-8859-1)。" - -#. (itstool) path: sect2/para -#: book.translate.xml:1406 -msgid "" -"DOC_PREFIX is the path to the root of the FreeBSD " -"Document Project tree. This is not always that easy to find, and is also " -"easily overridden, to allow for flexibility. .CURDIR is a " -"make1 builtin variable with the path to the current directory." -msgstr "" -"DOC_PREFIX 是到 FreeBSD 說明文件計劃樹根目錄的路徑。這並非" -"每一次都可以很輕易找到,為了增加彈性,要改寫也很簡單。.CURDIR 是一個 make1 內建的變數,代表目前目" -"錄的路徑。" - -#. (itstool) path: sect2/para -#: book.translate.xml:1413 -msgid "" -"The final line includes the FreeBSD Documentation Project's project-wide " -"make1 system file doc.project.mk which is the " -"glue which converts these variables into build instructions." -msgstr "" -"最後一行會引用 FreeBSD 說明文件計劃的全專案 " -"make1 系統檔 doc.project.mk,用來轉換這些變數成" -"為建置的指令。" - -#. (itstool) path: sect2/title -#: book.translate.xml:1420 -msgid "Documentation Makefiles" -msgstr "說明文件的 Makefile" - -#. (itstool) path: sect2/para -#: book.translate.xml:1422 -msgid "" -"These Makefiles set make1 variables that " -"describe how to build the documentation contained in that directory." -msgstr "" -"這些 Makefile 用來設定 " -"make1 變數來描述要如何建置在該目錄中的說明文件。" - -#. (itstool) path: sect2/para -#: book.translate.xml:1426 -msgid "Here is an example:" -msgstr "這裡有一個例子:" - -#. (itstool) path: sect2/programlisting -#: book.translate.xml:1428 -#, no-wrap -msgid "" -"MAINTAINER=nik@FreeBSD.org\n" -"\n" -"DOC?= book\n" -"\n" -"FORMATS?= html-split html\n" -"\n" -"INSTALL_COMPRESSED?= gz\n" -"INSTALL_ONLY_COMPRESSED?=\n" -"\n" -"# SGML content\n" -"SRCS= book.xml\n" -"\n" -"DOC_PREFIX?= ${.CURDIR}/../../..\n" -"\n" -".include \"$(DOC_PREFIX)/share/mk/docproj.docbook.mk\"" -msgstr "" - -#. (itstool) path: sect2/para -#: book.translate.xml:1444 -msgid "" -"The MAINTAINER variable allows committers to claim " -"ownership of a document in the FreeBSD Documentation Project, and take " -"responsibility for maintaining it." -msgstr "" -"MAINTAINER 變數讓提交者可以聲明文件在 FreeBSD 說明文件計劃" -"中的所有權,並負責維護該文件。" - -#. (itstool) path: sect2/para -#: book.translate.xml:1449 -msgid "" -"DOC is the name (sans the .xml " -"extension) of the main document created by this directory. SRCS lists all the individual files that make up the document. This " -"should also include important files in which a change should result in a " -"rebuild." -msgstr "" -"DOC 是由此目錄會建立的主要文件的名稱 (不需要 ." -"xml 副檔名)。SRCS 會列出產生文件所需的各別檔" -"案,此處也應引用要在重新建置 (Rebuild) 使用的重要的檔案。" - -#. (itstool) path: sect2/para -#: book.translate.xml:1456 -msgid "" -"FORMATS indicates the default formats that should be " -"built for this document. INSTALL_COMPRESSED is the " -"default list of compression techniques that should be used in the document " -"build. INSTALL_ONLY_COMPRESS, empty by default, should be " -"non-empty if only compressed documents are desired in the build." -msgstr "" -"FORMATS 用來指定此份文件建置時預設應採用的格式。" -"INSTALL_COMPRESSED 是為在文件建置時預設要使用的壓縮技術清" -"單。INSTALL_ONLY_COMPRESS 預設為空值的,若在建置時只想要產" -"生壓縮後的文件則改成非空值。" - -#. (itstool) path: sect2/para -#: book.translate.xml:1464 -msgid "" -"The DOC_PREFIX and include statements should be familiar " -"already." -msgstr "DOC_PREFIX 以及 include 敘述句應不需再說明了。" - -#. (itstool) path: sect1/title -#: book.translate.xml:1470 -msgid "FreeBSD Documentation Project Make Includes" -msgstr "FreeBSD 說明文件計劃 Make 引用檔" - -#. (itstool) path: sect1/para -#: book.translate.xml:1473 -msgid "" -"make1 includes are best explained by inspection of the code. Here " -"are the system include files:" -msgstr "" - -#. (itstool) path: listitem/para -#: book.translate.xml:1478 -msgid "" -"doc.project.mk is the main project include file, which " -"includes all the following include files, as necessary." -msgstr "" - -#. (itstool) path: listitem/para -#: book.translate.xml:1484 -msgid "" -"doc.subdir.mk handles traversing of the document tree " -"during the build and install processes." -msgstr "" - -#. (itstool) path: listitem/para -#: book.translate.xml:1490 -msgid "" -"doc.install.mk provides variables that affect ownership " -"and installation of documents." -msgstr "" - -#. (itstool) path: listitem/para -#: book.translate.xml:1495 -msgid "" -"doc.docbook.mk is included if DOCFORMAT is docbook and DOC is set." -msgstr "" - -#. (itstool) path: sect2/title -#: book.translate.xml:1502 -msgid "doc.project.mk" -msgstr "" - -#. (itstool) path: sect2/para -#: book.translate.xml:1504 -msgid "By inspection:" -msgstr "" - -#. (itstool) path: sect2/programlisting -#: book.translate.xml:1506 -#, no-wrap -msgid "" -"DOCFORMAT?=\tdocbook\n" -"MAINTAINER?=\tdoc@FreeBSD.org\n" -"\n" -"PREFIX?=\t/usr/local\n" -"PRI_LANG?=\ten_US.ISO8859-1\n" -"\n" -".if defined(DOC)\n" -".if ${DOCFORMAT} == \"docbook\"\n" -".include \"doc.docbook.mk\"\n" -".endif\n" -".endif\n" -"\n" -".include \"doc.subdir.mk\"\n" -".include \"doc.install.mk\"" -msgstr "" - -#. (itstool) path: sect3/title -#: book.translate.xml:1523 book.translate.xml:1573 -msgid "Variables" -msgstr "變數" - -#. (itstool) path: sect3/para -#: book.translate.xml:1525 -msgid "" -"DOCFORMAT and MAINTAINER are assigned " -"default values, if these are not set by the document make file." -msgstr "" - -#. (itstool) path: sect3/para -#: book.translate.xml:1529 -msgid "" -"PREFIX is the prefix under which the documentation building tools are installed. For normal package and " -"port installation, this is /usr/local." -msgstr "" - -#. (itstool) path: sect3/para -#: book.translate.xml:1534 -msgid "" -"PRI_LANG should be set to whatever language and encoding " -"is natural amongst users these documents are being built for. US English is " -"the default." -msgstr "" - -#. (itstool) path: note/para -#: book.translate.xml:1540 -msgid "" -"PRI_LANG does not affect which documents can, or even " -"will, be built. Its main use is creating links to commonly referenced " -"documents into the FreeBSD documentation install root." -msgstr "" - -#. (itstool) path: sect3/title -#: book.translate.xml:1548 -msgid "Conditionals" -msgstr "條件" - -#. (itstool) path: sect3/para -#: book.translate.xml:1550 -msgid "" -"The .if defined(DOC) line is an example of a " -"make1 conditional which, like in other programs, defines behavior if " -"some condition is true or if it is false. defined is a " -"function which returns whether the variable given is defined or not." -msgstr "" - -#. (itstool) path: sect3/para -#: book.translate.xml:1556 -msgid "" -".if ${DOCFORMAT} == \"docbook\", next, tests whether the " -"DOCFORMAT variable is \"docbook\", and " -"in this case, includes doc.docbook.mk." -msgstr "" - -#. (itstool) path: sect3/para -#: book.translate.xml:1561 -msgid "" -"The two .endifs close the two above conditionals, marking " -"the end of their application." -msgstr "" - -#. (itstool) path: sect2/title -#: book.translate.xml:1567 -msgid "doc.subdir.mk" -msgstr "" - -#. (itstool) path: sect2/para -#: book.translate.xml:1569 -msgid "" -"This file is too long to explain in detail. These notes describe the most " -"important features." -msgstr "" - -#. (itstool) path: listitem/para -#: book.translate.xml:1577 -msgid "" -"SUBDIR is a list of subdirectories that the build process " -"should go further down into." -msgstr "" - -#. (itstool) path: listitem/para -#: book.translate.xml:1583 -msgid "" -"ROOT_SYMLINKS is the name of directories that should be " -"linked to the document install root from their actual locations, if the " -"current language is the primary language (specified by PRI_LANG)." -msgstr "" - -#. (itstool) path: listitem/para -#: book.translate.xml:1591 -msgid "" -"COMPAT_SYMLINK is described in the Subdirectory Makefile section." -msgstr "" - -#. (itstool) path: sect3/title -#: book.translate.xml:1600 -msgid "Targets and Macros" -msgstr "目標與巨集" - -#. (itstool) path: sect3/para -#: book.translate.xml:1602 -msgid "" -"Dependencies are described by target: " -"dependency1 dependency2 ... tuples, " -"where to build target, the given dependencies must be " -"built first." -msgstr "" - -#. (itstool) path: sect3/para -#: book.translate.xml:1609 -msgid "" -"After that descriptive tuple, instructions on how to build the target may be " -"given, if the conversion process between the target and its dependencies are " -"not previously defined, or if this particular conversion is not the same as " -"the default conversion method." -msgstr "" - -#. (itstool) path: sect3/para -#: book.translate.xml:1615 -msgid "" -"A special dependency .USE defines the equivalent of a " -"macro." -msgstr "" - -#. (itstool) path: sect3/programlisting -#: book.translate.xml:1618 book.translate.xml:1705 -#, no-wrap -msgid "" -"_SUBDIRUSE: .USE\n" -".for entry in ${SUBDIR}\n" -"\t@${ECHO} \"===> ${DIRPRFX}${entry}\"\n" -"\t@(cd ${.CURDIR}/${entry} && \\\n" -"\t${MAKE} ${.TARGET:S/realpackage/package/:S/realinstall/install/} DIRPRFX=${DIRPRFX}${entry}/ )\n" -".endfor" -msgstr "" - -#. (itstool) path: para/buildtarget -#: book.translate.xml:1625 book.translate.xml:1641 -msgid "_SUBDIRUSE" -msgstr "" - -#. (itstool) path: sect3/para -#: book.translate.xml:1625 -msgid "" -"In the above, <_:buildtarget-1/> is now a macro which will execute the given " -"commands when it is listed as a dependency." -msgstr "" - -#. (itstool) path: sect3/para -#: book.translate.xml:1629 -msgid "" -"What sets this macro apart from other targets? Basically, it is executed " -"after the instructions given in the build procedure it " -"is listed as a dependency to, and it does not adjust .TARGET, which is the variable which contains the name of the target " -"currently being built." -msgstr "" - -#. (itstool) path: sect3/programlisting -#: book.translate.xml:1637 -#, no-wrap -msgid "" -"clean: _SUBDIRUSE\n" -"\trm -f ${CLEANFILES}" -msgstr "" - -#. (itstool) path: para/buildtarget -#: book.translate.xml:1640 book.translate.xml:1644 book.translate.xml:1664 -#: book.translate.xml:6074 book.translate.xml:6078 book.translate.xml:6082 -msgid "clean" -msgstr "" - -#. (itstool) path: sect3/para -#: book.translate.xml:1640 -msgid "" -"In the above, <_:buildtarget-1/> will use the <_:buildtarget-2/> macro after " -"it has executed the instruction rm -f ${CLEANFILES}. In " -"effect, this causes <_:buildtarget-3/> to go further and further down the " -"directory tree, deleting built files as it goes down, " -"not on the way back up." -msgstr "" - -#. (itstool) path: sect4/title -#: book.translate.xml:1650 -msgid "Provided Targets" -msgstr "已提供的目標" - -#. (itstool) path: para/buildtarget -#: book.translate.xml:1654 -msgid "install" -msgstr "" - -#. (itstool) path: para/buildtarget -#: book.translate.xml:1655 -msgid "package" -msgstr "" - -#. (itstool) path: para/buildtarget -#: book.translate.xml:1658 -msgid "realinstall" -msgstr "" - -#. (itstool) path: para/buildtarget -#: book.translate.xml:1659 -msgid "realpackage" -msgstr "" - -#. (itstool) path: listitem/para -#: book.translate.xml:1654 -msgid "" -"<_:buildtarget-1/> and <_:buildtarget-2/> both go down the directory tree " -"calling the real versions of themselves in the subdirectories (<_:" -"buildtarget-3/> and <_:buildtarget-4/> respectively)." -msgstr "" - -#. (itstool) path: para/buildtarget -#: book.translate.xml:1667 -msgid "cleandir" -msgstr "" - -#. (itstool) path: listitem/para -#: book.translate.xml:1664 -msgid "" -"<_:buildtarget-1/> removes files created by the build process (and goes down " -"the directory tree too). <_:buildtarget-2/> does the same, and also removes " -"the object directory, if any." -msgstr "" - -#. (itstool) path: sect3/title -#: book.translate.xml:1675 -msgid "More on Conditionals" -msgstr "更多條件" - -#. (itstool) path: listitem/para -#: book.translate.xml:1679 -msgid "" -"exists is another condition function which returns true " -"if the given file exists." -msgstr "" - -#. (itstool) path: listitem/para -#: book.translate.xml:1685 -msgid "empty returns true if the given variable is empty." -msgstr "" - -#. (itstool) path: listitem/para -#: book.translate.xml:1690 -msgid "" -"target returns true if the given target does not already " -"exist." -msgstr "" - -#. (itstool) path: sect3/title -#: book.translate.xml:1697 -msgid "Looping Constructs in make (.for)" -msgstr "在 make (.for) 中的迴圈結構" - -#. (itstool) path: sect3/para -#: book.translate.xml:1700 -msgid "" -".for provides a way to repeat a set of instructions for " -"each space-separated element in a variable. It does this by assigning a " -"variable to contain the current element in the list being examined." -msgstr "" - -#. (itstool) path: sect3/para -#: book.translate.xml:1712 -msgid "" -"In the above, if SUBDIR is empty, no action is taken; if " -"it has one or more elements, the instructions between .for and .endfor would repeat for every element, with " -"entry being replaced with the value of the current " -"element." -msgstr "" - -#. (itstool) path: chapter/title -#: book.translate.xml:1756 -msgid "The Website" -msgstr "網站" - -#. (itstool) path: chapter/para -#: book.translate.xml:1758 -msgid "" -"The FreeBSD web site is part of the FreeBSD documents. Files for the web " -"site are stored in the en_US.ISO8859-1/htdocs " -"subdirectory of the document tree directory, ~/doc in " -"this example." -msgstr "" -"FreeBSD 網站是 FreeBSD 文件的一部份。網站的檔案儲存在文件樹目錄,此例中是 " -"~/doc,的 en_US.ISO8859-1/htdocs 子" -"目錄。" - -#. (itstool) path: sect1/title -#: book.translate.xml:1765 -msgid "Environment Variables" -msgstr "環境變數" - -#. (itstool) path: sect1/para -#: book.translate.xml:1767 -msgid "" -"Several environment variables control which parts of the web site are built " -"or installed, and to which directories." -msgstr "" - -#. (itstool) path: tip/para -#: book.translate.xml:1772 -msgid "" -"The web build system uses make1, and considers " -"variables to be set when they have been defined, even if they are empty. The " -"examples here show the recommended ways of defining and using these " -"variables. Setting or defining these variables with other values or methods " -"might lead to unexpected surprises." -msgstr "" - -#. (itstool) path: varlistentry/term -#: book.translate.xml:1782 -msgid "DESTDIR" -msgstr "" - -#. (itstool) path: listitem/para -#: book.translate.xml:1785 -msgid "" -"DESTDIR specifies the path where the web site files are to be installed." -msgstr "" - -#. (itstool) path: listitem/para -#: book.translate.xml:1788 -msgid "" -"This variable is best set with env1 or the user shell's " -"method of setting environment variables, setenv for " -"csh1 or export for " -"sh1." -msgstr "" - -#. (itstool) path: varlistentry/term -#: book.translate.xml:1798 -msgid "ENGLISH_ONLY" -msgstr "" - -#. (itstool) path: listitem/para -#: book.translate.xml:1801 -msgid "Default: undefined. Build and include all translations." -msgstr "" - -#. (itstool) path: listitem/para -#: book.translate.xml:1804 -msgid "" -"ENGLISH_ONLY=yes: use only the English documents and " -"ignore all translations." -msgstr "" - -#. (itstool) path: varlistentry/term -#: book.translate.xml:1810 -msgid "WEB_ONLY" -msgstr "" - -#. (itstool) path: listitem/para -#: book.translate.xml:1813 -msgid "" -"Default: undefined. Build both the web site and all the books and articles." -msgstr "" - -#. (itstool) path: listitem/para -#: book.translate.xml:1816 -msgid "" -"WEB_ONLY=yes: build or install only HTML pages from the en_US.ISO8859-1/htdocs " -"directory. Other directories and documents, including books and articles, " -"will be ignored." -msgstr "" - -#. (itstool) path: varlistentry/term -#: book.translate.xml:1825 -msgid "WEB_LANG" -msgstr "" - -#. (itstool) path: listitem/para -#: book.translate.xml:1828 -msgid "" -"Default: undefined. Build and include all the available languages on the web " -"site." -msgstr "" - -#. (itstool) path: listitem/para -#: book.translate.xml:1831 -msgid "" -"Set to a space-separated list of languages to be included in the build or " -"install. The formats are the same as the directory names in the document " -"root directory. For example, to include the German and French documents:" -msgstr "" - -#. (itstool) path: listitem/screen -#: book.translate.xml:1837 -#, no-wrap -msgid "WEB_LANG=\"de_DE.ISO8859-1 fr_FR.ISO8859-1\"" -msgstr "" - -#. (itstool) path: sect1/para -#: book.translate.xml:1842 -msgid "" -"WEB_ONLY, WEB_LANG, and " -"ENGLISH_ONLY are make1 variables and can be " -"set in /etc/make.conf, Makefile.inc, as environment variables on the command line, or in dot files." -msgstr "" - -#. (itstool) path: sect1/title -#: book.translate.xml:1850 -msgid "Building and Installing the Web Pages" -msgstr "建置並安裝網頁" - -#. (itstool) path: sect1/para -#: book.translate.xml:1852 -msgid "" -"Having obtained the documentation and web site source files, the web site " -"can be built." -msgstr "" - -#. (itstool) path: sect1/para -#: book.translate.xml:1855 -msgid "" -"An actual installation of the web site is run as the root user because the permissions on the web " -"server directory will not allow files to be installed by an unprivileged " -"user. For testing, it can be useful to install the files as a normal user to " -"a temporary directory." -msgstr "" - -#. (itstool) path: sect1/para -#: book.translate.xml:1861 -msgid "" -"In these examples, the web site files are built by user jru in their home directory, ~/doc, with a full path of /usr/home/jru/doc." -msgstr "" - -#. (itstool) path: tip/para -#: book.translate.xml:1867 -msgid "" -"The web site build uses the INDEX from the Ports " -"Collection and might fail if that file or /usr/ports is " -"not present. The simplest approach is to install the Ports Collection." -msgstr "" - -#. (itstool) path: example/title -#: book.translate.xml:1875 -msgid "Build the Full Web Site and All Documents" -msgstr "建置完整網站與所有說明文件" - -#. (itstool) path: example/para -#: book.translate.xml:1877 -msgid "" -"Build the web site and all documents. The resulting files are left in the " -"document tree:" -msgstr "" - -#. (itstool) path: example/screen -#: book.translate.xml:1880 -#, no-wrap -msgid "" -"% cd ~/doc/en_US.ISO8859-1/htdocs/\n" -"% make all" -msgstr "" - -#. (itstool) path: example/title -#: book.translate.xml:1885 -msgid "Build Only the Web Site in English" -msgstr "只建置英文版網站" - -#. (itstool) path: example/para -#: book.translate.xml:1887 -msgid "" -"Build the web site only, in English, as user jru, and install the resulting files into /tmp/" -"www for testing:" -msgstr "" - -#. (itstool) path: example/screen -#: book.translate.xml:1892 -#, no-wrap -msgid "" -"% cd ~/doc/en_US.ISO8859-1/htdocs/\n" -"% env DESTDIR=/tmp/www make ENGLISH_ONLY=yes WEB_ONLY=yes all install" -msgstr "" - -#. (itstool) path: example/para -#: book.translate.xml:1895 -msgid "" -"Changes to static files can usually be tested by viewing the modified files " -"directly with a web browser. If the site has been built as shown above, a " -"modified main page can be viewed with:" -msgstr "" - -#. (itstool) path: example/screen -#: book.translate.xml:1900 -#, no-wrap -msgid "% firefox /tmp/www/data/index.html" -msgstr "" - -#. (itstool) path: example/para -#: book.translate.xml:1902 -msgid "" -"Modifications to dynamic files can be tested with a web server running on " -"the local system. After building the site as shown above, this /" -"usr/local/etc/apache24/httpd.conf can be used with www/" -"apache24:" -msgstr "" - -#. (itstool) path: example/programlisting -#: book.translate.xml:1908 -#, no-wrap -msgid "" -"# httpd.conf for testing the FreeBSD website\n" -"Define TestRoot \"/tmp/www/data\"\n" -"\n" -"# directory for configuration files\n" -"ServerRoot \"/usr/local\"\n" -"\n" -"Listen 80\n" -"\n" -"# minimum required modules\n" -"LoadModule authz_core_module libexec/apache24/mod_authz_core.so\n" -"LoadModule mime_module libexec/apache24/mod_mime.so\n" -"LoadModule unixd_module libexec/apache24/mod_unixd.so\n" -"LoadModule cgi_module libexec/apache24/mod_cgi.so\n" -"LoadModule dir_module libexec/apache24/mod_dir.so\n" -"\n" -"# run the webserver as user and group\n" -"User www\n" -"Group www\n" -"\n" -"ServerAdmin you@example.com\n" -"ServerName fbsdtest\n" -"\n" -"# deny access to all files\n" -"<Directory />\n" -" AllowOverride none\n" -" Require all denied\n" -"</Directory>\n" -"\n" -"# allow access to the website directory\n" -"DocumentRoot \"${TestRoot}\"\n" -"<Directory \"${TestRoot}\">\n" -" Options Indexes FollowSymLinks\n" -" AllowOverride None\n" -" Require all granted\n" -"</Directory>\n" -"\n" -"# prevent access to .htaccess and .htpasswd files\n" -"<Files \".ht*\">\n" -" Require all denied\n" -"</Files>\n" -"\n" -"ErrorLog \"/var/log/httpd-error.log\"\n" -"LogLevel warn\n" -"\n" -"# set up the CGI script directory\n" -"<Directory \"${TestRoot}/cgi\">\n" -" AllowOverride None\n" -" Options None\n" -" Require all granted\n" -" Options +ExecCGI\n" -" AddHandler cgi-script .cgi\n" -"</Directory>\n" -"\n" -"Include etc/apache24/Includes/*.conf" -msgstr "" - -#. (itstool) path: example/para -#: book.translate.xml:1963 -msgid "Start the web server with" -msgstr "" - -#. (itstool) path: example/screen -#: book.translate.xml:1965 -#, no-wrap -msgid "# service apache24 onestart" -msgstr "" - -#. (itstool) path: example/para -#: book.translate.xml:1967 -msgid "" -"The web site can be viewed at . Be " -"aware that many links refer to the real FreeBSD site by name, and those " -"links will still go to the external site instead of the local test version. " -"Fully testing the local site will require temporarily setting DNS so www.FreeBSD.org resolves to " -"localhost or the local IP address." -msgstr "" - -#. (itstool) path: example/title -#: book.translate.xml:1979 -msgid "Build and Install the Web Site" -msgstr "建置並安裝網站" - -#. (itstool) path: example/para -#: book.translate.xml:1981 -msgid "" -"Build the web site and all documents as user jru. Install the resulting files as root into the default directory, /root/" -"public_html:" -msgstr "" - -#. (itstool) path: example/screen -#: book.translate.xml:1988 -#, no-wrap -msgid "" -"% cd ~/doc/en_US.ISO8859-1/htdocs\n" -"% make all\n" -"% su -\n" -"Password:\n" -"# cd /usr/home/jru/doc/en_US.ISO8859-1/htdocs\n" -"# make install" -msgstr "" - -#. (itstool) path: sect1/para -#: book.translate.xml:1996 -msgid "" -"The install process does not delete any old or outdated files that existed " -"previously in the same directory. If a new copy of the site is built and " -"installed every day, this command will find and delete all files that have " -"not been updated in three days:" -msgstr "" - -#. (itstool) path: sect1/screen -#: book.translate.xml:2002 -#, no-wrap -msgid "# find /usr/local/www -ctime 3 -delete" -msgstr "" - -#. (itstool) path: chapter/title -#: book.translate.xml:2039 -msgid "XML Primer" -msgstr "XML 入門" - -#. (itstool) path: chapter/para -#: book.translate.xml:2041 -msgid "" -"Most FDP documentation is written with markup languages " -"based on XML. This chapter explains what that means, how " -"to read and understand the documentation source, and the XML techniques used." -msgstr "" - -#. (itstool) path: chapter/para -#: book.translate.xml:2047 -msgid "" -"Portions of this section were inspired by Mark Galassi's Get " -"Going With DocBook." -msgstr "" - -#. (itstool) path: sect1/para -#: book.translate.xml:2054 -msgid "" -"In the original days of computers, electronic text was simple. There were a " -"few character sets like ASCII or EBCDIC, but that was about it. Text was text, and what you saw really was " -"what you got. No frills, no formatting, no intelligence." -msgstr "" - -#. (itstool) path: sect1/para -#: book.translate.xml:2060 -msgid "" -"Inevitably, this was not enough. When text is in a machine-usable format, " -"machines are expected to be able to use and manipulate it intelligently. " -"Authors want to indicate that certain phrases should be emphasized, or added " -"to a glossary, or made into hyperlinks. Filenames could be shown in a " -"typewriter style font for viewing on screen, but as " -"italics when printed, or any of a myriad of other options for " -"presentation." -msgstr "" - -#. (itstool) path: sect1/para -#: book.translate.xml:2069 -msgid "" -"It was once hoped that Artificial Intelligence (AI) would make this easy. " -"The computer would read the document and automatically identify key phrases, " -"filenames, text that the reader should type in, examples, and more. " -"Unfortunately, real life has not happened quite like that, and computers " -"still require assistance before they can meaningfully process text." -msgstr "" - -#. (itstool) path: sect1/para -#: book.translate.xml:2077 -msgid "" -"More precisely, they need help identifying what is what. Consider this text:" -msgstr "" - -#. (itstool) path: blockquote/para -#: book.translate.xml:2081 -msgid "" -"To remove /tmp/foo, use " -"rm1." -msgstr "" - -#. (itstool) path: blockquote/screen -#: book.translate.xml:2084 -#, no-wrap -msgid "% rm /tmp/foo" -msgstr "" - -#. (itstool) path: sect1/para -#: book.translate.xml:2087 -msgid "" -"It is easy to see which parts are filenames, which are commands to be typed " -"in, which parts are references to manual pages, and so on. But the computer " -"processing the document cannot. For this we need markup." -msgstr "" - -#. (itstool) path: sect1/para -#: book.translate.xml:2092 -msgid "" -"Markup is commonly used to describe adding value or increasing cost. The term takes on both these " -"meanings when applied to text. Markup is additional text included in the " -"document, distinguished from the document's content in some way, so that " -"programs that process the document can read the markup and use it when " -"making decisions about the document. Editors can hide the markup from the " -"user, so the user is not distracted by it." -msgstr "" - -#. (itstool) path: sect1/para -#: book.translate.xml:2102 -msgid "" -"The extra information stored in the markup adds value " -"to the document. Adding the markup to the document must typically be done by " -"a person—after all, if computers could recognize the text sufficiently well " -"to add the markup then there would be no need to add it in the first place. " -"This increases the cost (the effort required) to create " -"the document." -msgstr "" - -#. (itstool) path: sect1/para -#: book.translate.xml:2111 -msgid "" -"The previous example is actually represented in this document like this:" -msgstr "" - -#. (itstool) path: sect1/programlisting -#: book.translate.xml:2114 -#, no-wrap -msgid "" -"paraTo remove filename/tmp/foofilename, use &man.rm.1;.para\n" -"\n" -"screen&prompt.user; userinputrm /tmp/foouserinputscreen" -msgstr "" - -#. (itstool) path: sect1/para -#: book.translate.xml:2118 -msgid "The markup is clearly separate from the content." -msgstr "" - -#. (itstool) path: sect1/para -#: book.translate.xml:2120 -msgid "" -"Markup languages define what the markup means and how it should be " -"interpreted." -msgstr "" - -#. (itstool) path: sect1/para -#: book.translate.xml:2123 -msgid "" -"Of course, one markup language might not be enough. A markup language for " -"technical documentation has very different requirements than a markup " -"language that is intended for cookery recipes. This, in turn, would be very " -"different from a markup language used to describe poetry. What is really " -"needed is a first language used to write these other markup languages. A " -"meta markup language." -msgstr "" - -#. (itstool) path: sect1/para -#: book.translate.xml:2131 -msgid "" -"This is exactly what the eXtensible Markup Language (XML) " -"is. Many markup languages have been written in XML, " -"including the two most used by the FDP, XHTML and DocBook." -msgstr "" - -#. (itstool) path: sect1/para -#: book.translate.xml:2137 -msgid "" -"Each language definition is more properly called a grammar, vocabulary, " -"schema or Document Type Definition (DTD). There are " -"various languages to specify an XML grammar, or " -"schema." -msgstr "" - -#. (itstool) path: sect1/para -#. (itstool) id: book.translate.xml#xml-primer-validating -#: book.translate.xml:2143 -msgid "" -"A schema is a complete specification of all the " -"elements that are allowed to appear, the order in which they should appear, " -"which elements are mandatory, which are optional, and so forth. This makes " -"it possible to write an XML parser " -"which reads in both the schema and a document which claims to conform to the " -"schema. The parser can then confirm whether or not all the elements required " -"by the vocabulary are in the document in the right order, and whether there " -"are any errors in the markup. This is normally referred to as " -"validating the document." -msgstr "" - -#. (itstool) path: note/para -#: book.translate.xml:2157 -msgid "" -"Validation confirms that the choice of elements, their ordering, and so on, " -"conforms to that listed in the grammar. It does not " -"check whether appropriate markup has been used for the " -"content. If all the filenames in a document were marked up as function " -"names, the parser would not flag this as an error (assuming, of course, that " -"the schema defines elements for filenames and functions, and that they are " -"allowed to appear in the same place)." -msgstr "" - -#. (itstool) path: sect1/para -#: book.translate.xml:2168 -msgid "" -"Most contributions to the Documentation Project will be content marked up in " -"either XHTML or DocBook, rather than alterations to the " -"schemas. For this reason, this book will not touch on how to write a " -"vocabulary." -msgstr "" - -#. (itstool) path: sect1/title -#: book.translate.xml:2176 -msgid "Elements, Tags, and Attributes" -msgstr "元素、標籤與屬性" - -#. (itstool) path: sect1/para -#: book.translate.xml:2178 -msgid "" -"All the vocabularies written in XML share certain " -"characteristics. This is hardly surprising, as the philosophy behind " -"XML will inevitably show through. One of the most obvious " -"manifestations of this philosophy is that of content " -"and elements." -msgstr "" - -#. (itstool) path: sect1/para -#: book.translate.xml:2185 -msgid "" -"Documentation, whether it is a single web page, or a lengthy book, is " -"considered to consist of content. This content is then divided and further " -"subdivided into elements. The purpose of adding markup is to name and " -"identify the boundaries of these elements for further processing." -msgstr "" - -#. (itstool) path: sect1/para -#: book.translate.xml:2191 -msgid "" -"For example, consider a typical book. At the very top level, the book is " -"itself an element. This book element obviously contains " -"chapters, which can be considered to be elements in their own right. Each " -"chapter will contain more elements, such as paragraphs, quotations, and " -"footnotes. Each paragraph might contain further elements, identifying " -"content that was direct speech, or the name of a character in the story." -msgstr "" - -#. (itstool) path: sect1/para -#: book.translate.xml:2200 -msgid "" -"It may be helpful to think of this as chunking content. At " -"the very top level is one chunk, the book. Look a little deeper, and there " -"are more chunks, the individual chapters. These are chunked further into " -"paragraphs, footnotes, character names, and so on." -msgstr "" - -#. (itstool) path: sect1/para -#: book.translate.xml:2206 -msgid "" -"Notice how this differentiation between different elements of the content " -"can be made without resorting to any XML terms. It really " -"is surprisingly straightforward. This could be done with a highlighter pen " -"and a printout of the book, using different colors to indicate different " -"chunks of content." -msgstr "" - -#. (itstool) path: sect1/para -#: book.translate.xml:2213 -msgid "" -"Of course, we do not have an electronic highlighter pen, so we need some " -"other way of indicating which element each piece of content belongs to. In " -"languages written in XML (XHTML, " -"DocBook, et al) this is done by means of tags." -msgstr "" - -#. (itstool) path: sect1/para -#: book.translate.xml:2219 -msgid "" -"A tag is used to identify where a particular element starts, and where the " -"element ends. The tag is not part of the element itself. Because each grammar was normally written to mark up specific " -"types of information, each one will recognize different elements, and will " -"therefore have different names for the tags." -msgstr "" - -#. (itstool) path: sect1/para -#: book.translate.xml:2226 -msgid "" -"For an element called element-name the start tag " -"will normally look like element-name. The corresponding closing tag for this element is element-name." -msgstr "" - -#. (itstool) path: example/title -#: book.translate.xml:2232 -msgid "Using an Element (Start and End Tags)" -msgstr "使用元素 (開始與結束標籤)" - -#. (itstool) path: example/para -#: book.translate.xml:2234 -msgid "" -"XHTML has an element for indicating that the content " -"enclosed by the element is a paragraph, called p." -msgstr "" - -#. (itstool) path: example/programlisting -#: book.translate.xml:2238 -#, no-wrap -msgid "" -"pThis is a paragraph. It starts with the start tag for\n" -" the 'p' element, and it will end with the end tag for the 'p'\n" -" element.p\n" -"\n" -"pThis is another paragraph. But this one is much shorter.p" -msgstr "" - -#. (itstool) path: sect1/para -#: book.translate.xml:2245 -msgid "" -"Some elements have no content. For example, in XHTML, a " -"horizontal line can be included in the document. For these empty elements, XML introduced a shorthand form that is " -"completely equivalent to the two-tag version:" -msgstr "" - -#. (itstool) path: example/title -#: book.translate.xml:2252 -msgid "Using an Element Without Content" -msgstr "使用沒有內容的元素" - -#. (itstool) path: example/para -#: book.translate.xml:2254 -msgid "" -"XHTML has an element for indicating a horizontal rule, " -"called hr. This element does not wrap content, so it looks like " -"this:" -msgstr "" - -#. (itstool) path: example/programlisting -#: book.translate.xml:2258 -#, no-wrap -msgid "" -"pOne paragraph.p\n" -"hrhr\n" -"\n" -"pThis is another paragraph. A horizontal rule separates this\n" -" from the previous paragraph.p" -msgstr "" - -#. (itstool) path: example/para -#: book.translate.xml:2264 -msgid "The shorthand version consists of a single tag:" -msgstr "" - -#. (itstool) path: example/programlisting -#: book.translate.xml:2266 -#, no-wrap -msgid "" -"pOne paragraph.p\n" -"hr\n" -"\n" -"pThis is another paragraph. A horizontal rule separates this\n" -" from the previous paragraph.p" -msgstr "" - -#. (itstool) path: sect1/para -#: book.translate.xml:2273 -msgid "" -"As shown above, elements can contain other elements. In the book example " -"earlier, the book element contained all the chapter elements, which in turn " -"contained all the paragraph elements, and so on." -msgstr "" - -#. (itstool) path: example/title -#: book.translate.xml:2279 -msgid "Elements Within Elements; em" -msgstr "在元素中的元素; em" - -#. (itstool) path: example/programlisting -#: book.translate.xml:2281 -#, no-wrap -msgid "" -"pThis is a simple emparagraphem where some\n" -" of the emwordsem have been ememphasizedem.p" -msgstr "" - -#. (itstool) path: sect1/para -#: book.translate.xml:2285 -msgid "" -"The grammar consists of rules that describe which elements can contain other " -"elements, and exactly what they can contain." -msgstr "" - -#. (itstool) path: important/para -#: book.translate.xml:2290 -msgid "" -"People often confuse the terms tags and elements, and use the terms as if " -"they were interchangeable. They are not." -msgstr "" - -#. (itstool) path: important/para -#: book.translate.xml:2294 -msgid "" -"An element is a conceptual part of your document. An element has a defined " -"start and end. The tags mark where the element starts and ends." -msgstr "" - -#. (itstool) path: important/para -#: book.translate.xml:2298 -msgid "" -"When this document (or anyone else knowledgeable about XML) refers to the p tag " -"they mean the literal text consisting of the three characters <, p, and >. But the phrase " -"the p element refers to the whole element." -msgstr "" - -#. (itstool) path: important/para -#: book.translate.xml:2307 -msgid "" -"This distinction is very subtle. But keep it in mind." -msgstr "" - -#. (itstool) path: sect1/para -#: book.translate.xml:2311 -msgid "" -"Elements can have attributes. An attribute has a name and a value, and is " -"used for adding extra information to the element. This might be information " -"that indicates how the content should be rendered, or might be something " -"that uniquely identifies that occurrence of the element, or it might be " -"something else." -msgstr "" - -#. (itstool) path: sect1/para -#: book.translate.xml:2317 -msgid "" -"An element's attributes are written inside the start " -"tag for that element, and take the form attribute-" -"name=\"attribute-value\"." -msgstr "" - -#. (itstool) path: sect1/para -#: book.translate.xml:2322 -msgid "" -"In XHTML, the p element has an attribute " -"called align, which suggests an alignment " -"(justification) for the paragraph to the program displaying the " -"XHTML." -msgstr "" - -#. (itstool) path: sect1/para -#: book.translate.xml:2328 -msgid "" -"The align attribute can take one of four " -"defined values, left, center, " -"right and justify. If the attribute is " -"not specified then the default is left." -msgstr "" - -#. (itstool) path: example/title -#: book.translate.xml:2335 -msgid "Using an Element with an Attribute" -msgstr "使用元素的屬性" - -#. (itstool) path: example/programlisting -#: book.translate.xml:2337 -#, no-wrap -msgid "" -"p align=\"left\"The inclusion of the align attribute\n" -" on this paragraph was superfluous, since the default is left.p\n" -"\n" -"p align=\"center\"This may appear in the center.p" -msgstr "" - -#. (itstool) path: sect1/para -#: book.translate.xml:2343 -msgid "" -"Some attributes only take specific values, such as left " -"or justify. Others allow any value." -msgstr "" - -#. (itstool) path: example/title -#: book.translate.xml:2348 -msgid "Single Quotes Around Attributes" -msgstr "屬性的單引號" - -#. (itstool) path: example/programlisting -#: book.translate.xml:2350 -#, no-wrap -msgid "p align='right'I am on the right!p" -msgstr "" - -#. (itstool) path: sect1/para -#: book.translate.xml:2353 -msgid "" -"Attribute values in XML must be enclosed in either single " -"or double quotes. Double quotes are traditional. Single quotes are useful " -"when the attribute value contains double quotes." -msgstr "" - -#. (itstool) path: sect1/para -#: book.translate.xml:2358 -msgid "" -"Information about attributes, elements, and tags is stored in catalog files. " -"The Documentation Project uses standard DocBook catalogs and includes " -"additional catalogs for FreeBSD-specific features. Paths to the catalog " -"files are defined in an environment variable so they can be found by the " -"document build tools." -msgstr "" - -#. (itstool) path: sect2/title -#: book.translate.xml:2366 book.translate.xml:2761 book.translate.xml:2895 -#: book.translate.xml:3082 book.translate.xml:3375 -msgid "To Do…" -msgstr "待辦事項..." - -#. (itstool) path: sect2/para -#: book.translate.xml:2368 -msgid "" -"Before running the examples in this document, install textproc/" -"docproj from the FreeBSD Ports Collection. This is a " -"meta-port that downloads and installs the standard " -"programs and supporting files needed by the Documentation Project. " -"csh1 users must use rehash for the shell to " -"recognize new programs after they have been installed, or log out and then " -"log back in again." -msgstr "" - -#. (itstool) path: step/para -#: book.translate.xml:2380 -msgid "Create example.xml, and enter this text:" -msgstr "" - -#. (itstool) path: step/programlisting -#: book.translate.xml:2383 -#, no-wrap -msgid "" -"!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\"\n" -"\n" -"html xmlns=\"http://www.w3.org/1999/xhtml\"\n" -" head\n" -" titleAn Example XHTML Filetitle\n" -" head\n" -"\n" -" body\n" -" pThis is a paragraph containing some text.p\n" -"\n" -" pThis paragraph contains some more text.p\n" -"\n" -" p align=\"right\"This paragraph might be right-justified.p\n" -" body\n" -"html" -msgstr "" - -#. (itstool) path: step/para -#: book.translate.xml:2401 -msgid "Try to validate this file using an XML parser." -msgstr "" - -#. (itstool) path: step/para -#: book.translate.xml:2404 -msgid "" -"textproc/docproj includes the xmllint " -"validating parser." -msgstr "" - -#. (itstool) path: step/para -#: book.translate.xml:2409 -msgid "Use xmllint to validate the document:" -msgstr "" - -#. (itstool) path: step/screen -#: book.translate.xml:2412 -#, no-wrap -msgid "% xmllint --valid --noout example.xml" -msgstr "" - -#. (itstool) path: step/para -#: book.translate.xml:2414 -msgid "" -"xmllint returns without displaying any output, showing " -"that the document validated successfully." -msgstr "" - -#. (itstool) path: step/para -#: book.translate.xml:2420 -msgid "" -"See what happens when required elements are omitted. Delete the line with " -"the title and title tags, and re-run the validation." -msgstr "" - -#. (itstool) path: step/screen -#: book.translate.xml:2426 -#, no-wrap -msgid "" -"% xmllint --valid --noout example.xml\n" -"example.xml:5: element head: validity error : Element head content does not follow the DTD, expecting ((script | style | meta | link | object | isindex)* , ((title , (script | style | meta | link | object | isindex)* , (base , (script | style | meta | link | object | isindex)*)?) | (base , (script | style | meta | link | object | isindex)* , title , (script | style | meta | link | object | isindex)*))), got ()" -msgstr "" - -#. (itstool) path: step/para -#: book.translate.xml:2429 -msgid "" -"This shows that the validation error comes from the fifth line of the example.xml file and " -"that the content of the head is the part which " -"does not follow the rules of the XHTML grammar." -msgstr "" - -#. (itstool) path: step/para -#: book.translate.xml:2436 -msgid "" -"Then xmllint shows the line where the error was found and " -"marks the exact character position with a ^ sign." -msgstr "" - -#. (itstool) path: step/para -#: book.translate.xml:2442 -msgid "Replace the title element." -msgstr "" - -#. (itstool) path: sect1/title -#: book.translate.xml:2449 -msgid "The DOCTYPE Declaration" -msgstr "DOCTYPE 宣告" - -#. (itstool) path: sect1/para -#: book.translate.xml:2451 -msgid "" -"The beginning of each document can specify the name of the DTD to which the document conforms. This DOCTYPE declaration is used by " -"XML parsers to identify the DTD and " -"ensure that the document does conform to it." -msgstr "" - -#. (itstool) path: sect1/para -#: book.translate.xml:2457 -msgid "" -"A typical declaration for a document written to conform with version 1.0 of " -"the XHTML DTD looks like this:" -msgstr "" - -#. (itstool) path: sect1/programlisting -#: book.translate.xml:2461 -#, no-wrap -msgid "!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\"" -msgstr "" - -#. (itstool) path: sect1/para -#: book.translate.xml:2463 -msgid "That line contains a number of different components." -msgstr "" - -#. (itstool) path: varlistentry/term -#: book.translate.xml:2467 -msgid "<!" -msgstr "" - -#. (itstool) path: listitem/para -#: book.translate.xml:2470 -msgid "" -"The indicator shows this is an XML " -"declaration." -msgstr "" - -#. (itstool) path: varlistentry/term -#: book.translate.xml:2476 -msgid "DOCTYPE" -msgstr "" - -#. (itstool) path: listitem/para -#: book.translate.xml:2479 -msgid "" -"Shows that this is an XML declaration of the document " -"type." -msgstr "" - -#. (itstool) path: listitem/para -#: book.translate.xml:2488 -msgid "" -"Names the first element that " -"will appear in the document." -msgstr "" - -#. (itstool) path: varlistentry/term -#: book.translate.xml:2495 -msgid "PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\"" -msgstr "" - -#. (itstool) path: para/indexterm -#. (itstool) path: sect2/indexterm -#: book.translate.xml:2500 book.translate.xml:2541 -msgid "Formal Public Identifier" -msgstr "" - -#. (itstool) path: listitem/para -#: book.translate.xml:2498 -msgid "" -"Lists the Formal Public Identifier (FPI) <_:indexterm-1/> " -"for the DTD to which this document conforms. The " -"XML parser uses this to find the correct DTD when processing this document." -msgstr "" - -#. (itstool) path: listitem/para -#: book.translate.xml:2508 -msgid "" -"PUBLIC is not a part of the FPI, but " -"indicates to the XML processor how to find the " -"DTD referenced in the FPI. Other ways " -"of telling the XML parser how to find the DTD are shown later." -msgstr "" - -#. (itstool) path: varlistentry/term -#: book.translate.xml:2519 -msgid "" -"\"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\"" -msgstr "" - -#. (itstool) path: listitem/para -#: book.translate.xml:2522 -msgid "" -"A local filename or a URL to find the DTD." -msgstr "" - -#. (itstool) path: varlistentry/term -#: book.translate.xml:2528 -msgid ">" -msgstr "" - -#. (itstool) path: listitem/para -#: book.translate.xml:2531 -msgid "Ends the declaration and returns to the document." -msgstr "" - -#. (itstool) path: sect2/title -#: book.translate.xml:2538 -msgid "Formal Public Identifiers (FPIs)" -msgstr "正式公用識別碼 (FPI)" - -#. (itstool) path: note/para -#: book.translate.xml:2546 -msgid "" -"It is not necessary to know this, but it is useful background, and might " -"help debug problems when the XML processor can not locate " -"the DTD." -msgstr "" - -#. (itstool) path: sect2/para -#: book.translate.xml:2552 -msgid "FPIs must follow a specific syntax:" -msgstr "" - -#. (itstool) path: sect2/programlisting -#: book.translate.xml:2555 -#, no-wrap -msgid "\"Owner//Keyword Description//Language\"" -msgstr "" - -#. (itstool) path: varlistentry/term -#: book.translate.xml:2559 -msgid "Owner" -msgstr "" - -#. (itstool) path: listitem/para -#: book.translate.xml:2562 -msgid "The owner of the FPI." -msgstr "" - -#. (itstool) path: listitem/para -#: book.translate.xml:2564 -msgid "" -"The beginning of the string identifies the owner of the FPI. For example, the FPI \"ISO 8879:1986//" -"ENTITIES Greek Symbols//EN\" lists ISO 8879:1986 as being the owner for the set of entities for Greek symbols. " -"ISO 8879:1986 is the International Organization for " -"Standardization (ISO) number for the SGML standard, the predecessor (and a superset) of XML." -msgstr "" - -#. (itstool) path: listitem/para -#: book.translate.xml:2577 -msgid "" -"Otherwise, this string will either look like -//Owner or +//Owner (notice the only difference is the leading + or " -"-)." -msgstr "" - -#. (itstool) path: listitem/para -#: book.translate.xml:2584 -msgid "" -"If the string starts with - then the owner information is " -"unregistered, with a + identifying it as registered." -msgstr "" - -#. (itstool) path: listitem/para -#: book.translate.xml:2589 -msgid "" -"ISO 9070:1991 defines how registered names are generated. " -"It might be derived from the number of an ISO " -"publication, an ISBN code, or an organization code " -"assigned according to ISO 6523. Additionally, a " -"registration authority could be created in order to assign registered names. " -"The ISO council delegated this to the American National " -"Standards Institute (ANSI)." -msgstr "" - -#. (itstool) path: listitem/para -#: book.translate.xml:2600 -msgid "" -"Because the FreeBSD Project has not been registered, the owner string is " -"-//FreeBSD. As seen in the example, the W3C are not a registered owner either." -msgstr "" - -#. (itstool) path: varlistentry/term -#: book.translate.xml:2608 -msgid "Keyword" -msgstr "" - -#. (itstool) path: listitem/para -#: book.translate.xml:2611 -msgid "" -"There are several keywords that indicate the type of information in the " -"file. Some of the most common keywords are DTD, " -"ELEMENT, ENTITIES, and TEXT. DTD is used only for DTD " -"files, ELEMENT is usually used for DTD " -"fragments that contain only entity or element declarations. TEXT is used for XML content (text and tags)." -msgstr "" - -#. (itstool) path: varlistentry/term -#: book.translate.xml:2626 -msgid "Description" -msgstr "" - -#. (itstool) path: listitem/para -#: book.translate.xml:2629 -msgid "" -"Any description can be given for the contents of this file. This may include " -"version numbers or any short text that is meaningful and unique for the " -"XML system." -msgstr "" - -#. (itstool) path: varlistentry/term -#: book.translate.xml:2637 -msgid "Language" -msgstr "" - -#. (itstool) path: listitem/para -#: book.translate.xml:2640 -msgid "" -"An ISO two-character code that identifies the native " -"language for the file. EN is used for English." -msgstr "" - -#. (itstool) path: sect3/title -#: book.translate.xml:2648 -msgid "catalog Files" -msgstr "catalog 檔案" - -#. (itstool) path: sect3/para -#: book.translate.xml:2650 -msgid "" -"With the syntax above, an XML processor needs to have " -"some way of turning the FPI into the name of the file " -"containing the DTD. A catalog file (typically called " -"catalog) contains lines that map FPIs to filenames. For example, if the catalog file contained the line:" -msgstr "" - -#. (itstool) path: sect3/programlisting -#: book.translate.xml:2660 -#, no-wrap -msgid "PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"1.0/transitional.dtd\"" -msgstr "" - -#. (itstool) path: sect3/para -#: book.translate.xml:2662 -msgid "" -"The XML processor knows that the DTD " -"is called transitional.dtd in the 1.0 subdirectory of the directory that held catalog." -msgstr "" - -#. (itstool) path: sect3/para -#: book.translate.xml:2668 -msgid "" -"Examine the contents of /usr/local/share/xml/dtd/xhtml/catalog." -"xml. This is the catalog file for the XHTML " -"DTDs that were installed as part of the textproc/" -"docproj port." -msgstr "" - -#. (itstool) path: sect2/title -#: book.translate.xml:2677 -msgid "Alternatives to FPIs" -msgstr "FPI 的替代方案" - -#. (itstool) path: sect2/para -#: book.translate.xml:2679 -msgid "" -"Instead of using an FPI to indicate the DTD to which the document conforms (and therefore, which file on the " -"system contains the DTD), the filename can be explicitly " -"specified." -msgstr "" - -#. (itstool) path: sect2/para -#: book.translate.xml:2685 -msgid "The syntax is slightly different:" -msgstr "" - -#. (itstool) path: sect2/programlisting -#: book.translate.xml:2687 -#, no-wrap -msgid "!DOCTYPE html SYSTEM \"/path/to/file.dtd\"" -msgstr "" - -#. (itstool) path: sect2/para -#: book.translate.xml:2689 -msgid "" -"The SYSTEM keyword indicates that the XML processor should locate the DTD in a system " -"specific fashion. This typically (but not always) means the DTD will be provided as a filename." -msgstr "" - -#. (itstool) path: sect2/para -#: book.translate.xml:2695 -msgid "" -"Using FPIs is preferred for reasons of portability. If " -"the SYSTEM identifier is used, then the DTD must be provided and kept in the same location for everyone." -msgstr "" - -#. (itstool) path: sect1/title -#: book.translate.xml:2703 -msgid "Escaping Back to XML" -msgstr "跳脫回 XML" - -#. (itstool) path: sect1/para -#: book.translate.xml:2705 -msgid "" -"Some of the underlying XML syntax can be useful within " -"documents. For example, comments can be included in the document, and will " -"be ignored by the parser. Comments are entered using XML " -"syntax. Other uses for XML syntax will be shown later." -msgstr "" - -#. (itstool) path: sect1/para -#: book.translate.xml:2711 -msgid "" -"XML sections begin with a <! tag " -"and end with a >. These sections contain instructions " -"for the parser rather than elements of the document. Everything between " -"these tags is XML syntax. The DOCTYPE declaration shown earlier is an example " -"of XML syntax included in the document." -msgstr "" - -#. (itstool) path: sect1/title -#: book.translate.xml:2723 -msgid "Comments" -msgstr "註解" - -#. (itstool) path: sect1/para -#: book.translate.xml:2725 -msgid "" -"An XML document may contain comments. They may appear " -"anywhere as long as they are not inside tags. They are even allowed in some " -"locations inside the DTD (e.g., between entity declarations)." -msgstr "" - -#. (itstool) path: sect1/para -#: book.translate.xml:2731 -msgid "" -"XML comments start with the string <!--" -" and end with the string -->." -msgstr "" - -#. (itstool) path: sect1/para -#: book.translate.xml:2735 -msgid "Here are some examples of valid XML comments:" -msgstr "" - -#. (itstool) path: example/title -#: book.translate.xml:2739 -msgid "XML Generic Comments" -msgstr "XML 通用註解" - -#. (itstool) path: example/programlisting -#: book.translate.xml:2741 -#, no-wrap -msgid "" -"<!-- This is inside the comment -->\n" -"\n" -"<!--This is another comment-->\n" -"\n" -"<!-- This is how you\n" -" write multiline comments -->\n" -"\n" -"<p>A simple <!-- Comment inside an element's content --> paragraph.</p>" -msgstr "" - -#. (itstool) path: sect1/para -#: book.translate.xml:2751 -msgid "" -"XML comments may contain any strings except " -"--:" -msgstr "" - -#. (itstool) path: example/title -#: book.translate.xml:2755 -msgid "Erroneous XML Comment" -msgstr "錯誤的XML 註解" - -#. (itstool) path: example/programlisting -#: book.translate.xml:2757 -#, no-wrap -msgid "<!-- This comment--is wrong -->" -msgstr "" - -#. (itstool) path: step/para -#: book.translate.xml:2765 -msgid "" -"Add some comments to example.xml, and check that the " -"file still validates using xmllint." -msgstr "" - -#. (itstool) path: step/para -#: book.translate.xml:2771 -msgid "" -"Add some invalid comments to example.xml, and see the " -"error messages that xmllint gives when it encounters an " -"invalid comment." -msgstr "" - -#. (itstool) path: sect1/title -#: book.translate.xml:2781 -msgid "Entities" -msgstr "Entities" - -#. (itstool) path: sect1/para -#: book.translate.xml:2783 -msgid "" -"Entities are a mechanism for assigning names to chunks of content. As an " -"XML parser processes a document, any entities it finds " -"are replaced by the content of the entity." -msgstr "" - -#. (itstool) path: sect1/para -#: book.translate.xml:2788 -msgid "" -"This is a good way to have re-usable, easily changeable chunks of content in " -"XML documents. It is also the only way to include one " -"marked up file inside another using XML." -msgstr "" - -#. (itstool) path: sect1/para -#: book.translate.xml:2793 -msgid "" -"There are two types of entities for two different situations: " -"general entities and parameter entities." -msgstr "" - -#. (itstool) path: sect2/title -#: book.translate.xml:2798 -msgid "General Entities" -msgstr "一般 Entities" - -#. (itstool) path: sect2/para -#: book.translate.xml:2800 -msgid "" -"General entities are used to assign names to reusable chunks of text. These " -"entities can only be used in the document. They cannot be used in an " -"XML context." -msgstr "" - -#. (itstool) path: sect2/para -#: book.translate.xml:2805 -msgid "" -"To include the text of a general entity in the document, include " -"&entity-name; in the text. " -"For example, consider a general entity called current.version which expands to the current version number of a product. To use it " -"in the document, write:" -msgstr "" - -#. (itstool) path: sect2/programlisting -#: book.translate.xml:2813 -#, no-wrap -msgid "" -"paraThe current version of our product is\n" -" &current.version;.para" -msgstr "" - -#. (itstool) path: sect2/para -#: book.translate.xml:2816 -msgid "" -"When the version number changes, edit the definition of the general entity, " -"replacing the value. Then reprocess the document." -msgstr "" - -#. (itstool) path: sect2/para -#: book.translate.xml:2820 -msgid "" -"General entities can also be used to enter characters that could not " -"otherwise be included in an XML document. For example, " -"< and & cannot normally appear " -"in an XML document. The XML parser " -"sees the < symbol as the start of a tag. Likewise, " -"when the & symbol is seen, the next text is expected " -"to be an entity name." -msgstr "" - -#. (itstool) path: sect2/para -#: book.translate.xml:2829 -msgid "" -"These symbols can be included by using two predefined general entities: " -"&lt; and &amp;." -msgstr "" - -#. (itstool) path: sect2/para -#: book.translate.xml:2833 -msgid "" -"General entities can only be defined within an XML " -"context. Such definitions are usually done immediately after the DOCTYPE " -"declaration." -msgstr "" - -#. (itstool) path: example/title -#: book.translate.xml:2838 -msgid "Defining General Entities" -msgstr "定義一般 Entities" - -#. (itstool) path: example/programlisting -#: book.translate.xml:2840 -#, no-wrap -msgid "" -"<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\"\n" -"\"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\" [\n" -"<!ENTITY current.version \"3.0-RELEASE\">\n" -"<!ENTITY last.version \"2.2.7-RELEASE\">\n" -"]>" -msgstr "" - -#. (itstool) path: example/para -#: book.translate.xml:2846 -msgid "" -"The DOCTYPE declaration has been extended by adding a square bracket at the " -"end of the first line. The two entities are then defined over the next two " -"lines, the square bracket is closed, and then the DOCTYPE declaration is " -"closed." -msgstr "" - -#. (itstool) path: example/para -#: book.translate.xml:2852 -msgid "" -"The square brackets are necessary to indicate that the DTD indicated by the " -"DOCTYPE declaration is being extended." -msgstr "" - -#. (itstool) path: sect2/title -#: book.translate.xml:2859 -msgid "Parameter Entities" -msgstr "參數 Entities" - -#. (itstool) path: sect2/para -#: book.translate.xml:2861 -msgid "" -"Parameter entities, like general entities, are used to assign names to reusable chunks of " -"text. But parameter entities can only be used within an XML context." -msgstr "" - -#. (itstool) path: sect2/para -#: book.translate.xml:2868 -msgid "" -"Parameter entity definitions are similar to those for general entities. " -"However, parameter entries are included with %entity-" -"name;. The definition also includes the % between the ENTITY keyword and the name of the " -"entity." -msgstr "" - -#. (itstool) path: sect2/para -#: book.translate.xml:2876 -msgid "" -"For a mnemonic, think Parameter entities use the " -"Percent symbol." -msgstr "" - -#. (itstool) path: example/title -#: book.translate.xml:2881 -msgid "Defining Parameter Entities" -msgstr "定義參數 Entities" - -#. (itstool) path: example/programlisting -#: book.translate.xml:2883 -#, no-wrap -msgid "" -"<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\"\n" -"\"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\" [\n" -"<!ENTITY % param.some \"some\">\n" -"<!ENTITY % param.text \"text\">\n" -"<!ENTITY % param.new \"%param.some more %param.text\">\n" -"\n" -"<!-- %param.new now contains \"some more text\" -->\n" -"]>" -msgstr "" - -#. (itstool) path: step/para -#: book.translate.xml:2899 -msgid "Add a general entity to example.xml." -msgstr "" - -#. (itstool) path: step/programlisting -#: book.translate.xml:2902 -#, no-wrap -msgid "" -"<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\"\n" -"\"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\" [\n" -"<!ENTITY version \"1.1\">\n" -"]>\n" -"\n" -"html xmlns=\"http://www.w3.org/1999/xhtml\"\n" -" head\n" -" titleAn Example XHTML Filetitle\n" -" head\n" -"\n" -" <!-- There may be some comments in here as well -->\n" -"\n" -" body\n" -" pThis is a paragraph containing some text.p\n" -"\n" -" pThis paragraph contains some more text.p\n" -"\n" -" p align=\"right\"This paragraph might be right-justified.p\n" -"\n" -" pThe current version of this document is: &version;p\n" -" body\n" -"html" -msgstr "" - -#. (itstool) path: step/para -#: book.translate.xml:2927 -msgid "Validate the document using xmllint." -msgstr "" - -#. (itstool) path: step/para -#: book.translate.xml:2932 -msgid "" -"Load example.xml into a web browser. It may have to be " -"copied to example.html before the browser recognizes it " -"as an XHTML document." -msgstr "" - -#. (itstool) path: step/para -#: book.translate.xml:2938 -msgid "" -"Older browsers with simple parsers may not render this file as expected. The " -"entity reference &version; may not be replaced by the " -"version number, or the XML context closing ]>" -" may not be recognized and instead shown in the output." -msgstr "" - -#. (itstool) path: step/para -#: book.translate.xml:2947 -msgid "" -"The solution is to normalize the document with an " -"XML normalizer. The normalizer reads valid XML and writes equally valid XML which has been " -"transformed in some way. One way the normalizer transforms the input is by " -"expanding all the entity references in the document, replacing the entities " -"with the text that they represent." -msgstr "" - -#. (itstool) path: step/para -#: book.translate.xml:2956 -msgid "" -"xmllint can be used for this. It also has an option to " -"drop the initial DTD section so that the closing " -"]> does not confuse browsers:" -msgstr "" - -#. (itstool) path: step/screen -#: book.translate.xml:2961 -#, no-wrap -msgid "% xmllint --noent --dropdtd example.xml > example.html" -msgstr "" - -#. (itstool) path: step/para -#: book.translate.xml:2963 -msgid "" -"A normalized copy of the document with entities expanded is produced in " -"example.html, ready to load into a web browser." -msgstr "" - -#. (itstool) path: sect1/title -#: book.translate.xml:2972 -msgid "Using Entities to Include Files" -msgstr "在引用檔使用 Entities" - -#. (itstool) path: sect1/para -#: book.translate.xml:2974 -msgid "" -"Both general and parameter entities are " -"particularly useful for including one file inside another." -msgstr "" - -#. (itstool) path: sect2/title -#. (itstool) path: example/title -#: book.translate.xml:2981 book.translate.xml:2997 -msgid "Using General Entities to Include Files" -msgstr "在引用檔使用一般 Entities" - -#. (itstool) path: sect2/para -#: book.translate.xml:2983 -msgid "" -"Consider some content for an XML book organized into " -"files, one file per chapter, called chapter1.xml, " -"chapter2.xml, and so forth, with a book.xml that will contain these chapters." -msgstr "" - -#. (itstool) path: sect2/para -#: book.translate.xml:2990 -msgid "" -"In order to use the contents of these files as the values for entities, they " -"are declared with the SYSTEM keyword. This directs the " -"XML parser to include the contents of the named file as " -"the value of the entity." -msgstr "" - -#. (itstool) path: example/programlisting -#: book.translate.xml:2999 -#, no-wrap -msgid "" -"<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\"\n" -"\"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\" [\n" -"<!ENTITY chapter.1 SYSTEM \"chapter1.xml\">\n" -"<!ENTITY chapter.2 SYSTEM \"chapter2.xml\">\n" -"<!ENTITY chapter.3 SYSTEM \"chapter3.xml\">\n" -"<!-- And so forth -->\n" -"]>\n" -"\n" -"html xmlns=\"http://www.w3.org/1999/xhtml\"\n" -" <!-- Use the entities to load in the chapters -->\n" -"\n" -" &chapter.1;\n" -" &chapter.2;\n" -" &chapter.3;\n" -"html" -msgstr "" - -#. (itstool) path: warning/para -#: book.translate.xml:3017 -msgid "" -"When using general entities to include other files within a document, the " -"files being included (chapter1.xml, chapter2." -"xml, and so on) must not start with a " -"DOCTYPE declaration. This is a syntax error because entities are low-level " -"constructs and they are resolved before any parsing happens." -msgstr "" - -#. (itstool) path: sect2/title -#. (itstool) path: example/title -#: book.translate.xml:3029 book.translate.xml:3048 -msgid "Using Parameter Entities to Include Files" -msgstr "在引用檔使用參數 Entities" - -#. (itstool) path: sect2/para -#: book.translate.xml:3031 -msgid "" -"Parameter entities can only be used inside an XML " -"context. Including a file in an XML context can be used " -"to ensure that general entities are reusable." -msgstr "" - -#. (itstool) path: sect2/para -#: book.translate.xml:3036 -msgid "" -"Suppose that there are many chapters in the document, and these chapters " -"were reused in two different books, each book organizing the chapters in a " -"different fashion." -msgstr "" - -#. (itstool) path: sect2/para -#: book.translate.xml:3040 -msgid "" -"The entities could be listed at the top of each book, but that quickly " -"becomes cumbersome to manage." -msgstr "" - -#. (itstool) path: sect2/para -#: book.translate.xml:3043 -msgid "" -"Instead, place the general entity definitions inside one file, and use a " -"parameter entity to include that file within the document." -msgstr "" - -#. (itstool) path: example/para -#: book.translate.xml:3050 -msgid "" -"Place the entity definitions in a separate file called chapters." -"ent and containing this text:" -msgstr "" - -#. (itstool) path: example/programlisting -#: book.translate.xml:3054 -#, no-wrap -msgid "" -"<!ENTITY chapter.1 SYSTEM \"chapter1.xml\">\n" -"<!ENTITY chapter.2 SYSTEM \"chapter2.xml\">\n" -"<!ENTITY chapter.3 SYSTEM \"chapter3.xml\">" -msgstr "" - -#. (itstool) path: example/para -#: book.translate.xml:3058 -msgid "" -"Create a parameter entity to refer to the contents of the file. Then use the " -"parameter entity to load the file into the document, which will then make " -"all the general entities available for use. Then use the general entities as " -"before:" -msgstr "" - -#. (itstool) path: example/programlisting -#: book.translate.xml:3064 -#, no-wrap -msgid "" -"<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\"\n" -"\"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\" [\n" -"<!-- Define a parameter entity to load in the chapter general entities -->\n" -"<!ENTITY % chapters SYSTEM \"chapters.ent\">\n" -"\n" -"<!-- Now use the parameter entity to load in this file -->\n" -"%chapters;\n" -"]>\n" -"\n" -"html xmlns=\"http://www.w3.org/1999/xhtml\"\n" -" &chapter.1;\n" -" &chapter.2;\n" -" &chapter.3;\n" -"html" -msgstr "" - -#. (itstool) path: sect3/title -#: book.translate.xml:3085 -msgid "Use General Entities to Include Files" -msgstr "在引用檔使用一般 Entities" - -#. (itstool) path: step/para -#: book.translate.xml:3089 -msgid "" -"Create three files, para1.xml, para2.xml, and para3.xml." -msgstr "" - -#. (itstool) path: step/para -#: book.translate.xml:3093 -msgid "Put content like this in each file:" -msgstr "" - -#. (itstool) path: step/programlisting -#: book.translate.xml:3095 -#, no-wrap -msgid "pThis is the first paragraph.p" -msgstr "" - -#. (itstool) path: step/para -#: book.translate.xml:3099 book.translate.xml:3152 -msgid "Edit example.xml so that it looks like this:" -msgstr "" - -#. (itstool) path: step/programlisting -#: book.translate.xml:3102 -#, no-wrap -msgid "" -"<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\"\n" -"\"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\" [\n" -"<!ENTITY version \"1.1\">\n" -"<!ENTITY para1 SYSTEM \"para1.xml\">\n" -"<!ENTITY para2 SYSTEM \"para2.xml\">\n" -"<!ENTITY para3 SYSTEM \"para3.xml\">\n" -"]>\n" -"\n" -"html xmlns=\"http://www.w3.org/1999/xhtml\"\n" -" head\n" -" titleAn Example XHTML Filetitle\n" -" head\n" -"\n" -" body\n" -" pThe current version of this document is: &version;p\n" -"\n" -" &para1;\n" -" &para2;\n" -" &para3;\n" -" body\n" -"html" -msgstr "" - -#. (itstool) path: step/para -#: book.translate.xml:3126 book.translate.xml:3187 -msgid "" -"Produce example.html by normalizing example." -"xml." -msgstr "" - -#. (itstool) path: step/screen -#: book.translate.xml:3129 book.translate.xml:3190 -#, no-wrap -msgid "% xmllint --dropdtd --noent example.xml > example.html" -msgstr "" - -#. (itstool) path: step/para -#: book.translate.xml:3133 book.translate.xml:3194 -msgid "" -"Load example.html into the web browser and confirm that " -"the paran.xml files have " -"been included in example.html." -msgstr "" - -#. (itstool) path: sect3/title -#: book.translate.xml:3143 -msgid "Use Parameter Entities to Include Files" -msgstr "在引用檔使用參數 Entities" - -#. (itstool) path: note/para -#: book.translate.xml:3146 -msgid "The previous steps must have completed before this step." -msgstr "" - -#. (itstool) path: step/programlisting -#: book.translate.xml:3155 -#, no-wrap -msgid "" -"<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\"\n" -"\"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\" [\n" -"<!ENTITY % entities SYSTEM \"entities.ent\"> %entities;\n" -"]>\n" -"\n" -"html xmlns=\"http://www.w3.org/1999/xhtml\"\n" -" head\n" -" titleAn Example XHTML Filetitle\n" -" head\n" -"\n" -" body\n" -" pThe current version of this document is: &version;p\n" -"\n" -" &para1;\n" -" &para2;\n" -" &para3;\n" -" body\n" -"html" -msgstr "" - -#. (itstool) path: step/para -#: book.translate.xml:3176 -msgid "" -"Create a new file called entities.ent with this content:" -msgstr "" - -#. (itstool) path: step/programlisting -#: book.translate.xml:3180 -#, no-wrap -msgid "" -"<!ENTITY version \"1.1\">\n" -"<!ENTITY para1 SYSTEM \"para1.xml\">\n" -"<!ENTITY para2 SYSTEM \"para2.xml\">\n" -"<!ENTITY para3 SYSTEM \"para3.xml\">" -msgstr "" - -#. (itstool) path: sect1/title -#: book.translate.xml:3206 -msgid "Marked Sections" -msgstr "已標記小節" - -#. (itstool) path: sect1/para -#: book.translate.xml:3208 -msgid "" -"XML provides a mechanism to indicate that particular " -"pieces of the document should be processed in a special way. These are " -"called marked sections." -msgstr "" - -#. (itstool) path: example/title -#: book.translate.xml:3214 -msgid "Structure of a Marked Section" -msgstr "已標記的結構" - -#. (itstool) path: example/programlisting -#: book.translate.xml:3216 -#, no-wrap -msgid "" -"<![KEYWORD[\n" -" Contents of marked section\n" -"]]>" -msgstr "" - -#. (itstool) path: sect1/para -#: book.translate.xml:3221 -msgid "" -"As expected of an XML construct, a marked section starts " -"with <!." -msgstr "" - -#. (itstool) path: sect1/para -#: book.translate.xml:3224 -msgid "The first square bracket begins the marked section." -msgstr "" - -#. (itstool) path: sect1/para -#: book.translate.xml:3226 -msgid "" -"KEYWORD describes how this marked section is to " -"be processed by the parser." -msgstr "" - -#. (itstool) path: sect1/para -#: book.translate.xml:3229 -msgid "" -"The second square bracket indicates the start of the marked section's " -"content." -msgstr "" - -#. (itstool) path: sect1/para -#: book.translate.xml:3232 -msgid "" -"The marked section is finished by closing the two square brackets, and then " -"returning to the document context from the XML context " -"with >." -msgstr "" - -#. (itstool) path: sect2/title -#: book.translate.xml:3238 -msgid "Marked Section Keywords" -msgstr "已標記關鍵字" - -#. (itstool) path: sect3/title -#: book.translate.xml:3241 -msgid "CDATA" -msgstr "" - -#. (itstool) path: sect3/para -#: book.translate.xml:3243 -msgid "" -"These keywords denote the marked sections content model, and allow you to change it from the default." -msgstr "" - -#. (itstool) path: sect3/para -#: book.translate.xml:3247 -msgid "" -"When an XML parser is processing a document, it keeps " -"track of the content model." -msgstr "" - -#. (itstool) path: sect3/para -#: book.translate.xml:3251 -msgid "" -"The content model describes the content the parser is expecting to see and " -"what it will do with that content." -msgstr "" - -#. (itstool) path: sect3/para -#: book.translate.xml:3255 -msgid "The CDATA content model is one of the most useful." -msgstr "" - -#. (itstool) path: sect3/para -#: book.translate.xml:3258 -msgid "" -"CDATA is for Character Data. When the " -"parser is in this content model, it expects to see only characters. In this " -"model the < and & symbols lose " -"their special status, and will be treated as ordinary characters." -msgstr "" - -#. (itstool) path: note/para -#: book.translate.xml:3266 -msgid "" -"When using CDATA in examples of text marked up in " -"XML, remember that the content of CDATA is not validated. The included text must be check with other means. " -"For example, the content could be written in another document, validated, " -"and then pasted into the CDATA section." -msgstr "" - -#. (itstool) path: example/title -#: book.translate.xml:3276 -msgid "Using a CDATA Marked Section" -msgstr "使用 CDATA 已標記小節" - -#. (itstool) path: example/programlisting -#: book.translate.xml:3279 -#, no-wrap -msgid "" -"paraHere is an example of how to include some text that contains\n" -" many literal&lt;literal and literal&amp;literal\n" -" symbols. The sample text is a fragment of\n" -" acronymXHTMLacronym. The surrounding text (para and\n" -" programlisting) are from DocBook.para\n" -"\n" -"programlisting<![CDATA[pThis is a sample that shows some of the\n" -" elements within acronymXHTMLacronym. Since the angle\n" -" brackets are used so many times, it is simpler to say the whole\n" -" example is a CDATA marked section than to use the entity names for\n" -" the left and right angle brackets throughout.p\n" -"\n" -" ul\n" -" liThis is a listitemli\n" -" liThis is a second listitemli\n" -" liThis is a third listitemli\n" -" ul\n" -"\n" -" pThis is the end of the example.p]]>programlisting" -msgstr "" - -#. (itstool) path: sect3/title -#: book.translate.xml:3302 -msgid "INCLUDE and IGNORE" -msgstr "INCLUDEIGNORE" - -#. (itstool) path: sect3/para -#: book.translate.xml:3305 -msgid "" -"When the keyword is INCLUDE, then the contents of the " -"marked section will be processed. When the keyword is IGNORE, the marked section is ignored and will not be processed. It will " -"not appear in the output." -msgstr "" - -#. (itstool) path: example/title -#: book.translate.xml:3312 -msgid "" -"Using INCLUDE and IGNORE in Marked " -"Sections" -msgstr "" -"在已標記小節中使用 INCLUDEIGNORE" - -#. (itstool) path: example/programlisting -#: book.translate.xml:3315 -#, no-wrap -msgid "" -"<![INCLUDE[\n" -" This text will be processed and included.\n" -"]]>\n" -"\n" -"<![IGNORE[\n" -" This text will not be processed or included.\n" -"]]>" -msgstr "" - -#. (itstool) path: sect3/para -#: book.translate.xml:3324 -msgid "" -"By itself, this is not too useful. Text to be removed from the document " -"could be cut out, or wrapped in comments." -msgstr "" - -#. (itstool) path: sect3/para -#: book.translate.xml:3328 -msgid "" -"It becomes more useful when controlled by parameter entities, yet this usage is limited to " -"entity files." -msgstr "" - -#. (itstool) path: sect3/para -#: book.translate.xml:3333 -msgid "" -"For example, suppose that documentation was produced in a hard-copy version " -"and an electronic version. Some extra text is desired in the electronic " -"version content that was not to appear in the hard-copy." -msgstr "" - -#. (itstool) path: sect3/para -#: book.translate.xml:3338 -msgid "" -"Create an entity file that defines general entities to include each chapter " -"and guard these definitions with a parameter entity that can be set to " -"either INCLUDE or IGNORE to control " -"whether the entity is defined. After these conditional general entity " -"definitions, place one more definition for each general entity to set them " -"to an empty value. This technique makes use of the fact that entity " -"definitions cannot be overridden but the first definition always takes " -"effect. So the inclusion of the chapter is controlled with the corresponding " -"parameter entity. Set to INCLUDE, the first general " -"entity definition will be read and the second one will be ignored. Set to " -"IGNORE, the first definition will be ignored and the " -"second one will take effect." -msgstr "" - -#. (itstool) path: example/title -#: book.translate.xml:3355 -msgid "Using a Parameter Entity to Control a Marked Section" -msgstr "使用參數 Entities 來控制已標記小節" - -#. (itstool) path: example/programlisting -#: book.translate.xml:3358 -#, no-wrap -msgid "" -"<!ENTITY % electronic.copy \"INCLUDE\">\n" -"\n" -"<![%electronic.copy;[\n" -"<!ENTITY chap.preface\tSYSTEM \"preface.xml\">\n" -"]]>\n" -"\n" -"<!ENTITY chap.preface \"\">" -msgstr "" - -#. (itstool) path: example/para -#: book.translate.xml:3366 -msgid "" -"When producing the hard-copy version, change the parameter entity's " -"definition to:" -msgstr "" - -#. (itstool) path: example/programlisting -#: book.translate.xml:3369 -#, no-wrap -msgid "<!ENTITY % electronic.copy \"IGNORE\">" -msgstr "" - -#. (itstool) path: step/para -#: book.translate.xml:3379 -msgid "Modify entities.ent to contain the following:" -msgstr "" - -#. (itstool) path: step/programlisting -#: book.translate.xml:3382 -#, no-wrap -msgid "" -"<!ENTITY version \"1.1\">\n" -"<!ENTITY % conditional.text \"IGNORE\">\n" -"\n" -"<![%conditional.text;[\n" -"<!ENTITY para1 SYSTEM \"para1.xml\">\n" -"]]>\n" -"\n" -"<!ENTITY para1 \"\">\n" -"\n" -"<!ENTITY para2 SYSTEM \"para2.xml\">\n" -"<!ENTITY para3 SYSTEM \"para3.xml\">" -msgstr "" - -#. (itstool) path: step/para -#: book.translate.xml:3396 -msgid "" -"Normalize example.xml and notice that the conditional " -"text is not present in the output document. Set the parameter entity guard " -"to INCLUDE and regenerate the normalized document and the " -"text will appear again. This method makes sense if there are more " -"conditional chunks depending on the same condition. For example, to control " -"generating printed or online text." -msgstr "" - -#. (itstool) path: sect1/title -#: book.translate.xml:3411 -msgid "Conclusion" -msgstr "結論" - -#. (itstool) path: sect1/para -#: book.translate.xml:3413 -msgid "" -"That is the conclusion of this XML primer. For reasons of " -"space and complexity, several things have not been covered in depth (or at " -"all). However, the previous sections cover enough XML to " -"introduce the organization of the FDP documentation." -msgstr "" - -#. (itstool) path: chapter/title -#: book.translate.xml:3455 -msgid "XHTML Markup" -msgstr "XHTML 標籤" - -#. (itstool) path: sect1/title -#: book.translate.xml:3458 book.translate.xml:4061 book.translate.xml:7308 -msgid "Introduction" -msgstr "簡介" - -#. (itstool) path: sect1/para -#: book.translate.xml:3460 -msgid "" -"This chapter describes usage of the XHTML markup language " -"used for the FreeBSD web site." -msgstr "" - -#. (itstool) path: sect1/para -#: book.translate.xml:3463 -msgid "" -"XHTML is the XML version of the " -"HyperText Markup Language, the markup language of choice on the World Wide " -"Web. More information can be found at http://www.w3.org/." -msgstr "" - -#. (itstool) path: sect1/para -#: book.translate.xml:3468 -msgid "" -"XHTML is used to mark up pages on the FreeBSD web site. " -"It is usually not used to mark up other documentation, since DocBook offers " -"a far richer set of elements from which to choose. Consequently, " -"XHTML pages will normally only be encountered when " -"writing for the web site." -msgstr "" - -#. (itstool) path: sect1/para -#: book.translate.xml:3475 -msgid "" -"HTML has gone through a number of versions. The " -"XML-compliant version described here is called " -"XHTML. The latest widespread version is XHTML 1.0, available in both strict and " -"transitional variants." -msgstr "" - -#. (itstool) path: sect1/para -#: book.translate.xml:3482 -msgid "" -"The XHTML DTDs are available from the " -"Ports Collection in textproc/xhtml. They are " -"automatically installed by the textproc/docproj port." -msgstr "" - -#. (itstool) path: note/para -#: book.translate.xml:3488 -msgid "" -"This is not an exhaustive list of elements, since that " -"would just repeat the documentation for XHTML. The aim is " -"to list those elements most commonly used. Please post questions about " -"elements or uses not covered here to the FreeBSD documentation project " -"mailing list." -msgstr "" - -#. (itstool) path: note/title -#: book.translate.xml:3496 book.translate.xml:4100 -msgid "Inline Versus Block" -msgstr "" - -#. (itstool) path: note/para -#: book.translate.xml:3498 book.translate.xml:4102 -msgid "" -"In the remainder of this document, when describing elements, " -"inline means that the element can occur within a block " -"element, and does not cause a line break. A block " -"element, by comparison, will cause a line break (and other processing) when " -"it is encountered." -msgstr "" - -#. (itstool) path: sect1/title -#: book.translate.xml:3508 -msgid "Formal Public Identifier (FPI)" -msgstr "正式公用識別碼 (FPI)" - -#. (itstool) path: sect1/para -#: book.translate.xml:3510 -msgid "" -"There are a number of XHTML FPIs, " -"depending upon the version, or level of XHTML to which a document conforms. Most XHTML " -"documents on the FreeBSD web site comply with the transitional version of " -"XHTML 1.0." -msgstr "" - -#. (itstool) path: sect1/programlisting -#: book.translate.xml:3517 -#, no-wrap -msgid "PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\"" -msgstr "" - -#. (itstool) path: sect1/title -#: book.translate.xml:3521 -msgid "Sectional Elements" -msgstr "分節元素" - -#. (itstool) path: sect1/para -#: book.translate.xml:3523 -msgid "" -"An XHTML document is normally split into two sections. " -"The first section, called the head, contains meta-" -"information about the document, such as its title, the name of the author, " -"the parent document, and so on. The second section, the body, contains content that will be displayed to the user." -msgstr "" - -#. (itstool) path: sect1/para -#: book.translate.xml:3531 -msgid "" -"These sections are indicated with head and body " -"elements respectively. These elements are contained within the top-level " -"html element." -msgstr "" - -#. (itstool) path: example/title -#: book.translate.xml:3537 -msgid "Normal XHTML Document Structure" -msgstr "一般的 XHTML 文件結構" - -#. (itstool) path: example/programlisting -#: book.translate.xml:3540 -#, no-wrap -msgid "" -"html xmlns=\"http://www.w3.org/1999/xhtml\"\n" -" head\n" -"\t titleThe Document's Titletitle\n" -" head\n" -"\n" -" body\n" -"\n" -" …\n" -"\n" -" body\n" -"html" -msgstr "" - -#. (itstool) path: sect1/title -#: book.translate.xml:3555 book.translate.xml:4700 -msgid "Block Elements" -msgstr "區塊元素" - -#. (itstool) path: sect2/title -#: book.translate.xml:3558 -msgid "Headings" -msgstr "標題" - -#. (itstool) path: sect2/para -#: book.translate.xml:3560 -msgid "" -"XHTML has tags to denote headings in the document at up " -"to six different levels." -msgstr "" - -#. (itstool) path: sect2/para -#: book.translate.xml:3563 -msgid "" -"The largest and most prominent heading is h1, then h2, " -"continuing down to h6." -msgstr "" - -#. (itstool) path: sect2/para -#: book.translate.xml:3567 -msgid "The element's content is the text of the heading." -msgstr "" - -#. (itstool) path: example/title -#: book.translate.xml:3570 -msgid "h1, h2, and Other Header Tags" -msgstr "h1, h2, 以及其他標題標籤" - -#. (itstool) path: example/para -#: book.translate.xml:3573 book.translate.xml:3608 book.translate.xml:3624 -#: book.translate.xml:3669 book.translate.xml:3701 book.translate.xml:3778 -#: book.translate.xml:3806 book.translate.xml:3828 book.translate.xml:3850 -#: book.translate.xml:3906 book.translate.xml:3923 book.translate.xml:3953 -#: book.translate.xml:3978 book.translate.xml:4719 book.translate.xml:4745 -#: book.translate.xml:4826 book.translate.xml:4860 book.translate.xml:4907 -#: book.translate.xml:4967 book.translate.xml:5029 book.translate.xml:5109 -#: book.translate.xml:5243 book.translate.xml:5404 book.translate.xml:5463 -#: book.translate.xml:5490 book.translate.xml:5520 book.translate.xml:5559 -#: book.translate.xml:5667 book.translate.xml:5724 book.translate.xml:5775 -#: book.translate.xml:5894 book.translate.xml:5962 book.translate.xml:5991 -#: book.translate.xml:6012 book.translate.xml:6054 book.translate.xml:6109 -#: book.translate.xml:6142 book.translate.xml:6159 book.translate.xml:6193 -#: book.translate.xml:6217 book.translate.xml:6697 book.translate.xml:6713 -msgid "Usage:" -msgstr "用法:" - -#. (itstool) path: example/programlisting -#: book.translate.xml:3575 -#, no-wrap -msgid "" -"h1First sectionh1\n" -"\n" -"<!-- Document introduction goes here -->\n" -"\n" -"h2This is the heading for the first sectionh2\n" -"\n" -"<!-- Content for the first section goes here -->\n" -"\n" -"h3This is the heading for the first sub-sectionh3\n" -"\n" -"<!-- Content for the first sub-section goes here -->\n" -"\n" -"h2This is the heading for the second sectionh2\n" -"\n" -"<!-- Content for the second section goes here -->" -msgstr "" - -#. (itstool) path: sect2/para -#: book.translate.xml:3592 -msgid "" -"Generally, an XHTML page should have one first level " -"heading (h1). This can contain many second level headings " -"(h2), which can in turn contain many third level headings. Do not " -"leave gaps in the numbering." -msgstr "" - -#. (itstool) path: sect2/title -#: book.translate.xml:3600 book.translate.xml:4703 -msgid "Paragraphs" -msgstr "段落" - -#. (itstool) path: sect2/para -#: book.translate.xml:3602 -msgid "" -"XHTML supports a single paragraph element, p." -msgstr "" - -#. (itstool) path: example/title -#: book.translate.xml:3606 -msgid "p Example" -msgstr "p 範例" - -#. (itstool) path: example/programlisting -#: book.translate.xml:3610 -#, no-wrap -msgid "" -"pThis is a paragraph. It can contain just about any\n" -" other element.p" -msgstr "" - -#. (itstool) path: sect2/title -#: book.translate.xml:3616 book.translate.xml:4732 -msgid "Block Quotations" -msgstr "區塊引言" - -#. (itstool) path: sect2/para -#: book.translate.xml:3618 -msgid "" -"A block quotation is an extended quotation from another document that will " -"appear in a separate paragraph." -msgstr "" - -#. (itstool) path: example/title -#: book.translate.xml:3622 book.translate.xml:4743 -msgid "blockquote Example" -msgstr "blockquote 範例" - -#. (itstool) path: example/programlisting -#: book.translate.xml:3626 -#, no-wrap -msgid "" -"pA small excerpt from the US Constitution:p\n" -"\n" -"blockquoteWe the People of the United States, in Order to form\n" -" a more perfect Union, establish Justice, insure domestic\n" -" Tranquility, provide for the common defence, promote the general\n" -" Welfare, and secure the Blessings of Liberty to ourselves and our\n" -" Posterity, do ordain and establish this Constitution for the\n" -" United States of America.blockquote" -msgstr "" - -#. (itstool) path: sect2/title -#: book.translate.xml:3638 -msgid "Lists" -msgstr "清單" - -#. (itstool) path: sect2/para -#: book.translate.xml:3640 -msgid "" -"XHTML can present the user with three types of lists: " -"ordered, unordered, and definition." -msgstr "" - -#. (itstool) path: sect2/para -#: book.translate.xml:3643 -msgid "" -"Entries in an ordered list will be numbered, while entries in an unordered " -"list will be preceded by bullet points. Definition lists have two sections " -"for each entry. The first section is the term being defined, and the second " -"section is the definition." -msgstr "" - -#. (itstool) path: sect2/para -#: book.translate.xml:3649 -msgid "" -"Ordered lists are indicated by the ol element, unordered lists by " -"the ul element, and definition lists by the dl element." -msgstr "" - -#. (itstool) path: sect2/para -#: book.translate.xml:3654 -msgid "" -"Ordered and unordered lists contain listitems, indicated by the li element. A listitem can contain textual content, or it may be further " -"wrapped in one or more p elements." -msgstr "" - -#. (itstool) path: sect2/para -#: book.translate.xml:3659 -msgid "" -"Definition lists contain definition terms (dt) and definition " -"descriptions (dd). A definition term can only contain inline " -"elements. A definition description can contain other block elements." -msgstr "" - -#. (itstool) path: example/title -#: book.translate.xml:3666 -msgid "ul and ol Example" -msgstr "ulol 範例" - -#. (itstool) path: example/programlisting -#: book.translate.xml:3671 -#, no-wrap -msgid "" -"pAn unordered list. Listitems will probably be\n" -" preceded by bullets.p\n" -"\n" -"ul\n" -" liFirst itemli\n" -"\n" -" liSecond itemli\n" -"\n" -" liThird itemli\n" -"ul\n" -"\n" -"pAn ordered list, with list items consisting of multiple\n" -" paragraphs. Each item (note: not each paragraph) will be\n" -" numbered.p\n" -"\n" -"ol\n" -" lipThis is the first item. It only has one paragraph.pli\n" -"\n" -" lipThis is the first paragraph of the second item.p\n" -"\n" -" pThis is the second paragraph of the second item.pli\n" -"\n" -" lipThis is the first and only paragraph of the third\n" -" item.pli\n" -"ol" -msgstr "" - -#. (itstool) path: example/title -#: book.translate.xml:3699 -msgid "Definition Lists with dl" -msgstr "使用 dl 列定義清單" - -#. (itstool) path: example/programlisting -#: book.translate.xml:3703 -#, no-wrap -msgid "" -"dl\n" -" dtTerm 1dt\n" -"\n" -" ddpParagraph 1 of definition 1.p\n" -"\n" -" pParagraph 2 of definition 1.pdd\n" -"\n" -" dtTerm 2dt\n" -"\n" -" ddpParagraph 1 of definition 2.pdd\n" -"\n" -" dtTerm 3dt\n" -"\n" -" ddpParagraph 1 of definition 3.pdd\n" -"dl" -msgstr "" - -#. (itstool) path: sect2/title -#: book.translate.xml:3722 -msgid "Pre-formatted Text" -msgstr "已預排文字" - -#. (itstool) path: sect2/para -#: book.translate.xml:3724 -msgid "" -"Pre-formatted text is shown to the user exactly as it is in the file. Text " -"is shown in a fixed font. Multiple spaces and line breaks are shown exactly " -"as they are in the file." -msgstr "" - -#. (itstool) path: sect2/para -#: book.translate.xml:3729 -msgid "Wrap pre-formatted text in the pre element." -msgstr "" - -#. (itstool) path: example/title -#: book.translate.xml:3733 -msgid "pre Example" -msgstr "pre 範例" - -#. (itstool) path: example/para -#: book.translate.xml:3735 -msgid "" -"For example, the pre tags could be used to mark up an email " -"message:" -msgstr "" - -#. (itstool) path: example/programlisting -#: book.translate.xml:3738 -#, no-wrap -msgid "" -"pre From: nik@FreeBSD.org\n" -" To: freebsd-doc@FreeBSD.org\n" -" Subject: New documentation available\n" -"\n" -" There is a new copy of my primer for contributors to the FreeBSD\n" -" Documentation Project available at\n" -"\n" -" &lt;URL:http://people.FreeBSD.org/~nik/primer/index.html&gt;\n" -"\n" -" Comments appreciated.\n" -"\n" -" Npre" -msgstr "" - -#. (itstool) path: example/para -#: book.translate.xml:3751 -msgid "" -"Keep in mind that < and & still " -"are recognized as special characters in pre-formatted text. This is why the " -"example shown had to use &lt; instead of <" -". For consistency, &gt; was used in place " -"of >, too. Watch out for the special characters that " -"may appear in text copied from a plain-text source, like an email message or " -"program code." -msgstr "" - -#. (itstool) path: sect2/title -#: book.translate.xml:3764 book.translate.xml:5216 -msgid "Tables" -msgstr "表格" - -#. (itstool) path: sect2/para -#: book.translate.xml:3766 -msgid "" -"Mark up tabular information using the table element. A table " -"consists of one or more table rows (tr), each containing one or " -"more cells of table data (td). Each cell can contain other block " -"elements, such as paragraphs or lists. It can also contain another table " -"(this nesting can repeat indefinitely). If the cell only contains one " -"paragraph then the pelement is not needed." -msgstr "" - -#. (itstool) path: example/title -#: book.translate.xml:3776 -msgid "Simple Use of table" -msgstr "table 的簡單用法" - -#. (itstool) path: example/programlisting -#: book.translate.xml:3780 -#, no-wrap -msgid "" -"pThis is a simple 2x2 table.p\n" -"\n" -"table\n" -" tr\n" -" tdTop left celltd\n" -"\n" -" tdTop right celltd\n" -" tr\n" -"\n" -" tr\n" -" tdBottom left celltd\n" -"\n" -" tdBottom right celltd\n" -" tr\n" -"table" -msgstr "" - -#. (itstool) path: sect2/para -#: book.translate.xml:3797 -msgid "" -"A cell can span multiple rows and columns by adding the rowspan or colspan " -"attributes with values for the number of rows or columns to be spanned." -msgstr "" - -#. (itstool) path: example/title -#: book.translate.xml:3803 -msgid "Using rowspan" -msgstr "使用 rowspan" - -#. (itstool) path: example/programlisting -#: book.translate.xml:3808 -#, no-wrap -msgid "" -"pOne tall thin cell on the left, two short cells next to\n" -" it on the right.p\n" -"\n" -"table\n" -" tr\n" -" td rowspan=\"2\"Long and thintd\n" -" tr\n" -"\n" -" tr\n" -" tdTop celltd\n" -"\n" -" tdBottom celltd\n" -" tr\n" -"table" -msgstr "" - -#. (itstool) path: example/title -#: book.translate.xml:3825 -msgid "Using colspan" -msgstr "使用 colspan" - -#. (itstool) path: example/programlisting -#: book.translate.xml:3830 -#, no-wrap -msgid "" -"pOne long cell on top, two short cells below it.p\n" -"\n" -"table\n" -" tr\n" -" td colspan=\"2\"Top celltd\n" -" tr\n" -"\n" -" tr\n" -" tdBottom left celltd\n" -"\n" -" tdBottom right celltd\n" -" tr\n" -"table" -msgstr "" - -#. (itstool) path: example/title -#: book.translate.xml:3846 -msgid "" -"Using rowspan and colspan Together" -msgstr "" -"rowspancolspan 一起使用" - -#. (itstool) path: example/programlisting -#: book.translate.xml:3852 -#, no-wrap -msgid "" -"pOn a 3x3 grid, the top left block is a 2x2 set of\n" -" cells merged into one. The other cells are normal.p\n" -"\n" -"table\n" -" tr\n" -" td colspan=\"2\" rowspan=\"2\"Top left large celltd\n" -"\n" -" tdTop right celltd\n" -" tr\n" -"\n" -" tr\n" -" <!-- Because the large cell on the left merges into\n" -" this row, the first <td> will occur on its\n" -" right -->\n" -"\n" -" tdMiddle right celltd\n" -" tr\n" -"\n" -" tr\n" -" tdBottom left celltd\n" -"\n" -" tdBottom middle celltd\n" -"\n" -" tdBottom right celltd\n" -" tr\n" -"table" -msgstr "" - -#. (itstool) path: sect1/title -#: book.translate.xml:3883 book.translate.xml:5442 -msgid "In-line Elements" -msgstr "行內元素" - -#. (itstool) path: sect2/title -#: book.translate.xml:3886 book.translate.xml:5445 -msgid "Emphasizing Information" -msgstr "強調資訊" - -#. (itstool) path: sect2/para -#: book.translate.xml:3888 -msgid "" -"Two levels of emphasis are available in XHTML, em and strong. em is for a normal level of emphasis " -"and strong indicates stronger emphasis." -msgstr "" - -#. (itstool) path: sect2/para -#: book.translate.xml:3894 -msgid "" -"em is typically rendered in italic and strong is " -"rendered in bold. This is not always the case, and should not be relied " -"upon. According to best practices, web pages only hold structural and " -"semantical information, and stylesheets are later applied to them. Think of " -"semantics, not formatting, when using these tags." -msgstr "" - -#. (itstool) path: example/title -#: book.translate.xml:3903 -msgid "em and strong Example" -msgstr "emstrong 範例" - -#. (itstool) path: example/programlisting -#: book.translate.xml:3908 -#, no-wrap -msgid "" -"pemThisem has been emphasized, while\n" -" strongthisstrong has been strongly emphasized.p" -msgstr "" - -#. (itstool) path: sect2/title -#: book.translate.xml:3914 -msgid "Indicating Fixed-Pitch Text" -msgstr "標示等寬文字" - -#. (itstool) path: sect2/para -#: book.translate.xml:3916 -msgid "" -"Content that should be rendered in a fixed pitch (typewriter) typeface is " -"tagged with tt (for teletype)." -msgstr "" - -#. (itstool) path: example/title -#: book.translate.xml:3921 -msgid "tt Example" -msgstr "tt 範例" - -#. (itstool) path: example/programlisting -#: book.translate.xml:3925 -#, no-wrap -msgid "" -"pMany system settings are stored in\n" -" tt/etctt.p" -msgstr "" - -#. (itstool) path: sect2/title -#. (itstool) path: sect1/title -#: book.translate.xml:3931 book.translate.xml:6535 -msgid "Links" -msgstr "連結" - -#. (itstool) path: note/para -#: book.translate.xml:3934 -msgid "Links are also inline elements." -msgstr "" - -#. (itstool) path: sect3/title -#. (itstool) path: sect2/title -#: book.translate.xml:3938 book.translate.xml:6630 -msgid "Linking to Other Documents on the Web" -msgstr "連結在網站上的其他文件" - -#. (itstool) path: sect3/para -#: book.translate.xml:3940 -msgid "" -"A link points to the URL of a document on the web. The " -"link is indicated with a, and the href attribute contains the URL of the target document. " -"The content of the element becomes the link, indicated to the user by " -"showing it in a different color or with an underline." -msgstr "" - -#. (itstool) path: example/title -#: book.translate.xml:3950 -msgid "Using a href=\"...\"" -msgstr "使用 a href=\"...\"" - -#. (itstool) path: example/programlisting -#: book.translate.xml:3955 -#, no-wrap -msgid "" -"pMore information is available at the\n" -" a href=\"http://www.&os;.org/\"&os; web sitea.p" -msgstr "" - -#. (itstool) path: sect3/para -#: book.translate.xml:3959 -msgid "This link always takes the user to the top of the linked document." -msgstr "" - -#. (itstool) path: sect3/title -#: book.translate.xml:3964 -msgid "Linking to Specific Parts of Documents" -msgstr "連結說明文件的特定章節" - -#. (itstool) path: sect3/para -#: book.translate.xml:3966 -msgid "" -"To link to a specific point within a document, that document must include an " -"anchor at the desired point. Anchors are included by " -"setting the id attribute of an element to a " -"name. This example creates an anchor by setting the id attribute of a p element." -msgstr "" - -#. (itstool) path: example/title -#: book.translate.xml:3976 -msgid "Creating an Anchor" -msgstr "建立錨點" - -#. (itstool) path: example/programlisting -#: book.translate.xml:3980 -#, no-wrap -msgid "" -"p id=\"samplepara\"This paragraph can be referenced\n" -" in other links with the name ttsampleparatt.p" -msgstr "" - -#. (itstool) path: sect3/para -#: book.translate.xml:3984 -msgid "" -"Links to anchors are similar to plain links, but include a # symbol and the anchor's ID at the end of the " -"URL." -msgstr "" - -#. (itstool) path: example/title -#: book.translate.xml:3990 -msgid "Linking to a Named Part of a Different Document" -msgstr "連結到另一份文件中已命名的段落" - -#. (itstool) path: example/para -#: book.translate.xml:3993 -msgid "" -"The samplepara example is part of a document called " -"foo.html. A link to that specific paragraph in the " -"document is constructed in this example." -msgstr "" - -#. (itstool) path: example/programlisting -#: book.translate.xml:3998 -#, no-wrap -msgid "" -"pMore information can be found in the\n" -" a href=\"foo.html#samplepara\"sample paragrapha of\n" -" ttfoo.htmltt.p" -msgstr "" - -#. (itstool) path: sect3/para -#: book.translate.xml:4003 -msgid "" -"To link to a named anchor within the same document, omit the document's " -"URL, and just use the # symbol " -"followed by the name of the anchor." -msgstr "" - -#. (itstool) path: example/title -#: book.translate.xml:4009 -msgid "Linking to a Named Part of the Same Document" -msgstr "連結到同一份文件已命名的段茖" - -#. (itstool) path: example/para -#: book.translate.xml:4011 -msgid "" -"The samplepara example resides in this document. To link " -"to it:" -msgstr "" - -#. (itstool) path: example/programlisting -#: book.translate.xml:4014 -#, no-wrap -msgid "" -"pMore information can be found in the\n" -" a href=\"#samplepara\"sample paragrapha of this\n" -" document.p" -msgstr "" - -#. (itstool) path: chapter/title -#: book.translate.xml:4058 -msgid "DocBook Markup" -msgstr "DocBook 標籤" - -#. (itstool) path: sect1/para -#: book.translate.xml:4063 -msgid "" -"This chapter is an introduction to DocBook as it is used for FreeBSD " -"documentation. DocBook is a large and complex markup system, but the subset " -"described here covers the parts that are most widely used for FreeBSD " -"documentation. While a moderate subset is covered, it is impossible to " -"anticipate every situation. Please post questions that this document does " -"not answer to the FreeBSD documentation project mailing list." -msgstr "" - -#. (itstool) path: footnote/para -#: book.translate.xml:4074 -msgid "" -"A short history can be found under http://www.oasis-open.org/docbook/intro." -"shtml#d0e41." -msgstr "" - -#. (itstool) path: sect1/para -#: book.translate.xml:4071 -msgid "" -"DocBook was originally developed by HaL Computer Systems and O'Reilly & " -"Associates to be a Document Type Definition (DTD) for " -"writing technical documentation <_:footnote-1/>. Since 1998 it is maintained " -"by the DocBook Technical Committee. As such, and unlike " -"LinuxDoc and XHTML, DocBook is very heavily oriented " -"towards markup that describes what something is, rather " -"than describing how it should be presented." -msgstr "" - -#. (itstool) path: sect1/para -#: book.translate.xml:4082 -msgid "" -"The DocBook DTD is available from the Ports Collection in " -"the textproc/docbook-xml port. It is automatically " -"installed as part of the textproc/docproj port." -msgstr "" - -#. (itstool) path: note/title -#: book.translate.xml:4090 -msgid "Formal Versus Informal" -msgstr "" - -#. (itstool) path: note/para -#: book.translate.xml:4092 -msgid "" -"Some elements may exist in two forms, formal and " -"informal. Typically, the formal version of the element " -"will consist of a title followed by the informal version of the element. The " -"informal version will not have a title." -msgstr "" - -#. (itstool) path: sect1/title -#: book.translate.xml:4112 -msgid "FreeBSD Extensions" -msgstr "FreeBSD 擴充項目" - -#. (itstool) path: sect1/para -#: book.translate.xml:4114 -msgid "" -"The FreeBSD Documentation Project has extended the DocBook DTD with additional elements and entities. These additions serve to " -"make some of the markup easier or more precise." -msgstr "" - -#. (itstool) path: sect1/para -#: book.translate.xml:4119 -msgid "" -"Throughout the rest of this document, the term DocBook is " -"used to mean the FreeBSD-extended DocBook DTD." -msgstr "" - -#. (itstool) path: note/para -#: book.translate.xml:4124 -msgid "" -"Most of these extensions are not unique to FreeBSD, it was just felt that " -"they were useful enhancements for this particular project. Should anyone " -"from any of the other *nix camps (NetBSD, OpenBSD, Linux, …) be interested " -"in collaborating on a standard DocBook extension set, please contact " -"Documentation Engineering Team doceng@FreeBSD.org." -msgstr "" - -#. (itstool) path: sect2/title -#: book.translate.xml:4133 -msgid "FreeBSD Elements" -msgstr "FreeBSD 元素" - -#. (itstool) path: sect2/para -#: book.translate.xml:4135 -msgid "" -"The additional FreeBSD elements are not (currently) in the Ports Collection. " -"They are stored in the FreeBSD Subversion tree, as head/share/xml/freebsd." -"dtd." -msgstr "" - -#. (itstool) path: sect2/para -#: book.translate.xml:4139 -msgid "" -"FreeBSD-specific elements used in the examples below are clearly marked." -msgstr "" - -#. (itstool) path: sect2/title -#: book.translate.xml:4144 -msgid "FreeBSD Entities" -msgstr "FreeBSD Entities" - -#. (itstool) path: sect2/para -#: book.translate.xml:4146 -msgid "" -"This table shows some of the most useful entities available in the " -"FDP. For a complete list, see the *.ent files in doc/share/xml." -msgstr "" - -#. (itstool) path: row/entry -#: book.translate.xml:4166 -msgid "FreeBSD Name Entities" -msgstr "" - -#. (itstool) path: row/entry -#: book.translate.xml:4171 -msgid "&os;" -msgstr "" - -#. (itstool) path: row/entry -#: book.translate.xml:4172 -msgid "FreeBSD" -msgstr "" - -#. (itstool) path: row/entry -#: book.translate.xml:4177 -msgid "&os.stable;" -msgstr "" - -#. (itstool) path: row/entry -#: book.translate.xml:4178 -msgid "FreeBSD-STABLE" -msgstr "" - -#. (itstool) path: row/entry -#: book.translate.xml:4183 -msgid "&os.current;" -msgstr "" - -#. (itstool) path: row/entry -#: book.translate.xml:4184 -msgid "FreeBSD-CURRENT" -msgstr "" - -#. (itstool) path: row/entry -#: book.translate.xml:4195 -msgid "Manual Page Entities" -msgstr "" - -#. (itstool) path: row/entry -#: book.translate.xml:4200 -msgid "&man.ls.1;" -msgstr "" - -#. (itstool) path: row/entry -#: book.translate.xml:4201 -msgid "" -"ls1" -msgstr "" - -#. (itstool) path: row/entry -#: book.translate.xml:4202 -msgid "" -"Usage: &man.ls.1; is the manual page for <command>ls</" -"command>." -msgstr "" - -#. (itstool) path: row/entry -#: book.translate.xml:4208 -msgid "&man.cp.1;" -msgstr "" - -#. (itstool) path: row/entry -#: book.translate.xml:4209 -msgid "" -"cp1" -msgstr "" - -#. (itstool) path: row/entry -#: book.translate.xml:4210 -msgid "" -"Usage: The manual page for <command>cp</command> is " -"&man.cp.1;." -msgstr "" - -#. (itstool) path: row/entry -#: book.translate.xml:4216 -msgid "" -"&man.command." -"sectionnumber;" -msgstr "" - -#. (itstool) path: row/entry -#: book.translate.xml:4217 -msgid "" -"link to command manual page in section " -"sectionnumber" -msgstr "" - -#. (itstool) path: row/entry -#: book.translate.xml:4221 -msgid "" -"Entities are defined for all the FreeBSD manual pages." -msgstr "" - -#. (itstool) path: row/entry -#: book.translate.xml:4233 -msgid "FreeBSD Mailing List Entities" -msgstr "" - -#. (itstool) path: row/entry -#: book.translate.xml:4238 -msgid "&a.doc;" -msgstr "" - -#. (itstool) path: row/entry -#: book.translate.xml:4239 -msgid "" -"FreeBSD documentation project mailing list" -msgstr "" - -#. (itstool) path: row/entry -#: book.translate.xml:4240 -msgid "Usage: A link to the &a.doc;." -msgstr "" - -#. (itstool) path: row/entry -#: book.translate.xml:4245 -msgid "&a.questions;" -msgstr "" - -#. (itstool) path: row/entry -#: book.translate.xml:4246 -msgid "" -"FreeBSD general questions mailing list" -msgstr "" - -#. (itstool) path: row/entry -#: book.translate.xml:4247 -msgid "Usage: A link to the &a.questions;." -msgstr "" - -#. (itstool) path: row/entry -#: book.translate.xml:4252 -msgid "&a.listname;" -msgstr "" - -#. (itstool) path: row/entry -#: book.translate.xml:4253 -msgid "link to listname" -msgstr "" - -#. (itstool) path: row/entry -#: book.translate.xml:4255 -msgid "" -"Entities are defined for all the FreeBSD " -"mailing lists." -msgstr "" - -#. (itstool) path: row/entry -#: book.translate.xml:4266 -msgid "FreeBSD Document Link Entities" -msgstr "" - -#. (itstool) path: row/entry -#: book.translate.xml:4271 -msgid "&url.books.handbook;" -msgstr "" - -#. (itstool) path: row/entry -#: book.translate.xml:4272 -msgid "@@URL_RELPREFIX@@/doc/en_US.ISO8859-1/books/handbook" -msgstr "" - -#. (itstool) path: row/entry -#: book.translate.xml:4273 -msgid "" -"Usage: A link to the <link xlink:href=\"&url.books.handbook;/" -"advanced-networking.html\">Advanced Networking</link> chapter of " -"the Handbook." -msgstr "" - -#. (itstool) path: row/entry -#: book.translate.xml:4280 -msgid "&url.books.bookname;" -msgstr "" - -#. (itstool) path: row/entry -#: book.translate.xml:4281 -msgid "" -"relative path to bookname" -msgstr "" - -#. (itstool) path: row/entry -#: book.translate.xml:4283 -msgid "" -"Entities are defined for all the FreeBSD books." -msgstr "" - -#. (itstool) path: row/entry -#: book.translate.xml:4288 -msgid "&url.articles.committers-guide;" -msgstr "" - -#. (itstool) path: row/entry -#: book.translate.xml:4289 -msgid "" -"@@URL_RELPREFIX@@/doc/en_US.ISO8859-1/articles/committers-guide" -msgstr "" - -#. (itstool) path: row/entry -#: book.translate.xml:4290 -msgid "" -"Usage: A link to the <link xlink:href=\"&url.articles." -"committers-guide;\">Committer's Guide</link> article." -msgstr "" - -#. (itstool) path: row/entry -#: book.translate.xml:4297 -msgid "" -"&url.articles.articlename;" -msgstr "" - -#. (itstool) path: row/entry -#: book.translate.xml:4298 -msgid "" -"relative path to articlename" -msgstr "" - -#. (itstool) path: row/entry -#: book.translate.xml:4300 -msgid "" -"Entities are defined for all the FreeBSD articles." -msgstr "" - -#. (itstool) path: row/entry -#: book.translate.xml:4311 -msgid "Other Operating System Name Entities" -msgstr "" - -#. (itstool) path: row/entry -#: book.translate.xml:4316 -msgid "&linux;" -msgstr "" - -#. (itstool) path: row/entry -#: book.translate.xml:4317 -msgid "Linux" -msgstr "" - -#. (itstool) path: row/entry -#: book.translate.xml:4318 -msgid "The Linux operating system." -msgstr "" - -#. (itstool) path: row/entry -#: book.translate.xml:4322 book.translate.xml:8816 -msgid "&unix;" -msgstr "" - -#. (itstool) path: row/entry -#: book.translate.xml:4323 book.translate.xml:8815 -msgid "UNIX" -msgstr "" - -#. (itstool) path: row/entry -#: book.translate.xml:4324 -msgid "The UNIX operating system." -msgstr "" - -#. (itstool) path: row/entry -#: book.translate.xml:4328 -msgid "&windows;" -msgstr "" - -#. (itstool) path: row/entry -#: book.translate.xml:4329 -msgid "Windows" -msgstr "" - -#. (itstool) path: row/entry -#: book.translate.xml:4330 -msgid "" -"The Windows operating system." -msgstr "" - -#. (itstool) path: row/entry -#: book.translate.xml:4340 -msgid "Miscellaneous Entities" -msgstr "" - -#. (itstool) path: row/entry -#: book.translate.xml:4345 -msgid "&prompt.root;" -msgstr "" - -#. (itstool) path: row/entry -#: book.translate.xml:4347 -msgid "The root user prompt." -msgstr "" - -#. (itstool) path: row/entry -#: book.translate.xml:4352 -msgid "&prompt.user;" -msgstr "" - -#. (itstool) path: row/entry -#: book.translate.xml:4354 -msgid "A prompt for an unprivileged user." -msgstr "" - -#. (itstool) path: row/entry -#: book.translate.xml:4358 -msgid "&postscript;" -msgstr "" - -#. (itstool) path: row/entry -#: book.translate.xml:4359 -msgid "PostScript" -msgstr "" - -#. (itstool) path: row/entry -#: book.translate.xml:4360 -msgid "" -"The PostScript programming " -"language." -msgstr "" - -#. (itstool) path: row/entry -#: book.translate.xml:4365 -msgid "&tex;" -msgstr "" - -#. (itstool) path: row/entry -#: book.translate.xml:4366 -msgid "TeX" -msgstr "" - -#. (itstool) path: row/entry -#: book.translate.xml:4367 -msgid "The TeX typesetting language." -msgstr "" - -#. (itstool) path: row/entry -#: book.translate.xml:4372 -msgid "&xorg;" -msgstr "" - -#. (itstool) path: row/entry -#: book.translate.xml:4373 -msgid "Xorg" -msgstr "" - -#. (itstool) path: row/entry -#: book.translate.xml:4374 -msgid "The Xorg open source X Window System." -msgstr "" - -#. (itstool) path: sect1/title -#: book.translate.xml:4384 -msgid "Formal Public Identifier (FPI)" -msgstr "正式公用識別碼 (FPI)" - -#. (itstool) path: sect1/para -#: book.translate.xml:4386 -msgid "" -"In compliance with the DocBook guidelines for writing FPIs for DocBook customizations, the FPI for the " -"FreeBSD extended DocBook DTD is:" -msgstr "" - -#. (itstool) path: sect1/programlisting -#: book.translate.xml:4391 -#, no-wrap -msgid "PUBLIC \"-//FreeBSD//DTD DocBook V4.2-Based Extension//EN\"" -msgstr "" - -#. (itstool) path: sect1/title -#: book.translate.xml:4395 -msgid "Document Structure" -msgstr "文件結構" - -#. (itstool) path: sect1/para -#: book.translate.xml:4397 -msgid "" -"DocBook allows structuring documentation in several ways. The FreeBSD " -"Documentation Project uses two primary types of DocBook document: the book " -"and the article." -msgstr "" - -#. (itstool) path: sect1/para -#: book.translate.xml:4401 -msgid "" -"Books are organized into chapters. This is a mandatory " -"requirement. There may be parts between the book and the chapter " -"to provide another layer of organization. For example, the Handbook is " -"arranged in this way." -msgstr "" - -#. (itstool) path: sect1/para -#: book.translate.xml:4407 -msgid "" -"A chapter may (or may not) contain one or more sections. These are indicated " -"with the sect1 element. If a section contains another section " -"then use the sect2 element, and so on, up to sect5." -msgstr "" - -#. (itstool) path: sect1/para -#: book.translate.xml:4413 -msgid "Chapters and sections contain the remainder of the content." -msgstr "" - -#. (itstool) path: sect1/para -#: book.translate.xml:4416 -msgid "" -"An article is simpler than a book, and does not use chapters. Instead, the " -"content of an article is organized into one or more sections, using the same " -"sect1 (and sect2 and so on) elements that are used in " -"books." -msgstr "" - -#. (itstool) path: sect1/para -#: book.translate.xml:4422 -msgid "" -"The nature of the document being written should be used to determine whether " -"it is best marked up as a book or an article. Articles are well suited to " -"information that does not need to be broken down into several chapters, and " -"that is, relatively speaking, quite short, at up to 20-25 pages of content. " -"Books are best suited to information that can be broken up into several " -"chapters, possibly with appendices and similar content as well." -msgstr "" - -#. (itstool) path: sect1/para -#: book.translate.xml:4431 -msgid "" -"The FreeBSD tutorials are all marked up as articles, while this document, the FAQ, and the Handbook are all marked up as books, for " -"example." -msgstr "" - -#. (itstool) path: sect2/title -#: book.translate.xml:4438 -msgid "Starting a Book" -msgstr "開始撰寫書籍" - -#. (itstool) path: sect2/para -#: book.translate.xml:4440 -msgid "" -"The content of a book is contained within the book element. As " -"well as containing structural markup, this element can contain elements that " -"include additional information about the book. This is either meta-" -"information, used for reference purposes, or additional content used to " -"produce a title page." -msgstr "" - -#. (itstool) path: sect2/para -#: book.translate.xml:4447 book.translate.xml:4502 -msgid "This additional information is contained within info." -msgstr "" - -#. (itstool) path: example/title -#: book.translate.xml:4451 -msgid "Boilerplate book with info" -msgstr "使用 infobook 樣板" - -#. (itstool) path: example/programlisting -#: book.translate.xml:4457 -#, no-wrap -msgid "" -"book\n" -" info\n" -" titleYour Title Heretitle\n" -"\n" -" author\n" -" personname\n" -" firstnameYour first namefirstname\n" -" surnameYour surnamesurname\n" -" personname\n" -"\n" -" affiliation\n" -"\taddress\n" -" emailYour email addressemail\n" -"\taddress\n" -" affiliation\n" -" author\n" -"\n" -" copyright\n" -" year1998year\n" -" holder role=\"mailto:your email address\"Your nameholder\n" -" copyright\n" -"\n" -" releaseinfo$FreeBSD$releaseinfo\n" -"\n" -" abstract\n" -" paraInclude an abstract of the book's contents here.para\n" -" abstract\n" -" info\n" -"\n" -" …\n" -"\n" -"book" -msgstr "" - -#. (itstool) path: sect2/title -#: book.translate.xml:4493 -msgid "Starting an Article" -msgstr "開始撰寫文章" - -#. (itstool) path: sect2/para -#: book.translate.xml:4495 -msgid "" -"The content of the article is contained within the article " -"element. As well as containing structural markup, this element can contain " -"elements that include additional information about the article. This is " -"either meta-information, used for reference purposes, or additional content " -"used to produce a title page." -msgstr "" - -#. (itstool) path: example/title -#: book.translate.xml:4506 -msgid "Boilerplate article with info" -msgstr "使用 infoarticle 樣板" - -#. (itstool) path: example/programlisting -#: book.translate.xml:4512 -#, no-wrap -msgid "" -"article\n" -" info\n" -" titleYour title heretitle\n" -"\n" -" author\n" -" personname\n" -"\tfirstnameYour first namefirstname\n" -"\tsurnameYour surnamesurname\n" -" personname\n" -"\n" -" affiliation\n" -"\taddress\n" -"\t emailYour email addressemailaddress\n" -"\taddress\n" -" affiliation\n" -" author\n" -"\n" -" copyright\n" -" year1998year\n" -" holder role=\"mailto:your email address\"Your nameholder\n" -" copyright\n" -"\n" -" releaseinfo$FreeBSD$releaseinfo\n" -"\n" -" abstract\n" -" paraInclude an abstract of the article's contents here.para\n" -" abstract\n" -" info\n" -"\n" -" …\n" -"\n" -"article" -msgstr "" - -#. (itstool) path: sect2/title -#: book.translate.xml:4548 -msgid "Indicating Chapters" -msgstr "標示章節" - -#. (itstool) path: sect2/para -#: book.translate.xml:4550 -msgid "" -"Use chapter to mark up your chapters. Each chapter has a " -"mandatory title. Articles do not contain chapters, they are " -"reserved for books." -msgstr "" - -#. (itstool) path: example/title -#: book.translate.xml:4556 -msgid "A Simple Chapter" -msgstr "簡單的章節" - -#. (itstool) path: example/programlisting -#: book.translate.xml:4558 -#, no-wrap -msgid "" -"chapter\n" -" titleThe Chapter's Titletitle\n" -"\n" -" ...\n" -"chapter" -msgstr "" - -#. (itstool) path: sect2/para -#: book.translate.xml:4565 -msgid "" -"A chapter cannot be empty; it must contain elements in addition to " -"title. If you need to include an empty chapter then just use an " -"empty paragraph." -msgstr "" - -#. (itstool) path: example/title -#: book.translate.xml:4571 -msgid "Empty Chapters" -msgstr "空白章節" - -#. (itstool) path: example/programlisting -#: book.translate.xml:4573 -#, no-wrap -msgid "" -"chapter\n" -" titleThis is An Empty Chaptertitle\n" -"\n" -" parapara\n" -"chapter" -msgstr "" - -#. (itstool) path: sect2/title -#: book.translate.xml:4582 -msgid "Sections Below Chapters" -msgstr "章底下的小節" - -#. (itstool) path: sect2/para -#: book.translate.xml:4584 -msgid "" -"In books, chapters may (but do not need to) be broken up into sections, " -"subsections, and so on. In articles, sections are the main structural " -"element, and each article must contain at least one section. Use the " -"sectn element. The n indicates the section number, which identifies the section " -"level." -msgstr "" - -#. (itstool) path: sect2/para -#: book.translate.xml:4592 -msgid "" -"The first sectn is sect1. " -"You can have one or more of these in a chapter. They can contain one or more " -"sect2 elements, and so on, down to sect5." -msgstr "" - -#. (itstool) path: example/title -#: book.translate.xml:4600 -msgid "Sections in Chapters" -msgstr "章中的小節" - -#. (itstool) path: example/programlisting -#: book.translate.xml:4602 -#, no-wrap -msgid "" -"chapter\n" -" titleA Sample Chaptertitle\n" -"\n" -" paraSome text in the chapter.para\n" -"\n" -" sect1\n" -" titleFirst Sectiontitle\n" -"\n" -" …\n" -" sect1\n" -"\n" -" sect1\n" -" titleSecond Sectiontitle\n" -"\n" -" sect2\n" -" titleFirst Sub-Sectiontitle\n" -"\n" -" sect3\n" -"\ttitleFirst Sub-Sub-Sectiontitle\n" -"\n" -"\t…\n" -" sect3\n" -" sect2\n" -"\n" -" sect2\n" -" titleSecond Sub-Section (1.2.2)title\n" -"\n" -" …\n" -" sect2\n" -" sect1\n" -"chapter" -msgstr "" - -#. (itstool) path: note/para -#: book.translate.xml:4636 -msgid "" -"Section numbers are automatically generated and prepended to titles when the " -"document is rendered to an output format. The generated section numbers and " -"titles from the example above will be:" -msgstr "" - -#. (itstool) path: listitem/para -#: book.translate.xml:4643 -msgid "1.1. First Section" -msgstr "" - -#. (itstool) path: listitem/para -#: book.translate.xml:4647 -msgid "1.2. Second Section" -msgstr "" - -#. (itstool) path: listitem/para -#: book.translate.xml:4651 -msgid "1.2.1. First Sub-Section" -msgstr "" - -#. (itstool) path: listitem/para -#: book.translate.xml:4655 -msgid "1.2.1.1. First Sub-Sub-Section" -msgstr "" - -#. (itstool) path: listitem/para -#: book.translate.xml:4659 -msgid "1.2.2. Second Sub-Section" -msgstr "" - -#. (itstool) path: sect2/title -#: book.translate.xml:4666 -msgid "Subdividing Using part Elements" -msgstr "使用 part 元素來分部" - -#. (itstool) path: sect2/para -#: book.translate.xml:4669 -msgid "" -"parts introduce another level of organization between book and chapter with one or more parts. This cannot " -"be done in an article." -msgstr "" - -#. (itstool) path: sect2/programlisting -#: book.translate.xml:4675 -#, no-wrap -msgid "" -"part\n" -" titleIntroductiontitle\n" -"\n" -" chapter\n" -" titleOverviewtitle\n" -"\n" -" ...\n" -" chapter\n" -"\n" -" chapter\n" -" titleWhat is FreeBSD?title\n" -"\n" -" ...\n" -" chapter\n" -"\n" -" chapter\n" -" titleHistorytitle\n" -"\n" -" ...\n" -" chapter\n" -"part" -msgstr "" - -#. (itstool) path: sect2/para -#: book.translate.xml:4705 -msgid "" -"DocBook supports three types of paragraphs: formalpara, " -"para, and simpara." -msgstr "" - -#. (itstool) path: sect2/para -#: book.translate.xml:4709 -msgid "" -"Almost all paragraphs in FreeBSD documentation use para. " -"formalpara includes a title element, and simpara disallows some elements from within para. Stick with " -"para." -msgstr "" - -#. (itstool) path: example/title -#: book.translate.xml:4717 -msgid "para Example" -msgstr "para 範例" - -#. (itstool) path: example/programlisting -#: book.translate.xml:4721 -#, no-wrap -msgid "" -"paraThis is a paragraph. It can contain just about any\n" -" other element.para" -msgstr "" - -#. (itstool) path: example/para -#. (itstool) path: sect2/para -#: book.translate.xml:4724 book.translate.xml:4762 book.translate.xml:4839 -#: book.translate.xml:4870 book.translate.xml:4929 book.translate.xml:4991 -#: book.translate.xml:5059 book.translate.xml:5126 book.translate.xml:5184 -#: book.translate.xml:5268 book.translate.xml:5308 book.translate.xml:5417 -#: book.translate.xml:5469 book.translate.xml:5498 book.translate.xml:5526 -#: book.translate.xml:5574 book.translate.xml:5686 book.translate.xml:5736 -#: book.translate.xml:5783 book.translate.xml:5920 book.translate.xml:5968 -#: book.translate.xml:5997 book.translate.xml:6018 book.translate.xml:6070 -#: book.translate.xml:6116 book.translate.xml:6146 book.translate.xml:6169 -#: book.translate.xml:6199 book.translate.xml:6221 book.translate.xml:6673 -#: book.translate.xml:6687 book.translate.xml:6702 book.translate.xml:6720 -msgid "Appearance:" -msgstr "輸出結果:" - -#. (itstool) path: example/para -#: book.translate.xml:4726 -msgid "This is a paragraph. It can contain just about any other element." -msgstr "" - -#. (itstool) path: sect2/para -#: book.translate.xml:4734 -msgid "" -"A block quotation is an extended quotation from another document that should " -"not appear within the current paragraph. These are rarely needed." -msgstr "" - -#. (itstool) path: sect2/para -#: book.translate.xml:4738 -msgid "" -"Blockquotes can optionally contain a title and an attribution (or they can " -"be left untitled and unattributed)." -msgstr "" - -#. (itstool) path: example/programlisting -#: book.translate.xml:4747 -#, no-wrap -msgid "" -"paraA small excerpt from the US Constitution:para\n" -"\n" -"blockquote\n" -" titlePreamble to the Constitution of the United Statestitle\n" -"\n" -" attributionCopied from a web site somewhereattribution\n" -"\n" -" paraWe the People of the United States, in Order to form a more\n" -" perfect Union, establish Justice, insure domestic Tranquility,\n" -" provide for the common defence, promote the general Welfare, and\n" -" secure the Blessings of Liberty to ourselves and our Posterity, do\n" -" ordain and establish this Constitution for the United States of\n" -" America.para\n" -"blockquote" -msgstr "" - -#. (itstool) path: example/para -#: book.translate.xml:4764 -msgid "A small excerpt from the US Constitution:" -msgstr "" - -#. (itstool) path: blockquote/title -#: book.translate.xml:4767 -msgid "Preamble to the Constitution of the United States" -msgstr "" - -#. (itstool) path: blockquote/attribution -#: book.translate.xml:4770 -msgid "Copied from a web site somewhere" -msgstr "" - -#. (itstool) path: blockquote/para -#: book.translate.xml:4773 -msgid "" -"We the People of the United States, in Order to form a more perfect Union, " -"establish Justice, insure domestic Tranquility, provide for the common " -"defence, promote the general Welfare, and secure the Blessings of Liberty to " -"ourselves and our Posterity, do ordain and establish this Constitution for " -"the United States of America." -msgstr "" - -#. (itstool) path: sect2/title -#: book.translate.xml:4785 -msgid "Tips, Notes, Warnings, Cautions, and Important Information" -msgstr "提示、注意、警告、注意事項及重要資訊" - -#. (itstool) path: sect2/para -#: book.translate.xml:4788 -msgid "" -"Extra information may need to be separated from the main body of the text. " -"Typically this is meta information of which the user should " -"be aware." -msgstr "" - -#. (itstool) path: sect2/para -#: book.translate.xml:4793 -msgid "" -"Several types of admonitions are available: tip, note, " -"warning, caution, and important." -msgstr "" - -#. (itstool) path: sect2/para -#: book.translate.xml:4798 -msgid "" -"Which admonition to choose depends on the situation. The DocBook " -"documentation suggests:" -msgstr "" - -#. (itstool) path: listitem/para -#: book.translate.xml:4804 -msgid "Note is for information that should be heeded by all readers." -msgstr "" - -#. (itstool) path: listitem/para -#: book.translate.xml:4809 -msgid "Important is a variation on Note." -msgstr "" - -#. (itstool) path: listitem/para -#: book.translate.xml:4813 -msgid "" -"Caution is for information regarding possible data loss or software damage." -msgstr "" - -#. (itstool) path: listitem/para -#: book.translate.xml:4818 -msgid "" -"Warning is for information regarding possible hardware damage or injury to " -"life or limb." -msgstr "" - -#. (itstool) path: example/title -#: book.translate.xml:4824 -msgid "tip and important Example" -msgstr "tipimportant 範例" - -#. (itstool) path: example/programlisting -#: book.translate.xml:4828 -#, no-wrap -msgid "" -"tip\n" -" para&os; may reduce stress.para\n" -"tip\n" -"\n" -"important\n" -" paraPlease use admonitions sparingly. Too many admonitions\n" -" are visually jarring and can have the opposite of the\n" -" intended effect.para\n" -"important" -msgstr "" - -#. (itstool) path: tip/para -#: book.translate.xml:4842 -msgid "FreeBSD may reduce stress." -msgstr "" - -#. (itstool) path: important/para -#: book.translate.xml:4846 -msgid "" -"Please use admonitions sparingly. Too many admonitions are visually jarring " -"and can have the opposite of the intended effect." -msgstr "" - -#. (itstool) path: sect2/para -#: book.translate.xml:4855 -msgid "Examples can be shown with example." -msgstr "" - -#. (itstool) path: example/title -#: book.translate.xml:4858 -msgid "example Source" -msgstr "example 原始碼" - -#. (itstool) path: example/programlisting -#: book.translate.xml:4862 -#, no-wrap -msgid "" -"example\n" -" paraEmpty files can be created easily:para\n" -"\n" -" screen&prompt.user; userinputtouch file1 file2 file3userinputscreen\n" -"example" -msgstr "" - -#. (itstool) path: example/title -#: book.translate.xml:4873 -msgid "Rendered example" -msgstr "example 的結果" - -#. (itstool) path: example/para -#: book.translate.xml:4875 -msgid "Empty files can be created easily:" -msgstr "" - -#. (itstool) path: example/screen -#: book.translate.xml:4877 -#, no-wrap -msgid "% touch file1 file2 file3" -msgstr "" - -#. (itstool) path: sect2/title -#: book.translate.xml:4882 -msgid "Lists and Procedures" -msgstr "清單與步驟" - -#. (itstool) path: sect2/para -#: book.translate.xml:4884 -msgid "" -"Information often needs to be presented as lists, or as a number of steps " -"that must be carried out in order to accomplish a particular goal." -msgstr "" - -#. (itstool) path: sect2/para -#: book.translate.xml:4888 -msgid "" -"To do this, use itemizedlist, orderedlist, " -"variablelist, or procedure. There are other types of " -"list elements in DocBook, but we will not cover them here." -msgstr "" - -#. (itstool) path: sect2/para -#: book.translate.xml:4893 -msgid "" -"itemizedlist and orderedlist are similar to their " -"counterparts in HTML, ul and ol. " -"Each one consists of one or more listitem elements, and each " -"listitem contains one or more block elements. The listitem elements are analogous to HTML's li tags. " -"However, unlike HTML, they are required." -msgstr "" - -#. (itstool) path: example/title -#: book.translate.xml:4904 -msgid "itemizedlist and orderedlist Example" -msgstr "itemizedlistorderedlist 範例" - -#. (itstool) path: example/programlisting -#: book.translate.xml:4909 -#, no-wrap -msgid "" -"itemizedlist\n" -" listitem\n" -" paraThis is the first itemized item.para\n" -" listitem\n" -"\n" -" listitem\n" -" paraThis is the second itemized item.para\n" -" listitem\n" -"itemizedlist\n" -"\n" -"orderedlist\n" -" listitem\n" -" paraThis is the first ordered item.para\n" -" listitem\n" -"\n" -" listitem\n" -" paraThis is the second ordered item.para\n" -" listitem\n" -"orderedlist" -msgstr "" - -#. (itstool) path: listitem/para -#: book.translate.xml:4933 -msgid "This is the first itemized item." -msgstr "" - -#. (itstool) path: listitem/para -#: book.translate.xml:4937 -msgid "This is the second itemized item." -msgstr "" - -#. (itstool) path: listitem/para -#: book.translate.xml:4943 -msgid "This is the first ordered item." -msgstr "" - -#. (itstool) path: listitem/para -#: book.translate.xml:4947 -msgid "This is the second ordered item." -msgstr "" - -#. (itstool) path: sect2/para -#. (itstool) id: book.translate.xml#docbook-markup-varlist -#: book.translate.xml:4952 -msgid "" -"An alternate and often useful way of presenting information is the " -"variablelist. These are lists where each entry has a term and a " -"description. They are well suited for many types of descriptions, and " -"present information in a form that is often easier for the reader than " -"sections and subsections." -msgstr "" - -#. (itstool) path: sect2/para -#: book.translate.xml:4960 -msgid "" -"A variablelist has a title, and then pairs of " -"term and listitem entries." -msgstr "" - -#. (itstool) path: example/title -#: book.translate.xml:4965 -msgid "variablelist Example" -msgstr "variablelist 範例" - -#. (itstool) path: example/programlisting -#: book.translate.xml:4969 -#, no-wrap -msgid "" -"variablelist\n" -" varlistentry\n" -" termParallelterm\n" -"\n" -" listitem\n" -" paraIn parallel communications, groups of bits arrive\n" -"\tat the same time over multiple communications\n" -"\tchannels.para\n" -" listitem\n" -" varlistentry\n" -"\n" -" varlistentry\n" -" termSerialterm\n" -"\n" -" listitem\n" -" paraIn serial communications, bits arrive one at a\n" -"\ttime over a single communications\n" -"\tchannel.para\n" -" listitem\n" -" varlistentry\n" -"variablelist" -msgstr "" - -#. (itstool) path: varlistentry/term -#: book.translate.xml:4995 -msgid "Parallel" -msgstr "" - -#. (itstool) path: listitem/para -#: book.translate.xml:4998 -msgid "" -"In parallel communications, groups of bits arrive at the same time over " -"multiple communications channels." -msgstr "" - -#. (itstool) path: varlistentry/term -#: book.translate.xml:5005 -msgid "Serial" -msgstr "" - -#. (itstool) path: listitem/para -#: book.translate.xml:5008 -msgid "" -"In serial communications, bits arrive one at a time over a single " -"communications channel." -msgstr "" - -#. (itstool) path: sect2/para -#: book.translate.xml:5015 -msgid "" -"A procedure shows a series of steps, which may in turn " -"consist of more steps or substeps. Each step contains block elements and may include an optional title." -msgstr "" - -#. (itstool) path: sect2/para -#: book.translate.xml:5021 -msgid "" -"Sometimes, steps are not sequential, but present a choice: do " -"this or do that, but not both. For " -"these alternative choices, use stepalternatives." -msgstr "" - -#. (itstool) path: example/title -#: book.translate.xml:5027 -msgid "procedure Example" -msgstr "procedure 範例" - -#. (itstool) path: example/programlisting -#: book.translate.xml:5031 -#, no-wrap -msgid "" -"procedure\n" -" step\n" -" paraDo this.para\n" -" step\n" -"\n" -" step\n" -" paraThen do this.para\n" -" step\n" -"\n" -" step\n" -" paraAnd now do this.para\n" -" step\n" -"\n" -" step\n" -" paraFinally, do one of these.para\n" -"\n" -" stepalternatives\n" -" step\n" -"\tparaGo left.para\n" -" step\n" -"\n" -" step\n" -"\tparaGo right.para\n" -" step\n" -" stepalternatives\n" -" step\n" -"procedure" -msgstr "" - -#. (itstool) path: step/para -#: book.translate.xml:5063 -msgid "Do this." -msgstr "" - -#. (itstool) path: step/para -#: book.translate.xml:5067 -msgid "Then do this." -msgstr "" - -#. (itstool) path: step/para -#: book.translate.xml:5071 -msgid "And now do this." -msgstr "" - -#. (itstool) path: step/para -#: book.translate.xml:5075 -msgid "Finally, do one of these:" -msgstr "" - -#. (itstool) path: step/para -#: book.translate.xml:5079 -msgid "Go left." -msgstr "" - -#. (itstool) path: step/para -#: book.translate.xml:5083 -msgid "Go right." -msgstr "" - -#. (itstool) path: sect2/title -#: book.translate.xml:5092 -msgid "Showing File Samples" -msgstr "顯示檔案範本" - -#. (itstool) path: sect2/para -#: book.translate.xml:5094 -msgid "" -"Fragments of a file (or perhaps a complete file) are shown by wrapping them " -"in the programlisting element." -msgstr "" - -#. (itstool) path: sect2/para -#: book.translate.xml:5098 -msgid "" -"White space and line breaks within programlisting are significant. In particular, this means that the opening tag should " -"appear on the same line as the first line of the output, and the closing tag " -"should appear on the same line as the last line of the output, otherwise " -"spurious blank lines may be included." -msgstr "" - -#. (itstool) path: example/title -#: book.translate.xml:5107 -msgid "programlisting Example" -msgstr "programlisting 範例" - -#. (itstool) path: example/programlisting -#: book.translate.xml:5111 -#, no-wrap -msgid "" -"paraWhen finished, the program will look like\n" -" this:para\n" -"\n" -"programlisting#include &lt;stdio.h&gt;\n" -"\n" -"int\n" -"main(void)\n" -"{\n" -" printf(\"hello, world\\n\");\n" -"}programlisting" -msgstr "" - -#. (itstool) path: example/para -#: book.translate.xml:5122 -msgid "" -"Notice how the angle brackets in the #include line need " -"to be referenced by their entities instead of being included literally." -msgstr "" - -#. (itstool) path: example/para -#: book.translate.xml:5128 book.translate.xml:5186 -msgid "When finished, the program will look like this:" -msgstr "" - -#. (itstool) path: example/programlisting -#: book.translate.xml:5130 -#, no-wrap -msgid "" -"#include <stdio.h>\n" -"\n" -"int\n" -"main(void)\n" -"{\n" -" printf(\"hello, world\\n\");\n" -"}" -msgstr "" - -#. (itstool) path: sect2/title -#: book.translate.xml:5141 -msgid "Callouts" -msgstr "標註" - -#. (itstool) path: sect2/para -#: book.translate.xml:5143 -msgid "" -"A callout is a visual marker for referring to a piece of text or specific " -"position within an example." -msgstr "" - -#. (itstool) path: sect2/para -#: book.translate.xml:5147 -msgid "" -"Callouts are marked with the co element. Each element must have a " -"unique id assigned to it. After the example, include a " -"calloutlist that describes each callout." -msgstr "" - -#. (itstool) path: example/title -#: book.translate.xml:5154 -msgid "co and calloutlist Example" -msgstr "cocalloutlist 範例" - -#. (itstool) path: example/programlisting -#: book.translate.xml:5157 -#, no-wrap -msgid "" -"paraWhen finished, the program will look like\n" -" this:para\n" -"\n" -"programlisting#include &lt;stdio.h&gt; co xml:id=\"co-ex-include\"\n" -"\n" -"int co xml:id=\"co-ex-return\"\n" -"main(void)\n" -"{\n" -" printf(\"hello, world\\n\"); co xml:id=\"co-ex-printf\"\n" -"}programlisting\n" -"\n" -"calloutlist\n" -" callout arearefs=\"co-ex-include\"\n" -" paraIncludes the standard IO header file.para\n" -" callout\n" -"\n" -" callout arearefs=\"co-ex-return\"\n" -" paraSpecifies that functionmain()function returns an\n" -" int.para\n" -" callout\n" -"\n" -" callout arearefs=\"co-ex-printf\"\n" -" paraThe functionprintf()function call that writes\n" -" literalhello, worldliteral to standard output.para\n" -" callout\n" -"calloutlist" -msgstr "" - -#. (itstool) path: example/programlisting -#: book.translate.xml:5188 -#, no-wrap -msgid "" -"#include <stdio.h> \n" -"\n" -"int \n" -"main(void)\n" -"{\n" -" printf(\"hello, world\\n\"); \n" -"}" -msgstr "" - -#. (itstool) path: callout/para -#: book.translate.xml:5198 -msgid "Includes the standard IO header file." -msgstr "" - -#. (itstool) path: callout/para -#: book.translate.xml:5202 -msgid "Specifies that main() returns an int." -msgstr "" - -#. (itstool) path: callout/para -#: book.translate.xml:5207 -msgid "" -"The printf() call that writes hello, world to standard output." -msgstr "" - -#. (itstool) path: sect2/para -#: book.translate.xml:5218 -msgid "" -"Unlike HTML, DocBook does not need tables for layout " -"purposes, as the stylesheet handles those issues. Instead, just use tables " -"for marking up tabular data." -msgstr "" - -#. (itstool) path: sect2/para -#: book.translate.xml:5223 -msgid "" -"In general terms (and see the DocBook documentation for more detail) a table " -"(which can be either formal or informal) consists of a table " -"element. This contains at least one tgroup element, which " -"specifies (as an attribute) the number of columns in this table group. " -"Within the tablegroup there is one thead element, which contains " -"elements for the table headings (column headings), and one tbody " -"which contains the body of the table." -msgstr "" - -#. (itstool) path: sect2/para -#: book.translate.xml:5234 -msgid "" -"Both tgroup and thead contain row elements, " -"which in turn contain entry elements. Each entry " -"element specifies one cell in the table." -msgstr "" - -#. (itstool) path: example/title -#: book.translate.xml:5241 -msgid "informaltable Example" -msgstr "informaltable 範例" - -#. (itstool) path: example/programlisting -#: book.translate.xml:5245 -#, no-wrap -msgid "" -"informaltable pgwide=\"1\"\n" -" tgroup cols=\"2\"\n" -" thead\n" -" row\n" -" entryThis is Column Head 1entry\n" -" entryThis is Column Head 2entry\n" -" row\n" -" thead\n" -"\n" -" tbody\n" -" row\n" -"\tentryRow 1, column 1entry\n" -"\tentryRow 1, column 2entry\n" -" row\n" -"\n" -" row\n" -"\tentryRow 2, column 1entry\n" -"\tentryRow 2, column 2entry\n" -" row\n" -" tbody\n" -" tgroup\n" -"informaltable" -msgstr "" - -#. (itstool) path: row/entry -#: book.translate.xml:5274 book.translate.xml:5314 -msgid "This is Column Head 1" -msgstr "" - -#. (itstool) path: row/entry -#: book.translate.xml:5275 book.translate.xml:5315 -msgid "This is Column Head 2" -msgstr "" - -#. (itstool) path: row/entry -#: book.translate.xml:5281 book.translate.xml:5321 -msgid "Row 1, column 1" -msgstr "" - -#. (itstool) path: row/entry -#: book.translate.xml:5282 book.translate.xml:5322 -msgid "Row 1, column 2" -msgstr "" - -#. (itstool) path: row/entry -#: book.translate.xml:5286 book.translate.xml:5326 -msgid "Row 2, column 1" -msgstr "" - -#. (itstool) path: row/entry -#: book.translate.xml:5287 book.translate.xml:5327 -msgid "Row 2, column 2" -msgstr "" - -#. (itstool) path: sect2/para -#: book.translate.xml:5294 -msgid "" -"Always use the pgwide attribute with a value of " -"1 with the informaltable element. A bug in " -"Internet Explorer can cause the table to render incorrectly if this is " -"omitted." -msgstr "" - -#. (itstool) path: sect2/para -#: book.translate.xml:5300 -msgid "" -"Table borders can be suppressed by setting the frame " -"attribute to none in the informaltable " -"element. For example, informaltable frame=\"none\"." -msgstr "" - -#. (itstool) path: example/title -#: book.translate.xml:5306 -msgid "Table with frame=\"none\" Example" -msgstr "表格使用 frame=\"none\" 範例" - -#. (itstool) path: sect2/title -#: book.translate.xml:5336 -msgid "Examples for the User to Follow" -msgstr "給使用者遵循的範例" - -#. (itstool) path: sect2/para -#: book.translate.xml:5338 -msgid "" -"Examples for the user to follow are often necessary. Typically, these will " -"consist of dialogs with the computer; the user types in a command, the user " -"gets a response back, the user types another command, and so on." -msgstr "" - -#. (itstool) path: sect2/para -#: book.translate.xml:5343 -msgid "A number of distinct elements and entities come into play here." -msgstr "" - -#. (itstool) path: varlistentry/term -#: book.translate.xml:5348 -msgid "screen" -msgstr "" - -#. (itstool) path: listitem/para -#: book.translate.xml:5351 -msgid "" -"Everything the user sees in this example will be on the computer screen, so " -"the next element is screen." -msgstr "" - -#. (itstool) path: listitem/para -#: book.translate.xml:5355 -msgid "Within screen, white space is significant." -msgstr "" - -#. (itstool) path: varlistentry/term -#: book.translate.xml:5361 -msgid "" -"prompt, &prompt.root; and &" -"prompt.user;" -msgstr "" - -#. (itstool) path: listitem/para -#: book.translate.xml:5366 -msgid "" -"Some of the things the user will be seeing on the screen are prompts from " -"the computer (either from the operating system, command shell, or " -"application). These should be marked up using prompt." -msgstr "" - -#. (itstool) path: listitem/para -#: book.translate.xml:5372 -msgid "" -"As a special case, the two shell prompts for the normal user and the root " -"user have been provided as entities. To indicate the user is at a shell " -"prompt, use one of &prompt.root; and &" -"prompt.user; as necessary. They do not need to be inside " -"prompt." -msgstr "" - -#. (itstool) path: note/para -#: book.translate.xml:5381 -msgid "" -"&prompt.root; and &prompt.user; are FreeBSD extensions to DocBook, and are not part of the original " -"DTD." -msgstr "" - -#. (itstool) path: varlistentry/term -#: book.translate.xml:5390 -msgid "userinput" -msgstr "" - -#. (itstool) path: listitem/para -#: book.translate.xml:5393 -msgid "" -"When displaying text that the user should type in, wrap it in " -"userinput tags. It will be displayed differently than system " -"output text." -msgstr "" - -#. (itstool) path: example/title -#: book.translate.xml:5401 -msgid "screen, prompt, and userinput Example" -msgstr "screen, promptuserinput 範例" - -#. (itstool) path: example/programlisting -#: book.translate.xml:5406 -#, no-wrap -msgid "" -"screen&prompt.user; userinputls -1userinput\n" -"foo1\n" -"foo2\n" -"foo3\n" -"&prompt.user; userinputls -1 | grep foo2userinput\n" -"foo2\n" -"&prompt.user; userinputsuuserinput\n" -"promptPassword: prompt\n" -"&prompt.root; userinputcat foo2userinput\n" -"This is the file called 'foo2'screen" -msgstr "" - -#. (itstool) path: example/screen -#: book.translate.xml:5419 -#, no-wrap -msgid "" -"% ls -1\n" -"foo1\n" -"foo2\n" -"foo3\n" -"% ls -1 | grep foo2\n" -"foo2\n" -"% su\n" -"Password: \n" -"# cat foo2\n" -"This is the file called 'foo2'" -msgstr "" - -#. (itstool) path: note/para -#: book.translate.xml:5432 -msgid "" -"Even though we are displaying the contents of the file foo2, it is not marked up as programlisting. Reserve programlisting for showing fragments of files " -"outside the context of user actions." -msgstr "" - -#. (itstool) path: sect2/para -#: book.translate.xml:5447 -msgid "" -"To emphasize a particular word or phrase, use emphasis. This may " -"be presented as italic, or bold, or might be spoken differently with a text-" -"to-speech system." -msgstr "" - -#. (itstool) path: sect2/para -#: book.translate.xml:5452 -msgid "" -"There is no way to change the presentation of the emphasis within the " -"document, no equivalent of HTML's b and " -"i. If the information being presented is important, then consider " -"presenting it in important rather than emphasis." -msgstr "" - -#. (itstool) path: example/title -#: book.translate.xml:5461 -msgid "emphasis Example" -msgstr "emphasis 範例" - -#. (itstool) path: example/programlisting -#: book.translate.xml:5465 -#, no-wrap -msgid "" -"para&os; is without doubt emphasistheemphasis\n" -" premiere &unix;-like operating system for the Intel\n" -" architecture.para" -msgstr "" - -#. (itstool) path: example/para -#: book.translate.xml:5471 -msgid "" -"FreeBSD is without doubt the premiere UNIX-like operating system for the Intel " -"architecture." -msgstr "" - -#. (itstool) path: sect2/title -#: book.translate.xml:5478 book.translate.xml:8512 -msgid "Acronyms" -msgstr "縮寫" - -#. (itstool) path: sect2/para -#: book.translate.xml:5480 -msgid "" -"Many computer terms are acronyms, words formed from the " -"first letter of each word in a phrase. Acronyms are marked up into " -"acronym elements. It is helpful to the reader when an acronym is " -"defined on the first use, as shown in the example below." -msgstr "" - -#. (itstool) path: example/title -#: book.translate.xml:5488 -msgid "acronym Example" -msgstr "acronym 範例" - -#. (itstool) path: example/programlisting -#: book.translate.xml:5492 -#, no-wrap -msgid "" -"paraRequest For Comments (acronymRFCacronym) 1149\n" -" defined the use of avian carriers for transmission of\n" -" Internet Protocol (acronymIPacronym) data. The\n" -" quantity of acronymIPacronym data currently\n" -" transmitted in that manner is unknown.para" -msgstr "" - -#. (itstool) path: example/para -#: book.translate.xml:5500 -msgid "" -"Request For Comments (RFC) 1149 defined the use of avian " -"carriers for transmission of Internet Protocol (IP) data. " -"The quantity of IP data currently transmitted in that " -"manner is unknown." -msgstr "" - -#. (itstool) path: sect2/title -#: book.translate.xml:5509 -msgid "Quotations" -msgstr "引言" - -#. (itstool) path: sect2/para -#: book.translate.xml:5511 -msgid "" -"To quote text from another document or source, or to denote a phrase that is " -"used figuratively, use quote. Most of the markup tags available " -"for normal text are also available from within a quote." -msgstr "" - -#. (itstool) path: example/title -#: book.translate.xml:5518 -msgid "quote Example" -msgstr "quote 範例" - -#. (itstool) path: example/programlisting -#: book.translate.xml:5522 -#, no-wrap -msgid "" -"paraHowever, make sure that the search does not go beyond the\n" -" quoteboundary between local and public administrationquote,\n" -" as acronymRFCacronym 1535 calls it.para" -msgstr "" - -#. (itstool) path: example/para -#: book.translate.xml:5528 -msgid "" -"However, make sure that the search does not go beyond the boundary " -"between local and public administration, as RFC " -"1535 calls it." -msgstr "" - -#. (itstool) path: sect2/title -#: book.translate.xml:5536 -msgid "Keys, Mouse Buttons, and Combinations" -msgstr "鍵盤按鍵、滑鼠按鍵及組合鍵" - -#. (itstool) path: sect2/para -#: book.translate.xml:5538 -msgid "" -"To refer to a specific key on the keyboard, use keycap. To refer " -"to a mouse button, use mousebutton. And to refer to combinations " -"of key presses or mouse clicks, wrap them all in keycombo." -msgstr "" - -#. (itstool) path: sect2/para -#: book.translate.xml:5544 -msgid "" -"keycombo has an attribute called action, which " -"may be one of click, double-click, " -"other, press, seq, " -"or simul. The last two values denote whether the keys or " -"buttons should be pressed in sequence, or simultaneously." -msgstr "" - -#. (itstool) path: sect2/para -#: book.translate.xml:5552 -msgid "" -"The stylesheets automatically add any connecting symbols, such as " -"+, between the key names, when wrapped in keycombo." -msgstr "" - -#. (itstool) path: example/title -#: book.translate.xml:5557 -msgid "Keys, Mouse Buttons, and Combinations Example" -msgstr "鍵盤按鍵、滑鼠案件及組合鍵範例" - -#. (itstool) path: example/programlisting -#: book.translate.xml:5561 -#, no-wrap -msgid "" -"paraTo switch to the second virtual terminal, press\n" -" keycombo action=\"simul\"keycapAltkeycap\n" -" keycapF1keycapkeycombo.para\n" -"\n" -"paraTo exit commandvicommand without saving changes, type\n" -" keycombo action=\"seq\"keycapEsckeycapkeycap:keycap\n" -" keycapqkeycapkeycap!keycapkeycombo.para\n" -"\n" -"paraMy window manager is configured so that\n" -" keycombo action=\"simul\"keycapAltkeycap\n" -" mousebuttonrightmousebutton\n" -" keycombo mouse button is used to move windows.para" -msgstr "" - -#. (itstool) path: example/para -#: book.translate.xml:5576 -msgid "" -"To switch to the second virtual terminal, press Alt F1." -msgstr "" - -#. (itstool) path: example/para -#: book.translate.xml:5580 -msgid "" -"To exit vi without saving changes, type Esc : q !" -"." -msgstr "" - -#. (itstool) path: example/para -#: book.translate.xml:5587 -msgid "" -"My window manager is configured so that " -"Alt right mouse " -"button is used to move windows." -msgstr "" - -#. (itstool) path: sect2/title -#: book.translate.xml:5596 -msgid "Applications, Commands, Options, and Cites" -msgstr "應用程式、指令、選項與引用" - -#. (itstool) path: sect2/para -#: book.translate.xml:5598 -msgid "" -"Both applications and commands are frequently referred to when writing " -"documentation. The distinction between them is that an application is the " -"name of a program or suite of programs that fulfill a particular task. A " -"command is the filename of a program that the user can type and run at a " -"command line." -msgstr "" - -#. (itstool) path: sect2/para -#: book.translate.xml:5605 -msgid "" -"It is often necessary to show some of the options that a command might take." -msgstr "" - -#. (itstool) path: sect2/para -#: book.translate.xml:5608 -msgid "" -"Finally, it is often useful to list a command with its manual section " -"number, in the command(number) format so common in Unix " -"manuals." -msgstr "" - -#. (itstool) path: sect2/para -#: book.translate.xml:5612 -msgid "Mark up application names with application." -msgstr "" - -#. (itstool) path: sect2/para -#: book.translate.xml:5615 -msgid "" -"To list a command with its manual section number (which should be most of " -"the time) the DocBook element is citerefentry. This will contain " -"a further two elements, refentrytitle and manvolnum. " -"The content of refentrytitle is the name of the command, and the " -"content of manvolnum is the manual page section." -msgstr "" - -#. (itstool) path: sect2/para -#: book.translate.xml:5625 -msgid "" -"This can be cumbersome to write, and so a series of general entities have been created to make " -"this easier. Each entity takes the form &man." -"manual-page.manual-section;." -msgstr "" - -#. (itstool) path: sect2/para -#: book.translate.xml:5631 -msgid "" -"The file that contains these entities is in doc/share/xml/man-refs." -"ent, and can be referred to using this FPI:" -msgstr "" - -#. (itstool) path: sect2/programlisting -#: book.translate.xml:5635 -#, no-wrap -msgid "PUBLIC \"-//FreeBSD//ENTITIES DocBook Manual Page Entities//EN\"" -msgstr "" - -#. (itstool) path: sect2/para -#: book.translate.xml:5637 -msgid "" -"Therefore, the introduction to FreeBSD documentation will usually include " -"this:" -msgstr "" - -#. (itstool) path: sect2/programlisting -#: book.translate.xml:5640 -#, no-wrap -msgid "" -"<!DOCTYPE book PUBLIC \"-//FreeBSD//DTD DocBook V4.1-Based Extension//EN\" [\n" -"\n" -"<!ENTITY % man PUBLIC \"-//FreeBSD//ENTITIES DocBook Manual Page Entities//EN\">\n" -"%man;\n" -"\n" -"…\n" -"\n" -"]>" -msgstr "" - -#. (itstool) path: sect2/para -#: book.translate.xml:5649 -msgid "" -"Use command to include a command name in-line but " -"present it as something the user should type." -msgstr "" - -#. (itstool) path: sect2/para -#: book.translate.xml:5653 -msgid "" -"Use option to mark up the options which will be passed to a " -"command." -msgstr "" - -#. (itstool) path: sect2/para -#: book.translate.xml:5656 -msgid "" -"When referring to the same command multiple times in close proximity, it is " -"preferred to use the &man.command." -"section; notation to markup the first " -"reference and use command to markup subsequent references. This " -"makes the generated output, especially HTML, appear " -"visually better." -msgstr "" - -#. (itstool) path: example/title -#: book.translate.xml:5665 -msgid "Applications, Commands, and Options Example" -msgstr "應用程式、指令、選項範例" - -#. (itstool) path: example/programlisting -#: book.translate.xml:5669 -#, no-wrap -msgid "" -"paraapplicationSendmailapplication is the most\n" -" widely used Unix mail application.para\n" -"\n" -"paraapplicationSendmailapplication includes the\n" -" citerefentry\n" -" refentrytitlesendmailrefentrytitle\n" -" manvolnum8manvolnum\n" -" citerefentry, &man.mailq.1;, and &man.newaliases.1;\n" -" programs.para\n" -"\n" -"paraOne of the command line parameters to citerefentry\n" -" refentrytitlesendmailrefentrytitle\n" -" manvolnum8manvolnum\n" -" citerefentry, option-bpoption, will display the current\n" -" status of messages in the mail queue. Check this on the command\n" -" line by running commandsendmail -bpcommand.para" -msgstr "" - -#. (itstool) path: example/para -#: book.translate.xml:5688 -msgid "" -"Sendmail is the most widely used Unix mail " -"application." -msgstr "" - -#. (itstool) path: example/para -#: book.translate.xml:5691 -msgid "" -"Sendmail includes the " -"sendmail 8 , mailq1, and " -"newaliases1 programs." -msgstr "" - -#. (itstool) path: example/para -#: book.translate.xml:5698 -msgid "" -"One of the command line parameters to " -"sendmail 8 , , will display the current status of " -"messages in the mail queue. Check this on the command line by running " -"sendmail -bp." -msgstr "" - -#. (itstool) path: note/para -#: book.translate.xml:5709 -msgid "" -"Notice how the &man.command." -"section; notation is easier to follow." -msgstr "" - -#. (itstool) path: sect2/title -#: book.translate.xml:5716 -msgid "Files, Directories, Extensions, Device Names" -msgstr "檔案、目錄、副檔名、裝置名稱" - -#. (itstool) path: sect2/para -#: book.translate.xml:5718 -msgid "" -"To refer to the name of a file, a directory, a file extension, or a device " -"name, use filename." -msgstr "" - -#. (itstool) path: example/title -#: book.translate.xml:5722 -msgid "filename Example" -msgstr "filename 範例" - -#. (itstool) path: example/programlisting -#: book.translate.xml:5726 -#, no-wrap -msgid "" -"paraThe source for the Handbook in English is found in\n" -" filename/usr/doc/en_US.ISO8859-1/books/handbook/filename.\n" -" The main file is called filenamebook.xmlfilename.\n" -" There is also a filenameMakefilefilename and a\n" -" number of files with a filename.entfilename extension.para\n" -"\n" -"parafilenamekbd0filename is the first keyboard detected\n" -" by the system, and appears in\n" -" filename/devfilename.para" -msgstr "" - -#. (itstool) path: example/para -#: book.translate.xml:5738 -msgid "" -"The source for the Handbook in English is found in /usr/doc/en_US." -"ISO8859-1/books/handbook/. The main file is called book." -"xml. There is also a Makefile and a number " -"of files with a .ent extension." -msgstr "" - -#. (itstool) path: example/para -#: book.translate.xml:5744 -msgid "" -"kbd0 is the first keyboard detected by the system, and " -"appears in /dev." -msgstr "" - -#. (itstool) path: sect2/title -#: book.translate.xml:5751 -msgid "The Name of Ports" -msgstr "Port 名稱" - -#. (itstool) path: note/title -#: book.translate.xml:5754 book.translate.xml:5798 book.translate.xml:6030 -msgid "FreeBSD Extension" -msgstr "" - -#. (itstool) path: note/para -#: book.translate.xml:5756 book.translate.xml:5800 book.translate.xml:6032 -msgid "" -"These elements are part of the FreeBSD extension to DocBook, and do not " -"exist in the original DocBook DTD." -msgstr "" - -#. (itstool) path: sect2/para -#: book.translate.xml:5761 -msgid "" -"To include the name of a program from the FreeBSD Ports Collection in the " -"document, use the package tag. Since the Ports Collection can be " -"installed in any number of locations, only include the category and the port " -"name; do not include /usr/ports." -msgstr "" - -#. (itstool) path: sect2/para -#: book.translate.xml:5767 -msgid "" -"By default, package refers to a binary package. To refer to a " -"port that will be built from source, set the role " -"attribute to port." -msgstr "" - -#. (itstool) path: example/title -#: book.translate.xml:5773 -msgid "package Example" -msgstr "package 範例" - -#. (itstool) path: example/programlisting -#: book.translate.xml:5777 -#, no-wrap -msgid "" -"paraInstall the packagenet/wiresharkpackage binary\n" -" package to view network traffic.para\n" -"\n" -"parapackage role=\"port\"net/wiresharkpackage can also be\n" -" built and installed from the Ports Collection.para" -msgstr "" - -#. (itstool) path: example/para -#: book.translate.xml:5785 -msgid "" -"Install the net/wireshark binary package to view network " -"traffic." -msgstr "" - -#. (itstool) path: example/para -#: book.translate.xml:5788 -msgid "" -"net/wireshark can also be built and " -"installed from the Ports Collection." -msgstr "" - -#. (itstool) path: sect2/title -#: book.translate.xml:5794 -msgid "" -"Hosts, Domains, IP Addresses, User Names, Group Names, and Other System Items" -msgstr "主機、網域、IP 位址、使用名稱、群組名稱及其他系統項目" - -#. (itstool) path: sect2/para -#: book.translate.xml:5805 -msgid "" -"Information for system items is marked up with " -"systemitem. The class attribute is used to " -"identify the particular type of information shown." -msgstr "" - -#. (itstool) path: varlistentry/term -#: book.translate.xml:5812 -msgid "class=\"domainname\"" -msgstr "" - -#. (itstool) path: listitem/para -#: book.translate.xml:5815 -msgid "" -"The text is a domain name, such as FreeBSD.org or " -"ngo.org.uk. There is no hostname component." -msgstr "" - -#. (itstool) path: varlistentry/term -#: book.translate.xml:5823 -msgid "class=\"etheraddress\"" -msgstr "" - -#. (itstool) path: listitem/para -#: book.translate.xml:5826 -msgid "" -"The text is an Ethernet MAC address, expressed as a " -"series of 2 digit hexadecimal numbers separated by colons." -msgstr "" - -#. (itstool) path: varlistentry/term -#: book.translate.xml:5833 -msgid "class=\"fqdomainname\"" -msgstr "" - -#. (itstool) path: listitem/para -#: book.translate.xml:5836 -msgid "" -"The text is a Fully Qualified Domain Name, with both hostname and domain " -"name parts." -msgstr "" - -#. (itstool) path: varlistentry/term -#: book.translate.xml:5842 -msgid "class=\"ipaddress\"" -msgstr "" - -#. (itstool) path: listitem/para -#: book.translate.xml:5845 -msgid "" -"The text is an IP address, probably expressed as a dotted " -"quad." -msgstr "" - -#. (itstool) path: varlistentry/term -#: book.translate.xml:5851 -msgid "class=\"netmask\"" -msgstr "" - -#. (itstool) path: listitem/para -#: book.translate.xml:5854 -msgid "" -"The text is a network mask, which might be expressed as a dotted quad, a " -"hexadecimal string, or as a / followed by a number " -"(CIDR notation)." -msgstr "" - -#. (itstool) path: varlistentry/term -#: book.translate.xml:5862 -msgid "class=\"systemname\"" -msgstr "" - -#. (itstool) path: listitem/para -#: book.translate.xml:5865 -msgid "" -"With class=\"systemname\" the marked up information is " -"the simple hostname, such as freefall or " -"wcarchive." -msgstr "" - -#. (itstool) path: varlistentry/term -#: book.translate.xml:5873 -msgid "class=\"username\"" -msgstr "" - -#. (itstool) path: listitem/para -#: book.translate.xml:5876 -msgid "The text is a username, like root." -msgstr "" - -#. (itstool) path: varlistentry/term -#: book.translate.xml:5882 -msgid "class=\"groupname\"" -msgstr "" - -#. (itstool) path: listitem/para -#: book.translate.xml:5885 -msgid "The text is a groupname, like wheel." -msgstr "" - -#. (itstool) path: example/title -#: book.translate.xml:5892 -msgid "systemitem and Classes Example" -msgstr "systemitem 與類別 (Class) 範例" - -#. (itstool) path: example/programlisting -#: book.translate.xml:5896 -#, no-wrap -msgid "" -"paraThe local machine can always be referred to by the\n" -" name systemitem class=\"systemname\"localhostsystemitem, which will have the IP\n" -" address systemitem class=\"ipaddress\"127.0.0.1systemitem.para\n" -"\n" -"paraThe systemitem class=\"domainname\"FreeBSD.orgsystemitem\n" -" domain contains a number of different hosts, including\n" -" systemitem class=\"fqdomainname\"freefall.FreeBSD.orgsystemitem and\n" -" systemitem class=\"fqdomainname\"bento.FreeBSD.orgsystemitem.para\n" -"\n" -"paraWhen adding an acronymIPacronym alias to an\n" -" interface (using commandifconfigcommand)\n" -" emphasisalwaysemphasis use a netmask of\n" -" systemitem class=\"netmask\"255.255.255.255systemitem (which can\n" -" also be expressed as\n" -" systemitem class=\"netmask\"0xffffffffsystemitem).para\n" -"\n" -"paraThe acronymMACacronym address uniquely identifies\n" -" every network card in existence. A typical\n" -" acronymMACacronym address looks like\n" -" systemitem class=\"etheraddress\"08:00:20:87:ef:d0systemitem.para\n" -"\n" -"paraTo carry out most system administration functions\n" -" requires logging in as systemitem class=\"username\"rootsystemitem.para" -msgstr "" - -#. (itstool) path: example/para -#: book.translate.xml:5922 -msgid "" -"The local machine can always be referred to by the name " -"localhost, which will have the IP address " -"127.0.0.1." -msgstr "" - -#. (itstool) path: example/para -#: book.translate.xml:5927 -msgid "" -"The FreeBSD.org domain " -"contains a number of different hosts, including freefall.FreeBSD.org and bento.FreeBSD.org." -msgstr "" - -#. (itstool) path: example/para -#: book.translate.xml:5933 -msgid "" -"When adding an IP alias to an interface (using " -"ifconfig) always use a netmask of " -"255.255.255.255 (which can also " -"be expressed as 0xffffffff)." -msgstr "" - -#. (itstool) path: example/para -#: book.translate.xml:5940 -msgid "" -"The MAC address uniquely identifies every network card in " -"existence. A typical MAC address looks like 08:00:20:87:ef:d0." -msgstr "" - -#. (itstool) path: example/para -#: book.translate.xml:5944 -msgid "" -"To carry out most system administration functions requires logging in as " -"root." -msgstr "" - -#. (itstool) path: sect2/title -#: book.translate.xml:5951 -msgid "Uniform Resource Identifiers (URIs)" -msgstr "統一資源識別碼 (URI)" - -#. (itstool) path: sect2/para -#: book.translate.xml:5954 -msgid "" -"Occasionally it is useful to show a Uniform Resource Identifier " -"(URI) without making it an active hyperlink. The " -"uri element makes this possible:" -msgstr "" - -#. (itstool) path: example/title -#: book.translate.xml:5960 -msgid "uri Example" -msgstr "uri 範例" - -#. (itstool) path: example/programlisting -#: book.translate.xml:5964 -#, no-wrap -msgid "" -"paraThis URL shows only as text:\n" -" urihttps://www.FreeBSD.orguri. It does not\n" -" create a link.para" -msgstr "" - -#. (itstool) path: example/para -#: book.translate.xml:5970 -msgid "" -"This URL shows only as text: https://www.FreeBSD." -"org. It does not create a link." -msgstr "" - -#. (itstool) path: sect2/para -#: book.translate.xml:5975 -msgid "To create links, see ." -msgstr "" - -#. (itstool) path: sect2/title -#: book.translate.xml:5980 -msgid "Email Addresses" -msgstr "郵件地址" - -#. (itstool) path: sect2/para -#: book.translate.xml:5982 -msgid "" -"Email addresses are marked up as email elements. In the " -"HTML output format, the wrapped text becomes a hyperlink " -"to the email address. Other output formats that support hyperlinks may also " -"make the email address into a link." -msgstr "" - -#. (itstool) path: example/title -#: book.translate.xml:5989 -msgid "email with a Hyperlink Example" -msgstr "有超連結的 email 範例" - -#. (itstool) path: example/programlisting -#: book.translate.xml:5993 -#, no-wrap -msgid "" -"paraAn email address that does not actually exist, like\n" -" emailnotreal@example.comemail, can be used as an\n" -" example.para" -msgstr "" - -#. (itstool) path: example/para -#: book.translate.xml:5999 -msgid "" -"An email address that does not actually exist, like notreal@example." -"com, can be used as an example." -msgstr "" - -#. (itstool) path: sect2/para -#: book.translate.xml:6004 -msgid "" -"A FreeBSD-specific extension allows setting the role " -"attribute to nolink to prevent the creation of the " -"hyperlink to the email address." -msgstr "" - -#. (itstool) path: example/title -#: book.translate.xml:6010 -msgid "email Without a Hyperlink Example" -msgstr "沒有超連結的 email 範例" - -#. (itstool) path: example/programlisting -#: book.translate.xml:6014 -#, no-wrap -msgid "" -"paraSometimes a link to an email address like\n" -" email role=\"nolink\"notreal@example.comemail is not\n" -" desired.para" -msgstr "" - -#. (itstool) path: example/para -#: book.translate.xml:6020 -msgid "" -"Sometimes a link to an email address like notreal@example.com is not desired." -msgstr "" - -#. (itstool) path: sect2/title -#: book.translate.xml:6027 -msgid "Describing Makefiles" -msgstr "說明 Makefile" - -#. (itstool) path: sect2/para -#: book.translate.xml:6037 -msgid "" -"Two elements exist to describe parts of Makefiles, " -"buildtarget and varname." -msgstr "" - -#. (itstool) path: sect2/para -#: book.translate.xml:6041 -msgid "" -"buildtarget identifies a build target exported by a " -"Makefile that can be given as a parameter to " -"make. varname identifies a variable that can " -"be set (in the environment, on the command line with make, or within the Makefile) to influence the " -"process." -msgstr "" - -#. (itstool) path: example/title -#: book.translate.xml:6051 -msgid "buildtarget and varname Example" -msgstr "buildtargetvarname 範例" - -#. (itstool) path: example/programlisting -#: book.translate.xml:6056 -#, no-wrap -msgid "" -"paraTwo common targets in a filenameMakefilefilename\n" -" are buildtargetallbuildtarget and\n" -" buildtargetcleanbuildtarget.para\n" -"\n" -"paraTypically, invoking buildtargetallbuildtarget will\n" -" rebuild the application, and invoking\n" -" buildtargetcleanbuildtarget will remove the temporary\n" -" files (filename.ofilename for example) created by the\n" -" build process.para\n" -"\n" -"parabuildtargetcleanbuildtarget may be controlled by a\n" -" number of variables, including varnameCLOBBERvarname\n" -" and varnameRECURSEvarname.para" -msgstr "" - -#. (itstool) path: para/buildtarget -#: book.translate.xml:6073 book.translate.xml:6076 -msgid "all" -msgstr "" - -#. (itstool) path: example/para -#: book.translate.xml:6072 -msgid "" -"Two common targets in a Makefile are <_:buildtarget-1/> " -"and <_:buildtarget-2/>." -msgstr "" - -#. (itstool) path: example/para -#: book.translate.xml:6076 -msgid "" -"Typically, invoking <_:buildtarget-1/> will rebuild the application, and " -"invoking <_:buildtarget-2/> will remove the temporary files (.o for example) created by the build process." -msgstr "" - -#. (itstool) path: example/para -#: book.translate.xml:6082 -msgid "" -"<_:buildtarget-1/> may be controlled by a number of variables, including " -"CLOBBER and RECURSE." -msgstr "" - -#. (itstool) path: sect2/title -#: book.translate.xml:6089 -msgid "Literal Text" -msgstr "實際文字 (Literal)" - -#. (itstool) path: sect2/para -#: book.translate.xml:6091 -msgid "" -"Literal text, or text which should be entered verbatim, is often needed in " -"documentation. This is text that is excerpted from another file, or which " -"should be copied exactly as shown from the documentation into another file." -msgstr "" - -#. (itstool) path: sect2/para -#: book.translate.xml:6096 -msgid "" -"Some of the time, programlisting will be sufficient to denote " -"this text. But programlisting is not always appropriate, " -"particularly when you want to include a portion of a file in-line with the rest of the paragraph." -msgstr "" - -#. (itstool) path: sect2/para -#: book.translate.xml:6103 -msgid "On these occasions, use literal." -msgstr "" - -#. (itstool) path: example/title -#: book.translate.xml:6107 -msgid "literal Example" -msgstr "literal 範例" - -#. (itstool) path: example/programlisting -#: book.translate.xml:6111 -#, no-wrap -msgid "" -"paraThe literalmaxusers 10literal line in the kernel\n" -" configuration file determines the size of many system tables, and is\n" -" a rough guide to how many simultaneous logins the system will\n" -" support.para" -msgstr "" - -#. (itstool) path: example/para -#: book.translate.xml:6118 -msgid "" -"The maxusers 10 line in the kernel configuration file " -"determines the size of many system tables, and is a rough guide to how many " -"simultaneous logins the system will support." -msgstr "" - -#. (itstool) path: sect2/title -#: book.translate.xml:6126 -msgid "Showing Items That the User Must Fill In" -msgstr "顯示使用者必填的項目" - -#. (itstool) path: sect2/para -#: book.translate.xml:6129 -msgid "" -"There will often be times when the user is shown what to do, or referred to " -"a file or command line, but cannot simply copy the example provided. " -"Instead, they must supply some information themselves." -msgstr "" - -#. (itstool) path: sect2/para -#: book.translate.xml:6134 -msgid "" -"replaceable is designed for this eventuality. Use it " -"inside other elements to indicate parts of that " -"element's content that the user must replace." -msgstr "" - -#. (itstool) path: example/title -#: book.translate.xml:6140 -msgid "replaceable Example" -msgstr "replaceable 範例" - -#. (itstool) path: example/programlisting -#: book.translate.xml:6144 -#, no-wrap -msgid "screen&prompt.user; userinputman replaceablecommandreplaceableuserinputscreen" -msgstr "" - -#. (itstool) path: informalexample/screen -#: book.translate.xml:6149 -#, no-wrap -msgid "% man command" -msgstr "" - -#. (itstool) path: example/para -#: book.translate.xml:6152 -msgid "" -"replaceable can be used in many different elements, including " -"literal. This example also shows that replaceable " -"should only be wrapped around the content that the user is meant to provide. The other content should be left alone." -msgstr "" - -#. (itstool) path: example/programlisting -#: book.translate.xml:6161 -#, no-wrap -msgid "" -"paraThe literalmaxusers replaceablenreplaceableliteral\n" -" line in the kernel configuration file determines the size of many system\n" -" tables, and is a rough guide to how many simultaneous logins the system will\n" -" support.para\n" -"\n" -"paraFor a desktop workstation, literal32literal is a good value\n" -" for replaceablenreplaceable.para" -msgstr "" - -#. (itstool) path: example/para -#: book.translate.xml:6171 -msgid "" -"The maxusers n line in the " -"kernel configuration file determines the size of many system tables, and is " -"a rough guide to how many simultaneous logins the system will support." -msgstr "" - -#. (itstool) path: example/para -#: book.translate.xml:6177 -msgid "" -"For a desktop workstation, 32 is a good value for " -"n." -msgstr "" - -#. (itstool) path: sect2/title -#: book.translate.xml:6183 -msgid "Showing GUI Buttons" -msgstr "顯示 GUI 按鈕" - -#. (itstool) path: sect2/para -#: book.translate.xml:6185 -msgid "" -"Buttons presented by a graphical user interface are marked with " -"guibutton. To make the text look more like a graphical button, " -"brackets and non-breaking spaces are added surrounding the text." -msgstr "" - -#. (itstool) path: example/title -#: book.translate.xml:6191 -msgid "guibutton Example" -msgstr "guibutton 範例" - -#. (itstool) path: example/programlisting -#: book.translate.xml:6195 -#, no-wrap -msgid "" -"paraEdit the file, then click\n" -" guibutton[&nbsp;Save&nbsp;]guibutton to save the\n" -" changes.para" -msgstr "" - -#. (itstool) path: example/para -#: book.translate.xml:6201 -msgid "" -"Edit the file, then click [ Save ] to save the " -"changes." -msgstr "" - -#. (itstool) path: sect2/title -#: book.translate.xml:6208 -msgid "Quoting System Errors" -msgstr "引用系統錯誤" - -#. (itstool) path: sect2/para -#: book.translate.xml:6210 -msgid "" -"System errors generated by FreeBSD are marked with errorname. " -"This indicates the exact error that appears." -msgstr "" - -#. (itstool) path: example/title -#: book.translate.xml:6215 -msgid "errorname Example" -msgstr "errorname 範例" - -#. (itstool) path: example/programlisting -#: book.translate.xml:6219 -#, no-wrap -msgid "screenerrornamePanic: cannot mount rooterrornamescreen" -msgstr "" - -#. (itstool) path: informalexample/screen -#: book.translate.xml:6224 -#, no-wrap -msgid "Panic: cannot mount root" -msgstr "" - -#. (itstool) path: sect1/title -#: book.translate.xml:6231 -msgid "Images" -msgstr "圖片" - -#. (itstool) path: important/para -#: book.translate.xml:6234 -msgid "" -"Image support in the documentation is somewhat experimental. The mechanisms " -"described here are unlikely to change, but that is not guaranteed." -msgstr "" - -#. (itstool) path: important/para -#: book.translate.xml:6238 -msgid "" -"To provide conversion between different image formats, the graphics/" -"ImageMagick port must be installed. This port is not included in " -"the textproc/docproj meta port, and must be installed " -"separately." -msgstr "" - -#. (itstool) path: important/para -#: book.translate.xml:6244 -msgid "" -"A good example of the use of images is the doc/en_US.ISO8859-1/" -"articles/vm-design/ document. Examine the files in that directory " -"to see how these elements are used together. Build different output formats " -"to see how the format determines what images are shown in the rendered " -"document." -msgstr "" - -#. (itstool) path: sect2/title -#: book.translate.xml:6253 -msgid "Image Formats" -msgstr "圖片格式" - -#. (itstool) path: sect2/para -#: book.translate.xml:6255 -msgid "" -"The following image formats are currently supported. An image file will " -"automatically be converted to bitmap or vector image depending on the output " -"document format." -msgstr "" - -#. (itstool) path: sect2/para -#: book.translate.xml:6259 -msgid "" -"These are the only formats in which images should be " -"committed to the documentation repository." -msgstr "" - -#. (itstool) path: varlistentry/term -#: book.translate.xml:6265 -msgid "EPS (Encapsulated Postscript)" -msgstr "" - -#. (itstool) path: listitem/para -#: book.translate.xml:6269 -msgid "" -"Images that are primarily vector based, such as network diagrams, time " -"lines, and similar, should be in this format. These images have a ." -"eps extension." -msgstr "" - -#. (itstool) path: varlistentry/term -#: book.translate.xml:6277 -msgid "PNG (Portable Network Graphic)" -msgstr "" - -#. (itstool) path: listitem/para -#: book.translate.xml:6281 -msgid "" -"For bitmaps, such as screen captures, use this format. These images have the " -".png extension." -msgstr "" - -#. (itstool) path: varlistentry/term -#: book.translate.xml:6288 -msgid "PIC (PIC graphics language)" -msgstr "" - -#. (itstool) path: listitem/para -#: book.translate.xml:6291 -msgid "" -"PIC is a language for drawing simple vector-based figures " -"used in the pic1 utility. These images have the .pic extension." -msgstr "" - -#. (itstool) path: varlistentry/term -#: book.translate.xml:6299 -msgid "SCR (SCReen capture)" -msgstr "" - -#. (itstool) path: listitem/para -#: book.translate.xml:6302 -msgid "" -"This format is specific to screenshots of console output. The following " -"command generates an SCR file shot.scr from video " -"buffer of /dev/ttyv0:" -msgstr "" - -#. (itstool) path: listitem/screen -#: book.translate.xml:6307 -#, no-wrap -msgid "# vidcontrol -p < /dev/ttyv0 > shot.scr" -msgstr "" - -#. (itstool) path: listitem/para -#: book.translate.xml:6309 -msgid "" -"This is preferable to PNG format for screenshots because " -"the SCR file contains plain text of the command lines so " -"that it can be converted to a PNG image or a plain text " -"depending on the output document format." -msgstr "" - -#. (itstool) path: sect2/para -#: book.translate.xml:6319 -msgid "" -"Use the appropriate format for each image. Documentation will often have a " -"mix of EPS and PNG images. The " -"Makefiles ensure that the correct format image is " -"chosen depending on the output format used. Do not commit the same " -"image to the repository in two different formats." -msgstr "" - -#. (itstool) path: important/para -#: book.translate.xml:6328 -msgid "" -"The Documentation Project may eventually switch to using the SVG (Scalable Vector Graphic) format for vector images. However, the " -"current state of SVG capable editing tools makes this " -"impractical." -msgstr "" - -#. (itstool) path: sect2/title -#: book.translate.xml:6337 -msgid "Image File Locations" -msgstr "圖片檔案位置" - -#. (itstool) path: sect2/para -#: book.translate.xml:6339 -msgid "" -"Image files can be stored in one of several locations, depending on the " -"document and image:" -msgstr "" - -#. (itstool) path: listitem/para -#: book.translate.xml:6344 -msgid "" -"In the same directory as the document itself, usually done for articles and " -"small books that keep all their files in a single directory." -msgstr "" - -#. (itstool) path: listitem/para -#: book.translate.xml:6350 -msgid "" -"In a subdirectory of the main document. Typically done when a large book " -"uses separate subdirectories to organize individual chapters." -msgstr "" - -#. (itstool) path: listitem/para -#: book.translate.xml:6354 -msgid "" -"When images are stored in a subdirectory of the main document directory, the " -"subdirectory name must be included in their paths in the Makefile and the imagedata element." -msgstr "" - -#. (itstool) path: listitem/para -#: book.translate.xml:6362 -msgid "" -"In a subdirectory of doc/share/images named after the " -"document. For example, images for the Handbook are stored in doc/" -"share/images/books/handbook. Images that work for multiple " -"translations are stored in this upper level of the documentation file tree. " -"Generally, these are images that can be used unchanged in non-English " -"translations of the document." -msgstr "" - -#. (itstool) path: sect2/title -#: book.translate.xml:6375 -msgid "Image Markup" -msgstr "圖片標籤" - -#. (itstool) path: sect2/para -#: book.translate.xml:6377 -msgid "" -"Images are included as part of a mediaobject. The " -"mediaobject can contain other, more specific objects. We are " -"concerned with two, the imageobject and the textobject." -msgstr "" - -#. (itstool) path: sect2/para -#: book.translate.xml:6382 -msgid "" -"Include one imageobject, and two textobject elements. " -"The imageobject will point to the name of the image file without " -"the extension. The textobject elements contain information that " -"will be presented to the user as well as, or instead of, the image itself." -msgstr "" - -#. (itstool) path: sect2/para -#: book.translate.xml:6389 -msgid "" -"Text elements are shown to the reader in several situations. When the " -"document is viewed in HTML, text elements are shown while " -"the image is loading, or if the mouse pointer is hovered over the image, or " -"if a text-only browser is being used. In formats like plain text where " -"graphics are not possible, the text elements are shown instead of the " -"graphical ones." -msgstr "" - -#. (itstool) path: sect2/para -#: book.translate.xml:6397 -msgid "" -"This example shows how to include an image called fig1.png in a document. The image is a rectangle with an A inside it:" -msgstr "" - -#. (itstool) path: sect2/programlisting -#: book.translate.xml:6401 -#, no-wrap -msgid "" -"mediaobject\n" -" imageobject\n" -" imagedata fileref=\"fig1\" \n" -" imageobject\n" -"\n" -" textobject\n" -" literallayout class=\"monospaced\"+---------------+ \n" -"| A |\n" -"+---------------+literallayout\n" -" textobject\n" -"\n" -" textobject\n" -" phraseA picturephrase \n" -" textobject\n" -"mediaobject" -msgstr "" - -#. (itstool) path: callout/para -#: book.translate.xml:6419 -msgid "" -"Include an imagedata element inside the imageobject " -"element. The fileref attribute should contain the " -"filename of the image to include, without the extension. The stylesheets " -"will work out which extension should be added to the filename automatically." -msgstr "" - -#. (itstool) path: callout/para -#: book.translate.xml:6429 -msgid "" -"The first textobject contains a literallayout element, " -"where the class attribute is set to monospaced. This is an opportunity to demonstrate ASCII art " -"skills. This content will be used if the document is converted to plain text." -msgstr "" - -#. (itstool) path: callout/para -#: book.translate.xml:6437 -msgid "" -"Notice how the first and last lines of the content of the " -"literallayout element butt up next to the element's tags. This " -"ensures no extraneous white space is included." -msgstr "" - -#. (itstool) path: callout/para -#: book.translate.xml:6444 -msgid "" -"The second textobject contains a single phrase " -"element. The contents of this phrase will become the alt " -"attribute for the image when this document is converted to HTML." -msgstr "" - -#. (itstool) path: sect2/title -#: book.translate.xml:6454 -msgid "Image Makefile Entries" -msgstr "圖片 Makefile 項目" - -#. (itstool) path: sect2/para -#: book.translate.xml:6456 -msgid "" -"Images must be listed in the Makefile in the " -"IMAGES variable. This variable must contain the names of " -"all the source images. For example, if there are three " -"figures, fig1.eps, fig2.png, " -"fig3.png, then the Makefile should " -"have lines like this in it." -msgstr "" - -#. (itstool) path: sect2/programlisting -#: book.translate.xml:6465 -#, no-wrap -msgid "" -"…\n" -"IMAGES= fig1.eps fig2.png fig3.png\n" -"…" -msgstr "" - -#. (itstool) path: sect2/para -#. (itstool) path: question/para -#: book.translate.xml:6469 book.translate.xml:7057 -msgid "or" -msgstr "" - -#. (itstool) path: sect2/programlisting -#: book.translate.xml:6471 -#, no-wrap -msgid "" -"…\n" -"IMAGES= fig1.eps\n" -"IMAGES+= fig2.png\n" -"IMAGES+= fig3.png\n" -"…" -msgstr "" - -#. (itstool) path: sect2/para -#: book.translate.xml:6477 -msgid "" -"Again, the Makefile will work out the complete list of " -"images it needs to build the source document, you only need to list the " -"image files you provided." -msgstr "" - -#. (itstool) path: sect2/title -#: book.translate.xml:6484 -msgid "Images and Chapters in Subdirectories" -msgstr "在子目錄中的圖片與章節" - -#. (itstool) path: sect2/para -#: book.translate.xml:6486 -msgid "" -"Be careful when separating documentation into smaller files in different " -"directories (see )." -msgstr "" - -#. (itstool) path: sect2/para -#: book.translate.xml:6489 -msgid "" -"Suppose there is a book with three chapters, and the chapters are stored in " -"their own directories, called chapter1/chapter.xml, " -"chapter2/chapter.xml, and chapter3/chapter." -"xml. If each chapter has images associated with it, place those " -"images in each chapter's subdirectory (chapter1/, " -"chapter2/, and chapter3/)." -msgstr "" - -#. (itstool) path: sect2/para -#: book.translate.xml:6499 -msgid "" -"However, doing this requires including the directory names in the " -"IMAGES variable in the Makefile, " -"and including the directory name in the imagedata element in the document." -msgstr "" - -#. (itstool) path: sect2/para -#: book.translate.xml:6505 -msgid "" -"For example, if the book has chapter1/fig1.png, then " -"chapter1/chapter.xml should contain:" -msgstr "" - -#. (itstool) path: sect2/programlisting -#: book.translate.xml:6510 -#, no-wrap -msgid "" -"mediaobject\n" -" imageobject\n" -" imagedata fileref=\"chapter1/fig1\" \n" -" imageobject\n" -"\n" -" …\n" -"\n" -"mediaobject" -msgstr "" - -#. (itstool) path: callout/para -#: book.translate.xml:6521 -msgid "" -"The directory name must be included in the fileref " -"attribute." -msgstr "" - -#. (itstool) path: sect2/para -#: book.translate.xml:6526 -msgid "The Makefile must contain:" -msgstr "" - -#. (itstool) path: sect2/programlisting -#: book.translate.xml:6528 -#, no-wrap -msgid "" -"…\n" -"IMAGES= chapter1/fig1.png\n" -"…" -msgstr "" - -#. (itstool) path: note/para -#: book.translate.xml:6538 -msgid "" -"Links are also in-line elements. To show a URI without " -"creating a link, see ." -msgstr "" - -#. (itstool) path: sect2/title -#: book.translate.xml:6544 -msgid "xml:id Attributes" -msgstr "xml:id 屬性" - -#. (itstool) path: sect2/para -#: book.translate.xml:6546 -msgid "" -"Most DocBook elements accept an xml:id attribute to give " -"that part of the document a unique name. The xml:id can " -"be used as a target for a crossreference or link." -msgstr "" - -#. (itstool) path: sect2/para -#: book.translate.xml:6551 -msgid "" -"Any portion of the document that will be a link target must have an " -"xml:id attribute. Assigning an xml:id " -"to all chapters and sections, even if there are no current plans to link to " -"them, is a good idea. These xml:ids can be used as unique " -"reference points by anyone referring to the HTML version " -"of the document." -msgstr "" - -#. (itstool) path: example/title -#: book.translate.xml:6560 -msgid "xml:id on Chapters and Sections Example" -msgstr "在章與節上加 xml:id 的範例" - -#. (itstool) path: example/programlisting -#: book.translate.xml:6563 -#, no-wrap -msgid "" -"chapter xml:id=\"introduction\"\n" -" titleIntroductiontitle\n" -"\n" -" paraThis is the introduction. It contains a subsection,\n" -" which is identified as well.para\n" -"\n" -" sect1 xml:id=\"introduction-moredetails\"\n" -" titleMore Detailstitle\n" -"\n" -" paraThis is a subsection.para\n" -" sect1\n" -"chapter" -msgstr "" - -#. (itstool) path: sect2/para -#: book.translate.xml:6577 -msgid "" -"Use descriptive values for xml:id names. The values must " -"be unique within the entire document, not just in a single file. In the " -"example, the subsection xml:id is constructed by " -"appending text to the chapter xml:id. This ensures that " -"the xml:ids are unique. It also helps both reader and " -"anyone editing the document to see where the link is located within the " -"document, similar to a directory path to a file." -msgstr "" - -#. (itstool) path: sect2/title -#: book.translate.xml:6589 -msgid "Crossreferences with xref" -msgstr "使用 xref 交叉參照" - -#. (itstool) path: sect2/para -#: book.translate.xml:6591 -msgid "" -"xref provides the reader with a link to jump to another section " -"of the document. The target xml:id is specified in the " -"linkend attribute, and xref generates the link " -"text automatically." -msgstr "" - -#. (itstool) path: example/title -#: book.translate.xml:6598 -msgid "xref Example" -msgstr "xref 範例" - -#. (itstool) path: example/para -#: book.translate.xml:6600 -msgid "" -"Assume that this fragment appears somewhere in a document that includes the " -"xml:id example shown above:" -msgstr "" - -#. (itstool) path: example/programlisting -#: book.translate.xml:6604 -#, no-wrap -msgid "" -"paraMore information can be found\n" -" in xref linkend=\"introduction\".para\n" -"\n" -"paraMore specific information can be found\n" -" in xref linkend=\"introduction-moredetails\".para" -msgstr "" - -#. (itstool) path: example/para -#: book.translate.xml:6610 -msgid "" -"The link text will be generated automatically, looking like " -"(emphasized text indicates the link text):" -msgstr "" - -#. (itstool) path: blockquote/para -#: book.translate.xml:6615 -msgid "" -"More information can be found in Chapter 1, Introduction." -msgstr "" - -#. (itstool) path: blockquote/para -#: book.translate.xml:6618 -msgid "" -"More specific information can be found in Section 1.1, More " -"Details." -msgstr "" - -#. (itstool) path: sect2/para -#: book.translate.xml:6624 -msgid "" -"The link text is generated automatically from the chapter and section number " -"and title elements." -msgstr "" - -#. (itstool) path: sect2/para -#: book.translate.xml:6633 -msgid "" -"The link element described here allows the writer to define the link text. " -"When link text is used, it is very important to be descriptive to give the " -"reader an idea of where the link goes. Remember that DocBook can be rendered " -"to multiple types of media. The reader might be looking at a printed book or " -"other form of media where there are no links. If the link text is not " -"descriptive enough, the reader might not be able to locate the linked " -"section." -msgstr "" - -#. (itstool) path: sect2/para -#: book.translate.xml:6642 -msgid "" -"The xlink:href attribute is the URL of " -"the page, and the content of the element is the text that will be displayed " -"for the user to activate." -msgstr "" - -#. (itstool) path: sect2/para -#: book.translate.xml:6647 -msgid "" -"In many situations, it is preferable to show the actual URL rather than text. This can be done by leaving out the element text " -"entirely." -msgstr "" - -#. (itstool) path: example/title -#: book.translate.xml:6652 -msgid "link to a FreeBSD Documentation Web Page Example" -msgstr "link 到 FreeBSD 說明文件網頁範例" - -#. (itstool) path: example/para -#: book.translate.xml:6655 -msgid "" -"Link to the book or article URL entity. To link to a " -"specific chapter in a book, add a slash and the chapter file name, followed " -"by an optional anchor within the chapter. For articles, link to the article " -"URL entity, followed by an optional anchor within the " -"article. URL entities can be found in doc/share/" -"xml/urls.ent." -msgstr "" - -#. (itstool) path: example/para -#: book.translate.xml:6664 -msgid "Usage for FreeBSD book links:" -msgstr "" - -#. (itstool) path: example/programlisting -#: book.translate.xml:6666 -#, no-wrap -msgid "" -"paraRead the link\n" -" xlink:href=\"&url.books.handbook;/svn.html#svn-intro\"SVN\n" -" introductionlink, then pick the nearest mirror from\n" -" the list of link\n" -" xlink:href=\"&url.books.handbook;/svn.html#svn-mirrors\"Subversion\n" -" mirror siteslink.para" -msgstr "" - -#. (itstool) path: example/para -#: book.translate.xml:6675 -msgid "" -"Read the SVN introduction, then pick the nearest " -"mirror from the list of Subversion mirror sites." -msgstr "" - -#. (itstool) path: example/para -#: book.translate.xml:6680 -msgid "Usage for FreeBSD article links:" -msgstr "" - -#. (itstool) path: example/programlisting -#: book.translate.xml:6682 -#, no-wrap -msgid "" -"paraRead this\n" -" link xlink:href=\"&url.articles.bsdl-gpl;\"article\n" -" about the BSD licenselink, or just the\n" -" link xlink:href=\"&url.articles.bsdl-gpl;#intro\"introductionlink.para" -msgstr "" - -#. (itstool) path: example/para -#: book.translate.xml:6689 -msgid "" -"Read this article about the BSD license, or just the introduction." -msgstr "" - -#. (itstool) path: example/title -#: book.translate.xml:6695 -msgid "link to a FreeBSD Web Page Example" -msgstr "link 到 FreeBSD 網頁範例" - -#. (itstool) path: example/programlisting -#: book.translate.xml:6699 -#, no-wrap -msgid "" -"paraOf course, you could stop reading this document and go to the\n" -" link xlink:href=\"&url.base;/index.html\"FreeBSD home pagelink instead.para" -msgstr "" - -#. (itstool) path: example/para -#: book.translate.xml:6704 -msgid "" -"Of course, you could stop reading this document and go to the FreeBSD home page instead." -msgstr "" - -#. (itstool) path: example/title -#: book.translate.xml:6710 -msgid "link to an External Web Page Example" -msgstr "link 到外部網頁範例" - -#. (itstool) path: example/programlisting -#: book.translate.xml:6715 -#, no-wrap -msgid "" -"paraWikipedia has an excellent reference on\n" -" link\n" -" xlink:href=\"http://en.wikipedia.org/wiki/GUID_Partition_Table\"GUID\n" -" Partition Tableslink.para" -msgstr "" - -#. (itstool) path: example/para -#: book.translate.xml:6722 -msgid "" -"Wikipedia has an excellent reference on GUID Partition Tables." -msgstr "" - -#. (itstool) path: example/para -#: book.translate.xml:6725 -msgid "The link text can be omitted to show the actual URL:" -msgstr "" - -#. (itstool) path: example/programlisting -#: book.translate.xml:6728 -#, no-wrap -msgid "" -"paraWikipedia has an excellent reference on\n" -" GUID Partition Tables: link\n" -" xlink:href=\"http://en.wikipedia.org/wiki/GUID_Partition_Table\"link.para" -msgstr "" - -#. (itstool) path: example/para -#: book.translate.xml:6732 -msgid "" -"The same link can be entered using shorter notation instead of a separate " -"ending tag:" -msgstr "" - -#. (itstool) path: example/programlisting -#: book.translate.xml:6735 -#, no-wrap -msgid "" -"paraWikipedia has an excellent reference on\n" -" GUID Partition Tables: link\n" -" xlink:href=\"http://en.wikipedia.org/wiki/GUID_Partition_Table\".para" -msgstr "" - -#. (itstool) path: example/para -#: book.translate.xml:6739 -msgid "The two methods are equivalent. Appearance:" -msgstr "" - -#. (itstool) path: example/para -#: book.translate.xml:6741 -msgid "" -"Wikipedia has an excellent reference on GUID Partition Tables: http://en." -"wikipedia.org/wiki/GUID_Partition_Table." -msgstr "" - -#. (itstool) path: chapter/title -#: book.translate.xml:6781 -msgid "Style Sheets" -msgstr "樣式表" - -#. (itstool) path: chapter/para -#: book.translate.xml:6783 -msgid "" -"XML is concerned with content, and says nothing about how " -"that content should be presented to the reader or rendered on paper. " -"Multiple style sheet languages have been developed to " -"describe visual layout, including Extensible Stylesheet Language " -"Transformation (XSLT), Document Style Semantics and " -"Specification Language (DSSSL), and Cascading Style " -"Sheets (CSS)." -msgstr "" - -#. (itstool) path: chapter/para -#: book.translate.xml:6792 -msgid "" -"The FDP documents use XSLT stylesheets " -"to transform DocBook into XHTML, and then CSS formatting is applied to the XHTML pages. " -"Printable output is currently rendered with legacy DSSSL " -"stylesheets, but this will probably change in the future." -msgstr "" - -#. (itstool) path: sect1/title -#: book.translate.xml:6801 -msgid "CSS" -msgstr "" - -#. (itstool) path: sect1/para -#: book.translate.xml:6803 -msgid "" -"Cascading Style Sheets (CSS) are a mechanism for " -"attaching style information (font, weight, size, color, and so forth) to " -"elements in an XHTML document without abusing " -"XHTML to do so." -msgstr "" - -#. (itstool) path: sect2/title -#: book.translate.xml:6810 -msgid "The DocBook Documents" -msgstr "DocBook 文件" - -#. (itstool) path: sect2/para -#: book.translate.xml:6812 -msgid "" -"The FreeBSD XSLT and DSSSL stylesheets " -"refer to docbook.css, which is expected to be present " -"in the same directory as the XHTML files. The project-" -"wide CSS file is copied from doc/share/misc/" -"docbook.css when documents are converted to XHTML, and is installed automatically." -msgstr "" - -#. (itstool) path: chapter/title -#: book.translate.xml:6857 -msgid "Translations" -msgstr "翻譯" - -#. (itstool) path: chapter/para -#: book.translate.xml:6859 -msgid "" -"This is the FAQ for people translating the FreeBSD documentation (FAQ, " -"Handbook, tutorials, manual pages, and others) to different languages." -msgstr "" -"本章節是供要翻譯 FreeBSD 說明文件 (常見問答集 (FAQ)、使用手冊 (Handbook)、教" -"學 (Tutorial)、操作手冊 (Manual page) 等) 到各種語言的常見問答集 (FAQ)。" - -#. (itstool) path: chapter/para -#: book.translate.xml:6863 -msgid "" -"It is very heavily based on the translation FAQ from " -"the FreeBSD German Documentation Project, originally written by Frank " -"Gründer elwood@mc5sys.in-berlin.de and translated back to " -"English by Bernd Warken bwarken@mayn.de." -msgstr "" -"本文件 主要 是以 FreeBSD 德文說明文件計劃的翻譯常見問答" -"集為母本而來的,原始撰稿者為 Frank Gründer elwood@mc5sys.in-berlin." -"de,並由 Bernd Warken bwarken@mayn.de 再翻譯回英文版。" - -#. (itstool) path: chapter/para -#: book.translate.xml:6869 -msgid "" -"The FAQ is maintained by the Documentation Engineering Team " -"doceng@FreeBSD.org." -msgstr "" -"本常見問答集是由文件工程團隊 Documentation Engineering Team " -"doceng@FreeBSD.org 所維護。" - -#. (itstool) path: question/para -#: book.translate.xml:6874 -msgid "What do i18n and l10n mean?" -msgstr "i18nl10n 代表的是什麼意思?" - -#. (itstool) path: answer/para -#: book.translate.xml:6879 -msgid "" -"i18n means internationalization and " -"l10n means localization. They are just a " -"convenient shorthand." -msgstr "" -"i18n 指的是國際化 (Internationalization) " -"而 l10n 指的是在地化 (Localization)。這些都" -"是為了書寫方便而用的簡寫。" - -#. (itstool) path: answer/para -#: book.translate.xml:6884 -msgid "" -"i18n can be read as i followed by 18 " -"letters, followed by n. Similarly, l10n is " -"l followed by 10 letters, followed by n." -msgstr "" -"i18n 就是開頭為 i 後面有 18 個字母,最後接 " -"n。同樣地,l10n 是開頭為 l 後" -"面有 10 個字母,最後接 n。" - -#. (itstool) path: question/para -#: book.translate.xml:6893 -msgid "Is there a mailing list for translators?" -msgstr "有給翻譯人員參與討論的郵遞論壇 (Mailing list) 嗎?" - -#. (itstool) path: answer/para -#: book.translate.xml:6897 -msgid "" -"Yes. Different translation groups have their own mailing lists. The list of " -"translation projects has more information about the mailing lists and " -"web sites run by each translation project. In addition there is " -"freebsd-translators@freebsd.org for general translation " -"discussion." -msgstr "" -"有的,不同的語系翻譯人員都各自有自屬的郵遞論壇。這份 翻譯計劃清單 有" -"列出各翻譯計劃的詳細 mailing lists 及相關網站。此外,有一般翻譯討論的" -"freebsd-translators@freebsd.org郵件論壇。" - -#. (itstool) path: question/para -#: book.translate.xml:6909 -msgid "Are more translators needed?" -msgstr "需要更多人一起參與翻譯嗎?" - -#. (itstool) path: answer/para -#: book.translate.xml:6913 -msgid "" -"Yes. The more people work on translation the faster it gets done, and the " -"faster changes to the English documentation are mirrored in the translated " -"documents." -msgstr "" -"當然囉,越多人參與翻譯,那麼就能夠越快翻完,而且英文版說明文件若有增減、更新" -"的話,各翻譯版也可以儘快同步囉。" - -#. (itstool) path: answer/para -#: book.translate.xml:6918 -msgid "You do not have to be a professional translator to be able to help." -msgstr "不一定得是專業譯者,才能參與翻譯的。" - -#. (itstool) path: question/para -#: book.translate.xml:6925 -msgid "What languages do I need to know?" -msgstr "有要求哪些語言能力呢" - -#. (itstool) path: answer/para -#: book.translate.xml:6929 -msgid "" -"Ideally, you will have a good knowledge of written English, and obviously " -"you will need to be fluent in the language you are translating to." -msgstr "" -"理論上,必須要對英文非常熟稔,而且很明顯地,對想翻譯的語言必須要能運用自如。" - -#. (itstool) path: answer/para -#: book.translate.xml:6933 -msgid "" -"English is not strictly necessary. For example, you could do a Hungarian " -"translation of the FAQ from the Spanish translation." -msgstr "" -"英文也並非一定要會的。比如說,可以把西班牙文 (Spanish) 的 FAQ 翻譯為匈牙利文 " -"(Hungarian)。" - -#. (itstool) path: question/para -#: book.translate.xml:6941 -msgid "What software do I need to know?" -msgstr "該學會哪些程式的使用呢?" - -#. (itstool) path: answer/para -#: book.translate.xml:6945 -msgid "" -"It is strongly recommended that you maintain a local copy of the FreeBSD " -"Subversion repository (at least the documentation part). This can be done by " -"running:" -msgstr "" -"強烈建議在自己機器上也建立 FreeBSD Subversion 檔案庫的備份 (至少要有說明文件" -"的部分),這可以執行:" - -#. (itstool) path: answer/screen -#: book.translate.xml:6949 -#, no-wrap -msgid "% svn checkout https://svn.FreeBSD.org/doc/head/ head" -msgstr "% svn checkout https://svn.FreeBSD.org/doc/head/ head" - -#. (itstool) path: answer/para -#: book.translate.xml:6951 -msgid "" -"svn.FreeBSD.org is a " -"public SVN server. Verify the server certificate from the " -"list of Subversion mirror sites." -msgstr "" -"svn.FreeBSD.org 是公共" -"的 SVN 伺服器。可以從 Subversion 鏡像站 清單檢查認證的伺服器。" - -#. (itstool) path: note/para -#: book.translate.xml:6958 -msgid "" -"This will require the devel/subversion package to be " -"installed." -msgstr "這需要安裝 devel/subversion 套件。" - -#. (itstool) path: answer/para -#: book.translate.xml:6962 -msgid "" -"You should be comfortable using svn. This will " -"allow you to see what has changed between different versions of the files " -"that make up the documentation." -msgstr "" -"你可以很自在地使用 svn。他可以讓你察看說明文件檔案" -"不同版本之間的修改差異。" - -#. (itstool) path: answer/para -#: book.translate.xml:6967 -msgid "" -"For example, to view the differences between revisions r33733 and r33734 of en_US.ISO8859-1/books/" -"fdp-primer/book.xml, run:" -msgstr "" -"例如你要看 en_US.ISO8859-1/books/fdp-primer/book.xml 版" -"本r33733r33734 的差異,請執行:" - -#. (itstool) path: answer/screen -#: book.translate.xml:6972 -#, no-wrap -msgid "% svn diff -r33733:33734 en_US.ISO8859-1/books/fdp-primer/book.xml" -msgstr "% svn diff -r33733:33734 en_US.ISO8859-1/books/fdp-primer/book.xml" - -#. (itstool) path: question/para -#: book.translate.xml:6978 -msgid "How do I find out who else might be translating to the same language?" -msgstr "要怎麼找出來還有誰要跟我一起翻譯的呢?" - -#. (itstool) path: answer/para -#: book.translate.xml:6983 -msgid "" -"The Documentation Project translations page lists the translation " -"efforts that are currently known about. If others are already working on " -"translating documentation to your language, please do not duplicate their " -"efforts. Instead, contact them to see how you can help." -msgstr "" -"說明文" -"件計劃翻譯頁 列了目前已知的各翻譯者成果,如果已經有其他人也在做跟你一" -"樣的翻譯工作,那麼請不要重複浪費人力,請與他們聯繫看看還有哪些地方可以幫上忙" -"的。" - -#. (itstool) path: answer/para -#: book.translate.xml:6990 -msgid "" -"If no one is listed on that page as translating for your language, then send " -"a message to the FreeBSD documentation project mailing list in " -"case someone else is thinking of doing a translation, but has not announced " -"it yet." -msgstr "" -"若上面並未列出你母語的翻譯,或是也有人要翻譯但還未公開宣布的話,那麼就寄信到 " -"FreeBSD 說明文件計劃郵遞論壇 。" - -#. (itstool) path: question/para -#: book.translate.xml:6999 -msgid "No one else is translating to my language. What do I do?" -msgstr "都沒人翻譯為我所使用的語言,該怎麼辦?" - -#. (itstool) path: answer/para -#: book.translate.xml:7004 -msgid "" -"Congratulations, you have just started the FreeBSD your-" -"language-here Documentation Translation Project. " -"Welcome aboard." -msgstr "" -"恭喜啊,你剛好踏上 FreeBSD 您的語言 說明文" -"件翻譯計劃的啟程之路,歡迎登船。" - -#. (itstool) path: answer/para -#: book.translate.xml:7009 -msgid "" -"First, decide whether or not you have got the time to spare. Since you are " -"the only person working on your language at the moment it is going to be " -"your responsibility to publicize your work and coordinate any volunteers " -"that might want to help you." -msgstr "" -"首先呢,先判斷是否有妥善規劃時間,因為你只有一個人在翻而已,因此,相關翻譯成" -"果的公布、與其他可能會幫忙的志工們聯繫這些工作都是你的職責所在。" - -#. (itstool) path: answer/para -#: book.translate.xml:7015 -msgid "" -"Write an email to the Documentation Project mailing list, announcing that " -"you are going to translate the documentation, so the Documentation Project " -"translations page can be maintained." -msgstr "" -"寫信到文件計劃郵遞論壇 (Documentation Project mailing list) 向大家宣布你正準" -"備要翻譯,然後文件計劃的翻譯部分就會更新相關資料。" - -#. (itstool) path: answer/para -#: book.translate.xml:7020 -msgid "" -"If there is already someone in your country providing FreeBSD mirroring " -"services you should contact them and ask if you can have some webspace for " -"your project, and possibly an email address or mailing list services." -msgstr "" -"若你的國家已經有人提供 FreeBSD 的鏡像站 (Mirror) 服務的話,那麼就先跟他們聯" -"繫,並詢問你是否在上面可以有網頁空間來放相關計劃資料,以及是否可以有提供電子" -"郵件帳號或郵遞論壇服務。" - -#. (itstool) path: answer/para -#: book.translate.xml:7025 -msgid "" -"Then pick a document and start translating. It is best to start with " -"something fairly small—either the FAQ, or one of the tutorials." -msgstr "" -"然後,就開始翻文件囉,一開始翻譯的時候,先找些篇幅較短的文件會比較容易些 —— " -"像是 FAQ 啦,或是如何上手之類的說明文章。" - -#. (itstool) path: question/para -#: book.translate.xml:7033 -msgid "I have translated some documentation, where do I send it?" -msgstr "已經翻好一些說明文件了,該寄到哪呢?" - -#. (itstool) path: answer/para -#: book.translate.xml:7038 -msgid "" -"That depends. If you are already working with a translation team (such as " -"the Japanese team, or the German team) then they will have their own " -"procedures for handling submitted documentation, and these will be outlined " -"on their web pages." -msgstr "" -"這要看情況而定。若你是在翻譯團隊內做的話 (像是日本團隊、德國團隊),他們會有自" -"己內部流程來決定翻譯文件怎麼送,這些大致流程會在他們網頁上面有寫。" - -#. (itstool) path: answer/para -#: book.translate.xml:7044 -msgid "" -"If you are the only person working on a particular language (or you are " -"responsible for a translation project and want to submit your changes back " -"to the FreeBSD project) then you should send your translation to the FreeBSD " -"project (see the next question)." -msgstr "" -"若你是某語系的唯一翻譯者 (或你是負責某翻譯計劃,並想把成果回饋給 FreeBSD 計" -"劃),那麼你就應該把自己的翻譯成果寄給 FreeBSD 計劃。(細節請看下個問題)" - -#. (itstool) path: question/para -#: book.translate.xml:7054 -msgid "" -"I am the only person working on translating to this language, how do I " -"submit my translation?" -msgstr "我是該語系的唯一翻譯者,該怎麼把翻譯成果寄出去呢?" - -#. (itstool) path: question/para -#: book.translate.xml:7059 -msgid "" -"We are a translation team, and want to submit documentation that our members " -"have translated for us." -msgstr "我們是翻譯團隊,該怎麼把我們成員翻譯成果寄出去呢?" - -#. (itstool) path: answer/para -#: book.translate.xml:7065 -msgid "" -"First, make sure your translation is organized properly. This means that it " -"should drop into the existing documentation tree and build straight away." -msgstr "" -"首先,請先確定你的翻譯成果組織條理分明,並可正確編譯,也就是說: 把它擺到現有" -"說明文件樹內是可以正確編譯成功的。" - -#. (itstool) path: answer/para -#: book.translate.xml:7069 -msgid "" -"Currently, the FreeBSD documentation is stored in a top level directory " -"called head/. Directories below this are named " -"according to the language code they are written in, as defined in ISO639 " -"(/usr/share/misc/iso639 on a version of FreeBSD newer " -"than 20th January 1999)." -msgstr "" -"目前,FreeBSD 說明文件都是放在最上層的 head/ 目錄內。而" -"該目錄下的則根據其 ISO639 所定義的語系代碼來做分類命名的 (在 1999/1/20 之後" -"的 FreeBSD 版本中的 /usr/share/misc/iso639)。" - -#. (itstool) path: answer/para -#: book.translate.xml:7076 -msgid "" -"If your language can be encoded in different ways (for example, Chinese) " -"then there should be directories below this, one for each encoding format " -"you have provided." -msgstr "" -"若你這個語系可能會有不同編碼方式 (像是:中文) 那麼就應該會像下面這樣,來依你" -"所使用的編碼方式細分。" - -#. (itstool) path: answer/para -#: book.translate.xml:7080 -msgid "Finally, you should have directories for each document." -msgstr "最後,你應該建立好各文件的目錄了。" - -#. (itstool) path: answer/para -#: book.translate.xml:7083 -msgid "For example, a hypothetical Swedish translation might look like:" -msgstr "舉例來說,假設有瑞典文 (Swedish) 版的翻譯,那麼應該會長像:" - -#. (itstool) path: answer/programlisting -#: book.translate.xml:7086 -#, no-wrap -msgid "" -"head/\n" -" sv_SE.ISO8859-1/\n" -" Makefile\n" -" htdocs/\n" -" docproj/\n" -" books/\n" -" faq/\n" -" Makefile\n" -" book.xml" -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:7096 -msgid "" -"sv_SE.ISO8859-1 is the name of the translation, in " -"lang.encoding form. Note the two Makefiles, which will be used to " -"build the documentation." -msgstr "" -"sv_SE.ISO8859-1是依照 語系 (Lang).編碼 (Encoding) 的規則來建" -"立的譯名。請注意:其中有兩個 Makefile 檔,它們是用來建置說明文件的。" - -#. (itstool) path: answer/para -#: book.translate.xml:7102 -msgid "" -"Use tar1 and gzip1 to compress up your " -"documentation, and send it to the project." -msgstr "" -"然後請用 tar1gzip1 來把你的說明文件壓縮起" -"來,並寄到本計劃來。" - -#. (itstool) path: answer/screen -#: book.translate.xml:7105 -#, no-wrap -msgid "" -"% cd doc\n" -"% tar cf swedish-docs.tar sv_SE.ISO8859-1\n" -"% gzip -9 swedish-docs.tar" -msgstr "" -"% cd doc\n" -"% tar cf swedish-docs.tar sv_SE.ISO8859-1\n" -"% gzip -9 swedish-docs.tar" - -#. (itstool) path: answer/para -#: book.translate.xml:7109 -msgid "" -"Put swedish-docs.tar.gz somewhere. If you do not have " -"access to your own webspace (perhaps your ISP does not let you have any) " -"then you can email Documentation Engineering Team doceng@FreeBSD.org, and arrange to email the files when it is convenient." -msgstr "" -"接著,把 swedish-docs.tar.gz 放到網頁空間上,若你沒有自" -"己網頁空間的話 (ISP 不提供),那麼可以該檔寄到文件工程團隊 Documentation " -"Engineering Team doceng@FreeBSD.org 來。" - -#. (itstool) path: answer/para -#: book.translate.xml:7115 -msgid "" -"Either way, you should use Bugzilla to submit a report indicating that you " -"have submitted the documentation. It would be very helpful if you could get " -"other people to look over your translation and double check it first, since " -"it is unlikely that the person committing it will be fluent in the language." -msgstr "" -"還有,記得用 Bugzilla 提交一個回報來通知大家你已經提交說明文件了,還有,若有" -"人可以幫忙檢閱、複審文件的話,對翻譯品質較好,因為這也有助於提升翻譯品質的流" -"暢度。" - -#. (itstool) path: answer/para -#: book.translate.xml:7122 -msgid "" -"Someone (probably the Documentation Project Manager, currently Documentation " -"Engineering Team doceng@FreeBSD.org) will then take your " -"translation and confirm that it builds. In particular, the following things " -"will be looked at:" -msgstr "" -"最後,會有人 (可能是文件計劃管理者,或是文件工程團隊 Documentation " -"Engineering Team doceng@FreeBSD.org 成員) 會檢閱你的翻譯文件," -"並確認是否可正常編譯。此外,他們會特別注意下列幾點:" - -#. (itstool) path: listitem/para -#: book.translate.xml:7129 -msgid "Do all your files use RCS strings (such as \"ID\")?" -msgstr "你的檔案是否都有用 RCS tag (像是 \"ID\" 之類的)?" - -#. (itstool) path: listitem/para -#: book.translate.xml:7134 -msgid "" -"Does make all in the sv_SE.ISO8859-1 " -"directory work correctly?" -msgstr "" -"sv_SE.ISO8859-1 是否可以順利make all " -"編譯呢?" - -#. (itstool) path: listitem/para -#: book.translate.xml:7140 -msgid "Does make install work correctly?" -msgstr "make install 是否結果有正確" - -#. (itstool) path: answer/para -#: book.translate.xml:7145 -msgid "" -"If there are any problems then whoever is looking at the submission will get " -"back to you to work them out." -msgstr "若有問題的話,那麼檢閱者會叮嚀你,來讓這些翻譯成果可以正確使用。" - -#. (itstool) path: answer/para -#: book.translate.xml:7148 -msgid "" -"If there are no problems your translation will be committed as soon as " -"possible." -msgstr "若沒問題的話,那麼就會很快把你的翻譯成果提交。" - -#. (itstool) path: question/para -#: book.translate.xml:7155 -msgid "Can I include language or country specific text in my translation?" -msgstr "可以加入某語系或某國家才有的東西到翻譯內容內嗎?" - -#. (itstool) path: answer/para -#: book.translate.xml:7160 -msgid "We would prefer that you did not." -msgstr "我們希望不要這麼做。" - -#. (itstool) path: answer/para -#: book.translate.xml:7162 -msgid "" -"For example, suppose that you are translating the Handbook to Korean, and " -"want to include a section about retailers in Korea in your Handbook." -msgstr "" -"舉例來說,假設你正準備把使用手冊 (Handbook) 翻譯為韓文版,並希望把韓國零售商" -"也加到你翻譯的韓文版使用手冊內。" - -#. (itstool) path: answer/para -#: book.translate.xml:7166 -msgid "" -"There is no real reason why that information should not be in the English " -"(or German, or Spanish, or Japanese, or …) versions as well. It is feasible " -"that an English speaker in Korea might try to pick up a copy of FreeBSD " -"whilst over there. It also helps increase FreeBSD's perceived presence " -"around the globe, which is not a bad thing." -msgstr "" -"我們想不出來有啥原因,為什麼不把這些資訊提供給英文版呢?(或是德文、西班牙文、" -"日文等 …) 因為,有可能英語讀者跑去韓國時,會想買 FreeBSD 相關產品。此外,這也" -"可以提升 FreeBSD 的可見度,很顯然的,這並不是件壞事啊。" - -#. (itstool) path: answer/para -#: book.translate.xml:7174 -msgid "" -"If you have country specific information, please submit it as a change to " -"the English Handbook (using Bugzilla) and then translate the change back to " -"your language in the translated Handbook." -msgstr "" -"若你有某國才有的資料,請提供給英文版使用手冊以作為修訂 (用 Bugzilla),然後再" -"把英文版的修訂部分翻為你要翻譯的使用手冊吧。" - -#. (itstool) path: answer/para -#: book.translate.xml:7179 -msgid "Thanks." -msgstr "謝謝。" - -#. (itstool) path: question/para -#: book.translate.xml:7185 -msgid "How should language specific characters be included?" -msgstr "要怎麼把該語系特有的字元寫進去翻譯內容呢?" - -#. (itstool) path: answer/para -#: book.translate.xml:7190 -msgid "" -"Non-ASCII characters in the documentation should be included using SGML " -"entities." -msgstr "" -"說明文件內所有的非 ASCII (Non-ASCII) 的字元,都要使用 SGML entities 才能寫進" -"去。" - -#. (itstool) path: answer/para -#: book.translate.xml:7193 -msgid "" -"Briefly, these look like an ampersand (&), the name of the entity, and a " -"semi-colon (;)." -msgstr "" -"簡單來說,長相一開頭會是 and 符號 (&),然後是該 Entity 名稱,最後接上分" -"號 (;)。" - -#. (itstool) path: answer/para -#: book.translate.xml:7196 -msgid "" -"The entity names are defined in ISO8879, which is in the ports tree as " -"textproc/iso8879." -msgstr "" -"這些 Entity 名稱都是 ISO8879 所制訂的,其在 Port 樹內的 textproc/" -"iso8879。" - -#. (itstool) path: answer/para -#: book.translate.xml:7199 -msgid "A few examples include:" -msgstr "以下舉一些例子:" - -#. (itstool) path: segmentedlist/segtitle -#: book.translate.xml:7202 -msgid "Entity" -msgstr "Entity 名稱" - -#. (itstool) path: segmentedlist/segtitle -#: book.translate.xml:7204 -msgid "Appearance" -msgstr "外觀" - -#. (itstool) path: seglistitem/seg -#: book.translate.xml:7209 -msgid "&eacute;" -msgstr "&eacute;" - -#. (itstool) path: seglistitem/seg -#: book.translate.xml:7210 -msgid "é" -msgstr "é" - -#. (itstool) path: seglistitem/seg -#: book.translate.xml:7211 -msgid "Small e with an acute accent" -msgstr "小 e,並帶尖、重音 (Acute accent)" - -#. (itstool) path: seglistitem/seg -#: book.translate.xml:7215 -msgid "&Eacute;" -msgstr "&Eacute;" - -#. (itstool) path: seglistitem/seg -#: book.translate.xml:7216 -msgid "É" -msgstr "É" - -#. (itstool) path: seglistitem/seg -#: book.translate.xml:7217 -msgid "Large E with an acute accent" -msgstr "大 E,並帶尖、重音 (Acute accent)" - -#. (itstool) path: seglistitem/seg -#: book.translate.xml:7221 -msgid "&uuml;" -msgstr "&uuml;" - -#. (itstool) path: seglistitem/seg -#: book.translate.xml:7222 -msgid "ü" -msgstr "ü" - -#. (itstool) path: seglistitem/seg -#: book.translate.xml:7223 -msgid "Small u with an umlaut" -msgstr "小 u,並帶日耳曼語系中的母音變化 (Umlaut)" - -#. (itstool) path: answer/para -#: book.translate.xml:7227 -msgid "" -"After you have installed the iso8879 port, the files in /usr/local/" -"share/xml/iso8879 contain the complete list." -msgstr "" -"在裝了 iso8879 這個 Port 之後,就可以在 /usr/local/share/xml/" -"iso8879 找到這些的詳細列表。" - -#. (itstool) path: question/para -#: book.translate.xml:7235 -msgid "Addressing the reader" -msgstr "如何稱呼讀者呢?" - -#. (itstool) path: answer/para -#: book.translate.xml:7239 -msgid "" -"In the English documents, the reader is addressed as you, " -"there is no formal/informal distinction as there is in some languages." -msgstr "" -"在英文文件內,讀者都是以 you 來稱呼,而有些語言並沒有正式/非正" -"式的區隔。" - -#. (itstool) path: answer/para -#: book.translate.xml:7243 -msgid "" -"If you are translating to a language which does distinguish, use whichever " -"form is typically used in other technical documentation in your language. If " -"in doubt, use a mildly polite form." -msgstr "" -"若你所要翻的語言可以區別這些差異,那麼請用該語系在一般技術說明文件上所使用的" -"稱呼吧。如果容易造成困惑的話,那麼請改用較中性的稱呼來取代。" - -#. (itstool) path: question/para -#: book.translate.xml:7252 -msgid "Do I need to include any additional information in my translations?" -msgstr "翻譯成果內要不要附上一些其他訊息呢?" - -#. (itstool) path: answer/para -#: book.translate.xml:7257 -msgid "Yes." -msgstr "要。" - -#. (itstool) path: answer/para -#: book.translate.xml:7259 -msgid "" -"The header of the English version of each document will look something like " -"this:" -msgstr "每份英文版原稿的開頭,通常會有像下面的內容:" - -#. (itstool) path: answer/programlisting -#: book.translate.xml:7262 -#, no-wrap -msgid "" -"<!--\n" -" The FreeBSD Documentation Project\n" -"\n" -" $FreeBSD$\n" -"-->" -msgstr "" - -#. (itstool) path: answer/para -#: book.translate.xml:7268 -msgid "" -"The exact boilerplate may change, but it will always include a $FreeBSD$ " -"line and the phrase The FreeBSD Documentation Project. " -"Note that the $FreeBSD part is expanded automatically by Subversion, so it " -"should be empty (just $FreeBSD$) for new files." -msgstr "" -"實際上的內容可能稍有不同,但每份原稿都會附上 $FreeBSD$ 這一行以及 " -"The FreeBSD Documentation Project 宣告。請注意:$FreeBSD$ " -"開頭的這行是會由 Subversion 隨著每次異動而自動更改的,所以新檔案的話請保持原" -"狀 (也就是只要寫 $FreeBSD$ 就好了)。" - -#. (itstool) path: answer/para -#: book.translate.xml:7276 -msgid "" -"Your translated documents should include their own $FreeBSD$ line, and " -"change the FreeBSD Documentation Project line to " -"The FreeBSD language Documentation " -"Project." -msgstr "" -"翻譯文件中,必須都要有 $FreeBSD$ 這行,並且把 FreeBSD Documentation " -"Project 這行改為 The FreeBSD language Documentation Project。" - -#. (itstool) path: answer/para -#: book.translate.xml:7282 -msgid "" -"In addition, you should add a third line which indicates which revision of " -"the English text this is based on." -msgstr "" -"此外,還必須加上第三行來指出你所翻譯的,到底是以英文版原稿的哪一版本為母本所" -"做的翻譯。" - -#. (itstool) path: answer/para -#: book.translate.xml:7285 -msgid "So, the Spanish version of this file might start:" -msgstr "因此呢,西班牙文版 (Spanish) 的檔案開頭應該是長像這樣:" - -#. (itstool) path: answer/programlisting -#: book.translate.xml:7287 -#, no-wrap -msgid "" -"<!--\n" -" The FreeBSD Spanish Documentation Project\n" -"\n" -" $FreeBSD$\n" -" Original revision: r38674\n" -"-->" -msgstr "" - -#. (itstool) path: chapter/title -#: book.translate.xml:7305 -msgid "PO Translations" -msgstr "PO 翻譯" - -#. (itstool) path: sect1/para -#: book.translate.xml:7310 -msgid "" -"The GNU gettext system offers translators " -"an easy way to create and maintain translations of documents. Translatable " -"strings are extracted from the original document into a PO (Portable Object) file. Translated versions of the strings are " -"entered with a separate editor. The strings can be used directly or built " -"into a complete translated version of the original document." -msgstr "" -"GNU gettext 系統提供翻譯者一個簡單的方" -"法來建立和維護文件的翻譯。翻譯的字串從原始文件題取出來到 PO (Portable Object) 檔。字串的翻譯用另外的編輯器輸入。翻譯的字串可以直" -"接使用,或是編譯成原始文件的完整翻譯版本。" - -#. (itstool) path: sect1/para -#: book.translate.xml:7323 -msgid "" -"The procedure shown in is assumed " -"to have already been performed, but the TRANSLATOR option " -"must be enabled in the textproc/docproj " -"port. If that option was not enabled, display the options menu and enable " -"it, then reinstall the port:" -msgstr "" -"我們會假設您已做過在 中的步驟,除此" -"之外還必須打開 textproc/docproj Port 中的 " -"TRANSLATOR 選項。如果沒有打開這個選項,請打開選項後重新安" -"裝 Port。" - -#. (itstool) path: sect1/screen -#: book.translate.xml:7331 -#, no-wrap -msgid "" -"# cd /usr/ports/textproc/docproj\n" -"# make config\n" -"# make clean deinstall install clean" -msgstr "" -"# cd /usr/ports/textproc/docproj\n" -"# make config\n" -"# make clean deinstall install clean" - -#. (itstool) path: sect1/para -#: book.translate.xml:7335 -msgid "" -"This example shows the creation of a Spanish translation of the short Leap Seconds article." -msgstr "" -"這個範例示範如何建立 Leap Seconds 短文的西班牙文翻譯。" - -#. (itstool) path: procedure/title -#: book.translate.xml:7340 -msgid "Install a PO Editor" -msgstr "安裝 PO 編輯器" - -#. (itstool) path: step/para -#: book.translate.xml:7343 -msgid "" -"A PO editor is needed to edit translation files. This " -"example uses editors/poedit." -msgstr "" -"編輯翻譯檔案需要 PO 編輯器。這個範例使用 editors/poedit。" - -#. (itstool) path: step/screen -#: book.translate.xml:7347 -#, no-wrap -msgid "" -"# cd /usr/ports/editors/poedit\n" -"# make install clean" -msgstr "" -"# cd /usr/ports/editors/poedit\n" -"# make install clean" - -#. (itstool) path: procedure/title -#: book.translate.xml:7353 -msgid "Initial Setup" -msgstr "初始設定" - -#. (itstool) path: procedure/para -#: book.translate.xml:7355 -msgid "" -"When a new translation is first created, the directory structure and " -"Makefile must be created or copied from the English " -"original:" -msgstr "" -"第一次建立新的翻譯時,目錄結構和 Makefile 必須建立或是從" -"英文版複製過來。" - -#. (itstool) path: step/para -#: book.translate.xml:7360 -msgid "" -"Create a directory for the new translation. The English article source is in " -"~/doc/en_US.ISO8859-1/articles/leap-seconds/. The " -"Spanish translation will go in ~/doc/es_ES.ISO8859-1/articles/leap-" -"seconds/. The path is the same except for the name of the " -"language directory." -msgstr "" -"建立新翻譯的目錄。英文文章原始碼位於 ~/doc/en_US.ISO8859-1/" -"articles/leap-seconds/ 。西班牙文翻譯將會放在 ~/doc/" -"es_ES.ISO8859-1/articles/leap-seconds/ 。除了語系目錄的名稱外,其" -"他路徑相同。" - -#. (itstool) path: step/screen -#: book.translate.xml:7368 -#, no-wrap -msgid "% svn mkdir --parents ~/doc/es_ES.ISO8859-1/articles/leap-seconds/" -msgstr "% svn mkdir --parents ~/doc/es_ES.ISO8859-1/articles/leap-seconds/" - -#. (itstool) path: step/para -#: book.translate.xml:7372 -msgid "" -"Copy the Makefile from the original document into the " -"translation directory:" -msgstr "從原始文件處將 Makefile 複製到翻譯目錄。" - -#. (itstool) path: step/screen -#: book.translate.xml:7375 -#, no-wrap -msgid "" -"% svn cp ~/doc/en_US.ISO8859-1/articles/leap-seconds/Makefile \\\n" -" ~/doc/es_ES.ISO8859-1/articles/leap-seconds/" -msgstr "" - -#. (itstool) path: procedure/title -#: book.translate.xml:7381 -msgid "Translation" -msgstr "翻譯" - -#. (itstool) path: procedure/para -#: book.translate.xml:7383 -msgid "" -"Translating a document consists of two steps: extracting translatable " -"strings from the original document, and entering translations for those " -"strings. These steps are repeated until the translator feels that enough of " -"the document has been translated to produce a usable translated document." -msgstr "" -"翻譯文件公有兩個步驟:將可翻譯的字串從原始文件提去出來,然後翻譯這些字串。重" -"複這些步驟,直到翻譯者認為文件的翻譯部份已經足夠用來產生可讀的翻譯文件。" - -#. (itstool) path: step/para -#: book.translate.xml:7391 -msgid "" -"Extract the translatable strings from the original English version into a " -"PO file:" -msgstr "從英文的原始文件提取字串到 PO 檔:" - -#. (itstool) path: step/screen -#: book.translate.xml:7394 -#, no-wrap -msgid "" -"% cd ~/doc/es_ES.ISO8859-1/articles/leap-seconds/\n" -"% make po" -msgstr "" -"% cd ~/doc/es_ES.ISO8859-1/articles/leap-seconds/\n" -"% make po" - -#. (itstool) path: step/para -#: book.translate.xml:7399 -msgid "" -"Use a PO editor to enter translations in the PO file. There are several different editors available. " -"poedit from editors/poedit is shown here." -msgstr "" -"使用 PO 編輯器將翻譯輸入 PO 檔。有幾個" -"不同的編輯器可以使用。這裡用的是 editors/poeditpoedit 。" - -#. (itstool) path: step/para -#: book.translate.xml:7405 -msgid "" -"The PO file name is the two-character language code " -"followed by an underline and a two-character region code. For Spanish, the " -"file name is es_ES.po." -msgstr "" -"PO 檔名是兩個字元的語系碼後面接底線和兩個字元的區域碼。以" -"西班牙語來說,檔名是 es_ES.po 。" - -#. (itstool) path: step/screen -#: book.translate.xml:7410 book.translate.xml:7874 -#, no-wrap -msgid "% poedit es_ES.po" -msgstr "% poedit es_ES.po" - -#. (itstool) path: procedure/title -#: book.translate.xml:7415 -msgid "Generating a Translated Document" -msgstr "產生翻譯文件" - -#. (itstool) path: step/para -#: book.translate.xml:7418 -msgid "Generate the translated document:" -msgstr "產生翻譯文件" - -#. (itstool) path: step/screen -#: book.translate.xml:7420 -#, no-wrap -msgid "" -"% cd ~/doc/es_ES.ISO8859-1/articles/leap-seconds/\n" -"% make tran" -msgstr "" -"% cd ~/doc/es_ES.ISO8859-1/articles/leap-seconds/\n" -"% make tran" - -#. (itstool) path: step/para -#: book.translate.xml:7423 -msgid "" -"The name of the generated document matches the name of the English original, " -"usually article.xml for articles or book.xml for books." -msgstr "" -"產生的文件名稱與英文原始文件名稱相符,文章通常是 article.xml,書籍是 book.xml 。" - -#. (itstool) path: step/para -#: book.translate.xml:7430 -msgid "" -"Check the generated file by rendering it to HTML and " -"viewing it with a web browser:" -msgstr "" -"可以轉換成 HTML 來檢查產生的檔案,並用瀏覽器來察看。" - -#. (itstool) path: step/screen -#: book.translate.xml:7434 -#, no-wrap -msgid "" -"% make FORMATS=html\n" -"% firefox article.html" -msgstr "" -"% make FORMATS=html\n" -"% firefox article.html" - -#. (itstool) path: sect1/title -#: book.translate.xml:7441 -msgid "Creating New Translations" -msgstr "建立新翻譯" - -#. (itstool) path: sect1/para -#: book.translate.xml:7443 -msgid "" -"The first step to creating a new translated document is locating or creating " -"a directory to hold it. FreeBSD puts translated documents in a subdirectory " -"named for their language and region in the format " -"lang_REGION. lang is a two-character lowercase " -"code. It is followed by an underscore character and then the two-character " -"uppercase REGION code." -msgstr "" -"建立新翻譯文件的第一步是找到或建立一個目錄來放它。FreeBSD 將翻譯文件放在子目" -"錄,用語系和區域以 語系 (lang)_區域 (REGION) 來命名。" -"語系 (lang) 是小寫的兩個字元碼,接著是底線和兩個字" -"元的大寫 REGION 碼。" - -#. (itstool) path: table/title -#: book.translate.xml:7454 -msgid "Language Names" -msgstr "語系名稱" - -#. (itstool) path: row/entry -#: book.translate.xml:7459 -msgid "Language" -msgstr "語言" - -#. (itstool) path: row/entry -#: book.translate.xml:7460 -msgid "Region" -msgstr "地區" - -#. (itstool) path: row/entry -#: book.translate.xml:7461 -msgid "Translated Directory Name" -msgstr "翻譯目錄名稱" - -#. (itstool) path: row/entry -#: book.translate.xml:7462 -msgid "PO File Name" -msgstr "PO 檔名稱" - -#. (itstool) path: row/entry -#: book.translate.xml:7463 -msgid "Character Set" -msgstr "字元集" - -#. (itstool) path: row/entry -#: book.translate.xml:7469 -msgid "English" -msgstr "英文" - -#. (itstool) path: row/entry -#: book.translate.xml:7470 -msgid "United States" -msgstr "美國" - -#. (itstool) path: row/entry -#: book.translate.xml:7471 -msgid "en_US.ISO8859-1" -msgstr "en_US.ISO8859-1" - -#. (itstool) path: row/entry -#: book.translate.xml:7472 -msgid "en_US.po" -msgstr "en_US.po" - -#. (itstool) path: row/entry -#: book.translate.xml:7473 book.translate.xml:7489 book.translate.xml:7497 -#: book.translate.xml:7513 book.translate.xml:7521 book.translate.xml:7569 -#: book.translate.xml:7577 book.translate.xml:7593 -msgid "ISO 8859-1" -msgstr "ISO 8859-1" - -#. (itstool) path: row/entry -#: book.translate.xml:7477 -msgid "Bengali" -msgstr "孟加拉文" - -#. (itstool) path: row/entry -#: book.translate.xml:7478 -msgid "Bangladesh" -msgstr "孟加拉" - -#. (itstool) path: row/entry -#: book.translate.xml:7479 -msgid "bn_BD.UTF-8" -msgstr "bn_BD.UTF-8" - -#. (itstool) path: row/entry -#: book.translate.xml:7480 -msgid "bn_BD.po" -msgstr "bn_BD.po" - -#. (itstool) path: row/entry -#: book.translate.xml:7481 book.translate.xml:7553 book.translate.xml:7561 -#: book.translate.xml:7625 book.translate.xml:7633 -msgid "UTF-8" -msgstr "UTF-8" - -#. (itstool) path: row/entry -#: book.translate.xml:7485 -msgid "Danish" -msgstr "丹麥文" - -#. (itstool) path: row/entry -#: book.translate.xml:7486 -msgid "Denmark" -msgstr "丹麥" - -#. (itstool) path: row/entry -#: book.translate.xml:7487 -msgid "da_DK.ISO8859-1" -msgstr "da_DK.ISO8859-1" - -#. (itstool) path: row/entry -#: book.translate.xml:7488 -msgid "da_DK.po" -msgstr "da_DK.po" - -#. (itstool) path: row/entry -#: book.translate.xml:7493 -msgid "German" -msgstr "德文" - -#. (itstool) path: row/entry -#: book.translate.xml:7494 -msgid "Germany" -msgstr "德國" - -#. (itstool) path: row/entry -#: book.translate.xml:7495 -msgid "de_DE.ISO8859-1" -msgstr "de_DE.ISO8859-1" - -#. (itstool) path: row/entry -#: book.translate.xml:7496 -msgid "de_DE.po" -msgstr "de_DE.po" - -#. (itstool) path: row/entry -#: book.translate.xml:7501 -msgid "Greek" -msgstr "希臘文" - -#. (itstool) path: row/entry -#: book.translate.xml:7502 -msgid "Greece" -msgstr "希臘" - -#. (itstool) path: row/entry -#: book.translate.xml:7503 -msgid "el_GR.ISO8859-7" -msgstr "el_GR.ISO8859-7" - -#. (itstool) path: row/entry -#: book.translate.xml:7504 -msgid "el_GR.po" -msgstr "el_GR.po" - -#. (itstool) path: row/entry -#: book.translate.xml:7505 -msgid "ISO 8859-7" -msgstr "ISO 8859-7" - -#. (itstool) path: row/entry -#: book.translate.xml:7509 -msgid "Spanish" -msgstr "西班牙文" - -#. (itstool) path: row/entry -#: book.translate.xml:7510 -msgid "Spain" -msgstr "西班牙" - -#. (itstool) path: row/entry -#: book.translate.xml:7511 -msgid "es_ES.ISO8859-1" -msgstr "es_ES.ISO8859-1" - -#. (itstool) path: row/entry -#: book.translate.xml:7512 -msgid "es_ES.po" -msgstr "es_ES.po" - -#. (itstool) path: row/entry -#: book.translate.xml:7517 -msgid "French" -msgstr "法文" - -#. (itstool) path: row/entry -#: book.translate.xml:7518 -msgid "France" -msgstr "法國" - -#. (itstool) path: row/entry -#: book.translate.xml:7519 -msgid "fr_FR.ISO8859-1" -msgstr "fr_FR.ISO8859-1" - -#. (itstool) path: row/entry -#: book.translate.xml:7520 -msgid "fr_FR.po" -msgstr "fr_FR.po" - -#. (itstool) path: row/entry -#: book.translate.xml:7525 -msgid "Hungarian" -msgstr "匈牙利文" - -#. (itstool) path: row/entry -#: book.translate.xml:7526 -msgid "Hungary" -msgstr "匈牙利" - -#. (itstool) path: row/entry -#: book.translate.xml:7527 -msgid "hu_HU.ISO8859-2" -msgstr "hu_HU.ISO8859-2" - -#. (itstool) path: row/entry -#: book.translate.xml:7528 -msgid "hu_HU.po" -msgstr "hu_HU.po" - -#. (itstool) path: row/entry -#: book.translate.xml:7529 book.translate.xml:7585 book.translate.xml:7609 -msgid "ISO 8859-2" -msgstr "ISO 8859-2" - -#. (itstool) path: row/entry -#: book.translate.xml:7533 -msgid "Italian" -msgstr "義大利文" - -#. (itstool) path: row/entry -#: book.translate.xml:7534 -msgid "Italy" -msgstr "義大利" - -#. (itstool) path: row/entry -#: book.translate.xml:7535 -msgid "it_IT.ISO8859-15" -msgstr "it_IT.ISO8859-15" - -#. (itstool) path: row/entry -#: book.translate.xml:7536 -msgid "it_IT.po" -msgstr "it_IT.po" - -#. (itstool) path: row/entry -#: book.translate.xml:7537 -msgid "ISO 8859-15" -msgstr "ISO 8859-15" - -#. (itstool) path: row/entry -#: book.translate.xml:7541 -msgid "Japanese" -msgstr "日文" - -#. (itstool) path: row/entry -#: book.translate.xml:7542 -msgid "Japan" -msgstr "日本" - -#. (itstool) path: row/entry -#: book.translate.xml:7543 -msgid "ja_JP.eucJP" -msgstr "ja_JP.eucJP" - -#. (itstool) path: row/entry -#: book.translate.xml:7544 -msgid "ja_JP.po" -msgstr "ja_JP.po" - -#. (itstool) path: row/entry -#: book.translate.xml:7545 -msgid "EUC JP" -msgstr "EUC JP" - -#. (itstool) path: row/entry -#: book.translate.xml:7549 -msgid "Korean" -msgstr "韓文" - -#. (itstool) path: row/entry -#: book.translate.xml:7550 -msgid "Korea" -msgstr "韓國" - -#. (itstool) path: row/entry -#: book.translate.xml:7551 -msgid "ko_KR.UTF-8" -msgstr "ko_KR.UTF-8" - -#. (itstool) path: row/entry -#: book.translate.xml:7552 -msgid "ko_KR.po" -msgstr "ko_KR.po" - -#. (itstool) path: row/entry -#: book.translate.xml:7557 -msgid "Mongolian" -msgstr "蒙古文" - -#. (itstool) path: row/entry -#: book.translate.xml:7558 -msgid "Mongolia" -msgstr "蒙古" - -#. (itstool) path: row/entry -#: book.translate.xml:7559 -msgid "mn_MN.UTF-8" -msgstr "mn_MN.UTF-8" - -#. (itstool) path: row/entry -#: book.translate.xml:7560 -msgid "mn_MN.po" -msgstr "mn_MN.po" - -#. (itstool) path: row/entry -#: book.translate.xml:7565 -msgid "Dutch" -msgstr "荷蘭文" - -#. (itstool) path: row/entry -#: book.translate.xml:7566 -msgid "Netherlands" -msgstr "荷蘭" - -#. (itstool) path: row/entry -#: book.translate.xml:7567 -msgid "nl_NL.ISO8859-1" -msgstr "nl_NL.ISO8859-1" - -#. (itstool) path: row/entry -#: book.translate.xml:7568 -msgid "nl_NL.po" -msgstr "nl_NL.po" - -#. (itstool) path: row/entry -#: book.translate.xml:7573 -msgid "Norwegian" -msgstr "挪威文" - -#. (itstool) path: row/entry -#: book.translate.xml:7574 -msgid "Norway" -msgstr "挪威" - -#. (itstool) path: row/entry -#: book.translate.xml:7575 -msgid "no_NO.ISO8859-1" -msgstr "no_NO.ISO8859-1" - -#. (itstool) path: row/entry -#: book.translate.xml:7576 -msgid "no_NO.po" -msgstr "no_NO.po" - -#. (itstool) path: row/entry -#: book.translate.xml:7581 -msgid "Polish" -msgstr "波蘭文" - -#. (itstool) path: row/entry -#: book.translate.xml:7582 -msgid "Poland" -msgstr "波蘭" - -#. (itstool) path: row/entry -#: book.translate.xml:7583 -msgid "pl_PL.ISO8859-2" -msgstr "pl_PL.ISO8859-2" - -#. (itstool) path: row/entry -#: book.translate.xml:7584 -msgid "pl_PL.po" -msgstr "pl_PL.po" - -#. (itstool) path: row/entry -#: book.translate.xml:7589 -msgid "Portuguese" -msgstr "葡萄牙文" - -#. (itstool) path: row/entry -#: book.translate.xml:7590 -msgid "Brazil" -msgstr "巴西" - -#. (itstool) path: row/entry -#: book.translate.xml:7591 -msgid "pt_BR.ISO8859-1" -msgstr "pt_BR.ISO8859-1" - -#. (itstool) path: row/entry -#: book.translate.xml:7592 -msgid "pt_BR.po" -msgstr "pt_BR.po" - -#. (itstool) path: row/entry -#: book.translate.xml:7597 -msgid "Russian" -msgstr "俄文" - -#. (itstool) path: row/entry -#: book.translate.xml:7598 -msgid "Russia" -msgstr "俄羅斯" - -#. (itstool) path: row/entry -#: book.translate.xml:7599 -msgid "ru_RU.KOI8-R" -msgstr "ru_RU.KOI8-R" - -#. (itstool) path: row/entry -#: book.translate.xml:7600 -msgid "ru_RU.po" -msgstr "ru_RU.po" - -#. (itstool) path: row/entry -#: book.translate.xml:7601 -msgid "KOI8-R" -msgstr "KOI8-R" - -#. (itstool) path: row/entry -#: book.translate.xml:7605 -msgid "Serbian" -msgstr "賽爾維亞" - -#. (itstool) path: row/entry -#: book.translate.xml:7606 -msgid "Serbia" -msgstr "賽爾維亞文" - -#. (itstool) path: row/entry -#: book.translate.xml:7607 -msgid "sr_YU.ISO8859-2" -msgstr "sr_YU.ISO8859-2" - -#. (itstool) path: row/entry -#: book.translate.xml:7608 -msgid "sr_YU.po" -msgstr "sr_YU.po" - -#. (itstool) path: row/entry -#: book.translate.xml:7613 -msgid "Turkish" -msgstr "土耳其文" - -#. (itstool) path: row/entry -#: book.translate.xml:7614 -msgid "Turkey" -msgstr "土耳其" - -#. (itstool) path: row/entry -#: book.translate.xml:7615 -msgid "tr_TR.ISO8859-9" -msgstr "tr_TR.ISO8859-9" - -#. (itstool) path: row/entry -#: book.translate.xml:7616 -msgid "tr_TR.po" -msgstr "tr_TR.po" - -#. (itstool) path: row/entry -#: book.translate.xml:7617 -msgid "ISO 8859-9" -msgstr "ISO 8859-9" - -#. (itstool) path: row/entry -#: book.translate.xml:7621 book.translate.xml:7629 -msgid "Chinese" -msgstr "中文" - -#. (itstool) path: row/entry -#: book.translate.xml:7622 -msgid "China" -msgstr "中國" - -#. (itstool) path: row/entry -#: book.translate.xml:7623 -msgid "zh_CN.UTF-8" -msgstr "zh_CN.UTF-8" - -#. (itstool) path: row/entry -#: book.translate.xml:7624 -msgid "zh_CN.po" -msgstr "zh_CN.po" - -#. (itstool) path: row/entry -#: book.translate.xml:7630 -msgid "Taiwan" -msgstr "台灣" - -#. (itstool) path: row/entry -#: book.translate.xml:7631 -msgid "zh_TW.UTF-8" -msgstr "zh_TW.UTF-8" - -#. (itstool) path: row/entry -#: book.translate.xml:7632 -msgid "zh_TW.po" -msgstr "zh_TW.po" - -#. (itstool) path: sect1/para -#: book.translate.xml:7639 -msgid "" -"The translations are in subdirectories of the main documentation directory, " -"here assumed to be ~/doc/ as shown in . For example, German translations are located in " -"~/doc/de_DE.ISO8859-1/, and French translations are in " -"~/doc/fr_FR.ISO8859-1/." -msgstr "" -"翻譯位於主要說明文件目錄的子目錄,這裡假設如 所示,是 ~/doc/。例如德文位於 ~/doc/" -"de_DE.ISO8859-1/,法文位於 ~/doc/fr_FR.ISO8859-1/。" - -#. (itstool) path: sect1/para -#: book.translate.xml:7648 -msgid "" -"Each language directory contains separate subdirectories named for the type " -"of documents, usually articles/ and books/." -msgstr "" -"每個語系目錄包含不同文件類型的子目錄,通常是 articles/ " -"和 books/。" - -#. (itstool) path: sect1/para -#: book.translate.xml:7653 -msgid "" -"Combining these directory names gives the complete path to an article or " -"book. For example, the French translation of the NanoBSD article is in " -"~/doc/fr_FR.ISO8859-1/articles/nanobsd/, and the " -"Mongolian translation of the Handbook is in ~/doc/mn_MN.UTF-8/" -"books/handbook/." -msgstr "" -"將目錄名稱組合起來就是文章或書的完整路徑。例如,NanoBSD 文章的法語翻譯在 " -"~/doc/fr_FR.ISO8859-1/articles/nanobsd/ 。而使用手冊的蒙" -"古文翻譯在~/doc/mn_MN.UTF-8/books/handbook/ 。" - -#. (itstool) path: sect1/para -#: book.translate.xml:7660 -msgid "" -"A new language directory must be created when translating a document to a " -"new language. If the language directory already exists, only a subdirectory " -"in the articles/ or books/ " -"directory is needed." -msgstr "" -"當翻譯到一個新語系時必須建立一個新的語系目錄。如果語系目錄已經存在,那只需要" -"有 articles/books/ 的子目錄。" - -#. (itstool) path: sect1/para -#: book.translate.xml:7666 -msgid "" -"FreeBSD documentation builds are controlled by a Makefile in the same directory. With simple articles, the " -"Makefile can often just be copied verbatim from the " -"original English directory. The translation process combines multiple " -"separate book.xml and chapter.xml " -"files in books into a single file, so the Makefile for " -"book translations must be copied and modified." -msgstr "" -"FreeBSD 說明文件的編譯是由同一個目錄的 Makefile 控制。簡" -"單的文章可以從原始的英語目錄直接複製 Makefile 過來。書籍" -"的翻譯流程結合多個獨立的 book.xmlchapter." -"xml 成為一個檔案,所以書籍翻譯的 Makefile 必" -"須複製並修改。" - -#. (itstool) path: example/title -#: book.translate.xml:7677 -msgid "Creating a Spanish Translation of the Porter's Handbook" -msgstr "建立 Porter 手冊的西班牙語翻譯" - -#. (itstool) path: example/para -#: book.translate.xml:7680 -msgid "" -"Create a new Spanish translation of the Porter's Handbook. The " -"original is a book in ~/doc/en_US.ISO8859-1/books/porters-handbook/" -"." -msgstr "" -"建立 Porter 手冊 的西班牙文翻譯。原文是位於 ~/doc/" -"en_US.ISO8859-1/books/porters-handbook/ 的書籍。" - -#. (itstool) path: step/para -#: book.translate.xml:7687 -msgid "" -"The Spanish language books directory ~/doc/es_ES.ISO8859-1/books/ already exists, so only a new subdirectory for the Porter's " -"Handbook is needed:" -msgstr "" -"西班牙文 books 目錄 ~/doc/es_ES.ISO8859-1/books/ 已經存" -"在,所以只要建立 Porter 手冊的子目錄:" - -#. (itstool) path: step/screen -#: book.translate.xml:7691 -#, no-wrap -msgid "" -"% cd ~/doc/es_ES.ISO8859-1/books/\n" -"% svn mkdir porters-handbook\n" -"A porters-handbook" -msgstr "" - -#. (itstool) path: step/para -#: book.translate.xml:7697 -msgid "Copy the Makefile from the original book:" -msgstr "從原始文件的目錄複製 Makefile:" - -#. (itstool) path: step/screen -#: book.translate.xml:7700 -#, no-wrap -msgid "" -"% cd ~/doc/es_ES.ISO8859-1/books/porters-handbook\n" -"% svn cp ~/doc/en_US.ISO8859-1/books/porters-handbook/Makefile .\n" -"A Makefile" -msgstr "" - -#. (itstool) path: step/para -#: book.translate.xml:7704 -msgid "" -"Modify the contents of the Makefile to only expect a " -"single book.xml:" -msgstr "" -"修改 Makefile 內容以產生單一的 book.xml:" - -#. (itstool) path: step/programlisting -#: book.translate.xml:7708 -#, no-wrap -msgid "" -"#\n" -"# $FreeBSD$\n" -"#\n" -"# Build the FreeBSD Porter's Handbook.\n" -"#\n" -"\n" -"MAINTAINER=doc@FreeBSD.org\n" -"\n" -"DOC?= book\n" -"\n" -"FORMATS?= html-split\n" -"\n" -"INSTALL_COMPRESSED?= gz\n" -"INSTALL_ONLY_COMPRESSED?=\n" -"\n" -"# XML content\n" -"SRCS= book.xml\n" -"\n" -"# Images from the cross-document image library\n" -"IMAGES_LIB+= callouts/1.png\n" -"IMAGES_LIB+= callouts/2.png\n" -"IMAGES_LIB+= callouts/3.png\n" -"IMAGES_LIB+= callouts/4.png\n" -"IMAGES_LIB+= callouts/5.png\n" -"IMAGES_LIB+= callouts/6.png\n" -"IMAGES_LIB+= callouts/7.png\n" -"IMAGES_LIB+= callouts/8.png\n" -"IMAGES_LIB+= callouts/9.png\n" -"IMAGES_LIB+= callouts/10.png\n" -"IMAGES_LIB+= callouts/11.png\n" -"IMAGES_LIB+= callouts/12.png\n" -"IMAGES_LIB+= callouts/13.png\n" -"IMAGES_LIB+= callouts/14.png\n" -"IMAGES_LIB+= callouts/15.png\n" -"IMAGES_LIB+= callouts/16.png\n" -"IMAGES_LIB+= callouts/17.png\n" -"IMAGES_LIB+= callouts/18.png\n" -"IMAGES_LIB+= callouts/19.png\n" -"IMAGES_LIB+= callouts/20.png\n" -"IMAGES_LIB+= callouts/21.png\n" -"\n" -"URL_RELPREFIX?= ../../../..\n" -"DOC_PREFIX?= ${.CURDIR}/../../..\n" -"\n" -".include \"${DOC_PREFIX}/share/mk/doc.project.mk\"" -msgstr "" - -#. (itstool) path: step/para -#: book.translate.xml:7754 -msgid "" -"Now the document structure is ready for the translator to begin translating " -"with make po." -msgstr "" -"現在文件結構已經準備好讓翻譯者執行 make po 開始翻譯。" - -#. (itstool) path: example/title -#: book.translate.xml:7762 -msgid "" -"Creating a French Translation of the PGP Keys Article" -msgstr "建立 PGP 金鑰文章的法語翻譯。" - -#. (itstool) path: example/para -#: book.translate.xml:7765 -msgid "" -"Create a new French translation of the PGP Keys article. The original is an article in ~/doc/en_US.ISO8859-1/" -"articles/pgpkeys/." -msgstr "" -"建立 PGP 金鑰文章 的法文翻譯。原文是位於 " -"~/doc/en_US.ISO8859-1/articles/pgpkeys/ 的文章。" - -#. (itstool) path: step/para -#: book.translate.xml:7772 -msgid "" -"The French language article directory ~/doc/fr_FR.ISO8859-1/" -"articles/ already exists, so only a new subdirectory for the " -"PGP Keys article is needed:" -msgstr "" -"法文文章目錄 ~/doc/fr_FR.ISO8859-1/articles/ 已經存在," -"所以只要建立 PGP 金鑰文章的子目錄:" - -#. (itstool) path: step/screen -#: book.translate.xml:7776 -#, no-wrap -msgid "" -"% cd ~/doc/fr_FR.ISO8859-1/articles/\n" -"% svn mkdir pgpkeys\n" -"A pgpkeys" -msgstr "" - -#. (itstool) path: step/para -#: book.translate.xml:7782 -msgid "Copy the Makefile from the original article:" -msgstr "從原始文件的目錄複製 Makefile:" - -#. (itstool) path: step/screen -#: book.translate.xml:7785 -#, no-wrap -msgid "" -"% cd ~/doc/fr_FR.ISO8859-1/articles/pgpkeys\n" -"% svn cp ~/doc/en_US.ISO8859-1/articles/pgpkeys/Makefile .\n" -"A Makefile" -msgstr "" - -#. (itstool) path: step/para -#: book.translate.xml:7789 -msgid "" -"Check the contents of the Makefile. Because this is a " -"simple article, in this case the Makefile can be used " -"unchanged. The $FreeBSD...$ version string on the second " -"line will be replaced by the version control system when this file is " -"committed." -msgstr "" -"檢查 Makefile 的內容。因為這是簡單的文章,此例的 " -"Makefile 不用修改。第二行的 $FreeBSD...$ 版本字串將會在檔案提交時被版本控制系統替換掉。" - -#. (itstool) path: step/programlisting -#: book.translate.xml:7796 -#, no-wrap -msgid "" -"#\n" -"# $FreeBSD$\n" -"#\n" -"# Article: PGP Keys\n" -"\n" -"DOC?= article\n" -"\n" -"FORMATS?= html\n" -"WITH_ARTICLE_TOC?= YES\n" -"\n" -"INSTALL_COMPRESSED?= gz\n" -"INSTALL_ONLY_COMPRESSED?=\n" -"\n" -"SRCS= article.xml\n" -"\n" -"# To build with just key fingerprints, set FINGERPRINTS_ONLY.\n" -"\n" -"URL_RELPREFIX?= ../../../..\n" -"DOC_PREFIX?= ${.CURDIR}/../../..\n" -"\n" -".include \"${DOC_PREFIX}/share/mk/doc.project.mk\"" -msgstr "" - -#. (itstool) path: step/para -#: book.translate.xml:7818 -msgid "" -"With the document structure complete, the PO file can be " -"created with make po." -msgstr "" -"文章結構處理好後,可以執行建立 make po 建立 PO 檔。" - -#. (itstool) path: sect1/title -#: book.translate.xml:7827 -msgid "Translating" -msgstr "翻譯" - -#. (itstool) path: sect1/para -#: book.translate.xml:7829 -msgid "" -"The gettext system greatly reduces the number of " -"things that must be tracked by a translator. Strings to be translated are " -"extracted from the original document into a PO file. Then " -"a PO editor is used to enter the translated versions of " -"each string." -msgstr "" -"gettext 系統大幅減少翻譯者要追蹤的事情。字串從原始" -"文件提取到 PO 檔。再用 PO 檔編輯器輸入" -"字串的翻譯。" - -#. (itstool) path: sect1/para -#: book.translate.xml:7836 -msgid "" -"The FreeBSD PO translation system does not overwrite " -"PO files, so the extraction step can be run at any time " -"to update the PO file." -msgstr "" -"FreeBSD PO 翻譯系統不會覆蓋掉 PO 檔。所" -"以提取步驟可以在任何時候重複執行來更新 PO 檔。" - -#. (itstool) path: sect1/para -#: book.translate.xml:7841 -msgid "" -"A PO editor is used to edit the file. editors/poedit is shown in these examples because it is simple " -"and has minimal requirements. Other PO editors offer " -"features to make the job of translating easier. The Ports Collection offers " -"several of these editors, including devel/" -"gtranslator." -msgstr "" -"用 PO 檔編輯器來編輯檔案。此例是用 editors/poedit,因為它很簡單而且系統需求低。其他的 PO 檔編輯器提供一些特點,能使翻譯工作更輕鬆。Port 套件集裡有數個編輯" -"器,包括 devel/gtranslator 。" - -#. (itstool) path: sect1/para -#: book.translate.xml:7849 -msgid "" -"It is important to preserve the PO file. It contains all " -"of the work that translators have done." -msgstr "保留 PO 檔是很重要的。它包含所有的翻譯成果。" - -#. (itstool) path: example/title -#: book.translate.xml:7853 -msgid "Translating the Porter's Handbook to Spanish" -msgstr "翻譯 Porter 手冊到西班牙文" - -#. (itstool) path: example/para -#: book.translate.xml:7855 -msgid "Enter Spanish translations of the contents of the Porter's Handbook." -msgstr "輸入 Porter 手冊的西班牙文內容" - -#. (itstool) path: step/para -#: book.translate.xml:7860 -msgid "" -"Change to the Spanish Porter's Handbook directory and update the " -"PO file. The generated PO file is " -"called es_ES.po as shown in ." -msgstr "" -"切換到西班牙文 Porter 手冊的目錄並更新 PO 檔。產生的 " -"PO 檔如 所示,名叫 es_ES.po 。" - -#. (itstool) path: step/screen -#: book.translate.xml:7866 -#, no-wrap -msgid "" -"% cd ~/doc/es_ES.ISO8859-1/books/porters-handbook\n" -"% make po" -msgstr "" -"% cd ~/doc/es_ES.ISO8859-1/books/porters-handbook\n" -"% make po" - -#. (itstool) path: step/para -#: book.translate.xml:7871 -msgid "Enter translations using a PO editor:" -msgstr "使用 PO 檔編輯器輸入翻譯:" - -#. (itstool) path: sect1/title -#: book.translate.xml:7881 -msgid "Tips for Translators" -msgstr "給翻譯者的提示" - -#. (itstool) path: sect2/title -#. (itstool) path: example/title -#: book.translate.xml:7884 book.translate.xml:7890 -msgid "Preserving XML Tags" -msgstr "保留 XML 標籤" - -#. (itstool) path: sect2/para -#: book.translate.xml:7886 -msgid "" -"Preserve XML tags that are shown in the English original." -msgstr "保留在英文原文的 XML 標籤。" - -#. (itstool) path: example/para -#: book.translate.xml:7892 -msgid "English original:" -msgstr "英文原文:" - -#. (itstool) path: example/programlisting -#: book.translate.xml:7894 -#, no-wrap -msgid "If acronymNTPacronym is not being used" -msgstr "If acronymNTPacronym is not being used" - -#. (itstool) path: example/para -#: book.translate.xml:7896 -msgid "Spanish translation:" -msgstr "西班牙文翻譯:" - -#. (itstool) path: example/programlisting -#: book.translate.xml:7898 -#, no-wrap -msgid "Si acronymNTPacronym no se utiliza" -msgstr "Si acronymNTPacronym no se utiliza" - -#. (itstool) path: sect2/title -#: book.translate.xml:7903 -msgid "Preserving Spaces" -msgstr "保留空白" - -#. (itstool) path: sect2/para -#: book.translate.xml:7905 -msgid "" -"Preserve existing spaces at the beginning and end of strings to be " -"translated. The translated version must have these spaces also." -msgstr "保留要翻譯字串前後的空白,翻譯過的版本也需要有這些空白。" - -#. (itstool) path: sect2/title -#: book.translate.xml:7911 -msgid "Verbatim Tags" -msgstr "不要翻譯的標籤" - -#. (itstool) path: sect2/para -#: book.translate.xml:7913 -msgid "The contents of some tags should be copied verbatim, not translated:" -msgstr "有些標籤的內容要一字不差地保留,不要翻譯。" - -#. (itstool) path: listitem/para -#: book.translate.xml:7918 -msgid "citerefentry" -msgstr "citerefentry" - -#. (itstool) path: listitem/para -#: book.translate.xml:7922 -msgid "command" -msgstr "command" - -#. (itstool) path: listitem/para -#: book.translate.xml:7926 -msgid "filename" -msgstr "filename" - -#. (itstool) path: listitem/para -#: book.translate.xml:7930 -msgid "literal" -msgstr "literal" - -#. (itstool) path: listitem/para -#: book.translate.xml:7934 -msgid "manvolnum" -msgstr "manvolnum" - -#. (itstool) path: listitem/para -#: book.translate.xml:7938 -msgid "orgname" -msgstr "orgname" - -#. (itstool) path: listitem/para -#: book.translate.xml:7942 -msgid "package" -msgstr "package" - -#. (itstool) path: listitem/para -#: book.translate.xml:7946 -msgid "programlisting" -msgstr "programlisting" - -#. (itstool) path: listitem/para -#: book.translate.xml:7950 -msgid "prompt" -msgstr "prompt" - -#. (itstool) path: listitem/para -#: book.translate.xml:7954 -msgid "refentrytitle" -msgstr "refentrytitle" - -#. (itstool) path: listitem/para -#: book.translate.xml:7958 -msgid "screen" -msgstr "screen" - -#. (itstool) path: listitem/para -#: book.translate.xml:7962 -msgid "userinput" -msgstr "userinput" - -#. (itstool) path: listitem/para -#: book.translate.xml:7966 -msgid "varname" -msgstr "varname" - -#. (itstool) path: sect2/title -#: book.translate.xml:7972 -msgid "$FreeBSD$ Strings" -msgstr "$FreeBSD$ 字串" - -#. (itstool) path: sect2/para -#: book.translate.xml:7975 -msgid "" -"The $FreeBSD$ version strings used in files require special handling. In " -"examples like , these " -"strings are not meant to be expanded. The English documents use " -"&dollar; entities to avoid including actual literal " -"dollar signs in the file:" -msgstr "" -"在檔案中使用到的 $FreeBSD$ 版本字串都需要特別處理,例如在 ,使用這些字串的用意並非要展開成版本。英文的" -"說明文件會使用 &dollar; Entity 來避免在檔案中用到錢字" -"符號:" - -#. (itstool) path: sect2/programlisting -#: book.translate.xml:7982 book.translate.xml:8000 -#, no-wrap -msgid "&dollar;FreeBSD&dollar;" -msgstr "&dollar;FreeBSD&dollar;" - -#. (itstool) path: sect2/para -#: book.translate.xml:7984 -msgid "" -"The &dollar; entities are not seen as dollar signs by " -"the version control system and so the string is not expanded into a version " -"string." -msgstr "" -"版本控制符號不會把 &dollar; entities 看成金錢符號,所" -"以不會把字串展開成版本字串。" - -#. (itstool) path: sect2/para -#: book.translate.xml:7988 -msgid "" -"When a PO file is created, the &dollar; entities used in examples are replaced with actual dollar signs. " -"The resulting literal $FreeBSD$ string will be wrongly " -"expanded by the version control system when the file is committed." -msgstr "" -"當 PO 檔建立之後,在範例中使用到的 &dollar; Entity 會被取代成實際的錢字符號,這會使的 $FreeBSD$ 字串在提交時錯誤的被版本控制系統展開成版本字串。" - -#. (itstool) path: sect2/para -#: book.translate.xml:7995 -msgid "" -"The same technique as used in the English documents can be used in the " -"translation. The &dollar; is used to replace the " -"dollar sign in the translation entered into the PO editor:" -msgstr "" -"在英文文件上使用的方法也可以用在翻譯上,翻譯時在 PO 編輯器" -"用 &dollar; 來取代金錢符號:" - -#. (itstool) path: sect1/title -#: book.translate.xml:8043 -msgid "Building a Translated Document" -msgstr "編譯翻譯的文件" - -#. (itstool) path: sect1/para -#: book.translate.xml:8045 -msgid "" -"A translated version of the original document can be created at any time. " -"Any untranslated portions of the original will be included in English in the " -"resulting document. Most PO editors have an indicator " -"that shows how much of the translation has been completed. This makes it " -"easy for the translator to see when enough strings have been translated to " -"make building the final document worthwhile." -msgstr "" -"原文的翻譯版本可以在任何時候被建立。未翻譯的部份會以英文呈獻。大部份 " -"PO 編輯器有指標可以顯示翻譯完成度。這讓翻譯者更容易看翻譯" -"好的字串是否足夠來編譯最終的文件。" - -#. (itstool) path: example/title -#: book.translate.xml:8055 -msgid "Building the Spanish Porter's Handbook" -msgstr "編譯西班牙文 Porter 手冊" - -#. (itstool) path: example/para -#: book.translate.xml:8057 -msgid "" -"Build and preview the Spanish version of the Porter's Handbook that was " -"created in an earlier example." -msgstr "編譯和預覽之前範例翻譯的西班牙文版 Porter 手冊" - -#. (itstool) path: step/para -#: book.translate.xml:8062 -msgid "" -"Build the translated document. Because the original is a book, the generated " -"document is book.xml." -msgstr "" -"編譯翻譯好的文件。因為原文是書籍,所以產生的文件是 book.xml。" - -#. (itstool) path: step/screen -#: book.translate.xml:8066 -#, no-wrap -msgid "" -"% cd ~/doc/es_ES.ISO8859-1/books/porters-handbook\n" -"% make tran" -msgstr "" -"% cd ~/doc/es_ES.ISO8859-1/books/porters-handbook\n" -"% make tran" - -#. (itstool) path: step/para -#: book.translate.xml:8071 -msgid "" -"Render the translated book.xml to HTML and view it with Firefox. This is the " -"same procedure used with the English version of the documents, and other " -"FORMATS can be used here in the same way. See ." -msgstr "" -"轉換翻譯好的 book.xmlHTML 並用 " -"Firefox 來瀏覽。這和英文版是相同的步驟,其他 " -"FORMATS 也可以這樣做。請見 。" - -#. (itstool) path: step/screen -#: book.translate.xml:8078 -#, no-wrap -msgid "" -"% make FORMATS=html\n" -"% firefox book.html" -msgstr "" -"% make FORMATS=html\n" -"% firefox book.html" - -#. (itstool) path: sect1/title -#: book.translate.xml:8086 -msgid "Submitting the New Translation" -msgstr "提交新翻譯" - -#. (itstool) path: sect1/para -#: book.translate.xml:8088 -msgid "" -"Prepare the new translation files for submission. This includes adding the " -"files to the version control system, setting additional properties on them, " -"then creating a diff for submission." -msgstr "" -"準備要提交的新翻譯。這包含新增檔案到版本控制系統,對檔案設定額外的屬性,並建" -"立 diff 來提交。" - -#. (itstool) path: sect1/para -#: book.translate.xml:8093 -msgid "" -"The diff files created by these examples can be attached to a documentation bug report or code review." -msgstr "" -"範例中產生的 diff 檔可以被附加到 文件問題回報 (Documentation " -"bug report) 或 程式" -"碼審查 (Code review) 。" - -#. (itstool) path: example/title -#: book.translate.xml:8099 -msgid "Spanish Translation of the NanoBSD Article" -msgstr "NanoBSD 文章的西班牙文翻譯" - -#. (itstool) path: step/para -#: book.translate.xml:8103 book.translate.xml:8170 -msgid "" -"Add a FreeBSD version string comment as the first line of the PO file:" -msgstr "增加 FreeBSD 版本字串註解到 PO 檔的第一行:" - -#. (itstool) path: step/programlisting -#: book.translate.xml:8106 book.translate.xml:8173 -#, no-wrap -msgid "#$FreeBSD$" -msgstr "" - -#. (itstool) path: step/para -#: book.translate.xml:8110 book.translate.xml:8177 -msgid "" -"Add the Makefile, the PO file, and " -"the generated XML translation to version control:" -msgstr "" -"增加 MakefilePO 檔和產生的 " -"XML 翻譯到版本控制系統:" - -#. (itstool) path: step/screen -#: book.translate.xml:8115 -#, no-wrap -msgid "" -"% cd ~/doc/es_ES.ISO8859-1/articles/nanobsd/\n" -"% ls\n" -"Makefile\tarticle.xml\tes_ES.po\n" -"% svn add Makefile article.xml es_ES.po\n" -"A Makefile\n" -"A article.xml\n" -"A es_ES.po" -msgstr "" - -#. (itstool) path: step/para -#: book.translate.xml:8125 book.translate.xml:8192 -msgid "" -"Set the Subversion svn:keywords properties on these files to FreeBSD=%H so " -"$FreeBSD$ strings are expanded into the path, revision, " -"date, and author when committed:" -msgstr "" -"在這些檔案設定 Subversion svn:keywords 屬性為 FreeBSD=%H$FreeBSD$ 字串可以在提交時被展開成為路徑、修訂、日期以及作者:" - -#. (itstool) path: step/screen -#: book.translate.xml:8133 -#, no-wrap -msgid "" -"% svn propset svn:keywords FreeBSD=%H Makefile article.xml es_ES.po\n" -"property 'svn:keywords' set on 'Makefile'\n" -"property 'svn:keywords' set on 'article.xml'\n" -"property 'svn:keywords' set on 'es_ES.po'" -msgstr "" -"% svn propset svn:keywords FreeBSD=%H Makefile article.xml es_ES.po\n" -"property 'svn:keywords' set on 'Makefile'\n" -"property 'svn:keywords' set on 'article.xml'\n" -"property 'svn:keywords' set on 'es_ES.po'" - -#. (itstool) path: step/para -#: book.translate.xml:8140 -msgid "" -"Set the MIME types of the files. These are text/" -"xml for books and articles, and text/x-gettext-" -"translation for the PO file." -msgstr "" -"設定檔案的 MIME 類型。書籍和文章是 text/xmlPO 檔是 text/x-gettext-translation 。" - -#. (itstool) path: step/screen -#: book.translate.xml:8146 -#, no-wrap -msgid "" -"% svn propset svn:mime-type text/x-gettext-translation es_ES.po\n" -"property 'svn:mime-type' set on 'es_ES.po'\n" -"% svn propset svn:mime-type text/xml article.xml\n" -"property 'svn:mime-type' set on 'article.xml'" -msgstr "" -"% svn propset svn:mime-type text/x-gettext-translation es_ES.po\n" -"property 'svn:mime-type' set on 'es_ES.po'\n" -"% svn propset svn:mime-type text/xml article.xml\n" -"property 'svn:mime-type' set on 'article.xml'" - -#. (itstool) path: step/para -#: book.translate.xml:8153 -msgid "" -"Create a diff of the new files from the ~/doc/ base " -"directory so the full path is shown with the filenames. This helps " -"committers identify the target language directory." -msgstr "" -"從 ~/doc/ 建立這些新檔案的 diff,讓檔名顯示完整的路徑。" -"這可以幫助提交者辨識目標語系目錄。" - -#. (itstool) path: step/screen -#: book.translate.xml:8158 -#, no-wrap -msgid "" -"% cd ~/doc\n" -"svn diff es_ES.ISO8859-1/articles/nanobsd/ > /tmp/es_nanobsd.diff" -msgstr "" -"% cd ~/doc\n" -"svn diff es_ES.ISO8859-1/articles/nanobsd/ > /tmp/es_nanobsd.diff" - -#. (itstool) path: example/title -#: book.translate.xml:8165 -msgid "" -"Korean UTF-8 Translation of the Explaining-BSD Article" -msgstr "Explaining-BSD 文章的韓文 UTF-8 翻譯" - -#. (itstool) path: step/screen -#: book.translate.xml:8182 -#, no-wrap -msgid "" -"% cd ~/doc/ko_KR.UTF-8/articles/explaining-bsd/\n" -"% ls\n" -"Makefile\tarticle.xml\tko_KR.po\n" -"% svn add Makefile article.xml ko_KR.po\n" -"A Makefile\n" -"A article.xml\n" -"A ko_KR.po" -msgstr "" - -#. (itstool) path: step/screen -#: book.translate.xml:8199 -#, no-wrap -msgid "" -"% svn propset svn:keywords FreeBSD=%H Makefile article.xml ko_KR.po\n" -"property 'svn:keywords' set on 'Makefile'\n" -"property 'svn:keywords' set on 'article.xml'\n" -"property 'svn:keywords' set on 'ko_KR.po'" -msgstr "" -"% svn propset svn:keywords FreeBSD=%H Makefile article.xml ko_KR.po\n" -"property 'svn:keywords' set on 'Makefile'\n" -"property 'svn:keywords' set on 'article.xml'\n" -"property 'svn:keywords' set on 'ko_KR.po'" - -#. (itstool) path: step/para -#: book.translate.xml:8206 -msgid "" -"Set the MIME types of the files. Because these files use " -"the UTF-8 character set, that is also specified. To " -"prevent the version control system from mistaking these files for binary " -"data, the fbsd:notbinary property is also set:" -msgstr "" -"設定檔案的 MIME 類型。因為這些檔案使用 UTF-8 字元集,這也需要指定。為了防止版本控制系統將這些檔案誤認為二進位資" -"料,fbsd:notbinary 屬性也需要設定。" - -#. (itstool) path: step/screen -#: book.translate.xml:8213 -#, no-wrap -msgid "" -"% svn propset svn:mime-type 'text/x-gettext-translation; charset=UTF-8' ko_KR.po\n" -"property 'svn:mime-type' set on 'ko_KR.po'\n" -"% svn propset fbsd:notbinary yes ko_KR.po\n" -"property 'fbsd:notbinary' set on 'ko_KR.po'\n" -"% svn propset svn:mime-type 'text/xml; charset=UTF-8' article.xml\n" -"property 'svn:mime-type' set on 'article.xml'\n" -"% svn propset fbsd:notbinary yes article.xml\n" -"property 'fbsd:notbinary' set on 'article.xml'" -msgstr "" -"% svn propset svn:mime-type 'text/x-gettext-translation;charset=UTF-8' ko_KR.po\n" -"property 'svn:mime-type' set on 'ko_KR.po'\n" -"% svn propset fbsd:notbinary yes ko_KR.po\n" -"property 'fbsd:notbinary' set on 'ko_KR.po'\n" -"% svn propset svn:mime-type 'text/xml;charset=UTF-8' article.xml\n" -"property 'svn:mime-type' set on 'article.xml'\n" -"% svn propset fbsd:notbinary yes article.xml\n" -"property 'fbsd:notbinary' set on 'article.xml'" - -#. (itstool) path: step/para -#: book.translate.xml:8224 -msgid "" -"Create a diff of these new files from the ~/doc/ base " -"directory:" -msgstr "從 ~/doc/ 建立這些新檔案的 diff。" - -#. (itstool) path: step/screen -#: book.translate.xml:8227 -#, no-wrap -msgid "" -"% cd ~/doc\n" -"svn diff ko_KR.UTF-8/articles/explaining-bsd > /tmp/ko-explaining.diff" -msgstr "" -"% cd ~/doc\n" -"svn diff ko_KR.UTF-8/articles/explaining-bsd > /tmp/ko-explaining.diff" - -#. (itstool) path: chapter/title -#: book.translate.xml:8268 -msgid "Writing Style" -msgstr "寫作風格" - -#. (itstool) path: sect1/title -#: book.translate.xml:8271 -msgid "Tips" -msgstr "叮嚀" - -#. (itstool) path: sect1/para -#: book.translate.xml:8273 -msgid "" -"Technical documentation can be improved by consistent use of several " -"principles. Most of these can be classified into three goals: be " -"clear, be complete, and be " -"concise. These goals can conflict with each other. Good writing " -"consists of a balance between them." -msgstr "" - -#. (itstool) path: sect2/title -#: book.translate.xml:8282 -msgid "Be Clear" -msgstr "要明瞭" - -#. (itstool) path: sect2/para -#: book.translate.xml:8284 -msgid "" -"Clarity is extremely important. The reader may be a novice, or reading the " -"document in a second language. Strive for simple, uncomplicated text that " -"clearly explains the concepts." -msgstr "" - -#. (itstool) path: sect2/para -#: book.translate.xml:8289 -msgid "" -"Avoid flowery or embellished speech, jokes, or colloquial expressions. Write " -"as simply and clearly as possible. Simple text is easier to understand and " -"translate." -msgstr "" - -#. (itstool) path: sect2/para -#: book.translate.xml:8293 -msgid "" -"Keep explanations as short, simple, and clear as possible. Avoid empty " -"phrases like in order to, which usually just means to. Avoid potentially patronizing words like basically. " -"Avoid Latin terms like i.e. or cf., which may " -"be unknown outside of academic or scientific groups." -msgstr "" - -#. (itstool) path: sect2/para -#: book.translate.xml:8301 -msgid "" -"Write in a formal style. Avoid addressing the reader as you. " -"For example, say copy the file to /tmp " -"rather than you can copy the file to /tmp." -msgstr "" - -#. (itstool) path: sect2/para -#: book.translate.xml:8307 -msgid "" -"Give clear, correct, tested examples. A trivial example " -"is better than no example. A good example is better yet. Do not give bad " -"examples, identifiable by apologies or sentences like but really it " -"should never be done that way. Bad examples are worse than no " -"examples. Give good examples, because even when warned not to use " -"the example as shown, the reader will usually just use the " -"example as shown." -msgstr "" - -#. (itstool) path: sect2/para -#: book.translate.xml:8316 -msgid "" -"Avoid weasel words like should, " -"might, try, or could. These " -"words imply that the speaker is unsure of the facts, and create doubt in the " -"reader." -msgstr "" - -#. (itstool) path: sect2/para -#: book.translate.xml:8322 -msgid "" -"Similarly, give instructions as imperative commands: not you should " -"do this, but merely do this." -msgstr "" - -#. (itstool) path: sect2/title -#: book.translate.xml:8328 -msgid "Be Complete" -msgstr "要完整" - -#. (itstool) path: sect2/para -#: book.translate.xml:8330 -msgid "" -"Do not make assumptions about the reader's abilities or skill level. Tell " -"them what they need to know. Give links to other documents to provide " -"background information without having to recreate it. Put yourself in the " -"reader's place, anticipate the questions they will ask, and answer them." -msgstr "" - -#. (itstool) path: sect2/title -#: book.translate.xml:8339 -msgid "Be Concise" -msgstr "要簡潔" - -#. (itstool) path: sect2/para -#: book.translate.xml:8341 -msgid "" -"While features should be documented completely, sometimes there is so much " -"information that the reader cannot easily find the specific detail needed. " -"The balance between being complete and being concise is a challenge. One " -"approach is to have an introduction, then a quick start " -"section that describes the most common situation, followed by an in-depth " -"reference section." -msgstr "" - -#. (itstool) path: sect1/title -#: book.translate.xml:8352 -msgid "Guidelines" -msgstr "準則" - -#. (itstool) path: sect1/para -#: book.translate.xml:8354 -msgid "" -"To promote consistency between the myriad authors of the FreeBSD " -"documentation, some guidelines have been drawn up for authors to follow." -msgstr "" - -#. (itstool) path: varlistentry/term -#: book.translate.xml:8360 -msgid "Use American English Spelling" -msgstr "使用美式英語拼寫" - -#. (itstool) path: listitem/para -#: book.translate.xml:8363 -msgid "" -"There are several variants of English, with different spellings for the same " -"word. Where spellings differ, use the American English variant. " -"color, not colour, rationalize, " -"not rationalise, and so on." -msgstr "" - -#. (itstool) path: note/para -#: book.translate.xml:8370 -msgid "" -"The use of British English may be accepted in the case of a contributed " -"article, however the spelling must be consistent within the whole document. " -"The other documents such as books, web site, manual pages, etc. will have to " -"use American English." -msgstr "" - -#. (itstool) path: varlistentry/term -#: book.translate.xml:8380 -msgid "Do not use contractions" -msgstr "不要使用縮寫式" - -#. (itstool) path: listitem/para -#: book.translate.xml:8383 -msgid "" -"Do not use contractions. Always spell the phrase out in full. Don't " -"use contractions is wrong." -msgstr "" - -#. (itstool) path: listitem/para -#: book.translate.xml:8387 -msgid "" -"Avoiding contractions makes for a more formal tone, is more precise, and is " -"slightly easier for translators." -msgstr "" - -#. (itstool) path: varlistentry/term -#: book.translate.xml:8394 -msgid "Use the serial comma" -msgstr "使用逗號串行" - -#. (itstool) path: listitem/para -#: book.translate.xml:8397 -msgid "" -"In a list of items within a paragraph, separate each item from the others " -"with a comma. Separate the last item from the others with a comma and the " -"word and." -msgstr "" - -#. (itstool) path: listitem/para -#: book.translate.xml:8402 -msgid "For example:" -msgstr "" - -#. (itstool) path: blockquote/para -#: book.translate.xml:8405 -msgid "This is a list of one, two and three items." -msgstr "" - -#. (itstool) path: listitem/para -#: book.translate.xml:8408 -msgid "" -"Is this a list of three items, one, two, and " -"three, or a list of two items, one and " -"two and three?" -msgstr "" - -#. (itstool) path: listitem/para -#: book.translate.xml:8413 -msgid "It is better to be explicit and include a serial comma:" -msgstr "" - -#. (itstool) path: blockquote/para -#: book.translate.xml:8417 -msgid "This is a list of one, two, and three items." -msgstr "" - -#. (itstool) path: varlistentry/term -#: book.translate.xml:8423 -msgid "Avoid redundant phrases" -msgstr "避免多餘的語句" - -#. (itstool) path: listitem/para -#: book.translate.xml:8426 -msgid "" -"Do not use redundant phrases. In particular, the command, " -"the file, and man command are often redundant." -msgstr "" - -#. (itstool) path: listitem/para -#: book.translate.xml:8430 -msgid "For example, commands:" -msgstr "" - -#. (itstool) path: informalexample/para -#: book.translate.xml:8433 -msgid "Wrong: Use the svn command to update sources." -msgstr "" - -#. (itstool) path: informalexample/para -#: book.translate.xml:8438 -msgid "Right: Use svn to update sources." -msgstr "" - -#. (itstool) path: listitem/para -#: book.translate.xml:8442 -msgid "Filenames:" -msgstr "" - -#. (itstool) path: informalexample/para -#: book.translate.xml:8445 -msgid "Wrong: … in the filename /etc/rc.local…" -msgstr "" - -#. (itstool) path: informalexample/para -#: book.translate.xml:8450 -msgid "Right: … in /etc/rc.local…" -msgstr "" - -#. (itstool) path: listitem/para -#: book.translate.xml:8454 -msgid "" -"Manual page references (the second example uses citerefentry with " -"the &man.csh.1; entity):." -msgstr "" - -#. (itstool) path: informalexample/para -#: book.translate.xml:8459 -msgid "Wrong: See man csh for more information." -msgstr "" - -#. (itstool) path: informalexample/para -#: book.translate.xml:8464 -msgid "" -"Right: See csh1." -msgstr "" - -#. (itstool) path: varlistentry/term -#: book.translate.xml:8470 -msgid "Two spaces between sentences" -msgstr "在句子之間空兩個空白" - -#. (itstool) path: listitem/para -#: book.translate.xml:8473 -msgid "" -"Always use two spaces between sentences, as it improves readability and " -"eases use of tools such as Emacs." -msgstr "" - -#. (itstool) path: listitem/para -#: book.translate.xml:8477 -msgid "" -"A period and spaces followed by a capital letter does not always mark a new " -"sentence, especially in names. Jordan K. Hubbard is a good " -"example. It has a capital H following a period and a " -"space, and is certainly not a new sentence." -msgstr "" - -#. (itstool) path: sect1/para -#: book.translate.xml:8486 -msgid "" -"For more information about writing style, see Elements of Style, by William Strunk." -msgstr "" - -#. (itstool) path: sect1/title -#: book.translate.xml:8491 -msgid "Style Guide" -msgstr "風格指南" - -#. (itstool) path: sect1/para -#: book.translate.xml:8493 -msgid "" -"To keep the source for the documentation consistent when many different " -"people are editing it, please follow these style conventions." -msgstr "" -"由於說明文件是由眾多作者所維護,為了保持寫作風格的一貫性,請遵守下列撰寫風格" -"慣例。" - -#. (itstool) path: sect2/title -#: book.translate.xml:8498 -msgid "Letter Case" -msgstr "大小寫" - -#. (itstool) path: sect2/para -#: book.translate.xml:8500 -msgid "" -"Tags are entered in lower case, para, not " -"PARA." -msgstr "" -"Tag 的部份都是用小寫字母,譬如是用 para而非PARA。" - -#. (itstool) path: sect2/para -#: book.translate.xml:8503 -msgid "" -"Text that appears in SGML contexts is generally written in upper case, " -"<!ENTITY…>, and <!DOCTYPE…>, not <!entity…> and " -"<!doctype…>." -msgstr "" -"而 SGML 內文則是用大寫字母表示,像是: <!ENTITY…> " -"及 <!DOCTYPE…>而不是 " -"<!entity…><!doctype…>。" - -#. (itstool) path: sect2/para -#: book.translate.xml:8514 -msgid "" -"Acronyms should be defined the first time they appear in a document, as in: " -"Network Time Protocol (NTP). After the " -"acronym has been defined, use the acronym alone unless it makes more sense " -"contextually to use the whole term. Acronyms are usually defined only once " -"per chapter or per document." -msgstr "" -"縮寫字 (Acronym) 通常在書中第一次提到時,必須同時列出完整拼法,比如:" -"Network Time Protocol (NTP)。定義縮寫字之" -"後,應該儘量只使用該縮寫字(而非完整詞彙,除非使用完整詞彙可以更能表達語意)來" -"表達即可。通常每本書只會第一次提到時,才會列出完整詞彙,但若您高興也可以在每" -"章第一次提到時又列出完整詞彙。" - -#. (itstool) path: sect2/para -#: book.translate.xml:8522 -msgid "All acronyms should be enclosed in acronym tags." -msgstr "所有縮寫要包在acronym標籤內。" - -#. (itstool) path: sect2/title -#: book.translate.xml:8527 -msgid "Indentation" -msgstr "縮排" - -#. (itstool) path: sect2/para -#: book.translate.xml:8529 -msgid "" -"The first line in each file starts with no indentation, " -"regardless of the indentation level of the file which " -"might contain the current file." -msgstr "無論檔案縮排設定為何,每個檔案的第一行都不縮排。" - -#. (itstool) path: sect2/para -#: book.translate.xml:8533 -msgid "" -"Opening tags increase the indentation level by two spaces. Closing tags " -"decrease the indentation level by two spaces. Blocks of eight spaces at the " -"start of a line should be replaced with a tab. Do not use spaces in front of " -"tabs, and do not add extraneous whitespace at the end of a line. Content " -"within elements should be indented by two spaces if the content runs over " -"more than one line." -msgstr "" -"未完的標籤會以多兩個空白來增加縮排,結尾的標籤則少兩個空白來縮減縮排。若已達 " -"8 個空白,則以 tab 取代之。此外,在 tab 前面不要再用空白,也不要在每行後面加" -"上空白。每個 tag 的內文若超過一行的話,則接下來的就多兩個空白以做縮排。" - -#. (itstool) path: sect2/para -#: book.translate.xml:8541 -msgid "For example, the source for this section looks like this:" -msgstr "舉個例子,這節所用的寫法大致是下面這樣:" - -#. (itstool) path: sect2/programlisting -#: book.translate.xml:8544 -#, no-wrap -msgid "" -"chapter\n" -" title...title\n" -"\n" -" sect1\n" -" title...title\n" -"\n" -" sect2\n" -" titleIndentationtitle\n" -"\n" -" paraThe first line in each file starts with no indentation,\n" -"\temphasisregardlessemphasis of the indentation level of\n" -"\tthe file which might contain the current file.para\n" -"\n" -" ...\n" -" sect2\n" -" sect1\n" -"chapter" -msgstr "" - -#. (itstool) path: sect2/para -#: book.translate.xml:8562 -msgid "" -"Tags containing long attributes follow the same rules. Following the " -"indentation rules in this case helps editors and writers see which content " -"is inside the tags:" -msgstr "" -"有長屬性的標籤也是遵循一樣的原則。遵守縮排規則可以幫助編輯和作者了解哪些內容" -"在標籤內:" - -#. (itstool) path: sect2/programlisting -#: book.translate.xml:8567 -#, no-wrap -msgid "" -"paraSee the link\n" -" linkend=\"gmirror-troubleshooting\"Troubleshootinglink\n" -" section if there are problems booting. Powering down and\n" -" disconnecting the original filenameada0filename disk\n" -" will allow it to be kept as an offline backup.para\n" -"\n" -"paraIt is also possible to journal the boot disk of a &os;\n" -" system. Refer to the article link\n" -" xlink:href=\"&url.articles.gjournal-desktop;\"Implementing UFS\n" -" Journaling on a Desktop PClink for detailed\n" -" instructions.para" -msgstr "" - -#. (itstool) path: sect2/para -#: book.translate.xml:8579 -msgid "" -"When an element is too long to fit on the remainder of a line without " -"wrapping, moving the start tag to the next line can make the source easier " -"to read. In this example, the systemitem element has been " -"moved to the next line to avoid wrapping and indenting:" -msgstr "" - -#. (itstool) path: sect2/programlisting -#: book.translate.xml:8585 -#, no-wrap -msgid "" -"paraWith file flags, even\n" -" systemitem class=\"username\"rootsystemitem can be\n" -" prevented from removing or altering files.para" -msgstr "" - -#. (itstool) path: sect2/para -#: book.translate.xml:8589 -msgid "" -"Configurations to help various text editors conform to these guidelines can " -"be found in ." -msgstr "" - -#. (itstool) path: sect2/title -#: book.translate.xml:8595 -msgid "Tag Style" -msgstr "標籤風格" - -#. (itstool) path: sect3/title -#: book.translate.xml:8598 -msgid "Tag Spacing" -msgstr "標籤間距" - -#. (itstool) path: sect3/para -#: book.translate.xml:8600 -msgid "" -"Tags that start at the same indent as a previous tag should be separated by " -"a blank line, and those that are not at the same indent as a previous tag " -"should not:" -msgstr "同一縮排階層的標籤要以空一行來做區隔,而不同縮排階層的則不必。比如:" - -#. (itstool) path: informalexample/programlisting -#: book.translate.xml:8605 -#, no-wrap -msgid "" -"article lang='en'\n" -" articleinfo\n" -" titleNIStitle\n" -"\n" -" pubdateOctober 1999pubdate\n" -"\n" -" abstract\n" -" para...\n" -"\t...\n" -"\t...para\n" -" abstract\n" -" articleinfo\n" -"\n" -" sect1\n" -" title...title\n" -"\n" -" para...para\n" -" sect1\n" -"\n" -" sect1\n" -" title...title\n" -"\n" -" para...para\n" -" sect1\n" -"article" -msgstr "" - -#. (itstool) path: sect3/title -#: book.translate.xml:8634 -msgid "Separating Tags" -msgstr "分隔標籤" - -#. (itstool) path: sect3/para -#: book.translate.xml:8636 -msgid "" -"Tags like itemizedlist which will always have further tags inside " -"them, and in fact do not take character data themselves, are always on a " -"line by themselves." -msgstr "" -"像是 itemizedlist 這類的標籤事實上本身不含任何文字資料,必須得由其" -"他標籤來補充內文。這類的標籤會獨用一整行。" - -#. (itstool) path: sect3/para -#: book.translate.xml:8641 -msgid "" -"Tags like para and term do not need other tags to " -"contain normal character data, and their contents begin immediately after " -"the tag, on the same line." -msgstr "" -"另外,像是 paraterm 這類的標籤並不需搭配其他標籤," -"就可附上文字資料,並且在標籤後面的同一行內即可立即寫上這" -"些內文。" - -#. (itstool) path: sect3/para -#: book.translate.xml:8646 -msgid "The same applies to when these two types of tags close." -msgstr "當然,這兩類的標籤結尾時也是跟上面道理相同。" - -#. (itstool) path: sect3/para -#: book.translate.xml:8649 -msgid "This leads to an obvious problem when mixing these tags." -msgstr "不過,當上述這兩種標籤混用時,會有很明顯的困擾。" - -#. (itstool) path: sect3/para -#: book.translate.xml:8652 -msgid "" -"When a starting tag which cannot contain character data directly follows a " -"tag of the type that requires other tags within it to use character data, " -"they are on separate lines. The second tag should be properly indented." -msgstr "" -"當第一類標籤的後面接上第二類標籤的話,那麼要把這兩類標籤各自分行來寫。後者標" -"籤的段落,也是需要做適當縮排調整。" - -#. (itstool) path: sect3/para -#: book.translate.xml:8657 -msgid "" -"When a tag which can contain character data closes directly after a tag " -"which cannot contain character data closes, they co-exist on the same line." -msgstr "而第二類標籤結尾時,可以與第一類標籤的結尾放在同一行。" - -#. (itstool) path: sect2/title -#: book.translate.xml:8664 -msgid "Whitespace Changes" -msgstr "空白變更" - -#. (itstool) path: sect2/para -#: book.translate.xml:8666 -msgid "" -"Do not commit changes to content at the same time as changes to " -"formatting." -msgstr "" -"在提交修改時,請別在修改內容的同時也一起更改編排格式。" - -#. (itstool) path: sect2/para -#: book.translate.xml:8670 -msgid "" -"When content and whitespace changes are kept separate, translation teams can " -"easily see whether a change was content that must be translated or only " -"whitespace." -msgstr "" -"如此一來,像是翻譯團隊才能迅速找出你改了哪些內容,而不用費心思去判斷該行的改" -"變,是由於格式重排或者內容異動。" - -#. (itstool) path: sect2/para -#: book.translate.xml:8674 -msgid "" -"For example, if two sentences have been added to a paragraph so that the " -"line lengths now go over 80 columns, first commit the change with the too-" -"long lines. Then fix the line wrapping, and commit this second change. In " -"the commit message for the second change, indicate that this is a whitespace-" -"only change that can be ignored by translators." -msgstr "" -"舉例說明,若要在某段加上兩個句子,如此一來該段落的某行勢必會超出 80 縱列,這" -"時請先 commmit 修改。接著,再修飾過長行落的換行,然後再次 commit 之。而第二次" -"的 commit 紀錄,請明確說明這只是 whitespace-only (修改空白而已) 的更改,如此" -"一來,翻譯團隊就可以忽略第二次 commit 了 。" - -#. (itstool) path: sect2/title -#: book.translate.xml:8684 -msgid "Non-Breaking Space" -msgstr "不斷行空白" - -#. (itstool) path: sect2/para -#: book.translate.xml:8686 -msgid "" -"Avoid line breaks in places where they look ugly or make it difficult to " -"follow a sentence. Line breaks depend on the width of the chosen output " -"medium. In particular, viewing the HTML documentation with a text browser " -"can lead to badly formatted paragraphs like the next one:" -msgstr "" -"請避免一些情況下的斷行:造成版面醜醜的、或是須連貫表達的同一句子。斷行的情況" -"會隨所閱讀的工具不同而有所不同。尤其是透過純文字瀏覽器來看 HTML 說明文件時會" -"更明顯看到類似下面這樣不好的編排段落:" - -#. (itstool) path: sect2/literallayout -#: book.translate.xml:8692 -#, no-wrap -msgid "" -"Data capacity ranges from 40 MB to 15\n" -"GB. Hardware compression …" -msgstr "" - -#. (itstool) path: sect2/para -#: book.translate.xml:8695 -msgid "" -"The general entity &nbsp; prohibits line breaks " -"between parts belonging together. Use non-breaking spaces in the following " -"places:" -msgstr "" -"請使用 &nbsp; 以避免同句子之間的斷行,以下示範如何使用" -"不斷行空白:" - -#. (itstool) path: listitem/para -#: book.translate.xml:8701 -msgid "between numbers and units:" -msgstr "在數字與單位之間:" - -#. (itstool) path: listitem/programlisting -#: book.translate.xml:8702 -#, no-wrap -msgid "57600&nbsp;bps" -msgstr "57600&nbsp;bps" - -#. (itstool) path: listitem/para -#: book.translate.xml:8706 -msgid "between program names and version numbers:" -msgstr "在程式名稱與版號之間:" - -#. (itstool) path: listitem/programlisting -#: book.translate.xml:8707 -#, no-wrap -msgid "&os;&nbsp;9.2" -msgstr "&os;&nbsp;9.2" - -#. (itstool) path: listitem/para -#: book.translate.xml:8711 -msgid "" -"between multiword names (use with caution when applying this to more than " -"3-4 word names like The FreeBSD Brazilian Portuguese Documentation " -"Project):" -msgstr "" -"多個單字的名稱之間 (在套用到如 The FreeBSD Brazilian Portuguese " -"Documentation Project 這種由三到四個字所組成的名稱時請小心):" - -#. (itstool) path: listitem/programlisting -#: book.translate.xml:8715 -#, no-wrap -msgid "Sun&nbsp;Microsystems" -msgstr "Sun&nbsp;Microsystems" - -#. (itstool) path: sect1/title -#: book.translate.xml:8722 -msgid "Word List" -msgstr "詞彙表" - -#. (itstool) path: sect1/para -#: book.translate.xml:8724 -msgid "" -"This list of words shows the correct spelling and capitalization when used " -"in FreeBSD documentation. If a word is not on this list, ask about it on the " -"FreeBSD documentation project mailing list." -msgstr "" -"以下詞彙表列出使用在 FreeBSD 文件的正確拼法和大小寫。若找不到要找的詞彙,請詢" -"問 FreeBSD documentation project mailing list 。" - -#. (itstool) path: row/entry -#: book.translate.xml:8732 -msgid "Word" -msgstr "字詞" - -#. (itstool) path: row/entry -#: book.translate.xml:8733 -msgid "XML Code" -msgstr "XML 程式碼" - -#. (itstool) path: row/entry -#: book.translate.xml:8734 -msgid "Notes" -msgstr "備註" - -#. (itstool) path: row/entry -#: book.translate.xml:8740 -msgid "CD-ROM" -msgstr "CD-ROM" - -#. (itstool) path: row/entry -#: book.translate.xml:8742 -msgid "" -"acronymCD-ROMacronym" -msgstr "" -"acronymCD-ROMacronym" - -#. (itstool) path: row/entry -#: book.translate.xml:8746 -msgid "DoS (Denial of Service)" -msgstr "DoS (Denial of Service)" - -#. (itstool) path: row/entry -#: book.translate.xml:8747 -msgid "" -"acronymDoSacronym" -msgstr "" -"acronymDoSacronym" - -#. (itstool) path: row/entry -#: book.translate.xml:8751 -msgid "email" -msgstr "email" - -#. (itstool) path: row/entry -#: book.translate.xml:8755 -msgid "file system" -msgstr "file system" - -#. (itstool) path: row/entry -#: book.translate.xml:8759 -msgid "IPsec" -msgstr "IPsec" - -#. (itstool) path: row/entry -#: book.translate.xml:8763 -msgid "Internet" -msgstr "Internet" - -#. (itstool) path: row/entry -#: book.translate.xml:8767 -msgid "manual page" -msgstr "manual page" - -#. (itstool) path: row/entry -#: book.translate.xml:8771 -msgid "mail server" -msgstr "mail server" - -#. (itstool) path: row/entry -#: book.translate.xml:8775 -msgid "name server" -msgstr "name server" - -#. (itstool) path: row/entry -#: book.translate.xml:8779 -msgid "Ports Collection" -msgstr "Ports Collection" - -#. (itstool) path: row/entry -#: book.translate.xml:8783 -msgid "read-only" -msgstr "read-only" - -#. (itstool) path: row/entry -#: book.translate.xml:8787 -msgid "Soft Updates" -msgstr "Soft Updates" - -#. (itstool) path: row/entry -#: book.translate.xml:8791 -msgid "stdin" -msgstr "stdin" - -#. (itstool) path: row/entry -#: book.translate.xml:8792 -msgid "" -"varnamestdinvarname" -msgstr "" -"varnamestdinvarname" - -#. (itstool) path: row/entry -#: book.translate.xml:8796 -msgid "stdout" -msgstr "stdout" - -#. (itstool) path: row/entry -#: book.translate.xml:8797 -msgid "" -"varnamestdoutvarname" -msgstr "" -"varnamestdoutvarname" - -#. (itstool) path: row/entry -#: book.translate.xml:8801 -msgid "stderr" -msgstr "stderr" - -#. (itstool) path: row/entry -#: book.translate.xml:8802 -msgid "" -"varnamestderrvarname" -msgstr "" -"varnamestderrvarname" - -#. (itstool) path: row/entry -#: book.translate.xml:8806 -msgid "Subversion" -msgstr "Subversion" - -#. (itstool) path: row/entry -#: book.translate.xml:8808 -msgid "" -"applicationSubversionapplication" -msgstr "" -"applicationSubversionapplication" - -#. (itstool) path: row/entry -#: book.translate.xml:8809 -msgid "" -"Do not refer to the Subversion application as SVN in " -"upper case. To refer to the command, use commandsvncommand." -msgstr "" -"不要用大寫 SVN 來表示 Subversion 應用程式。若要表示指令," -"請使用 commandsvncommand。" - -#. (itstool) path: row/entry -#: book.translate.xml:8820 -msgid "userland" -msgstr "userland" - -#. (itstool) path: row/entry -#: book.translate.xml:8822 -msgid "things that apply to user space, not the kernel" -msgstr "指那些要會用在使用者空間 (User space) 而非核心的東西。" - -#. (itstool) path: row/entry -#: book.translate.xml:8827 -msgid "web server" -msgstr "web server" - -#. (itstool) path: chapter/title -#: book.translate.xml:8866 -msgid "Editor Configuration" -msgstr "編輯器設定" - -#. (itstool) path: chapter/para -#: book.translate.xml:8868 -msgid "" -"Adjusting text editor configuration can make working on document files " -"quicker and easier, and help documents conform to FDP " -"guidelines." -msgstr "" - -#. (itstool) path: sect1/title -#: book.translate.xml:8873 -msgid "Vim" -msgstr "" - -#. (itstool) path: sect1/para -#: book.translate.xml:8875 -msgid "" -"Install from editors/vim or editors/vim-lite, then follow the configuration instructions in ." -msgstr "" - -#. (itstool) path: sect2/title -#: book.translate.xml:8881 book.translate.xml:9060 -msgid "Use" -msgstr "使用" - -#. (itstool) path: sect2/para -#: book.translate.xml:8883 -msgid "" -"Press P to reformat paragraphs or text that has been " -"selected in Visual mode. Press T to replace groups of eight " -"spaces with a tab." -msgstr "" - -#. (itstool) path: sect2/title -#: book.translate.xml:8890 book.translate.xml:9031 -msgid "Configuration" -msgstr "設置" - -#. (itstool) path: sect2/para -#: book.translate.xml:8892 -msgid "" -"Edit ~/.vimrc, adding these lines to the end of the " -"file:" -msgstr "" - -#. (itstool) path: sect2/programlisting -#: book.translate.xml:8895 -#, no-wrap -msgid "" -"if has(\"autocmd\")\n" -" au BufNewFile,BufRead *.sgml,*.ent,*.xsl,*.xml call Set_SGML()\n" -" au BufNewFile,BufRead *.[1-9] call ShowSpecial()\n" -"endif \" has(autocmd)\n" -"\n" -"function Set_Highlights()\n" -" \"match ExtraWhitespace /^\\s* \\s*\\|\\s\\+$/\n" -" highlight default link OverLength ErrorMsg\n" -" match OverLength /\\%71v.\\+/\n" -" return 0\n" -"endfunction\n" -"\n" -"function ShowSpecial()\n" -" setlocal list listchars=tab:>>,trail:*,eol:$\n" -" hi def link nontext ErrorMsg\n" -" return 0\n" -"endfunction \" ShowSpecial()\n" -"\n" -"function Set_SGML()\n" -" setlocal number\n" -" syn match sgmlSpecial \"&[^;]*;\"\n" -" setlocal syntax=sgml\n" -" setlocal filetype=xml\n" -" setlocal shiftwidth=2\n" -" setlocal textwidth=70\n" -" setlocal tabstop=8\n" -" setlocal softtabstop=2\n" -" setlocal formatprg=\"fmt -p\"\n" -" setlocal autoindent\n" -" setlocal smartindent\n" -" \" Rewrap paragraphs\n" -" noremap P gqj\n" -" \" Replace spaces with tabs\n" -" noremap T :s/ /\\t/<CR>\n" -" call ShowSpecial()\n" -" call Set_Highlights()\n" -" return 0\n" -"endfunction \" Set_SGML()" -msgstr "" - -#. (itstool) path: sect1/title -#: book.translate.xml:8937 -msgid "Emacs" -msgstr "" - -#. (itstool) path: sect1/para -#: book.translate.xml:8939 -msgid "" -"Install from editors/emacs or editors/emacs-" -"devel." -msgstr "" - -#. (itstool) path: sect2/title -#: book.translate.xml:8943 -msgid "Validation" -msgstr "檢驗" - -#. (itstool) path: sect2/para -#: book.translate.xml:8945 -msgid "" -"Emacs's nxml-mode uses compact relax NG schemas for validating XML. A " -"compact relax NG schema for FreeBSD's extension to DocBook 5.0 is included " -"in the documentation repository. To configure nxml-mode to validate using " -"this schema, create ~/.emacs.d/schema/schemas.xml and " -"add these lines to the file:" -msgstr "" - -#. (itstool) path: sect2/programlisting -#: book.translate.xml:8953 -#, no-wrap -msgid "" -"locatingRules xmlns=\"http://thaiopensource.com/ns/locating-rules/1.0\"\n" -" documentElement localName=\"section\" typeId=\"DocBook\"\n" -" documentElement localName=\"chapter\" typeId=\"DocBook\"\n" -" documentElement localName=\"article\" typeId=\"DocBook\"\n" -" documentElement localName=\"book\" typeId=\"DocBook\"\n" -" typeId id=\"DocBook\" uri=\"/usr/local/share/xml/docbook/5.0/rng/docbook.rnc\"\n" -"locatingRules" -msgstr "" - -#. (itstool) path: sect2/title -#: book.translate.xml:8964 -msgid "Automated Proofreading with Flycheck and Igor" -msgstr "使用 Flycheck 和 Igor 自動化校對" - -#. (itstool) path: sect2/para -#: book.translate.xml:8966 -msgid "" -"The Flycheck package is available from Milkypostman's Emacs Lisp Package " -"Archive (MELPA). If MELPA is not " -"already in Emacs's packages-archives, it can be added by evaluating" -msgstr "" - -#. (itstool) path: sect2/programlisting -#: book.translate.xml:8971 -#, no-wrap -msgid "(add-to-list 'package-archives '(\"melpa\" . \"http://stable.melpa.org/packages/\") t)" -msgstr "" - -#. (itstool) path: sect2/para -#: book.translate.xml:8973 -msgid "" -"Add the line to Emacs's initialization file (one of ~/.emacs, ~/.emacs.el, or ~.emacs.d/init.el) to make this change permanent." -msgstr "" - -#. (itstool) path: sect2/para -#: book.translate.xml:8979 -msgid "To install Flycheck, evaluate" -msgstr "" - -#. (itstool) path: sect2/programlisting -#: book.translate.xml:8981 -#, no-wrap -msgid "(package-install 'flycheck)" -msgstr "" - -#. (itstool) path: sect2/para -#: book.translate.xml:8983 -msgid "" -"Create a Flycheck checker for textproc/igor by evaluating" -msgstr "" - -#. (itstool) path: sect2/programlisting -#: book.translate.xml:8986 -#, no-wrap -msgid "" -"(flycheck-define-checker igor\n" -" \"FreeBSD Documentation Project sanity checker.\n" -"\n" -"See URLs http://www.freebsd.org/docproj/ and\n" -"http://www.freshports.org/textproc/igor/.\"\n" -" :command (\"igor\" \"-X\" source-inplace)\n" -" :error-parser flycheck-parse-checkstyle\n" -" :modes (nxml-mode)\n" -" :standard-input t)\n" -"\n" -" (add-to-list 'flycheck-checkers 'igor 'append)" -msgstr "" - -#. (itstool) path: sect2/para -#: book.translate.xml:8998 -msgid "" -"Again, add these lines to Emacs's initialization file to make the changes " -"permanent." -msgstr "" - -#. (itstool) path: sect2/title -#: book.translate.xml:9003 -msgid "FreeBSD Documentation Specific Settings" -msgstr "FreeBSD 說明文件特定的設定" - -#. (itstool) path: sect2/para -#: book.translate.xml:9005 -msgid "" -"To apply settings specific to the FreeBSD documentation project, create " -".dir-locals.el in the root directory of the " -"documentation repository and add these lines to the file:" -msgstr "" - -#. (itstool) path: sect2/programlisting -#: book.translate.xml:9010 -#, no-wrap -msgid "" -";;; Directory Local Variables\n" -";;; For more information see (info \"(emacs) Directory Variables\")\n" -"\n" -"((nxml-mode\n" -" (eval . (turn-on-auto-fill))\n" -" (fill-column . 70)\n" -" (eval . (require 'flycheck))\n" -" (eval . (flycheck-mode 1))\n" -" (flycheck-checker . igor)\n" -" (eval . (add-to-list 'rng-schema-locating-files \"~/.emacs.d/schema/schemas.xml\"))))" -msgstr "" - -#. (itstool) path: sect1/title -#: book.translate.xml:9024 -msgid "nano" -msgstr "" - -#. (itstool) path: sect1/para -#: book.translate.xml:9026 -msgid "" -"Install from editors/nano or editors/nano-devel." -msgstr "" - -#. (itstool) path: sect2/para -#: book.translate.xml:9033 -msgid "" -"Copy the sample XML syntax highlight file to the user's " -"home directory:" -msgstr "" - -#. (itstool) path: sect2/screen -#: book.translate.xml:9036 -#, no-wrap -msgid "% cp /usr/local/share/nano/xml.nanorc ~/.nanorc" -msgstr "" - -#. (itstool) path: sect2/para -#: book.translate.xml:9038 -msgid "Add these lines to the new ~/.nanorc." -msgstr "" - -#. (itstool) path: sect2/programlisting -#: book.translate.xml:9041 -#, no-wrap -msgid "" -"syntax \"xml\" \"\\.([jrs]html?|xml|xslt?)$\"\n" -"# trailing whitespace\n" -"color ,blue \"[[:space:]]+$\"\n" -"# multiples of eight spaces at the start a line\n" -"# (after zero or more tabs) should be a tab\n" -"color ,blue \"^([TAB]*[ ]{8})+\"\n" -"# tabs after spaces\n" -"color ,yellow \"( )+TAB\"\n" -"# highlight indents that have an odd number of spaces\n" -"color ,red \"^(([ ]{2})+|(TAB+))*[ ]{1}[^ ]{1}\"\n" -"# lines longer than 70 characters\n" -"color ,yellow \"^(.{71})|(TAB.{63})|(TAB{2}.{55})|(TAB{3}.{47}).+$\"" -msgstr "" - -#. (itstool) path: sect2/para -#: book.translate.xml:9054 -msgid "Process the file to create embedded tabs:" -msgstr "" - -#. (itstool) path: sect2/screen -#: book.translate.xml:9056 -#, no-wrap -msgid "% perl -i'' -pe 's/TAB/\\t/g' ~/.nanorc" -msgstr "" - -#. (itstool) path: sect2/para -#: book.translate.xml:9062 -msgid "Specify additional helpful options when running the editor:" -msgstr "" - -#. (itstool) path: sect2/screen -#: book.translate.xml:9065 -#, no-wrap -msgid "% nano -AKipwz -r 70 -T8 chapter.xml" -msgstr "" - -#. (itstool) path: sect2/para -#: book.translate.xml:9067 -msgid "" -"Users of csh1 can define an alias in ~/.cshrc to automate these options:" -msgstr "" - -#. (itstool) path: sect2/programlisting -#: book.translate.xml:9071 -#, no-wrap -msgid "alias nano \"nano -AKipwz -r 70 -T8\"" -msgstr "" - -#. (itstool) path: sect2/para -#: book.translate.xml:9073 -msgid "After the alias is defined, the options will be added automatically:" -msgstr "" - -#. (itstool) path: sect2/screen -#: book.translate.xml:9076 -#, no-wrap -msgid "% nano chapter.xml" -msgstr "" - -#. (itstool) path: chapter/title -#: book.translate.xml:9114 -msgid "See Also" -msgstr "他山之石" - -#. (itstool) path: chapter/para -#: book.translate.xml:9116 -msgid "" -"This document is deliberately not an exhaustive discussion of XML, the DTDs " -"listed, and the FreeBSD Documentation Project. For more information about " -"these, you are encouraged to see the following web sites." -msgstr "" - -#. (itstool) path: sect1/title -#: book.translate.xml:9122 -msgid "The FreeBSD Documentation Project" -msgstr "FreeBSD 說明文件計劃" - -#. (itstool) path: listitem/para -#: book.translate.xml:9126 -msgid "" -"The FreeBSD " -"Documentation Project web pages" -msgstr "" -"FreeBSD 說明文件計" -"劃網頁" - -#. (itstool) path: listitem/para -#: book.translate.xml:9131 -msgid "" -"The FreeBSD Handbook" -msgstr "" -"FreeBSD 使用手冊" - -#. (itstool) path: sect1/title -#: book.translate.xml:9138 -msgid "XML" -msgstr "XML" - -#. (itstool) path: listitem/para -#: book.translate.xml:9142 -msgid "" -"W3C's XML page SGML/XML web " -"page" -msgstr "" -"W3C's XML 網頁 SGML/XML 網頁" - -#. (itstool) path: sect1/title -#: book.translate.xml:9149 -msgid "HTML" -msgstr "HTML" - -#. (itstool) path: listitem/para -#: book.translate.xml:9153 -msgid "" -"The World Wide Web Consortium" -msgstr "全球資訊網協會" - -#. (itstool) path: listitem/para -#: book.translate.xml:9158 -msgid "" -"The HTML 4.0 " -"specification" -msgstr "" -"The HTML 4.0 規格表" - -#. (itstool) path: sect1/title -#: book.translate.xml:9165 -msgid "DocBook" -msgstr "DocBook" - -#. (itstool) path: listitem/para -#: book.translate.xml:9169 -msgid "" -"The DocBook " -"Technical Committee, maintainers of the DocBook DTD" -msgstr "" -"The DocBook 技術委員" -"會,DocBook DTD的維護者" - -#. (itstool) path: listitem/para -#: book.translate.xml:9175 -msgid "" -"DocBook: The Definitive Guide, the online documentation for the DocBook DTD" -msgstr "" -"DocBook:The Definitive Guide,DocBook DTD 的線上說明文件。" - -#. (itstool) path: listitem/para -#: book.translate.xml:9181 -msgid "" -"The DocBook Open " -"Repository contains DSSSL stylesheets and other resources for people " -"using DocBook" -msgstr "" - -#. (itstool) path: appendix/para -#: book.translate.xml:9227 -msgid "" -"These examples are not exhaustive—they do not contain all the elements that " -"might be desirable to use, particularly in a document's front matter. For " -"more examples of DocBook markup, examine the XML source " -"for this and other documents available in the Subversion doc repository, or available online starting " -"at http://svnweb.FreeBSD." -"org/doc/." -msgstr "" - -#. (itstool) path: sect1/title -#. (itstool) path: example/title -#: book.translate.xml:9236 book.translate.xml:9239 -msgid "DocBook book" -msgstr "DocBook book" - -#. (itstool) path: example/programlisting -#: book.translate.xml:9241 -#, no-wrap -msgid "" -"<!DOCTYPE book PUBLIC \"-//FreeBSD//DTD DocBook XML V5.0-Based Extension//EN\"\n" -"\t\"http://www.FreeBSD.org/XML/share/xml/freebsd50.dtd\">\n" -"\n" -"book xmlns=\"http://docbook.org/ns/docbook\"\n" -" xmlns:xlink=\"http://www.w3.org/1999/xlink\" version=\"5.0\"\n" -" xml:lang=\"en\"\n" -"\n" -" info\n" -" titleAn Example Booktitle\n" -"\n" -" author\n" -" personname\n" -" firstnameYour first namefirstname\n" -" surnameYour surnamesurname\n" -" personname\n" -"\n" -" affiliation\n" -"\taddress\n" -"\t emailfoo@example.comemail\n" -"\taddress\n" -" affiliation\n" -" author\n" -"\n" -" copyright\n" -" year2000year\n" -" holderCopyright string hereholder\n" -" copyright\n" -"\n" -" abstract\n" -" paraIf your book has an abstract then it should go here.para\n" -" abstract\n" -" info\n" -"\n" -" preface\n" -" titlePrefacetitle\n" -"\n" -" paraYour book may have a preface, in which case it should be placed\n" -" here.para\n" -" preface\n" -"\n" -" chapter\n" -" titleMy First Chaptertitle\n" -"\n" -" paraThis is the first chapter in my book.para\n" -"\n" -" sect1\n" -" titleMy First Sectiontitle\n" -"\n" -" paraThis is the first section in my book.para\n" -" sect1\n" -" chapter\n" -"book" -msgstr "" - -#. (itstool) path: sect1/title -#. (itstool) path: example/title -#: book.translate.xml:9297 book.translate.xml:9300 -msgid "DocBook article" -msgstr "DocBook article" - -#. (itstool) path: example/programlisting -#: book.translate.xml:9302 -#, no-wrap -msgid "" -"<!DOCTYPE article PUBLIC \"-//FreeBSD//DTD DocBook XML V5.0-Based Extension//EN\"\n" -"\t\"http://www.FreeBSD.org/XML/share/xml/freebsd50.dtd\">\n" -"\n" -"article xmlns=\"http://docbook.org/ns/docbook\"\n" -" xmlns:xlink=\"http://www.w3.org/1999/xlink\" version=\"5.0\"\n" -" xml:lang=\"en\"\n" -"\n" -" info\n" -" titleAn Example Articletitle\n" -"\n" -" author\n" -" personname\n" -" firstnameYour first namefirstname\n" -" surnameYour surnamesurname\n" -" personname\n" -"\n" -" affiliation\n" -"\taddress\n" -"\t emailfoo@example.comemail\n" -"\taddress\n" -" affiliation\n" -" author\n" -"\n" -" copyright\n" -" year2000year\n" -" holderCopyright string hereholder\n" -" copyright\n" -"\n" -" abstract\n" -" paraIf your article has an abstract then it should go here.para\n" -" abstract\n" -" info\n" -"\n" -" sect1\n" -" titleMy First Sectiontitle\n" -"\n" -" paraThis is the first section in my article.para\n" -"\n" -" sect2\n" -" titleMy First Sub-Sectiontitle\n" -"\n" -" paraThis is the first sub-section in my article.para\n" -" sect2\n" -" sect1\n" -"article" -msgstr "" diff --git a/zh_TW.UTF-8/books/handbook/Makefile b/zh_TW.UTF-8/books/handbook/Makefile deleted file mode 100644 index 0c348973bf..0000000000 --- a/zh_TW.UTF-8/books/handbook/Makefile +++ /dev/null @@ -1,167 +0,0 @@ -# -# $FreeBSD$ -# -# Build the FreeBSD Handbook (Traditional Chinese). -# - -.PATH: ${.CURDIR}/../../share/xml/glossary - -MAINTAINER= doc@FreeBSD.org - -DOC?= book - -FORMATS?= html-split - -INSTALL_COMPRESSED?= gz -INSTALL_ONLY_COMPRESSED?= - -# English images -# as these are translated, move them from IMAGES_EN to IMAGES -IMAGES_EN = advanced-networking/isdn-bus.eps -IMAGES_EN+= advanced-networking/isdn-twisted-pair.eps -IMAGES_EN+= advanced-networking/natd.eps -IMAGES_EN+= advanced-networking/net-routing.pic -IMAGES_EN+= advanced-networking/pxe-nfs.png -IMAGES_EN+= advanced-networking/static-routes.pic -IMAGES_EN+= basics/disk-layout.eps -IMAGES_EN+= basics/example-dir1.eps -IMAGES_EN+= basics/example-dir2.eps -IMAGES_EN+= basics/example-dir3.eps -IMAGES_EN+= basics/example-dir4.eps -IMAGES_EN+= basics/example-dir5.eps -IMAGES_EN+= bsdinstall/bsdinstall-adduser1.png -IMAGES_EN+= bsdinstall/bsdinstall-adduser2.png -IMAGES_EN+= bsdinstall/bsdinstall-adduser3.png -IMAGES_EN+= bsdinstall/bsdinstall-boot-loader-menu.png -IMAGES_EN+= bsdinstall/bsdinstall-boot-options-menu.png -IMAGES_EN+= bsdinstall/bsdinstall-newboot-loader-menu.png -IMAGES_EN+= bsdinstall/bsdinstall-choose-mode.png -IMAGES_EN+= bsdinstall/bsdinstall-config-components.png -IMAGES_EN+= bsdinstall/bsdinstall-config-hostname.png -IMAGES_EN+= bsdinstall/bsdinstall-config-keymap.png -IMAGES_EN+= bsdinstall/bsdinstall-config-services.png -IMAGES_EN+= bsdinstall/bsdinstall-config-crashdump.png -IMAGES_EN+= bsdinstall/bsdinstall-configure-network-interface-ipv4-dhcp.png -IMAGES_EN+= bsdinstall/bsdinstall-configure-network-interface-ipv4.png -IMAGES_EN+= bsdinstall/bsdinstall-configure-network-interface-ipv4-static.png -IMAGES_EN+= bsdinstall/bsdinstall-configure-network-interface-ipv6.png -IMAGES_EN+= bsdinstall/bsdinstall-configure-network-interface-ipv6-static.png -IMAGES_EN+= bsdinstall/bsdinstall-configure-network-interface-slaac.png -IMAGES_EN+= bsdinstall/bsdinstall-configure-network-interface.png -IMAGES_EN+= bsdinstall/bsdinstall-configure-network-ipv4-dns.png -IMAGES_EN+= bsdinstall/bsdinstall-configure-wireless-accesspoints.png -IMAGES_EN+= bsdinstall/bsdinstall-configure-wireless-scan.png -IMAGES_EN+= bsdinstall/bsdinstall-configure-wireless-wpa2setup.png -IMAGES_EN+= bsdinstall/bsdinstall-distfile-extracting.png -IMAGES_EN+= bsdinstall/bsdinstall-distfile-fetching.png -IMAGES_EN+= bsdinstall/bsdinstall-distfile-verifying.png -IMAGES_EN+= bsdinstall/bsdinstall-final-confirmation.png -IMAGES_EN+= bsdinstall/bsdinstall-finalconfiguration.png -IMAGES_EN+= bsdinstall/bsdinstall-final-modification-shell.png -IMAGES_EN+= bsdinstall/bsdinstall-keymap-10.png -IMAGES_EN+= bsdinstall/bsdinstall-keymap-select-default.png -IMAGES_EN+= bsdinstall/bsdinstall-mainexit.png -IMAGES_EN+= bsdinstall/bsdinstall-netinstall-files.png -IMAGES_EN+= bsdinstall/bsdinstall-netinstall-mirrorselect.png -IMAGES_EN+= bsdinstall/bsdinstall-part-entire-part.png -IMAGES_EN+= bsdinstall/bsdinstall-part-guided-disk.png -IMAGES_EN+= bsdinstall/bsdinstall-part-guided-manual.png -IMAGES_EN+= bsdinstall/bsdinstall-part-manual-addpart.png -IMAGES_EN+= bsdinstall/bsdinstall-part-manual-create.png -IMAGES_EN+= bsdinstall/bsdinstall-part-manual-partscheme.png -IMAGES_EN+= bsdinstall/bsdinstall-part-review.png -IMAGES_EN+= bsdinstall/bsdinstall-post-root-passwd.png -IMAGES_EN+= bsdinstall/bsdinstall-set-clock-local-utc.png -IMAGES_EN+= bsdinstall/bsdinstall-timezone-confirm.png -IMAGES_EN+= bsdinstall/bsdinstall-timezone-country.png -IMAGES_EN+= bsdinstall/bsdinstall-timezone-region.png -IMAGES_EN+= bsdinstall/bsdinstall-timezone-zone.png -IMAGES_EN+= bsdinstall/bsdinstall-zfs-disk_info.png -IMAGES_EN+= bsdinstall/bsdinstall-zfs-disk_select.png -IMAGES_EN+= bsdinstall/bsdinstall-zfs-geli_password.png -IMAGES_EN+= bsdinstall/bsdinstall-zfs-menu.png -IMAGES_EN+= bsdinstall/bsdinstall-zfs-partmenu.png -IMAGES_EN+= bsdinstall/bsdinstall-zfs-vdev_invalid.png -IMAGES_EN+= bsdinstall/bsdinstall-zfs-vdev_type.png -IMAGES_EN+= bsdinstall/bsdinstall-zfs-warning.png -IMAGES_EN+= geom/striping.pic -IMAGES_EN+= mail/mutt1.scr -IMAGES_EN+= mail/mutt2.scr -IMAGES_EN+= mail/mutt3.scr -IMAGES_EN+= mail/pine1.scr -IMAGES_EN+= mail/pine2.scr -IMAGES_EN+= mail/pine3.scr -IMAGES_EN+= mail/pine4.scr -IMAGES_EN+= mail/pine5.scr -IMAGES_EN+= security/ipsec-network.pic -IMAGES_EN+= security/ipsec-crypt-pkt.pic -IMAGES_EN+= security/ipsec-encap-pkt.pic -IMAGES_EN+= security/ipsec-out-pkt.pic -IMAGES_EN+= virtualization/parallels-freebsd1.png -IMAGES_EN+= virtualization/parallels-freebsd2.png -IMAGES_EN+= virtualization/parallels-freebsd3.png -IMAGES_EN+= virtualization/parallels-freebsd4.png -IMAGES_EN+= virtualization/parallels-freebsd5.png -IMAGES_EN+= virtualization/parallels-freebsd6.png -IMAGES_EN+= virtualization/parallels-freebsd7.png -IMAGES_EN+= virtualization/parallels-freebsd8.png -IMAGES_EN+= virtualization/parallels-freebsd9.png -IMAGES_EN+= virtualization/parallels-freebsd10.png -IMAGES_EN+= virtualization/parallels-freebsd11.png -IMAGES_EN+= virtualization/parallels-freebsd12.png -IMAGES_EN+= virtualization/parallels-freebsd13.png -IMAGES_EN+= virtualization/virtualpc-freebsd1.png -IMAGES_EN+= virtualization/virtualpc-freebsd2.png -IMAGES_EN+= virtualization/virtualpc-freebsd3.png -IMAGES_EN+= virtualization/virtualpc-freebsd4.png -IMAGES_EN+= virtualization/virtualpc-freebsd5.png -IMAGES_EN+= virtualization/virtualpc-freebsd6.png -IMAGES_EN+= virtualization/virtualpc-freebsd7.png -IMAGES_EN+= virtualization/virtualpc-freebsd8.png -IMAGES_EN+= virtualization/virtualpc-freebsd9.png -IMAGES_EN+= virtualization/virtualpc-freebsd10.png -IMAGES_EN+= virtualization/virtualpc-freebsd11.png -IMAGES_EN+= virtualization/virtualpc-freebsd12.png -IMAGES_EN+= virtualization/virtualpc-freebsd13.png -IMAGES_EN+= virtualization/vmware-freebsd01.png -IMAGES_EN+= virtualization/vmware-freebsd02.png -IMAGES_EN+= virtualization/vmware-freebsd03.png -IMAGES_EN+= virtualization/vmware-freebsd04.png -IMAGES_EN+= virtualization/vmware-freebsd05.png -IMAGES_EN+= virtualization/vmware-freebsd06.png -IMAGES_EN+= virtualization/vmware-freebsd07.png -IMAGES_EN+= virtualization/vmware-freebsd08.png -IMAGES_EN+= virtualization/vmware-freebsd09.png -IMAGES_EN+= virtualization/vmware-freebsd10.png -IMAGES_EN+= virtualization/vmware-freebsd11.png -IMAGES_EN+= virtualization/vmware-freebsd12.png - -# Images from the cross-document image library -IMAGES_LIB= callouts/1.png -IMAGES_LIB+= callouts/2.png -IMAGES_LIB+= callouts/3.png -IMAGES_LIB+= callouts/4.png -IMAGES_LIB+= callouts/5.png -IMAGES_LIB+= callouts/6.png -IMAGES_LIB+= callouts/7.png -IMAGES_LIB+= callouts/8.png -IMAGES_LIB+= callouts/9.png -IMAGES_LIB+= callouts/10.png -IMAGES_LIB+= callouts/11.png -IMAGES_LIB+= callouts/12.png -IMAGES_LIB+= callouts/13.png -IMAGES_LIB+= callouts/14.png -IMAGES_LIB+= callouts/15.png - -# XML content -SRCS= book.xml - -SYMLINKS= ${DESTDIR} index.html handbook.html - -URL_RELPREFIX?= ../../../.. -DOC_PREFIX?= ${.CURDIR}/../../.. - -# Fixme! -DOCBOOK_DEPS_DISABLE=YES - -.include "${DOC_PREFIX}/share/mk/doc.project.mk" diff --git a/zh_TW.UTF-8/books/handbook/book.xml b/zh_TW.UTF-8/books/handbook/book.xml deleted file mode 100644 index 2c09efdcb8..0000000000 --- a/zh_TW.UTF-8/books/handbook/book.xml +++ /dev/null @@ -1,61783 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -"> - - -]> - - - - - - - - - - - - - FreeBSD 使用手冊 - - FreeBSD 文件計劃 - - $FreeBSD$ - - $FreeBSD$ - - - 1995 - 1996 - 1997 - 1998 - 1999 - 2000 - 2001 - 2002 - 2003 - 2004 - 2005 - 2006 - 2007 - 2008 - 2009 - 2010 - 2011 - 2012 - 2013 - 2014 - 2015 - 2016 - 2017 - 2018 - 2019 - The FreeBSD Documentation Project - - - - - 版權 - - Redistribution and use in source (XML DocBook) and 'compiled' - forms (XML, HTML, PDF, PostScript, RTF and so forth) with or without - modification, are permitted provided that the following conditions are - met: - - - - Redistributions of source code (XML DocBook) must retain the - above copyright notice, this list of conditions and the following - disclaimer as the first lines of this file unmodified. - - - - Redistributions in compiled form (transformed to other DTDs, - converted to PDF, PostScript, RTF and other formats) must - reproduce the above copyright notice, this list of conditions and - the following disclaimer in the documentation and/or other - materials provided with the distribution. - - - - - THIS DOCUMENTATION IS PROVIDED BY THE FREEBSD DOCUMENTATION - PROJECT "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, - BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND - FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL - THE FREEBSD DOCUMENTATION PROJECT BE LIABLE FOR ANY DIRECT, INDIRECT, - INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, - BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS - OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR - TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE - USE OF THIS DOCUMENTATION, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH - DAMAGE. - - - - - - FreeBSD 是 FreeBSD 基金會的註冊商標。 - 3Com 和 HomeConnect 是 3Com Corporation 的註冊商標。 - 3ware 是 3ware Inc 的註冊商標。 - ARM 是 ARM Limited. 的註冊商標。 - Adaptec 是 Adaptec, Inc. 的註冊商標。 - Adobe, Acrobat, Acrobat Reader, Flash 以及 PostScript 是 Adobe Systems Incorporated 在美國和/或其他國家的商標或註冊商標。 - Apple, AirPort, FireWire, iMac, iPhone, iPad, Mac, Macintosh, Mac OS, Quicktime 以及 TrueType 是 Apple Inc. 在美國以及其他國家的註冊商標。 - Android 是 Google Inc 的商標。 - Heidelberg, Helvetica, Palatino 以及 Times Roman 是 Heidelberger Druckmaschinen AG 在美國以及其他國家的商標或註冊商標。 - IBM, AIX, OS/2, PowerPC, PS/2, S/390 以及 ThinkPad 是 International Business Machines Corporation 在美國和其他國家的商標。 - IEEE, POSIX 以及 802 是 Institute of Electrical and Electronics Engineers, Inc. 在美國的註冊商標。 - Intel, Celeron, Centrino, Core, EtherExpress, i386, i486, Itanium, Pentium 以及 Xeon 是 Intel Corporation 及其分支機構在美國和其他國家的商標或註冊商標。 - Intuit 和 Quicken 是 Intuit Inc., 或其子公司在美國和其他國家的商標或註冊商標。 - Linux 是 Linus Torvalds 的註冊商標。 - LSI Logic, AcceleRAID, eXtremeRAID, MegaRAID 以及 Mylex 是 LSI Logic Corp 的商標或註冊商標。 - Microsoft, IntelliMouse, MS-DOS, Outlook, Windows, Windows Media 以及 Windows NT 是 Microsoft Corporation 在美國和/或其他國家的商標或註冊商標。 - Motif, OSF/1 以及 UNIX 是 The Open Group 在美國和其他國家的註冊商標; IT DialTone 和 The Open Group 是其商標。 - Oracle 是 Oracle Corporation 的註冊商標。 - RealNetworks, RealPlayer, 和 RealAudio 是 RealNetworks, Inc. 的註冊商標。 - Red Hat, RPM, 是 Red Hat, Inc. 在美國和其他國家的註冊商標。 - Sun, Sun Microsystems, Java, Java Virtual Machine, JDK, JRE, JSP, JVM, Netra, OpenJDK, Solaris, StarOffice, SunOS 以及 VirtualBox 是 Sun Microsystems, Inc. 在美國和其他國家的商標或註冊商標。 - MATLAB 是 The MathWorks, Inc. 的註冊商標。 - SpeedTouch 是 Thomson 的商標。 - VMware 是 VMware, Inc. 的商標。 - Mathematica 是 Wolfram Research, Inc 的註冊商標。 - XFree86 是 The XFree86 Project, Inc 的商標。 - Ogg Vorbis 以及 Xiph.Org 是 Xiph.Org 的商標。 - 許多製造商和經銷商使用一些稱為商標的圖案或文字設計來區別自己的產品。 本文件中出現的眾多商標,以及 FreeBSD Project 本身廣所人知的商標,後面將以 ® 符號來標示。 - - - - 歡迎使用 FreeBSD! 本使用手冊涵蓋範圍包括了 FreeBSD 12.0-RELEASEFreeBSD 11.3-RELEASE 的安裝與平日操作的說明。 這份使用手冊是很多人的集體創作,而且仍然『持續不斷』的進行中,因此部份章節可能尚未仍未完成,如果您有興趣協助本計畫的話,請寄電子郵件至 FreeBSD 文件專案郵遞論壇。 - - FreeBSD 網站 可以找到本手冊的最新版本,舊版文件可從 https://docs.FreeBSD.org/doc/ 取得。本文件也提供各種格式與不同壓縮方式的版本可自 FreeBSD FTP 伺服器 或是其中一個 鏡像網站 下載。 列印出來的實體書面資料可在 FreeBSD 商城 購買。 此外,您可在 搜尋頁面 中搜尋本文件或其他文件的資料。 - - - - - - - - - 給讀者的話 - - 若您是第一次接觸 FreeBSD 的新手,可以在本書第一部分找到 FreeBSD 的安裝程序,同時會逐步介紹 UNIX 的基礎概念與一些常用、共通的東西。而閱讀這部分並不難,只需要您有探索的精神和接受新概念。 - - 讀完這些之後,手冊中的第二部分花很長篇幅介紹的各種廣泛主題,相當值得系統管理者去注意。 在閱讀這些章節的內容時所需要的背景知識,都註釋在該章的大綱裡面,若不熟的話,可在閱讀前先預習一番。 - - 延伸閱讀方面,可參閱 - - 自第三版後的主要修訂 - - 您目前看到的這本手冊代表著上百位貢獻者歷時 10 年所累積的心血之作。以下為自 2014 年發佈的兩冊第三版後所做的主要修訂: - - - - 增加說明有關強大的 DTrace 效能分析工具的資訊。 - - - - 增加有關 FreeBSD 非原生檔案系統的資訊,如:來自 Sun 的 ZSF。 - - - - 增加的內容涵蓋 FreeBSD 的新稽查功能及其使用說明。 - - - - 增加有關在虛擬化軟體安裝 FreeBSD 的資訊。 - - - - 增加的內容涵蓋使用新安裝工具 bsdinstall 來安裝 FreeBSD。 - - - - 自第二版後的主要修訂 (2004) - - 您目前看到的這本手冊第三版是 FreeBSD 文件計劃的成員歷時兩年完成的心血之作。因文件內容成長到一定大小,印刷版需要分成兩冊發佈。新版的主要修訂部分如下: - - - - 已針對新內容作更新,如:ACPI 電源管理、cron 以及其他更多的核心調校選項說明內容。 - - - - 增加了虛擬私人網路 (VPN)、檔案系統的存取控制 (ACL),以及安全報告。 - - - - 是此版本新增的章節。該章介紹:什麼是 MAC 機制?以及如何運用它來使您的 FreeBSD 系統更安全。 - - - - 新增了像是:USB 隨身碟、檔案系統快照 (Snapshot)、檔案系統配額 (Quota) 、檔案與網路為基礎的檔案系統、以及如何對硬碟分割區作加密等詳解。 - - - - 增加了疑難排解的章節。 - - - - 新增有關如何使用其它的傳輸代理程式、SMTP 認證、UUCP、fetchmailprocmail 的運用以及其它進階主題。 - - - - 是該版中全新的一章。這一章介紹了如何架設 Apache HTTP 伺服器ftpd 以及用於支援 Microsoft Windows 客戶端的 Samba。其中有些段落來自原先的 - - - - 新增有關在 FreeBSD 中使用藍牙裝置、設定無線網路以及使用非同步傳輸模式 (Asynchronous Transfer Mode, ATM) 網路的介紹。 - - - - 增加詞彙表,用以說明全書中出現的術語。 - - - - 重新美編書中所列的圖表。 - - - - 自第一版後的主要修訂 (2001) - - 本手冊的第二版是 FreeBSD 文件計劃的成員歷時兩年完成的心血之作。第二版包的主要變動如下: - - - - - - 增加完整的目錄索引。 - - - - 所有的 ASCII 圖表均改成圖檔格式的圖表。 - - - - 每個章節均加入概述,以便快速的瀏覽該章節內容摘要、讀者所欲了解的部分。 - - - - 內容架構重新組織成三大部分:入門系統管理 以及 附錄 - - - - 新增了程序、Daemon 以及信號 (Signal) 的介紹。 - - - - 新增了介紹如何管理 Binary 套件的資訊。 - - - - 經過全面改寫,著重於在 XFree86 4.X 上的現代桌面技術,如: KDEGNOME - - - - 更新相關內容。 - - - - 分別以兩個章節 磁碟備份 來撰寫。我們認為這樣子會比單一章節來得容易瞭解。還有關於 RAID (包含硬體、軟體 RAID) 的段落也新增上去了。 - - - - 架構重新改寫,並更新至 FreeBSD 4.X/5.X 的內容。 - - - - 有相當程度的更新。 - - - - 加入許多新內容。 - - - - 大量新增了設定 sendmail 的介紹。 - - - - 增加許多有關安裝 Oracle 以及 SAP R/3 的介紹。 - - - - 此外,第二版還新加章節,以介紹下列新主題: - - - - - - - - - - - - - - 本書架構 - - 本書主要分為五大部分,第一部份入門:介紹 FreeBSD 的安裝、基本操作。 讀者可根據自己的程度,循序或者跳過一些熟悉的主題來閱讀; 第二部分一般作業:介紹 FreeBSD 常用功能,這部分可以不按順序來讀。 每章前面都會有概述,概述會描述本章節涵蓋的內容和讀者應該已知的, 這主要是讓讀者可以挑喜歡的章節閱讀; 第三部分系統管理:介紹 FreeBSD 老手所感興趣的各種主題部分; 第四部分網路通訊:則包括網路和各式伺服器主題;而第五部分則為附錄包含各種有關 FreeBSD 的資源。 - - - - - - - - - - 向新手介紹 FreeBSD。該篇說明了 FreeBSD 計劃的歷史、目標和開發模式。 - - - - - - - - 帶領使用者走一次使用 bsdinstall 在 FreeBSD 9.x 及之後版本的完整安裝流程。 - - - - - - - - 涵蓋 FreeBSD 作業系統的基礎指令及功能。若您熟悉 Linux 或其他類 UNIX® 系統,您則可跳過此章。 - - - - - - - - 涵蓋如何使用 FreeBSD 獨創的 Port 套件集 與標準 Binary 套件安裝第三方軟體。 - - - - - - - - 介紹 X Windows 系統概要及在 FreeBSD 上使用 X11,同時也會介紹常用的桌面環境如 KDEGNOME - - - - - - - - - - 列出一些常用的桌面應用程式,例如:網頁瀏覽器、辦工工具並介紹如何安裝這些應用程式到 FreeBSD。 - - - - - - - 示範如何在您的系統設定音效及影像播放支援,同時會介紹幾個代表性的音訊及視訊應用程式。 - - - - - - - - 說明為何需要設定新的核心並會提供設定、編譯與安裝的詳細操作說明。 - - - - - - - - 介紹如何在 FreeBSD 管理印表機,包含橫幅頁面、列印帳務以及初始設定等資訊。 - - - - - - - - 介紹 FreeBSD 的 Linux 相容性功能,同時提供許多熱門的 Linux 應用程式詳細的安裝操作說明,例如 OracleMathematica - - - - - - - - - - 介紹可供系統管理者用來調校 FreeBSD 系統的可用參數來最佳化效率,同時也介紹 FreeBSD 用到的各種設定檔以及到何處尋找這些設定檔。 - - - - - - - - 介紹 FreeBSD 開機流程並說明如何使用設定選項控制開機流程。 - - - - - - - - 介紹許多可讓您的 FreeBSD 系統更安全的各種工具,包含 Kerberos, IPsec 及 OpenSSH。 - - - - - - - - 介紹 Jail Framework,以及 Jail 改進那些 FreeBSD 傳統 chroot 不足的地方。 - - - - - - - - 說明什麼是強制存取控制 (Mandatory Access Control, MAC) 及這個機制如何用來確保 FreeBSD 系統的安全。 - - - - - - - - 介紹什麼事 FreeBSD 事件稽查,如何安裝與設定,以及如何檢查與監控稽查線索。 - - - - - - - - 介紹如何在 FreeBSD 管理儲存媒體及檔案系統,這包含了實體磁碟、RAID 陣列、光碟與磁帶媒體、記憶體為基礎的磁碟以及網路檔案系統。 - - - - - - - - 介紹在 FreeBSD 中的 GEOM Framework 是什麼,以及如何設定各種支援的 RAID 階層。 - - - - - - - - 查看 FreeBSD 還支援那些非原生檔案系統,如 Sun 的 Z 檔案系統。 - - - - - - - - 介紹虛擬化系統提供了那些功能,以及如何在 FreeBSD 上使用。 - - - - - - - - 介紹如何在 FreeBSD 使用非英文的語言,這涵蓋了系統及應用層的在地化。 - - - - - - - - 說明 FreeBSD-STABLE、FreeBSD-CURRENT 以及 FreeBSD 發佈版之間的差異,並介紹那些使用者適何追蹤開發系統以及程序的概述,這涵蓋了使用者更新系統到最新安全性發佈版本的方法。 - - - - - - - - 介紹如何在 FreeBSD 設定及使用 Sun 的 DTrace 工具,動態追蹤可以透過執行真實時間系統分析來協助定位效能問題。 - - - - - - - - - - 介紹如何使用撥入及撥出連線到您的 FreeBSD 系統的終端機與數據機。 - - - - - - - - 介紹如何在 FreeBSD 使用 PPP 來連線遠端的系統。 - - - - - - - - 說明組成電子郵件伺服器的各種元件,並深入說明如何設定最熱門的郵件伺服器軟體:sendmail - - - - - - - - 提供詳細的操作說明與範例設定檔,讓您可安裝您的 FreeBSD 機器為網路檔案伺服器、網域名稱伺服器、網路資訊系統伺服器或時間同步伺服器。 - - - - - - - - 說明軟體為基礎的防火牆背後的理念,並提供可用於 FreeBSD 中不同的防火牆設定的詳細資訊。 - - - - - - - - 介紹許多網路主題,包含在您的區域網路 (LAN) 分享網際網路連線給其他電腦、進階路由主題、無線網路、Bluetooth、ATM、IPv6 以及更多相關主題。 - - - - - - - - - - 列出取得 FreeBSD CDROM 或 DVD 媒體的各種來源,以及在網際網路上的各種網站,讓您可以下載並安裝 FreeBSD。 - - - - - - - - 本書觸及許多不同主題,可能會讓您想更深入的了解,參考書目列出了在文中引用的許多優秀書籍。 - - - - - - - - 介紹了可讓 FreeBSD 使用者提出問題以及參與有關 FreeBSD 技術會談的許多論壇。 - - - - - - - - 列出了數個 FreeBSD 開發人員的 PGP 指紋。 - - - - - 本書的編排體裁 - - 為了提供有一致性且易於閱讀的內容,以下是一些本書所遵循的編排體裁。 - - 文字編排體裁 - - - - 斜體字 - - - 斜體字用於:檔名、目錄、網址 (URL)、 強調語氣、以及第一次提及的技術詞彙。 - - - - - 等寬字 - - - 等寬字用於: 錯誤訊息、指令、環境變數、Port 名稱、主機名稱、帳號、群組、裝置名稱、變數、程式碼等。 - - - - - 粗體字 - - - 粗體字表示:應用程式、指令、按鍵。 - - - - - - 使用者輸入 - - 鍵盤輸入以粗體字表示,以便與一般文字做區隔。 組合鍵是指同時按下一些按鍵,我們以 `+' 來表示連接,像是: - - - - Ctrl - Alt - Del - - 是說,一起按 CtrlAlt 以及 Del 鍵。 - - 若要逐一按鍵,那麼會以逗號 (,) 來表示,像是: - - - - Ctrl - X - , - - Ctrl - S - - 是說:先同時按下 CtrlX 鍵, 然後放開後再同時按 CtrlS 鍵。 - - - 範例 - - 範例以 C:\> 為開頭代表 MS-DOS 的指令。 若沒有特殊情況的話,這些指令應該是在 Microsoft Windows 環境的 指令提示字元 (Command Prompt) 視窗內執行。 - - E:\> tools\fdimage floppies\kern.flp A: - - 範例以 # 為開頭代表在 FreeBSD 中以超級使用者權限來執行的指令。 你可以先以 root 登入系統並下指令,或是以你自己的帳號登入再使用 su1 來取得超級使用者權限。 - - # dd if=kern.flp of=/dev/fd0 - - 範例以 % 為開頭代表在 FreeBSD 中以一般使用者帳號執行的指令。 除非有提到其他用法,否則都是預設為 C-shell 語法,用來設定環境變數以及下其他指令的意思。 - - % top - - 銘謝 - - 您所看到的這本書是經過數百個分散在世界各地的人所努力而來的結果。 無論他們只是糾正一些錯誤或提交完整的章節,所有的點滴貢獻都是非常寶貴有用的。 - - 也有一些公司透過提供資金讓作者專注於撰稿、提供出版資金等模式來支持文件的寫作。 其中,BSDi (之後併入 Wind River Systems) 資助 FreeBSD 文件計劃成員來專職改善這本書直到 2000 年 3 月第一版的出版。(ISBN 1-57176-241-8) Wind River Systems 同時資助其他作者來對輸出架構做很多改進,以及給文章增加一些附加章節。這項工作結束於 2001 年 11 月第二版。(ISBN 1-57176-303-1) 在 2003-2004 兩年中,FreeBSD Mall, Inc 把報酬支付給改進這本手冊以使第三版印刷版本能夠出版的志工。 - - - - - - 入門 - - - 這部份是提供給初次使用 FreeBSD 的使用者和系統管理者。 這些章節包括: - - - - 介紹 FreeBSD 給您。 - - - - 在安裝過程給您指引。 - - - - 教您 UNIX 的基礎及原理。 - - - - 展示給您看如何安裝豐富的 FreeBSD 的應用軟體。 - - - - 向您介紹 X,UNIX 的視窗系統以及詳細的桌面環境設定,讓您更有生產力。 - - - - 我們試著儘可能的讓這段文字的參考連結數目降到最低,讓您在讀使用手冊的這部份時可以不太需要常常前後翻頁。 - - - - - - - - 簡介 - - - - - Jim - Mock - - Restructured, reorganized, and parts rewritten - by - - - - - - 概述 - - 非常感謝您對 FreeBSD 感興趣!以下章節涵蓋 FreeBSD 計劃的各方面:比如它的歷史、目標、開發模式等等。 - - 讀完這章,您將了解: - - - - FreeBSD 與其他作業系統之間的關係。 - - - - FreeBSD 計劃的歷史。 - - - - FreeBSD 計劃的目標。 - - - - FreeBSD 開源開發模式的基礎概念。 - - - - 當然囉,還有 FreeBSD 這名字的由來。 - - - - - - 歡迎使用 FreeBSD! - - 4.4BSD-Lite - - FreeBSD 是一套開源、符合標準的類 Unix 的作業系統,適用於 x86 (32 與 64 位元), ARM, AArch64, RISC-V, MIPS, POWER, PowerPC 以及 Sun UltraSPARC 的電腦。它提供了現代作業系統所應具備的所有功能,例如:先佔式多工、記憶體保護、虛擬記憶體、多使用者架構、對稱多工處理 (SMP)、各種針對不同語言和框架的開源開發工具以及以 X Window 系統、KDE 及 GNOME 為主的桌面功能,而它有以下優勢: - - - - 自由的開放原始碼授權,授予您自由修改和擴充其原始碼並將其合併到開放原始碼專案或封閉的產品中的權力,不會對 Copyleft 授權施加典型的限制,也避免了授權不相容的潛在問題。 - - - - 強大的 TCP/IP 網路 TCP/IP - networking - FreeBSD 以工業標準實作通訊協定並不斷改善效能與擴展性,這使得 FreeBSD 非常適合應用在伺服器、路由器/防火牆的角色 - 這也是許多公司和供應商使用它的原因。 - - - - 完全整合 OpenZFS,包含 root-on-ZFS、ZFS 開機環境、故障管理、委託管理、對 Jail 的支援、FreeBSD 專屬的文件以及系統安裝程式的支援。 - - - - 鉅細靡遺的安全性功能,從強制存取控制 (Mandatory Access Control, MAC) 框架到 Capsicum 功能以及沙盒機制。 - - - - 超過 3 萬個預編的套件供所有支援的架構以及可簡單編譯依您的需求所客製的 Port 套件集。 - - - - 說明文件 - 除了操作手冊及由許多作者著作從系統管理到核心內部主題的書籍外,也有不僅只針對 Userspace Daemon、工具及設定檔,同樣也有針對核心驅動程式 APIs (第 9 節) 及各別驅動程式 (第 4 節) 的操作說明頁 ( man1 page)。 - - - - 簡單且具一致性的檔案庫架構與編譯系統 - FreeBSD 對所有的元件、核心與 Userspace 使用單一的檔案庫,加上統一、易於客製的編譯系統以及嚴謹的開發流程,讓 FreeBSD 的編譯基礎架構更容易與您產品的整合。 - - - - 忠於 Unix 哲學,偏好可組合而非具寫死的 多合一 單一 Daemon。 - - - - binary compatibility - Linux Linux 執行檔 (Binary) 相容性,無需虛擬化即可執行許多 Linux 執行檔。 - - - - FreeBSD 系統是基於美國加州大學柏克萊分校的電腦系統研究組 (Computer Systems Research Group 也就是 CSRG) 所發行的 4.4BSD-Lite - 4.4BSD-Lite - ,繼承了 BSD 系統開發的優良傳統。 除了由 CSRG 所提供的高品質的成果外,FreeBSD 計劃也投入了上千人時在擴充及微調,來讓系統在真實情境下能達到最大的效能與可靠性。 FreeBSD 提供了其他開源與商業產品的效能及穩定性,並結合其他產品所沒有的尖端功能。 - - - FreeBSD 能做什麼? - - FreeBSD 能應用的情境完全限制在你的想像力上。 從軟體開發到工廠自動化,庫存管控到遠程衛星天線的方位角校正;若您的需求可以用商用的 UNIX 產品來達成,那麼極有可能使用 FreeBSD 也能辦到! FreeBSD 也受益於來自於全球各研究中心及大學所開發的數千個高品質的軟體 ,這些通常只需要花費很少的費用或根本就是免費的。 - - 由於每個人都可以取得 FreeBSD 的原始程式碼, 這個系統可以被量身訂做成能執行任何原本完全無法想像的功能或計劃, 而對於從各廠商取得的作業系統通常沒有辦法這樣地被修改。 以下提供一些人們使用 FreeBSD 的例子: - - - - 網際網路服務: FreeBSD 內建強勁的網路功能使它成為網路服務 (如下例) 的理想平台: - - - - 網頁伺服器 - - - - IPv4 及 IPv6 路由 - - - - 防火牆 - firewall - 以及 NAT - NAT - (IP 偽裝) 通訊閘 - - - - 檔案傳輸協定伺服器 - FTP servers - - - - - - electronic mail - email - - email - 電子郵件伺服器 - - - - 還有更多... - - - - - - 教育:您是電腦科學相關領域的學生嗎?再也沒有比使用 FreeBSD 能學到更多作業系統、計算機結構、及網路的方法了。其中許多免費提供的 CAD,數學和圖形設計套件對於那些需要在電腦完成 其他 工作的人也非常有用! - - - - 研究:有了完整的原始程式碼,FreeBSD 是研究作業系統及電腦科學的極佳環境。 具有免費且自由取得特性的 FreeBSD 也使得一個分置兩地的合作計劃,不必擔心版權及系統開放性的問題, 而能自在的交流。 - - - - 網路: 你如果需要 路由器 - router - 、名稱伺服器 (DNS) - DNS Server - 或安全的防火牆, FreeBSD 可以輕易的將你沒有用到的 386 或 486 PC 變身成為絕佳的伺服器,甚至具有過濾封包的功能。 - - - - 嵌入式: FreeBSD 是一套可用來建立嵌入式系統的傑出平台。 - embedded - 支援 ARM, MIPS 以及 PowerPC 平台,再加上健全的網路環境、尖端的功能以及自由的 BSD 授權條款,FreeBSD 成為用來建置嵌入式路由器、防火牆及其他裝置的絕佳基礎。 - - - - - X Window System - - GNOME - - KDE - 桌面: FreeBSD 同時也是低成本桌面解決方案中不錯的選擇,使用了免費的 X11 伺服器。FreeBSD 提供許多開源桌面環境可選擇,包含了標準 GNOMEKDE 圖型化使用者介面。FreeBSD 甚至可以透過中央伺服器做 無磁碟 開機,讓個人工作站變的更便宜、更易於管理。 - - - - 軟體開發: 基本安裝的 FreeBSD 就包含了完整的程式開發工具,如 C/C++ - Compiler - 編譯器及除錯器。 透過 Port 與套件管理系統也可支援需多其他語言。 - - - - 你可以經由燒錄 CD-ROM、DVD 或是從 FTP 站上抓回 FreeBSD。 詳情請參閱 取得 FreeBSD。 - - - - 誰在用 FreeBSD? - - 使用者 執行 FreeBSD 的大型站台 - - FreeBSD 以其網頁 (Web) 服務功能而聞名 - 在 FreeBSD 上運作的網站包括 Hacker News, Netcraft, NetEase, Netflix, Sina, Sony Japan, Rambler, Yahoo! 及 Yandex。 - - FreeBSD 先進的功能、成熟的安全性、可預測的發佈週期以及自由的授權條款,讓 FreeBSD 已經被用來做為建立許多商業、開源應用、裝置以及產品的平台,有許多世界上最大的資訊公司使用 FreeBSD: - - - - - Apache - Apache - - Apache 軟體基金會中大部分面對大眾的基礎設施,包括可能是世界上最大的 SVN 檔案庫 (擁有超過 140 萬次提交) 都是在 FreeBSD 上運作。 - - - - Apple - Apple - - OS X 大量借鑒 FreeBSD 的網路 Stack、虛擬檔案系統以及許多使用者空間的元件。Apple iOS 中含有從 FreeBSD 借鑒來的元素。 - - - - Cisco - Cisco - - IronPort 網路安全及反垃圾郵件設備是採用改良後 FreeBSD 核心來運作。 - - - - Citrix - Citrix - - 安全設備的 NetScaler 產品線提供的第 4-7 層的負載均衡、內容快取、應用層防火牆、安全的 VPN 以及行動雲端網路存取,皆運用了 FreeBSD Shell 強大的功能。 - - - - Dell EMC Isilon - Isilon - - Isilon 的企業存儲設備是以 FreeBSD 為基礎。非常自由的 FreeBSD 授權條款讓 Isilon 整合了它們的智慧財產到整個核心,並專注打造自己的產品,而不是一個作業系統。 - - - - Quest KACE - Quest KACE - - KACE 系統管理設備中運作了 FreeBSD,是因為 FreeBSD 的可靠性、可擴展性以及支持其持續發展的社群。 - - - - iXsystems - iXsystems - - 統合存儲 (Unified Storage) 設備的 TrueNAS 產品線是以 FreeBSD 為基礎。除了該公司自己的商業產品外,iXsystems 也管理著 TrueOS 和 FreeNAS 兩個開源計劃的開發。 - - - - Juniper - Juniper - - JunOS 作業系統驅動了所有的 Juniper 網絡設備 (包括路由器,交換器,安全與網絡設備) 便是以 FreeBSD 為基礎。Juniper 在眾多廠商之中,展現了計劃與商業產品供應商之間的共生關係。由 Juniper 所開發的改進內容會回饋給 FreeBSD 來降低未來新功能從 FreeBSD 整合回 JunOS 的複雜性。 - - - - McAfee - McAfee - - SecurOS 是 McAfee 企業防火牆產品的基礎,其中包含了 Sidewinder ,也是以 FreeBSD 為基礎。 - - - - NetApp - NetApp - - 存儲設備中的 Data ONTAP GX 產品線是以 FreeBSD 為基礎。除此之外,NetApp 還貢獻了回 FreeBSD 許多功能,包括新 BSD 條款授權的 hypervisor, bhyve。 - - - - Netflix - Netflix - - Netflix 用來以串流傳送電影到客戶的 OpenConnect 設備是以 FreeBSD 為基礎。 Netflix 也做了大量貢獻到程式碼庫,並致力於維持與主線 FreeBSD 的零修正關係。Netflix 的 OpenConnect 設備負責了北美所有的網路流量 32% 以上。 - - - - Sandvine - Sandvine - - Sandvine 使用 FreeBSD 作為它的高性能即時網路處理平台的基礎來建立它們的智慧網路策略控制產品。 - - - - Sony - Sony - - PlayStation 4 遊戲主機使用了修改過的 FreeBSD 版本來運作。 - - - - Sophos - Sophos - - Sophos 電子郵件設備產品是以加強防護 (Hardened) 的 FreeBSD 為基礎,可掃描入站郵件中的垃圾郵件和病毒,同時也可監控出站郵件中的惡意軟體及敏感資訊。 - - - - Spectra Logic - Spectra Logic - - 儲藏級儲存設備的 nTier 產品線以 FreeBSD 和 OpenZFS 來運作。 - - - - Stormshield - Stormshield - - - Stormshield 網路安全設備使用了硬體化版本的 FreeBSD 做為基礎,BSD 授權條款讓他們可將其智慧財產與系統整合並同時回饋大量有趣的發展給社群。 - - - - The Weather Channel - The Weather Channel - - - 被安裝在各地有線電視營運商前端,負責加入當地天氣預報到有線電視網路節目的 IntelliStar 設備便是使用 FreeBSD。 - - - - Verisign - Verisign - - - VeriSign 主要經營 .com 與 .net 根網域名稱註冊業務以及隨附的 DNS 基礎設施運作。這些基礎設施的運作仰賴各種不同的網路作業系統包括 FreeBSD 來確保不會有單點故障的問題。 - - - - Voxer - Voxer - - - Voxer 使用了 FreeBSD 的 ZFS 來驅動行動語音通訊平台,讓 Voxer 從 Solaris 改使用 FreeBSD 的原因是 FreeBSD 擁有詳盡的文件、更大型且活躍的社群、較便利的開發人員環境。除了提供關鍵的 ZFS 和 DTrace 功能之外 FreeBSD 的 ZFS 也支援了 TRIM。 - - - - WhatsApp - WhatsApp - - 當 WhatsApp 面臨需要一個每台伺服器能夠同時處理超過 100 萬個 TCP 連線的平台時,它們選擇了 FreeBSD。它們接著擴大規模到每台伺服器處理超過 250 萬的連線。 - - - - Wheel Systems - Wheel Systems - - - FUDO 安全性設備讓企業可以監控、控制、記錄以及稽查在其系統中作業的承包商與管理員。這些功能皆是以 FreeBSD 最佳的安全性功能為基礎,包括 ZFS, GELI, Capsicum, HAST 及 auditdistd。 - - - - FreeBSD 也催生了數個相關的開源計劃: - - - - BSD Router - BSD Router - - 以 FreeBSD 為基礎的大型企業路由器替代方案,專門設計為可在標準 PC 硬體上運作。 - - - - FreeNAS - FreeNAS - - 專為網路檔案伺服器設備使用所設計的 FreeBSD。提供了以 Python 為基礎的網頁介面來簡化 UFS 與 ZFS 檔案系統的管理,支援了 NFS、SMB/ CIFS、AFP、FTP 與 iSCSI,還有以 FreeBSD Jail 為基礎的套件系統。 - - - - GhostBSD - GhostBSD - - 採用 Gnome 桌面環境的 FreeBSD 發行版。 - - - - mfsBSD - mfsBSD - - 用來建置可完全從記憶體執行 FreeBSD 系統映像檔工具。 - - - - NAS4Free - NAS4Free - - 以 FreeBSD 及 PHP 驅動網頁介面為基礎的檔案伺服器。 - - - - OPNSense - OPNsense - - OPNsense 是一個以 FreeBSD 為基礎的開源、易於使用及易於建置的防火牆和路由平台。OPNsense 有大多數在昂貴的商業防火牆上才有的功能。它帶來了商業產品的豐富功能集,同時擁有開放和安全的來源。 - - - - TrueOS - TrueOS - - 訂製版本的 FreeBSD,裝備了給桌面使用者使用的圖型化工具來展示 FreeBSD 強大的功能給所有使用者,專門設計來緩解使用者在 Windows 與 OS X 間的過渡。 - - - - pfSense - pfSense - - 以 FreeBSD 為基礎的防火牆發行版,支援巨型陣列及大規模 IPv6。 - - - - ZRouter - ZRouter - - 嵌入式裝置韌體的開源替代方案,以 FreeBSD 為基礎,專門設計來取代現成路由器上的專用韌體。 - - - - 在 FreeBSD 基金會網站上可以找到以 FreeBSD 為基礎的產品與服務的公司的推薦 清單。 Wikipedia 也維護了一份以 FreeBSD 為基礎的產品清單。 - - - - - - 關於 FreeBSD 計劃 - - 接下來講的是 FreeBSD 計劃的背景,包含歷史、計劃目標以及開發模式。 - - - FreeBSD 歷史簡介 - - 386BSD Patchkit - Hubbard, Jordan - Williams, Nate - Grimes, Rod - - FreeBSD Project - history - - - FreeBSD 計畫起源於 1993 年初, 那是源自於維護一組『非官方 386BSD 修正工具』計劃的最後三個協調人 Nate Williams,Rod Grimes 和 Jordan Hubbard。 - - 386BSD - 最初的目標是做出一份 386BSD 的中間版本的快照 (Snapshot) 來修正使用修正工具 (Patchkit) 機制無法解決的數個問題,也因此早期的計劃名稱叫做 386BSD 0.5 或 386BSD Interim 便是這個原因。 - - Jolitz, Bill - 386BSD 是 Bill Jolitz 的作業系統,在當時就已經忍受了將近一年的忽視,隨著修正工具日漸龐大的令人不舒服,他們決定提供一份過渡性的 簡潔 快照來幫助 Bill。 然而,由於 Bill Jolitz 忽然決定取消其對該計劃的認可,且沒有明確指出未來的打算,所以該計劃便突然面臨中止。 - - Greenman, David - Walnut Creek CDROM - - 這三人認為這個目標即始沒有 Bill 的支持仍有保留的價值,最後他們採用 David Greenman 丟銅板決定的名字,也就是 "FreeBSD"。在詢問了當時的一些使用者意見之後決定了最初的目標,隨著目標越來越明確便開始著手進行。Jordan 找了 Walnut Creek CD-ROM 商討,著眼於如何改進 FreeBSD 的發行通路,讓那些不便上網的人可簡單的取得。 Walnut Creek CD-ROM 不只贊成以 CD 來發行 FreeBSD 的想法,同時提供了一台機器以及快速的網路。 若不是 Walnut Creek CD-ROM 在那個時間上史無前例的信任,這個默默無名的計劃很可能不會成為現在的 FreeBSD 快速的成長到今日這樣的規模。 - - 4.3BSD-Lite - Net/2 - U.C. Berkeley - 386BSD - Free Software - Foundation - 第一張以 CD-ROM (及網路) 發行的版本為 FreeBSD 1.0,是在 1993 年十二月發佈。 該版本採用了 U.C. Berkeley 以磁帶方式發行的 4.3BSD-Lite (Net/2) 及許多來自於 386BSD 和自由軟體基金會的元件為基礎。對於第一次發行而言還算成功,我們又接著於 1994 年 5 月發行了相當成功的 FreeBSD 1.1。 - - Novell - U.C. Berkeley - Net/2 - AT&T - 然而此後不久,另一個意外的風暴在 Novell 與 U.C. Berkeley 關於 Berkeley Net/2 磁帶之法律地位的訴訟確定之後形成。 U.C. Berkeley 承認大部份的 Net/2 的程式碼都是侵佔來的且是屬於 Novell 的財產 -- 事實上是當時不久前從 AT&T 取得的。 Berkeley 得到的是 Novell 對於 4.4BSD-Lite 的祝福,最後當 4.4BSD-Lite 終於發行之後,便不再是侵佔行為。 而所有現有 Net/2 使用者都被強烈建議更換新版本,這包括了 FreeBSD。 於是,我們被要求於 1994 年 6 月底前停止散佈以 Net/2 為基礎的產品。在此前提之下,本計劃被允許在期限以前作最後一次發行,也就是 FreeBSD 1.1.5.1。 - - FreeBSD 便開始了這宛如『重新發明輪子』的艱鉅工作 -- 從全新的且不完整的 4.4BSD-Lite 重新整合。 這個 Lite 版本是不完整的,因為 Berkeley 的 CSRG 已經刪除了大量在建立一個可以開機執行的系統所需要的程式碼 (基於若干法律上的要求),且該版本在 Intel 平台的移植是非常不完整的。 直到 1994 年 11 月本計劃才完成了這個轉移, 同時在該年 12 月底以 CD-ROM 以及網路的形式發行了 FreeBSD 2.0。 雖然該份版本在當時有點匆促粗糙,但仍是富有意義的成功。 隨之於 1995 年 6 月又發行了更容易安裝,更好的 FreeBSD 2.0.5。 - - 自那時以來,FreeBSD 在每一次對先前版本改進穩定性、速度及功能時便會發佈一個新的發佈版本。 - - 目前,長期的開發計畫繼續在 10.X-CURRENT (trunk) 分支中進行,而 10.X 的快照 (Snapshot) 版本可以在 快照伺服器 取得。 - - - - - FreeBSD 計劃目標 - - - - - Jordan - Hubbard - - Contributed by - - - - - FreeBSD 計劃 目標 - FreeBSD 計劃的目標在於提供可作任意用途的軟體而不附帶任何限制條文。 我們之中許多人對程式碼 (以及計畫本身) 都有非常大的投入, 因此,當然不介意偶爾有一些資金上的補償,但我們並沒打算堅決地要求得到這類資助。 我們認為我們的首要使命是為任何人提供程式碼, 不管他們打算用這些程式碼做什麼, 因為這樣程式碼將能夠被更廣泛地使用,從而發揮其價值。 我認為這是自由軟體最基本的,同時也是我們所倡導的一個目標。 - - GNU 通用公共授權條款 (GPL) - GNU 較寬鬆通用公共授權條款 (LGPL) - BSD 版權 - 我們程式碼樹中,有若干是以 GNU 通用公共授權條款 (GPL) 或者 GNU 較寬鬆通用公共授權條款 (LGPL) 發佈的那些程式碼帶有少許的附加限制,還好只是強制性的要求開放程式碼而不是別的。 由於使用 GPL 的軟體在商業用途上會增加若干複雜性,因此,如果可以選擇的話, 我們會比較喜歡使用限制相對更寬鬆的 BSD 版權來發佈軟體。 - - - - - FreeBSD 開發模式 - - - - - Satoshi - Asami - - Contributed by - - - - - FreeBSD 專案 開發模式 - - FreeBSD 的開發是一個非常開放且具彈性的過程,就像從 貢獻者名單 所看到的,是由全世界成千上萬的貢獻者發展起來的。 FreeBSD 的開發基礎架構允許數以百計的開發者透過網際網路協同工作。 我們也經常關注著那些對我們的計畫感興趣的新開發者和新的創意, 那些有興趣更進一步參與計劃的人只需要在 FreeBSD 技術討論郵遞論壇 連繫我們。 FreeBSD 公告郵遞論壇 對那些希望了解我們進度的人也是相當有用的。 - - 無論是單獨開發者或者封閉式的團隊合作,多瞭解 FreeBSD 計劃和它的開發過程會是不錯的: - - - - SVN 檔案庫 - - - - CVS - - CVS Repository - - Concurrent Versions System - CVS - - Subversion - - Subversion Repository - - SVN - Subversion - 過去數年來 FreeBSD 的中央原始碼樹 (Source tree) 一直是以 CVS (Concurrent Versions System) 來維護的, 它是一套免費的原始碼控管工具。 從 2008 年 6 月起, FreeBSD 計劃開始改用 SVN (Subversion)。 這是一個必要的更換動作,因為隨著原始碼樹及歷史版本儲存的數量不斷快速擴張,CVS 先天的技術限制越來越明顯。 文件計劃與 Port 套件集檔案庫也同樣於 2012 年 5 月及 2012 年 7 月由 CVS 改為 SVN。請參考 同步您的原始碼樹 一節來取得有關如何取得 FreeBSD src/ 檔案庫的更多資訊,以及 使用 Port 套件集 了解如何取得 FreeBSD Port 套件集。 - - - - - 提交者名單 - - - 所謂的 提交者 (Committer) 指的是對 Subversion 原始碼樹有 寫入 權限的人, 並且被授予修改 FreeBSD 原始碼的權限。 (committer 一詞源自版本管理系統中的 commit 指令,該指令是用來把新的修改提交給檔案庫)。 任何人都可以回報問題到 Bug Database,在回報問題之前,可以使用 FreeBSD 郵遞清單、IRC 頻道或論壇來確認問題真的是一個錯誤 (Bug)。 - - - - - FreeBSD 核心團隊 - - - 如果把 FreeBSD 看成是一家公司的話, FreeBSD 核心團隊 (FreeBSD core team) - core team - 就相當於公司的董事會。 核心團隊的主要職責在於確保此計劃的整體有良好的架構,以朝著正確的方向發展。 此外,邀請敬業且負責的開發者加入提交者的行列也是核心團隊的職責之一,隨著其他新成員的加入也招募新的核心團隊成員。 目前的核心團隊是在 2018 年 7 月從提交者候選人之中選出來的,這個選舉每兩年會舉辦一次。 - - - 如同多數的開發者,核心團隊大部分成員加入 FreeBSD 開發都是志工性質而已, 並未從本計劃中獲得任何薪酬,所以這只是一個 承諾 不應該被誤解為 保證支援 才對。 前面用 董事會 來舉例可能不是很恰當,或許我們應該說: 他們是一群自願放棄原本的優渥生活、個人其他領域成就, 而選擇投入 FreeBSD 開發的熱血有為者才對! - - - - - - 非官方貢獻者 - - - 最後一點,但這點絕非最不重要的, 最大的開發者團隊就是持續為我們提供回饋以及錯誤修正的使用者自己。 與 FreeBSD 非核心開發者互動的主要方式,便是透過訂閱 FreeBSD 技術討論郵遞論壇 來進行溝通,這方面可參考,請參閱 以瞭解各式不同的 FreeBSD 郵遞論壇。 - - FreeBSD 貢獻者名單 - contributors - 相當長且不斷成長中, 只要有貢獻就會被列入其中, 要不要立即考慮貢獻 FreeBSD 一些回饋呢? - - 提供原始碼並非為這個計劃做貢獻的唯一方式; 需要大家投入的完整工作清單請參閱 FreeBSD 計畫網站。 - - - - - 總而言之,我們的開發模式像是由鬆散的同心圓所組織。這個集中模式的設計為的是讓 FreeBSD 的使用者更便利,可以很容易的追蹤同一個中央的程式庫,避免把潛在的貢獻者排除在外!而我們的目標是提供一個穩定的作業系統,並有大量相關的 應用程式,讓使用者能夠輕鬆的安裝與使用 — 而這個開發模式對我們要完成這個目標來說運作的非常好。 - - 我們對於那些想要加入 FreeBSD 開發者的期待是: 請保持如同前人一樣的投入,以確保繼續成功! - - - - 第三方程式 - - 除了基礎發行版之外,FreeBSD 提供了擁有上千個常用的程式的移植軟體的套件集,在撰寫本文的同時,已有超過 24,000 個 Port!Port 的範圍從 HTTP 伺服器到遊戲、語系、編輯器,幾乎所有東西都在裡面。完整的 Port 套件集需要將近 500 MB。要編譯一個 Port 您只需要切換目錄到您想安裝的程式目錄,然後輸入 make install,接著系統便會處理剩下的動作。您編譯的每個 Port 完整原始發行版內容是動態下載的,所以您只需要有足夠的磁碟空間來編譯您想要的 Port。幾乎所有 Port 都提供已經預先編譯好的套件,您可以透過簡單的指令來安裝 (pkg install),提供那些不想要自行從原始碼編譯的人使用。更多有關套件與 Port 的資訊可於 取得。 - - - - 其他文件 - - 所有支援的 FreeBSD 版本都會在安裝程式中提供一個選項,讓您可以在初始化系統安裝的階段安裝額外的說明文件到 /usr/local/share/doc/freebsd。說明文件也可在往後隨時使用套件安裝,詳細說明於 。您也可以使用任何支援 HTML 的瀏覽器進入下列 URL 檢視已安裝在本機的手冊: - - - - FreeBSD 使用手冊 - - - /usr/local/share/doc/freebsd/handbook/index.html - - - - - FreeBSD 常見問答集 - - - /usr/local/share/doc/freebsd/faq/index.html - - - - - 此外,可在下列網址找到最新版 (也是更新最頻繁的版本):https://www.FreeBSD.org/ - - - - - - - - - - - 安裝 FreeBSD - - - - - Jim - Mock - - - Restructured, reorganized, and parts rewritten - by - - - - - - - - - Gavin - Atkinson - - - Updated for bsdinstall by - - - - - Warren - Block - - - - - - - - Allan - Jude - - - Updated for root-on-ZFS by - - - - - - 概述 - - 安裝 - - 有多種不同的方法可以執行 FreeBSD,根據所在環境,包含: - - - - 一般虛擬機映像檔,可下載並匯入到您所選擇的虛擬環境。映像檔可從 Download FreeBSD 頁面下載,KVM (qcow2), VMWare (vmdk), Hyper-V (vhd) 及原始裝置的映像檔都支援。這些並非安裝程式的映像檔,而是已經預先設定好 (已安裝好) 的實例,可直接使用並執行安裝後的作業。 - - - - 託管服務虛擬機映像檔,可在 Amazon 的 AWS Marketplace, Microsoft Azure Marketplace 和 Google Cloud Platform 等託管服務上運行的虛擬機映像檔。有關如何在 Azure 上部署 FreeBSD 的資訊可查詢 Azure 說明文件中的相關章節。 - - - - SD 卡映像檔,供嵌入式系統,如 Raspberry Pi 或 BeagleBone Black 使用的映像檔,可從 Download FreeBSD 頁面下載,這些檔案必須先解壓縮後以原始映像檔的格式寫入 SD 卡以讓這些開發電路板能夠啟動。 - - - - 安裝程式映像檔,用來安裝 FreeBSD 到硬碟,供一般的桌機、筆電或伺服器系統使用。 - - - - 此章接下來的部份會介紹第四個案例,說明如何使用文字介面為基礎的安裝程式 bsdinstall 安裝 FreeBSD。 - - 一般來說,本章所寫的安裝說明是針對 i386AMD64 架構。如果可以用於其他平台,將會列表說明。 安裝程式和本章所敘述的內容可能會有些微差異,所以請將本章視為通用的指引,而不是完全照著來做。 - - - 喜歡用圖形化安裝程式安裝 FreeBSD 的使用者, 可能會對 pc-sysinstall 有興趣,這是 TrueOS 計畫所使用的。 他可以用來安裝圖形化桌面 (TrueOS) 或是指令列版本的 FreeBSD。 細節請參考 TrueOS 使用者 Handbook (https://www.trueos.org/handbook/trueos.html)。 - - - 讀完這章,您將了解: - - - - 最低的硬體需求和 FreeBSD 支援的架構。 - - - - 如何建立 FreeBSD 的安裝媒體。 - - - - 如何開始執行 bsdinstall - - - - bsdinstall 會詢問的問題,問題代表的意思,以及如何回答。 - - - - 安裝失敗時如何做故障排除。 - - - - 如何在正式安裝前使用 live 版本的 FreeBSD。 - - - - 在開始閱讀這章之前,您需要: - - - - 閱讀即將安裝的 FreeBSD 版本所附帶的硬體支援清單,並核對系統的硬體是否有支援。 - - - - - - 最低硬體需求 - - 安裝 FreeBSD 的硬體需求隨 FreeBSD 的版本和硬體架構而不同。 FreeBSD 發行版支援的硬體架構和裝置會列在 FreeBSD 發佈資訊 頁面。FreeBSD 下載頁面 -也有建議如何正確的選擇在不同架構使用的映像檔。 - - FreeBSD 安裝程序需要至少 96 MB 的 RAM 以及 1.5 GB 的硬碟空間。然而,如此少的記憶體及磁碟空間只適合在客製的應用上,如嵌入式設備。一般用途的桌面系統會需要更多的資源,2-4 GB RAM 與至少 8 GB 的硬碟空間是不錯的起點。 - - 每一種架構的處理器需求概述如下: - - - - amd64 - - 桌面電腦與筆記型電腦最常見的處理器類型,運用在近代的系統。Intel 稱該類型為 Intel64,其他製造商則稱該類型為 x86-64 - - 與 amd64 相容的處理器範例包含:AMD Athlon64, AMD Opteron, 多核心 Intel Xeon 以及 Intel Core 2 與之後的處理器。 - - - - - i386 - - 舊型的桌面電腦與筆記型電腦常使用此 32-bit, x86 架構。 - - 幾乎所有含浮點運算單元的 i386 相容處理器都有支援。所有 Intel 486 或是更高階的處理器也有支援。 - - FreeBSD 可在有支援實體位址延伸 (Physical Address Extensions, PAE) 功能的 CPU 上運用該功能所帶來的優點。有開啟 PAE 支援的核心會偵測超過 4 GB 的記憶體,並讓這些超過的記憶體能夠被系統使用。 但使用 PAE 會限制裝置驅動程式及 FreeBSD 的其他功能,詳情請見 pae4 - - - - - ia64 - - 目前支援的處理器是 ItaniumItanium 2。支援的晶片組包括 HP zx1, Intel 460GX 和 Intel E8870。 單處理器 (Uniprocessor, UP) 和對稱多處理器 (Symmetric Multi-processor, SMP) 的設定都有支援。 - - - - - powerpc - - 所有內建 USB 的 New World ROM Apple Mac 系統都有支援。 SMP 在多 CPU 的機器都有支援。 - - 32 位元的核心只能使用前 2 GB 的 RAM - - - - - sparc64 - - FreeBSD/sparc64 支援的系統列在 FreeBSD/sparc64 計劃。 - - 所有超過一個處理器的系統都有支援 SMP。需要專用的磁碟系統,因為此時無法和其他作業系統共用磁碟。 - - - - - - - 安裝前準備工作 - - 一旦確定系統符合安裝 FreeBSD 的最低硬體需求,就可以下載安裝檔案並準備安裝的媒體。 做這些之前,先檢查以下核對清單的項目是否準備好了: - - - - 備份重要資料 - - 安裝任何作業系統前, 總是 要先備份所有重要資料。 不要儲存備份在即將安裝的系統上,而是將資料儲存在可移除磁碟,像是 USB 隨身碟、網路上的另一個系統或是線上備份服務上。 開始安裝程序前要檢查備份,確定備份含有所有需要的檔案,一旦安裝程式格式化系統的磁碟,所有儲存在上面的資料都會遺失。 - - - - 決定 FreeBSD 安裝在哪裡 - - 如果 FreeBSD 是唯一一套要安裝到電腦的作業系統,這個步驟可以略過。 但是假如 FreeBSD 要和其他作業系統共用磁碟空間的話,就要決定 FreeBSD 要安裝在哪個磁碟或是哪個分割區 (Partition)。 - - 在 i386 和 amd64 架構,可將磁碟分割成多個分割區,可以選擇下列兩種分割表格式 (Partitioning scheme) 的其中一種達成。 傳統的主開機紀錄 (Master Boot Record, MBR) 的一個分割區表定義最多可有四個主分割區 (Primary partition),因一些歷史淵源,FreeBSD 稱這些主分割區為 slice,其中一個主分割區可作為延伸分割區 (Extended partition),延伸分割區又可分割成多個邏輯分割區 (Logical partition)。 GUID 分割區表 (GUID Partition Table, GPT) 是較新和較簡單的分割磁碟的方法,一般 GPT 實作允許每個磁碟多達 128 個分割區,不再需要使用邏輯分割區。 - - - 一些比較舊的作業系統,像是 Windows XP 並不相容 GPT 分割表格式。 如果 FreeBSD 將和這類作業系統共用一個磁碟,則需要用 MBR 分割表格式。 - - - FreeBSD 開機啟動程式需要主分割區或是 GPT 分割區。如果所有的主分割區或 GPT 分割區都已使用,必須釋放其中一個分割區讓 FreeBSD 使用。如果要建立一個分割區而不刪除原有的資料,可以使用磁碟重設大小的工具來縮小現有的分割區,並使用釋放出來的空間建立新分割區。 - - 各種免費和付費的磁碟重設大小工具列於 http://en.wikipedia.org/wiki/List_of_disk_partitioning_software。GParted Live (http://gparted.sourceforge.net/livecd.php) 是內含分割區編輯程式 GParted 的免費 Live CD。 GParted 同時也被許多 Linux Live CD 發行版所收錄。 - - - 在正確使用的情況下,磁碟重設大小的工具可以安全的建立讓新的分割區使用的空間。 但因仍有可能會誤選已經存在的分割區,所以在修改磁碟分割區前, 一定要備份重要資料,並確認備份的完整性。 - - - 在磁碟分割區中儲存不同的作業系統讓一台電腦可以安裝多個作業系統,另一種作法是使用虛擬化技術 () ,可讓多個作業系統同時間執行而不需要改變任何磁碟分割區。 - - - - 收集網路資訊 - - 部份 FreeBSD 安裝方式需要網路連線來下載安裝檔,因此之後的安裝程序,安裝程式進入設定系統網路的介面。 - - 如果網路中有 DHCP 伺服器,則可透過該伺服器自動設定網路,若無法使用 DHCP,則需要從區域網路管理者或是網際網路服務供應商 (Internet Service Provider, ISP) 取得以的網路資訊供系統使用: - - - 需要的網路資訊 - - - IP 位址 - - - - 子網路遮罩 - - - - 預設通訊閘 IP 位址 - - - - 網路的網域名稱 - - - - 網路 DNS 伺服器 IP 位址 - - - - - - 檢查 FreeBSD 勘誤表 - - 儘管 FreeBSD 計劃努力確保每個 FreeBSD 發行版能夠儘可能地穩定,但臭蟲偶爾還是會悄悄出現,並有極小的可能會發生影響安裝流程的錯誤,當這些問題被發現並修正後,會被紀錄在 FreeBSD 網站的 FreeBSD 勘誤表 (https://www.freebsd.org/releases/12.0R/errata.html)。 安裝前先檢查勘誤表,以確保沒有會影響到安裝的問題。 - - 所有發行版的資訊和勘誤表可以在 FreeBSD 網站的發行資訊找到 (https://www.freebsd.org/releases/index.html)。 - - - - - 準備安裝的媒體 - - FreeBSD 安裝程式並不是一個可以在其他作業系統上執行的應用程式,反而您需要下載 FreeBSD 安裝檔,燒錄安裝檔到符合其檔案類型與大小的媒體 (CD, DVDUSB),然後開機從插入的媒體來安裝。 - - FreeBSD 的安裝檔可於 www.freebsd.org/where.html#download 取得。安裝檔的名稱由 FreeBSD 發佈版本、架構、以及檔案類型所組成,舉例,要從 DVD 安裝 FreeBSD 10.2 到 amd64 的系統,需下載 FreeBSD-10.2-RELEASE-amd64-dvd1.iso,並燒錄這個檔案到 DVD,然後使用插入 DVD 來開機。 - - 安裝檔有許多種可用的格式,格式會依據電腦架構及媒體類型的不同而異。 - - 還有另一種安裝檔是給使用 UEFI (Unified Extensible Firmware Interface) 開機的電腦使用,這些安裝檔的名稱會含有 uefi - - 檔案類型: - - - - -bootonly.iso:這是最精簡的安裝檔,檔案中只含安裝程式。 安裝時需要網際網路連線來下載所需的檔案以完成 FreeBSD 安裝。這個檔案應使用 CD 燒錄應用程式燒錄到 CD 使用。 - - - - -disc1.iso:這個檔案含有所有安裝 FreeBSD 所需的檔案,包含原始碼及 Port 套件集。這個檔案應使用 CD 燒錄應用程式燒錄到 CD 使用。 - - - - -dvd1.iso:這個檔案含有所有安裝 FreeBSD 所需的檔案,包含原始碼及 Port 套件集,也內含熱門的 Binary 套件可安裝視窗管理程式以及一些應用程式,如此便可從媒體安裝完整的系統,無須連線到網際網路。這個檔案應使用 DVD 燒錄應用程式燒錄到 DVD 使用。 - - - - -memstick.img:這個檔案含有所有安裝 FreeBSD 所需的檔案,包含原始碼及 Port 套件集。這個檔案應依據以下操作指示寫入到 USB 隨身碟使用。 - - - - -mini-memstick.img:類似 -bootonly.iso,但不含安裝檔 (可依所要下載),安裝時需要網際網路連線,可依 的說明將此檔案寫入至 USB 隨身碟。 - - - - 映像檔下載完成之後,下載同一個目錄之中的 CHECKSUM.SHA256。FreeBSD 提供 sha2561 可用來計算映像檔的 校驗碼 (Checksum),使用方式為 sha256 imagefilename,其他作業系統也會有類似的程式。 - - 比對計算後的校驗碼與 CHECKSUM.SHA256 檔案中的值,校驗碼應該要完全相符,若校驗碼不相符,則代表該映像檔是損壞的,必須再下載一次。 - - - 寫入映象檔到 <acronym>USB</acronym> - - *.img 檔案是隨身碟的完整內容的映像檔 (image),該檔案不能直接用檔案的方式複製到目標裝置。有許多應用程式可用來寫入 *.imgUSB 隨身碟,本節會介紹其中兩種。 - - - 在繼續之前,請先備份 USB 上的重要資料,這個程序會清除在隨身碟上既有的資料。 - - - - 使用 <command>dd</command> 來寫入映像檔 - - - 本範例使用 /dev/da0 做為目標裝置,是映像檔將會寫入的位置。 務必十分小心確認要使用的裝置正確,因為這個指示會摧毀所有在指定目標裝置上已存在的資料。 - - - - dd1 指令列工具在 BSD, Linux 以及Mac OS 系統皆可使用。要使用 dd 燒錄映像檔需先插入 USB 隨身碟,然後確認隨身碟的裝置名稱。然後指定已下載的安裝檔名稱以及 USB 隨身碟的裝置名稱。本例示範在已有的 FreeBSD 系統燒錄 amd64 安裝映像檔到第一個 USB 裝置。 - - # dd if=FreeBSD-10.2-RELEASE-amd64-memstick.img of=/dev/da0 bs=1M conv=sync - - 若這個指示執行失敗,請確認 USB 隨身碟是否還未掛載,以及該裝置名稱是否指向這個隨身碟,而不是一個分割區。有些作業系統可能需要使用 sudo8 來執行這個指令。且 dd1 的指令語法在不同的作業系統上有些不同,例如在 Mac OS 需要使用小寫的 ,而在 Linux 這類的系統可能會暫存寫入動作,要強制完成所有寫入動作,需使用 sync8 - - - - - 使用 <trademark class="registered">Windows</trademark> 來寫入映象檔 - - - 務必確認指定的磁碟機代號正確,因在指定磁碟機上的既有資料將會被覆蓋與摧毀。 - - - - 取得 <application>Image Writer <trademark class="registered">Windows</trademark> 版</application> - - Image Writer Windows 是一個免費的應用程式,可以正確地將映像檔寫入隨身碟。可從 https://sourceforge.net/projects/win32diskimager/ 下載,並解壓縮到一個資料夾。 - - - - 用 Image Writer 寫入映象檔 - - 雙擊 Win32DiskImager 圖示啟動程式。 確認 Device 顯示的磁碟機代號是隨身碟的磁碟機代號。 按下資料夾圖示選擇要寫入隨身碟的映像檔。 按下 [ Save ] 按鈕確定映像檔名。 確認所有東西都正確,隨身碟的資料夾並沒有在其他視窗開啟。 所有東西準備好後,按下 [ Write ] 將映像檔寫入隨身碟。 - - - - 您現在可以開始安裝 FreeBSD 。 - - - - - - 開始安裝 - - - 預設安裝程序在下列訊息顯示之前不會對磁碟做任何更動: - - Your changes will now be written to disk. If you -have chosen to overwrite existing data, it will -be PERMANENTLY ERASED. Are you sure you want to -commit your changes? - - 在這個警告訊息之前可以隨時中止安裝,若有任何設定錯誤的疑慮,只需在此時關閉電腦,將不會對系統磁碟做任何更改。 - - - 本節將介紹如何使用根據 指示所準備的安裝媒體來開機。要使用可開機的 USB,請在開啟電腦前插入 USB 隨身碟。要使用 CDDVD,則可開啟電腦後在第一時間插入媒體。如何設定系統使用插入的媒體開機依不同的系統架構會有所不同。 - - - 在 <trademark>i386</trademark> 及 amd64 開機 - - 這兩種架構提供了 BIOS 選單可選擇開機的裝置,依據要使用的安裝媒體類型,選擇 CD/DVDUSB 裝置做為第一個開機裝置。大多數的系統也會提供快速鍵可在啟動時選擇開機裝置,而不需要進入BIOS,通常這個按鍵可能是 F10, F11, F12Escape 其中之一。 - - 若電腦仍載入了現有的作業系統,而不是 FreeBSD 安裝程式,原因可能為: - - - - 執行開機程序時安裝媒體插入主機的時間不夠早,請讓安裝媒體留在電腦中並重新啟動電腦。 - - - - 未正確修改 BIOS 或未儲檔,請再三檢查第一個開機裝置選擇了正確的裝置。 - - - - 系統太舊,無法支援使用選擇的開機媒體開機,發生這個情況可以使用 Plop Boot Manager () 來從選擇的開機媒體開機。 - - - - - - 在 <trademark class="registered">PowerPC</trademark> 開機 - - 在大部份機型,可於開機時按住鍵盤上的 C,便可從 CD 開機。若在非 Apple 的鍵盤則可按住 Command Option O F Windows Alt O F ,出現 0 > 提示時,輸入 - - boot cd:,\ppc\loader cd:0 - - - - 在 <trademark class="registered">SPARC64</trademark> 開機 - - 大多數 SPARC64 系統會自動從磁碟開機,要從 CD 安裝 FreeBSD 需要進入 PROM - - 要進入 PROM,需重新開機系統然後等候開機訊息出現。訊息會依機型而有所不同,但大致結果會如: - - Sun Blade 100 (UltraSPARC-IIe), Keyboard Present -Copyright 1998-2001 Sun Microsystems, Inc. All rights reserved. -OpenBoot 4.2, 128 MB memory installed, Serial #51090132. -Ethernet address 0:3:ba:b:92:d4, Host ID: 830b92d4. - - 若系統繼續從磁碟開機,此時按下鍵盤上的 L1AStopA 或透過序列 Console 送出 BREAK。當使用 tipcu, ~# 發出一個 BREAK 後,PROM 的提示會在單 CPU 的系統出現 okSMP 的系統出現 ok {0} ,其中的數字代表啟動的 CPU 數。 - - 此時,放入 CD 到磁碟機然後在 PROM 提示畫面輸入 boot cdrom - - - - FreeBSD 開機選單 - - 從安裝媒體開機之後,會顯示如下的選單: - -
- FreeBSD 開機載入程式選單 - - - - - - -
- - 預設在開機進入 FreeBSD 安裝程式前選單會等候使用者輸入 10 秒鐘,若已經安裝 FreeBSD,則會在開機進入 FreeBSD 前等候。要暫停開機計時器來仔細查看選項,請按 Space 鍵。要選擇選項,按下明顯標示的數字、字元或按鍵。選單有以下選項可選。 - - - - 啟動多使用者模式 (Boot Multi User):這個選項會繼續 FreeBSD 開機程序,若開機計時器已經暫停,可按 1、大寫或小寫 BEnter 鍵。 - - - - 啟動單使用者模式 (Boot Single User):這個模式用來修正已安裝的 FreeBSD,如 所述。可按 2、大寫或小寫 S 進入這個模式。 - - - - 離開到載入程式提示 (Escape to loader prompt):這個選項會開機進入修復提示,這個模式含有有限數量的低階指令,這個模式詳細說明於 。可按 3Esc 進入這個提示。 - - - - 重新開機 (Reboot):重新開啟系統。 - - - - 設定開機選項 (Configure Boot Options):開啟內部選單,詳細說明於 - - - -
- FreeBSD 開機選項選單 - - - - - - -
- - 開機選項選單分成兩個部份。第一個部份用來返回主開機選單或重設任何已切換的選項回預設值。 - - 第二個部份用來切換可用的選項為開 (On) 或關 (Off),透過按下選項明顯標示的編號或字元。系統將會一直使用這些選項開機,直到選項被修改。有數個選項可以在這個選單做切換: - - - - ACPI 支援 (ACPI Support):若系統在開機時卡住,可嘗試切換這個選項為關 (Off)。 - - - - 安全模式 (Safe Mode):若系統在 ACPI 支援 (ACPI Support) 設為關 (Off) 時開機時仍然會卡住,可嘗試將此選項設為開 (On)。 - - - - 單使用者 (Single User):切換這個選項為開 (On) 來修正已存在的 FreeBSD 如 所述,問題修正後,將其設回關 (Off)。 - - - - 詳細資訊 (Verbose):切換這個選項為開 (On) 來查看開機程序中更詳細的訊息,這在診斷硬體問題時非常有用。 - - - - 在做完所需的選擇後,按下 1Backspace 返回主開機選單,然後按下 Enter 繼續開機進入 FreeBSD。FreeBSD 執行裝置偵測及載入安裝程式時會顯示一系列的開機訊息,開機完成之後,會顯示歡迎選單如 - -
- 歡迎選單 - - - - - - -
- - 按下 Enter 選擇預設的 [ Install ] 進入安裝程式,接下來本章將介紹如何使用這個安裝程式。 若要選擇其他項目,可使用右或左方向鍵或顏色標示的字母選擇想要的選單項目。[ Shell ] 可用來進入 FreeBSD 的 Shell 使用指令列工具在安裝之前準備磁碟。[ Live CD ] 選項可用來在安裝之前試用 FreeBSD,Live 版本的詳細說明於 - - - 要重新檢視開機訊息,包含硬體裝置偵測,請按大寫或小寫 S 然後再按 Enter 進入 Shell。在 Shell 提示之後輸入 more /var/run/dmesg.boot 然後使用空白鍵來捲動訊息。當查看完畢後輸入 exit 返回歡迎選單。 - -
-
- - - 使用 <application>bsdinstall</application> - - 本節將告訴您在系統安裝之前 bsdinstall 選單的順序以及會詢問的資訊類型,可使用方向鍵來選擇選單的選項,然後按下 Space 選擇或取消選擇選單項目。當完成之後,按下 Enter 儲存選項然後進入下一個畫面。 - - - 選擇鍵盤對應表選單 - - 依據使用的系統 Console,bsdinstall 可能一開始顯示的選單會如 - -
- 鍵盤對應表選擇 - - - - - - -
- - 要設定鍵盤配置,請選擇 [ YES ] 按下 Enter,接著會顯示選單如 。若要使用預設的配置,則可使用方向鍵選擇 [ NO ] 然後按下 Enter 跳過這個選單畫面。 - -
- 選擇鍵盤選單 - - - - - - -
- - 設定鍵盤配置時,可使用上與下方向鍵來選擇最接近已連接到系統的鍵盤的鍵盤對應表 (Keymap),然後按下 Enter 儲存選項。 - - - Esc 會離開這個選單然後使用預設的鍵盤對應表,若不清楚要使用那種鍵盤對應表,United States of America ISO-8859-1 是也是保險的選項。 - - - 在 FreeBSD 10.0-RELEASE 以及之後的版本,已經加強了這個選單,會顯示完整的鍵盤對應表選項,並預先選擇預設值。另外,當選擇其他鍵盤對應用時,在繼續之前會顯示對話框讓使用者測試鍵盤對應表來確認。 - -
- 改進後的鍵盤對應表選單 - - - - - - -
- -
- - - 設定主機名稱 - - 下一個 bsdinstall 選單用來為新安裝的系統設定主機名稱。 - -
- 設定主機名稱 - - - - - - -
- - 輸入在網路上獨一無二的主機名稱,主機名稱要是完整的主機名稱,如 machine3.example.com -
- - - 選擇要安裝的元件 - - 接下來 bsdinstall 會提示選擇要安裝的選用元件。 - -
- 選擇要安裝的元件 - - - - - - -
- - 決定要安裝的元件主要會根據系統的用途以及可用的磁碟空間容量。FreeBSD 核心 (Kernel) 及 Userland 統稱為 基礎系統 (Base system),是必須安裝的部份。依據系統的架構,部份元件可能不會顯示: - - - - doc - 額外的說明文件,大部份是經年累月的產物,會安裝到 /usr/share/doc。由 FreeBSD 文件計劃所提供的說明文件可在之後安裝,依照 中的指示操作。 - - - - games - 數個傳統 BSD 遊戲,包含 fortune, rot13 以及其他。 - - - - lib32 - 在 64-bit 版本的 FreeBSD 供執行 32-bit 應用程式使用的相容性程式庫。 - - - - ports - FreeBSD Port 套件集是一套可自動下載、編譯安裝第三方軟體套件的集合, 中會討論到如何使用 Port 套件集。 - - - 安裝程式並不會檢查是否有充足的磁碟空間,FreeBSD Port 套件集會使用約 500 MB 的磁碟空間,只有在有足夠的磁碟空間時才選擇這個選項。 - - - - - src - 完整的 FreeBSD 原始碼,包含核心 (Kernel) 與 Userland。雖然大多數的應用程式並不需要,但它可以編譯裝置驅動程式、核心模組或部份來自 Port 套件集的應用程式,它同時也用來做為開發 FreeBSD 本身所使用。完整的原始碼樹需要 1 GB 的磁碟空間,重新編譯整個 FreeBSD 系統需要額外再 5 GB 的空間。 - - -
- - - 從網路安裝 - - 所示的選單只會在使用 -bootonly.iso CD 安裝時顯示,因這個安裝媒體中並未含安裝檔的複本。由於安裝檔必須透過網路下載,此選單會告知要先設定網路介面。 - -
- 從網路安裝 - - - - - - -
- - 要設定網路連線,按下 Enter 然後依照 中的指示操作,完成網路介面的設定之後,選擇與要安裝 FreeBSD 的電腦相同所在地區的鏡像站,當鏡像站越接近目標電腦,檔案下載的速度會比較快,這會減少安裝的時間。 - -
- 選擇鏡像站 - - - - - - -
- - 若在本機的安裝媒體中找到安裝檔案,安裝程序便會繼續。 -
-
- - - 配置磁碟空間 - - 接下來的選單用來決定配置磁碟空間的方式。 - -
- FreeBSD 10.x 或更新版本的磁碟分割選項 - - - - - - -
- - 引導式 (Guided) 磁碟分割會自動設定磁碟的分割區 (Partition),手動 (Manual) 磁碟分割可讓進階的使用者使用選單項目建立自訂的分割區,而 Shell 會開啟 Shell 提示讓進階的使用者可以使用指示列工具如 gpart8, fdisk8 以及 bsdlabel8 來建立自訂的分割區。ZFS 磁碟分割只在 FreeBSD 10 及之後的版本可以使用,可建立選擇性加密的 root-on-ZFS 系統並支援 開機環境 (Boot environment) - - 本節會介紹在配置磁碟分割時需要考量那些事情,並且會示範各種磁碟分割的方式。 - - - 規劃分割區配置 - - 分割區配置 - - /etc - - - /var - - - /usr - - - 配置檔案系統時要記得硬碟的資料傳輸的速度外軌較內軌快,因此較小且大量存取的檔案系統應要較接近磁碟的外軌,而較大的分割區如 /usr 應放置在磁碟較內部,建議建立分割區的順序如下:/, swap, /var 然後 /usr - - 機器預期的用途會反映到 /var 分割區的大小,這個分割區用來保存郵件 (Mailbox)、日誌檔 (Log file) 及印表機緩衝 (Spool)。依使用者數及保存的期間,郵件及日誌檔可能成長到無法預期的大小,一般來說大部份的使用很少會在 /var 需要超過 1 GB 的可用磁碟空間。 - - - 有時在 /var/tmp 會需要較多的空間,當新軟體安裝,套件工具會從套件中取出暫存的複本置於 /var/tmp。若在 /var/tmp 沒有足夠的空間,要安裝大型軟體套件,例如 Firefox, Apache OpenOfficeLibreOffice 會很困難。 - - - /usr 分割區保存了許多支持系統運作的檔案,包含 FreeBSD Port 套件集以及系統原始碼,這個分割區建議至少要有 2 GB 的空間。 - - 在規劃分割區大小時,請牢記空間需求,當因某個分割區空間不足時要改使用其他分割區時會很麻煩。 - - - swap sizing - - - swap partition - - - 根據經驗,交換分割區應為是實體記憶體 (RAM) 的兩倍。使用最低需求的 RAM 來運作的系統會需要更多的交換空間來取得更好的表現。配置太小的交換交間可能導致 VM 分頁掃描碼效率不佳,且往後增加更多記憶體時可能會產生問題。 - - 在有數個 SCSI 磁碟或數個 IDE 磁碟在不同控制器的大型系統建議在每個磁碟機上都設定交換空間,最多可至四個磁碟機。每個交換分割區的大小應接近相同。核心雖可以處以任意大小的交換空間,但內部資料結構擴充到 4 倍的最大交換分割區大小時,讓交換分割區擁有相同的大小可以讓核心可以最佳的方式串連各個磁碟的交換空間。規劃較大交換空間是可以的,即使沒有使用到多少交換空間,這也會讓要從失控的程式恢復運作更容易,而不需強制重新啟動系統。 - - 正確的做磁碟分割,可以區隔頻繁寫入所產生的資料碎片與經常讀取的分割區,將寫入頻繁的分割區放在磁碟的邊緣可以增加 I/O 效率。雖然較大的分割區可能也需要增加 I/O 效率,但將這些分割區往磁碟邊緣移動所增加的效率並不會比將 /var 移到磁碟邊緣所增加的效率來的顯著。 - - - - 引導式磁碟分割 - - 當選擇這個方法,選單上會顯示可用的磁碟,若電腦有安裝多個磁碟,則需選擇其中一個來安裝 FreeBSD。 - -
- 自多個磁碟選擇 - - - - - - -
- - 選擇磁碟之後,接下來選單會提示是否要安裝到整個磁碟或是使用剩餘的空間建立新的分割區。若選擇 [ Entire Disk ],會自動建立通用的分割區配置來填滿整個磁碟。選擇 [ Partition ] 則會使用磁碟上未使用的空間來建立分割區配置。 - -
- 選擇完整磁碟或分割區 - - - - - - -
- - 分割區配置建立完成之後,再檢查一次確定是否符合安裝的需求。選擇 [ Revert ] 會重設分割區回復為原來的設定值,選擇 [ Auto ] 會重新建立自動配置的 FreeBSD 分割區。分割區也可以手動建立、修改或刪除。當確認磁碟分割正確之後,選擇 [ Finish ] 繼續安裝。 - -
- 確認已建立的分割區 - - - - - - -
-
- - - 手動磁碟分割 - - 選擇這個方法會開啟分割區編輯程式: - -
- 手動建立分割區 - - - - - - -
- - 選擇要安裝的磁碟機 (在這個例子為 ada0) 然後選擇 [ Create ] 會以選單顯示可用的分割表格式 (Partition scheme): - -
- 手動建立分割區 - - - - - - -
- - amd64 電腦最適合的選擇通常是 GPT,無法相容 GPT 的舊電腦則應使用 MBR。而其他分割表格式一般會用在那些較罕見或較舊的電腦上。 - - - 磁碟分割表格式 - - - - - 縮寫 - 說明 - - - - - - APM - Apple Partition Map,用於 PowerPC - - - - BSD - MBRBSD 標籤,因非 BSD 的磁碟工具可能無法辨識該標籤,有時被稱做 危險專用模式 (Dangerously dedicated mode) - - - - GPT - GUID 分割區表 (http://en.wikipedia.org/wiki/GUID_Partition_Table)。 - - - - MBR - 主開機記錄 (http://en.wikipedia.org/wiki/Master_boot_record)。 - - - - PC98 - 使用 MBR 改編,用於 NEC PC-98 電腦 (http://en.wikipedia.org/wiki/Pc9801)。 - - - - VTOC8 - Volume Table Of Contents,用於 Sun SPARC64 及 UltraSPARC 電腦。 - - - -
- - 選擇完分割區表格式並建立之後,再選擇 [ Create ] 一次來建立分割區。Tab 鍵可用來在欄位間移動游標。 - -
- 手動建立分割區 - - - - - - -
- - 標準的 FreeBSD GPT 安裝會使用至少三種分割區: - - - - freebsd-boot - 儲存 FreeBSD 開機程式 (Boot code)。 - - - - freebsd-ufs - FreeBSD 的 UFS 檔案系統。 - - - - freebsd-swap - FreeBSD 交換空間。 - - - - 另一個值得注意的分割區類型是 freebsd-zfs,這個分割區用來放置 FreeBSD ZFS 檔案系統 ()。請參考 gpart8 取得可用的 GPT 分割區類型說明。 - - 檔案系統分割區可建立多個,且有部份人會偏好使用傳統的配置方式將 /, /var, /tmp 以及 /usr 分開存放在不同的分割區。請參考 的範例。 - - 大小 (Size) 欄位可以使用常用的縮寫來輸入:K 代表 KB, M 代表 MB, G 代表 GB。 - - - 適當的對齊磁碟扇區 (Sector) 會提供最佳的效能,而且讓分割區大小為 4 KB 的偶數倍數可協助確保對齊在磁碟機上的 512-byte 或 4K-byte 扇區。一般來說,使用分割區大小為 1M 或 1G 的偶數倍數是最簡單的方式確保每個分割區以 4K 的偶數倍數做為開始。唯一一個例外是:freebsd-boot 分割區因目前開機程式 (Boot code) 的限制,不可大於 512K。 - - - 若分割區內含檔案系統便會需要一個掛載點 (Mountpoint),若只要建立一個 UFS 分割區,那麼掛載點應設為 / - - 標籤 (Label) 是分割區的名稱,磁碟機名稱或編號可能因為磁碟機連接到不同的控制器或連結埠而有所不同,但分割區標籤並不會改變。因此在檔案如 /etc/fstab 中參照時,使用標籤來替代磁碟機名稱與分割區編號會讓系統對硬體變更有更多的容錯空間。GPT 標籤會於磁碟連結之後出現在 /dev/gpt/。其他分割表格式的標籤格有不同功能,且標籤會在 /dev/ 中有各自的目錄。 - - - 每個分割區請使用獨一無二的標籤來避免相同名稱的衝突,標籤可以加入與電腦名稱、用途、地點有關的文字。例如,使用 labrootrootfslab 來做為電腦名稱為 labUFS 根目錄分割區。 - - - - 建立傳統分割的檔案系統分割區 - - 傳統的分割區配置會將 /, /var, /tmp 以及 /usr 分別使用不同的檔案系統與分割區。先建立 GPT 分割表格式,然後依照下表所示建立分割區。下表是針對 20G 目標磁碟的分割區大小,若在目標磁碟有更多可用的空間,則可增加交換空間 (Swap) 或 /var 會比較有用。以下所示的標籤皆以 ex 為字首,代表 example,讀者應照前面的說明使用其他獨一無二的標籤。 - - 預設 FreeBSD 的 gptboot 會預期第一個 UFS 分割區為 / 分割區。 - - - - - - 分割區類型 - 大小 - 掛載點 - 標籤 - - - - - - freebsd-boot - 512K - - - - freebsd-ufs - 2G - / - exrootfs - - - - freebsd-swap - 4G - - exswap - - - - freebsd-ufs - 2G - /var - exvarfs - - - - freebsd-ufs - 1G - /tmp - extmpfs - - - - freebsd-ufs - 接受預設值 (依磁碟提示) - /usr - exusrfs - - - - - - - 自訂的分割區建立完後,選擇 [ Finish ] 繼續安裝。 -
- - - Root-on-ZFS 自動磁碟分割 - - 在 FreeBSD 10.0-RELEASE 之後支援了自動建立 root-on-ZFS 的安裝程序。這種磁碟分割模式只能使用整個磁碟,並會清除整個磁碟內的內容。安裝程式會自動建立對齊 4k 邊界的分割區然後強制 ZFS 使用 4k 扇區 (Sector)。即使在 512 位元扇區的磁碟使用也很安全,並增加了確保在 512 位元的磁碟上建立儲存池 (Pool) 也可在未來加入 4k 扇區磁碟的好處,無論是作為額外的存儲空間或作為故障磁碟的替代品。安裝程式也可選擇性採用 GELI 磁碟加密,如 所介紹,若開啟磁碟加密,會建立一個內含 /boot 目錄的 2 GB 未加密的開機儲存池,這個儲存池中會儲存核心及其他開機必要的檔案。然後剩餘的空用會給 ZFS 儲存池使用。 - - 主要 ZFS 設定選單提供了數個設定選項來控制儲存池的建立。 - -
- <acronym>ZFS</acronym> 磁碟分割選單 - - - - - - -
- - 選擇 T 來設定儲存池類型 (Pool Type) 以及要組成儲存池的磁碟。自動 ZFS 安裝程式目前僅支援建立單一頂層 vdev,除了在串連 (Stripe) 模式。要建立更複雜的儲存池,需使用 的操作來建立儲存池。安裝程式支援建立各種儲存池類型,包含串連 Stripe (不建議,沒有備援功能)、鏡像 Mirror (效能較佳,但可用空間較少) 以及 RAID-Z 1, 2, 與 3 (分別有能力承受同時 1, 2 與 3 個磁碟的損壞)。在選擇儲存池類型時會在螢幕的下方提示所需的磁碟數量,以及在使用 RAID-Z 時,每種配置最佳的磁碟數。 - -
- <acronym>ZFS</acronym> 儲存池類型 - - - - - - -
- - 選擇儲存池 (Pool Type) 之後,會顯示可用的磁碟清單,然後會提示使用者選擇一個或多個磁碟來建立儲存池。接著會檢驗設定來確定選擇的磁碟足夠,若不足,選擇更改選項 (<Change Selection>) 來返回磁碟清單或取消 (<Cancel>) 來更改儲存池類型。 - -
- 磁碟選擇 - - - - - - -
- -
- 無效的選擇 - - - - - - -
- - 若有一個或多磁碟未出現在清單上,或在安裝程式啟動後才連接的磁碟,可選擇重新掃描裝置 (- Rescan Devices) 來更新可用磁碟的清單。要避免清除掉錯的磁碟,可用磁碟資訊 (- Disk Info) 來檢查每個磁碟,包含磁碟中的分割表以及各種其他資訊如裝置型號與序號 (若有的話)。 - -
- 分析磁碟 - - - - - - -
- - ZFS 設定選單也允許使用者輸入儲存池名稱、關閉強制 4k 扇區對齊、開啟或關閉加密、切換 GPT (建議) 與 MBR 分割表類型以及選擇交換空間容量。設定所有選項為想要的值之後,請選擇選單上方的安裝 (>>> Install) 選項。 - - 若開啟了 GELI 磁碟加密,安裝程式會提示輸入兩次用來加密磁碟的密碼。 - -
- 磁碟加密密碼 - - - - - - -
- - 安裝程式接著會提供最後一次修改的機會可取消先前所選擇摧毀用來建立 ZFS 儲存池的磁碟機。 - -
- 最後修改 - - - - - - -
- - 然後安裝程序會正常繼續。 - -
- - - Shell 模式磁碟分割 - - 當要做進階的安裝時,bsdinstall 的磁碟分割選單可能無法提供需要的彈性。進階的使用者可以在磁碟分割選單選擇 Shell 選項來手動分割磁碟機、建立檔案系統、填寫 /tmp/bsdinstall_etc/fstab 以及掛載檔案系統到 /mnt 下。這些動作完成之後,輸入 exit 可返回 bsdinstall 繼續安裝程序。 - -
- - - 確認安裝 - - 磁碟設定完之後,接下來的選單會讓您在格式化所選的硬碟之前有最後一次機會做變更,若需要做變更,可選 [ Back ] 返回到主磁碟分割選單。[ Revert & Exit ] 則會離開安裝程式,不會對硬碟做任何變更。 - -
- 最後確認 - - - - - - -
- - 要開始實際的安裝,請選擇 [ Commit ] 然後按下 Enter - - 安裝時間會依據選擇的發行版、安裝媒體、電腦的速度而有所不同,接下來會有一系列訊息會告知目前的進度。 - - 首先,安裝程式會格式化選擇的磁碟,然後初始化分割區。然後,若使用僅可開機 (Boot only) 的媒體則會開始下載選擇的元件: - -
- 取得發行版檔案 - - - - - - -
- - 接著,會檢驗發行版的檔案完整性來確保沒有因下載過程中或安裝媒體的讀取過程中讀取錯誤造成的損壞: - -
- 檢驗發行版檔案 - - - - - - -
- - 最後,檢驗過的發行版檔案會被取出儲存至磁碟: - -
- 解開發行版檔案 - - - - - - -
- - 所有選擇的發行版檔案取出後,bsdinstall 會顯示第一次安裝後設定畫面,可用的安裝後設定選項會在下一節說明。 -
- - - 安裝後注意事項 - - FreeBSD 安裝完之後,bsdinstall 會在開機進入新安裝的系統之前提示設定數個選項,本節將介紹這些設定選項。 - - - 系統開機之後,bsdconfig 提供了一個選單導向的方式可用來設定系統使用這些以及其他的選項。 - - - - 設定 <systemitem class="username">root</systemitem> 密碼 - - 首先,必需設定 root 的密碼,輸入密碼時,並不會直接在畫面上顯示輸入的字元。輸入完密碼之後,必須再輸入一次來確認沒有輸入錯誤。 - -
- 設定 <systemitem class="username">root</systemitem> 密碼 - - - - - - -
-
- - - 設定網路介面卡 - - 接著,會顯示在電腦上找到的網路介面卡清單。請選擇要設定的介面卡。 - - - 若使用 bootonly 的方式安裝在先前已有設定過網路,將會跳過網路設定選單。 - - -
- 選擇網路介面卡 - - - - - - -
- - 若選擇的是乙太網路介面卡,安裝程式會跳過這部份直接到 ,若選擇的是無線網路介面卡,系統則會開始掃描無線存取點 (Wireless Access Point): - -
- 掃描無線網路存取點 - - - - - - -
- - 網線網路會使用 Service Set Identifier (SSID) 來辦識,SSID 是一段簡短、獨一無二的名稱,用來命名每個網路。 掃描時找到的 SSID 會列到清單,並會說明該網路可用的加密類型。 若想要連線的 SSID 並未出現在清單上,可選擇 [ Rescan ] 再掃描一次,若想要連線的網路仍然沒有出現,請檢查天線的連線是否有問題,或者嘗試將電腦移至更靠近存取點的位置,然後再掃描一次。 - -
- 選擇無線網路 - - - - - - -
- - 然後,輸入加密資訊來連線到選擇的無線網路。強列建議使用 WPA2 加密,因較舊的加密類型,如 WEP 僅提供微弱的安全性。若網路使用 WPA2 則需輸入密碼,也稱作 Pre-Shared Key (PSK)。考量安全性,輸入到輸入框的字元會以星號顯示。 - -
- WPA2 設定 - - - - - - -
- - 接下來,選擇是否要設定乙太網路或無線網路介面卡的 IPv4 位址: - -
- 選擇 <acronym>IPv4</acronym> 網路 - - - - - - -
- - 有兩種方式可以設定 IPv4DHCP 會自動設定網路介面卡且該網路上需有 DHCP 伺服器才可使用。否則,必須手動輸入位址的資訊來做靜態設定。 - - - 請不要隨便輸入網路資訊,因為這不管用。如果沒有可用的 DHCP 伺服器,可向網路管理者或網路服務供應商 (Internet Service Provider, ISP) 索取列於 的資訊。 - - - 若有可用的 DHCP 伺服器,請在接下來的選單中選擇 [ Yes ] 則會自動設定網路介面卡。當找到 DHCP 伺服器並且取得系統的位址資訊時,安裝程式會出現一分鐘左右的停頓。 - -
- 選擇 <acronym>IPv4</acronym> <acronym>DHCP</acronym> 設定 - - - - - - -
- - 若沒有可用的 DHCP 伺服器,則選擇 [ No ] 然後在這個選單中輸入以下位址資訊: - -
- <acronym>IPv4</acronym> 靜態位置設定 - - - - - - -
- - - - IP 位址 (IP Address) - 要分配給這台電腦的 IPv4 位址。位址必須獨一無二且不可已被其他在區域網路上的設備使用。 - - - - 子網路遮罩 (Subnet Mask) - 網路的子網路遮罩。 - - - - 預設路由器 (Default Router) - IP 位址所在網段的預設通訊閘。 - - - - 接下來的畫面會詢問是否要設定介面卡的 IPv6 位址,若可以且想要使用 IPv6,請選擇 [ Yes ] - -
- 選擇 IPv6 網路 - - - - - - -
- - 同樣有兩種方式可以設定 IPv6。StateLess Address AutoConfiguration (SLAAC) 會自動向區域路由器請求取得正確的設定資訊,請參考 http://tools.ietf.org/html/rfc4862 取得進一步資訊。靜態設定則需要手動輸入網路資訊。 - - 若有可用的 IPv6 路由器,請在接下來的選單選擇 [ Yes ] 來自動設定網路介面卡。當找到路由器並且取得系統的位址資訊時,安裝程式會出現一分鐘左右的停頓。 - -
- 選擇 IPv6 SLAAC 設定 - - - - - - -
- - 若沒有可用的 IPv6 路由器,請選擇 [ No ] 然後在這個選單中輸入以下位址資訊: - -
- IPv6 靜態位置設定 - - - - - - -
- - - - IPv6 位址 (IPv6 Address) - 要分配給這台電腦的 IPv6 位址。位址必須獨一無二且不可已被其他在區域網路上的設備使用。 - - - - 預設路由器 (Default Router) - IPv6 位址所在網段的預設通訊閘。 - - - - 最後的網路設定選單是用來設定網域名稱系統 (Domain Name System, DNS) 的解析器,解析器會轉換主機名稱為網路位址。若已使用 DHCPSLAAC 來自動設定網路介面卡,解析器設定 (Resolver Configuration) 的值可能會事先已填入,否則需輸入區域網路的網域名稱到搜尋 (Search) 欄位。 DNS #1DNS #2 要填寫 DNS 伺服器的 IPv4 及/或 IPv6 位址,至少需填寫一個 DNS 伺服器。 - -
- DNS 設定 - - - - - - -
-
- - - 設定時區 - - 接下來的選單會詢問系統時鐘要使用 UTC 或者當地時間。 若有疑問時可選擇 [ No ]使用更常用的當地時間。 - -
- 選擇本地或 UTC 時鐘 - - - - - - -
- - 接下來一系列的選單會透過選擇地理區域、城市及時區來判斷正確的當地時間。設定時區可讓系統自動更正區域時間的更改,如日光節約時間以及正確執行其他時區相關的功能。 - - 此處以位於美國東部時區的機器為例,選擇會依據地理位置不同改變。 - -
- 選擇區域 - - - - - - -
- - 使用方向鍵選擇適當的區域然後按下 Enter - -
- 選擇城市 - - - - - - -
- - 使用方向鍵選擇適當的城市然後按下 Enter - -
- 選擇時區 - - - - - - -
- - 使用方向鍵選擇適當的時區然後按下 Enter - -
- 確認時區 - - - - - - -
- - 確認時區的縮寫是否正確,若正確,按下 Enter 繼續安裝後設定。 -
- - - 開啟服務 - - 接下來的選單用來設定有那些系統服務要在系統啟動時執行。所有的服務為選用,只需開啟系統運作真正需要的服務。 - -
- 選擇要開啟的其他服務 - - - - - - -
- - 這是可以在這個選單開啟的服務摘要: - - - - sshd - Secure Shell (SSH) Daemon 可從遠端透過加密的連線存取系統,只有在系統允許遠端登入時開啟這個服務。 - - - - moused - 若在指令列系統 Console 會使用到滑鼠時,可開啟此服務。 - - - - ntpd - 網路時間通訊協定 (Network Time Protoco, NTP) Daemon 用來自動同步時間。若在網路上有使用 Windows, Kerberos 或 LDAP 伺服器時,可開啟此服務。 - - - - powerd - 系統電源控制工具用來做電源控制與節能。 - - -
- - - 開啟當機資訊 (Crash Dump) - - 接下來的選單用來設定是否開啟當機資訊 (Crash dump),開啟當機資訊對系統除錯非常有用,因此建議使用者開啟當機資訊。 - -
- 開啟當機資訊 (Crash Dump) - - - - - - -
-
- - - 新增使用者 - - 下個選單會提示建立至少一個使用者帳號。建議使用 root 以外的使用者帳號登入系統,當使用 root 登入時,基本上沒有任何的限制或保護。 -使用一般使用者登入較保險且安全。 - - 選擇 [ Yes ] 來新增新使用者。 - -
- 新增使用者帳號 - - - - - - -
- - 請依照提示輸入請求的使用者帳號資訊, 的範例示範建立 asample 使用者帳號。 - -
- 輸入使用者資訊 - - - - - - -
- - 這裡是要輸入的資訊摘要: - - - - 使用者名稱 (Username) - 登入時使用者要輸入的名稱,常見的慣例是用姓的前一個字母與名結合,只要每個使用者名稱在系統唯一的皆可。使用者名稱區分大小寫且不應含有任何空白字元。 - - - - 全名 (Full name) - 使用者的全名,這個欄位可使用空白並且會用來描述該使用者帳號。 - - - - Uid - 使用者 ID,通常這個欄位會留空,系統會自動分配一個值。 - - - - 登入群組 (Login group) - 使用者的群組,通常這個欄位會留空來使用預設值。 - - - - 邀請使用者進入其他群組? (Invite user into other groups?) - 使用者要加入成為其成員的其他群組,若該使用者需要管理權限,則在此輸入 wheel - - - - 登入類別 (Login class) - 通常會留空來使用預設值。 - - - - Shell - 輸入清單中的其中一項來設定使用者所互動的 Shell,請參考 取得更多有關 Shell 的資訊。 - - - - 家目錄 (Home directory) - 使用者的家目錄,預設值通常是沒有問題的。 - - - - 家目錄權限 (Home directory permissions) - 使用者家目錄的權限,預設值通常是沒有問題的。 - - - - 使用密碼為基礎的認証方式? (Use password-based authentication?) - 通常為是 (yes),使用者才可於登入時輸入密碼。 - - - - 使用空白密碼? (Use an empty password?) - 通常為否 (no),因為使用空白密碼並不安全。 - - - - 使用隨機密碼? (Use a random password?) - 通常為否 (no),這樣使用者接下來才可設定自己的密碼。 - - - - 輸入密碼 (Enter password) - 這個使用者的密碼,輸入的字元不會顯示在畫面上。 - - - - 再輸入密碼一次 (Enter password again) - 再輸入一次密碼來確認無誤。 - - - - 建立後鎖定使用者帳號? (Lock out the account after creation?) - 通常為否 (no),這樣使用者才可以登入。 - - - - 在輸入完全部的資料後,會顯示摘要供檢查,若發現錯誤,可輸入否 (no) 然後再輸入一次,若輸入的所有資訊皆正確,輸入是 (yes) 以後便會建立新使用者。 - -
- 離開使用者與群組管理 - - - - - - -
- - 若還有其他要新增的使用者,則在詢問新增其他使用者? (Add another user?) 時回答是 (yes)。輸入否 (no) 來完成加入使用者然後繼續安裝。 - - 要取得新增使用者與使用者管理的更多資訊,請參考 -
- - - 最後設定 - - 在所有東西安裝並設定完之後,會提供最後一次修改設定的機會。 - -
- 最後設定 - - - - - - -
- - 使用這個選單在完成安裝前做任何更改或做任何額外的設定。 - - - - 新增使用者 (Add User) - 詳述於 - - - - Root 密碼 (Root Password) - 詳述於 - - - - 主機名稱 (Hostname) - 詳述於 - - - - 網路 (Network) - 詳述於 - - - - 服務 (Services) - 詳述於 - - - - 時區 (Time Zone) - 詳述於 - - - - 使用手冊 (Handbook) - 下載並安裝 FreeBSD 使用手冊。 - - - - 完成最後的設定之後,選擇 Exit - -
- 手動設定 - - - - - - -
- - bsdinstall 會提示是否有任何額外的設定需要在重新開機進入新系統之前完成。選擇 [ Yes ] 會離開進入到新系統的 Shell 或 [ No ] 繼續最後的安裝步驟。 - -
- 完成安裝 - - - - - - -
- - 若有需要做進一步或特殊的設定,選擇 [ Live CD ] 會開機進入安裝媒體的 Live CD 模式。 - - 若安裝已完成,選擇 [ Reboot ] 重新開啟電腦然後啟動新的 FreeBSD 電腦。不要忘了移除 FreeBSD 安裝媒體,否則電腦會再次開機進入安裝程式。 - - FreeBSD 開機的過程會顯示許多可以參考的訊息,系統開機完成後,會顯示登入提示,在 login: 提示,輸入安裝時新增的使用者名稱。登入時避免直接使用 root,請參考 來取得當需要管理權限時如何成為超級使用者的說明。 - - 要查看開機過程顯示的訊息可按 Scroll-Lock 鍵來開啟卷軸暫存,然後可使用 PgUp, PgDn 以及方向鍵來捲動訊息。查看完成之後再按 Scroll-Lock 鍵一次來解除畫面鎖定並返回 Console。系統開機一段時間之後要查看這些訊息可在指令提示後輸入 less /var/run/dmesg.boot,查看後按下 q 鍵便可返回指令列。 - - 若在 有開啟 sshd,因系統會產生 RSADSA 金鑰第一次開機可能會有點慢,之後的開機便會恢復正常速度。接著會顯示金鑰的指紋 (Fingerprint),如這個範例: - - Generating public/private rsa1 key pair. -Your identification has been saved in /etc/ssh/ssh_host_key. -Your public key has been saved in /etc/ssh/ssh_host_key.pub. -The key fingerprint is: -10:a0:f5:af:93:ae:a3:1a:b2:bb:3c:35:d9:5a:b3:f3 root@machine3.example.com -The key's randomart image is: -+--[RSA1 1024]----+ -| o.. | -| o . . | -| . o | -| o | -| o S | -| + + o | -|o . + * | -|o+ ..+ . | -|==o..o+E | -+-----------------+ -Generating public/private dsa key pair. -Your identification has been saved in /etc/ssh/ssh_host_dsa_key. -Your public key has been saved in /etc/ssh/ssh_host_dsa_key.pub. -The key fingerprint is: -7e:1c:ce:dc:8a:3a:18:13:5b:34:b5:cf:d9:d1:47:b2 root@machine3.example.com -The key's randomart image is: -+--[ DSA 1024]----+ -| .. . .| -| o . . + | -| . .. . E .| -| . . o o . . | -| + S = . | -| + . = o | -| + . * . | -| . . o . | -| .o. . | -+-----------------+ -Starting sshd. - - 請參考 來取得更多有關指紋與 SSH 的資訊。 - - FreeBSD 預設並不會安裝圖型化介面,請參考 取得有關安裝與設定圖型化視窗管理程式的資訊。 - - 正確的將 FreeBSD 電腦關機對保護資料及避免硬體損壞有幫助。在系統尚未正常關機之前請不要關閉電源! 若使用者為 wheel 群組的成員之一,可在指令列輸入 su 然後輸入 root 密碼來成為超級使用者。接著輸入 shutdown -p now 系統便會關機,若硬體支援的話,電腦會自行關閉電源。 -
-
- - - 疑難排解 - - - installation - troubleshooting - - 本節涵蓋基礎的安裝疑難排解,例如一些已有人回報的常見問題。 - - 查看該 FreeBSD 版本的 Hardware Notes (https://www.freebsd.org/releases/index.html) 文件來確認是否支援該硬體。若確定有支援該硬體但仍然卡住或發生其他問題,請依照 的指示編譯自訂核心來加入未在 GENERIC 核心的裝置。預設的核心會假設大部份的硬體裝置會使用原廠預設的 IRQs, I/O 位址,及 DMA 通道,若硬體已經被重新設定過,自訂的核心設定檔可以告訴 FreeBSD 到那找到這些裝置。 - - - 部份安裝問題可以透過更各種硬體元件的韌體來避免或緩解,特別是主機板。主機板的韌體通常稱為 BIOS,大部份主機板與電腦製造商會有網站可以取得升級程式與升級資訊。 - - 製造商通常會建議若沒有特殊原因盡量避免升級主機板 BIOS,例如:重大更新,升級的程多可能會出錯,導致未更新完成的 BIOS 並讓電腦無法運作。 - - - 若系統在開機偵測硬體時卡住或安裝時運作異常,可能主因為 ACPI,FreeBSD 在 i386, amd64 及 ia64 平台廣泛的使用了系統 ACPI 服務來協助設定系統組態,若在開機時有偵測到該功能。不幸的是,ACPI 驅動程式與系統主機板及 BIOS 韌體之間仍存在部份問題。可於開機載入程式的第三階段設定 hint.acpi.0.disabled Hint 來關閉 ACPI - - set hint.acpi.0.disabled="1" - - 每一次系統重開之後便會重設,因此需要在 /boot/loader.conf 檔案加入 hint.acpi.0.disabled="1"。更多有關開機載入程式的資訊可於 取得。 - - - - 使用 Live <acronym>CD</acronym> - - 所示 bsdinstall 的歡迎選單提供了 [ Live CD ] 選項,這對那些對 FreeBSD 是否為正確的作業系統尚存疑慮的人非常有幫助,這可讓這些人在安裝前測試一部份功能。 - - 在使用 [ Live CD ] 之前必須注意以下幾點事項: - - - - 若要增加存取權限,必須透過認証。使用者名稱為 root 而密碼則是空白。 - - - - 系統是直接從安裝媒體上執行,比起安裝到硬碟的系統,效能可能較差。 - - - - 這個選項只提供指令提示,不會有圖型化介面。 - - - -
- - - - - - FreeBSD 基礎 - - - 概述 - - 接下來的這一章將涵蓋 FreeBSD 作業系統的基本指令及功能。 大部份的內容在 UNIX-like 作業系統中都是相通的。 如果您對這些內容熟悉的話,可以放心的跳過。 如果您剛接觸 FreeBSD,那您一定要仔細的讀完這章。 - - 讀完這章,您將了解: - - - - 如何使用 FreeBSD 的虛擬 Console。 - - - - 如何在 FreeBSD 建立與管理使用者與群組。 - - - - UNIX 檔案權限以及 FreeBSD 檔案標記的運作方式。 - - - - 預設的 FreeBSD 檔案系統配置。 - - - - FreeBSD 的磁碟組織。 - - - - 如何掛載 (Mount)、卸載 (Umount) 檔案系統。 - - - - 什麼是程序、Daemon 以及信號 (Signal)。 - - - - 什麼是 Shell,以及如何變更您預設的登入環境。 - - - - 如何使用基本的文字編輯器。 - - - - 什麼是裝置 (Device) 和裝置節點 (Device node)。 - - - - 如何閱讀操作手冊以獲得更多的資訊。 - - - - - - 虛擬 Console 與終端機 - - - virtual consoles - - - terminals - - - console - - - 如果您沒有將 FreeBSD 設定成開機時自動進入圖形化模式,系統會進入指令登入提示像是這樣的東西: - - FreeBSD/amd64 (pc3.example.org) (ttyv0) - -login: - - 第一行包含了剛開機完系統的資訊,amd64 代表此範例所使用的系統是執行 64-位元版本的 FreeBSD,這台主機的名稱是 pc3.example.orgttyv0 代表這是個 系統 Console。第二行則是登人的提示訊息。 - - FreeBSD 是一個多使用者的系統,需要一套可以分辨不同使用者的方法。因此所有的使用者在執行程式之前必須先“登入”系統以取得系統內程式的存取權限。每個使用者都有一組獨一無二的使用者名稱 (username) 及個人密碼 (password)。 - - 要登入系統 Console 需輸入在系統安裝時設定的使用者名稱,請參考 ,並按下 Enter。 接著輸入該使用者名稱的密碼按下 Enter。 輸入的密碼為了安全起見不會顯示在畫面上。 - - 如果您輸入了正確的密碼,您應該會看到今日訊息 (Message of the day, MOTD),後面接著顯示指令提示字元,依使用者建立時所選擇的 Shell 會有不同的提示字元可能為 #, $ 或者 %。 看到指令提示代表使用者現在已經登入 FreeBSD 系統 Console 且已經準備好可以下指令。 - - - 虛擬 Console - - 雖然系統 Console 已經可以用來與系統互動,但使用鍵盤來下指令使用 FreeBSD 系統的使用者通常會使用虛擬 Console 登入。 因為系統訊息預設會顯示在系統 Console,這些訊些會在使用者作業的過程中不斷出現,讓使用者難以專心作業。 - - FreeBSD 預設提供多個虛擬 Console 可輸入指令,每個虛擬 Console 都有自己的登入提示及 Shell 並且可以輕易的在虛擬 Console 間切換。 這實際上讓指令輸入有了類似於圖型化環境中可以同時開啟多個視窗的功能。 - - 組合鍵 AltF1AltF8 被 FreeBSD 保留用來切換虛擬 Console,使用 AltF1 可切換至系統 Console (ttyv0),AltF2 可存取第一個虛擬 Console (ttyv1),AltF3 可存取第二個虛擬 Console (ttyv2),以此類推。當使用 Xorg 作為圖型化 Console 時,組合鍵則改使用 CtrlAltF1 來切換回文字介面的虛擬 Console。 - - 當您從一個 Console 切換到下一個的時候,FreeBSD 會切換畫面顯示的內容, 這就好像有很多虛擬的螢幕和鍵盤可以讓您輸入指令到 FreeBSD 執行。 在某一個虛擬 Console 上執行的程式並不會因為使用者切到別的 Console 而停止執行。 - - 請參考 kbdcontrol1, vidcontrol1, atkbd4, syscons4 以及 vt4 來取得更多有關 FreeBSD Console 及鍵盤驅動程式的技術說明。 - - FreeBSD 中虛擬 Console 的數量設定在 /etc/ttys 檔案中的下列章節: - - # name getty type status comments -# -ttyv0 "/usr/libexec/getty Pc" xterm on secure -# Virtual terminals -ttyv1 "/usr/libexec/getty Pc" xterm on secure -ttyv2 "/usr/libexec/getty Pc" xterm on secure -ttyv3 "/usr/libexec/getty Pc" xterm on secure -ttyv4 "/usr/libexec/getty Pc" xterm on secure -ttyv5 "/usr/libexec/getty Pc" xterm on secure -ttyv6 "/usr/libexec/getty Pc" xterm on secure -ttyv7 "/usr/libexec/getty Pc" xterm on secure -ttyv8 "/usr/X11R6/bin/xdm -nodaemon" xterm off secure - - - 要關閉虛擬 Console 只要在指定的虛擬 Console 該行設定的一開始加上註解符號 (#)。 例如要將虛擬 Console 的數量由 8 個改為 4 個,則可將 # 加在代表虛擬 Console 的 ttyv5ttyv8 的最後四行一開始。 請勿將系統 Console ttyv0 加上註解符號。 注意,若有依照 安裝並設定 Xorg 時,會用到最後一個虛擬 Console (ttyv8)。 - - 有關各欄位的設定以及其他選項,請參閱 ttys5 說明。 - - - - 單使用者模式 - - FreeBSD 開機選單會提供一個選項為 Boot Single User,若選擇該項目,系統將會進入所謂 單使用者模式 的特殊模式。 此模式通常用在修復系統無法開機或重設已忘掉的 root 密碼。 在當使用者模式中無法使用網路及其他虛擬 Console,但有完整 root 對系統的存取權限,而且預設是不須要輸入 root 密碼。 也因此,要能透過實體鍵盤操作才能進入此模式,在考量 FreeBSD 系統安全時須要限制可操作實體鍵盤的人員。 - - 有關單使用者模式的設定可在 /etc/ttys 中的以下章節中找到: - - # name getty type status comments -# -# If console is marked "insecure", then init will ask for the root password -# when going to single-user mode. -console none unknown off secure - - 預設狀態為安全 (secure),這代表誰能夠操作實體鍵盤不是不重要就是已受到實體安全規範管制。 若設定更該為不安全 (insecure) 則代表主機所在的環境不安全,因為任何人皆可接觸鍵盤。 當此行設定更改為不安全 (insecure) 時,當使用擇選擇單使用者模式時,FreeBSD 將會要求輸入 root 的密碼。 - - - 請審慎考慮是否要改為 insecure! 因為萬一忘記 root 密碼的話,雖然還是有其他辦法可以登入單使用者模式,只是對不熟 FreeBSD 開機程序的人可就麻煩了。 - - - - - 更改 Console 影像模式 - - FreeBSD Console 預設顯示大小可以調整為 1024x768、1280x1024 或其他顯示卡與螢幕有支援的解析度大小。 要使用不同的影像模式需載入 VESA 模組: - - # kldload vesa - - 要偵測硬體支援的影像模式,可使用 vidcontrol1。 要取得支援的影像模式清單可輸入以下指令: - - # vidcontrol -i mode - - 該指令會顯示硬體所支援的影像模式清單,要採用新的影像模式需以 root 使用者執行 vidcontrol1 指令: - - # vidcontrol MODE_279 - - 若可接受新的影像模式,可以在 /etc/rc.conf 加入設定,讓每次重開機後會自動生效: - - allscreens_flags="MODE_279" - - - - - - - 使用者與基礎帳號管理 - - FreeBSD 允許多使用者同時使用電腦,在一次只能有一位使用者坐在電腦螢幕前使用鍵盤操作的同時,可讓任何數量的使用者透過網路登入到系統。每一位要使用該系統的使用者應有自己的帳號。 - - 本章介紹: - - - - FreeBSD 系統中各種類型的使用者帳號。 - - - - 如何加入、移除與修改使用者帳號。 - - - - 如何設定用來控制使用者與群組允許存取的資源的限制。 - - - - 如何建立群組與加入使用者作為群組成員。 - - - - - 帳號類型 - - 由於所有對 FreeBSD 系統的存取是透過使用者帳號來達成,且所有的程序需要經由使用者來執行,因此使用者帳號管理非常重要。 - - 有三種主要類型的帳號:系統帳號、使用者帳號以及超級使用者帳號。 - - - 系統帳號 - - - accounts - system - - - 系統帳號用來執行服務,例如 DNS、郵件及網頁伺服器,要這麼作是因為安全性考量,若所有的服務均以超級使用者來執行,那麼這些服務的運作將不會受到限制。 - - - accounts - daemon - - - accounts - operator - - - 系統帳號的例子有 daemon, operator, bind, news, and www - - - accounts - nobody - - - nobody 是通用的無權限系統帳號。雖然如此,只有要越多的服務使用 nobody,就會有更多的檔案與程式與該使用者相關聯,會讓該使用者擁有更多的權限。 - - - - 使用者帳號 - - - accounts - user - - - 使用者帳號會分配給實際人員,用來登入及使用系統。每位要存取系統的人員需要擁有一組唯一的使用者帳號,這可讓管理者辨識誰在做什麼以及避免使用者覆蓋其他使用者的設定。 - - 每位使用者可以設定自己的環境來配合自己使用系統的習慣,透過設定預設的 Shell、編輯器、組合鍵 (Key Binding) 及語言設定。 - - 每個在 FreeBSD 系統的使用者帳號都會有一些相關的資訊: - - - - 使用者名稱 (User name) - - - login: 提示出現時便要輸入使用者名稱,每位使用者必須要有一個唯一的使用者名稱。要建立有效的使用者名稱要遵守數條規則,在 passwd5 中有說明。建議使用者名稱由 8 個或更少的字母組成,全部採用小寫字元以向下相容應用程式。 - - - - - 密碼 (Password) - - - 每個帳號都會有密碼。 - - - - - 使用者 ID (UID) - - - 使用者 ID (User ID, UID) 是一組數字用來獨一無二的辨識 FreeBSD 系統的使用者,用到使用者名稱的指令會先將使用者名稱轉換為 UID。建議使用小於 65535 的 UID,超過這個值可能會造成部份軟體的相容性問題。 - - - - - 群組 ID (GID) - - - 群組 ID (Group ID, GID) 是一組數字用來獨一無二的辨識使用者所屬的主要群組。群組是一個除了使用 UID 之外根據使用者的 GID 來控制資源存取權的機制。這可以顯著的降低某些設定檔的大小且可讓使用者成為一個以上群組的成員。建議使用 65535 或以下的 GID,因超過此值的 GID 可能會讓部份軟體無法運作。 - - - - - 登入類別 (Login class) - - - 登入類別 (Login class) 擴充了群組機制,當在對不同使用者客製化系統時可提供額外的彈性。在 有對登入類別更進一步的討論。 - - - - - 密碼更改時間 (Password change time) - - - 預設情況下密碼並不會過期,雖然如此,密碼期限可在各別使用者上開啟,可強制部份或所有使用者在某段期間過後更改他們的密碼。 - - - - - 帳號到期時間 (Account expiration time) - - - 預設情況下 FreeBSD 的帳號不會有期限。當建立需要有限壽命的帳號時,例如,學校的學生帳號,可使用 pw8 指定帳號的到期日期。到期日期過後,便無法使用該帳號登入到系統,儘管該帳號的目錄及檔案仍存在。 - - - - - 使用者的全名 (User's full name) - - - 使用者名稱用來獨一無二的辦識 FreeBSD 的帳號,但並不一定反映了使用者的真實姓名。類似註解,這個資訊可以含有空白、大寫字元並可超過 8 個字母的長度。 - - - - - 家目錄 (Home directory) - - - 家目錄是系統中某個目錄的完整路徑,這個目錄是使用者登入後的起點目錄。習慣上會將所有使用者目錄放置在 /home/username/usr/home/username。每位使用者可以儲存他們的個人檔案及子目錄於他們自己的家目錄。 - - - - - 使用者 Shell (User shell) - - - Shell 提供了使用者預設的環境來與系統互動。有數種不同類型的 Shell,有經驗的使用者會有自己偏好的選擇,可儲存在自己的帳號設定。 - - - - - - - 超級使用者帳號 - - - accounts - superuser (root) - - - 超級使用者帳號,通常稱作 root,用來管理系統,沒有權限的限制,也因這個原因,該帳號不應該用來做每日的例行作業,如:寄信與收信、系統的一般探索或程式設計。 - - 超級使用者並不像其他使用者帳號,可以沒有限制的操作,不正確的使用超級使用者帳號可能會造成可觀的災害。一般使用者帳號不會因為失誤而法摧毀作業系統,所以建議登入一般使用者帳號,只有在指令需要額外權限時切換為超級使用者。 - - 使用超級使用者下指令時永遠要再三檢查,由於一個多餘的空白或缺少的字元可能意味著無法挽回的資料遺失。 - - 有數種方法可以提升為超級使用者權限,雖然可以直接登入為 root,但強烈不建議這樣做。 - - 改使用 su1 切換為超級使用者。執行此指令時若指定 - 參數,該使用者會繼承 root 的使用者環境。執行此指令的使用者必須在 wheel 群組中,否則指令會失敗。使用者也必須要知道 root 使用者帳號的密碼。 - - 在此例當中,該使用者只在要執行 make install 時切換為超級使用者,因為這個步驟需要超級使用者權限。指令完成之後,該使用者輸入 exit 離開超級使用者帳號並返回他的使用者帳號權限。 - - - 以超級使用者的身份安裝程式 - - % configure -% make -% su - -Password: -# make install -# exit -% - - - 內建的 su1 框架在單人系統或只有一位系統管理者的小型網路可以運作的很好。另一種方式是安裝 security/sudo 套件或 Port。此軟體提供了活動記錄且允許管理者設定那個使用者可以用超級使用者執行那個指令。 - - - - - 管理帳號 - - - accounts - modifying - - - FreeBSD 提供了各種不同指令來管理使用者帳號,最常用的指令已摘要於 ,接著有一些用法的範例。請參考每個工具的操作手冊來取得更多詳細的資訊與用法範例。 - - - 管理使用者帳號的工具 - - - - - - - - 指令 - 摘要 - - - - - adduser8 - 建議用來新增新使用者的指令列應用程式。 - - - - rmuser8 - 建議用來移除使用者的指令列應用程式。 - - - - chpass1 - 用來更改使用者資料庫資訊的工具。 - - - - passwd1 - 用來更改使用者密碼的指令列工具。 - - - - pw8 - 用來修改使用者帳號各方面資訊強大且靈活的工具。 - - - -
- - - <command>adduser</command> - - - accounts - adding - - - adduser - - - /usr/share/skel - - - skeleton directory - - - 建議用來新增新使用者的程式為 adduser8。當新使用者新增之後,此程式會自動更新 /etc/passwd 以及 /etc/group,這同時也會建立新使用者的家目錄 (複製 /usr/share/skel 中的預設設定檔),並且可以選擇是否要寄送歡迎訊息通知新使用者。這個工具必須使用超級使用者執行。 - - adduser8 工具採用互動的方式,只需幾個步驟便可建立新使用者帳號。如 所示,可輸入必填的資訊或按 Return 鍵採用方括中的預設值。在此例當中,使用者被邀請加入 wheel 群組,這讓使用者可使用 su1 變成超級使用者。完成之後,此工具會詢問是否要建立其他的使用者或離開。 - - - 在 FreeBSD 新增使用者 - - # adduser -Username: jru -Full name: J. Random User -Uid (Leave empty for default): -Login group [jru]: -Login group is jru. Invite jru into other groups? []: wheel -Login class [default]: -Shell (sh csh tcsh zsh nologin) [sh]: zsh -Home directory [/home/jru]: -Home directory permissions (Leave empty for default): -Use password-based authentication? [yes]: -Use an empty password? (yes/no) [no]: -Use a random password? (yes/no) [no]: -Enter password: -Enter password again: -Lock out the account after creation? [no]: -Username : jru -Password : **** -Full Name : J. Random User -Uid : 1001 -Class : -Groups : jru wheel -Home : /home/jru -Shell : /usr/local/bin/zsh -Locked : no -OK? (yes/no): yes -adduser: INFO: Successfully added (jru) to the user database. -Add another user? (yes/no): no -Goodbye! -# - - - - 由於密碼在輸入時並不會顯示,在建立使用者帳號時要小心密碼不要輸入錯誤。 - - - - - <command>rmuser</command> - - - rmuser - - - accounts - removing - - - 要自系統完全移除一個使用者可使用超級使用者執行 rmuser8。這個指令會執行以下步驟: - - - - 移除使用者的 crontab1 項目,若項目存在。 - - - - 移除任何屬於該使用者的 at1 工作。 - - - - 中止所有該使用者擁有的程序。 - - - - 自系統本地密碼檔移除該使用者。 - - - - 選擇性移除該使用者的家目錄,若使用者擁有該目錄。 - - - - /var/mail 移除屬於該使用者的收件郵件檔。 - - - - 自暫存檔儲存區域 (如 /tmp) 移除所有使用者擁有的檔案。 - - - - 最後,自 /etc/group 中該使用者所屬的所有群組移除該使用者。若群組無任何成員且群組名稱與該使用者名稱相同,則該群組也會一併移除。這是為了輔助 adduser8 替每位使用者建立獨一無二的群組。 - - - - rmuser8 無法用來移除超級使用者帳號,因為這幾乎代表著大規模破壞。 - - 預設會使用互動式模式,如下範例所示。 - - - <command>rmuser</command> 互動式帳號移除 - - # rmuser jru -Matching password entry: -jru:*:1001:1001::0:0:J. Random User:/home/jru:/usr/local/bin/zsh -Is this the entry you wish to remove? y -Remove user's home directory (/home/jru)? y -Removing user (jru): mailspool home passwd. -# - - - - - <command>chpass</command> - - - chpass - - - 任何使用者都可以使用 chpass1 來變更自己的預設 Shell 以及與自己的使用者帳號關聯的個人資訊。超級使用者可以使用這個工具更改任何使用者的其他帳號資訊。 - - 除了選填的使用者名稱外,未傳入任何選項時,chpass1 會開啟含有使用者資訊的編輯器。當使用者自編輯器離開,便會更新新的資訊到使用者資料庫。 - - - 離開編輯器時,此工具會提示使用者輸入密碼,除非使用超級使用者執行此工具。 - - - 中,超級使用者輸入了 chpass jru 並正在檢視這個使用者可以更改的欄位。若改以 jru 執行這個指令,只會顯示最後六個欄位供編輯,如 所示。 - - - 以超級使用者的身份使用 <command>chpass</command> - - #Changing user database information for jru. -Login: jru -Password: * -Uid [#]: 1001 -Gid [# or name]: 1001 -Change [month day year]: -Expire [month day year]: -Class: -Home directory: /home/jru -Shell: /usr/local/bin/zsh -Full Name: J. Random User -Office Location: -Office Phone: -Home Phone: -Other information: - - - - 以一般使用者的身份使用 <command>chpass</command> - - #Changing user database information for jru. -Shell: /usr/local/bin/zsh -Full Name: J. Random User -Office Location: -Office Phone: -Home Phone: -Other information: - - - - 指令 chfn1 以及 chsh1 皆連結至 chpass1,就如同 ypchpass1, ypchfn1 以及 ypchsh1 的關係。自從 NIS 支援自動化以後,便不再需要特別加上 yp,如何設定 NIS 在 中有說明。 - - - - - <command>passwd</command> - - - passwd - - - accounts - changing password - - - 任何使用者皆可簡單的使用 passwd1 更改自己的密碼。要避免意外或未授權的變更,這個指令在設定新密碼之前會提示使用者輸入原來的密碼: - - - 更改您的密碼 - - % passwd -Changing local password for jru. -Old password: -New password: -Retype new password: -passwd: updating the database... -passwd: done - - - 超級使用者可以更改任何使用者的密碼透過在執行 passwd1 時指定使用者名稱。當此工具以超級使用者執行時,將不會提示輸入使用者目前的密碼,這可在使用者忘記原來的密碼時更改密碼。 - - - 以超級使用者的身份更改其他使用者的密碼 - - # passwd jru -Changing local password for jru. -New password: -Retype new password: -passwd: updating the database... -passwd: done - - - - 如同 chpass1yppasswd1 連結到 passwd1,因此 NIS 在兩個指令上皆可運作。 - - - - - <command>pw</command> - - - pw - - - pw8 工具可以建立、移除、修改以及顯示使用者與群組,它的功能是做為系統使用者與群組檔的前端。pw8 有非常強大的的指令列選項集,這讓該指令非常適合用於 Shell scripts,但新的使用者可能會發現它比其他在本節的指令要複雜許多。 - -
- - - 管理群組 - - - groups - - - /etc/groups - - - accounts - groups - - - 群組代表一群使用者,群組可以由其群組名稱及 GID 來辨識。在 FreeBSD,核心會使用程序的 UID 以及其所屬的群組清單來決定程序可以做那些事。大多數情況使用者或程序的 GID 通常指的是清單中的第一個群組。 - - 群組名稱與 GID 的對應表列在 /etc/group。這個純文字檔案使用了四個以冒號分隔的欄位,第一個欄位為群組名稱,第二個欄位為加密後的密碼,第二個欄位為 GID 以及第四個欄位為以逗號分隔的成員清單。要取得更完整的語法說明,請參考 group5 - - 超級使用者可以使用文字編輯器修改 /etc/group,或者可使用 pw8 加入與編輯群組。例如,要加入一個叫做 teamtwo 的群組然後確認該群組已新增: - - - 使用 <citerefentry><refentrytitle>pw</refentrytitle><manvolnum>8</manvolnum></citerefentry> 新增群組 - - # pw groupadd teamtwo -# pw groupshow teamtwo -teamtwo:*:1100: - - - 在本例中,1100teamtwoGID。目前 teamtwo 沒有任何成員,這個指令會加入 jru 作為 teamtwo 的成員。 - - - 使用 <citerefentry><refentrytitle>pw</refentrytitle><manvolnum>8</manvolnum></citerefentry> 加入使用者帳號到新的群組 - - # pw groupmod teamtwo -M jru -# pw groupshow teamtwo -teamtwo:*:1100:jru - - - 的參數是以逗號分隔的使用者清單,用來加入成員到新的 (空的) 群組或取代既有群組中的成員。對使用者來說這裡的群組成員與使用者列於密碼檔的主要群組不同 (額外的),這代表在 pw8 使用 時不會顯示做為使用者主要群組的成員,但會顯示在使用 id1 或同類工具所查詢的資訊當中。當使用 pw8 來加入使用者到某個群組,該指令只會處理 /etc/group 且不會嘗試自 /etc/passwd 讀取其他的資料。 - - - 使用 <citerefentry><refentrytitle>pw</refentrytitle><manvolnum>8</manvolnum></citerefentry> 加入新成員到群組 - - # pw groupmod teamtwo -m db -# pw groupshow teamtwo -teamtwo:*:1100:jru,db - - - 在本例當中,給 的參數是以逗號分隔的使用者清單,用來加入使用者到群組。不像前面的例子,這些使用者會加入到群組,而非取代既有群組中的使用者。 - - - 使用 <citerefentry><refentrytitle>id</refentrytitle><manvolnum>1</manvolnum></citerefentry> 來查看所屬群組 - - % id jru -uid=1001(jru) gid=1001(jru) groups=1001(jru), 1100(teamtwo) - - - 在本例中,jru 是群組 jru 以及 teamtwo 的成員。 - - 要取得更多有關此指令的資訊及 /etc/group 的格式,請參考 pw8 以及 group5 - -
- - - 權限 - - - UNIX - - - 在 FreeBSD 中,每個檔案與目都有相關聯的數個權限,且有許多工具可以檢視與修改這些權限。了解權限如何運作是必須的,這可確保使用者能夠存存取它們所需的檔案以及無法不正確的存取供作業系統或其他使用者擁有的檔案。 - - 本節會探討在 FreeBSD 中所用到的傳統 UNIX 權限。要做檔案系統存取控制的微調,請參考 - - UNIX,基礎權限透過三種類型的存取來分配:讀取、寫入與執行。這些存取類型用來決定檔案擁有者、群組以及其他人 (其他任何人) 的檔案存取權。讀取、寫入及執行權限可使用 r, w, and x 字母來表示。這些權限也可以使用二進位數字來表示每種權限的開或關 (0)。當以二進位數字來表示時,閱讀的順序為 rwx,其中 r 開啟的值為 4w 開啟的值為 2 以及 x 開啟的值為 1 - - 表格 4.1 摘要了可用的數字及可用的字母。當閱讀 目錄清單標示 欄位時,- 用來代表該權限設為關閉。 - - - permissions - - - file permissions - - - - <trademark class="registered">UNIX</trademark> 權限 - - - - - 數值 - 權限 - 目錄清單標示 - - - - - - 0 - 不可讀取, 不可寫入, 不可執行 - --- - - - - 1 - 不可讀取, 不可寫入, 可執行 - --x - - - - 2 - 不可讀取, 可寫入, 不可執行 - -w- - - - - 3 - 不可讀取, 可寫入, 可執行 - -wx - - - - 4 - 可讀取, 不可寫入, 不可執行 - r-- - - - - 5 - 可讀取, 不可寫入, 可執行 - r-x - - - - 6 - 可讀取, 可寫入, 不可執行 - rw- - - - - 7 - 可讀取, 可寫入, 可執行 - rwx - - - -
- - - ls1 - - - directories - - - 使用 ls1 指令時,可以加上 參數, 來檢視詳細的目錄清單。 清單中欄位的資訊包含檔案對所有者、群組及其他人的權限。 在任一個目錄底下執行 ls -l,會顯示如下的結果: - - % ls -l -total 530 --rw-r--r-- 1 root wheel 512 Sep 5 12:31 myfile --rw-r--r-- 1 root wheel 512 Sep 5 12:31 otherfile --rw-r--r-- 1 root wheel 7680 Sep 5 12:31 email.txt - - 第一個 (最左邊) 的字元用來表示這個檔案的類型為何,除標準檔案以外,尚有目錄、特殊字元裝置、Socket 及其他特殊虛擬檔案裝置, 在此例當中,- 表示該檔案為一個標準的檔案。 範例中接下來的三個字元中,rw- 代表所有者對檔案擁有的權限。 再接下來的三個字元, r-- 則代表群組對檔案擁有的權限, 最後三個字元,r-- 則代表其他人對檔案擁有的權限。 破折號 (-) 表示沒有權限,範例中的這個檔案的權限, 只允許所有者讀取、寫入檔案,群組以及其他人僅能讀取檔案。 根據以上的表格,此種權限的檔案可以使用 644 來表示, 每組數字分別代表檔案的三種權限。 - - 那系統如何控制裝置的權限? 實際上 FreeBSD 對大多的硬碟裝置就如同檔案,程式可以開啟、讀取以及寫入資料如一般檔案。 這些特殊裝置檔案都儲存於 /dev/ 目錄中。 - - 目錄也同如檔案,擁有讀取、寫入及執行的權限, 但在執行權限上與檔案有明顯的差異。 當目錄被標示為可執行時,代表可以使用 cd1 指令切換進入該目錄。 也代表能夠存取在此目錄之中的已知檔名的檔案,但仍會受限於檔案本身所設定的權限。 - - 要能夠列出目錄內容,必須擁有目錄的讀取權限。 要刪除已知檔名的檔案,必須擁有檔案所在目錄的寫入 以及 執行的權限。 - - 還有一些權限位元,但這些權限主要在特殊情況使用,如 setuid 執行檔及 sticky 目錄。 如果您還想知道更多檔案權限的資訊及使用方法,請務必參閱 chmod1 - - - - 權限符號 - - - - - Tom - Rhodes - - Contributed by - - - - - - permissions - symbolic - - - 權限符號可稱做符號表示,使用字元的方式來取代使用數值來設定檔案或目錄的權限。 符號表示的格式依序為 (某人)(動作)(權限),可使用的符號如下: - - - - - - 項目 - 字母 - 代表意義 - - - - - - (某人) - u - 使用者 - - - - (某人) - g - 群組所有者 - - - - (某人) - o - 其他 - - - - (某人) - a - 全部 (world) - - - - (動作) - + - 增加權限 - - - - (動作) - - - 移除權限 - - - - (動作) - = - 指定權限 - - - - (權限) - r - 讀取 - - - - (權限) - w - 寫入 - - - - (權限) - x - 執行 - - - - (權限) - t - Sticky 位元 - - - - (權限) - s - 設定 UID 或 GID - - - - - - 如先前同樣使用 chmod1 指令來設定,但使用的參數為這些字元。 例如,您可以使用下列指令禁止其他使用者存取檔案 FILE - - % chmod go= FILE - - 若有兩個以上的權限更改可以使用逗號 (,) 區隔。 例如,下列指令將會移除群組及全部人 (world) 對檔案 FILE 的寫入權限, 並使全部人對該檔有執行權限: - - % chmod go-w,a+x FILE - - - - - - - FreeBSD 檔案旗標 - - - - - Tom - Rhodes - - Contributed by - - - - - 除了前面提到的檔案權限外,FreeBSD 支援使用 檔案旗標。 這些旗標增加了檔案的安全性及管理性,但不包含目錄。有了檔案旗標可確保在某些時候 root 不會意外將檔案修改或移除。 - - 修改的檔案 flag 僅需要使用擁有簡易的介面的 chflags1 工具。 例如,標示系統禁止刪除的旗標於檔案 file1,使用下列指令: - - # chflags sunlink file1 - - 若要移除系統禁止刪除的旗標,只需要簡單在 前加上 no,例如: - - # chflags nosunlink file1 - - 使用 ls1 及參數 可檢視檔案目前的旗標: - - # ls -lo file1 - - -rw-r--r-- 1 trhodes trhodes sunlnk 0 Mar 1 05:54 file1 - - 多數的旗標僅能由 root 使用者來標示或移除,而部份旗標可由檔案所有者設定。 我們建議系統管理者可閱讀 chflags1chflags2 說明以瞭解相關細節。 - - - - - <literal>setuid</literal> 、<literal>setgid</literal> 與 <literal>sticky</literal> 權限 - - - - - Tom - Rhodes - - Contributed by - - - - - 除了已經探討過的權限外,這裡尚有另外三種特別的設定所有管理者都應該知道,這些設定為 setuid, setgid 以及 sticky 權限。 - - 這些設定對某些一般不會授權給一般使用者的 UNIX 操作非常重要,它讓這些功能可運作。要了解這些權限,就必須說明真實使用者 ID (Real user ID) 與有效使用者 ID (Effective user ID) 的差異。 - - 真實使用者 ID 即是擁有者或啟動程序者的 UID,而有效 UID 是執行程序所使用的使用者 ID。例如,passwd1 在使用者更改自己的密碼時會以真實使用者 ID 執行,然而,為了要更新密碼資料庫,該指令必須以 root 使用者做為有效 ID 來執行,這讓使用者可以更改自己的密碼而不會遇到權限不足 (Permission Denied) 的錯誤。 - - setuid 權限可以透過在權限集前加上數字 (4) 來設定,如下範例所示: - - # chmod 4755 suidexample.sh - - 現在 suidexample.sh 的權限會如下所示: - - -rwsr-xr-x 1 trhodes trhodes 63 Aug 29 06:36 suidexample.sh - - 注意,s 現在取代了原來的執行位元成為指定檔案擁有者權限集的一部份,這會允許須要提升權限的工具,如 passwd1 可正常使用。 - - - mount8nosuid 選項會造成這類 Binary 執行失敗,但不會警告使用者。由於 nosuid Wrapper 可能可繞過該選項,因此該選項並非完全可靠。 - - - 實際來看這個範例,先開啟兩個終端機,其中一個用一般使用者輸入 passwd。在等待輸入新密碼的同時,檢查程序表並查看 passwd1 程序的使用者資訊: - - 於終端機 A: - - Changing local password for trhodes -Old Password: - - 於終端機 B: - - # ps aux | grep passwd - - trhodes 5232 0.0 0.2 3420 1608 0 R+ 2:10AM 0:00.00 grep passwd -root 5211 0.0 0.2 3620 1724 2 I+ 2:09AM 0:00.01 passwd - - 雖然使用一般使用者來執行 passwd1,但該程序使用了 root 的有效 UID - - setgid 權限的功能與 setuid 相似,當應用程式或工具使用此設定執行時,將會以擁有該檔案的群組來執行,而非執行行該程序的使用者。 - - 要在檔案設定 setgid 權限,需在 chmod1 的參數前加上 (2): - - # chmod 2755 sgidexample.sh - - 注意以下清單中,s 現在位於指定群組權限設定的欄位: - - -rwxr-sr-x 1 trhodes trhodes 44 Aug 31 01:49 sgidexample.sh - - - 在以上這些範例中,雖然在例子中的 Shell script 是可執行的檔案,但並不會以其他的 EUID 或有效使用者 ID 執行,這是因為 Shell script 並不會存取 setuid2 系統呼叫 (System call)。 - - - setuidsetgid 權限位元可能會因允許提升權限而降低系統的安全性,因此有了第三個特殊的權限:sticky bit,可以加強系統的安全性。 - - 當在目錄上設定 sticky bit,將只允許由檔案擁有者刪除檔案。這對避免公開目錄,如 /tmp 中的檔案被不擁有該檔案的人刪除非常有用。要使用這個權限,可在權限集前加上 (1): - - # chmod 1777 /tmp - - sticky bit 權限會以 t 顯示於權限集的最後: - - # ls -al / | grep tmp - - drwxrwxrwt 10 root wheel 512 Aug 31 01:49 tmp - - -
- - - 目錄結構 - - - directory hierarchy - - - 認識 FreeBSD 的目錄架構,就可對系統有概略的基礎理解。 最重要的莫過於整個目錄的根目錄,就是 / 目錄, 該目錄會在開機時最先掛載 (mount),裡面會有開機所會用到必備檔案。 此外,根目錄還有紀錄其他檔案系統的掛載點相關設定。 - - 「掛載點」就是讓新增的檔案系統,能接到上層的檔案系統 (通常就是「根目錄」檔案系統) 的目錄。 在 這邊對此有更詳細介紹。 標準的掛載點包括了 /usr/, /var/, /tmp/, /mnt/ 以及 /cdrom/。 這些目錄通常會記錄在 /etc/fstab 設定檔內。 /etc/fstab 是記錄各檔案系統及相關掛載點的表格。 大部分在 /etc/fstab 有記錄的檔案系統,會在開機時由 rc8 Script 來自動掛載,除非它們有設定 選項。 其中細節說明可參閱 - - 有關檔案系統架構的完整說明可參閱 hier7。 現在呢,讓我們大致先一窺常見的目錄有哪些吧。 - - - - - - - 目錄 - 說明 - - - - - / - 檔案系統的根目錄。 - - - - /bin/ - 單使用者 (Single-user)、多使用者 (Multi-user) 兩種模式皆可使用的基本工具 。 - - - - /boot/ - 作業系統開機過程會用到的程式、設定檔。 - - - - /boot/defaults/ - 預設的開機啟動設定檔,詳情請參閱 loader.conf5 - - - - /dev/ - 裝置節點 (Device node),詳情請參閱 intro4 - - - - /etc/ - 系統設定檔及一些 Script 檔。 - - - - /etc/defaults/ - 預設的系統設定檔,詳情請參閱 rc8 - - - - /etc/mail/ - 郵件傳輸代理程式,像是 sendmail8 的相關設定檔。 - - - - /etc/periodic/ - 每日、每週、每月透過 cron8,執行的定期排程 Script,詳情請參閱 periodic8 - - - - /etc/ppp/ - ppp8 設定檔。 - - - - /mnt/ - 系統管理者慣用充當臨時掛載點的空目錄。 - - - - /proc/ - 程序 (Process) 檔案系統,詳情請參閱 procfs5mount_procfs8 - - - - /rescue/ - 緊急救援用途的一些靜態連結 (Statically linked) 的程式,詳情請參閱 rescue8 - - - - /root/ - root 帳號的家目錄。 - - - - /sbin/ - 供單使用者 (Single-user) 及多使用者 (Multi-user) 環境使用的系統程式及管理工具 。 - - - - /tmp/ - 臨時檔案。 一般而言,重開機之後 /tmp 內的東西會被清除掉。 而通常會將以記憶體為基礎 (Memory-based) 的檔案系統掛載在 /tmp 上。 這些瑣事可透過 tmpmfs 相關的 rc.conf5 環境變數來自動完成 。(或是在 /etc/fstab 內做設定, 詳情請參閱 mdmfs8)。 - - - - /usr/ - 主要是使用者所安裝的工具程式、應用程式存放處。 - - - - /usr/bin/ - 常用工具、開發工具、應用軟體。 - - - - /usr/include/ - 標準 C include 檔案。 - - - - /usr/lib/ - 程式庫存放處。 - - - - - /usr/libdata/ - 其他各式工具的資料檔。 - - - - /usr/libexec/ - 系統 Daemon 及系統工具程式 (透過其他程式來執行)。 - - - - /usr/local/ - 存放一些自行安裝的執行檔、程式庫等等。 同時,也是 FreeBSD Port 架構的預設安裝目錄。 /usr/local 內的目錄架構大致與 /usr 相同,詳情請參閱 hier7 說明。 但 man 目錄例外,它們是直接放在 /usr/local 底下,而非 /usr/local/share,而 Port 所安裝的說明文件則在 share/doc/port - - - - /usr/obj/ - 在編譯 /usr/src 目錄時所產生的相關架構目地檔。 - - - - /usr/ports/ - FreeBSD Port 套件集 (選用)。 - - - - /usr/sbin/ - 由使用者執行的系統 Daemon 及系統工具。 - - - - /usr/share/ - 各架構皆共通的檔案。 - - - - /usr/src/ - BSD 原始碼 (或自行新增的)。 - - - - /var/ - 存放各種用途的日誌 (Log) 檔、臨時或暫時存放、列印或郵件的緩衝 (Spool) 檔案。有時候,以記憶體為基礎 (Memory-based) 的檔案系統也會掛載在 /var。 這些瑣事可透過 varmfs 相關的 rc.conf5 環境變數來自動完成。(或是在 /etc/fstab 內做設定,相關細節請參閱 mdmfs8)。 - - - - /var/log/ - 各項系統記錄的日誌 (Log) 檔。 - - - - /var/mail/ - 各使用者的郵件 (Mailbox) 檔案。 - - - - /var/spool/ - 各種印表機、郵件系統的緩衝 (Spool) 目錄。 - - - - /var/tmp/ - 臨時檔案。 這些檔案在重開機後通常仍會保留,除非 /var 是屬於以記憶體為基礎 (Memory-based) 的檔案系統。 - - - - /var/yp/ - NIS 對應表。 - - - - - - - - 磁碟組織 - - FreeBSD 用來尋找檔案的最小單位就是檔案的名稱了。 檔案的名稱有大小寫之分,所以說 readme.txtREADME.TXT 是兩個不同的檔案。 FreeBSD 並不使用副檔名 (.txt) 來判別這是一個程式檔、文件檔或是其他類型的檔案。 - - 檔案存在目錄裡面。 一個目錄中可能沒有任何檔案,也可能有好幾百個檔案。 目錄之中也可以包含其他的目錄; 您可以建立階層式的目錄以便資料的管理。 - - 檔案或目錄的對應是藉由給定的檔案或目錄名稱,然後加上正斜線符號 (/);之後再視需要加上其他的目錄名稱。 如果您有一個目錄 foo ,裡面有一個目錄叫作 bar,這個目錄中又包含了一個叫 readme.txt 的檔案,那麼這個檔案的全名,或者說檔案的路徑 (Path)就是 foo/bar/readme.txt。注意這與 Windows 用來分隔檔案與目錄名稱所使用的 \ 不同,且 FreeBSD 在路徑上並不使用磁碟機代號或其他磁碟機名稱,意思是,在 FreeBSD 上不會有人輸入 c:\foo\bar\readme.txt 這種路徑。 - - 目錄及檔案儲存在檔案系統 (File system) 之中。 每個檔案系統都有唯一一個最上層的目錄,叫做根目錄 (Root directory)。 然後在這個根目錄下面才能有其他的目錄。其中一個檔案系統會被指定成為根檔案系統 (Root file system)/,其他的檔案系統均會掛載 (Mount) 在該根檔案系統之下,不論在 FreeBSD 有多少個磁碟,所有目錄都會成為該磁碟的一部份。 - - 假設您有三個檔案系統,分別叫作 A, BC。 每個檔案系統都包含兩個目錄,叫做 A1, A2 (以此類推得 B1, B2C1, C2)。 - - A 為主要的檔案系統;如果您用 ls1 指令查看此目錄的內容,您會看到兩個子目錄: A1A2,如下所示: - - - - - - - - / - | - +--- A1 - | - `--- A2 - - - - 一個檔案系統必須以目錄形式掛載於另一個檔案系統上。 因此,假設您將 B 掛載於 A1 之上,則 B 的根目錄就變成了 A1,而在 B 之下的任何目錄的路徑也隨之改變: - - - - - - - - / - | - +--- A1 - | | - | +--- B1 - | | - | `--- B2 - | - `--- A2 - - - - B1B2 目錄中的任何檔案必須經由路徑 /A1/B1/A1/B2 才能達到。 所有原來在 /A1 中的檔案會暫時被隱藏起來,直到 B卸載 (Unmount) 後才會再顯現出來。 - - 如果 B 掛載在 A2 之上,則會變成: - - - - - - - - / - | - +--- A1 - | - `--- A2 - | - +--- B1 - | - `--- B2 - - - - 上面的路徑分別為 /A2/B1/A2/B2 - - 檔案系統可以掛在其他檔案系統的目錄之上。 延續之前的例子,C 檔案系統可以掛在檔案系統 BB1 目錄之上,如圖所示: - - - - - - - - / - | - +--- A1 - | - `--- A2 - | - +--- B1 - | | - | +--- C1 - | | - | `--- C2 - | - `--- B2 - - - - 或者 C 直接掛載於 AA1 目錄之上: - - - - - - - - / - | - +--- A1 - | | - | +--- C1 - | | - | `--- C2 - | - `--- A2 - | - +--- B1 - | - `--- B2 - - - - 您可以使用單一的一個大的根檔案系統而不建立其他的檔案系統。 這樣有好處也有有壞處。 - - - 使用多個檔案系統的好處 - - - 不同的檔案系統在掛上的時候可以有不同的 掛載參數 (Mount option)。 舉例來說,為求謹慎您可以將根檔案系統設成唯讀, 以避免不小心刪除或修改掉重要的檔案。 將使用者可寫入的檔案系統 (例如 /home) 獨立出來也可以讓他們用 nosuid 的參數掛載,此選項可以讓在這個檔案系統中執行檔的 suid/guid 位元失效,可讓系統更安全。 - - - - FreeBSD 會自動根據您檔案系統的使用方式來做最佳的檔案配置方式。 因此,一個有很多小檔案、 常常寫入的檔案系統跟只有幾個較大的檔案的檔案系統配置是不一樣的。 如果您只有單一個大的檔案系統,這部分就沒用了。 - - - - FreeBSD 的檔案系統在停電的時候很穩固。 然而,在某些重要的時候停電仍然會對檔案系統結構造成損害。 分割成許多個檔案系統的話在系統在停電後比較能夠正常啟動, 以便您在需要的時候將備份資料回存回來。 - - - - - 使用單一檔案系統的好處 - - - 檔案系統的大小是固定的。 若您在當初安裝 FreeBSD 的時指定了一個大小,可是後來您想把空間加大,在沒有備份的情況下很難達成,您必須將檔案系統重新建立為您需要的大小,然後將備份回存回來。 - - - FreeBSD 的 growfs8 指令可以突破此限制直接變更檔案系統的大小。 - - - - - 檔案系統放在分區 (Partition) 中。 因為 FreeBSD 承襲 UNIX 架構,這邊講的分區和一般提到的分割區 (例如 MS-DOS 分割區) 不同。每一個分區由一個代號 (字母) 表示,從 ah。 每個分區只能含有一個檔案系統,因此在表示檔案系統時,除了用該檔案系統的常用的掛載點表示外,也可以使用該檔案系統所在的分區來表示。 - - FreeBSD 也會使用磁碟空間作為交換空間 (Swap space) 來提供虛擬記憶體 (Virtual memory)。 這讓您的電腦好像擁有比實際更多的記憶體。 當 FreeBSD 的記憶體用完的時候,它會把一些目前沒用到的資料移到交換空間,然後在用到的時候移回去 (同時移出部份沒用到的)。 - - 有些分割區有特定的使用慣例。 - - - - - - - - - 分區 - 慣例 - - - - - - a - 通常含有根檔案系統。 - - - - b - 通常含有交換空間。 - - - - c - 通常用來代表整個切割區 (Slice),因此大小會與其所在的切割區一樣。這可讓需要對整個切割區處理的工具 (例如硬碟壞軌檢查工具) 可在 c 分區上執行。一般來說不會把檔案系統建立在這個分區。 - - - - d - 分區 d 曾經有代表特殊意義,但是已經不再使用。所以現在 d 和一般的分區相同。 - - - - - - 在 FreeBSD 的磁碟會分割成數個切割區 (Slice),如同 Windows 中由編號 1 到 4 表示的分割區。這些切割區會再分成數個分區,每個分區內含檔案系統,且會使用字母來標示。 - - - slices - - - partitions - - - dangerously dedicated - - - 切割區的編號在裝置名稱後面,會先以 s 為字首,然後從 1 開始編號。 因此 da0s1 是指第一個 SCSI 硬碟的第一個切割區。 一個磁碟上只能有四個實體切割區,但是在實體切割區中放進適當類型的邏輯切割區。這些延伸的切割區編號會從 5 開始,所以 ada0s5 是第一個 SATA 硬碟上的第一個延伸切割區。因此可以預期這些由檔案系統使用的裝置 (Device) 上均會各別佔據一個切割區。 - - 切割區、危險專用 (Dangerously dedicated) 的實體磁碟機以及其他內含分割區 (Partition) 的磁碟都是以字母 ah 來表示。 字母會接在裝置名稱的後面,因此 da0a 是第一顆 dangerously dedicated 磁碟機 da 上的 a 分割區。 而 ada1s3e 則是第二顆 SATA 硬碟上第三個切割區的第五個分區。 - - 終於,我們可以辨識系統上的每個磁碟了,一個磁碟的名稱會有一個代碼來表示這個磁碟的類型,接著是一個表示這是那一個磁碟的編號。不像切割區,磁碟的編號從 0 開始。常見的代碼可以參考 - - 當要參照一個分區的時候,需包含磁碟機名稱、s、切割區編號以及分區字母。範例可以參考 - - 示範了一個基本的磁碟配置,相信對您有些幫助。 - - 要安裝 FreeBSD,您必須先建置磁碟的切割區,接著於切割區中建立要給 FreeBSD 用的分區。 最後在這些分區中建立檔案系統 (或交換空間) 並決定要將這些檔案系統掛載於哪裡。 - - - 磁碟裝置名稱 - - - - - - - - 磁碟機類型 - 磁碟機裝置稱 - - - - - - SATAIDE 硬碟 - adaad - - - - SCSI 硬碟與 USB 儲存裝置 - da - - - - SATAIDE CD-ROM 光碟機 - cdacd - - - - SCSI CD-ROM 光碟機 - cd - - - - 軟碟機 - fd - - - - 各種非標準 CD-ROM 光碟機 - mcd 代表 Mitsumi CD-ROM 以及 scd 代表 Sony CD-ROM 光碟機 - - - - SCSI 磁帶機 - sa - - - - IDE 磁帶機 - ast - - - - RAID 磁碟機 - 範例包含 aacd 代表 Adaptec AdvancedRAID,mlxdmlyd 代表 Mylexamrd 代表 AMI MegaRAIDidad 代表 Compaq Smart RAID,twed 代表 3ware RAID. - - - -
- - - 磁碟、切割區及分區命名範例 - - - - - - - - - 名稱 - 意義 - - - - - - ada0s1a - 第一個 SATA 硬碟 (ada0) 上第一個切割區 (s1)的第一個分區(a) 。 - - - - da1s2e - 第二個 SCSI 硬碟 (da1) 上第二個切割區 (s2) 的第五個分區 (e) 。 - - - - - - - - 磁碟的概念模型 - - 此圖顯示 FreeBSD 中連接到系統的第一個 SATA 磁碟機內部配置圖。 假設這個磁碟的容量是 250 GB,並且包含了一個 80 GB 的切割區及一個 170 GB 的切割區 (MS-DOS 的分割區)。 第一個切割區是 Windows NTFS 檔案系統的 C: 磁碟機,第二個則安裝了 FreeBSD。 本範例中安裝的 FreeBSD 有四個資料分區及一個交換分區。 - - 這四個分區中各有一個檔案系統。 分區 a 是根檔案系統、分區 d/var/、分區 e/tmp/,而分區 f/usr/。分區字母 c 用來代表整個切割區,因此並不作為一般分區使用。 - - - - - - - -
- - - 掛載與卸載檔案系統 - - 檔案系統就像一顆樹。/ 就像是樹根,而 /dev/usr 以及其他在根目錄下的目錄就像是樹枝,而這些樹枝上面又還有分支,像是 /usr/local 等。 - - - root file system - - - 因為某些原因,我們會將一些目錄分別放在不同的檔案系統上。 如 /var 包含了可能會滿出來的 log/spool/ 等目錄以及各式各樣的暫存檔。 把根檔案系統塞到滿出來顯然不是個好主意,所以我們往往會比較傾向把 /var/ 中拉出來。 - - 另一個常見到把某些目錄放在不同檔案系統上的理由是: 這些檔案在不同的實體或虛擬磁碟機上。 像是網路檔案系統 (Network File System) 詳情可參考 或是光碟機。 - - - <filename>fstab</filename> 檔 - - - file systems - mounted with fstab - - - /etc/fstab 裡面有設定的檔案系統會在開機 () 的過程中自動地被掛載 (除非該檔案系統有被加上 參數)。檔案內容的格式如下: - - device /mount-point fstype options dumpfreq passno - - - - device - - 已存在的裝置名稱,詳情請參閱 - - - - - mount-point - - - 檔案系統要掛載到的目錄 (該目錄必須存在)。 - - - - - fstype - - - 檔案系統類型,這是要傳給 mount8 的參數。 FreeBSD 預設的檔案系統是 ufs - - - - - options - - - 可讀可寫 (Read-Write) 的檔案系統用 ,而唯讀 (Read-Only) 的檔案系統則是用 ,後面視需要還可以加其他選項。 常見的選項如 是用在不要於開機過程中自動的掛載的檔案系統。 其他選項可參閱 mount8 說明。 - - - - - dumpfreq - - - dump8 由此項目決定那些檔案系統需要傾印。 如果這格空白則以零為預設值。 - - - - - passno - - - 這個項目決定檔案系統檢查的順序。 對於要跳過檢查的檔案系統,它們的 passno 值要設為零。 根檔案系統的 passno 值應設為一 (因為需要比所有其他的還要先檢查),而其他的檔案系統的 passno 值應該要設得比一大。 若有多個檔案系統具有相同的 passno 值,則 fsck8 會試著平行地 (如果可能的話) 檢查這些檔案系統。 - - - - - 更多關於 /etc/fstab 檔案格式及選項的資訊請參閱 fstab5 說明文件。 - - - - 使用 <citerefentry><refentrytitle>mount</refentrytitle><manvolnum>8</manvolnum></citerefentry> - - - file systems - mounting - - - mount8 指令是拿來掛載檔案系統用的。基本的操作指令格式如下: - - - # mount device mountpoint - - - mount8 裡面有提到一大堆的選項,不過最常用的就是這些: - - - 掛載選項 - - - - - - 把 /etc/fstab 裡面所有還沒有被掛載、沒有被標記成 /etc/fstab 而且沒有用 排除的檔案系統掛載起來。 - - - - - - - - - 執行所有的動作,但是不真的去呼叫掛載的系統呼叫 (System call)。 這個選項和 搭配拿來推測 mount8 將要做什麼動作時很好用。 - - - - - - - - 強迫掛載不乾淨的檔案系統 (危險),或是用來強制取消寫入權限 (把檔案系統的掛載狀態從可存取變成唯讀)。 - - - - - - - - 用唯讀的方式掛載檔案系統。 這個選項和在 -o 選項中指定 ro 參數是一樣的。 - - - - - - fstype - - - 用指定的檔案系統型態來掛載指定的檔案系統,或是在有 選項時只掛載指定型態的檔案系統。預設的檔案系統類型為 ufs - - - - - - - - 更新檔案系統的掛載選項。 - - - - - - - - 顯示詳細資訊。 - - - - - - - - 以可讀寫的模式掛載檔案系統。 - - - - - 選項後面會接著以逗號分隔的參數: - - - - nosuid - - - 不解析檔案系統上的 setuid 或 setgid 旗標, 這也是一個蠻有用的安全選項。 - - - - - - - 使用 <citerefentry><refentrytitle>umount</refentrytitle><manvolnum>8</manvolnum></citerefentry> - - - file systems - unmounting - - - 要卸載檔案系統可使用 umount8 指令。該指令需要一個參數可以是掛載點 (mountpoint),裝置名稱,以及 或是 等選項。 - - 加上 可以強制卸載,加上 則是會顯示詳細資訊。 要注意的是一般來說用 並不是個好主意,強制卸載檔案系統有可能會造成電腦當機, 或者損壞檔案系統內的資料。 - - 是用來卸載所有已掛載的檔案系統,另外還可以用 來指定要卸載的是哪些種類的檔案系統。 要注意的是 並不會試圖卸載根檔案系統。 - - - - - 程序與 Daemon - - FreeBSD 是一個多工的作業系統,也就是說在同一時間內可以跑超過一個程式。 每一個正在花時間跑的程式就叫做程序 (Process)。 您下的每個指令都至少會開啟一個新的程序, 而有些系統程序是一直在跑以維持系統正常運作的。 - - 每一個程序都有一個獨一無二的數字叫做 程序代號 (Process ID, PID),而且就像檔案一樣,每一個程序也有擁有者及群組。 擁有者及群組的資訊是用來決定什麼檔案或裝置是這個程序可以開啟的 (前面有提到過檔案權限)。 大部份的程序都有父程序。 父程序是開啟這個程序的程序,例如:您對 Shell 輸入指令,Shell 本身就是一個程序,而您執行的指令也是程序。 每一個您用這種方式跑的程序的父程序都是 Shell。 有一個特別的程序叫做 init8 是個例外,在 FreeBSD 開機的時候 init 會自動地被開啟,init 永遠是第一個程序,所以他的 PID 一直都會是 1 - - 有些程式並不是設計成一直在接收使用者的輸入的, 而是在開始執行的時候就從中斷與終端機的連線。 例如說, 網頁伺服器整天都在回應網頁方面的要求,它通常不需要您輸入任何東西。 另外,像是把信從一個站傳送到另一個站的程式,也是這種類型的應用程式。我們把這種程式稱作 Daemon。 Daemon 一詞是來自是希臘神話中的角色:祂們既不屬於善良陣營或邪惡陣營,祂們在背地裡做一些有用的事情。這也就是為何 BSD 的吉祥物,是一隻穿著帆布鞋拿著三叉耙的快樂小惡魔的原因。 - - 通常來說做為 Deamon 執行的程式名字後面都會加一個字母 dBIND 是 Berkeley Internet Name Domain 的縮寫,但實際上執行的程式名稱是 namedApache 網頁伺服器的程式名稱是 httpd、行列式印表機緩衝服務 (Line Printer Spooling) Daemon 是 lpd,依此類推。 但這是習慣用法,並沒有硬性規定,例如 Sendmail 主要的寄信 Daemon 是叫做 sendmail 而不是 maild - - - 檢視程序 - - 要看系統執行中的程序,有兩個相當有用的指令可用: ps1 以及 top1ps1 指令是用來列出正在執行之程序,而且可以顯示它們的 PID、用了多少記憶體、執行的指令名稱及其後之參數是什麼等等。 top1 指令則是顯示所有正在執行的程序, 並且數秒鐘更新一次。因此您可以互動式的觀看您的電腦正在做什麼。 - - 在預設的情況下,ps1 指令只會顯示使用者所擁有的的程序。 例如: - - % ps - PID TT STAT TIME COMMAND -8203 0 Ss 0:00.59 /bin/csh -8895 0 R+ 0:00.00 ps - - 在這個範例裡可以看到 ps1 的輸出分成好幾個欄位。 PID 就是前面有提到的程序代號。 PID 的分配是從 1 開始一直到 99999,如果用完的話又會繞回來重頭開始分配 (若該 PID 已經在用了,則 PID 不會重新分配)。 TT 欄位是指這個程式在哪個 Console (tty) 上執行,在這裡可以先忽略不管。STAT 是程式的狀態,也可以先不要管。TIME 是這個程式在 CPU 上執行的時間—這通常不是程式總共花的時間, 因為當您開始執行程式後,大部份的程式在 CPU 上執行前會先花上不少時間等待 。 最後,COMMAND 是執行這個程式的指令。 - - 有幾個不同的選項組合可以用來變更顯示出來的資訊,其中一個最有用的組合是 auxww 可以顯示所有正在跑的程序的指令,不只是您自已的。 則是顯示程序的擁有者名稱以及記憶體使用情況。 可以把 daemon 程序顯示出來, 而 可讓 ps1 顯示出每個程序完整的內容, 而不致因過長而被螢幕截掉了。 - - top1 也有類似的輸出。 一般的情況看像是這樣: - - % top -last pid: 9609; load averages: 0.56, 0.45, 0.36 up 0+00:20:03 10:21:46 -107 processes: 2 running, 104 sleeping, 1 zombie -CPU: 6.2% user, 0.1% nice, 8.2% system, 0.4% interrupt, 85.1% idle -Mem: 541M Active, 450M Inact, 1333M Wired, 4064K Cache, 1498M Free -ARC: 992M Total, 377M MFU, 589M MRU, 250K Anon, 5280K Header, 21M Other -Swap: 2048M Total, 2048M Free - - PID USERNAME THR PRI NICE SIZE RES STATE C TIME WCPU COMMAND - 557 root 1 -21 r31 136M 42296K select 0 2:20 9.96% Xorg - 8198 dru 2 52 0 449M 82736K select 3 0:08 5.96% kdeinit4 - 8311 dru 27 30 0 1150M 187M uwait 1 1:37 0.98% firefox - 431 root 1 20 0 14268K 1728K select 0 0:06 0.98% moused - 9551 dru 1 21 0 16600K 2660K CPU3 3 0:01 0.98% top - 2357 dru 4 37 0 718M 141M select 0 0:21 0.00% kdeinit4 - 8705 dru 4 35 0 480M 98M select 2 0:20 0.00% kdeinit4 - 8076 dru 6 20 0 552M 113M uwait 0 0:12 0.00% soffice.bin - 2623 root 1 30 10 12088K 1636K select 3 0:09 0.00% powerd - 2338 dru 1 20 0 440M 84532K select 1 0:06 0.00% kwin - 1427 dru 5 22 0 605M 86412K select 1 0:05 0.00% kdeinit4 - - 輸出的資訊分成兩個部份。開頭 (前五行或六行) 顯示出最近一個程序的 PID、系統平均負載 (系統忙磁程度評估方式)、系統的開機時間 (自上次重新開機) 以及現在的時間等。 在開頭裡面的其他數字分別是在講有多少程序正在執行、有多少記憶體及交換空間被占用了,還有就是系統分別花了多少時間在不同的 CPU 狀態上。若有載入 ZFS 檔案系統模組,會有一行 ARC 標示有多少資料從磁碟改由記憶體快取中取得。 - - 接下來的部份是由好幾個欄位所構成,和 ps1 輸出的資訊類似。 就如同前例,您可以看到 PID、使用者名稱、CPU 花費的時間以及正在執行的指令。 top1 在預設的情況下還會告訴您程序用掉了多少的記憶體空間。 在這邊會分成兩欄,一個是總用量 (Total size),另一個是實際用量 (Resident size)——總用量是指這個應用程式需要的記憶體空間,而實際用量則是指目前實際上該程式的記憶體使用量。 - - top(1) 每隔 2 秒鐘會自動更新顯示內容,可用 選項來改變間隔的時間。 - - - - 終止程序 - - 要與執行中的程序或 Daemon 溝通唯一的方法是透過 kill1 指令傳送信號 (Signal)。 信號有很多種,有些有特定的意義,有些則是會由應用程式來解讀,應用程式的說明文件會告訴您該程式是如何解讀信號。 使用者只能送信號給自己所擁有的程序,送信號給其他人的程序會出現權限不足的錯誤。 唯一的例外是 root使用者,他可以送信號給任何人的程序。 - - 作業系統在某些情況也會送信號給應用程式。 假設有個應用程式寫得不好,企圖要存取它不該碰的記憶體的時候,FreeBSD 會送一個 Segmentation Violation 信號 (SIGSEGV) 給這個程序。 如果有一個應用程式用了 alarm3 的系統呼叫 (System call) 要求系統在過一段時間之後發出通知,時間到了的時候系統就會發出通知信號 (SIGALRM) 給該程式。 - - SIGTERMSIGKILL 這兩個信號可以拿來終止程序。 用 SIGTERM 結束程序是比較有禮貌的方式,該程序收到信號後可以把自已所使用的日誌檔關閉及其他要在結束前要做的事完成, 然後在關掉程序之前結束掉手邊的工作。 在某些情況下程序有可能會忽略 SIGTERM,如它正在做一些不能中斷的工作的話。 - - SIGKILL 就沒有辦法被程序忽略。 傳送 SIGKILL 信號給程序通常會將程序直接中止還是有少數東西不能被中斷。 例如有個程序正在從網路上的別的電腦讀一個檔案, 而那部電腦因為某些理由連不到,那這個程序就是一個 不能中斷的 程序。 通常在經過 2 分鐘左右之後這個程序會逾時。 當發生逾時的時候這個程序就會被結束掉了。 - - 其他常用的信號有:SIGHUP, SIGUSR1SIGUSR2。 這些是通用的信號,對不同的應用程式會有不同的反應。 - - 舉例來說,當您更動了網頁伺服器的設定檔,您想要叫網頁伺服器去重新讀取設定。 重新啟動 httpd 會造成網頁伺服器暫停服務一段時間,我們可以傳送 SIGHUP 信號來取代關掉重開。 不同的 Daemon 會有不同的行為,所以使用前請先參考 Deamon 的說明文件查看是否可以達到想要的結果。 - - - 送信號給程序 - - 這個範例將會示範如何送一個信號給 inetd8inetd8 的設定檔是 /etc/inetd.conf,而 inetd8 會在收到 SIGHUP 的時候重新讀取這個設定檔。 - - - 使用 pgrep1 來查詢要傳送信號的目標程序。 在這個例子中 inetd8PID 為 198: - - % pgrep -l inetd -198 inetd -wW - - - - - 使用 kill1 來發送信號。因為 inetd8root 所有,因此必須先用 su1 切換成 root 先。 - - % su -Password: -# /bin/kill -s HUP 198 - - 對大多數 UNIX 指令來講,kill1 執行成功時並不會輸出任何訊息。 假設您送一個信號給某個不是使用者所擁有的程序, 那麼就會顯示這個錯誤訊息: kill: PID: Operation not permitted。 若打錯 PID 的話,那就會把信號送給錯誤的程序,並把該程序關閉,或者是把信號送給一個非使用中的 PID,那您就會看到錯誤:kill: PID: No such process - - - 為何要使用 <command>/bin/kill</command>? - - 多數 Shell 都有提供內建的 kill 指令。 也就是說這種 shell 會直接發送信號,而不是執行 /bin/kill。 但要小心不同的 shell 會有不同的語法來指定信號的名稱等。 與其嘗試去把它們通通學會,不如就單純的直接用 /bin/kill - - - - - 要送其他的信號的話也是非常類似,就視需要把指令中的 TERMKILL 替換成其他信號的名稱即可。 - - - 隨便抓一個系統中的程序然後把他砍掉並不是個好主意。 特別是 init8PID 1 是一個非常特別的程序。 執行 /bin/kill -s KILL 1 的結果就是系統立刻關機。 因此在您按下 Return 要執行 kill1 之前, 請一定要記得再次確認您下的參數。 - - - - - - Shell - - - shells - - - command line - - - Shell 提供了指令列介面可用來與作業系統互動,Shell 負責從輸入的頻道接收指令並執行它們。 多數 Shell 也內建一些有助於日常工作的功能,像是檔案管理、檔案搜尋、指令列編輯、指令巨集以及環境變數等。 FreeBSD 有內附了幾個 Shell,包含 Bourne Shell (sh1),與改良版的 C-shell (tcsh1)。 還有許多其他的 Shell 可以從 FreeBSD Port 套件集中取得,像是 zsh 以及 bash 等。 - - 要用哪個 Shell 牽涉到每個人的喜好。 如果您是一個 C 程式設計師,那對於使用像是 tcsh1 這種 C-like 的 shell 可能會感到較容易上手。 如果是 Linux 的使用者,那您也許會想要用 bash。 每一個 Shell 都有自已獨特之處,至於這些特點能不能符合使用者的喜好,就是您選擇 shell 的重點了。 - - 常見的 Shell 功能之一就是檔名自動補齊。 首先輸入指令或檔案的前幾個字母,然後按下 Tab 鍵,Shell 就會自動把指令或是檔案名稱剩餘的部份補齊。 假設您有兩個檔案分別叫作 foobarfootball。 要刪掉 foobar,那麼可以輸入 rm foo 然後按下 Tab 來補齊檔名。 - - 但 Shell 只顯示了 rm foo,這代表它沒有辦法完全自動補齊檔名,因為有不只一個檔名符合條件。 foobarfootball 都是 foo 開頭的檔名。 有一些 Shell 會有嗶的音效或者顯示所有符符條件的檔名。 使用者只需要多打幾個字元來分辦想要的檔名。 輸入 t 然後再按 Tab 一次,那 Shell 就能夠替您把剩下的檔名填滿了。 - - - environment variables - - - Shell 的另一項特點是使用了環境變數。 環境變數是以變數與鍵值 (Variable/Key) 的對應關係儲存於 Shell 的環境,任何由該 Shell 所產生的程序都可以讀取此環境變數, 因此環境變數儲存了許多程序的設定。 提供了常見的環境變數與其涵義的清單。 請注意環境變數的名稱永遠以大寫表示。 - - - 常用環境變數 - - - - - 變數 - 說明 - - - - - - USER - 目前登入的使用者名稱。 - - - - PATH - 以冒號 (:) 隔開的目錄列表,用以搜尋執行檔的路徑。 - - - - DISPLAY - 若存在這個環境變數,則代表 Xorg 顯示器的網路名稱。 - - - - SHELL - 目前使用的 Shell。 - - - - TERM - - 使用者終端機類型的名稱,用來判斷終端機有那些功能。 - - - - TERMCAP - - 用來執行各種終端機功能的終端機跳脫碼 (Terminal escape code) 的資料庫項目。 - - - - OSTYPE - 作業系統的類型。 - - - - MACHTYPE - 系統的 CPU 架構。 - - - - EDITOR - 使用者偏好的文字編輯器。 - - - - PAGER - 使用者偏好的文字分頁檢視工具。 - - - - MANPATH - 以冒號 (:) 隔開的目錄列表,用以搜尋使用手冊的路徑。 - - - -
- - - Bourne shells - - - 在不同的 Shell 底下設定環境變數的方式也有所不同。 在 tcsh1csh1,使用 setenv 來設定環境變數。 在 sh1bash 則使用 export 來設定目前環境的變數。 以下範例將 tcsh1 Shell 下的 EDITOR 環境變數從預設值更改為 /usr/local/bin/emacs - - % setenv EDITOR /usr/local/bin/emacs - - 相同功能的指令在 bash 下則是: - - % export EDITOR="/usr/local/bin/emacs" - - 要展開以顯示目前環境變數中的值,只要在指令列輸入環境變數之前加上 $ 字元。 舉例來說,echo $TERM 會顯示出目前 $TERM 的設定值。 - - Shell 中有特殊字元用來表示特殊資料,我們將其稱作 Meta-character。 其中最常見的 Meta-character 是 * 字元,它代表了檔名中的任意字元。 Meta-character 可以用在搜尋檔名,舉例來說,輸入 echo * 會和輸入 ls 得到幾乎相同的結果,這是因為 shell 會將所有符合 * 字元的檔案由 echo 顯示出來。 - - 為了避免 Shell 轉譯這些特殊字元,我們可以在這些特殊字元前放一個反斜線 (\) 字元使他們跳脫 (Escape) Shell 的轉譯。舉例來說,echo $TERM 會印出你目前終端機的設定, echo \$TERM 則會直接印出 $TERM 這幾個字。 - - - 變更 Shell - - 永久變更 Shell 最簡單的方法就是透過 chsh 指令。 執行 chsh 將會使用環境變數中 EDITOR 指定的文字編輯器,如果沒有設定,則預設是 vi1。 請修改 Shell: 為新的 Shell 的完整路徑。 - - 或者,使用 chsh -s, 來直接設定 Shell 而不開啟文字編輯器。 例如, 假設想把 Shell 更改為 bash - - % chsh -s /usr/local/bin/bash - - - 新的 Shell 必須已列於 /etc/shells 裡頭。 若是依 說明由 Port 套件集來裝的 Shell, 那就會自動列入至該檔案裡。 若仍缺少,請使用以下指令加入檔案 (請將路徑替換為新的 Shell 的路徑): - - # echo /usr/local/bin/bash >> /etc/shells - - 然後重新執行 chsh1 - - - - - - 進階 Shell 技巧 - - - - - Tom - Rhodes - - Written by - - - - - UNIX Shell 不只是指令的直譯器,它是一個強大的工具可讓使用者執行指令、重新導向指令的輸出、重新導向指令的輸入並將指令串連在一起來改進最終指令的輸出結果。當這個功能與內建的指令混合使用時,可提供一個可以最佳化效率的環境給使用者。 - - Shell 重新導向是將一個指令的輸出或輸入傳送給另一個指令或檔案。例如,要擷取 ls1 指令的輸出到一個檔案,可以重新導向輸出: - - % ls > directory_listing.txt - - 目錄的內容現在會列到 directory_listing.txt 中,部份指令可以讀取輸入,例如 sort1。要排序這個清單,可重新導向輸入: - - % sort < directory_listing.txt - - 輸入的內容會被排序後呈現在畫面上,要重新導向該輸入到另一個檔案,可以重新導向 sort1 的出輸: - - % sort < directory_listing.txt > sorted.txt - - 於上述所有的範例中,指令會透過檔案描述符 (File descriptor) 來執行重新導向。每個 UNIX 系統都有檔案描述符,其中包含了標準輸入 (stdin)、標準輸出 (stdout) 以及標準錯誤 (stderr)。每一種檔案描述符都有特定的用途,輸入可能來自鍵盤或滑鼠、任何可能提供輸入的來源,輸出則可能是螢幕或印表機中的紙張,而錯誤則為任何可能用來診斷的資訊或錯誤訊息。這三種皆被認為是以 I/O 為基礎的檔案描述符,有些也會被當做串流。 - - 透過使用這些檔案描述符,Shell 能夠讓輸出與輸入在各種指令間傳遞與重新導向到或自檔案。另一種重新導向的方式是使用管線運算子 (Pipe operator)。 - - UNIX 的管線運算子,即 |,可允許指令的輸出可直接傳遞或導向到另一個程式。基本上,管線運算子允許指令的標準輸出以標準輸入傳遞給另一個指令,例如: - - % cat directory_listing.txt | sort | less - - 在這個例子中,directory_listing.txt 的內容會被排序然後輸出傳遞給 less1,這可讓使用者依自己的閱讀步調捲動輸出的結果,避免結果直接捲動出畫面。 - -
- - - 文字編輯器 - - - text editors - - - editors - - - 在 FreeBSD 中有許多設定必須透過編輯文字檔完成。 因此,若能熟悉文字編輯器是再好不過的。 FreeBSD 本身就內建幾種文字編輯器, 您也可以透過 Port 套件集來安裝其他的文字編輯器。 - - - ee - - - editors - ee1 - - - 最簡單易學的文字編輯器叫做 ee1,意為簡易的編輯器 (Easy Editor)。 要開始使用這個編輯器, 只需輸入 ee filename,其中 filename 代表你想要編輯的檔案名稱。 在編輯器中, 所有編輯器的功能與操作都顯示在螢幕的上方。 其中的插入符號 (^) 代表鍵盤上的 Ctrl 鍵,所以 ^e 代表的是 Ctrl e 。 若要結束 ee1,請按下 Esc 鍵,接著選擇 leave editor 即可。 此時如果該檔案有修改過,編輯器會提醒你是否要存檔。 - - - vi - - - editors - - - emacs - - - FreeBSD 同時也內建功能強大的文字編輯器,像是vi1。 其他編輯器如 editors/emacseditors/vim 則由 FreeBSD Port 套件集提供。 這些編輯器提供更強的功能,但是也比較難學習。 長期來看學習 vimEmacs 會在日後為您省下更多的時間。 - - 有許多應用程式在修改檔案或需要輸入時會自動開啟文字編輯器,要更改預設的編輯器可設定 EDITOR 環境變數如 所說明。 - - - - 裝置及裝置節點 - - 裝置 (Device) 一詞大多是跟硬體比較有關的術語,包括磁碟、印表機、顯示卡和鍵盤。 FreeBSD 開機過程當中,開機訊息 (Boot Message) 中主要是會列出偵測到的硬體裝置,開機訊息的複本也會存放在 /var/run/dmesg.boot - - 每一個裝置都有一個裝置名稱及編號,舉例來說 ada0 是第一台 SATA 硬碟,而 kbd0 則代表鍵盤。 - - 在 FreeBSD 中大多數的裝置必須透過裝置節點 (Device Node) 的特殊檔案來存取,這些檔案會放置在 /dev - - - - 操作手冊 - - - manual pages - - - 在 FreeBSD 中,最詳細的文件莫過於操作手冊。 幾乎在系統上所有程式都會有簡短的操作手冊來介紹該程式的基本操作以及可用的參數。 這些操作手冊可以使用 man 指令來檢視: - - % man command - - 其中 command 想要瞭解指令的名稱。 舉例,要知道 ls1 的詳細用法,就可以打: - - % man ls - - 操作手冊被分成很多個章節,每個章節有不同的主題。 在 FreeBSD 中操作手冊有以下章節: - - - - 使用者指令。 - - - - 系統呼叫 (System call) 與錯誤編號。 - - - - C 程式庫函數。 - - - - 裝置驅動程式。 - - - - 檔案格式。 - - - - 遊戲及其他程式。 - - - - 其他資訊。 - - - - 系統維護與操作指令。 - - - - 系統核心介面。 - - - - 有些情況會有同樣主題會同時出現在不同章節。 舉個例子,系統內會有 chmod 使用者指令,但同時也有 chmod() 系統呼叫。 在這種情況,要告訴 man1 要查詢的章節編號: - - % man 1 chmod - - 如此一來就會查詢使用者指令 chmod1。 通常在寫文件時會把有參考到特定章節的號碼寫在括號內。 所以 chmod1 就是指使用者指令,而 chmod2 則是指系統呼叫。 - - 若不曉得操作手冊的名稱,可以使用 man -k 來以關鍵字查詢所有操作手冊的描述: - - % man -k mail - - 這個指令會顯示所有描述中有使用到關鍵字 mail 的指令。 這等同使用 apropos1 - - 想要閱讀所有在 /usr/bin 底下的指令說明則可輸入: - - % cd /usr/bin -% man -f * | more - - - - % cd /usr/bin -% whatis * |more - - - GNU Info 檔 - - - Free Software Foundation - - - FreeBSD 有許多應用程式與工具來自自由軟體基金會 (Free Software Foundation, FSF)。 除了操作手冊之外,這些程式提供了另外一種更具有彈性的超文字文件叫做 info 檔。 這些檔案可以使用 info1 指令來閱讀,或者若有裝 editors/emacs 亦可透過 emacs 的 info 模式閱讀。 - - 要使用 info1 指令,只需輸入: - - % info - - 要查詢簡單說明請按 h 鍵,若要查訊快速指令參考請按 ? 鍵。 - - -
- - - - - - 安裝應用程式:套件與 Port - - - 概述 - - ports - 套件 - FreeBSD 內建豐富的系統工具集,此外 FreeBSD 提供了兩種安裝第三方軟體的套件管理技術︰由原始碼安裝的 FreeBSD Port 套件集,以及由預先編譯好的 Binary 安裝的 Binary 套件集。兩種方法都可使用本地的媒體或網路來安裝軟體。 - - 讀完這章,您將了解: - - - - Binary 套件集與 Port 的差別。 - - - - 如何找到已移植到 FreeBSD 的第三方軟體。 - - - - 如何使用 pkg 管理 Binary 套件。 - - - - 如何編譯來自 Port 套件集的第三方軟體原始碼。 - - - - 如何找到應用程式已安裝的檔案來完成安裝後的設定。 - - - - 若軟體安裝失敗要如何處理。 - - - - - - 安裝軟體的概要 - - 通常要在 UNIX 系統上安裝第三方軟體時,有幾個步驟要作: - - - - 找到並且下載軟體,該軟體有可能以原始碼或 Binary 格式發佈。 - - - - 自發佈的格式解壓縮軟體。 發佈的格式通常為 tarball 並以程式壓縮,如 compress1, gzip1, bzip21xz1 - - - - 找到位於 INSTALL, README 或者 doc/ 子目錄底下的檔案閱讀如何安裝該軟體。 - - - - 若軟體是以原始碼的格式發佈則需要編譯該軟體。 這可能會需要修改 Makefile 或執行 configure Script。 - - - - 測試並安裝該軟體。 - - - - FreeBSD Port 是指設計用來自動化從原始碼編譯應用程式整個程序的一系列檔案,組成 Port 的檔案包含了自動下載、解壓縮、修補、編譯與安裝應用程式的必要資訊。 - - 若軟體尚未被 FreeBSD 採用並測試,可能會需要經過一些修正才能正常安裝並執行。 - - 雖然如此,目前已有超過 24,000 個第三方應用程式已經被移植到 FreeBSD。當可行時,這些應用程式也會做成預先編譯好的 套件 (Package) 供下載。 - - 這些 Binary 套件可使用 FreeBSD 套件管理指令來管理。 - - 不論是 Binary 套件或者 Port 都有相依性,若用 Binary 套件或 Port 來安裝應用程式,且該應用程式若有相依的程式庫尚未被安裝,則會自動先安裝該程式庫。 - - FreeBSD Binary 套件中含有一個應用程式中所有預先編譯好的指令、設定檔以及文件,Binary 套件可以使用 pkg8 指令來管理,如 pkg install - - 雖然兩種技術非常相似,但 Binary 套件及 Port 有各自的優點。 要視您要安裝的應用程式需求來選擇。 - - - Binary 套件優點 - - - 應用程式壓縮 Binary 套件的 tarball 會比壓縮原始碼的 tarball 還要小。 - - - - 安裝 Binary 套件不需要編譯的時間,對於較慢的電腦要安裝大型的應用程式如 Mozilla, KDEGNOME 這點顯的相當重要。 - - - - Binary 套件不需要了解在 FreeBSD 上編譯軟體的流程。 - - - - - Port 套件優點 - - - 由於 Binary 套件必須盡可能在大多數系統上執行,通常會採用較通用的編譯選項來編譯,由 Port 來編輯可更改編譯選項。 - - - - 部份應用程式編譯期選項會與要安裝的功能有關,舉例來說 Apache 便有大量不同的內建選項可以設定。 - - 在某些情況,同樣的應用程式會存在多個不同的 Binary 套件,如 Ghostscriptghostscriptghostscript-nox11 兩種 Binary 套件,用來區別是否有安裝 Xorg。 若應用程式有一個以上的編譯期選項便無法用這個方式來區別 Binary 套件。 - - - - 部份軟體的授權條款中禁止以 Binary 格式發佈。 這種軟體必須以原始碼發佈並由終端使用者編譯。 - - - - 部份人並不相信 Binary 發佈版本,寧願閱讀原始碼來查看是否潛藏的問題。 - - - - 原始碼可套用自訂的修補。 - - - - 要持續追蹤 Port 的更新可以訂閱 FreeBSD Port 郵遞論壇 與 FreeBSD Port 問題郵遞論壇。 - - - 在安裝任何應用程式之前,請先查看 是否有與該應用程式相關的安全性問題或輸入 pkg audit -F 來檢查所有已安裝的應用程式是否有已知的漏洞。 - - - 本章接下來的部份將說明如何在 FreeBSD 使用 Binary 套件及 Port 套件安裝與管理第三方軟體。 - - - - 搜尋軟體 - - FreeBSD 上可安裝的軟體清單不斷在增加, 有幾種方式可以來找你想安裝的軟體: - - - - FreeBSD 網站有維護一份可搜尋的最新應用程式清單,在 https://www.FreeBSD.org/ports/。 可以依應用程式名稱或軟體分類來搜尋 Port。 - - - - FreshPorts - - 由 Dan Langille 維護的 FreshPorts.org,提供完整的搜尋工具並且可追蹤在 Port 套件集中的應用程式變更。註冊的使用者可以建立自訂的監視清單會自動寄發電子郵件通知 Port 的更新資訊。 - - - - SourceForge - - 若找不到指定的應用程式,可以先到網站 SourceForge.net 或 GitHub.com 搜尋,後然再回到 FreeBSD 網站 檢查該應用程式是否已被移植。 - - - - - pkg - search - - - 要搜尋 Binary 套件檔案庫中的應用程式可: - - # pkg search subversion -git-subversion-1.9.2 -java-subversion-1.8.8_2 -p5-subversion-1.8.8_2 -py27-hgsubversion-1.6 -py27-subversion-1.8.8_2 -ruby-subversion-1.8.8_2 -subversion-1.8.8_2 -subversion-book-4515 -subversion-static-1.8.8_2 -subversion16-1.6.23_4 -subversion17-1.7.16_2 - - 套件名稱包含版本編號,且若 Port 使用 Python 為基礎,也會包含用來編譯該套件的 Python 版本。有些 Port 會有多個版本可使用,如 Subversion ,因編譯選項不同,有多個版本可用,這個例子中即指靜態連結版本的 Subversion。在指定要安裝的套件時,最好使用 Port 來源來指定該應用程式,Port 來源是指應用程式在 Port 樹中的路徑。再輸入一次 pkg search 並加上 來列出每個套件來源: - - # pkg search -o subversion -devel/git-subversion -java/java-subversion -devel/p5-subversion -devel/py-hgsubversion -devel/py-subversion -devel/ruby-subversion -devel/subversion16 -devel/subversion17 -devel/subversion -devel/subversion-book -devel/subversion-static - - pkg search 支援使用 Shell 萬手字元 (globs)、正規表示法、描述或檔案庫中的其他其他內容。在安裝 ports-mgmt/pkgports-mgmt/pkg-devel 之後,可參考 pkg-search8 以取得更多詳細資訊。 - - - - 若 Port 套件集已安裝,有數個方法可以查詢 Port 樹中的本地版本。要找到 Port 所在的分類,可輸入 whereis file,其中 file 是要安裝的程式: - - # whereis lsof -lsof: /usr/ports/sysutils/lsof - - 或者,也可使用 echo1 - - # echo /usr/ports/*/*lsof* -/usr/ports/sysutils/lsof - - 請注意,這也會顯示已下載至 /usr/ports/distfiles 目錄中任何已符合條件的檔案。 - - - - 另一個方法是使用 Port 套件集內建的搜尋機制來找軟體。要使用搜尋的功能需先 cd/usr/ports 然後執行 make search name=program-name,其中 program-name 代表軟體的名稱。舉例搜尋 lsof - - # cd /usr/ports -# make search name=lsof -Port: lsof-4.88.d,8 -Path: /usr/ports/sysutils/lsof -Info: Lists information about open files (similar to fstat(1)) -Maint: ler@lerctr.org -Index: sysutils -B-deps: -R-deps: - - - 內建的搜尋機制會使用索引檔內的資訊。若出現訊息指出需要 INDEX 檔,可執行 make fetchindex 來下載最新的索引檔。當 INDEX 檔存在時,make search 方可執行請求的搜尋動作。 - - - Path: 此行代表 Port 的所在位置。 - - 若不要接受這麼多資訊,可使用 quicksearch 功能: - - # cd /usr/ports -# make quicksearch name=lsof -Port: lsof-4.88.d,8 -Path: /usr/ports/sysutils/lsof -Info: Lists information about open files (similar to fstat(1)) - - 若要進行更有深度的搜尋,使用 make search key=stringmake quicksearch key=string 其中 string 是要搜尋的文字。該文字可以是一部份的註解、描述或相依套件,當不清楚程式的名稱時可以找到與特定主題相關的 Port。 - - 當使用 searchquicksearch 時,搜尋的字串不分大小寫。 搜尋 LSOF 會與搜尋 lsof 產生相同的結果。 - - - - - - 使用 <application>pkg</application> 管理 Binary 套件 - - pkg 是新一代套件管理工具用來取代舊版工具,提供許多功能讓處理 Binary 套件更快更簡單。 - - 對於只想要使用在 FreeBSD 鏡像站上預先編譯 Binary 套件的站台,使用 pkg 管理套件便已足夠。 - - 但是,對於那些想要從原始碼或使用自己的檔案庫編譯的站台,則會需要 Port 管理工具。 - - 因為 pkg 僅能管理 Binary 套件,所以不能當做為替代 Port 管理工具,這些工具可用來安裝來自 Binary 與 Port 套件集的軟體,而 pkg 僅能安裝 Binary 套件。 - - - 開始使用 <application>pkg</application> - - FreeBSD 內建啟動 (Bootstrap) 工具可用來下載並安裝 pkg 及其操作手冊。這個工具是設計在 FreeBSD 版本 10.X 之後使用。 - - - 不是所有 FreeBSD 版本及架構支援此啟動程序,目前支援的清單列於 ,對不支援的版本,必須改透過 Port 套件集或者 Binary 套件來安裝 pkg - - - - 要啟動 (Bootstrap) 系統請執行: - - # /usr/sbin/pkg - - 您必須有可用的網際網路連線供啟動程式使用方可成功。 - - 否則,要安裝 Port 套件,則須執行: - - # cd /usr/ports/ports-mgmt/pkg -# make -# make install clean - - 當升級原使用舊版 pkg_* 工具的既有系統時,必須將資料庫轉換成新的格式,如此新的工具才會知道有那些已安裝過的套件。pkg 安裝完後,必須執行以下指令將套件資料庫從舊版格式轉換到新版格式: - - # pkg2ng - - 新安裝的版本因尚未安裝任何第三方軟體因此不須做這個步驟。 - - - 這個步驟無法還原。一旦套件資料庫轉為成 pkg 的格式,舊版 pkg_* 工具就不該再繼續使用。 - - - - 套件資料庫轉換的過程可能會因內容轉換為新版本產生錯誤。通常,這些錯誤皆可安全忽略,即使如此,仍然有在執行 pkg2ng 後無法成功轉換的軟體清單,這些應用程式則必須手動重新安裝。 - - - 為了確保 FreeBSD Port 套件集會將新軟體的資訊註冊到 pkg 而非舊版套件資料庫,FreeBSD 版本 10.X 之前需要在 /etc/make.conf 加入此行: - - WITH_PKGNG= yes - - 預設 pkg 會使用 FreeBSD 套件鏡像站 (Repository) 的 Binary 套件。若要取得有關編譯自訂套件檔案庫的資訊,請參考 - - 其他 pkg 設定選項說明請參考 pkg.conf5 - - pkg 的用法資訊可在 pkg8 操作手冊或不加任何參數執行 pkg 來取得。 - - 每個 pkg 指令參數皆記庫在指令操件手冊。要閱讀 pkg install 的操作手冊,可執行以下指令: - - # pkg help install - - # man pkg-install - - 本章節剩餘的部份將會示範使用 pkg 執行常用的 Binary 套件管理工作。每個示範的指令皆會提供多個參數可使用,請參考指令的說明或操作手冊以取得詳細資訊或更多範例。 - - - - 取得有關已安裝套件的資訊 - - 有關已安裝在系統的套件資訊可透過執行 pkg info 來檢視,若執行時未指定任何參數,將會列出所有已安裝或指定的套件版本。 - - 例如,要查看已安裝的 pkg 版本可執行: - - # pkg info pkg -pkg-1.1.4_1 - - - - 安裝與移除套件 - - 要安裝 Binary 套件可使用以下指令,其中 packagename 為要安裝的套件名稱: - - # pkg install packagename - - 這個指令會使用檔案庫的資料來決定要安裝的軟體版本以及是否有任何未安裝的相依。例如,要安裝 curl - - # pkg install curl -Updating repository catalogue -/usr/local/tmp/All/curl-7.31.0_1.txz 100% of 1181 kB 1380 kBps 00m01s - -/usr/local/tmp/All/ca_root_nss-3.15.1_1.txz 100% of 288 kB 1700 kBps 00m00s - -Updating repository catalogue -The following 2 packages will be installed: - - Installing ca_root_nss: 3.15.1_1 - Installing curl: 7.31.0_1 - -The installation will require 3 MB more space - -0 B to be downloaded - -Proceed with installing packages [y/N]: y -Checking integrity... done -[1/2] Installing ca_root_nss-3.15.1_1... done -[2/2] Installing curl-7.31.0_1... done -Cleaning up cache files...Done - - 新的套件以及任何做為相依安裝的額外套件可在已安裝的套件清單中看到: - - # pkg info -ca_root_nss-3.15.1_1 The root certificate bundle from the Mozilla Project -curl-7.31.0_1 Non-interactive tool to get files from FTP, GOPHER, HTTP(S) servers -pkg-1.1.4_6 New generation package manager - - 不再需要的套件可以使用 pkg delete 來移除,例如: - - # pkg delete curl -The following packages will be deleted: - - curl-7.31.0_1 - -The deletion will free 3 MB - -Proceed with deleting packages [y/N]: y -[1/1] Deleting curl-7.31.0_1... done - - - - 升級已安裝套件 - - 執行以下指令,可將已安裝的套件升級到最新版本: - - # pkg upgrade - - 這個指令將會比對已安裝的版本與在檔案庫分類中的版本,並從檔案庫升級這些套件。 - - - - 稽查已安裝套件 - - 在第三方的應用程式中偶爾可能會發現軟體漏洞,要找出這些程式,可使用 pkg 內建的稽查機制。要查詢已安裝在系統上的軟體是否有任何已知的漏洞可執行: - - # pkg audit -F - - - - 自動移除未使用的套件 - - 移除一個套件可能會留下不再需要使用的相依套件。不再需要的相依套件是當初隨著其套件所安裝的套件 (枝葉套件),可以使用以下指令自動偵測並移除: - - # pkg autoremove -Packages to be autoremoved: - ca_root_nss-3.15.1_1 - -The autoremoval will free 723 kB - -Proceed with autoremoval of packages [y/N]: y -Deinstalling ca_root_nss-3.15.1_1... done - - 因為相依所安裝的套件稱作 自動 (Automatic) 套件,而非自動套件即套件被安裝的原因不是因為其他套件所相依,可以使用以下方式查詢: - - # pkg prime-list -nginx -openvpn -sudo - - pkg prime-list 是一個別名指令,定義在 /usr/local/etc/pkg.conf,尚還有許多其他相關指令可以用來查詢系統的套件資料庫,例如,指令 pkg prime-origins 可用來取得上述清單的來源 Port 目錄: - - # pkg prime-origins -www/nginx -security/openvpn -security/sudo - - 這份清單可以用來重新編譯所有安裝在系統中的套件,使用 ports-mgmt/poudriere ports-mgmt/synth 這類的編譯工具。 - - 要將一個安裝好的套件註記成為 "自動" 可以用: - - # pkg set -A 1 devel/cmake - - 當套件為末端套件 (Leaf Package) 且被註記為 "自動",則會被 pkg autoremove 挑選出來。 - - 要註記一個安裝好的套件為 "自動" 可以用: - - # pkg set -A 0 devel/cmake - - - - - 還原套件資料庫 - - 不如傳統的套件管理系統,pkg 有自己的套件資料庫備份機制,此功能預設是開啟的。 - - - 要停止週期的 Script 備份套件資料庫可在 periodic.conf5 設定 daily_backup_pkgdb_enable="NO" - - - 要還原先前套件資料庫的備份,可執行以下指令並將 /path/to/pkg.sql 替換為備份的位置: - - # pkg backup -r /path/to/pkg.sql - - - 若要還原有週期 Script 所產生的備份必須在還原前先解壓縮。 - - - 要手動備份 pkg 資料庫,可執行以下指令,並替換 /path/to/pkg.sql 為適當的檔案名稱與位置: - - # pkg backup -d /path/to/pkg.sql - - - - 移除過時的套件 - - 預設 pkg 會儲存 Binary 套件在快取目錄定義在 pkg.conf5 中的 PKG_CACHEDIR,只會保留最後安裝的套件複本。較舊版的 pkg 會保留所有先前的套件,若要移除這些過時的 Binary 套件,可執行: - - # pkg clean - - 使用以下指令可清空全部的快取: - - # pkg clean -a - - - - 修改套件 Metadata - - 在 FreeBSD Port 套件集中的軟體可能會經歷主要版號的修改,要解決這個問題可使用 pkg 內建的指令來更新套件來源。這非常有用,例如 lang/php5 重新命名為 lang/php53 因此 lang/php5 從此之後代表版本 5.4 - - 要更改上述例子中的套件來源,可執行: - - # pkg set -o lang/php5:lang/php53 - - 再一個例子,要更新 lang/ruby18lang/ruby19,可執行: - - # pkg set -o lang/ruby18:lang/ruby19 - - 最後一個例子,要更改 libglut 共用程式庫的來源從 graphics/libglut 改成 graphics/freeglut 可執行: - - # pkg set -o graphics/libglut:graphics/freeglut - - - 在更改套件來源之後,很重要的一件事是要重新安裝套件,來讓相依的套件也同時使用修改後的來源。要強制重新安裝相依套件,可執行: - - # pkg install -Rf graphics/freeglut - - - - - - 使用 Port 套件集 - - Port 套件集是指一數個 Makefiles、修補及描述檔案,每一組這些檔案可用來編譯與安裝在 FreeBSD 上的一個應用程式,即稱為一個 Port - - 預設,Port 套件集儲存在 /usr/ports 的子目錄下。 - - 在應用程式可以使用 Port 編譯之前,必須先安裝 Port 套件集。若在安裝 FreeBSD 時沒有安裝,可以使用以下其中一種方式安裝: - - - Portsnap 方法 - - FreeBSD 的基礎系統內含 Portsnap,這是一個可用來取得 Port 套件集簡單又快速的工具,較建議多數使用者使用這個方式。此工具會連線到 FreeBSD 的網站,驗証密鑰,然後下載 Port 套件集的新複本。該金鑰是要用來檢驗所有已下載檔案的完整性。 - - - 要下載壓縮後的 Port 套件集快照 (Snapshot) 到 /var/db/portsnap - - # portsnap fetch - - - - 當第一次執行 Portsnap 時,要先解壓縮快照到 /usr/ports - - # portsnap extract - - - - 在完成上述第一次使用 Portsnap 的動作之後,往後可隨需要執行以下指令來更新 /usr/ports - - # portsnap fetch -# portsnap update - - 當使用 fetch 時也可同時執行 extractupdate 如: - - # portsnap fetch update - - - - - Subversion 方法 - - 若要取得更多對 Port 樹的控制,或若有本地的變更需要維護,可以使用 Subversion 來取得 Port 套件集。請參考 Subversion Primer 來取得 Subversion 的詳細說明。 - - - 必須安裝 Subversion 才可用來取出 (Check out) Port 樹。若已存在 Port 樹的複本,可使用此方式安裝 Subversion - - # cd /usr/ports/devel/subversion -# make install clean - - 若尚無法使用 Port 樹,或已經使用 pkg 來管理套件,可使用套件來安裝 Subversion - - # pkg install subversion - - - - - 取出 Port 樹的複本: - - # svn checkout https://svn.FreeBSD.org/ports/head /usr/ports - - - - 若需要,在第一次 Subversion 取出後可使用以下指令更新 /usr/ports - - # svn update /usr/ports - - - - Port 套件集中含有代表不同軟體分類的目錄,每個分類底下的子目錄代表每個應用程式,每個內含數個用來告訴 FreeBSD 如何編譯與安裝該程式檔案的應用程式子目錄即稱作 Port Skeleton,每個 Port Skeleton 會含有以下檔案及目錄: - - - - Makefile:內含用來說明應用程式要如何編譯、要安裝該程式到那的敘述句。 - - - - distinfo:內含編譯 Port 必須下載的檔案名稱以及校驗碼 (Checksum)。 - - - - files/:此目錄含有編譯與安裝程式到 FreeBSD 時所需的修補檔。此目錄也可能含有其他用來編譯 Port 的檔案。 - - - - pkg-descr:提供程式更詳細的說明。 - - - - pkg-plist:Port 安裝的所有檔案清單,也同時會告訴 Port 系統解除安裝時要移除那一些檔案。 - - - - 部份 Port 含有 pkg-message 或其他檔案用來處理特殊情況。要取得有關這些檔案的詳細資訊,以及 Port 的概要可參考 FreeBSD Porter's Handbook。 - - Port 中並不含實際的原始碼,即為 distfile,在編譯 Port 解壓縮時會自動下載的原始碼到 /usr/ports/distfiles - - - 安裝 Port - - - ports - installing - - - 下面我們會介紹如何使用 Port 套件集來安裝、移除軟體的基本用法。 make 可用的目標及環境變數詳細說明可參閱 ports7 - - - 在編譯任何 Port 套件前,請先確認已經如前章節所敘述之方法更新 Port 套件集。安裝任何第三方軟體皆可能會導致安全性漏洞,建議在安裝前先閱讀 了解 Port 已知的安全性問題。或者在每次安裝新 Port 前執行 pkg audit -F。此指令可以設定在每日系統安全性檢查時自動完成安全性稽查以及更新漏洞資料庫。要取得更多資訊,請參考 pkg-audit8periodic8 - - - 使用 Port 套件集會假設您擁有可正常連線的網路,同時也會需要超級使用者的權限。 - - 要編譯並安裝 Port,需切換目錄到要安裝的 Port 底下,然後輸入 make install,訊息中會顯示安裝的進度: - - # cd /usr/ports/sysutils/lsof -# make install ->> lsof_4.88D.freebsd.tar.gz doesn't seem to exist in /usr/ports/distfiles/. ->> Attempting to fetch from ftp://lsof.itap.purdue.edu/pub/tools/unix/lsof/. -===> Extracting for lsof-4.88 -... -[extraction output snipped] -... ->> Checksum OK for lsof_4.88D.freebsd.tar.gz. -===> Patching for lsof-4.88.d,8 -===> Applying FreeBSD patches for lsof-4.88.d,8 -===> Configuring for lsof-4.88.d,8 -... -[configure output snipped] -... -===> Building for lsof-4.88.d,8 -... -[compilation output snipped] -... - -===> Installing for lsof-4.88.d,8 -... -[installation output snipped] -... -===> Generating temporary packing list -===> Compressing manual pages for lsof-4.88.d,8 -===> Registering installation for lsof-4.88.d,8 -===> SECURITY NOTE: - This port has installed the following binaries which execute with - increased privileges. -/usr/local/sbin/lsof -# - - lsof 是需要進階權限才有辦法執行的程式,因此當該程式安裝完成時會顯示安全性警告。一旦安裝完成便會顯示指令提示。 - - 有些 Shell 會將 PATH 環境變數中所列目錄中可用的指令做快取,來增加在執行指這些指令時的查詢速度。tcsh Shell 的使用者應輸入 rehash 來讓新安裝的指令不須指定完整路徑便可使用。若在 sh Shell 則使用 hash -r。請參考 Shell 的說明文件以取得更多資訊。 - - 安裝過程中會建立工作用的子目錄用來儲存編譯時暫存的檔案。可移除此目錄來節省磁碟空間並漸少往後升級新版 Port 時造成問題: - - # make clean -===> Cleaning for lsof-88.d,8 -# - - - 若想要少做這個額外的步驟,可以編譯 Port 時使用 make install clean - - - - 自訂 Port 安裝 - - 部份 Port 提供編譯選項,可用來開啟或關閉應用程式中的元件、安全選項、或其他允許自訂的項目。這類的應用程式例子包括 www/firefox, security/gpgme 以及 mail/sylpheed-claws。若 Port 相依的其他 Port 有可設定的選項時,預設的模式會提示使用者選擇選單中的選項,這可能會讓安裝的過程暫停讓使用者操作數次。要避免這個情況,可一次設定所有選項,只要在 Port skeleton 中執行 make config-recursive,然後再執行 make install [clean] 編譯與安裝該 Port。 - - - 使用 config-recursive 時,會使用 all-depends-list Target 來收集所有要設定 Port 清單。建議執行 make config-recursive 直到所有相依的 Port 選項都已定義,直到 Port 的選項畫面不會再出現,來確定所有相依的選項都已經設定。 - - - 有許多方式可以重新進入 Port 的編譯選項清單,以便在編譯 Port 之後加入、移除或更改這些選項。方法之一是 cd 進入含有 Port 的目錄並輸入 make config。還有另一個方法是使用 make showconfig。最後一個方法是執行 make rmconfig 來移除所有曾選擇過的選項,讓您能夠重新設定。這些方法在 ports7 中都有詳細的說明。 - - Port 系統使用 fetch1 來下載檔案,它支援許多的環境變數可設定。若 FreeBSD 系統在防火牆或 FTP/HTTP 代理伺服器後面,可以設定 FTP_PASSIVE_MODE, FTP_PROXY 以及 FTP_PASSWORD 變數。請參考 fetch3 取得完整支援的變數清單。 - - 對於那些無法一直連線到網際網路的使用者,可在 /usr/ports 下執行 make fetch 來下載所有的 distfiles,或是可在某個分類的目錄中,例如 /usr/ports/net,或指定的 Port Skeleton 中執行。要注意的是,若 Port 有任何的相依,在分類或 Port Skeleton 中執行此指令並 不會 下載相依在其他分類的 Port distfiles。可使用 make fetch-recursive 來下載所有相依 Port 的 distfiles。 - - 在部份少數情況,例如當公司或組織有自己的本地 distfiles 檔案庫,可使用 MASTER_SITES 變數來覆蓋在 Makefile 中指定的下載位址。當要指定替代的位址時可: - - # cd /usr/ports/directory -# make MASTER_SITE_OVERRIDE= \ -ftp://ftp.organization.org/pub/FreeBSD/ports/distfiles/ fetch - - 也可使用 WRKDIRPREFIXPREFIX 變數來覆蓋預設的工作及目標目錄。例如: - - # make WRKDIRPREFIX=/usr/home/example/ports install - - 會編譯在 /usr/home/example/ports 的 Port 並安裝所有東西到 /usr/local 下。 - - # make PREFIX=/usr/home/example/local install - - 會編譯在 /usr/ports Port 並安裝到 /usr/home/example/local。然後: - - # make WRKDIRPREFIX=../ports PREFIX=../local install - - 來同時設定工作及目標目錄。 - - 這些變數也可做為環境變數設定,請參考您使用的 Shell 操作手冊來取得如何設定環境變數的說明。 - - - - - 移除已安裝的 Port - - - ports - removing - - - 安裝的 Port 可以使用 pkg delete 解除安裝。 使用這個指令的範例可以在 pkg-delete8 操作手冊找到。 - - 或者,可在 Port 的目錄下執行 make deinstall - - # cd /usr/ports/sysutils/lsof -make deinstall -===> Deinstalling for sysutils/lsof -===> Deinstalling -Deinstallation has been requested for the following 1 packages: - - lsof-4.88.d,8 - -The deinstallation will free 229 kB -[1/1] Deleting lsof-4.88.d,8... done - - 建議閱讀 Port 解除安裝後的訊息,若有任何相依該 Port 的應用程式,這些資訊會被顯示出來,但解除安裝的程序仍會繼續。在這種情況下最好重新安裝應用程式來避免破壞相依性。 - - - - 升級 Port - - - ports - upgrading - - - 隨著時間推移,Port 套件集中會有新版的軟體可用。本節將說明如何檢查是否有可以升級的軟體及如何升級。 - - 要檢查已安裝 Port 是否有新版可用,請先確定已安裝最新版本的 Port 樹,使用 中說明的指令來更新。在 FreeBSD 10 與更新的版本,或若套件系統已轉換為 pkg,可以使用下列指令列出已經安裝的 Port 中有那些已過時: - - # pkg version -l "<" - - 在 FreeBSD 9.X 與較舊的版本,可以使用下列指令列出已經安裝的 Port 中有那些已過時: - - # pkg_version -l "<" - - - 在嘗試升級之前,請先從檔首閱讀 /usr/ports/UPDATING 來取得最近有那些 Port 已升級或系統已安裝。這個檔案中會說明各種問題及在升級 Port 時可能會需要使用者執行的額外步驟,例如檔案格式更改、設定檔位置更改、或任何與先前版本不相容的問題。留意那些與您要升級 Port 相關的指示,並依照這些指示執行升級。 - - - - 升級與管理 Port 的工具 - - ports upgrading-tools - - Port 套件集含有數個工具可以進行升級,每一種工具都有其優點及缺點。 - - 以往大多 Port 安裝會使用 PortmasterPortupgrade,現在有較新的 Synth 可使用。 - - - 那一種工具對特定系統是最佳的選擇取決於系統管理員。建議在使用任何這些工具之前先備份資料。 - - - - - - 使用 <application>Portmaster</application> 升級 Port - - - portmaster - - - ports-mgmt/portmaster 是可用來升級已安裝 Port 的小巧工具,它只使用了隨 FreeBSD 基礎系統安裝的工具,不需要相依其他 Port 或資料庫便可在 FreeBSD 使用,要使用 Port 安裝此工具可: - - # cd /usr/ports/ports-mgmt/portmaster -# make install clean - - Portmaster 將 Port 定義成四種類型: - - - - 根 Port:沒有相依且也不被任何其他 Port 相依。 - - - - 主幹 Port:沒有相依,但被其他 Port 相依。 - - - - 分支 Port:有相依,且其被其他 Port 相依。 - - - - 枝 Port:有相依,但沒有被其他 Port 相依。 - - - - 要列出這幾個分類並搜尋是否有新版: - - # portmaster -L -===>>> Root ports (No dependencies, not depended on) -===>>> ispell-3.2.06_18 -===>>> screen-4.0.3 - ===>>> New version available: screen-4.0.3_1 -===>>> tcpflow-0.21_1 -===>>> 7 root ports -... -===>>> Branch ports (Have dependencies, are depended on) -===>>> apache22-2.2.3 - ===>>> New version available: apache22-2.2.8 -... -===>>> Leaf ports (Have dependencies, not depended on) -===>>> automake-1.9.6_2 -===>>> bash-3.1.17 - ===>>> New version available: bash-3.2.33 -... -===>>> 32 leaf ports - -===>>> 137 total installed ports - ===>>> 83 have new versions available - - 此指令用來升級所有過時的 Port: - - # portmaster -a - - - 預設 Portmaster 會在刪除已存在的 Port 前備份套件,若成功安裝新版 Portmaster 會刪除該備份。使用 來讓 Portmaster 不會自動刪除備份。加入 可啟動 Portmaster 的互動模式,會在升級每個 Port 前提示訊息。尚有許多可用的其他選項,請閱讀 portmaster8 的操作手冊來取得詳細的用法。 - - - 若升級的過程發生錯誤,可加入 來升級並重新編譯所有 Port: - - # portmaster -af - - Portmaster 也可用來安裝新的 Port 到系統,在編譯及安裝新 Port 前升級所有相依模組。要使用這個功能,要指定 Port 位於 Port 套件集中的位置: - - # portmaster shells/bash - - 更多有關 ports-mgmt/portmaster 的資訊可至其 pkg-descr 取得。 - - - - 使用 Portupgrade 升級 Port - - - portupgrade - - - ports-mgmt/portupgrade 是另一個可以用來升級 Port 的工具,此工具會安裝一套可以用來管理 Port 的應用程式,它需要相依 Ruby。要安裝該 Port: - - # cd /usr/ports/ports-mgmt/portupgrade -# make install clean - - 在執行升級之前使用此工具,建議使用 pkgdb -F 掃描已安裝的 Port 並修正該指令回報的所有資訊不一致的套件。 - - 要升級所有安裝在系統上過時的 Port,可使用 portupgrade -a,或者加上 會在每個套件升級時詢問確認: - - # portupgrade -ai - - 要升級指定的應用程式而非所有可用 Port 可使用 portupgrade pkgname,非常重要的是,要加上 來先升級指定應用程式所有相依的 Port: - - # portupgrade -R firefox - - 若使用 Portupgrade 會先在 PKG_PATH 清單中的本地目錄中搜尋可用的套件。若本地沒有可用的套件,則會從遠端下載。若套件無法在本地或遠端找到,Portupgrade 則會使用 Port 來安裝。要避免完全使用 Port 安裝,可使用 ,這個選項會告訴 Portupgrade 若沒有套件可用時放棄安裝: - - # portupgrade -PP gnome3 - - 若只想要下載 Port distfiles 或套件,使用 參數。若不要編譯或安裝任何東西,使用 。請參考 portupgrade 的操作手冊來取得所有可用選項的更多資訊。 - - 更多有關 ports-mgmt/portupgrade 的資訊可至其 pkg-descr 取得。 - - - - - - Port 與磁碟空間 - - - ports - disk-space - - - 使用 Port 套件集會隨著時間消耗磁碟空間。在編譯與安裝 Port 完之後,在 Port Skeleton 中執行 make clean 可清除暫存的 work 目錄。若使用 Portmaster 來安裝 Port,則會自動移除該目錄,除非使用 。若有安裝 Portupgrade,此指令將會移除所有在 Port 套件集的本地複本中找到的 work 目錄: - - # portsclean -C - - 除此之外,許多過時的原始碼發行檔案會儲存在 /usr/ports/distfiles。使用 Portupgrade 刪除所有不再被任何 Port 所引用的 distfiles: - - # portsclean -D - - Portupgrade 可以移除所有未被任何安裝在系統上的 Port 所引用的 distfiles: - - # portsclean -DD - - 若有安裝 Portmaster,則可使用: - - # portmaster --clean-distfiles - - 預設,若 distfile 應要被刪除,這個指令會以互動的方式向使用者確認。 - - 除了以上指令外,ports-mgmt/pkg_cutleaves 可自動移除不再需要使用的 Port。 - - - - - 使用 <application>Poudriere</application> 編譯套件 - - Poudriere 是一個使用 BSD 授權條款用來建立與測試 FreeBSD 套件的工具。它使用 FreeBSD Jail 來建置獨立的編譯環境,這些 Jail 可以用來編譯與目前所在系統不同 FreeBSD 版本的套件,也同樣可以在主機為 amd64 的系統上編譯供 i386 使用的套件。套件編譯完成後的目錄配置會與官方鏡像站完全相同。這些套件可由 pkg8 及其他套件管理工具使用。 - - Poudriere 可使用 ports-mgmt/poudriere 套件或 Port 安裝。安裝完成後會有一個範例的設定檔 /usr/local/etc/poudriere.conf.sample。複製此檔案到 /usr/local/etc/poudriere.conf,編輯複製的檔案來配合本地的設定。 - - 雖然在系統上執行 poudriere 並不一定要使用 ZFS,但使用了是有幫助的。當使用了 ZFS,則必須在 /usr/local/etc/poudriere.conf 指定 ZPOOL 以及 FREEBSD_HOST 應設定到一個最近的鏡像站。定義 CCACHE_DIR 可開啟使用 devel/ccache 快取的功能來快取編譯結果並減少那些需時常編譯的程式碼的編譯次數。將 poudriere 資料集放到一個獨立的目錄並掛載到 /poudriere 可能會比較方便,其他設定項目採用預設值便足夠。 - - 偵測到的處理器數量可用來定義要同時執行多少個編譯。並給予足夠的虛擬記憶體,不論是 RAM 或交換空間,若虛擬記憶體不足,編譯 Jail 的動作將會停止並被清除,會造成奇怪的錯誤訊息。 - - - 初始化 Jail 與 Port 樹 - - 在設定之後,初始化 poudriere 來安裝 Jail 及其所需的 FreeBSD 樹與 Port 樹。使用 來指定 Jail 的名稱以及 來指定 FreeBSD 的版本。在執行 FreeBSD/amd64 的系統上可使用 來設定要使用的架構為 i386amd64,預設會採用使用 uname 所顯示的架構。 - - # poudriere jail -c -j 10amd64 -v 10.0-RELEASE -====>> Creating 10amd64 fs... done -====>> Fetching base.txz for FreeBSD 10.0-RELEASE amd64 -/poudriere/jails/10amd64/fromftp/base.txz 100% of 59 MB 1470 kBps 00m42s -====>> Extracting base.txz... done -====>> Fetching src.txz for FreeBSD 10.0-RELEASE amd64 -/poudriere/jails/10amd64/fromftp/src.txz 100% of 107 MB 1476 kBps 01m14s -====>> Extracting src.txz... done -====>> Fetching games.txz for FreeBSD 10.0-RELEASE amd64 -/poudriere/jails/10amd64/fromftp/games.txz 100% of 865 kB 734 kBps 00m01s -====>> Extracting games.txz... done -====>> Fetching lib32.txz for FreeBSD 10.0-RELEASE amd64 -/poudriere/jails/10amd64/fromftp/lib32.txz 100% of 14 MB 1316 kBps 00m12s -====>> Extracting lib32.txz... done -====>> Cleaning up... done -====>> Jail 10amd64 10.0-RELEASE amd64 is ready to be used - - # poudriere ports -c -p local -====>> Creating local fs... done -====>> Extracting portstree "local"... -Looking up portsnap.FreeBSD.org mirrors... 7 mirrors found. -Fetching public key from ec2-eu-west-1.portsnap.freebsd.org... done. -Fetching snapshot tag from ec2-eu-west-1.portsnap.freebsd.org... done. -Fetching snapshot metadata... done. -Fetching snapshot generated at Tue Feb 11 01:07:15 CET 2014: -94a3431f0ce567f6452ffde4fd3d7d3c6e1da143efec76100% of 69 MB 1246 kBps 00m57s -Extracting snapshot... done. -Verifying snapshot integrity... done. -Fetching snapshot tag from ec2-eu-west-1.portsnap.freebsd.org... done. -Fetching snapshot metadata... done. -Updating from Tue Feb 11 01:07:15 CET 2014 to Tue Feb 11 16:05:20 CET 2014. -Fetching 4 metadata patches... done. -Applying metadata patches... done. -Fetching 0 metadata files... done. -Fetching 48 patches. -(48/48) 100.00% done. -done. -Applying patches... -done. -Fetching 1 new ports or files... done. -/poudriere/ports/tester/CHANGES -/poudriere/ports/tester/COPYRIGHT - -[...] - -Building new INDEX files... done. - - 在一台電腦,poudriere 可使用多組設定在多個 Jail 編譯來自不同 Port 樹的 Port。用來定義這些組合的自訂設定稱作 sets,可在安裝 ports-mgmt/poudriereports-mgmt/poudriere-devel 後參考 poudriere8 中的 CUSTOMIZATION 章節來取得詳細的資訊。 - - 在此處示範的基本設定放了單一個 jail-, port- 以及 set- 特定的 make.conf/usr/local/etc/poudriere.d。在此範例使用的檔案名稱由 Jail 名稱、Port 名稱以及 set 名稱所組成:10amd64-local-workstation-make.conf。系統 make.conf 與這個新的檔案在編譯時期會被合併為編譯 Jail 要使用的 make.conf - - 要編譯的套件會輸入到 10amd64-local-workstation-pkglist - - editors/emacs -devel/git -ports-mgmt/pkg -... - - 可使用以下方式設定選項及相依: - - # poudriere options -j 10amd64 -p local -z workstation -f 10amd64-local-workstation-pkglist - - 最後,編譯套件並建立套件檔案庫: - - # poudriere bulk -j 10amd64 -p local -z workstation -f 10amd64-local-workstation-pkglist - - 在執行時,按下 Ctrlt 可以顯示目前編譯的狀態,Poudriere 也會編譯在 /poudriere/logs/bulk/jailname 中的檔案,可用在網頁伺服器來顯示編譯資訊。 - - 完成之後,新套件現在可以從 poudriere 檔案庫來安裝。 - - 要取得更多使用 poudriere 的資訊,請參考 poudriere8 及主網站 - - - 設定 pkg 客戶端使用 Poudriere 檔案庫 - - 雖然可以同時使用自訂的檔案庫與官方檔案庫,但有時關閉官方檔案庫會有幫助。這可以透過建立一個設定檔覆蓋並關閉官方的設定檔來完成。建立 /usr/local/etc/pkg/repos/FreeBSD.conf 包含以下內容: - - FreeBSD: { - enabled: no -} - - 通常最簡單要提供 poudriere 檔案庫給客戶端的方式是透過 HTTP。安裝一個網頁伺服器來提供套件目錄,通常會像:/usr/local/poudriere/data/packages/10amd64,其中 10amd64 是編譯的名稱。 - - 若要連往套件檔案庫的 URL 是:http://pkg.example.com/10amd64,則在 /usr/local/etc/pkg/repos/custom.conf 的檔案庫設定檔為: - - custom: { - url: "http://pkg.example.com/10amd64", - enabled: yes, -} - - - - - 安裝後的注意事項 - - 不論軟體是從套件或 Port 安裝,大部份的第三方應用程式安裝完後需要做某種程度的設定,下列指令與位置可以用來協助找到應用程式安裝了什麼。 - - - - 大部份應用程式安裝會在 /usr/local/etc 安裝至少一個預設的設定檔,若應用程式有大量設定檔的時則會建立一個子目錄來存放這些設定檔。範例的設定檔案名稱通常使用 .sample 結尾,設定檔應要仔細查看並可能要做一些編輯讓設定檔符合系統的需求,要編輯設定檔範本前需先複製該檔案並去除 .sample 副檔名。 - - - - 應用程式提供的文件會安裝到 /usr/local/share/doc,且許多應用程式也同時會安裝操作手冊,在繼續使用應用程式前應先查看這些文件。 - - - - 部份應用程式會以服務的方式執行,在啟動應用程式前前需要加入設定到 /etc/rc.conf。這些應用程式通常會安裝啟動 Script 到 /usr/local/etc/rc.d,請參考 啟動服務 來取得更多資訊。 - - - 依設計,應用程式不會在安裝時執行其啟動 Script,也不會在解除安裝或升級時執行其中止 Script,這留給各系統的管理者去做決定。 - - - - - - csh1 的使用者應要執行 rehash 來更新已知 Binary 清單到 Shell 的 PATH - - - - 使用 pkg info 來了解應用程式安裝了那些檔案、操作手冊以及 Binary。 - - - - - - 處理損壞的 Port - - 當發現某個 Port 無法順利編譯或安裝,可以嘗試以下幾種方法解決: - - - - 搜尋 問題回報資料庫 看該 Port 有沒有待審核的修正,若有的話可以使用該修正來修正問題。 - - - - 尋求維護人員的協助,在 Port Skeleton 目錄中輸入 make maintainer 或閱讀 Port 的 Makefile 來取得維護人員的電子郵件位址。寄給維護人員的郵件內容請記得要包含 Port 的 Makefile 中的 $FreeBSD: 一整行及輸出的錯誤訊息。 - - - 有一些 Port 並非由個人維護,而是由 郵遞論壇 維護,有許多,但並非全部,只要郵件地址長的像 freebsd-listname@FreeBSD.org 都是,寄信時記得代入實際的論壇名稱。 - - 尤其是由 ports@FreeBSD.org 所維護的 Port 都不是由特定個人維護,而該 Port 的修正與支援都是來自訂閱該郵遞論壇的一般社群所提供,我們隨時歡迎志工參與! - - - 若寄信後沒有取得任何回應,可以依照 撰寫 FreeBSD 問題回報 的說明使用 Bugzilla 提出問題回報。 - - - - 自行修正看看!Porter's Handbook 中含有 Port 基礎架構的詳細資訊,可提供資訊讓您可修正偶然損壞的 Port 或甚至您可以提交之自己的 Port! - - - - 依照 中的說明安裝 Binary 套件,替代使用 Port 安裝。 - - - - - - - - - - - X Window 系統 - - - 概述 - - 使用 bsdinstall 安裝 FreeBSD 並不會自動安裝圖型化使用者介面。本章將說明如何安裝並設定 Xorg,該應用程式提供開放源碼的 X Window 系統來提供圖型化環境。接著會說明如何找到並安裝桌面環境或視窗管理程式。 - - - 偏好安裝時會自動設定 Xorg 並且在安裝過程提供視窗管理程式選項的使用者請參考 網站。 - - - 更多有關 Xorg 支援影像硬體資訊,請參考 x.org 網站。 - - 讀完這章,您將了解: - - - - 組成 X Window 系統的各種元件以及它們是如何相互運作。 - - - - 如何安裝並設定 Xorg - - - - 如何安裝並設定各種視窗管理程式與桌面環境。 - - - - 如何在 Xorg 上使用 TrueType 字型。 - - - - 如何設定系統以使用圖形化登入 (XDM)。 - - - - 在開始閱讀這章之前,您需要: - - - - 了解如何依照 說明安裝其他第三方軟體。 - - - - - - 術語 - - 雖然 X 各元件的所有細節及運作方式,並不是必須要知道的。 但對它們有些基本概念會更容易上手。 - - - - X 伺服器 (X Server) - - - X 最初設計是以網路為中心,採用 client-server 架構。在此架構下 X 伺服器 在有鍵盤、螢幕、滑鼠的電腦上運作。該伺服器負責的工作包含管理顯示、處理來自鍵盤、滑鼠的輸入及來自其他設備 (如平板或或影像投影機) 的輸入或輸出。這點可能會讓人感到困惑,因為 X 使用的術語與一般的認知剛好相反。 一般認知會以為 X 伺服器 是要在最強悍的主機上執行,而 X 客戶端 才是在桌機上面執行,實際上卻是相反。 - - - - - X 客戶端 (X Client) - - - 每個 X 應用程式,如 XTermFirefox 都是 客戶端。 客戶端會傳訊息到伺服器,例如:請在這些座標畫一個視窗,接著伺服器會傳回訊息,如:使用者剛點選了確定按鈕 - - 在家庭或小型辦公室環境,通常 X 伺服器跟 X 客戶端都是在同一台電腦上執行。也可以在比較慢的電腦上執行 X 伺服器, 並在比較強、比較貴的系統上執行 X 應用程式。 在這種情景,X 客戶端與伺服器之間的溝通就需透過網路來進行。 - - - - - 視窗管理程式 (Window Manager) - - - X 並不規定螢幕上的視窗該長什麼樣、要如何移動滑鼠指標、 要用什麼鍵來在視窗切換、每個視窗的標題列長相,及是否該有關閉按鈕,等等。事實上,X 把這部分交給所謂的視窗管理程式來管理。可用的視窗管理程式有很多種,每一種視窗管理程式都提供不同的使用介面風格:有些支援虛擬桌面,有些允許自訂組合鍵來管理桌面,有些有 開始 鈕,有些則是可更換佈景主題,可自行安裝新的佈景主題以更換外觀。 視窗管理程式可在 Port 套件集的 x11-wm 分類找到。 - - 每個視窗管理程式也各有其不同的設定機制,有些需要手動修改設定檔, 而有的則可透過圖型化工具來完成大部分的設定工作。 - - - - - 桌面環境 (Desktop Environment) - - - KDEGNOME 會被稱作桌面環境是因為包含了完整常用桌面作業的應用程式,這些應用程式可能包含文書軟體、網頁瀏覽器及遊戲。 - - - - - 聚焦政策 (Focus Policy) - - - 視窗管理程式負責滑鼠指標的聚焦政策。 聚焦政策指的是如何決定使用中及接收鍵盤輸入的視窗。 - - 通常較為人熟悉的聚焦政策叫做 click-to-focus,這個模式中,滑鼠點選到的視窗便會處於作用中 (Active) 的狀態。在 focus-follows-mouse 模式滑鼠指標所在的視窗便是作用中的視窗,只要把滑鼠移到其他視窗就可以改變作用中的視窗,若滑鼠移到根視窗 (Root Window),則會聚焦在根視窗。在 sloppy-focus 模式,既使滑鼠移到根視窗,仍然會聚焦在最後聚焦的視窗上,此模式只有當滑鼠進入新的視窗時才會聚焦於該視窗,而非離開目前視窗時。click-to-focus 模式用滑鼠點擊來決定作用中的視窗,且該視窗會被置頂到所有其他視窗之前,即使滑鼠移到其他視窗,所有的鍵盤輸入仍會由該視窗所接收。 - - 不同的視窗管理程式支援不同的聚焦模式,全部都支援 click-to-focus 且其中大部份支援其他模式,請查看視窗管理程式的說明文件來了解可用的聚焦模式。 - - - - - 視窗元件 (Widget) - - - 視窗元件指的是在所有在使用者介面上可被點選或操作的項目,這包括按鈕、核選方塊、單選按鈕、圖示及清單。 視窗元件工具包 (Widget toolkit) 是指用來建立圖型化應用程式的一系列的視窗元件。目前有數個有名的視窗元件工具包,包含 KDE 所使用的 Qt、GNOME 所使用的 GTK+。 因此應用程式會依其開發時所選用的視窗元件工具包而有不同的外觀。 - - - - - - - 安裝 <application>Xorg</application> - - 在 FreeBSD,Xorg 可透過套件或 Port 來安裝。 - - 使用 Binary 套件的安裝速度較快,但可用的自訂選項較少: - - # pkg install xorg - - 要從 Port 套件集編譯與安裝: - - # cd /usr/ports/x11/xorg -# make install clean - - 兩種安裝方式皆可完整安裝 Xorg 系統,對大多數使用者較建議使用 Binary 套件安裝。 - - 較精簡版本的 X 系統適合給有經驗的使用者使用,可至 x11/xorg-minimal 取得。這個版本就不會安裝大多數的文件、函數庫以及應用程式,而部份應用程式會需要這些額外的元件才能運作。 - - - - <application>Xorg</application> 設定 - - - - - Warren - Block - - Originally contributed by - - - - Xorg - Xorg - - - 快速開始 - - Xorg 支援大多數常見的顯示卡、鍵盤以及指標裝置。 - - - 顯示卡、顯示器以及輸入裝置會自動偵測,無須任何手動設置。除非自動設置失敗,否則請勿建立 xorg.conf 或執行 步驟。 - - - - - Xorg 曾經在電腦使用過,可先將現有的設定檔重新命名或移除: - - # mv /etc/X11/xorg.conf ~/xorg.conf.etc -# mv /usr/local/etc/X11/xorg.conf ~/xorg.conf.localetc - - - - 加入要執行 Xorg 的使用者到 videowheel 群組,以便在可用時能開啟 3D 加速。要加入使用者 jru 到任一個可用的群組: - - # pw groupmod video -m jru || pw groupmod wheel -m jru - - - - 預設內含 TWM 視窗管理程式,啟動 Xorg 時便會啟動該視窗管理程式: - - % startx - - - - 在部份較舊版的 FreeBSD,在切換回文字 Console 前系統 Console 必須設為 vt4 才可正常運作,請參考 - - - - - - 可加速影像處理的使用者群組 - - 要存取 /dev/dri 需要允許顯示卡的 3D 加速功能,這通常只需要將要執行 X 的使用者加入 videowheel 群組。此處使用 pw8 來將使用者 slurms 加入 video 群組,若沒有 video 則會加入 wheel 群組: - - # pw groupmod video -m slurms || pw groupmod wheel -m slurms - - - - 核心模式設定 (Kernel Mode Setting, <acronym>KMS</acronym>) - - 當電腦顯示從 Console 切換到高螢幕解析度供 X 使用時,必須設定影像輸出模式。最近版本的 Xorg 使用了核心內部的系統來讓切換模式更有效率。較舊版的 FreeBSD 使用的 sc4 並不知到 KMS 系統的存在,這會導致關閉 X 之後即始仍在運作但系統 Console 卻呈現空白。較新版的 vt4 Console 可避免這個問題。 - - 加入此行到 /boot/loader.conf 來開啟 vt4 - - kern.vty=vt - - - - 設定檔 - - 通常不需要做手動設置,除非自動設置無法運作,否則請不要手動建立設定檔。 - - - 目錄 - - Xorg 會查看數個目錄來尋找設定檔,在 FreeBSD 較建議使用 /usr/local/etc/X11/ 來存放這些設定檔,使用這個目錄可以幫助將應用程式檔案與作業系統檔案分離。 - - 儲存設定檔在傳統的 /etc/X11/ 仍可運作,但並不建議將應用程式檔案與基礎 FreeBSD 檔案混合在一起存放。 - - - - 單檔或多檔 - - 使用多檔,每一個檔案只設定一個指定項目會較傳統使用單一 xorg.conf 設定來的簡單。這些檔案會存放在主設定檔目錄下的 xorg.conf.d/ 子目錄,完整路徑通常為 /usr/local/etc/X11/xorg.conf.d/ - - 於本節稍後會有這些檔案的範例。 - - 傳統單一 xorg.conf 的方式仍可運作,但比起在 xorg.conf.d/ 子目錄中的多檔設定方式較不明瞭且沒有彈性。 - - - - - 顯示卡 - - 由於最近 FreeBSD 版本所做的變更,現在可以使用由 Port 或套件所提供的繪圖驅動程式,所以使用者可以使用下列來自 graphics/drm-kmod 的驅動程式。 - - - - Intel KMS 驅動程式 - Radeon KMS 驅動程式 - AMD KMS 驅動程式 - - - 大多數使用 Intel KMS 驅動程式的 Intel 顯示卡支援 2D 與 3D 加速。 - - 驅動程式名稱:i915kms - - 大多數使用 Radeon KMS 驅動程式的舊 AMD 顯示卡支援 2D 與 3D 加速。 - - 驅動程式名稱:radeonkms - - 大多數使用 AMD KMS 驅動程式的新 AMD 顯示卡支援 2D 與 3D 加速。 - - 驅動程式名稱:amdgpu - - 參考文獻請至 或至 取得支援的 GPU 清單。 - - - - - Intel - - - 3D 加速在大多數 Intel 顯示晶片都有支援,最新到 Ivy Bridge (HD Graphics 2500, 4000, 及 P4000) 包含 Iron Lake (HD Graphics) 與 Sandy Bridge (HD Graphics 2000)。 - - 驅動程式名稱:intel - - 參考文獻請至 - - - - - AMD Radeon - - - Radeon 顯示卡支援 2D 及 3D 加速,最新到 HD6000 系列。 - - 驅動程式名稱:radeon - - 參考文獻請至 - - - - - NVIDIA - - - 有數個 NVIDIA 驅動程式可於 Port 套件集中的 x11 分類取得,請安裝其中與顯示卡相符的驅動程式。 - - 參考文獻請至 - - - - - 混合組合繪圖晶片 - - - 部份筆記型電腦加入了額外繪圖處理單元到那些內建晶片組或處理。Optimus 結合了 Intel 及 NVIDIA 的硬體,Switchable GraphicsHybrid Graphics 則是結合了 IntelAMD 處理器與 AMD Radeon GPU - - 這些混合繪圖系統的實作方式均不同,FreeBSD 的 Xorg 尚無法驅動所有的混合繪圖系統版本。 - - 部份電腦提供了 BIOS 的選項可以關閉其中一個繪圖介面卡或選擇 discrete 模式,可用使用其中一種標準顯示卡驅動程式來驅動。例如,有時關閉 Optimus 系統中的 NVIDIA GPU 是可能讓 Intel 顯示晶片可用 Intel 驅動程式驅動。 - - BIOS 設定會依電腦的型號有所不同,在某些情況下,可以同時開啟兩個 GPU,而在建立的設定檔中的 Device 節只使用主要的 GPU 便能讓系統運作。 - - - - - 其他顯示卡 - - - 較不常見的顯示卡驅動程式可在 Port 套件集的 x11-drivers 目錄找到。 - - 若沒有特定的驅動程式可以支援顯示卡,仍可能可用 x11-drivers/xf86-video-vesa 驅動程式來驅動。該驅動程式可使用 x11/xorg 安裝,也可使用 x11-drivers/xf86-video-vesa 手動安裝。當沒有指定驅動程式時 Xorg 會嘗試使用這個驅動程式來驅動顯示卡。 - - x11-drivers/xf86-video-scfb 也是不特定顯示卡的驅動程式,可在許多 UEFIARM 的電腦上運作。 - - - - - 在檔案中設定影像驅動程式 - - - 要在設定檔設定使用 Intel 驅動程式: - - - 在單檔中選擇 <trademark class="registered">Intel</trademark> 影像驅動程式 - - /usr/local/etc/X11/xorg.conf.d/driver-intel.conf - - Section "Device" - Identifier "Card0" - Driver "intel" - # BusID "PCI:1:0:0" -EndSection - - 若有多張顯示卡,可取消註解 BusID identifier 然後設定為想要的顯示卡,顯示卡的 Bus ID 清單可以使用 pciconf -lv | grep -B3 display 取得。 - - - 要在設定檔設定使用 Radeon 驅動程式: - - - 在單檔中選擇 Radeon 影像驅動程式 - - /usr/local/etc/X11/xorg.conf.d/driver-radeon.conf - - Section "Device" - Identifier "Card0" - Driver "radeon" -EndSection - - - 要在設定檔設定使用 VESA 驅動程式: - - - 在單檔中選擇 <acronym>VESA</acronym> 影像驅動程式 - - /usr/local/etc/X11/xorg.conf.d/driver-vesa.conf - - Section "Device" - Identifier "Card0" - Driver "vesa" -EndSection - - - 要設定 UEFIARM 電腦使用 scfb 驅動程式: - - - 在單檔中選擇 <literal>scfb</literal> 影像驅動程式 - - /usr/local/etc/X11/xorg.conf.d/driver-scfb.conf - - Section "Device" - Identifier "Card0" - Driver "scfb" -EndSection - - - - - - - - 顯示器 - - 幾乎所有顯示器都支援延伸顯示辨識資料標準 (Extended Display Identification Data, EDID),Xorg 會使用 EDID 與顯示器通訊並偵測支援的解析度與更新頻率,然後選擇最適合的設定組合使用該顯示器。 - - 其他顯示器支援的解析度可透過在設定檔中設定想要的解析度來選擇,或者在 X 伺服器啟動之後使用 xrandr1 - - - - 使用 xrandr1 - - - 執行 xrandr1 不加任何參數可檢查影像輸出及已偵測到的顯示器模式清單: - - % xrandr -Screen 0: minimum 320 x 200, current 3000 x 1920, maximum 8192 x 8192 -DVI-0 connected primary 1920x1200+1080+0 (normal left inverted right x axis y axis) 495mm x 310mm - 1920x1200 59.95*+ - 1600x1200 60.00 - 1280x1024 85.02 75.02 60.02 - 1280x960 60.00 - 1152x864 75.00 - 1024x768 85.00 75.08 70.07 60.00 - 832x624 74.55 - 800x600 75.00 60.32 - 640x480 75.00 60.00 - 720x400 70.08 -DisplayPort-0 disconnected (normal left inverted right x axis y axis) -HDMI-0 disconnected (normal left inverted right x axis y axis) - - 這個結果顯示 DVI-0 輸出被用來顯示解析度為 1920x1200 像素於更新頻率約 60 Hz 的畫面,未有顯示器連接到 DisplayPort-0HDMI-0 接頭。 - - 可使用 xrandr1 來選擇任何其他的顯示模式。例如要切換為 1280x1024 於 60 Hz: - - % xrandr --mode 1280x1024 --rate 60 - - 在筆記型電腦使用外部顯示輸出到投影機是常見的作業。 - - 不同裝置間輸出接頭的類型與數量也不同,給每個輸出的名稱在不同驅動程式間也不同。在某些驅動程式稱為 HDMI-1 的輸出在其他驅動程式則可能稱為 HDMI1。因此第一個步驟是執行 xrandr1 列出所有可用的輸出: - - % xrandr -Screen 0: minimum 320 x 200, current 1366 x 768, maximum 8192 x 8192 -LVDS1 connected 1366x768+0+0 (normal left inverted right x axis y axis) 344mm x 193mm - 1366x768 60.04*+ - 1024x768 60.00 - 800x600 60.32 56.25 - 640x480 59.94 -VGA1 connected (normal left inverted right x axis y axis) - 1280x1024 60.02 + 75.02 - 1280x960 60.00 - 1152x864 75.00 - 1024x768 75.08 70.07 60.00 - 832x624 74.55 - 800x600 72.19 75.00 60.32 56.25 - 640x480 75.00 72.81 66.67 60.00 - 720x400 70.08 -HDMI1 disconnected (normal left inverted right x axis y axis) -DP1 disconnected (normal left inverted right x axis y axis) - - 已找到四個輸出:內建面板的 LVDS1,外接的 VGA1, HDMI1 以及 DP1 接頭。 - - 投影機已連接至 VGA1 輸出,現在使用 xrandr1 來設定該輸出到投影機 (原始解析度) 並加入額外的空間到桌面的右側: - - % xrandr --output VGA1 --auto --right-of LVDS1 - - --auto 會選擇使用 EDID 偵測到的解析度與更新頻率。若未正確偵測解析度,可替換 --auto--mode 然後給予固定值。例如大部份的投影機可使用 1024x768 解析度為,則可設定 --mode 1024x768 - - xrandr1 通常會在 .xinitrc 執行以在 X 啟動時設定適合的模式。 - - - - - 在檔案中設定螢幕解析度 - - - 在設定檔設定螢幕解析度為 1024x768: - - - 在單檔中設定螢幕解析度 - - /usr/local/etc/X11/xorg.conf.d/screen-resolution.conf - - Section "Screen" - Identifier "Screen0" - Device "Card0" - SubSection "Display" - Modes "1024x768" - EndSubSection -EndSection - - - 少數顯示器沒有 EDID,可設定 HorizSyncVertRefresh 為顯示器支援的頻率範圍。 - - - 手動設定顯示器頻率 - - /usr/local/etc/X11/xorg.conf.d/monitor0-freq.conf - - Section "Monitor" - Identifier "Monitor0" - HorizSync 30-83 # kHz - VertRefresh 50-76 # Hz -EndSection - - - - - - - - 輸入裝置 - - - 鍵盤 - - - - 鍵盤配置 - - - 鍵盤上標準按鍵的位置稱做 配置 (Layout)。配置與其他可調整的參數列於 xkeyboard-config7 - - 預設為 United States 配置,要選擇其他的配置可在 InputClass 設定 XkbLayoutXkbVariant 選項。這會套用所有符合該類別的輸入裝置。 - - 這個例子選擇 French 鍵盤配置使用 oss 變體。 - - - 設定鍵盤配置 - - /usr/local/etc/X11/xorg.conf.d/keyboard-fr-oss.conf - - Section "InputClass" - Identifier "KeyboardDefaults" - Driver "keyboard" - MatchIsKeyboard "on" - Option "XkbLayout" "fr" - Option "XkbVariant" "oss" -EndSection - - - - 設定多個鍵盤配置 - - 設定 United States, Spanish 與 Ukrainian 鍵盤配置,並可按 Alt Shift 來切換這些配置。可使用 x11/xxkbx11/sbxkb 來加強配置切換控制與目前配置的指示。 - - /usr/local/etc/X11/xorg.conf.d/kbd-layout-multi.conf - - Section "InputClass" - Identifier "All Keyboards" - MatchIsKeyboard "yes" - Option "XkbLayout" "us, es, ua" -EndSection - - - - - - 從鍵盤關閉 Xorg - - - X 可以使用組合鍵來關閉,預設並未設定組合鍵,因為該組合鍵與部份應用程式的鍵盤指令衝突。要開啟這個選項需要更改鍵盤 InputDevice 節: - - - 開啟鍵盤離開 X 功能 - - /usr/local/etc/X11/xorg.conf.d/keyboard-zap.conf - - Section "InputClass" - Identifier "KeyboardDefaults" - Driver "keyboard" - MatchIsKeyboard "on" - Option "XkbOptions" "terminate:ctrl_alt_bksp" -EndSection - - - - - - - - 滑鼠與指標裝置 - - 有許多滑鼠參數可使用設定選項來調整,請參考 mousedrv4 來取得完整清單。 - - - - 滑鼠按鍵 - - - 滑鼠的按鍵數可在 xorg.conf 的滑鼠 InputDevice 節設定,例如要設定按鍵數為 7: - - - 設定滑鼠按鍵數 - - /usr/local/etc/X11/xorg.conf.d/mouse0-buttons.conf - - Section "InputDevice" - Identifier "Mouse0" - Option "Buttons" "7" -EndSection - - - - - - - - - 手動設定 - - 在某些情況 Xorg 的自動設定無法在特定硬體上運作,或需要使用不同的設定。針對這些情況會建立自訂的設定檔。 - - - 非必要請勿手動建立設定檔,非必要的手動設置會造成運作不正常。 - - - 設定檔可由 Xorg 根據偵測到的硬體產生,這個檔案對一開始自訂設定很有幫助。 - - 產生 xorg.conf - - # Xorg -configure - - 設定檔會儲存至 /root/xorg.conf.new,做任何需要的更改,然後使用以下指令測試該檔案: - - # Xorg -config /root/xorg.conf.new - - 在新設定檔調整與測試過後,便可分開成較小的檔案放置到正常的位置 /usr/local/etc/X11/xorg.conf.d/ - - - - - - 在 <application>Xorg</application> 使用字型 - - - Type1 字型 - - 由於 Xorg 內建的預設字型用在典型的桌面出版應用程式並不是很理想,大字型會呈現鋸齒狀邊緣,看起來很不專業,小字型幾乎完全看不清楚。不過,這裡有幾個免費高品質的 Type1 (PostScript) 字型可用,且能容易的在 Xorg 使用。例如,URW 字型集 (Times Roman, Helvetica, Palatino 及其他)。 Freefont 字型集 (x11-fonts/freefonts) 包含了更多的字型,但其中大部分是給圖形軟體如 GIMP 所使用的字型,並不能完全作為螢幕字型使用。此外,Xorg 可以簡單的設定使用 TrueType 字型。更多有關本主題的詳細資訊,請參考 X7 操作手冊或 - - 要由 Binary 套件安裝上述的 Type1 字型集可執行以下指令: - - # pkg install urwfonts - - 或由 Port 套件集編譯,可執行以下指令: - - # cd /usr/ports/x11-fonts/urwfonts -# make install clean - - 同樣的安裝方式也適用 Freefont 或其他字型集。要讓 X 伺服器偵測到這些新安裝的字型,可加入適當的設定到 X 伺服器設定檔 (/etc/X11/xorg.conf),內容為: - - FontPath "/usr/local/share/fonts/urwfonts/" - - 或者在 X session 的指令列執行: - - % xset fp+ /usr/local/share/fonts/urwfonts -% xset fp rehash - - 這樣便可,但在 X session 關閉時將會失效,除非將該設定加入啟動檔 (一般的 startx session 可在 ~/.xinitrc 設定,若透過圖型化登入管理程式如 XDM 登入時則在 ~/.xsession 設定)。第三種方式是使用新 /usr/local/etc/fonts/local.conf,如 的示範。 - - - - <trademark class="registered">TrueType</trademark> 字型 - - - TrueType Fonts - - - fonts - TrueType - - - Xorg 內建支援繪製 TrueType 字型,目前有兩個模組可以支援這項功能。在本例中使用 freetype 模組,由於此模組與其他字型繪製後端較為一致。要開啟 freetype 模組只需要將下行加入到 /etc/X11/xorg.conf 中的 "Module" section。 - - Load "freetype" - - 現在要建立一個儲存 TrueType 字型的目錄 (例如,/usr/local/share/fonts/TrueType) 然後複製所有 TrueType 字型到這個目錄。要注意 TrueType 字型並無法直接取自 Apple MacXorg 使用的字型必須為 UNIX/MS-DOS/Windows 的格式。檔案複製到讓目錄之後,使用 mkfontscale 來建立 fonts.dir 來讓 X 字型繪製程式知道安裝了新的檔案。mkfontscale 可用套件的方式安裝: - - # pkg install mkfontscale - - 然後在目錄中建立 X 字型檔的索引: - - # cd /usr/local/share/fonts/TrueType -# mkfontscale - - 接著加入 TrueType 目錄到字型路徑。這個動作與 中所介紹的方式相同: - - % xset fp+ /usr/local/share/fonts/TrueType -% xset fp rehash - - 或直接加入 FontPath 一行到 xorg.conf - - 現在 Gimp, Apache OpenOffice 以及其他 X 應用程式應可以辨識到已安裝的 TrueType 字型。極小的字型 (以高解析度在網頁中顯示的文字) 與極大的字型 (在 StarOffice 中) 現在會看起來比較像樣了。 - - - - - 反鋸齒字型 - - - anti-aliased fonts - - - fonts - anti-aliased - - - 所有可在 /usr/local/share/fonts/~/.fonts/ 找到的 Xorg 字型均可在 Xft-aware 的應用程式使用反鋸齒的效果。大多最近的應用程式均為 Xft-aware 的,包括 KDE, GNOME 以及 Firefox - - 要控制那一些字型要做反鋸齒或設定反鋸齒的屬性,需建立 /usr/local/etc/fonts/local.conf 檔案 (若檔案存在則編輯)。在這個檔案中可以調整 Xft 字型系統的數項進階功能,本章節僅介紹部份簡單的項目,要取得進一步資訊,請參考 fonts-conf5 - - XML - - 這個檔案必須使用 XML 格式,小心文字大小寫,且要確定所有標籤均有正常結尾。檔案的開頭使用常見的 XML 檔首,接著為 DOCTYPE 定義,然後是 <fontconfig> 標籤: - - <?xml version="1.0"?> - <!DOCTYPE fontconfig SYSTEM "fonts.dtd"> - <fontconfig> - - 如同前面所提到的,所有在 /usr/local/share/fonts/~/.fonts/ 的字型均可在 Xft-aware 的應用程式做反鋸齒效果,若您想要加入除了上兩者以外的目錄,可加入如下行設定到 /usr/local/etc/fonts/local.conf - - <dir>/path/to/my/fonts</dir> - - 加入新字型及額外的新字型目錄之後,需重新建立字型快取: - - # fc-cache -f - - 反鋸齒效果會讓文字的邊緣變模糊,這會讓非常小的文字更能閱讀且去除大型文字的 鋸齒,但套用在一般的文字可能會造成眼睛的疲勞。要排除小於 14 點的字型大小使用反鋸齒效果,可加入這些行: - - <match target="font"> - <test name="size" compare="less"> - <double>14</double> - </test> - <edit name="antialias" mode="assign"> - <bool>false</bool> - </edit> - </match> - <match target="font"> - <test name="pixelsize" compare="less" qual="any"> - <double>14</double> - </test> - <edit mode="assign" name="antialias"> - <bool>false</bool> - </edit> - </match> - - - fonts - spacing - - - 反鋸齒所產生的間距對於部份等寬字型並不合適,尤其是在使用 KDE 時會成為一個問題。可能的修正方式是強制這類字型的間距為 100,可加入以下行: - - <match target="pattern" name="family"> - <test qual="any" name="family"> - <string>fixed</string> - </test> - <edit name="family" mode="assign"> - <string>mono</string> - </edit> - </match> - <match target="pattern" name="family"> - <test qual="any" name="family"> - <string>console</string> - </test> - <edit name="family" mode="assign"> - <string>mono</string> - </edit> - </match> - - (這會設定等寬字型的其他常用名稱為 "mono"),然後加入: - - <match target="pattern" name="family"> - <test qual="any" name="family"> - <string>mono</string> - </test> - <edit name="spacing" mode="assign"> - <int>100</int> - </edit> - </match> - - 部份字型,如 Helvetica,在使用反鋸齒時可能會發生問題,通常會呈現像垂直切成兩半的字型,最差還可能會導致應用程式當掉。要避免這個問題,可考慮加入以下設定到 local.conf - - <match target="pattern" name="family"> - <test qual="any" name="family"> - <string>Helvetica</string> - </test> - <edit name="family" mode="assign"> - <string>sans-serif</string> - </edit> - </match> - - 編輯 local.conf 完之後,請確認有使用 </fontconfig> 標籤結尾,若沒有使用會讓所做的更改被忽略。 - - 使用者可透過建立自己的 ~/.config/fontconfig/fonts.conf 來加入個人化的設定,此檔案使用與上述說明相同的 XML 格式。 - - LCD screen - Fonts - LCD screen - - 最後一點:若有使用 LCD 螢幕,可能會想要使用子像素取樣 (Sub-pixel sampling),這基本上會分開處理 (水平分隔) 紅、綠、藍色彩組成來提高垂直解析度,結果可能是無法預料的。要開啟這個功能,加入下行到 local.conf 的任一處: - - <match target="font"> - <test qual="all" name="rgba"> - <const>unknown</const> - </test> - <edit name="rgba" mode="assign"> - <const>rgb</const> - </edit> - </match> - - - 依據不同的顯示器類型可能會需要將 rgb 更改為 bgr, vrgbvbgr:可實驗看看然後看那一個效果最好。 - - - - - - - X 顯示管理程式 - - - - - Seth - Kingsley - - Originally contributed by - - - - - X Display Manager - Xorg 提供了 X 顯示管理程式 (X Display Manager, XDM),可用來做登入階段的管理。XDM 提供了一個圖型化的介面來選擇要連結的顯示伺服器以及輸入認証資訊 (登入與密碼)。 - - 本節將示範如何設定 FreeBSD 的 X 顯示管理程式。部份桌面環境會提供自己的圖型化登入管理程式,請參考 取得如何設定 GNOME 顯示管理程式 (GNOME Display Manager) 的操作方式以及 取得如何設定 KDE 顯示管理程式 (KDE Display Manager) 的操作方式。 - - - 設定 <application>XDM</application> - - 要安裝 XDM 可使用 x11/xdm 套件或 Port。安裝完成之後,可設定 XDM 在開機時執行,只需編輯 /etc/ttys 中的此項目: - - ttyv8 "/usr/local/bin/xdm -nodaemon" xterm off secure - - 更改關 (off) 為開 (on) 然後儲存編輯。在此項目中的 ttyv8 代表 XDM 會在第 9 個虛擬終端機執行。 - - XDM 的設定目錄位於 /usr/local/etc/X11/xdm。此目錄中包含數個可用來更改 XDM 行為與外觀的檔案以及在 XDM 執行時用來設定桌面的一些 Script 及程式, 摘要了每個檔案的功能。這些檔案正確的語法與用法在 xdm1 有說明。 - - - XDM 設定檔 - - - - - 檔案 - 說明 - - - - - - Xaccess - 連線到 XDM 所需的通訊協定稱做 X 顯示管理程式連線通訊協定 (X Display Manager Connection Protocol, XDMCP),此檔案為客戶端認証規則,用來控制來自遠端機器的 XDMCP 連線。預設此檔案並不允許任何遠端的客戶端連線。 - - - - Xresources - 此檔案控制 XDM 顯示選擇器及登入畫面的外觀。預設的設定簡單的矩形登入視窗,上方用較大的字型顯示機器的主機名稱,並在下方顯示 Login:Password: 提示。此檔案的格式與 Xorg 說明文件中說明的 app-defaults 檔相同。 - - - - Xservers - 登入選擇時在選擇器上要提供的本地及遠端顯示清單。 - - - - Xsession - 預設的登入階段 Script,使用者登入之後由 XDM 執行。這會指向使用者自訂的登入階段 Script 於 ~/.xsession - - - - Xsetup_* - 用來在顯示選擇器與登入介面之前自動執行應用程式的 Script。每一個顯示各有一個 Script,名稱為 Xsetup_*,其中 * 為本地顯示編號。正常情況這些 Script 會在背景執行一兩個程式,例如 xconsole - - - - xdm-config - 用來設定所有在此機器上執行的顯示的全域設定檔。 - - - - xdm-errors - 內含由伺服器程式產生的錯誤訊息,若 XDM 嘗試啟動的顯示沒有回應,可查看此檔案來取得錯誤訊息。以登入階段為基礎,這些訊息也同樣會寫入至使用者的 ~/.xsession-errors - - - - xdm-pid - XDM 的執行程序 ID - - - -
-
- - - 設定遠端存取 - - 預設只有同系統的使用者可以使用 XDM 登入。要開啟讓其他系統的使用者可連線到顯示伺服器,需編輯存取控制規則及開啟連線傾聽程式。 - - 要設定 XDM 傾聽任何遠端的連線,在 /usr/local/etc/X11/xdm/xdm-config 中的 DisplayManager.requestPort 行前加上 ! 來註解該行: - - ! SECURITY: do not listen for XDMCP or Chooser requests -! Comment out this line if you want to manage X terminals with xdm -DisplayManager.requestPort: 0 - - 儲存編輯並重新啟動 XDM,要限制遠端存取,請看 /usr/local/etc/X11/xdm/Xaccess 中的範例項目,並參考 xdm1 取得進一步資訊。 - -
- - - - 桌面環境 - - - - - Valentino - Vaschetto - - Contributed by - - - - - - 本節將介紹如何在 FreeBSD 系統安裝三種熱門的桌面環境。一套桌面環境的範圍可從簡單的視窗管理程式到完整的桌面應用程式集。有上百套的桌面環境可在 Port 套件集的 x11-wm 分類取得。 - - - GNOME - - GNOME - GNOME 是一個擁有友善使用者介面的的桌面環境,它包括用於啟動應用程式和顯示狀態的面板、一系列工具與應用程序及一套可讓應用程式更容易進行合作、相互一致的協定。更多有關 FreeBSD GNOME 的訊息可在 https://www.FreeBSD.org/gnome 取得,該網站包含了有關在 FreeBSD 安裝、設定和管理 GNOME 的額外文件。 - - 這套桌面環境可以從套件安裝: - - # pkg install gnome3 - - 也可使用以下指令從 Port 編譯 GNOMEGNOME 是一套大型的應用程式,即使在速度較快的電腦上,也會需要花費一些時間編譯。 - - # cd /usr/ports/x11/gnome3 -# make install clean - - GNOME 需要掛載 /proc。加入下行到 /etc/fstab 讓系統啟動時會自動掛載這個檔案系統: - - proc /proc procfs rw 0 0 - - GNOME 使用了 D-Bus 以及 HAL 的 Message bus 與 Hardware abstraction。這兩個應用程式會隨著 GNOME 的相依一併自動安裝,但需要在 /etc/rc.conf 開啟,這樣在系統開機時才會啟動: - - dbus_enable="YES" -hald_enable="YES" - - 安裝完之後,需設定讓 Xorg 啟動 GNOME。最簡單的方法是開啟 GNOME Display Manager, GDM,該程式已做為 GNOME 套件或 Port 的一部份安裝了,可加入下行到 /etc/rc.conf 來開啟: - - gdm_enable="YES" - - 通常也會需要啟動所有的 GNOME 服務,可加入下行到 /etc/rc.conf - - gnome_enable="YES" - - GDM 則會在系統開機時自動啟動。 - - 第二種啟動 GNOME 的方法是在設定完 ~/.xinitrc 後在指令列輸入 startx。若這個檔案已經存在,替換啟動目前視窗管理程式的那一行,改為啟動 /usr/local/bin/gnome-session。若檔案不存在,則使用以下指令建立一個: - - % echo "exec /usr/local/bin/gnome-session" > ~/.xinitrc - - 第三種方法是使用 XDM 做為顯示管理程式,在這個方法需要建立一個可執行的 ~/.xsession - - % echo "exec /usr/local/bin/gnome-session" > ~/.xsession - - - - KDE - - KDE - - KDE 是另一套易於使用的桌面環境。這個桌面環境提供了一致外觀的應用程式、標準化的選單和工具列、組合鍵、配色方案、國際化與集中、對話框導向的桌面設定。更多有關 KDE 可在 http://www.kde.org/ 取得。要取得 FreeBSD 特定的資訊,則可參考 http://freebsd.kde.org。 - - 要安裝 KDE 套件,請輸入: - - # pkg install x11/kde5 - - 或者要使用 KDE Port 編譯,可使用以下指令,採用 Port 方式安裝會有選單可以選擇要安裝的元件。KDE 是一個大型的應用程式,即使在較快的電腦上仍需要花費一段時間來編譯。 - - # cd /usr/ports/x11/kde5 -# make install clean - - - KDE - display manager - - - KDE 需要掛載 /proc。加入下行到 /etc/fstab 讓系統啟動時會自動掛載這個檔案系統: - - proc /proc procfs rw 0 0 - - KDE 使用了 D-Bus 以及 HAL 的 Message bus 與 Hardware abstraction。這兩個應用程式會隨著 KDE 的相依一併自動安裝,但需要在 /etc/rc.conf 開啟,這樣在系統開機時才會啟動: - - dbus_enable="YES" -hald_enable="YES" - - 自 KDE Plasma 5 開始,KDE Display Manager, KDM 便停止開發,可能的替代方案為 SDDM,要安裝該套件可輸入: - - # pkg install x11/sddm - - 加入下行到 /etc/rc.conf - - sddm_enable="YES" - - 第二種執行 KDE 的方法是在在指令列輸入 startx。要採用這個方式,需要加入下行到 ~/.xinitrc - - exec ck-launch-session startkde - - 第三種啟動 KDE 的方式是透過 XDM,要使用這個方法需要建立一個可執行的 ~/.xsession 如下: - - % echo "exec ck-launch-session startkde" > ~/.xsession - - 啟動 KDE 之後,請參考內建的說明系統來取得更多有關如何使用各種選單及應用程式的資訊。 - - - - Xfce - - Xfce 是以 GNOME 使用的 GTK +工具包做為基礎所開發的桌面環境,但是它更輕巧且提供了一種簡單、高效、易於使用的桌面。它可完全自訂設定、附有選單、Applet 及應用程式啟動器的主面板、提供檔案管理程式和音效管理程式並且可設定主題。由於它是快速、輕巧、高效的桌面環境,因此它非常適合有記憶體限制的較舊或較慢機器。更多有關 Xfce 的資訊可至 http://www.xfce.org 取得。 - - 要安裝 Xfce 套件: - - # pkg install xfce - - 或者使用 Port 編譯: - - # cd /usr/ports/x11-wm/xfce4 -# make install clean - - Xfce 使用了 D-Bus 作為 Message bus,由於是 Xfce 的相依,因此會自動安裝,但仍要在 /etc/rc.conf 中開啟該程式才會在系統開機時啟動: - - dbus_enable="YES" - - 不像 GNOMEKDEXfce 並沒有自己的登入管理程式,要能用 startx 指令列啟動 Xfce 之前需先加入其項目到 ~/.xinitrc - - % echo ". /usr/local/etc/xdg/xfce4/xinitrc" > ~/.xinitrc - - 另一種方式是使用 XDM,要設定這個方式需建立一個可執行的 ~/.xsession - - % echo ". /usr/local/etc/xdg/xfce4/xinitrc" > ~/.xsession - - - - - 安裝 Compiz Fusion - - 要令使用桌面電腦更令人愉快的方法是用炫麗的 3D 效果。 - - 安裝 Compiz Fusion 套件非常簡單,但設定該套件需要一些未在 Port 說明文件中說明的步驟。 - - - 設定 FreeBSD nVidia 驅動程式 - - 桌面特效需要使用相當程度的顯示卡,對於以 nVidia 為基礎的顯示卡,需要使用專用的驅動程序來取得較佳的性能。其他顯示卡的使用可以跳過這一節,並繼續 xorg.conf 設定。 - - 要知道需要那一種 nVidia 驅動程式可以查看 FAQ 中與此主題相關的問題。 - - 知道您的顯示卡要使用那種驅動程式才是正確的之後,接下來的安裝程序跟安裝其他套件一樣簡單。 - - 例如,要安裝最新的驅動程式: - - # pkg install x11/nvidia-driver - - 驅動程式會建立一個需要在系統啟動時載入的核心模組,加入下行到 /boot/loader.conf - - nvidia_load="YES" - - - 要立即載入核心模組到執行中的核心可以下 kldload nvidia 指令,但是需要注意,若不是在開機時載入,某些 Xorg 版本會無法正常運作。因此編輯完 /boot/loader.conf 之後建議要重新開機。 - - - 核心模組載入之後,您只需要更改 xorg.conf 的其中一行來開啟專用的驅動程式: - - 找到 /etc/X11/xorg.conf 中的下行: - - Driver "nv" - - 然後更改該行為: - - Driver "nvidia" - - 如往常般啟動 GUI,您應該會看到 nVidia 的啟動畫面,其他東西應如往常般運作。 - - - - 設定 xorg.conf 來啟動桌面特效 - - 要開啟 Compiz Fusion 需要修改 /etc/X11/xorg.conf - - 加入以下 Section 來開啟合成特效: - - Section "Extensions" - Option "Composite" "Enable" -EndSection - - 找到 Screen section,長的應該如下所示: - - Section "Screen" - Identifier "Screen0" - Device "Card0" - Monitor "Monitor0" - ... - - 然後加入以下兩行 (在Monitor 之後): - - DefaultDepth 24 -Option "AddARGBGLXVisuals" "True" - - 找到您欲使用的螢幕解析度所在的 Subsection,例如,您想要使用 1280x1024,則找到如下所示的 Section。若想要使用的解析度不在任何 Subsection 之中,您可以手動加入對應的項目: - - SubSection "Display" - Viewport 0 0 - Modes "1280x1024" -EndSubSection - - 桌面合成需要 24 bit 的色彩深度,更改上述 Subsection 為: - - SubSection "Display" - Viewport 0 0 - Depth 24 - Modes "1280x1024" -EndSubSection - - 最後確認在 Module section 中已經載入 glxextmod 模組: - - Section "Module" - Load "extmod" - Load "glx" - ... - - 前面所述的動作可以執行 x11/nvidia-xconfig 來自動完成 (使用 root): - - # nvidia-xconfig --add-argb-glx-visuals -# nvidia-xconfig --composite -# nvidia-xconfig --depth=24 - - - - 安裝與設定 Compiz Fusion - - 安裝 Compiz Fusion 如同安裝其他套件一樣簡單: - - # pkg install x11-wm/compiz-fusion - - 安裝完成之後,開啟您的圖型化桌面,然後在終端機的畫面輸入以下指令 (使用一般使用者): - - % compiz --replace --sm-disable --ignore-desktop-hints ccp & -% emerald --replace & - - 由於您的視窗管理程式 (例如:Metacity,若您使用 GNOME) 會被替換成 Compiz Fusion,您的螢幕會閃爍幾秒。而 Emerald 會處理視窗的裝飾 (例如:關閉、最小化、最大化按鈕、標題列及其他相關)。 - - 您或許可以將這些指令改寫成較小的 Script 然後在啟動時自動執行 (加到 GNOME 桌面的 Sessions 中): - - #! /bin/sh -compiz --replace --sm-disable --ignore-desktop-hints ccp & -emerald --replace & - - 儲存這個 Script 到您的家目錄所在位置,例如 start-compiz,然後讓該檔案可以執行: - - % chmod +x ~/start-compiz - - 接著使用 GUI 將該檔案加入啟動程式 Startup Programs (位於 GNOME 桌面的系統 System, 偏好設定 Preferences, 工作階段 Sessions)。 - - 要選擇所想使用的特效與相關設定,可執行 (一樣使用一般使用者) Compiz Config 設定管理程式 Compiz Config Settings Manager - - % ccsm - - - GNOME 中,也可在系統 System, 偏好設定 Preferences 選單中找到。 - - - 若您在編譯時選擇了 gconf support,您便可使用 gconf-editorapps/compiz 下查看設定。 - - - - - - 疑難排解 - - 若滑鼠無法使用,您將需要做第一次設定方可繼續。在最近的 Xorg 版本,使用自動偵測裝置會忽略在 xorg.conf 中的 InputDevice section。要採用舊的方式,需在此檔案加入下行到 ServerLayoutServerFlags section: - - Option "AutoAddDevices" "false" - - 輸入裝置便可如先前版本一樣設定,連同其他所需的選項 (如:切換鍵盤配置)。 - - - 如同前面有說明過,hald Daemon 預設會自動偵測您的鍵盤,因此您的鍵盤配置或型號可能不正確,桌面環境如 GNOME, KDEXfce 會提供設定鍵盤的工具。即使如此,還是有可能透過 setxkbmap1 工具或 hald 的設定規則的協助來直接設定鍵盤屬性。 - - 舉例來說,若有人想要使用 PC 102 鍵的鍵盤,採用法語 (French) 配置,我們便需要建立一個給 hald 的鍵盤設定檔,名稱為 x11-input.fdi,然後儲存到 /usr/local/etc/hal/fdi/policy 目錄。這個檔案中應要有以下幾行: - - <?xml version="1.0" encoding="iso-8859-1"?> -<deviceinfo version="0.2"> - <device> - <match key="info.capabilities" contains="input.keyboard"> - <merge key="input.x11_options.XkbModel" type="string">pc102</merge> - <merge key="input.x11_options.XkbLayout" type="string">fr</merge> - </match> - </device> -</deviceinfo> - - 若這個檔案已經存在,只需要複製並貼上您的檔案中有關鍵盤設定的那幾行。 - - 您會需要重新啟動您的機器來讓 hald 讀取這個檔案。 - - 也是可以從 X 終端機或 Script 下指令來做同樣的設定: - - % setxkbmap -model pc102 -layout fr - - /usr/local/share/X11/xkb/rules/base.lst 中列出了各種可用的鍵盤、配置與設定。 - - - Xorg - tuning - - 現在可以開始調整 xorg.conf.new 設定檔,在文字編輯器如 emacs1ee1 開啟該設定檔。若顯示器是不支援自動偵測同步頻率 (Sync frequency) 的舊或特殊的型號,同步頻率的設定可以手動加到 xorg.conf.new"Monitor" section: - - Section "Monitor" - Identifier "Monitor0" - VendorName "Monitor Vendor" - ModelName "Monitor Model" - HorizSync 30-107 - VertRefresh 48-120 -EndSection - - 多數顯示器都支援自動偵測同步頻率,並不需要手動設定這些數值。對於那些不支援自動偵測的顯示器,請輸入由製造商提供的數值來避免損壞顯示器。 - - X 允許在支援的顯示器使用 DPMS (Energy Star) 功能,xset1 程式可以控制逾時並可強制待機 (Standby)、暫停 (Suspend) 或關閉 (Off) 模式。若您想要為您的顯示器開啟 DPMS 功能,您需要加入下行到顯示器 (Monitor) 的 Section: - - Option "DPMS" - - - xorg.conf - - - 在編輯器還未關閉 xorg.conf.new 設定檔前,選擇想要使用的預設解析度及色彩深度。這些項目可在 "Screen" section 定義: - - Section "Screen" - Identifier "Screen0" - Device "Card0" - Monitor "Monitor0" - DefaultDepth 24 - SubSection "Display" - Viewport 0 0 - Depth 24 - Modes "1024x768" - EndSubSection -EndSection - - DefaultDepth 關鍵字代表預設執行要使用的色彩深度,這個設定可以被 Xorg1 的指令列參數 覆蓋。Modes 關鍵字代表執行要使用的解析度,注意,只有 VESA 標準模式才支援目標系統的繪圖硬體來定義解析度。在上述的例子中,預設使用的色彩深度為每像素 24 bit,這個色彩深度可用的解析度為 1024 x 768 像素。 - - 最後,儲存設定檔並使用測試模式來測試上述的設定。 - - - 有一個工具可以協助您診斷問題,那就是 Xorg 日誌檔。該日誌檔中記錄了 Xorg 連接的每個裝置的資訊。Xorg 記錄檔名稱的格式為 /var/log/Xorg.0.log,確切的記錄檔名會可能從 Xorg.0.logXorg.8.log 以此類推。 - - - 若一且運作正常,設定檔需要安裝到 Xorg1 會尋找的常用設定檔位置,通常是 /etc/X11/xorg.conf/usr/local/etc/X11/xorg.conf - - # cp xorg.conf.new /etc/X11/xorg.conf - - 現在已經完成了 Xorg 的設定程序。Xorg 現在可以使用 startx1 工具啟動。Xorg 伺服器也可以使用 xdm1 來啟動。 - - - 設定 <trademark class="registered">Intel</trademark> <literal>i810</literal> 繪圖晶片組 - - - Intel i810 graphic chipset - - - 要設定 Intel i810 整合晶片組需要使用 agpgart AGP 程式介面來控制 Xorg 驅動該顯示卡。請參考 agp4 驅動程式操作手冊來取得更多詳細資訊。 - - 這也可讓您可以設定任何其他繪圖卡的硬體。注意,在未編譯 agp4 到核心的系統,並無法使用 kldload8 來載入該模組,因此驅動程式必須在開機時便在核心啟動,所以需要透過編譯或使用 /boot/loader.conf 來載入。 - - - - 加入寬螢幕平板顯示器到設定檔 - - - widescreen flatpanel configuration - - - 此章節會需要有一些進階的設定知識,若嘗試使用上述的標準設定工具仍無法產生可運作的設定,在日誌檔中應有足夠的資訊可運用來讓顯示卡運作。在此會需要使用文字編輯器。 - - 目前使用寬螢幕 (WSXGA, WSXGA+, WUXGA, WXGA, WXGA+, et.al.) 格式支援的 16:10 及 10:9 格式或其他的寬高比可會有問題。例如一些 16:10 寬高比常見的螢幕解析度: - - - - 2560x1600 - - - - 1920x1200 - - - - 1680x1050 - - - - 1440x900 - - - - 1280x800 - - - - 在某些時候,可以簡單的將這些要使用的解析度以 Mode 加入到 Section "Screen": - - Section "Screen" -Identifier "Screen0" -Device "Card0" -Monitor "Monitor0" -DefaultDepth 24 -SubSection "Display" - Viewport 0 0 - Depth 24 - Modes "1680x1050" -EndSubSection -EndSection - - Xorg 能夠從寬螢幕設定取得解析度資訊 (透過 I2C/DDC),因此能夠知道螢幕能處理的頻率及解析度。 - - 若驅動程式中不存在那些螢幕能處理的 ModeLines,則需要給 Xorg 一點提示。透過 /var/log/Xorg.0.log 可以取得足夠的資訊來手動建立可運作的 ModeLine。只需要在日誌檔中找到類似以下的訊息: - - (II) MGA(0): Supported additional Video Mode: -(II) MGA(0): clock: 146.2 MHz Image Size: 433 x 271 mm -(II) MGA(0): h_active: 1680 h_sync: 1784 h_sync_end 1960 h_blank_end 2240 h_border: 0 -(II) MGA(0): v_active: 1050 v_sync: 1053 v_sync_end 1059 v_blanking: 1089 v_border: 0 -(II) MGA(0): Ranges: V min: 48 V max: 85 Hz, H min: 30 H max: 94 kHz, PixClock max 170 MHz - - 這些資訊稱作 EDID 資訊,使用 EDIT 資訊建立 ModeLine 只需要將數據使用正確的順序放入: - - ModeLine <name> <clock> <4 horiz. timings> <4 vert. timings> - - 將資訊放入之後,本例中 Section "Monitor" 中的 ModeLine 會看起來像這樣: - - Section "Monitor" -Identifier "Monitor1" -VendorName "Bigname" -ModelName "BestModel" -ModeLine "1680x1050" 146.2 1680 1784 1960 2240 1050 1053 1059 1089 -Option "DPMS" -EndSection - - 便完成編輯的步驟,接著需要在您的寬螢幕顯示器啟動 X。 - - - - Compiz Fusion 疑難排解 - - - - - 我已經安裝了 Compiz Fusion,但在執行了您所提到的指令後,我的視窗的標題列與按鈕便消失了。是那裡有問題? - - - - 您可能忘記在 /etc/X11/xorg.conf 中的設定。請重新檢查這個檔案,特別是 DefaultDepthAddARGBGLXVisuals 指令項。 - - - - - - 當我執行指令來啟動 Compiz Fusion,X 伺服器便當掉了,然後我又返回 Console。是那裡有問題? - - - - 若您檢查 /var/log/Xorg.0.log,您可能可以找到當 X 啟動時所發生的錯誤訊息。最常發生的錯誤會是: - - (EE) NVIDIA(0): Failed to initialize the GLX module; please check in your X -(EE) NVIDIA(0): log file that the GLX module has been loaded in your X -(EE) NVIDIA(0): server, and that the module is the NVIDIA GLX module. If -(EE) NVIDIA(0): you continue to encounter problems, Please try -(EE) NVIDIA(0): reinstalling the NVIDIA driver. - - 會發生這個情形通常是因為您升級了 Xorg,您需要重新安裝 x11/nvidia-driver 套件來重新編譯 glx。 - - - - - -
- -
- - - 一般作業 - - - 既然基礎的部分已經提過了,接下來的這個部分將會討論一些常會用到的 FreeBSD 的特色,這些章節包括: - - - - 介紹給您常見且實用的桌面應用軟體:瀏覽器、辦工工具、文件閱覽程式等。 - - - - 介紹給您眾多 FreeBSD 上可用的多媒體工具。 - - - - 解釋如何編譯量身訂做的 FreeBSD 核心以增加額外系統功能的流程。 - - - - 詳細描述列印系統,包含桌上型印表機及網路印表機的設定。 - - - - 展示給您看如何在您的 FreeBSD 系統中執行 Linux 應用軟體。 - - - - 這些章節中有些需要您預先閱讀些相關文件,在各章節開頭的概要內會提及。 - - - - - - - - 桌面應用程式 - - - 概述 - - 隨著 FreeBSD 優越的效能及穩定性越來越熱門,它同時適合作為每日使用的桌面系統。FreeBSD 套件或 Port 有超過 24,000 個可用的應用程式,可以簡單的建立一個自訂的桌面環境來執行各種不同的桌面應用程式。本章將示範如何安裝數個桌面應用程式,包含網頁瀏覽器、辦工軟體、文件閱覽程式以及財務軟體。 - - - 比起重頭設定與編譯,較偏好使用 FreeBSD 桌面環境已預先編譯好版本的使用者可參考 trueos.org 網站。 - - - 在閱讀這章之前,你必須了解如何: - - - - 使用套件或 Port 安裝其他軟體如 所敘述。 - - - - 安狀 X 與視窗管理程式如 所敘述。 - - - - 要取得有關如何設定多媒體環境的資訊,請參考 - - - - 瀏覽器 - - - browsers - web - - - 在 FreeBSD 中並未預先安裝好網頁瀏覽器。 但在 Port 套件集中的 www 分類中有許多瀏覽器可以採 Binary 套件安裝或自 Port 套件集編譯的方式安裝。 - - KDEGNOME 桌面環境都有提供自有的 HTML 瀏覽器。請參考 來了解更多有關如何設定完整桌面環境的資訊。 - - 有一些輕量化的瀏覽器可使用,包含 www/dillo2, www/links 以及 www/w3m - - 本章節將示範如何安裝下列常見的網頁瀏覽器並說明該應用程式是否需要用到大量資源、花費大量時間自 Port 編譯或何主要的相依套件。 - - - - - - 應用程式名稱 - 所需資源 - 自 Port 安裝時間 - 說明 - - - - - - Firefox - - - 有 FreeBSD 、 Linux 及在地化版本 - - - - Opera - - - 有 FreeBSD 、 Linux 版本 - - - - Konqueror - - - 需要 KDE 程式庫 - - - - Chromium - - - 需要 Gtk+ 程式庫 - - - - - - - Firefox - - - Firefox - - - Firefox 是一套開放源始碼的瀏覽器,它具備符合 HTML 標準的顯示引擎、頁籤瀏覽、彈出視窗封鎖、擴充套件、強化安全性及其他更多功能。Firefox 的基礎使用了 Mozilla 的程式庫。 - - 要安裝最新釋出版本的 Firefox 套件可輸入: - - # pkg install firefox - - 要安裝延長支援發佈 (Extended Support Release, ESR) 版本的 Firefox,可使用: - - # pkg install firefox-esr - - 在地化的版本可在 www/firefox-i18nwww/firefox-esr-i18n 取得。 - - 使用 Port 套件地可以用原始碼編譯成您想要的 Firefox 版本。此範例編譯 www/firefox,其中 firefox 可替換為 ESR 或在地化版本來安裝。 - - # cd /usr/ports/www/firefox -# make install clean - - - - Opera - - - Opera - - - Opera 是個具備完整功能、符合標準且輕量、執行速度快的瀏覽器。 它同時也具備了內建的郵件、新聞閱讀器、IRC 客戶端、RSS/Atom 來源閱讀器等。 可用的版本有兩種原生的 FreeBSD 版本及 Linux 模擬模式下執行的版本。 - - 以下指令可安裝 FreeBSD Binary 套件版本的 Opera,替換 operalinux-opera 則可改安裝 Linux 版本。 - - # pkg install opera - - 或者,可安裝 Port 套件集中的版本,以下範例會編譯原生的版本: - - # cd /usr/ports/www/opera -# make install clean - - 要安裝 Linux 則替換 operalinux-opera - - 要安裝 Adobe Flash 附加元件,需先編譯 www/linux-flashplayer Port,因受到授權條款限制無法事先編譯為 Binary 套件。然後再安裝 www/opera-linuxplugins。以下範例示範如何編譯 Port 中的這兩個應用程式: - - # cd /usr/ports/www/linux-flashplayer -# make install clean -# cd /usr/ports/www/opera-linuxplugins -# make install clean - - 安裝完成後,開啟瀏覽器檢查附加元件是否存在,在網址列輸入 opera:plugins 並按下 Enter 鍵,便會有清單顯示目前可用的附加元件。 - - 若要安裝 Java 附加元件請接著安裝 java/icedtea-web - - - - Konqueror - - - Konqueror - - - Konqueror 不只是個網頁瀏覽器, 它同時也是檔案管理器和多媒體瀏覽器。它包含在 x11/kde4-baseapps 套件或 Port 中。 - - Konqueror 使用支援 WebKit 以及它自有的 KTHML。WebKit 是一套被許多現代瀏覽器所使用的繪圖引擎,包含 Chromium。要在 FreeBSD 的 Konqueror 使用 WebKit 需安裝 www/kwebkitpart 套件或 Port。此範例示範使用 Binary 套件安裝: - - # pkg install kwebkitpart - - 從 Port 套件集安裝: - - # cd /usr/ports/www/kwebkitpart -# make install clean - - 要啟動 Konqueror 中的 WebKit 點選 SettingsConfigure Konqueror。在 General 設定頁面內點選 Default web browser engine 旁的下拉示選單並變更 KHTMLWebKit - - Konqueror 也支援 Flash如何Konqueror 上安裝 Flash 的說明可參考 http://freebsd.kde.org/howtos/konqueror-flash.php - - - - Chromium - - - Chromium - - - Chromium 是一個開放源始碼的瀏覽器計劃,該計劃的目標是要建立一個安全、快速且更穩定的網頁瀏覽體驗。Chromium 的功能有頁籤式瀏覽、彈出視窗封鎖、擴充套件等等。 - - Chromium 可以使用套件來安裝,只要輸入: - - # pkg install chromium - - 或者可從 Port 套件集的原始碼編譯 Chromium - - # cd /usr/ports/www/chromium -# make install clean - - - Chromium 的執行檔為 /usr/local/bin/chrome,並非 /usr/local/bin/chromium - - - - - - 辦工工具 - - 當開始進行辦公,使用者通常會找好用的辦公軟體或是好上手的文書處理程式。 雖然有些 桌面環境 像是 KDE 已經提供了辦公軟體,但並沒有預設的辦公軟體,FreeBSD 提供多套辦公軟體以及圖型化文書處理程式,不論您用那種的視窗管理程式都能使用。 - - 本章節元範如何安裝以下熱門的辦公軟體以及說明該應用程式所需的資源、自 Port 編譯的時間或者是否有其他主要相依套件。 - - - - - - 應用程式名稱 - 所需資源 - 自 Port 安裝時間 - 主要相依套件 - - - - - - Calligra - - - KDE - - - - AbiWord - - - Gtk+GNOME - - - - The Gimp - - - Gtk+ - - - - Apache - OpenOffice - - 非常多 - JDKMozilla - - - - LibreOffice - 有點多 - 非常多 - Gtk+KDE/ GNOMEJDK - - - - - - - Calligra - - - Calligra - - - office suite - Calligra - - - KDE 桌面環境中內含辦公軟體可以與 KDE 分開安裝。Calligra 中也有可在其他辦公軟體中找到的標準元件,如 Words 是文件處理程式、Sheets 是試算表程式、Stage 可管理投影片以及 Karbon 用來繪製圖型文件。 - - 在 FreeBSD 中 editors/calligra 可以使用套件或 Port 的方式安裝,要使用套件安裝: - - # pkg install calligra - - 若沒有可用的套件,可改使用 Port 套件集安裝: - - # cd /usr/ports/editors/calligra -# make install clean - - - - AbiWord - - - AbiWord - - - AbiWord 是一個免費的文件處理軟體,外觀和感覺都近似於 Microsoft Word。 它非常快速,包含了許多功能而且非常容易上手。 - - AbiWord 可以輸入或輸出許多檔案格式, 包括一些有專用的格式,例如 Microsoft .rtf 格式。 - - 要安裝 AbiWord Binary 套件,可使用下列指令: - - # pkg install abiword - - 若沒有 Binary 套件版本,也可以從 Port 套件集中編譯安裝: - - # cd /usr/ports/editors/abiword -# make install clean - - - - The GIMP - - - The GIMP - - - 對於影像的編輯及修改來說,The GIMP 是非常精緻的影像處理軟體。 它可以當作簡單的繪圖軟體或是高品質的相片處理軟體。 它支援為數眾多的外掛程式及指令稿 (script-fu) 介面。 The GIMP 可以讀寫許多檔案格式。 它也支援掃描器和手寫板。 - - 要安裝套件可: - - # pkg install gimp - - 或使用 Port 套件集安裝: - - # cd /usr/ports/graphics/gimp -# make install clean - - 在 Port 套件集的 graphics 分類 (freebsd.org/ports/graphics.html) 下也包含了許多 GIMP 相關的附加元件,說明檔及使用手冊。 - - - - - Apache OpenOffice - - - - Apache OpenOffice - - - - office suite - - Apache OpenOffice - - - - Apache OpenOffice 是開放原始碼的辦工室軟體,由 Apache Software Foundation's Incubator 底下的團隊所開發。 它包含了所有完整的辦公軟體組合: 文字處理器、試算表、簡報軟體還有繪圖軟體。 除了它的使用者介面非常類似其他的辦公軟體, 他還能夠輸入和輸出許多熱門的檔案格式。 它也包含了不同語言的使用者介面、拼字檢查和字典。 - - Apache OpenOffice 的文字處理器使用原生的 XML 檔案格式來增加移植性及彈性。 試算表程式支援巨集 (Macro) 功能而且能夠使用外來的資料庫介面。 Apache OpenOffice 已經十分穩定, 並且能夠在 Windows, Solaris, Linux, FreeBSD 及 Mac OS X 等作業系統上面執行。 想知道更多關於 Apache OpenOffice 的資訊可以在 openoffice.org 網頁上查詢。在 FreeBSD 特定的資訊可參考 porting.openoffice.org/freebsd/。 - - 要安裝 Apache OpenOffice 套件: - - # pkg install apache-openoffice - - 當套件安裝完成之後,只要輸入下面的指令就能執行 Apache OpenOffice - - % openoffice-X.Y.Z - - 其中 X.Y.Z 是已安裝的 Apache OpenOffice 的版本編號。第一次執行 Apache OpenOffice 會詢問一些問題且會在使用者的家目錄建立一個 .openoffice.org 資料夾。 - - 若無法由套件取得想要的 Apache OpenOffice,仍可選擇從 Port 編譯。 不過必須注意:編譯的過程會需要大量的磁碟空間與時間: - - # cd /usr/ports/editors/openoffice-4 -# make install clean - - - 如果想要編譯在地化的版本,將前面的指令替換成為: - - # make LOCALIZED_LANG=your_language install clean - - 替換 your_language 為正確的語言 ISO 編碼。支援的語言編碼清單在 files/Makefile.localized,位於該 Port 的目錄。 - - - - - LibreOffice - - - LibreOffice - - - office suite - LibreOffice - - - LibreOffice 是一套自由的辦公軟體由 documentfoundation.org 所開發。它可相容其他主流的辦公軟體以及可在各種平台上使用。它是 Apache OpenOffice 品牌重塑後的分支,含有可在完整辦公生產力軟體中找到的應用程式:文件處理程式、試算表、簡報管理程式、繪圖程式、資料庫管理程式以及建立與編輯數學公式的工具。它也支援數種語言與國際化一直延伸到介面、拼字檢查程式與字典。 - - LibreOffice 的文件處理程式使用了原生的 XML 檔案格式來增加可攜性與彈性,試算表程式支援可與外部資料庫連接的巨集語言。LibreOffice 非常穩定且可直接在 Windows, Linux, FreeBSD 以及 Mac OS X 上執行。更多有關 LibreOffice 的資訊可在 libreoffice.org 找到。 - - 要安裝英文版本的 LibreOffice 套件: - - # pkg install libreoffice - - Port 套件集的編輯器分類 (freebsd.org/ports/editors.html) 中含有數個 LibreOffice 的語系。安裝在地化套件時,請替換 libreoffice 為在地化套件的名稱。 - - 套件安裝之後,輸入以下指令來執行 LibreOffice - - % libreoffice - - 第一次啟動的過程中會詢問一些問題並在使用者的家目錄建立 .libreoffice 資料夾。 - - 若找不到想使用的 LibreOffice 套件,也可從 Port 編譯,但這會要大量的磁碟空間及漫長的時間編譯。以下例子示範編譯英文版本: - - # cd /usr/ports/editors/libreoffice -# make install clean - - - 要編譯在地化版本,則需 cd 進入想要的語言 Port 目錄。支援的語言可在 Port 套件集的編輯器分類 (freebsd.org/ports/editors.html) 中找到。 - - - - - - 文件閱覽程式 - - UNIX 出現之後,有一些新的文件格式才越來越熱門,這些文件所需的檢視程式可能並不在基礎系統中。本節將示範如何安裝以下文件檢視程式: - - - - - - 應用程式名稱 - 所需資源 - 自 Port 安裝時間 - 主要相依套件 - - - - - - Xpdf - - - FreeType - - - - gv - - - Xaw3d - - - - Geeqie - - - Gtk+GNOME - - - - ePDFView - - - Gtk+ - - - - Okular - - - KDE - - - - - - - Xpdf - - - Xpdf - - - PDF - viewing - - - 如果你想要一個小型的 FreeBSD PDF 閱覽軟體, Xpdf 是個輕量級而且有效率的閱覽器。 它只需要非常少的資源而且十分穩定。 它只使用標準的 X 字型且不需要額外的工具包(Toolkit)。 - - 安裝 Xpdf 套件: - - # pkg install xpdf - - 若沒有可用的套件版本,可使用 Port 套件集安裝: - - # cd /usr/ports/graphics/xpdf -# make install clean - - 完成安裝後,執行 xpdf 並使用滑鼠右鍵開啟選單。 - - - - <application>gv</application> - - - gv - - - PDF - viewing - - - PostScript - viewing - - - gvPostScript 和 PDF 的閱覽器。 它建構於 ghostview 的基礎上,不過因為使用 Xaw3d 視窗元件工具包,所以外觀看起來比較漂亮。 gv 有許多可設定的功能,比如說紙張方向、紙張大小、縮放比例、和反鋸齒(Anti-aliasing)等。 而且幾乎所有的使用都可以從鍵盤或滑鼠來完成。 - - 安裝 gv 套件: - - # pkg install gv - - 若沒有可用的套件版本,可使用 Port 套件集安裝: - - # cd /usr/ports/print/gv -# make install clean - - - - Geeqie - - Geeqie - - Geeqie 是由已經停止維護的 GQView 專案所衍伸出來的分支,並致力開發新功能並整合已有的修補。Geeqie 是一套影像管理軟體,支援單鍵閱覽檔案、啟動外部編輯器、縮圖預覽等功能。 它也有幻燈片模式及一些基本的檔案操作的功能,能輕鬆的管理大量影像並找出重複的檔案。 Geeqie 也支援使用全螢幕閱覽以及國際化。 - - 安裝 Geeqie 套件: - - # pkg install geeqie - - 若沒有可用的套件版本,可使用 Port 套件集安裝: - - # cd /usr/ports/graphics/geeqie -# make install clean - - - - ePDFView - - - ePDFView - - - PDF - viewing - - - ePDFView 是一套小巧的 PDF 文件檢視程式,只使用了 Gtk+Poppler 程式庫。它目前還在開發當中,但已經可以開啟大部份 PDF 檔案 (甚至是加密過的)、儲存文件複本以及支援使用 CUPS 來列印。 - - 要以套件安裝 ePDFView - - # pkg install epdfview - - 若沒有可用的套件版本,可使用 Port 套件集安裝: - - # cd /usr/ports/graphics/epdfview -# make install clean - - - - Okular - - - Okular - - - PDF - viewing - - - Okular 是一套通用的文件檢視程式,以 KDEKPDF 為基礎。它可以開啟許多種文件格式,包含了 PDF, PostScript, DjVu, CHM, XPS 以及 ePub。 - - 要以套件安裝 Okular - - # pkg install okular - - 若沒有可用的套件版本,可使用 Port 套件集安裝: - - # cd /usr/ports/graphics/okular -# make install clean - - - - - 財務 - - 如果有任何理由你想要在你的 FreeBSD 桌面環境上管理你的個人財務, 這裡有一些功能強大、使用簡單的應用程式可供安裝。 這些財務管理軟體之中有些是相容於流行的 QuickenExcel 文件。 - - 這節涵蓋了下面這些軟體: - - - - - - 應用程式名稱 - 所需資源 - 自 Port 安裝時間 - 主要相依套件 - - - - - - GnuCash - - - GNOME - - - - Gnumeric - - - GNOME - - - - KMyMoney - - - KDE - - - - - - - GnuCash - - - GnuCash - - - GnuCashGNOME 團隊努力成果中的一部分, GNOME 團隊主要提供親切而強大的桌面應用程式給終端使用者。使用 GnuCash 可以持續追蹤收入與花費、銀行帳戶以及股票證券等。 它的特性是介面直覺但功能仍非常專業。 - - GnuCash 提供了智慧的計數器、多階層帳戶系統以及快速鍵及自動完成功能。 它也能分開單一的報表至數個詳細的部份。 GnuCash 也能夠匯入及合併 Quicken QIF 檔案。 它也能處理大部分國際的日期及通用貨幣之格式。 - - 安裝 GnuCash 套件: - - # pkg install gnucash - - 若沒有可用的套件版本,可使用 Port 套件集安裝: - - # cd /usr/ports/finance/gnucash -# make install clean - - - - Gnumeric - - - Gnumeric - - 試算表 Gnumeric - - GnumericGNOME 社群所開發的試算表程式。 它的特點是擁有能夠根據儲存格格式 「猜出」使用者的輸入來自動補齊的系統。 它也能夠匯入許多熱門的檔案格式,像是 Excel, Lotus 1-2-3 以及 Quattro Pro。 它有大量內建的函數而且能夠使用常用的儲存格格式,像是:數字、貨幣、日期、時間及其他格式等。 - - 安裝 Gnumeric 套件: - - # pkg install gnumeric - - 若沒有可用的套件版本,可使用 Port 套件集安裝: - - # cd /usr/ports/math/gnumeric -# make install clean - - - - KMyMoney - - KMyMoney - - 試算表 KMyMoney - - KMyMoney 是一套個人財務應用程式,由 KDE 社群所開發。KMyMoney 的目標是提供可在商業個人財務管理應用程式中找到的重要功能,它也強調簡單易用及其功能間採用合適的複式記帳。KMyMoney 可從標準 Quicken QIF 檔案匯入資料、追蹤投資、處理多種貨幣並提供財務報表。 - - 要以套件安裝 KMyMoney - - # pkg install kmymoney-kde4 - - 若沒有可用的套件版本,可使用 Port 套件集安裝: - - # cd /usr/ports/finance/kmymoney-kde4 -# make install clean - - - - - - - - - - 多媒體 - - - - - Ross - Lippert - - Edited by - - - - - - 概述 - - FreeBSD 廣泛地支援各種音效卡, 讓使用者可以享受來自電腦上的高傳真音質(Hi-Fi), 此外還包括了錄製和播放 MPEG Audio Layer 3 (MP3)、 Waveform Audio File (WAV)、Ogg Vorbis 以及其他許多種格式聲音的能力。同時 FreeBSD Port 套件集也包含了許多可讓您可以錄音、編修音效以及控制 MIDI 配備的應用程式。 - - FreeBSD 也能播放一般的視訊檔和 DVD。 FreeBSD Port 套件集中含有可編碼、轉換以及播放格種影像媒體的應用程式。 - - 本章會說明如何設定 FreeBSD 上的音效卡、影像播放器、電視卡及掃描器。同時會說明有那些應用程式可以使用這些裝置。 - - 讀完這章,您將了解: - - - - 設定 FreeBSD 上的音效卡。 - - - - 音效設定疑難排解。 - - - - 播放、錄製 MP3 及其他聲音檔案格式。 - - - - FreeBSD 系統播放影像的準備工具。 - - - - 播放 DVD.mpg.avi 檔。 - - - - 擷取(Rip) CDDVD的內容至檔案。 - - - - 設定電視卡。 - - - - 在 FreeBSD 安裝 MythTV - - - - 設定影像掃描機。 - - - - 設定藍芽耳機。 - - - - 在開始閱讀這章之前,您需要: - - - 知道如何安裝應用程式如 所敘述。 - - - - - - 設定音效卡 - - - - - Moses - Moore - - Contributed by - - - - - - - Marc - Fonvieille - - Enhanced by - - - - - PCI - sound cards - 開始設定之前,必須先知道你的音效卡型號、晶片為何。 FreeBSD 支援許多種音效卡,請檢查支援的音效硬體表 Hardware Notes,以確認你的音效卡是否支援以及如何在 FreeBSD 上驅動。 - - - kernel - configuration - - - 要使用音效裝置,必須要載入正確的驅動程式才行。最簡單方式就是以 kldload8 來載入核心模組。以下範例示範載入 Intel 規格內建的音效晶片驅動程式: - - # kldload snd_hda - - 要開機時自動載入驅動程式,需將驅動程式加到 /boot/loader.conf 檔,以此驅動程式為例: - - snd_hda_load="YES" - - 其他可用的音效卡模組清單列於 /boot/defaults/loader.conf。當不確認要使用何種驅動程式時,可載入 snd_driver 模組: - - # kldload snd_driver - - 它是 metadriver 會載入所有最通用的音效驅動程式並且用來加速尋找正確的驅動程式。也可以把 metadriver 加入 /boot/loader.conf 檔來載入所有音效驅動程式。 - - 要知道載入 snd_driver metadriver 後使用了那個音效卡驅動程式,請輸入 cat /dev/sndstat - - - 設定自訂核心支援音效 - - This section is for users who prefer to statically compile - in support for the sound card in a custom kernel. For more - information about recompiling a kernel, refer to . - - When using a custom kernel to provide sound support, make - sure that the audio framework driver exists in the custom - kernel configuration file: - - device sound - - Next, add support for the sound card. To continue the - example of the built-in audio chipset based on the Intel - specification from the previous section, use the following - line in the custom kernel configuration file: - - device snd_hda - - Be sure to read the manual page of the driver for the - device name to use for the driver. - - Non-PnP ISA sound cards may require the IRQ and I/O port - settings of the card to be added to - /boot/device.hints. During the boot - process, loader8 reads this file and passes the - settings to the kernel. For example, an old Creative - SoundBlaster 16 ISA non-PnP card will use the - snd_sbc4 driver in conjunction with - snd_sb16. For this card, the following - lines must be added to the kernel configuration file: - - device snd_sbc -device snd_sb16 - - If the card uses the 0x220 I/O port and - IRQ 5, these lines must also be added to - /boot/device.hints: - - hint.sbc.0.at="isa" -hint.sbc.0.port="0x220" -hint.sbc.0.irq="5" -hint.sbc.0.drq="1" -hint.sbc.0.flags="0x15" - - The syntax used in /boot/device.hints - is described in sound4 and the manual page for the - driver of the sound card. - - The settings shown above are the defaults. In some - cases, the IRQ or other settings may need to be changed to - match the card. Refer to snd_sbc4 for more information - about this card. - - - - 測試音效 - - After loading the required module or rebooting into the - custom kernel, the sound card should be detected. To confirm, - run dmesg | grep pcm. This example is - from a system with a built-in Conexant CX20590 chipset: - - pcm0: <NVIDIA (0x001c) (HDMI/DP 8ch)> at nid 5 on hdaa0 -pcm1: <NVIDIA (0x001c) (HDMI/DP 8ch)> at nid 6 on hdaa0 -pcm2: <Conexant CX20590 (Analog 2.0+HP/2.0)> at nid 31,25 and 35,27 on hdaa1 - - The status of the sound card may also be checked using - this command: - - # cat /dev/sndstat -FreeBSD Audio Driver (newpcm: 64bit 2009061500/amd64) -Installed devices: -pcm0: <NVIDIA (0x001c) (HDMI/DP 8ch)> (play) -pcm1: <NVIDIA (0x001c) (HDMI/DP 8ch)> (play) -pcm2: <Conexant CX20590 (Analog 2.0+HP/2.0)> (play/rec) default - - The output will vary depending upon the sound card. If no - pcm devices are listed, double-check - that the correct device driver was loaded or compiled into the - kernel. The next section lists some common problems and their - solutions. - - If all goes well, the sound card should now work in FreeBSD. - If the CD or DVD drive - is properly connected to the sound card, one can insert an - audio CD in the drive and play it with - cdcontrol1: - - % cdcontrol -f /dev/acd0 play 1 - - - Audio CDs have specialized encodings - which means that they should not be mounted using - mount8. - - - Various applications, such as - audio/workman, provide a friendlier - interface. The audio/mpg123 port can be - installed to listen to MP3 audio files. - - Another quick way to test the card is to send data to - /dev/dsp: - - % cat filename > /dev/dsp - - where - filename can - be any type of file. This command should produce some noise, - confirming that the sound card is working. - - - The /dev/dsp* device nodes will - be created automatically as needed. When not in use, they - do not exist and will not appear in the output of - ls1. - - - - - 設定藍芽音效裝置 - - 藍牙音訊 - - Connecting to a Bluetooth device is out of scope for this - chapter. Refer to for more information. - - To get Bluetooth sound sink working with FreeBSD's sound - system, users have to install - audio/virtual_oss first: - - # pkg install virtual_oss - - audio/virtual_oss requires - cuse to be loaded into the kernel: - - # kldload cuse - - To load cuse during system startup, run - this command: - - # sysrc -f /boot/loader.conf cuse_load=yes - - To use headphones as a sound sink with - audio/virtual_oss, users need to create a - virtual device after connecting to a Bluetooth audio - device: - - # virtual_oss -C 2 -c 2 -r 48000 -b 16 -s 768 -R /dev/null -P /dev/bluetooth/headphones -d dsp - - - headphones in this example is - a hostname from /etc/bluetooth/hosts. - BT_ADDR could be used instead. - - - 請參考 virtual_oss8 取得更多資訊。 - - - - 疑難排解音效 - - device nodes - I/O port - IRQ - DSP - - - lists some common error messages and their solutions: - - - 常見錯誤訊息 - - - - - 錯誤 - 解決方式 - - - - - - sb_dspwr(XX) timed - out - The I/O port is not set - correctly. - - - - bad irq XX - The IRQ is set incorrectly. Make sure - that the set IRQ and the sound IRQ are the - same. - - - - xxx: gus pcm not attached, out of - memory - There is not enough available memory to - use the device. - - - - xxx: can't open - /dev/dsp! - Type fstat | grep - dsp to check if another application is - holding the device open. Noteworthy troublemakers are - esound and - KDE's sound - support. - - - -
- - Modern graphics cards often come with their own sound - driver for use with HDMI. This sound - device is sometimes enumerated before the sound card meaning - that the sound card will not be used as the default playback - device. To check if this is the case, run - dmesg and look for - pcm. The output looks something like - this: - - ... -hdac0: HDA Driver Revision: 20100226_0142 -hdac1: HDA Driver Revision: 20100226_0142 -hdac0: HDA Codec #0: NVidia (Unknown) -hdac0: HDA Codec #1: NVidia (Unknown) -hdac0: HDA Codec #2: NVidia (Unknown) -hdac0: HDA Codec #3: NVidia (Unknown) -pcm0: <HDA NVidia (Unknown) PCM #0 DisplayPort> at cad 0 nid 1 on hdac0 -pcm1: <HDA NVidia (Unknown) PCM #0 DisplayPort> at cad 1 nid 1 on hdac0 -pcm2: <HDA NVidia (Unknown) PCM #0 DisplayPort> at cad 2 nid 1 on hdac0 -pcm3: <HDA NVidia (Unknown) PCM #0 DisplayPort> at cad 3 nid 1 on hdac0 -hdac1: HDA Codec #2: Realtek ALC889 -pcm4: <HDA Realtek ALC889 PCM #0 Analog> at cad 2 nid 1 on hdac1 -pcm5: <HDA Realtek ALC889 PCM #1 Analog> at cad 2 nid 1 on hdac1 -pcm6: <HDA Realtek ALC889 PCM #2 Digital> at cad 2 nid 1 on hdac1 -pcm7: <HDA Realtek ALC889 PCM #3 Digital> at cad 2 nid 1 on hdac1 -... - - In this example, the graphics card - (NVidia) has been enumerated before the - sound card (Realtek ALC889). To use the - sound card as the default playback device, change - hw.snd.default_unit to the unit that should - be used for playback: - - # sysctl hw.snd.default_unit=n - - where n is the number of the sound - device to use. In this example, it should be - 4. Make this change permanent by adding - the following line to - /etc/sysctl.conf: - - hw.snd.default_unit=4 -
- - - - 使用多個音效來源 - - - - - Munish - Chopra - - Contributed by - - - - - It is often desirable to have multiple sources of sound - that are able to play simultaneously. FreeBSD uses - Virtual Sound Channels to multiplex the sound - card's playback by mixing sound in the kernel. - - Three sysctl8 knobs are available for configuring - virtual channels: - - # sysctl dev.pcm.0.play.vchans=4 -# sysctl dev.pcm.0.rec.vchans=4 -# sysctl hw.snd.maxautovchans=4 - - This example allocates four virtual channels, which is a - practical number for everyday use. Both - dev.pcm.0.play.vchans=4 and - dev.pcm.0.rec.vchans=4 are configurable - after a device has been attached and represent the number of - virtual channels pcm0 has for playback - and recording. Since the pcm module can - be loaded independently of the hardware drivers, - hw.snd.maxautovchans indicates how many - virtual channels will be given to an audio device when it is - attached. Refer to pcm4 for more information. - - - The number of virtual channels for a device cannot be - changed while it is in use. First, close any programs using - the device, such as music players or sound daemons. - - - The correct pcm device will - automatically be allocated transparently to a program that - requests /dev/dsp0. - - - - - 設定混音器頻道的預設值 - - - - - Josef - El-Rayes - - Contributed by - - - - - The default values for the different mixer channels are - hardcoded in the source code of the pcm4 driver. While - sound card mixer levels can be changed using mixer8 or - third-party applications and daemons, this is not a permanent - solution. To instead set default mixer values at the driver - level, define the appropriate values in - /boot/device.hints, as seen in this - example: - - hint.pcm.0.vol="50" - - This will set the volume channel to a default value of - 50 when the pcm4 module is - loaded. - -
- - - - MP3 音樂 - - - - - Chern - Lee - - Contributed by - - - - - This section describes some MP3 - players available for FreeBSD, how to rip audio - CD tracks, and how to encode and decode - MP3s. - - - MP3 播放器 - - A popular graphical MP3 player is - Audacious. It supports - Winamp skins and additional - plugins. The interface is intuitive, with a playlist, graphic - equalizer, and more. Those familiar with - Winamp will find - Audacious simple to use. On FreeBSD, - Audacious can be installed from the - multimedia/audacious port or package. - Audacious is a descendant of XMMS. - - The audio/mpg123 package or port - provides an alternative, command-line MP3 - player. Once installed, specify the MP3 - file to play on the command line. If the system has multiple - audio devices, the sound device can also be specified: - - # mpg123 -a /dev/dsp1.0 Foobar-GreatestHits.mp3 -High Performance MPEG 1.0/2.0/2.5 Audio Player for Layers 1, 2 and 3 - version 1.18.1; written and copyright by Michael Hipp and others - free software (LGPL) without any warranty but with best wishes - -Playing MPEG stream from Foobar-GreatestHits.mp3 ... -MPEG 1.0 layer III, 128 kbit/s, 44100 Hz joint-stereo - - Additional MP3 players are available in - the FreeBSD Ports Collection. - - - - 擷取 <acronym>CD</acronym> 音軌 - - Before encoding a CD or - CD track to MP3, the - audio data on the CD must be ripped to the - hard drive. This is done by copying the raw - CD Digital Audio (CDDA) - data to WAV files. - - The cdda2wav tool, which is installed - with the sysutils/cdrtools suite, can be - used to rip audio information from - CDs. - - With the audio CD in the drive, the - following command can be issued as - root to rip an - entire CD into individual, per track, - WAV files: - - # cdda2wav -D 0,1,0 -B - - In this example, the - indicates - the SCSI device 0,1,0 - containing the CD to rip. Use - cdrecord -scanbus to determine the correct - device parameters for the system. - - To rip individual tracks, use to - specify the track: - - # cdda2wav -D 0,1,0 -t 7 - - To rip a range of tracks, such as track one to seven, - specify a range: - - # cdda2wav -D 0,1,0 -t 1+7 - - To rip from an ATAPI - (IDE) CDROM drive, - specify the device name in place of the - SCSI unit numbers. For example, to rip - track 7 from an IDE drive: - - # cdda2wav -D /dev/acd0 -t 7 - - Alternately, dd can be used to extract - audio tracks on ATAPI drives, as described - in . - - - - MP3 編碼與解碼 - - Lame is a popular - MP3 encoder which can be installed from the - audio/lame port. Due to patent issues, a - package is not available. - - The following command will convert the ripped - WAV file - audio01.wav to - audio01.mp3: - - # lame -h -b 128 --tt "Foo Song Title" --ta "FooBar Artist" --tl "FooBar Album" \ ---ty "2014" --tc "Ripped and encoded by Foo" --tg "Genre" audio01.wav audio01.mp3 - - The specified 128 kbits is a standard - MP3 bitrate while the 160 and 192 bitrates - provide higher quality. The higher the bitrate, the larger - the size of the resulting MP3. The - turns on the - higher quality but a little slower - mode. The options beginning with - indicate ID3 tags, which usually contain - song information, to be embedded within the - MP3 file. Additional encoding options can - be found in the lame manual - page. - - In order to burn an audio CD from - MP3s, they must first be converted to a - non-compressed file format. XMMS - can be used to convert to the WAV format, - while mpg123 can be used to convert - to the raw Pulse-Code Modulation (PCM) - audio data format. - - To convert audio01.mp3 using - mpg123, specify the name of the - PCM file: - - # mpg123 -s audio01.mp3 > audio01.pcm - - To use XMMS to convert a - MP3 to WAV format, use - these steps: - - - Converting to <acronym>WAV</acronym> Format in - <application>XMMS</application> - - - Launch XMMS. - - - - Right-click the window to bring up the - XMMS menu. - - - - Select Preferences under - Options. - - - - Change the Output Plugin to Disk Writer - Plugin. - - - - Press Configure. - - - - Enter or browse to a directory to write the - uncompressed files to. - - - - Load the MP3 file into - XMMS as usual, with volume at - 100% and EQ settings turned off. - - - - Press Play. The - XMMS will appear as if it is - playing the MP3, but no music will be - heard. It is actually playing the MP3 - to a file. - - - - When finished, be sure to set the default Output - Plugin back to what it was before in order to listen to - MP3s again. - - - - Both the WAV and PCM - formats can be used with cdrecord. - When using WAV files, there will be a small - tick sound at the beginning of each track. This sound is the - header of the WAV file. The - audio/sox port or package can be used to - remove the header: - - % sox -t wav -r 44100 -s -w -c 2 track.wav track.raw - - Refer to for more - information on using a CD burner in - FreeBSD. - - - - - - 影片播放 - - - - - Ross - Lippert - - Contributed by - - - - - Before configuring video playback, determine the model and - chipset of the video card. While - Xorg supports a wide variety of - video cards, not all provide good playback performance. To - obtain a list of extensions supported by the - Xorg server using the card, run - xdpyinfo while - Xorg is running. - - It is a good idea to have a short MPEG test file for - evaluating various players and options. Since some - DVD applications look for - DVD media in /dev/dvd by - default, or have this device name hardcoded in them, it might be - useful to make a symbolic link to the proper device: - - # ln -sf /dev/cd0 /dev/dvd - - Due to the nature of devfs5, manually created links - will not persist after a system reboot. In order to recreate - the symbolic link automatically when the system boots, add the - following line to /etc/devfs.conf: - - link cd0 dvd - - DVD decryption invokes certain functions - that require write permission to the DVD - device. - - To enhance the shared memory - Xorg interface, it is recommended - to increase the values of these sysctl8 - variables: - - kern.ipc.shmmax=67108864 -kern.ipc.shmall=32768 - - - 偵測影像處理能力 - - XVideo - SDL - DGA - - There are several possible ways to display video under - Xorg and what works is largely - hardware dependent. Each method described below will have - varying quality across different hardware. - - Common video interfaces include: - - - - Xorg: normal output using - shared memory. - - - - XVideo: an extension to the - Xorg interface which - allows video to be directly displayed in drawable objects - through a special acceleration. This extension provides - good quality playback even on low-end machines. The next - section describes how to determine if this extension is - running. - - - - SDL: the Simple Directmedia Layer - is a porting layer for many operating systems, allowing - cross-platform applications to be developed which make - efficient use of sound and graphics. - SDL provides a low-level abstraction to - the hardware which can sometimes be more efficient than - the Xorg interface. On FreeBSD, - SDL can be installed using the - devel/sdl20 package or port. - - - - DGA: the Direct Graphics Access is - an Xorg extension which - allows a program to bypass the - Xorg server and directly - alter the framebuffer. Because it relies on a low level - memory mapping, programs using it must be run as - root. The - DGA extension can be tested and - benchmarked using dga1. When - dga is running, it changes the colors - of the display whenever a key is pressed. To quit, press - q. - - - - SVGAlib: a low level console graphics layer. - - - - - XVideo - - To check whether this extension is running, use - xvinfo: - - % xvinfo - - XVideo is supported for the card if the result is - similar to: - - X-Video Extension version 2.2 - screen #0 - Adaptor #0: "Savage Streams Engine" - number of ports: 1 - port base: 43 - operations supported: PutImage - supported visuals: - depth 16, visualID 0x22 - depth 16, visualID 0x23 - number of attributes: 5 - "XV_COLORKEY" (range 0 to 16777215) - client settable attribute - client gettable attribute (current value is 2110) - "XV_BRIGHTNESS" (range -128 to 127) - client settable attribute - client gettable attribute (current value is 0) - "XV_CONTRAST" (range 0 to 255) - client settable attribute - client gettable attribute (current value is 128) - "XV_SATURATION" (range 0 to 255) - client settable attribute - client gettable attribute (current value is 128) - "XV_HUE" (range -180 to 180) - client settable attribute - client gettable attribute (current value is 0) - maximum XvImage size: 1024 x 1024 - Number of image formats: 7 - id: 0x32595559 (YUY2) - guid: 59555932-0000-0010-8000-00aa00389b71 - bits per pixel: 16 - number of planes: 1 - type: YUV (packed) - id: 0x32315659 (YV12) - guid: 59563132-0000-0010-8000-00aa00389b71 - bits per pixel: 12 - number of planes: 3 - type: YUV (planar) - id: 0x30323449 (I420) - guid: 49343230-0000-0010-8000-00aa00389b71 - bits per pixel: 12 - number of planes: 3 - type: YUV (planar) - id: 0x36315652 (RV16) - guid: 52563135-0000-0000-0000-000000000000 - bits per pixel: 16 - number of planes: 1 - type: RGB (packed) - depth: 0 - red, green, blue masks: 0x1f, 0x3e0, 0x7c00 - id: 0x35315652 (RV15) - guid: 52563136-0000-0000-0000-000000000000 - bits per pixel: 16 - number of planes: 1 - type: RGB (packed) - depth: 0 - red, green, blue masks: 0x1f, 0x7e0, 0xf800 - id: 0x31313259 (Y211) - guid: 59323131-0000-0010-8000-00aa00389b71 - bits per pixel: 6 - number of planes: 3 - type: YUV (packed) - id: 0x0 - guid: 00000000-0000-0000-0000-000000000000 - bits per pixel: 0 - number of planes: 0 - type: RGB (packed) - depth: 1 - red, green, blue masks: 0x0, 0x0, 0x0 - - The formats listed, such as YUV2 and YUV12, are not - present with every implementation of XVideo and their - absence may hinder some players. - - If the result instead looks like: - - X-Video Extension version 2.2 -screen #0 -no adaptors present - - XVideo is probably not supported for the card. This - means that it will be more difficult for the display to meet - the computational demands of rendering video, depending on - the video card and processor. - - - - - 可處理影像的 Port 與套件 - - video ports - video packages - - This section introduces some of the software available - from the FreeBSD Ports Collection which can be used for video - playback. - - - <application>MPlayer</application> 與 <application>MEncoder</application> - - MPlayer is a command-line - video player with an optional graphical interface which aims - to provide speed and flexibility. Other graphical - front-ends to MPlayer are - available from the FreeBSD Ports Collection. - - MPlayer - - MPlayer can be installed - using the multimedia/mplayer package or - port. Several compile options are available and a variety - of hardware checks occur during the build process. For - these reasons, some users prefer to build the port rather - than install the package. - - When compiling the port, the menu options should be - reviewed to determine the type of support to compile into - the port. If an option is not selected, - MPlayer will not be able to - display that type of video format. Use the arrow keys and - spacebar to select the required formats. When finished, - press Enter to continue the port compile - and installation. - - By default, the package or port will build the - mplayer command line utility and the - gmplayer graphical utility. To encode - videos, compile the multimedia/mencoder - port. Due to licensing restrictions, a package is not - available for MEncoder. - - The first time MPlayer is - run, it will create ~/.mplayer in the - user's home directory. This subdirectory contains default - versions of the user-specific configuration files. - - This section describes only a few common uses. Refer to - mplayer(1) for a complete description of its numerous - options. - - To play the file - testfile.avi, - specify the video interfaces with , as - seen in the following examples: - - % mplayer -vo xv testfile.avi - - % mplayer -vo sdl testfile.avi - - % mplayer -vo x11 testfile.avi - - # mplayer -vo dga testfile.avi - - # mplayer -vo 'sdl:dga' testfile.avi - - It is worth trying all of these options, as their - relative performance depends on many factors and will vary - significantly with hardware. - - To play a DVD, replace - testfile.avi - with , where - N is the title number to play and - DEVICE is the device node for the - DVD. For example, to play title 3 from - /dev/dvd: - - # mplayer -vo xv dvd://3 -dvd-device /dev/dvd - - - The default DVD device can be - defined during the build of the - MPlayer port by including the - WITH_DVD_DEVICE=/path/to/desired/device - option. By default, the device is - /dev/cd0. More details can be found - in the port's - Makefile.options. - - - To stop, pause, advance, and so on, use a keybinding. - To see the list of keybindings, run mplayer - -h or read mplayer(1). - - Additional playback options include , which engages fullscreen mode, and - , which helps performance. - - Each user can add commonly used options to their - ~/.mplayer/config like so: - - vo=xv -fs=yes -zoom=yes - - mplayer can be used to rip a - DVD title to a .vob. - To dump the second title from a - DVD: - - # mplayer -dumpstream -dumpfile out.vob dvd://2 -dvd-device /dev/dvd - - The output file, out.vob, will be - in MPEG format. - - Anyone wishing to obtain a high level of expertise with - UNIX video should consult mplayerhq.hu/DOCS - as it is technically informative. This documentation should - be considered as required reading before submitting any bug - reports. - - - mencoder - - - Before using mencoder, it is a good - idea to become familiar with the options described at mplayerhq.hu/DOCS/HTML/en/mencoder.html. - There are innumerable ways to improve quality, lower - bitrate, and change formats, and some of these options may - make the difference between good or bad performance. - Improper combinations of command line options can yield - output files that are unplayable even by - mplayer. - - Here is an example of a simple copy: - - % mencoder input.avi -oac copy -ovc copy -o output.avi - - To rip to a file, use with - mplayer. - - To convert - input.avi to - the MPEG4 codec with MPEG3 audio encoding, first install the - audio/lame port. Due to licensing - restrictions, a package is not available. Once installed, - type: - - % mencoder input.avi -oac mp3lame -lameopts br=192 \ - -ovc lavc -lavcopts vcodec=mpeg4:vhq -o output.avi - - This will produce output playable by applications such - as mplayer and - xine. - - input.avi - can be replaced with and run as root to re-encode a - DVD title directly. Since it may take a - few tries to get the desired result, it is recommended to - instead dump the title to a file and to work on the - file. - - - - <application>xine</application> 影像播放器 - - xine is a video player with a - reusable base library and a modular executable which can be - extended with plugins. It can be installed using the - multimedia/xine package or port. - - In practice, xine requires - either a fast CPU with a fast video card, or support for the - XVideo extension. The xine video - player performs best on XVideo interfaces. - - By default, the xine player - starts a graphical user interface. The menus can then be - used to open a specific file. - - Alternatively, xine may be - invoked from the command line by specifying the name of the - file to play: - - % xine -g -p mymovie.avi - - Refer to - xine-project.org/faq for more information and - troubleshooting tips. - - - - <application>Transcode</application> 工具 - - Transcode provides a suite of - tools for re-encoding video and audio files. - Transcode can be used to merge - video files or repair broken files using command line tools - with stdin/stdout stream interfaces. - - In FreeBSD, Transcode can be - installed using the multimedia/transcode - package or port. Many users prefer to compile the port as - it provides a menu of compile options for specifying the - support and codecs to compile in. If an option is not - selected, Transcode will not be - able to encode that format. Use the arrow keys and spacebar - to select the required formats. When finished, press - Enter to continue the port compile and - installation. - - This example demonstrates how to convert a DivX file - into a PAL MPEG-1 file (PAL VCD): - - % transcode -i input.avi -V --export_prof vcd-pal -o output_vcd -% mplex -f 1 -o output_vcd.mpg output_vcd.m1v output_vcd.mpa - - The resulting MPEG file, - output_vcd.mpg, - is ready to be played with - MPlayer. The file can be burned - on a CD media to create a video - CD using a utility such as - multimedia/vcdimager or - sysutils/cdrdao. - - In addition to the manual page for - transcode, refer to transcoding.org/cgi-bin/transcode - for further information and examples. - - - - - - - 電視卡 - - - - - Josef - El-Rayes - - Original contribution by - - - - - - - Marc - Fonvieille - - Enhanced and adapted by - - - - - - TV cards - - - 電視卡 (TV card) 可以讓您用電腦來看無線、有線電視節目。許多卡都是透過 RCA 或 S-video 輸入端子來接收視訊,而且有些卡還可接收 FM 廣播的功能。 - - FreeBSD 可透過 bktr4 驅動程式,來支援 PCI 介面的電視卡,只要這些卡使用的是 Brooktree Bt848/849/878/879 或 Conexant CN-878/Fusion 878a 視訊擷取晶片。此外,要再確認哪些卡上所附的選台功能是否有支援,可以參考 bktr4 說明,以查看所支援的硬體清單。 - - - 載入驅動程式 - - 要用電視卡的話,就要載入 bktr4 驅動程式,這個可以透過在 /boot/loader.conf 檔加上下面這一行就可以了: - - bktr_load="YES" - - 或者可以將電視卡支援靜態編譯到自訂的核心當中,若要這麼做則可在自訂核心設定檔加入以下行: - - device bktr -device iicbus -device iicbb -device smbus - - 之所以要加上這些額外的驅動程式,是因為卡的各組成部分都是透過 I2C 匯流排而相互連接的。接下來,請編譯、安裝新的核心 。 - - 要測試調諧器 (Tuner) 是否被正確的偵測,請先重新啟動系統。電視卡應該會出現在開機訊息檔中,如同此範例: - - bktr0: <BrookTree 848A> mem 0xd7000000-0xd7000fff irq 10 at device 10.0 on pci0 -iicbb0: <I2C bit-banging driver> on bti2c0 -iicbus0: <Philips I2C bus> on iicbb0 master-only -iicbus1: <Philips I2C bus> on iicbb0 master-only -smbus0: <System Management Bus> on bti2c0 -bktr0: Pinnacle/Miro TV, Philips SECAM tuner. - - 該訊息會依硬體不同而有所不同。若必要,可以使用 sysctl8 系統偵測的參數或者自訂核心設定選項。例如要強制使用 Philips SECAM 調諧器則可加入下列行至自訂核心設定檔: - - options OVERRIDE_TUNER=6 - - 或使用 sysctl8 - - # sysctl hw.bt848.tuner=6 - - 請參考 bktr4 查看 sysctl8 可用的參數說明及核心選項。 - - - - 好用的應用程式 - - To use the TV card, install one of the following - applications: - - - - multimedia/fxtv - provides TV-in-a-window and image/audio/video capture - capabilities. - - - multimedia/xawtv - is another TV application with similar features. - - - audio/xmradio - provides an application for using the FM radio tuner of a - TV card. - - - - More applications are available in the FreeBSD Ports - Collection. - - - - 疑難排解 - - If any problems are encountered with the TV card, check - that the video capture chip and the tuner are supported by - bktr4 and that the right configuration options were - used. For more support or to ask questions about supported TV - cards, refer to the freebsd-multimedia mailing list. - - - - - MythTV - - MythTV is a popular, open source Personal Video Recorder - (PVR) application. This section demonstrates - how to install and setup MythTV on FreeBSD. Refer to mythtv.org/wiki - for more information on how to use MythTV. - - MythTV requires a frontend and a backend. These components - can either be installed on the same system or on different - machines. - - The frontend can be installed on FreeBSD using the - multimedia/mythtv-frontend package or port. - Xorg must also be installed and - configured as described in . Ideally, this - system has a video card that supports X-Video Motion - Compensation (XvMC) and, optionally, a Linux - Infrared Remote Control (LIRC)-compatible - remote. - - To install both the backend and the frontend on FreeBSD, use - the multimedia/mythtv package or port. A - MySQL database server is also required and should - automatically be installed as a dependency. Optionally, this - system should have a tuner card and sufficient storage to hold - recorded data. - - - 硬體 - - MythTV uses Video for Linux (V4L) to - access video input devices such as encoders and tuners. In - FreeBSD, MythTV works best with USB DVB-S/C/T - cards as they are well supported by the - multimedia/webcamd package or port which - provides a V4L userland application. Any - Digital Video Broadcasting (DVB) card - supported by webcamd should work - with MythTV. A list of known working cards can be found at - wiki.freebsd.org/WebcamCompat. - Drivers are also available for Hauppauge cards in the - multimedia/pvr250 and - multimedia/pvrxxx ports, but they provide a - non-standard driver interface that does not work with versions - of MythTV greater than 0.23. Due to licensing restrictions, - no packages are available and these two ports must be - compiled. - - The wiki.freebsd.org/HTPC - page contains a list of all available DVB - drivers. - - - - 設定 MythTV 後端 - - 要使用 Binary 套件安裝 MythTV 可: - - # pkg install mythtv - - 或從 Port 套件集安裝: - - # cd /usr/ports/multimedia/mythtv -# make install - - Once installed, set up the MythTV database: - - # mysql -uroot -p < /usr/local/share/mythtv/database/mc.sql - - Then, configure the backend: - - # mythtv-setup - - Finally, start the backend: - - # sysrc mythbackend_enable=yes -# service mythbackend start - - - - - - 影像掃描器 - - - - - Marc - Fonvieille - - Written by - - - - - - image scanners - - - In FreeBSD, access to image scanners is provided by - SANE (Scanner Access Now Easy), which - is available in the FreeBSD Ports Collection. - SANE will also use some FreeBSD device - drivers to provide access to the scanner hardware. - - FreeBSD supports both SCSI and - USB scanners. Depending upon the scanner - interface, different device drivers are required. Be sure the - scanner is supported by SANE prior - to performing any configuration. Refer to - http://www.sane-project.org/sane-supported-devices.html - for more information about supported scanners. - - This chapter describes how to determine if the scanner has - been detected by FreeBSD. It then provides an overview of how to - configure and use SANE on a FreeBSD - system. - - - 檢查掃描器 - - The GENERIC kernel includes the - device drivers needed to support USB - scanners. Users with a custom kernel should ensure that the - following lines are present in the custom kernel configuration - file: - - device usb -device uhci -device ohci -device ehci - - To determine if the USB scanner is - detected, plug it in and use dmesg to - determine whether the scanner appears in the system message - buffer. If it does, it should display a message similar to - this: - - ugen0.2: <EPSON> at usbus0 - - In this example, an EPSON - Perfection 1650 - USB scanner was detected on - /dev/ugen0.2. - - If the scanner uses a SCSI interface, - it is important to know which SCSI - controller board it will use. Depending upon the - SCSI chipset, a custom kernel configuration - file may be needed. The GENERIC kernel - supports the most common SCSI controllers. - Refer to /usr/src/sys/conf/NOTES to - determine the correct line to add to a custom kernel - configuration file. In addition to the - SCSI adapter driver, the following lines - are needed in a custom kernel configuration file: - - device scbus -device pass - - Verify that the device is displayed in the system message - buffer: - - pass2 at aic0 bus 0 target 2 lun 0 -pass2: <AGFA SNAPSCAN 600 1.10> Fixed Scanner SCSI-2 device -pass2: 3.300MB/s transfers - - If the scanner was not powered-on at system boot, it is - still possible to manually force detection by performing a - SCSI bus scan with - camcontrol: - - # camcontrol rescan all -Re-scan of bus 0 was successful -Re-scan of bus 1 was successful -Re-scan of bus 2 was successful -Re-scan of bus 3 was successful - - The scanner should now appear in the - SCSI devices list: - - # camcontrol devlist -<IBM DDRS-34560 S97B> at scbus0 target 5 lun 0 (pass0,da0) -<IBM DDRS-34560 S97B> at scbus0 target 6 lun 0 (pass1,da1) -<AGFA SNAPSCAN 600 1.10> at scbus1 target 2 lun 0 (pass3) -<PHILIPS CDD3610 CD-R/RW 1.00> at scbus2 target 0 lun 0 (pass2,cd0) - - Refer to scsi4 and camcontrol8 for more - details about SCSI devices on FreeBSD. - - - - <application>SANE</application> 設定 - - The SANE system is split in two - parts: the backends - (graphics/sane-backends) and the frontends - (graphics/sane-frontends or - graphics/xsane). The backends provide - access to the scanner. Refer to http://www.sane-project.org/sane-supported-devices.html - to determine which backend supports the scanner. The - frontends provide the graphical scanning interface. - graphics/sane-frontends installs - xscanimage while - graphics/xsane installs - xsane. - - 要由 Binary 套件安裝這兩個部份可: - - # pkg install xsane sane-frontends - - 或由 Port 套件集安裝 - - # cd /usr/ports/graphics/sane-frontends -# make install clean -# cd /usr/ports/graphics/xsane -# make install clean - - After installing the - graphics/sane-backends port or package, use - sane-find-scanner to check the scanner - detection by the SANE - system: - - # sane-find-scanner -q -found SCSI scanner "AGFA SNAPSCAN 600 1.10" at /dev/pass3 - - The output should show the interface type of the scanner - and the device node used to attach the scanner to the system. - The vendor and the product model may or may not appear. - - - Some USB scanners require firmware to - be loaded. Refer to sane-find-scanner(1) and sane(7) for - details. - - - Next, check if the scanner will be identified by a - scanning frontend. The SANE - backends include scanimage which can be - used to list the devices and perform an image acquisition. - Use to list the scanner devices. The - first example is for a SCSI scanner and the - second is for a USB scanner: - - # scanimage -L -device `snapscan:/dev/pass3' is a AGFA SNAPSCAN 600 flatbed scanner -# scanimage -L -device 'epson2:libusb:/dev/usb:/dev/ugen0.2' is a Epson GT-8200 flatbed scanner - - In this second example, - 'epson2:libusb:/dev/usb:/dev/ugen0.2' is - the backend name (epson2) and - /dev/ugen0.2 is the device node used by the - scanner. - - If scanimage is unable to identify the - scanner, this message will appear: - - # scanimage -L - -No scanners were identified. If you were expecting something different, -check that the scanner is plugged in, turned on and detected by the -sane-find-scanner tool (if appropriate). Please read the documentation -which came with this software (README, FAQ, manpages). - - If this happens, edit the backend configuration file in - /usr/local/etc/sane.d/ and define the - scanner device used. For example, if the undetected scanner - model is an EPSON - Perfection 1650 and it uses the - epson2 backend, edit - /usr/local/etc/sane.d/epson2.conf. When - editing, add a line specifying the interface and the device - node used. In this case, add the following line: - - usb /dev/ugen0.2 - - Save the edits and verify that the scanner is identified - with the right backend name and the device node: - - # scanimage -L -device 'epson2:libusb:/dev/usb:/dev/ugen0.2' is a Epson GT-8200 flatbed scanner - - Once scanimage -L sees the scanner, the - configuration is complete and the scanner is now ready to - use. - - While scanimage can be used to perform - an image acquisition from the command line, it is often - preferable to use a graphical interface to perform image - scanning. The graphics/sane-frontends - package or port installs a simple but efficient graphical - interface, xscanimage. - - Alternately, xsane, which is - installed with the graphics/xsane package - or port, is another popular graphical scanning frontend. It - offers advanced features such as various scanning modes, color - correction, and batch scans. Both of these applications are - usable as a GIMP plugin. - - - - 掃描器權限 - - In order to have access to the scanner, a user needs read - and write permissions to the device node used by the scanner. - In the previous example, the USB scanner - uses the device node /dev/ugen0.2 which - is really a symlink to the real device node - /dev/usb/0.2.0. The symlink and the - device node are owned, respectively, by the wheel and operator groups. While - adding the user to these groups will allow access to the - scanner, it is considered insecure to add a user to - wheel. A better - solution is to create a group and make the scanner device - accessible to members of this group. - - This example creates a group called usb: - - # pw groupadd usb - - Then, make the /dev/ugen0.2 symlink - and the /dev/usb/0.2.0 device node - accessible to the usb group with write - permissions of 0660 or - 0664 by adding the following lines to - /etc/devfs.rules: - - [system=5] -add path ugen0.2 mode 0660 group usb -add path usb/0.2.0 mode 0666 group usb - - Finally, add the users to usb - in order to allow access to the scanner: - - # pw groupmod usb -m joe - - For more details refer to pw8. - - -
- - - - - - - 設定 FreeBSD 核心 - - - 概述 - - - kernel - building a custom kernel - - - 核心 (Kernel) 是 FreeBSD 作業系統最重要的部份之一。它負責記憶體管理、安全控管、網路、硬碟存取等等。 儘管目前 FreeBSD 大多可以用動態設定, 但有時仍需要設定並編譯自訂的核心。 - - 讀完這章,您將了解: - - - - 何時需要編譯自訂核心。 - - - - 如何取得硬體資訊。 - - - - 如何量身訂做核心設定檔。 - - - - 如何使用核心設定檔來建立並編譯新的核心。 - - - - 如何安裝新的核心。 - - - - 發生錯誤時如何排除問題。 - - - - 所有在本章所列出的指令均應以 root 來執行。 - - - - 為何要編譯自訂的核心? - - 早期的 FreeBSD 的核心 (Kernel) 被戲稱為 “巨石”。因為當時的核心是一個非常大的程式,且只支援固定的硬體裝置,如果您想改變核心的設定,就必須編譯一個新核心並重新開機,才能使用。 - - 現今,大多數在 FreeBSD 核心的功能已採用模組 (Module) 的方式包裝,並可依需求動態從核心載入或卸載。 這使得執行中的核心能夠快速適應新硬體環境並在核心開啟新的功能,這就是所謂模組化核心 (Modular Kernel)。 - - 儘管如此,還是有一些功能因使用到靜態的核心設定須要編譯,因為這些功能與核心緊密結合,無法將做成可動態載入的模組。且部份強調安全性的環境會盡量避免載入與卸載核心模組,且只要將需要的功能靜態的編譯到核心當中。 - - 編譯自訂的核心幾乎是每位進階的 BSD 使用者所必須經歷的過程。儘管這項工作可能比較耗時,但在 FreeBSD 的使用上會有許多好處。 跟必須支援大多數各式硬體的 GENERIC 核心相比的話, 自訂的核心可以更『體貼』,只支援『自己硬體』的部分就好。 自訂核心有許多項優點,如: - - - - 加速開機,因為自訂的核心只需要偵測您系統上存在的硬體,所以讓啟動所花的過程更流暢快速。 - - - - 減少記憶體使用,自訂的核心通常會比 GENERIC 核心使用更少的記憶體,這很重要,因為核心必須一直存放在實體記憶體內,會讓其他應用程式無法使用。因此,自訂核心對於記憶體較小的系統來說,發揮很大的作用。 - - - - 支援額外的硬體,自訂的核心可以增加一些 GENERIC 核心沒有提供的硬體支援。 - - - - 在編譯自訂核心之前,請思考要這麼做的原因,若是因為需要特定硬體的支援,很可能已有既有的模組可以使用。 - - 核心模組會放在 /boot/kernel 並且可使用 kldload8 動態載入到執行中的核心。大部份的核心驅動程式都有可載入的模組與操作手冊。例如 ath4 無線乙太網路驅動程式在其操作手冊有以下資訊: - - Alternatively, to load the driver as a module at boot time, place the -following line in loader.conf5: - - if_ath_load="YES" - - 加入 if_ath_load="YES"/boot/loader.conf 會於開機期間自動載入這個模組。 - - 部份情況在 /boot/kernel 會沒有相關的模組,這對於某些子系統大多是真的。 - - - - - 偵測系統硬體 - - 在編輯核心設定檔之前,建議先調查清楚機器各項硬體資訊。在雙作業系統的環境,也可透過其他作業系統來了解目前機器上的硬體資訊。 舉例來說,Microsoft裝置管理員 (Device Manager) 內會有目前已安裝的硬體資訊。 - - - 某些版本的 Microsoft Windows 會有系統 (System) 圖示可用來進入 裝置管理員 - - - 若 FreeBSD 是唯一安裝的作業系統,則可使用 dmesg8 來查看開時時系統偵測到的硬體資訊 。FreeBSD 上大多硬體驅動程式都有操作手冊會列出支援的硬體。例如,以下幾行是說 psm4 驅動程式偵測到了一隻滑鼠: - - psm0: <PS/2 Mouse> irq 12 on atkbdc0 -psm0: [GIANT-LOCKED] -psm0: [ITHREAD] -psm0: model Generic PS/2 mouse, device ID 0 - - 因為該硬體存在,此驅動程式便不應該從自訂核心設定檔中移除。 - - dmesg 輸出的結果未顯示開機偵測硬體的部份,則可改閱讀 /var/run/dmesg.boot 檔案的內容。 - - 另外,也可以透過 pciconf8 工具可用來查詢硬體資訊,該工具會列出更詳細的硬體資訊如: - - % pciconf -lv -ath0@pci0:3:0:0: class=0x020000 card=0x058a1014 chip=0x1014168c rev=0x01 hdr=0x00 - vendor = 'Atheros Communications Inc.' - device = 'AR5212 Atheros AR5212 802.11abg wireless' - class = network - subclass = ethernet - - 以上輸出資訊說明 ath 驅動程式已經找到一個無線乙太網路裝置。 - - man1 指令加上 旗標可提供有用的資訊,例如,這可列出有包含指定裝置品牌或名稱的手冊頁面清單: - - # man -k Atheros -ath(4) - Atheros IEEE 802.11 wireless network driver -ath_hal(4) - Atheros Hardware Access Layer (HAL) - - 準備好硬體清單之後,參考該清單來確認已安裝的硬體驅動程式在編輯自訂核心設定時沒有被移除。 - - - - - 設定檔 - - 為了要建立自訂核心設定檔並編譯自訂核心,必須先安裝完整的 FreeBSD 原始碼樹。 - - /usr/src/ 目錄不存在或者是空的,代表尚未安裝。原始碼可以使用 Subversion 並依據 中的操作說明來安裝。 - - 完成原始碼安裝完成後,需檢查 /usr/src/sys 內的檔案。該目錄內包含數個子目錄,這些子目錄代表著支援的硬體架構 (Architecture) 如下:amd64, i386, ia64, powerpc 以及 sparc64。在指定架構目錄中的內容只對該架構有效,其餘部份的程式碼與硬體架構無關,可通用所有平台。每個支援的硬體架構中會有 conf 子目錄,裡面含有供該架構使用的 GENERIC 核心設定檔。 - - 請不要直接對 GENERIC 檔案做編輯。複製該檔案為另一個名稱,並對複製出來的檔案做編輯,習慣上檔名會全部使用大寫字元。當維護多台安裝不同的硬體的 FreeBSD 機器時,將檔名後方加上機器的主機名稱 (Host name) 是個不錯的方法。以下範例使用 amd64 架構的 GENERIC 設定檔建立了一個複本名稱為 MYKERNEL - - # cd /usr/src/sys/amd64/conf -# cp GENERIC MYKERNEL - - 現在可以使用任何 ASCII 文字編輯器來自訂 MYKERNEL。預設的編輯器為 vi,在 FreeBSD 也內建一個易於初學者使用的編輯器叫做 ee - - - kernel - NOTES - - NOTES - - kernel - configuration file - - - 核心設定檔的格式很簡單,每一行會含有代表裝置 (Device) 或子系統 (Subsystem) 的關鍵字、參數以及簡短的說明。任何在 # 符號之後的文字會被當做註解並且略過。要移除核心對某個裝置或子系統的支援,僅需要在代表該裝置或子系統的行前加上 # 符號。請不要在您還不了解用途的行前加上或移除 # 符號。 - - - 移除對裝置或選項的支援很容易會造成核心損壞。例如,若從核心設定檔 ata4 驅動程式,那麼使用 ATA 磁碟驅動程式的系統便會無法開機。因此當您不確定時,請在核心保留該項目的支援。 - - - 除了在設定檔中提供的簡短說明之外,尚有其他的說明在 NOTES 檔案中,可在與該架構 GENERIC 相同的目錄底下找到。要查看所有架構通用的選項,請參考 /usr/src/sys/conf/NOTES - - - 當完成自訂的核心設定檔,請備份到 /usr/src 位置之外。 - - 或者,將核心設定檔放在其他地方,然後建立一個符號連結 (Symbolic link) 至該檔案: - - # cd /usr/src/sys/amd64/conf -# mkdir /root/kernels -# cp GENERIC /root/kernels/MYKERNEL -# ln -s /root/kernels/MYKERNEL - - - 設定檔中可以使用 include 指令 (Directive)。該指令可以引用其他設定檔到目前的設定檔,這讓只需根據現有檔案設定做些微調整時更簡單。若只有少量的額外選項或驅動程式需要設定,該指令可引用 GENERIC 並設定額外增加的選項,如範例所示: - - include GENERIC -ident MYKERNEL - -options IPFIREWALL -options DUMMYNET -options IPFIREWALL_DEFAULT_TO_ACCEPT -options IPDIVERT - - 使用此方法,設定檔只含有與 GENERIC 核心不同的部份。當升級有新功能加入 GENERIC 時,也可一併引用,除非特別使用 nooptionsnodevice 選項來排除設定。更詳細的設定檔指令及其說明可在 config5 找到。 - - - 要產生含有所有可用選項的設定檔,可以 root 執行以下指令: - - # cd /usr/src/sys/arch/conf && make LINT - - - - - - - - - 編譯與安裝自訂核心 - - 完成自訂設定檔的編輯並儲存之後,便可依據以下步驟編譯核心的原始碼: - - - 編譯核心 - - - kernel - building / installing - - - - 切換至此目錄: - - # cd /usr/src - - - - 指定自訂核心設定檔的名稱來編譯新的核心: - - # make buildkernel KERNCONF=MYKERNEL - - - - 安裝使用指定核心設定檔所編譯的新核心。此指令將會複製新核心到 /boot/kernel/kernel 並將舊核心備份到 /boot/kernel.old/kernel - - # make installkernel KERNCONF=MYKERNEL - - - - 關機並重新開機載入新的核心,若發生錯誤請參考 - - - - 預設在自訂核心編譯完成後,所有核心模組也同被重新編譯。要快速更新核心或只編譯自訂的模組,需在開始編譯之前先編輯 /etc/make.conf - - 例如,使用以下變數可指定要編譯的模組清單來替代預設編譯所有模組的設定: - - MODULES_OVERRIDE = linux acpi - - 或者,可使用以下變數來從編譯程序中排除要編譯的模組: - - WITHOUT_MODULES = linux acpi sound - - 尚有其他可用的變數,請參考 make.conf5 取得詳細資訊。 - - - /boot/kernel.old - - - - - 如果發生錯誤 - - 當編譯自訂核心時可能發生以下四種類型的問題: - - - - config 失敗 - - - config 失敗,會列出不正確的行號。使用以下訊息為例子,需要與 GENERICNOTES 比對來確認第 17 行輸入的內容正確: - - config: line 17: syntax error - - - - - make 失敗 - - - make 失敗,通常是因為核心設定檔未提供足夠的資訊讓 config 找到問題。請仔細檢查設定檔,若仍不清楚問題,請寄發電子郵件給 FreeBSD general questions mailing list 並附上核心設定檔。 - - - - - 無法使用核心開機 - - - 若新核心無法開機或無法辨識裝置並不要恐慌!幸好,FreeBSD 有良好的機制可以從不相容的核心復原。只需要在 FreeBSD 開機載入程式 (Boot loader) 選擇要用來開機的核心便可,當系統開機選單出現時選擇 Escape to a loader prompt 選項,並在指令提示後輸入 boot kernel.old 或替換為任何其他已經知道可以正常開機的核心名稱。 - - 使用好的核心開機之後,檢查設定檔並嘗試再編譯一次。/var/log/messages 是有用的資源,它在每次成功開機時會記錄核心訊息。同樣的,dmesg8 也會印出自本次開機後的核心訊息。 - - - 在排除核心問題時,請確定留有 GENERIC 的複本,或者其他已知可以運作的核心,並使用不同的名稱來確保下次編譯時不會被刪除,這很重要,因此每當新的核心被安裝之後,kernel.old 都會被最後安裝的核心覆寫,有可能會無法開機。盡快,透過重新命名將可運作的核心目錄移動到目前運作的核心目錄: - - # mv /boot/kernel /boot/kernel.bad -# mv /boot/kernel.good /boot/kernel - - - - - - 核心可運作,但 ps1 無法運作 - - - 若核心版本與系統工具所編譯的版本不同,例如,有一個核心使用 -CURRENT 的原始碼編譯並安裝在 -RELEASE 的系統上,許多系統狀態指令如 ps1vmstat8 將會無法運作。要修正此問題,請使用與核心相同版本的原始碼樹 (Source tree) 重新編譯並安裝 World。使用與作業系統其他部份版本不同的核心永遠不會是個好主意。 - - - - - - - - - - - - 列印 - - - - - Warren - Block - Originally contributed by - - - - - 儘管很多人試圖淘汰列印功能,但列印資訊到紙上仍是一個重要的功能。列印由兩個基本元件組成,包含了資料傳送到印表機的方式以及印表機可以理解的資料形式。 - - - 快速開始 - - 基本的列印功能可以快速設定完成,列印機必須能夠列印純 ASCII 文字。若要列印其他類型的檔案,請參考 - - - - 建立一個目錄來儲存要被列印的檔案: - - # mkdir -p /var/spool/lpd/lp -# chown daemon:daemon /var/spool/lpd/lp -# chmod 770 /var/spool/lpd/lp - - - - root 建立 /etc/printcap 內容如下: - - lp:\ - :lp=/dev/unlpt0:\ - :sh:\ - :mx#0:\ - :sd=/var/spool/lpd/lp:\ - :lf=/var/log/lpd-errs: - - - - 此行是針對連接到 USB 埠的印表機。 - - 連接到並列或 印表器 (Printer) 埠的印表機要使用: - - :lp=/dev/lpt0:\ - - 直接連接到網路的印表機要使用: - - :lp=:rm=network-printer-name:rp=raw:\ - - 替換 network-printer-name 為網路印表機的 DNS 主機名稱。 - - - - - - 編輯 /etc/rc.conf 加入下行來開啟 lpd - - lpd_enable="YES" - - 啟動服務: - - # service lpd start -Starting lpd. - - - - 測試列印: - - # printf "1. This printer can print.\n2. This is the second line.\n" | lpr - - - 若列印的兩行未從左邊界開始,而是呈現 階梯狀 (Stairstep),請參考 - - - 現在可以使用 lpr 來列印文字檔,只要在指令列給序檔案名稱,或者將輸出使用管線符號 (Pipe) 傳送給 lpr - - % lpr textfile.txt -% ls -lh | lpr - - - - - - 印表機連線 - - 印表機有許多方式可以連接到電腦,小型的桌面印表機會直接連接到電腦的 USB 埠,舊式的印表機會連接到並列 (Parallel) 或 印表機 (Printer) 埠,而有一部份印表機則是直接連接網路,讓印表機能夠給多台電腦共享使用,還有少部分印表機則是連接到較罕見的序列 (Serial) 埠。 - - FreeBSD 可以與這些類型的印表機溝通。 - - - - USB - - - USB 印表機可以連接到電腦上任何可用的 USB 埠。 - - 當 FreeBSD 偵測到 USB 印表機,會建立兩個裝置項目:/dev/ulpt0 以及 /dev/unlpt0,傳送到兩者任一裝置的資料都會被轉發到印表機。在每個列印工作完成後 ulpt0 便會重設 USB 埠,重設 USB 埠可能會在部份印表機造成問題,因此通常可以改使用 unlpt0 裝置。unlpt0 不會重設 USB 埠。 - - - - - 並列 (IEEE-1284) - - - 並列埠裝置使用 /dev/lpt0,此裝置不論印表機是否連接上都會存在,它並不會自動偵測。 - - 供應商已不再採用這種 舊式 連接埠,且有許多電腦甚至已沒有這種連接埠。可以用轉接器來連接並列印表機到 USB 埠,有了轉接器,並列印表機可以被當作 USB 印表機使用。有另一種稱作 列印伺服器 (Print server) 的裝置也可用來連接並列印表機到網路。 - - - - - 序列 (RS-232) - - - 序列埠也是另一種舊式連接埠,已很少用在印表機上,除了某些特殊的應用外,纜線、接頭與需要的佈線方式依需求變化性很大。 - - 內建在主機板的序列埠的序列裝置名稱為 /dev/cuau0/dev/cuau1。也有序列 USB 轉接器可使用,而裝置的的名稱則會是 /dev/cuaU0 - - 要與序列印表機通訊必須知道數個通訊參數,其中最重要的是 傳輸速率 (Baud rate)BPS (Bits Per Second) 以及 同位檢查 (Parity)。數值有數種,但一般序列印表機會使用 的傳輸速率是 9600 且無同位檢查。 - - - - - 網路 - - - 網路印表機可直接連接到區域網路。 - - 若印表機透過 DHCP 分配動態位址,則必須要知道 DNS 主機名稱,DNS 應動態更新來讓主機名稱能夠對應到正確的 IP 位址。指定網路印表機一個靜態的 IP 位址可避免這個問題。 - - 大多數網路印表機可以認得使用 LPD 通訊協定所送出的列印工作,列印佇列 (Print queue) 的名稱也會在這時指定。部份印表機會依據使用的佇列來決定處理資料的方式,例如 raw 佇列會列印原始資料,而 text 佇列則會在純文字上增加換行符號 (Carriage return)。 - - 大部份網路印表機也可列印直接傳送到埠號 9100 的資料。 - - - - - - 摘要 - - 有線網路連線通常是安裝最簡單的方式,且可以提供快速的列印。若要直接連接到電腦,較建議使用 USB,由於較快速、簡單。並列連線仍然可以使用,但有纜線長度與速度上的限制。而序列連線則比較難設定,不同型號的纜線佈線方式不同,且通訊參數如傳輸速率及同位檢查增加了複雜性,所幸序列印表機並不多。 - - - - - 常見的頁面描述語言 - - 傳送給印表機的資料必須使用印表機能夠理解的語言,這些語言稱為頁面描述語言 (Page Description Languages) 或 PDL - - - - ASCII - - - ASCII 文字是傳送資料到印表機最簡單的方式,一個字元對應一個要列印的文字:資料中的 A 會列印一個 A 在頁面。可以使用的格式非常少,沒有辦法選擇字型或者比例間距。強迫使用簡單的純 ASCII 為的是讓文字可以直接從電腦列印只需一點或甚至不需要編碼或轉譯,列印的結果可直接對應傳送的內容。 - - 部份便宜印表機無法列印純 ASCII 文字,這讓這些印表機較難設定。 - - - - - PostScript - - - PostScriptASCII 幾乎相反,與簡單的文字不同,PostScript 程式語言有一套指令可以繪出最終所要的文件,可以使用不同的字型與圖形,但是,這樣強大的功能是有代價的,繪製頁面需要搛寫程式語言,通常這個程式語言會由應用程式產生,所以使用者是看不到的。 - - 便宜的印表機有時會移除 PostScript 的相容性來節省成本。 - - - - - PCL (Printer Command Language) - - - PCLASCII 延伸而來,加入了跳脫序列 (Escape sequence) 來標示格式、選擇字型以及列印圖型。大部份印表機都支援 PCL5,少數支援較新的 PCL6PCLXL,這些後來的版本是 PCL5 的超集合 (Superset),並可以提供更快的列印速度。 - - - - - 以主機為基礎 (Host-Based) - - - 製造商可能會使用簡單的處理器和較小的記憶體來降低印表機的成本,這些印表機無法列印純文字,相反的,文字與圖形會先在機器上的驅動程式畫完後傳送到印表機。這些稱為以主機為基礎 (Host-based) 的印表機。 - - 驅動程式與以主機為基礎的印表機通訊通常會透過專用或無文件的通訊協定,這讓這些印表機只能在最常用的作業系統上運作。 - - - - - - 轉換 <trademark class="registered">PostScript</trademark> 至其他 <acronym>PDL</acronym> - - Port 套件集與 FreeBSD 工具集有許多可以處理 PostScript 輸出的應用程式,此表整理出了可轉換 PostScript 成其他常用 PDL 的工具: - - - 輸出 <acronym>PDL</acronym> 格式 - - - - - 輸出 PDL - 產生由 - 說明 - - - - - - PCLPCL5 - print/ghostscript9-base - 單色使用 -sDEVICE=ljet4、彩色使用 -sDEVICE=cljet5 - - - - PCLXLPCL6 - print/ghostscript9-base - 單色使用 -sDEVICE=pxlmono、彩色使用 -sDEVICE=pxlcolor - - - - ESC/P2 - print/ghostscript9-base - -sDEVICE=uniprint - - - - XQX - print/foo2zjs - - - - -
-
- - - 摘要 - - 要可以列印最簡單的方式就是選擇支援 PostScript 的印表機,再來是支援 PCL 的印表機,有了 print/ghostscript9-base 這些印表機也可像原生支援 PostScript 的印表機一般使用。有直接支援 PostScriptPCL 的印表機通常也會直接支援純 ASCII 文字檔案。 - - 行列式印表機如同典型的噴墨式印表機通常不支援 PostScriptPCL,這種印表機通常可以列印純 ASCII 文字檔案。print/ghostscript9-base 支援部份這種印表機使用的 PDL,不過要在這種印表機上列印完全以圖型為基礎的頁面通常會非常緩慢,由於需要傳送大量的資料並列印。 - - 以主機為基礎的印表機通常較難設定,有些會因為用了專用的 PDL 而無法使用,盡可能避免使用這類的印表機。 - - 有關各種 PDL 的介紹可至 。各種型號印表機所使用的特定 PDL 可至 查詢。 - -
- - - 直接列印 - - 對於偶爾列印,檔案可以直接傳送到印表機裝置,無需做任何設定。例如,要傳送一個名稱為 sample.txt 的檔案到 USB 印表機: - - # cp sample.txt /dev/unlpt0 - - 要直接使用網路印表機列印需看該印表機支援的功能,但大多數會接受埠號 9100 的列印作業,可使用 nc1 來完成。要使用 DNS 主機名稱為 netlaser 的印表機列印與上述相同的檔案可: - - # nc netlaser 9100 < sample.txt - - - - <acronym>LPD</acronym> (行列式印表機 Daemon) - - 在背景列印一個檔案稱作 Spooling,緩衝程式 (Spooler) 讓使用者能夠繼續執行電腦的其他程式而不需要等候印表機緩慢的完成列印工作。 - - FreeBSD 內含的緩衝程式 (Spooler) 稱作 lpd8,而列印工作會使用 lpr1 來提交。 - - - 初始設定 - - 建立要用來儲存列印工作的目錄、設定擁有關係以及權限來避免其他使用者可以檢視這些檔案的內容: - - # mkdir -p /var/spool/lpd/lp -# chown daemon:daemon /var/spool/lpd/lp -# chmod 770 /var/spool/lpd/lp - - 印表機會定義在 /etc/printcap,每台印表機項目所包含的詳細資料有名稱、連接的接頭以及各種其他設定。建立 /etc/printcap 使用以下內容: - - lp:\ - :lp=/dev/unlpt0:\ - :sh:\ - :mx#0:\ - :sd=/var/spool/lpd/lp:\ - :lf=/var/log/lpd-errs: - - - - 印表機的名稱。 lpr1 會傳送列印工作到 lp 印表機,除非有使用 來指定其他印表機,所以預的印表機名稱應使用 lp - - - - 印表機所連接到裝置。替換此行為正確的連線類型,如此處所示。 - - - - - - 連線類型 - /etc/printcap 的裝置項目 - - - - - - USB - :lp=/dev/unlpt0:\ - - 此為不會重設 USB 印表機的裝置,若使用上發生問題,請改使用 ulpt0,這個裝置會在每次使用後重設 USB 埠。 - - - - 並列 - :lp=/dev/lpt0:\ - - - - 網路 - - 針對支援 LPD 通訊協定的印表機: - - :lp=:rm=network-printer-name:rp=raw:\ - - 針對支援使用埠號 9100 列印的印表機: - - :lp=9100@network-printer-name:\ - - 針對兩者皆支援的印表機,請替換 network-printer-name 為網路印表機的 DNS 主機名稱。 - - - - 序列 - :lp=/dev/cuau0:br=9600:pa=none:\ - - 這些是一般序列印表機連接到主機板序列埠會採用的數值,傳輸速率 (Baud rate) 是 9600 且無同位檢查 (No Parity)。 - - - - - - - - 在列印工作開始時不列印首頁。 - - - - 不限制列印工作的最大尺寸。 - - - - 此印表機的緩衝 (Spooling) 目錄路徑,每台印表機會自己使用一個獨立的緩衝 (Spooling) 目錄。 - - - - 回報此印表機的錯誤的日誌檔。 - - - - 在建立 /etc/printcap 之後,使用 chkprintcap8 測試印表機是否有錯誤: - - # chkprintcap - - 在繼續之前修正任何回報的問題。 - - 開啟 /etc/rc.conf 中的 lpd8 - - lpd_enable="YES" - - 啟動服務: - - # service lpd start - - - - 使用 <citerefentry><refentrytitle>lpr</refentrytitle><manvolnum>1</manvolnum></citerefentry> 列印 - - Documents are sent to the printer with - lpr. A file to be printed can be named on - the command line or piped into lpr. These - two commands are equivalent, sending the contents of - doc.txt to the default printer: - - % lpr doc.txt -% cat doc.txt | lpr - - Printers can be selected with . To - print to a printer called - laser: - - % lpr -Plaser doc.txt - - - - 過濾器 - - The examples shown so far have sent the contents of a text - file directly to the printer. As long as the printer - understands the content of those files, output will be printed - correctly. - - Some printers are not capable of printing plain text, and - the input file might not even be plain text. - - Filters allow files to be - translated or processed. The typical use is to translate one - type of input, like plain text, into a form that the printer - can understand, like PostScript or PCL. - Filters can also be used to provide additional features, like - adding page numbers or highlighting source code to make it - easier to read. - - The filters discussed here are - input filters or - text filters. These filters convert the - incoming file into different forms. Use su1 to become - root before - creating the files. - - Filters are specified in - /etc/printcap with the - if= identifier. To use - /usr/local/libexec/lf2crlf as a filter, - modify /etc/printcap like this: - - lp:\ - :lp=/dev/unlpt0:\ - :sh:\ - :mx#0:\ - :sd=/var/spool/lpd/lp:\ - :if=/usr/local/libexec/lf2crlf:\ - :lf=/var/log/lpd-errs: - - - - if= identifies the - input filter that will be used on - incoming text. - - - - - The backslash line continuation - characters at the end of the lines in - printcap entries reveal that an entry - for a printer is really just one long line with entries - delimited by colon characters. An earlier example can be - rewritten as a single less-readable line: - - lp:lp=/dev/unlpt0:sh:mx#0:sd=/var/spool/lpd/lp:if=/usr/local/libexec/lf2crlf:lf=/var/log/lpd-errs: - - - - 避免在純文字印表機階梯狀列印 - - Typical FreeBSD text files contain only a single line feed - character at the end of each line. These lines will - stairstep on a standard printer: - - A printed file looks - like the steps of a staircase - scattered by the wind - - A filter can convert the newline characters into - carriage returns and newlines. The carriage returns make - the printer return to the left after each line. Create - /usr/local/libexec/lf2crlf with these - contents: - - #!/bin/sh -CR=$'\r' -/usr/bin/sed -e "s/$/${CR}/g" - - Set the permissions and make it executable: - - # chmod 555 /usr/local/libexec/lf2crlf - - Modify /etc/printcap to use the - new filter: - - :if=/usr/local/libexec/lf2crlf:\ - - Test the filter by printing the same plain text file. - The carriage returns will cause each line to start at the - left side of the page. - - - - 使用 <package>print/enscript</package> 在 <trademark class="registered">PostScript</trademark> 印表機美化純文字內容 - - GNU - Enscript converts plain text - files into nicely-formatted PostScript for printing on - PostScript printers. It adds page numbers, wraps long - lines, and provides numerous other features to make printed - text files easier to read. Depending on the local paper - size, install either - print/enscript-letter or - print/enscript-a4 from the - Ports Collection. - - Create /usr/local/libexec/enscript - with these contents: - - #!/bin/sh -/usr/local/bin/enscript -o - - - Set the permissions and make it executable: - - # chmod 555 /usr/local/libexec/enscript - - Modify /etc/printcap to use the - new filter: - - :if=/usr/local/libexec/enscript:\ - - Test the filter by printing a plain text file. - - - - 列印 <trademark class="registered">PostScript</trademark> 到 <acronym>PCL</acronym> 印表機 - - Many programs produce PostScript documents. - However, inexpensive printers often only understand plain - text or PCL. This filter converts - PostScript files to PCL before sending - them to the printer. - - 由 Port 套件集安裝 Ghostscript PostScript 直譯器,print/ghostscript9-base - - Create /usr/local/libexec/ps2pcl - with these contents: - - #!/bin/sh -/usr/local/bin/gs -dSAFER -dNOPAUSE -dBATCH -q -sDEVICE=ljet4 -sOutputFile=- - - - Set the permissions and make it executable: - - # chmod 555 /usr/local/libexec/ps2pcl - - PostScript input sent to this script will be rendered - and converted to PCL before being sent on - to the printer. - - Modify /etc/printcap to use this - new input filter: - - :if=/usr/local/libexec/ps2pcl:\ - - Test the filter by sending a small PostScript program - to it: - - % printf "%%\!PS \n /Helvetica findfont 18 scalefont setfont \ -72 432 moveto (PostScript printing successful.) show showpage \004" | lpr - - - - 智慧過濾器 - - A filter that detects the type of input and - automatically converts it to the correct format for the - printer can be very convenient. The first two characters of - a PostScript file are usually %!. A - filter can detect those two characters. PostScript files - can be sent on to a PostScript printer unchanged. Text - files can be converted to PostScript with - Enscript as shown earlier. - Create /usr/local/libexec/psif with - these contents: - - #!/bin/sh -# -# psif - Print PostScript or plain text on a PostScript printer -# -IFS="" read -r first_line -first_two_chars=`expr "$first_line" : '\(..\)'` - -case "$first_two_chars" in -%!) - # %! : PostScript job, print it. - echo "$first_line" && cat && exit 0 - exit 2 - ;; -*) - # otherwise, format with enscript - ( echo "$first_line"; cat ) | /usr/local/bin/enscript -o - && exit 0 - exit 2 - ;; -esac - - Set the permissions and make it executable: - - # chmod 555 /usr/local/libexec/psif - - Modify /etc/printcap to use this - new input filter: - - :if=/usr/local/libexec/psif:\ - - Test the filter by printing PostScript and plain text - files. - - - - 其他智慧過濾器 - - Writing a filter that detects many different types of - input and formats them correctly is challenging. - print/apsfilter from the - Ports Collection is a smart magic filter that - detects dozens of file types and automatically converts them - to the PDL understood by the printer. - See for - more details. - - - - - 多序列 - - The entries in /etc/printcap are - really definitions of queues. There can - be more than one queue for a single printer. When combined - with filters, multiple queues provide users more control over - how their jobs are printed. - - As an example, consider a networked PostScript laser - printer in an office. Most users want to print plain text, - but a few advanced users want to be able to print PostScript - files directly. Two entries can be created for the same - printer in /etc/printcap: - - textprinter:\ - :lp=9100@officelaser:\ - :sh:\ - :mx#0:\ - :sd=/var/spool/lpd/textprinter:\ - :if=/usr/local/libexec/enscript:\ - :lf=/var/log/lpd-errs: - -psprinter:\ - :lp=9100@officelaser:\ - :sh:\ - :mx#0:\ - :sd=/var/spool/lpd/psprinter:\ - :lf=/var/log/lpd-errs: - - Documents sent to textprinter will be - formatted by the - /usr/local/libexec/enscript filter shown - in an earlier example. Advanced users can print PostScript - files on psprinter, where no filtering is - done. - - This multiple queue technique can be used to provide - direct access to all kinds of printer features. A printer - with a duplexer could use two queues, one for ordinary - single-sided printing, and one with a filter that sends the - command sequence to enable double-sided printing and then - sends the incoming file. - - - - 監視與控制列印 - - Several utilities are available to monitor print jobs and - check and control printer operation. - - - <citerefentry><refentrytitle>lpq</refentrytitle><manvolnum>1</manvolnum></citerefentry> - - lpq1 shows the status of a user's print - jobs. Print jobs from other users are not shown. - - Show the current user's pending jobs on a single - printer: - - % lpq -Plp -Rank Owner Job Files Total Size -1st jsmith 0 (standard input) 12792 bytes - - Show the current user's pending jobs on all - printers: - - % lpq -a -lp: -Rank Owner Job Files Total Size -1st jsmith 1 (standard input) 27320 bytes - -laser: -Rank Owner Job Files Total Size -1st jsmith 287 (standard input) 22443 bytes - - - - <citerefentry><refentrytitle>lprm</refentrytitle><manvolnum>1</manvolnum></citerefentry> - - lprm1 is used to remove print jobs. Normal users - are only allowed to remove their own jobs. - root can remove - any or all jobs. - - Remove all pending jobs from a printer: - - # lprm -Plp - -dfA002smithy dequeued -cfA002smithy dequeued -dfA003smithy dequeued -cfA003smithy dequeued -dfA004smithy dequeued -cfA004smithy dequeued - - Remove a single job from a - printer. lpq1 is used to find the job number. - - % lpq -Rank Owner Job Files Total Size -1st jsmith 5 (standard input) 12188 bytes -% lprm -Plp 5 -dfA005smithy dequeued -cfA005smithy dequeued - - - - <citerefentry><refentrytitle>lpc</refentrytitle><manvolnum>8</manvolnum></citerefentry> - - lpc8 is used to check and modify printer status. - lpc is followed by a command and an - optional printer name. all can be used - instead of a specific printer name, and the command will be - applied to all printers. Normal users can view status with - lpc8. Only - root can use - commands which modify printer status. - - Show the status of all printers: - - % lpc status all -lp: - queuing is enabled - printing is enabled - 1 entry in spool area - printer idle -laser: - queuing is enabled - printing is enabled - 1 entry in spool area - waiting for laser to come up - - Prevent a printer from accepting new jobs, then begin - accepting new jobs again: - - # lpc disable lp -lp: - queuing disabled -# lpc enable lp -lp: - queuing enabled - - Stop printing, but continue to accept new jobs. Then - begin printing again: - - # lpc stop lp -lp: - printing disabled -# lpc start lp -lp: - printing enabled - daemon started - - Restart a printer after some error condition: - - # lpc restart lp -lp: - no daemon to abort - printing enabled - daemon restarted - - Turn the print queue off and disable printing, with a - message to explain the problem to users: - - # lpc down lp Repair parts will arrive on Monday -lp: - printer and queuing disabled - status message is now: Repair parts will arrive on Monday - - Re-enable a printer that is down: - - # lpc up lp -lp: - printing enabled - daemon started - - See lpc8 for more commands and options. - - - - - 分享印表機 - - Printers are often shared by multiple users in businesses - and schools. Additional features are provided to make sharing - printers more convenient. - - - 別名 - - The printer name is set in the first line of the - entry in /etc/printcap. Additional - names, or aliases, can be added after - that name. Aliases are separated from the name and each - other by vertical bars: - - lp|repairsprinter|salesprinter:\ - - Aliases can be used in place of the printer name. For - example, users in the Sales department print to their - printer with - - % lpr -Psalesprinter sales-report.txt - - Users in the Repairs department print to - their printer with - - % lpr -Prepairsprinter repairs-report.txt - - All of the documents print on that single printer. When - the Sales department grows enough to need their own printer, - the alias can be removed from the shared printer entry and - used as the name of a new printer. Users in both - departments continue to use the same commands, but the Sales - documents are sent to the new printer. - - - - 頁首 - - It can be difficult for users to locate their documents - in the stack of pages produced by a busy shared printer. - Header pages were created to solve this - problem. A header page with the user name and document name - is printed before each print job. These pages are also - sometimes called banner or - separator pages. - - Enabling header pages differs depending on whether the - printer is connected directly to the computer with a - USB, parallel, or serial cable, or - is connected remotely over a network. - - Header pages on directly-connected printers are enabled - by removing the :sh:\ (Suppress Header) - line from the entry in /etc/printcap. - These header pages only use line feed characters for new - lines. Some printers will need the - /usr/share/examples/printing/hpif - filter to prevent stairstepped text. The filter configures - PCL printers to print both carriage - returns and line feeds when a line feed is received. - - Header pages for network printers must be configured on - the printer itself. Header page entries in - /etc/printcap are ignored. Settings - are usually available from the printer front panel or a - configuration web page accessible with a web browser. - - - - - - 參考文獻 - - Example files: /usr/share/examples/printing/. - - The 4.3BSD Line Printer Spooler - Manual, - /usr/share/doc/smm/07.lpd/paper.ascii.gz. - - Manual pages: printcap5, lpd8, lpr1, - lpc8, lprm1, lpq1. - - - - - 其他列印系統 - - Several other printing systems are available in - addition to the built-in lpd8. These systems - offer support for other protocols or additional features. - - - <acronym>CUPS</acronym> (Common <trademark class="registered">UNIX</trademark> Printing - System) - - CUPS is a popular printing system - available on many operating systems. Using - CUPS on FreeBSD is documented in a separate - article: - - - - HPLIP - - Hewlett Packard provides a printing system that supports - many of their inkjet and laser printers. The port is - print/hplip. The main web page - is at . - The port handles all the installation details on FreeBSD. - Configuration information is shown at . - - - - LPRng - - LPRng was developed as an - enhanced alternative to lpd8. The port is - sysutils/LPRng. For details - and documentation, see - . - - -
- - - - - - - <trademark class="registered">Linux</trademark> Binary 相容性 - - - - - Jim - Mock - - Restructured and parts updated by - - - - - - - - Brian N. - Handy - - Originally contributed by - - - - - Rich - Murphey - - - - - - - 概述 - - - Linux binary compatibility - - Binary 相容性 Linux - - FreeBSD 提供 Linux Binary 的相容性,允許使用者在 FreeBSD 系統上不需要修改就可以安裝和執行大部份的 Linux Binary。 曾經有報告指出,在某些情況下,Linux Binary 在 FreeBSD 的表現比在 Linux 好。 - - 然而,部份特定在 Linux 作業系統上的功能在 FreeBSD 並沒有支援。例如,若 Linux Binary 過度的使用 i386 特定的呼叫,如啟動虛擬 8086 模式,會無法在 FreeBSD 執行。 - - - FreeBSD 10.3 後支援 64 位元的 Linux Binary 相容性。 - - - 讀完這章,您將了解: - - - - 如何在 FreeBSD 系統啟用 Linux Binary 相容模式。 - - - - 如何安裝其他的 Linux 共用程式庫。 - - - - 如何在 FreeBSD 系統安裝 Linux 應用程式。 - - - - 在 FreeBSD 中 Linux 相容性的實作細節。 - - - - 在開始閱讀這章之前,您需要: - - - - 知道如何安裝 其他的第三方軟體。 - - - - - - - 設定 <trademark class="registered">Linux</trademark> Binary 相容性 - - Ports Collection - - Linux 程式庫預設並不會安裝,且並不會開啟 Linux Binary 相容性。 Linux 程式庫可以手動安裝或是從 FreeBSD Port 套件集安裝。 - - 在嘗試編譯 Port 前,要載入 Linux 核心模組,否則編譯會失敗: - - # kldload linux - - 對 64-位元的相容性: - - # kldload linux64 - - 確認模組已載入: - - % kldstat - Id Refs Address Size Name - 1 2 0xc0100000 16bdb8 kernel - 7 1 0xc24db000 d000 linux.ko - - 在 FreeBSD 安裝基本的 Linux 程式庫和 Binary 最簡單的方式是安裝 emulators/linux_base-c6 套件或是 Port 。要安裝 Port: - - # pkg install emulators/linux_base-c6 - - 要在開機時開啟 Linux 相容性,可以加入這行到 /etc/rc.conf - - linux_enable="YES" - - 在 64-位元的機器上,/etc/rc.d/abi 會自動載入用來做 64-位元模擬的模組。 - - 核心選項 COMPAT_LINUX - - Since the Linux binary compatibility layer has gained - support for running both 32- and 64-bit Linux binaries (on - 64-bit x86 hosts), it is no longer possible to link the - emulation functionality statically into a custom kernel. - - - 手動安裝其他程式庫 - - - shared libraries - - - 若有 Linux 應用程式在設定 Linux Binary 相容性後出現缺少共用程式庫的情況,確認這個 Linux Binary 需要哪個共用程式庫並手動安裝。 - - Linux 系統,可使用 ldd 來找出應用程式需要哪個共用程式庫。 例如,檢查 linuxdoom 需要哪個共用程式庫,在有安裝 DoomLinux 系統執行這個指令: - - % ldd linuxdoom -libXt.so.3 (DLL Jump 3.1) => /usr/X11/lib/libXt.so.3.1.0 -libX11.so.3 (DLL Jump 3.1) => /usr/X11/lib/libX11.so.3.1.0 -libc.so.4 (DLL Jump 4.5pl26) => /lib/libc.so.4.6.29 - - - symbolic links - - - 然後,複製所有 Linux 系統輸出結果中最後一欄的檔案到 FreeBSD 系統的 /compat/linux。 複製完後,建立符號連結 (Symbolic link) 至輸出結果第一欄的名稱。以這個例子會在 FreeBSD 系統產生以下檔案: - - /compat/linux/usr/X11/lib/libXt.so.3.1.0 -/compat/linux/usr/X11/lib/libXt.so.3 -> libXt.so.3.1.0 -/compat/linux/usr/X11/lib/libX11.so.3.1.0 -/compat/linux/usr/X11/lib/libX11.so.3 -> libX11.so.3.1.0 -/compat/linux/lib/libc.so.4.6.29 -/compat/linux/lib/libc.so.4 -> libc.so.4.6.29 - - Linux 共用程式庫已經存在,並符合 ldd 輸出結果第一欄的主要修訂版號,則不需要複製該行最後一欄的檔案,使用既有的程式庫應可運作。若有較新的版本建議仍要複製共用程式庫,只要符號連結指向新版的程式庫,舊版便可移除。 - - 例如,以下程式庫已存在 FreeBSD 系統: - - /compat/linux/lib/libc.so.4.6.27 -/compat/linux/lib/libc.so.4 -> libc.so.4.6.27 - - ldd 顯示 Binary 需要使用較新的版本: - - libc.so.4 (DLL Jump 4.5pl26) -> libc.so.4.6.29 - - 雖然既有的程式庫只有在最後一碼過時一或兩個版本,程式應該仍可使用稍微舊的版本執行,雖然如此,保險起見還替換既有的 libc.so 為較新的版本: - - /compat/linux/lib/libc.so.4.6.29 -/compat/linux/lib/libc.so.4 -> libc.so.4.6.29 - - 一般來說,只有在安裝 Linux 程式到 FreeBSD 完的前幾次會需要查看 Linux Binary 相依的共用程式庫。之後系統便有足夠的 Linux 共用程式庫能夠執行新安裝的 Linux Binary,便不再需要額外的動作。 - - - - 安裝 <trademark class="registered">Linux</trademark> <acronym>ELF</acronym> Binary - - - Linux - ELF binaries - - - ELF Binary 有時候需要額外的步驟。當執行無商標 (Unbranded) 的 ELF Binary,會產生錯誤訊息: - - % ./my-linux-elf-binary -ELF binary type not known -Abort - - 要協助 FreeBSD 核心區別是 FreeBSD ELF Binary 還是 Linux Binary,可使用 brandelf1 - - % brandelf -t Linux my-linux-elf-binary - - - GNU toolchain - - - 由於 GNU 工具鏈會自動放置適當的商標資訊到 ELF Binary,通常不需要這個步驟。 - - - - 安裝以 <trademark class="registered">Linux</trademark> <acronym>RPM</acronym> 為基礎的應用程式 - - 要安裝 Linux RPM 為基礎的應用程式,需先安裝 archivers/rpm4 套件或 Port。安裝完成之後,root 可以使用這個指令安裝 .rpm - - # cd /compat/linux -# rpm2cpio < /path/to/linux.archive.rpm | cpio -id - - 如果需要, brandelf 已安裝的 ELF Binary。注意,這將會無法乾淨地解除安裝。 - - - - 設定主機名稱解析器 - - 如果 DNS 無法運作或出現這個錯誤: - - resolv+: "bind" is an invalid keyword resolv+: -"hosts" is an invalid keyword - - /compat/linux/etc/host.conf 設定如下: - - order hosts, bind -multi on - - 這指定先搜尋 /etc/hosts,其次為 DNS。 當 /compat/linux/etc/host.conf 不存在, Linux 應用程式會使用 /etc/host.conf 並會警告不相容的 FreeBSD 語法。如果名稱伺服器未設定使用 /etc/resolv.conf 的話,則可移除 bind - - - - - - - - Boris - Hollas - Updated for Mathematica 5.X by - - - - - Installing &mathematica; - - - applications - Mathematica - - - This section describes the process of installing the &linux; - version of &mathematica; 9.X onto a - &os; system. &mathematica; is a - commercial, computational software program used in scientific, - engineering, and mathematical fields. A 30 day trial version is - available for download from wolfram.com/mathematica. - - - Running the &mathematica; Installer - - Before installing &mathematica;, make sure that the - textproc/linux-c6-aspell - package or port is installed and that the &man.linprocfs.5; - file system is mounted. - - &prompt.root; sysctl kern.fallback_elf_brand=3 - - &os; will now assume that unbranded ELF binaries use the - &linux; ABI which should allow the - installer to execute from the CDROM. - - The downloaded file will be saved to - /tmp/Mathematica_9.0.1_LINUX.sh. Become - the superuser and run this installer file: - - &prompt.root; sh /tmp/Mathematica_9.0.1_LINUX.sh -Mathematica Secured 9.0.1 for LINUX Installer Archive - -Verifying archive integrity. -Extracting installer. ... - Wolfram Mathematica 9 Installer -Copyright (c) 1988-2013 Wolfram Research, Inc. All rights reserved. - -WARNING: Wolfram Mathematica is protected by copyright law and international treaties. Unauthorized -reproduction or distribution may result in severe civil and criminal -penalties and will be prosecuted to the maximum extent possible under law. - -Enter the installation directory, or press ENTER to select /usr/local/Wolfram/Mathematica/9.0: -> -Now installing... -*********************** -Installation complete. - - - - Running the &mathematica; Frontend over a Network - - &mathematica; uses some special - fonts to display characters not present in any of the standard - font sets. Xorg requires these - fonts to be installed locally. This means that these fonts - need to be copied from the CDROM or from a host with - &mathematica; installed to the - local machine. These fonts are normally stored in /cdrom/Unix/Files/SystemFiles/Fonts - on the CDROM, or /usr/local/mathematica/SystemFiles/Fonts - on the hard drive. The actual fonts are in the subdirectories - Type1 and - X. There are several - ways to use them, as described below. - - The first way is to copy the fonts into one of the - existing font directories in /usr/local/lib/X11/fonts then - running &man.mkfontdir.1; within the directory containing the - new fonts. - - The second way to do this is to copy the directories to - /usr/local/lib/X11/fonts: - - &prompt.root; cd /usr/local/lib/X11/fonts -&prompt.root; mkdir X -&prompt.root; mkdir MathType1 -&prompt.root; cd /cdrom/Unix/Files/SystemFiles/Fonts -&prompt.root; cp X/* /usr/local/lib/X11/fonts/X -&prompt.root; cp Type1/* /usr/local/lib/X11/fonts/MathType1 -&prompt.root; cd /usr/local/lib/X11/fonts/X -&prompt.root; mkfontdir -&prompt.root; cd ../MathType1 -&prompt.root; mkfontdir - - Now add the new font directories to the font path: - - &prompt.root; xset fp+ /usr/local/lib/X11/fonts/X -&prompt.root; xset fp+ /usr/local/lib/X11/fonts/MathType1 -&prompt.root; xset fp rehash - - When using the &xorg; server, - these font directories can be loaded automatically by adding - them to /etc/X11/xorg.conf. - - fonts - - If /usr/local/lib/X11/fonts/Type1 - does not already exist, change the name of the MathType1 directory in the - example above to Type1. - - - --> - - - - - - - 設定與調校 - - - - - Chern - Lee - - Written by - - - - - - - Mike - Smith - - Based on a tutorial written by - - - - - - - Matt - Dillon - - Also based on tuning(7) written by - - - - - - 概述 - - - system configuration - - - system optimization - - - 在 FreeBSD 使用過程中,相當重要的環節之一就是如何正確設定系統。 本章著重於介紹 FreeBSD 的設定流程,包括一些可以調整 FreeBSD 效能的參數設定。 - - 讀完這章,您將了解: - - - - rc.conf 設定的基礎概念及 /usr/local/etc/rc.d 啟動 Script。 - - - - 如何設定並測試網路卡。 - - - - 如何在網路裝置上設定虛擬主機。 - - - - 如何使用在 /etc 中的各種設定檔。 - - - - 如何使用 sysctl8 變數調校 FreeBSD。 - - - - 如何調校磁碟效能及修改核心限制。 - - - - 在開始閱讀這章之前,您需要: - - - - 了解 UNIX 及 FreeBSD 基礎 ()。 - - - - 熟悉核心設定與編譯的基礎 ()。 - - - - - - - 啟動服務 - - - - - Tom - Rhodes - - Contributed by - - - - - - services - - - 許多使用者會使用 Port 套件集安裝第三方軟體到 FreeBSD 且需要安裝服務在系統初始化時可啟動該軟體。服務,例如 mail/postfixwww/apache22 僅只是在眾多需要在系統初始化時啟動的軟體之中的兩個。本章節將說明可用來啟動第三方軟體的程序。 - - 在 FreeBSD 大多數內建的服務,例如 cron8 也是透過系統啟動 Script 來執行。 - - - 延伸應用程式設定 - - 現在 FreeBSD 會引用 rc.d,設定應用程式啟動變的更簡單且提供更多的功能。使用於 所提到的關鍵字,可以設定應用程式在其他特定服務之後啟動且可以透過 /etc/rc.conf 來傳遞額外的旗標來取代寫死在啟動 Script 中的旗標。一個基本的 Script 可能會如下例所示: - - #!/bin/sh -# -# PROVIDE: utility -# REQUIRE: DAEMON -# KEYWORD: shutdown - -. /etc/rc.subr - -name=utility -rcvar=utility_enable - -command="/usr/local/sbin/utility" - -load_rc_config $name - -# -# DO NOT CHANGE THESE DEFAULT VALUES HERE -# SET THEM IN THE /etc/rc.conf FILE -# -utility_enable=${utility_enable-"NO"} -pidfile=${utility_pidfile-"/var/run/utility.pid"} - -run_rc_command "$1" - - 這個 Script 會確保要執行的 utility 會在虛構的服務 DAEMON 之後啟動,也同時提供設定與追蹤程序 ID (Process ID, PID) 的方法。 - - 接著此應用程式便可將下行放到 /etc/rc.conf 中: - - utility_enable="YES" - - 使用這種方式可以簡單的處理指令列參數、引用 /etc/rc.subr 所提供的預設函數、與 rcorder8 相容並可在 rc.conf 簡單的設定。 - - - - 使用服務來啟動其他服務 - - 其他的服務可以使用 inetd8 來啟動,在 有如何使用 inetd8 以及其設定的深入說明。 - - 在某些情況更適合使用 cron8 來啟動系統服務,由於 cron8 會使用 crontab5 的擁有者來執行這些程序,所以這個方法有不少優點,這讓一般的使用者也可以啟動與維護自己的應用程式。 - - cron8@reboot 功能,可用來替代指定詳細的時間,而該工作會在系統初始化時執行 cron8 後執行。 - - - - - - 設定 <citerefentry><refentrytitle>cron</refentrytitle><manvolnum>8</manvolnum></citerefentry> - - - - - Tom - Rhodes - - Contributed by - - - - - - cron - configuration - - - 在 FreeBSD 其中最有用的其中一項工具便是 cron,這個工具會在背景執行並且定期檢查 /etc/crontab 是否有要執行的工作然後搜尋 /var/cron/tabs 是否有自訂的 crontab 檔案,這些檔案用來安排要讓 cron 在指定的時間執行的工作,crontab 中的每一個項目定義了一個要執行的工作,又稱作 cron job - - 這裡使用了兩種類型的設定檔:其一是系統 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 -# -# $FreeBSD$ -# -SHELL=/bin/sh -PATH=/etc:/bin:/sbin:/usr/bin:/usr/sbin -# -#minute hour mday month wday who command -# -*/5 * * * * root /usr/libexec/atrun - - - - # 字元為首的行代表註解。可在檔案中放置註解提醒要執行什麼動作及為何要執行。註解不可與指令同行,否則會被當做指令的一部份,註解必須在新的一行,空白行則會被忽略掉。 - - - - 等號 (=) 字元用來定義任何環境設定。在這個例子當中,使用了等號來定義 SHELLPATH。若 SHELL 被省略,cron 則會使用預設的 Bourne shell。若 PATH 被省略,則必須指定指令或 Script 的完整路徑才能執行。 - - - - 此行定義了在系統 crontab 會使用到的七個欄位:minute, hour, mday, month, wday, who 以及 commandminute 欄位是指定指令要執行的時間中的分,hour 指定指令要執行的時,mday 是月裡面的日,month 是月,以及 wday 是週裡面的日。這些欄位必須數值代表 24 小時制的時間或 * 來代表所有可能的值。who 這個欄位只有系統 crontab 才有,用來指定要用那一個使用者來執行指令。最後一個欄位則是要執行的指令。 - - - - 這個項目定義了該工作所使用的數值,*/5 後接著數個 * 字元指的是每個月的每一週的每一日的每個小時的每 5 分鐘會使用 root 執行 /usr/libexec/atrun - - 指令可含任何數量的參數,但若指令要使用多行則需以反斜線 \ 連線字元換行。 - - - - - 建立使用者的 Crontab - - 要建立一個使用者 crontab 可使用編輯模式執行 crontab - - % crontab -e - - 這樣會使用預設的文字編輯器來開啟使用者的 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 - - 然後每一個要執行的指令或 Script 加入一行,指定要執行指令的時間。這個例子會每天在下午 2 點執行指定的自訂 Bourne shell script,由於沒有在 PATH 指定 Script 的路徑,所以必須給予完整的 Script 路徑: - - 0 14 * * * /usr/home/dru/bin/mycustomscript.sh - - - 在使用自訂的 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 - - crontab5 有討論 cron 使用的環境變數,若 Script 中含有任何會使用萬用字元刪除檔案的指令,那麼檢查 Script 可正常在 cron 的環境運作非常重要。 - - - 編輯完成 crontab 之後儲存檔案,編輯完的 crontab 會被自動安裝且 cron 會讀取該 crontab 並在其指定的時指執行其 cron job。要列出 crontab 中有那一些 cron job 可以使用此指令: - - % crontab -l -0 14 * * * /usr/home/dru/bin/mycustomscript.sh - - 要移除使用在使用者 crontab 中的 cron job 可: - - % crontab -r -remove crontab for dru? y - - - - - - 管理 FreeBSD 中的服務 - - - - - Tom - Rhodes - - Contributed by - - - - - FreeBSD 在系統初始化時使用 rc8 系統的啟動 Script。列於 /etc/rc.d 的 Script 提供了基本的服務可使用 service8 加上 , 以及 選項來控制。例如,使用以下指令可以重新啟動 sshd8 - - # service sshd restart - - 這個程序可以用來在執行中的系統上啟動服務,而在 rc.conf5 中有指定的服務則會在開機時自動啟動。例如,要在系統啟動時開啟 natd8,可入下行到 /etc/rc.conf - - natd_enable="YES" - - 行已存在,則將 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 - - 要檢查一個服務是否有在 /etc/rc.conf 開啟,可執行服務的 rc8 Script 加上 。這個例子會檢查 sshd8 是否在 /etc/rc.conf 已經開啟: - - # service sshd rcvar -# sshd -# -sshd_enable="YES" -# (default: "") - - - # sshd 的輸出來自上述指令,而非 root console。 - - - 要判斷是一個服務是否正在執行,可使用 ,例如要確認 sshd8 是否正常在執行: - - # service sshd status -sshd is running as pid 433. - - 在某些情況,也可以 一個服務。這個動作會嘗試發送一個信號給指定的服務,強制服務重新載入其設定檔,在大多數的情況下,發送給服務的信號是 SIGHUP。並不是每個服務都有支援此功能。 - - rc8 系統會用在網路服務及也應用在大多數的系統初化 。例如執行 /etc/rc.d/bgfsck Script 會列印出以下訊息: - - Starting background file system checks in 60 seconds. - - 這個 Script 用來在背景做檔案系統檢查,只有在系統初始化時要執行。 - - 許多系統服務會相依其他服務來運作,例如 yp8 及其他以 RPC 為基礎的服務在 rpcbind8 服務啟動前可能會啟動失敗。要解決這種問題,就必須在啟動 Script 上方的註解中加入相依及其他 meta-data。在系統初始化時會用 rcorder8 程式分析這些註解來決定要以什麼順序來執行系統服務以滿足相依。 - - rc.subr8 的需要,以下的關鍵字必須加入到所有的啟動 Script 方可 enable 啟動 Script: - - - - PROVIDE: 設定此檔案所提供的服務。 - - - - 以下關鍵字可能會在每個啟動 Script 的上方引用,雖然非必要,但是對於 rcorder8 是非常有用的提示: - - - - REQUIRE: 列出此服務需要引用的服務。有使用此關鍵字的 Script 會在指定服務啟動 之後 才執行。 - - - - BEFORE: 列出相依此服務的服務。有使用此關鍵字的 Script 會在指定的服務啟動 之前 執行。 - - - - 透過仔細的設定每個啟動 Script 的這些關鍵字,管理者便可對 Script 的啟動順序進行微調,而不需使用到其他 UNIX 作業系統所使用的 runlevels - - 額外的資訊可在 rc8 以及 rc.subr8 中找到。請參考 此文章 來取得如何建立自訂 rc8 Script 的操作說明。 - - - 管理系統特定的設定 - - - rc files - rc.conf - - - 系統設定資訊的主要位於 /etc/rc.conf,這個檔案的設定資訊範圍非常廣且會在系統啟動時讀取來設定系統,它也提供設定資訊給 rc* 檔案使用。 - - /etc/rc.conf 中的設定項目會覆蓋在 /etc/defaults/rc.conf 的預設設定,不應直接編輯該檔案中的預設設定,所有系統特定的設定應到 /etc/rc.conf 所修改。 - - 在叢集應用時要將系統特定的設定與各站特定的設定分開,藉此減少管理成本有好幾種方法,建議的方法是將系統特定的設定放置在 /etc/rc.conf.local,例如以下將要套用到所有系統的設定項目放在 /etc/rc.conf - - sshd_enable="YES" -keyrate="fast" -defaultrouter="10.1.1.254" - - 而只套用到此系統的設定放在 /etc/rc.conf.local - - hostname="node1.example.org" -ifconfig_fxp0="inet 10.1.1.1/8" - - 使用應用程式如 rsyncpuppet/etc/rc.conf 散布到每個系統,而在各系統保留自己的 /etc/rc.conf.local - - 升級系統並不會覆寫 /etc/rc.conf,所以系統設定資訊不會因此遺失。 - - - /etc/rc.conf 以及 /etc/rc.conf.local 兩個檔案都會使用 sh1 解析,這讓系統操作者能夠建立較複雜的設定方案。請參考 rc.conf5 來取得更多有關此主題的資訊。 - - - - - - - 設定網路介面卡 - - - - - Marc - Fonvieille - - Contributed by - - - - - - network cards - configuration - - - 對 FreeBSD 管理者來說加入與設定網路介面卡 (Network Interface Card, NIC) 會是一件常見的工作。 - - - 找到正確的驅動程式 - - - network cards - driver - - - 首先,要先確定 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 -miibus0: <MII bus> on dc0 -bmtphy0: <BCM5201 10/100baseTX PHY> PHY 1 on miibus0 -bmtphy0: 10baseT, 10baseT-FDX, 100baseTX, 100baseTX-FDX, auto -dc0: Ethernet address: 00:a0:cc:da:da:da -dc0: [ITHREAD] -dc1: <82c169 PNIC 10/100BaseTX> port 0x9800-0x98ff mem 0xd3000000-0xd30 -000ff irq 11 at device 12.0 on pci0 -miibus1: <MII bus> on dc1 -bmtphy1: <BCM5201 10/100baseTX PHY> PHY 1 on miibus1 -bmtphy1: 10baseT, 10baseT-FDX, 100baseTX, 100baseTX-FDX, auto -dc1: Ethernet address: 00:a0:cc:da:da:db -dc1: [ITHREAD] - - 若在 GENERIC 中沒有該 NIC 的驅動程式,但有可用的驅動程式,那麼在設定及使用 NIC 前要先載入該驅動程式,有兩種方式可以完成這件事: - - - - 最簡單的方式是使用 kldload8 載入 NIC 要使用的核心模組。要在開機時自動載入,可加入適當的設定到 /boot/loader.conf。不是所有 NIC 驅動程式皆可當做模組使用。 - - - - 或者,靜態編譯對 NIC 的支援到自訂核心,請參考 /usr/src/sys/conf/NOTES, /usr/src/sys/arch/conf/NOTES 及驅動程式的操作手冊來了解要在自訂核心設定檔中要加入那些設定。要取得更多有關重新編譯核心的資訊可參考 。若在開機時有偵測到 NIC,就不需要再重新編譯核心。 - - - - - 使用 <trademark class="registered">Windows</trademark> <acronym>NDIS</acronym> 驅動程式 - - - NDIS - - - NDISulator - - - Windows drivers - - - Microsoft Windows - device drivers - - - KLD (kernel loadable - object) - - - - 很不幸的,仍有很多供應商並沒有提供它們驅動程式的技術文件給開源社群,因為這些文件有涉及商業機密。因此,FreeBSD 及其他作業系統的開發人員只剩下兩種方案可以選擇:透過長期與艱苦的過程做逆向工程來開發驅動程式或是使用現有供 Microsoft Windows 平台用的驅動程式 Binary。 - - FreeBSD 對 Network Driver Interface Specification (NDIS) 有提供 原生 的支援,這包含了 ndisgen8 可用來轉換 Windows XP 驅動程式成可在 FreeBSD 上使用的格式。由於 ndis4 驅動程式使用的是 Windows XP binary,所以只能在 i386 及 amd64 系統上執行。PCI, CardBus, PCMCIA 以及 USB 裝置也都有支援。 - - 要使用 ndisgen8 需要三樣東西: - - - - FreeBSD 核心原始碼。 - - - - 一個 .SYS 附檔名的 Windows XP 驅動程式 Binary。 - - - - 一個 .INF 附檔名的 Windows XP 驅動程式設定檔。 - - - - 下載供指定 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 - - 這個指令是互動式的,會提示輸入任何所需的額外資訊,新的核心模組會被產生在目前的目錄,使用 kldload8 來載入新的模組: - - # kldload ./W32DRIVER_SYS.ko - - 除了產生的核心模組之外,ndis.ko 以及 if_ndis.ko 也必須載入,會在任何有相依 ndis4 的模組被載入時一併自動載入。若沒有自動載入,則需使用以下指令手動載入: - - # kldload ndis -# kldload if_ndis - - 第一個指令會載入 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 -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 - - 到此之後 ndis0 可以像任何其他 NIC 設定使用。 - - 要設定系統於開機時載入 ndis4 模組,可複製產生的模組 W32DRIVER_SYS.ko/boot/modules。然後加入下行到 /boot/loader.conf - - W32DRIVER_SYS_load="YES" - - - - - 設定網路卡 - - - network cards - configuration - - - 載入正確的 NIC 驅動程式之後,接著需要設定介面卡,這個動作可能在安裝時已經使用 bsdinstall8 設定過了。 - - 要查看 NIC 設定可輸入以下指令: - - % ifconfig -dc0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500 - options=80008<VLAN_MTU,LINKSTATE> - ether 00:a0:cc:da:da:da - inet 192.168.1.3 netmask 0xffffff00 broadcast 192.168.1.255 - media: Ethernet autoselect (100baseTX <full-duplex>) - status: active -dc1: flags=8802<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500 - options=80008<VLAN_MTU,LINKSTATE> - ether 00:a0:cc:da:da:db - inet 10.0.0.1 netmask 0xffffff00 broadcast 10.0.0.255 - media: Ethernet 10baseT/UTP - status: no carrier -lo0: flags=8049<UP,LOOPBACK,RUNNING,MULTICAST> metric 0 mtu 16384 - options=3<RXCSUM,TXCSUM> - inet6 fe80::1%lo0 prefixlen 64 scopeid 0x4 - inet6 ::1 prefixlen 128 - inet 127.0.0.1 netmask 0xff000000 - nd6 options=3<PERFORMNUD,ACCEPT_RTADV> - - 在這個例子中列出了以下裝置: - - - - dc0: 第一個乙太網路介面。 - - - - dc1: 第二個乙太網路介面。 - - - - lo0: Loopback 裝置。 - - - - FreeBSD 會使用驅動程式名稱接著開機時所偵測到的介面卡順序來命名 NIC。例如 sis2 是指在系統上使用 sis4 驅動程式的第三個 NIC - - 在此例中,dc0 已經上線並且執行中。主要的依據有: - - - - UP 代表介面卡已設定好並且準備就緒。 - - - - 介面卡有網際網路 (inet) 位址,192.168.1.3 - - - - 介面卡有一個有效的子網路遮罩 (netmask),其中 0xffffff00 等同於 255.255.255.0 - - - - 介面卡有一個有效的廣播位址,192.168.1.255 - - - - 介面卡 (ether) 的 MAC 位址是 00:a0:cc:da:da:da - - - - 實體媒介選擇為自動選擇模式 (media: Ethernet autoselect (100baseTX <full-duplex>))。在本例中 dc1 被設定使用 10baseT/UTP 媒介。要取得更多有關可用的驅動程式媒介類型請參考操作手冊。 - - - - 連結的狀態 (status) 為使用中 (active),代表有偵測到載波信號 (Carrier Signal)。若 dc1 所代表的介面卡未插入乙太網路線則狀態為 status: no carrier 是正常的。 - - - - ifconfig8 的輸出結果如下: - - dc0: flags=8843<BROADCAST,SIMPLEX,MULTICAST> metric 0 mtu 1500 - options=80008<VLAN_MTU,LINKSTATE> - ether 00:a0:cc:da:da:da - media: Ethernet autoselect (100baseTX <full-duplex>) - status: active - - 則代表尚未設定介面卡。 - - 介面卡必須以 root 來設定。NIC 的設定可在指令列執行 ifconfig8 來完成,但重新開機之後變會消失,除非將設定也加到 /etc/rc.conf。若在 LAN 中有 DHCP 伺服器,則只需加入此行: - - ifconfig_dc0="DHCP" - - 替換 dc0 為該系統的正確值。 - - 加入這行之後,接著依據 指示操作。 - - - 若網路在安裝時已設定,可能會已經有 NIC 的設定項目。在加入任何設定前請再次檢查 /etc/rc.conf - - - 在這個例中,沒有 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" - - 替換 dc0dc1 以及 IP 位址資訊為系統的正確值。請參考驅動程式的操作手冊、ifconfig8 以及 rc.conf5 取得更多有關可用的選項及 /etc/rc.conf 的語法。 - - 若網路沒有使用 DNS,則編輯 /etc/hosts 加入 LAN 上主機的名稱與 IP 位址。要取得更多資訊請參考 hosts5/usr/share/examples/etc/hosts - - - 若沒有 DHCP 伺服器且需要存取網際網路,那麼需要手動設定預設閘道及名稱伺服器: - - # echo 'defaultrouter="your_default_router"' >> /etc/rc.conf -# echo 'nameserver your_DNS_server' >> /etc/resolv.conf - - - - - 測試與疑難排解 - - 必要的變更儲存到 /etc/rc.conf 之後,需要重新啟動系統來測試網路設定並檢查系統重新啟動是否沒有任何設定錯誤。或者使用這個指令將設定套用到網路系統: - - # service netif restart - - - 若預設的通訊閘已設定於 /etc/rc.conf 也同樣要下這個指令: - - # service routing restart - - - 網路系統重新啟動後,便可接著測試 NIC - - - 測試乙太網路卡 - - - network cards - testing - - - 要檢查乙太網路卡是否已正確設定可 ping8 介面卡自己,然後 ping8 其他於 LAN 上的主機: - - % ping -c5 192.168.1.3 -PING 192.168.1.3 (192.168.1.3): 56 data bytes -64 bytes from 192.168.1.3: icmp_seq=0 ttl=64 time=0.082 ms -64 bytes from 192.168.1.3: icmp_seq=1 ttl=64 time=0.074 ms -64 bytes from 192.168.1.3: icmp_seq=2 ttl=64 time=0.076 ms -64 bytes from 192.168.1.3: icmp_seq=3 ttl=64 time=0.108 ms -64 bytes from 192.168.1.3: icmp_seq=4 ttl=64 time=0.076 ms - ---- 192.168.1.3 ping statistics --- -5 packets transmitted, 5 packets received, 0% packet loss -round-trip min/avg/max/stddev = 0.074/0.083/0.108/0.013 ms - - % ping -c5 192.168.1.2 -PING 192.168.1.2 (192.168.1.2): 56 data bytes -64 bytes from 192.168.1.2: icmp_seq=0 ttl=64 time=0.726 ms -64 bytes from 192.168.1.2: icmp_seq=1 ttl=64 time=0.766 ms -64 bytes from 192.168.1.2: icmp_seq=2 ttl=64 time=0.700 ms -64 bytes from 192.168.1.2: icmp_seq=3 ttl=64 time=0.747 ms -64 bytes from 192.168.1.2: icmp_seq=4 ttl=64 time=0.704 ms - ---- 192.168.1.2 ping statistics --- -5 packets transmitted, 5 packets received, 0% packet loss -round-trip min/avg/max/stddev = 0.700/0.729/0.766/0.025 ms - - 要測試網路解析,可使用主機名稱來替代 IP 位址。若在網路上沒有 DNS 伺服器則必須先設定 /etc/hosts,若主機尚未設定到 /etc/hosts 中,則需編輯 /etc/hosts 加入 LAN 上主機的名稱及 IP 位址,要取得更多資訊請參考 hosts5/usr/share/examples/etc/hosts - - - - 疑難排解 - - - network cards - troubleshooting - - - 在排除硬體及軟體設定問題時,要先檢查幾件簡單的事。網路線插上了沒?網路的服務都正確設定了嗎?防火牆設定是否正確?FreeBSD 是否支援該 NIC?在回報問題之前,永遠要先檢查 Hardware Notes、更新 FreeBSD 到最新的 STABLE 版本、檢查郵遞論壇封存記錄以及上網查詢。 - - 若介面卡可以運作,但是效能很差,請閱讀 tuning7,同時也要檢查網路設定,因為不正確的網路設定會造成連線速度緩慢。 - - 部份使用者會遇到一次或兩次 device timeout 的訊息,在對某些介面卡是正常的。若訊息持續發生或很煩的,請確認是否有與其他的裝置衝突,再次檢查網路線,或考慮使用其他介面卡。 - - 要解決 watchdog timeout 錯誤,先檢查網路線。許多介面卡需要使用支援 Bus Mastering 的 PCI 插槽,在一些舊型的主機板,只會有一個 PCI 插槽支援,通常是插槽 0。檢查 NIC 以及主機板說明文件來確定是否為此問題。 - - 若系統無法路由傳送封包到目標主機則會出現 No route to host 訊息,這可能是因為沒有指定預設的路由或未插上網路線。請檢查 netstat -rn 的輸出並確認有一個有效的路由可連線至主機,若沒有,請閱讀 - - 造成 ping: sendto: Permission denied 錯誤訊息的原因通常是防火牆設定錯誤。若在 FreeBSD 上有開啟防火牆,但卻未定義任何的規則,預設的原則是拒絕所有傳輸,即使是用 ping8。請參考 取得更多資訊。 - - 有時介面卡的效能很差或低於平均值,在這種情況可嘗試設定媒介選擇模式由 autoselect 更改為正確的媒介選項,雖然這在大部份硬體可運作,但可能無法解決問題,同樣的,檢查所有網路設定並參考 tuning7 - - - - - - 虛擬主機 - - virtual hosts - IP - aliases - - FreeBSD 最常見的用途之一就是虛擬網站代管,即以一台伺服器在網路上扮演多台伺服器,這可以透過指定多個網路位置到一個網路介面來做到。 - - 一個網路介面會有一個 真實 (Real) 位址且可以有許多個 別名 (Alias) 位址。一般會在 /etc/rc.conf 中放置別名項目來增加別名,如下例: - - ifconfig_fxp0_alias0="inet xxx.xxx.xxx.xxx netmask xxx.xxx.xxx.xxx" - - 別名項目必須以 alias0 開頭,使用連續數字例如 alias0, alias1 以此類推,設定程序會在第一個遇到缺號的地方中止。 - - 要注意別名網路遮罩 (Netmask) 的計算,使用的介面必須至少有一個正確的填寫網路遮罩的位址,而其他所有在此網路中的位址則必須使用全部 1 的網路遮罩,可用 255.255.255.2550xffffffff 來表示。 - - 舉例來說,有一個 fxp0 介面連結到兩個網路:10.1.1.0 使用網路遮罩 255.255.255.0 以及 202.0.75.16 使用網路遮罩 255.255.255.240。而系統將要設定使用範圍 10.1.1.110.1.1.5 以及 202.0.75.17202.0.75.20。在指定的網路範圍中只有第一個位址應使用真實的網路遮罩,其餘 (10.1.1.210.1.1.5202.0.75.18202.0.75.20) 則必須設定使用 255.255.255.255 的遮罩。 - - 在此情境下正確設定網路介面的方式如下 /etc/rc.conf 中的項目: - - ifconfig_fxp0="inet 10.1.1.1 netmask 255.255.255.0" -ifconfig_fxp0_alias0="inet 10.1.1.2 netmask 255.255.255.255" -ifconfig_fxp0_alias1="inet 10.1.1.3 netmask 255.255.255.255" -ifconfig_fxp0_alias2="inet 10.1.1.4 netmask 255.255.255.255" -ifconfig_fxp0_alias3="inet 10.1.1.5 netmask 255.255.255.255" -ifconfig_fxp0_alias4="inet 202.0.75.17 netmask 255.255.255.240" -ifconfig_fxp0_alias5="inet 202.0.75.18 netmask 255.255.255.255" -ifconfig_fxp0_alias6="inet 202.0.75.19 netmask 255.255.255.255" -ifconfig_fxp0_alias7="inet 202.0.75.20 netmask 255.255.255.255" - - 有一種更簡單的方式可以表達這些設定,便是使用以空白分隔的 IP 位址清單。只有第一個位址會使用指定的子網路遮罩,其他的位址則會使用 255.255.255.255 的子網路遮罩。 - - ifconfig_fxp0_aliases="inet 10.1.1.1-5/24 inet 202.0.75.17-20/28" - - - - - 設定系統日誌 - - - - - Niclas - Zeising - - Contributed by - - - - - - system logging - - - syslog - - - syslogd8 - - - 產生與讀取系統日誌對系統管理來說是一件非常重要的事,在系統日誌中的資訊可以用來偵測硬體與軟體的問題,同樣也可以偵測應用程式與系統設定的錯誤。這些資訊在安全性稽查與事件回應也同樣扮演了重要的角色,大多數系統 Daemon 與應用程式都會產生日誌項目。 - - FreeBSD 提供了一個系統日誌程式 syslogd 用來管理日誌。預設 syslogd 會與系統開機時啟動。這可使用在 /etc/rc.conf 中的變數 syslogd_enable 來控制。而且有數個應用程式參數可在 /etc/rc.conf 使用 syslogd_flags 來設定。請參考 syslogd8 來取得更多可用參數的資訊。 - - 此章節會介紹如何設定 FreeBSD 系統日誌程式來做本地與遠端日誌並且介紹如何執行日誌翻轉 (Log rotation) 與日誌管理。 - - - 設定本地日誌 - - syslog.conf - - 設定檔 /etc/syslog.conf 控制 syslogd 收到日誌項目時要做的事情,有數個參數可以用來控制接收到事件時的處理方式。設施 (facility) 用來描述記錄產生訊息的子系統 (subsystem),如核心或者 Daemon,而 層級 (level) 用來描述所發生的事件嚴重性。也可以依據應用程式所發出的訊息及產生日誌事件機器的主機名稱來決定後續處置的動作。 - - 此設定檔中一行代表一個動作,每一行的格式皆為一個選擇器欄位 (Selector field) 接著一個動作欄位 (Action field)。選擇器欄位的格式為 facility.level 可以用來比對來自 facility 於層級 level 或更高層的日誌訊息,也可以在層級前加入選擇性的比對旗標來更確切的指定記錄的內容。同樣一個動作可以使用多個選擇器欄位並使用分號 (;) 來分隔。用 * 可以比對任何東西。動作欄位可用來指定傳送日誌訊息的目標,如一個檔案或遠端日誌主機。範例為以下為 FreeBSD 預設的 syslog.conf - - # $FreeBSD$ -# -# Spaces ARE valid field separators in this file. However, -# other *nix-like systems still insist on using tabs as field -# separators. If you are sharing this file between systems, you -# may want to use only tabs as field separators here. -# Consult the syslog.conf(5) manpage. -*.err;kern.warning;auth.notice;mail.crit /dev/console -*.notice;authpriv.none;kern.debug;lpr.info;mail.crit;news.err /var/log/messages -security.* /var/log/security -auth.info;authpriv.info /var/log/auth.log -mail.info /var/log/maillog -lpr.info /var/log/lpd-errs -ftp.info /var/log/xferlog -cron.* /var/log/cron -!-devd -*.=debug /var/log/debug.log -*.emerg * -# uncomment this to log all writes to /dev/console to /var/log/console.log -#console.info /var/log/console.log -# uncomment this to enable logging of all log messages to /var/log/all.log -# touch /var/log/all.log and chmod it to mode 600 before it will work -#*.* /var/log/all.log -# uncomment this to enable logging to a remote loghost named loghost -#*.* @loghost -# uncomment these if you're running inn -# news.crit /var/log/news/news.crit -# news.err /var/log/news/news.err -# news.notice /var/log/news/news.notice -# Uncomment this if you wish to see messages produced by devd -# !devd -# *.>=info -!ppp -*.* /var/log/ppp.log -!* - - 在這個範例中: - - - - 第 8 行會找出所有符合 err 或以上層級的訊息,還有 kern.warning, auth.noticemail.crit 的訊息,然後將這些日誌訊息傳送到 Console (/dev/console)。 - - - - 第 12 行會找出所有符合 mail 設施中於 info 或以上層級的訊息,並記錄訊息至 /var/log/maillog - - - - 第 17 行使用了比較旗標 (=) 來只找出符合 debug 層級的訊息,並將訊息記錄至 /var/log/debug.log - - - - 第 33 行是指定程式的範例用法。這可以讓在該行以下的規則只對指定的程式生效。在此例中,只有由 ppp 產生的訊息會被記錄到 /var/log/ppp.log - - - - 所以可用層級從最嚴重到最不嚴重的順序為 emerg, alert, crit, err, warning, notice, info 以及 debug - - 設施 (facility) 則無特定順序,可用的有 auth, authpriv, console, cron, daemon, ftp, kern, lpr, mail, mark, news, security, syslog, user, uucplocal0local7。要注意在其他作業系統的設施可能會不同。 - - 要記錄所有所有 notice 與以上層級的訊息到 /var/log/daemon.log 可加入以下項目: - - daemon.notice /var/log/daemon.log - - 要取得更多有關不同的層級與設施的資訊請參考 syslog3syslogd8。要取得更多有關 /etc/syslog.conf、語法以及更多進階用法範例的資訊請參考 syslog.conf5 - - - - 日誌管理與翻轉 - - newsyslog - newsyslog.conf - log rotation - log management - - 日誌檔案會成長的非常快速,這會消耗磁碟空間並且會更難在日誌中找到有用的資訊,日誌管理便是為了嘗試減緩這種問題。在 FreeBSD 可以使用 newsyslog 來管理日誌檔案,這個內建的程式會定期翻轉 (Rotate) 與壓縮日誌檔案,並且可選擇性的建立遺失的日誌檔案並在日誌檔案被移動位置時通知程式。日誌檔案可能會由 syslogd 產生或由其他任何會產生日誌檔案的程式。newsyslog 正常會由 cron8 來執行,它並非一個系統 Daemon,預設會每個小時執行一次。 - - newsyslog 會讀取其設定檔 /etc/newsyslog.conf 來決定其要採取的動作,每個要由 newsyslog 所管理的日誌檔案會在此設定檔中設定一行,每一行要說明檔案的擁有者、權限、何時要翻轉該檔案、選用的日誌翻轉旗標,如:壓縮,以及日誌翻轉時要通知的程式。以下為 FreeBSD 的預設設定: - - # configuration file for newsyslog -# $FreeBSD$ -# -# Entries which do not specify the '/pid_file' field will cause the -# syslogd process to be signalled when that log file is rotated. This -# action is only appropriate for log files which are written to by the -# syslogd process (ie, files listed in /etc/syslog.conf). If there -# is no process which needs to be signalled when a given log file is -# rotated, then the entry for that file should include the 'N' flag. -# -# The 'flags' field is one or more of the letters: BCDGJNUXZ or a '-'. -# -# Note: some sites will want to select more restrictive protections than the -# defaults. In particular, it may be desirable to switch many of the 644 -# entries to 640 or 600. For example, some sites will consider the -# contents of maillog, messages, and lpd-errs to be confidential. In the -# future, these defaults may change to more conservative ones. -# -# logfilename [owner:group] mode count size when flags [/pid_file] [sig_num] -/var/log/all.log 600 7 * @T00 J -/var/log/amd.log 644 7 100 * J -/var/log/auth.log 600 7 100 @0101T JC -/var/log/console.log 600 5 100 * J -/var/log/cron 600 3 100 * JC -/var/log/daily.log 640 7 * @T00 JN -/var/log/debug.log 600 7 100 * JC -/var/log/kerberos.log 600 7 100 * J -/var/log/lpd-errs 644 7 100 * JC -/var/log/maillog 640 7 * @T00 JC -/var/log/messages 644 5 100 @0101T JC -/var/log/monthly.log 640 12 * $M1D0 JN -/var/log/pflog 600 3 100 * JB /var/run/pflogd.pid -/var/log/ppp.log root:network 640 3 100 * JC -/var/log/devd.log 644 3 100 * JC -/var/log/security 600 10 100 * JC -/var/log/sendmail.st 640 10 * 168 B -/var/log/utx.log 644 3 * @01T05 B -/var/log/weekly.log 640 5 1 $W6D0 JN -/var/log/xferlog 600 7 100 * JC - - 每一行的開始為要翻轉的日誌名稱、接著是供翻轉與新建檔案使用的擁有者及群組 (選填)。mode 欄位可設定日誌檔案的權限,count 代表要保留多少個翻轉過的日誌檔案,而 sizewhen 欄位會告訴 newsyslog 何時要翻轉該檔案。日誌檔案會在當其檔案超過 size 欄位的大小或已超過 when 欄位指定的時間時翻轉,可使用星號 (*) 忽略該欄位。flags 欄位可以給予進階的參數,例如:如何壓縮翻轉後檔案或建立遺失的日誌檔案。最後兩個欄位皆為選填,可指定程序的程序 ID (PID) 檔名稱以及檔案翻轉後要傳送給該程序的信號 (Signal) 編號。 - - 要取的更多有關所有欄位、可用的旗標及如何指定翻轉時間,請參考 newsyslog.conf5。由於 newsyslog 是由 cron8 執行,因此無法比其在 cron8 中所排定的時間間距內更頻繁的執行翻轉檔案。 - - - - - 設定遠端日誌 - - - - - Tom - Rhodes - - Contributed by - - - - - Monitoring the log files of multiple hosts can become - unwieldy as the number of systems increases. Configuring - centralized logging can reduce some of the administrative - burden of log file administration. - - In FreeBSD, centralized log file aggregation, merging, and - rotation can be configured using - syslogd and - newsyslog. This section - demonstrates an example configuration, where host - A, named logserv.example.com, will - collect logging information for the local network. Host - B, named logclient.example.com, - will be configured to pass logging information to the logging - server. - - - 日誌伺服器設定 - - A log server is a system that has been configured to - accept logging information from other hosts. Before - configuring a log server, check the following: - - - - If there is a firewall between the logging server - and any logging clients, ensure that the firewall - ruleset allows UDP port 514 for both - the clients and the server. - - - - The logging server and all client machines must - have forward and reverse entries in the local - DNS. If the network does not have a - DNS server, create entries in each - system's /etc/hosts. Proper name - resolution is required so that log entries are not - rejected by the logging server. - - - - On the log server, edit - /etc/syslog.conf to specify the name of - the client to receive log entries from, the logging facility - to be used, and the name of the log to store the host's log - entries. This example adds the hostname of - B, logs all facilities, and stores - the log entries in - /var/log/logclient.log. - - - 日誌伺服器設定範例 - - +logclient.example.com -*.* /var/log/logclient.log - - - When adding multiple log clients, add a similar two-line - entry for each client. More information about the available - facilities may be found in syslog.conf5. - - Next, configure - /etc/rc.conf: - - syslogd_enable="YES" -syslogd_flags="-a logclient.example.com -v -v" - - The first entry starts - syslogd at system boot. The - second entry allows log entries from the specified client. - The increases the verbosity of logged - messages. This is useful for tweaking facilities as - administrators are able to see what type of messages are - being logged under each facility. - - Multiple options may be specified to - allow logging from multiple clients. IP - addresses and whole netblocks may also be specified. Refer - to syslogd8 for a full list of possible - options. - - Finally, create the log file: - - # touch /var/log/logclient.log - - At this point, syslogd should - be restarted and verified: - - # service syslogd restart -# pgrep syslog - - If a PID is returned, the server - restarted successfully, and client configuration can begin. - If the server did not restart, consult - /var/log/messages for the error. - - - - 日誌客戶端設定 - - A logging client sends log entries to a logging server - on the network. The client also keeps a local copy of its - own logs. - - Once a logging server has been configured, edit - /etc/rc.conf on the logging - client: - - syslogd_enable="YES" -syslogd_flags="-s -v -v" - - The first entry enables - syslogd on boot up. The second - entry prevents logs from being accepted by this client from - other hosts () and increases the - verbosity of logged messages. - - Next, define the logging server in the client's - /etc/syslog.conf. In this example, all - logged facilities are sent to a remote system, denoted by - the @ symbol, with the specified - hostname: - - *.* @logserv.example.com - - After saving the edit, restart - syslogd for the changes to take - effect: - - # service syslogd restart - - To test that log messages are being sent across the - network, use logger1 on the client to send a message - to syslogd: - - # logger "Test message from logclient" - - This message should now exist both in - /var/log/messages on the client and - /var/log/logclient.log on the log - server. - - - - 日誌伺服器除錯 - - If no messages are being received on the log server, the - cause is most likely a network connectivity issue, a - hostname resolution issue, or a typo in a configuration - file. To isolate the cause, ensure that both the logging - server and the logging client are able to - ping each other using the hostname - specified in their /etc/rc.conf. If - this fails, check the network cabling, the firewall ruleset, - and the hostname entries in the DNS - server or /etc/hosts on both the - logging server and clients. Repeat until the - ping is successful from both - hosts. - - If the ping succeeds on both hosts - but log messages are still not being received, temporarily - increase logging verbosity to narrow down the configuration - issue. In the following example, - /var/log/logclient.log on the logging - server is empty and /var/log/messages - on the logging client does not indicate a reason for the - failure. To increase debugging output, edit the - syslogd_flags entry on the logging server - and issue a restart: - - syslogd_flags="-d -a logclient.example.com -v -v" - - # service syslogd restart - - Debugging data similar to the following will flash on - the console immediately after the restart: - - logmsg: pri 56, flags 4, from logserv.example.com, msg syslogd: restart -syslogd: restarted -logmsg: pri 6, flags 4, from logserv.example.com, msg syslogd: kernel boot file is /boot/kernel/kernel -Logging to FILE /var/log/messages -syslogd: kernel boot file is /boot/kernel/kernel -cvthname(192.168.1.10) -validate: dgram from IP 192.168.1.10, port 514, name logclient.example.com; -rejected in rule 0 due to name mismatch. - - In this example, the log messages are being rejected due - to a typo which results in a hostname mismatch. The - client's hostname should be logclient, - not logclien. Fix the typo, issue a - restart, and verify the results: - - # service syslogd restart -logmsg: pri 56, flags 4, from logserv.example.com, msg syslogd: restart -syslogd: restarted -logmsg: pri 6, flags 4, from logserv.example.com, msg syslogd: kernel boot file is /boot/kernel/kernel -syslogd: kernel boot file is /boot/kernel/kernel -logmsg: pri 166, flags 17, from logserv.example.com, -msg Dec 10 20:55:02 <syslog.err> logserv.example.com syslogd: exiting on signal 2 -cvthname(192.168.1.10) -validate: dgram from IP 192.168.1.10, port 514, name logclient.example.com; -accepted in rule 0. -logmsg: pri 15, flags 0, from logclient.example.com, msg Dec 11 02:01:28 trhodes: Test message 2 -Logging to FILE /var/log/logclient.log -Logging to FILE /var/log/messages - - At this point, the messages are being properly received - and placed in the correct file. - - - - 安全注意事項 - - As with any network service, security requirements - should be considered before implementing a logging server. - Log files may contain sensitive data about services enabled - on the local host, user accounts, and configuration data. - Network data sent from the client to the server will not be - encrypted or password protected. If a need for encryption - exists, consider using security/stunnel, - which will transmit the logging data over an encrypted - tunnel. - - Local security is also an issue. Log files are not - encrypted during use or after log rotation. Local users may - access log files to gain additional insight into system - configuration. Setting proper permissions on log files is - critical. The built-in log rotator, - newsyslog, supports setting - permissions on newly created and rotated log files. Setting - log files to mode 600 should prevent - unwanted access by local users. Refer to - newsyslog.conf5 for additional information. - - - - - - 設定檔 - - - <filename>/etc</filename> 配置 - - 有數個目錄中儲存著設定資訊,這些目錄有: - - - - - - - - - /etc - 通用系統特定的設定資訊。 - - - - /etc/defaults - 系統設定檔的預設版本。 - - - - /etc/mail - sendmail8 額外的設定以及其他 MTA 設定檔。 - - - - /etc/ppp - user- 及 kernel-ppp 程式的設定。 - - - - /usr/local/etc - 已安裝應用程式的設定檔,可能會有以應用程式區分的子目錄。 - - - - /usr/local/etc/rc.d - 已安裝應用程式的 rc8 Script。 - - - - /var/db - 自動產生的系統特定資料庫檔案,例如套件資料庫以及 locate1 資料庫。 - - - - - - - - 主機名稱 - - hostname - DNS - - - <filename>/etc/resolv.conf</filename> - - - resolv.conf - - - FreeBSD 要如何存取網際網路網域名稱系統 (Internet Domain Name System, DNS) 是由 resolv.conf5 來控制。 - - /etc/resolv.conf 中最常用的項目為: - - - - - - - - - nameserver - 解析程式 (Resolver) 要查詢的名稱伺服器 IP 位置,這些伺服器會依所列的順序來查詢,最多可以有三個。 - - - - search - 主機名稱查詢使用的搜尋清單。這通常會使用本機主機名稱所在的網域。 - - - - domain - 本地網域名稱。 - - - - - - 典型的 /etc/resolv.conf 會如下: - - search example.com -nameserver 147.11.1.11 -nameserver 147.11.100.30 - - - searchdomain 選項應擇一使用。 - - - 當使用 DHCP 時,dhclient8 通常會使用從 DHCP 伺服器所接收到的資訊覆寫 /etc/resolv.conf - - - - <filename>/etc/hosts</filename> - - hosts - - /etc/hosts 是簡單的文字資料庫,會與 DNSNIS 一併使用來提供主機名稱與 IP 位址的對應。可將透過 LAN 所連結的在地電腦項目加入到這個檔案做最簡單的命名,來替代設定一個 named8 伺服器。除此之外 /etc/hosts 可以用來提供本地的網際網路名稱記錄,來減少常用名稱向外部 DNS 伺服器查詢的需求。 - - # $FreeBSD$ -# -# -# Host Database -# -# This file should contain the addresses and aliases for local hosts that -# share this file. Replace 'my.domain' below with the domainname of your -# machine. -# -# In the presence of the domain name service or NIS, this file may -# not be consulted at all; see /etc/nsswitch.conf for the resolution order. -# -# -::1 localhost localhost.my.domain -127.0.0.1 localhost localhost.my.domain -# -# Imaginary network. -#10.0.0.2 myname.my.domain myname -#10.0.0.3 myfriend.my.domain myfriend -# -# According to RFC 1918, you can use the following IP networks for -# private nets which will never be connected to the Internet: -# -# 10.0.0.0 - 10.255.255.255 -# 172.16.0.0 - 172.31.255.255 -# 192.168.0.0 - 192.168.255.255 -# -# In case you want to be able to connect to the Internet, you need -# real official assigned numbers. Do not try to invent your own network -# numbers but instead get one from your network provider (if any) or -# from your regional registry (ARIN, APNIC, LACNIC, RIPE NCC, or AfriNIC.) -# - - /etc/hosts 的格式如下: - - [Internet address] [official hostname] [alias1] [alias2] ... - - 例如: - - 10.0.0.1 myRealHostname.example.com myRealHostname foobar1 foobar2 - - 請參考 hosts5 取得更多資訊。 - - - - - - 使用 <citerefentry><refentrytitle>sysctl</refentrytitle><manvolnum>8</manvolnum></citerefentry> 調校 - - sysctl - - tuning - with sysctl - - - sysctl8 可用來更改執行中的 FreeBSD 系統,這包含許多 TCP/IP 堆疊及虛擬記憶體系統的進階選項,讓有經驗的系統管理者能夠簡單的提升效能。有超過五百個系統變數可以使用 sysctl8 來讀取與設定。 - - sysctl8 主要提供兩個功能:讀取與修改系統設定。 - - 檢視所有可讀取的變數: - - % sysctl -a - - 要讀取特定變數只要指定其名稱: - - % sysctl kern.maxproc -kern.maxproc: 1044 - - 要設定特定變數可使用 variable=value 語法: - - # sysctl kern.maxfiles=5000 -kern.maxfiles: 2088 -> 5000 - - sysctl 的設定值通常為字串、數字或布林值,其中布林值的 1 代表是,0 代表否。 - - 要在每次機器開機時自動設定一些變數可將其加入到 /etc/sysctl.conf。要取得更多的資訊請參考 sysctl.conf5 - - - <filename>sysctl.conf</filename> - - sysctl.conf - sysctl - - sysctl8 的設定檔於 /etc/sysctl.conf,內容很像 /etc/rc.conf,設定數值使用 variable=value 格式。指定的數值會在系統進入多使用者模式時設定,但並非所有變數皆可在此模式設定。 - - 例如,要關閉嚴重信號 (Fatal signal) 中止的記錄並避免使用者看到其他使用者所執行的程序,可加入以下設定到 /etc/sysctl.conf - - # Do not log fatal signal exits (e.g., sig 11) -kern.logsigexit=0 - -# Prevent users from seeing information about processes that -# are being run under another UID. -security.bsd.see_other_uids=0 - - - - - 唯讀 <citerefentry><refentrytitle>sysctl</refentrytitle><manvolnum>8</manvolnum></citerefentry> - - - - - Tom - Rhodes - - Contributed by - - - - - 在有些情況可能會需要修改唯讀的 sysctl8 數值,而這會需要重新啟動系統。 - - 例如,某些筆電型號的 cardbus4 裝置無法偵測到記憶體範圍而且會失效並有類似以下的錯誤: - - cbb0: Could not map register memory -device_probe_and_attach: cbb0 attach returned 12 - - 這個修正需要修改唯讀的 sysctl8 設定。加入 /boot/loader.conf 然後重新啟動。現在 cardbus4 應可正常運作。 - - - - - 調校磁碟 - - 接下來的章節會討論在磁碟裝置上各種可調校的機制與選項。在大多數案例中,有使用機械元件的硬碟,如 SCSI 磁碟機,會成為導致整體系統效能低下的瓶頸。雖然已經有不使用機械元件的磁碟機解決方案,如,固態硬碟,但使用機械元件的磁碟機短期內並不會消失。在調校磁碟時,建議可以利用 iostat8 指令的功能來測試各種對系統的變更,這個指令可讓使用者取得系統 IO 相關的有用資訊。 - - - Sysctl 變數 - - - <varname>vfs.vmiodirenable</varname> - - - vfs.vmiodirenable - - - The vfs.vmiodirenable sysctl8 - variable - may be set to either 0 (off) or - 1 (on). It is set to - 1 by default. This variable controls - how directories are cached by the system. Most directories - are small, using just a single fragment (typically 1 K) - in the file system and typically 512 bytes in the - buffer cache. With this variable turned off, the buffer - cache will only cache a fixed number of directories, even - if the system has a huge amount of memory. When turned on, - this sysctl8 allows the buffer cache to use the - VM page cache to cache the directories, - making all the memory available for caching directories. - However, the minimum in-core memory used to cache a - directory is the physical page size (typically 4 K) - rather than 512  bytes. Keeping this option enabled - is recommended if the system is running any services which - manipulate large numbers of files. Such services can - include web caches, large mail systems, and news systems. - Keeping this option on will generally not reduce - performance, even with the wasted memory, but one should - experiment to find out. - - - - <varname>vfs.write_behind</varname> - - - vfs.write_behind - - - The vfs.write_behind sysctl8 - variable - defaults to 1 (on). This tells the file - system to issue media writes as full clusters are collected, - which typically occurs when writing large sequential files. - This avoids saturating the buffer cache with dirty buffers - when it would not benefit I/O performance. However, this - may stall processes and under certain circumstances should - be turned off. - - - - <varname>vfs.hirunningspace</varname> - - - vfs.hirunningspace - - - The vfs.hirunningspace sysctl8 - variable determines how much outstanding write I/O may be - queued to disk controllers system-wide at any given - instance. The default is usually sufficient, but on - machines with many disks, try bumping it up to four or five - megabytes. Setting too high a value - which exceeds the buffer cache's write threshold can lead - to bad clustering performance. Do not set this value - arbitrarily high as higher write values may add latency to - reads occurring at the same time. - - There are various other buffer cache and - VM page cache related sysctl8 - values. Modifying these values is not recommended as the - VM system does a good job of - automatically tuning itself. - - - - <varname>vm.swap_idle_enabled</varname> - - - vm.swap_idle_enabled - - - The vm.swap_idle_enabled - sysctl8 variable is useful in large multi-user - systems with many active login users and lots of idle - processes. Such systems tend to generate continuous - pressure on free memory reserves. Turning this feature on - and tweaking the swapout hysteresis (in idle seconds) via - vm.swap_idle_threshold1 and - vm.swap_idle_threshold2 depresses the - priority of memory pages associated with idle processes more - quickly then the normal pageout algorithm. This gives a - helping hand to the pageout daemon. Only turn this option - on if needed, because the tradeoff is essentially pre-page - memory sooner rather than later which eats more swap and - disk bandwidth. In a small system this option will have a - determinable effect, but in a large system that is already - doing moderate paging, this option allows the - VM system to stage whole processes into - and out of memory easily. - - - - <varname>hw.ata.wc</varname> - - - hw.ata.wc - - - Turning off IDE write caching reduces - write bandwidth to IDE disks, but may - sometimes be necessary due to data consistency issues - introduced by hard drive vendors. The problem is that - some IDE drives lie about when a write - completes. With IDE write caching - turned on, IDE hard drives write data - to disk out of order and will sometimes delay writing some - blocks indefinitely when under heavy disk load. A crash or - power failure may cause serious file system corruption. - Check the default on the system by observing the - hw.ata.wc sysctl8 variable. If - IDE write caching is turned off, one can - set this read-only variable to - 1 in - /boot/loader.conf in order to enable - it at boot time. - - For more information, refer to ata4. - - - - <literal>SCSI_DELAY</literal> - (<varname>kern.cam.scsi_delay</varname>) - - - kern.cam.scsi_delay - - - 核心選項 SCSI DELAY - - The SCSI_DELAY kernel configuration - option may be used to reduce system boot times. The - defaults are fairly high and can be responsible for - 15 seconds of delay in the boot process. - Reducing it to 5 seconds usually works - with modern drives. The - kern.cam.scsi_delay boot time tunable - should be used. The tunable and kernel configuration - option accept values in terms of - milliseconds and - not - seconds. - - - - - 軟更新 - - Soft Updates - tunefs8 - - To fine-tune a file system, use tunefs8. This - program has many different options. To toggle Soft Updates - on and off, use: - - # tunefs -n enable /filesystem -# tunefs -n disable /filesystem - - A file system cannot be modified with tunefs8 while - it is mounted. A good time to enable Soft Updates is before - any partitions have been mounted, in single-user mode. - - Soft Updates is recommended for UFS - file systems as it drastically improves meta-data performance, - mainly file creation and deletion, through the use of a memory - cache. There are two downsides to Soft Updates to be aware - of. First, Soft Updates guarantee file system consistency - in the case of a crash, but could easily be several seconds - or even a minute behind updating the physical disk. If the - system crashes, unwritten data may be lost. Secondly, Soft - Updates delay the freeing of file system blocks. If the - root file system is almost full, performing a major update, - such as make installworld, can cause the - file system to run out of space and the update to fail. - - - 有關軟更新的更多詳細資訊 - - - Soft Updates - details - - - Meta-data updates are updates to non-content data like - inodes or directories. There are two traditional approaches - to writing a file system's meta-data back to disk. - - Historically, the default behavior was to write out - meta-data updates synchronously. If a directory changed, - the system waited until the change was actually written to - disk. The file data buffers (file contents) were passed - through the buffer cache and backed up to disk later on - asynchronously. The advantage of this implementation is - that it operates safely. If there is a failure during an - update, meta-data is always in a consistent state. A - file is either created completely or not at all. If the - data blocks of a file did not find their way out of the - buffer cache onto the disk by the time of the crash, - fsck8 recognizes this and repairs the file system - by setting the file length to 0. - Additionally, the implementation is clear and simple. The - disadvantage is that meta-data changes are slow. For - example, rm -r touches all the files in a - directory sequentially, but each directory change will be - written synchronously to the disk. This includes updates to - the directory itself, to the inode table, and possibly to - indirect blocks allocated by the file. Similar - considerations apply for unrolling large hierarchies using - tar -x. - - The second approach is to use asynchronous meta-data - updates. This is the default for a UFS - file system mounted with mount -o async. - Since all meta-data updates are also passed through the - buffer cache, they will be intermixed with the updates of - the file content data. The advantage of this - implementation is there is no need to wait until each - meta-data update has been written to disk, so all operations - which cause huge amounts of meta-data updates work much - faster than in the synchronous case. This implementation - is still clear and simple, so there is a low risk for bugs - creeping into the code. The disadvantage is that there is - no guarantee for a consistent state of the file system. - If there is a failure during an operation that updated - large amounts of meta-data, like a power failure or someone - pressing the reset button, the file system will be left - in an unpredictable state. There is no opportunity to - examine the state of the file system when the system comes - up again as the data blocks of a file could already have - been written to the disk while the updates of the inode - table or the associated directory were not. It is - impossible to implement a fsck8 which is able to - clean up the resulting chaos because the necessary - information is not available on the disk. If the file - system has been damaged beyond repair, the only choice - is to reformat it and restore from backup. - - The usual solution for this problem is to implement - dirty region logging, which is also - referred to as journaling. - Meta-data updates are still written synchronously, but only - into a small region of the disk. Later on, they are moved - to their proper location. Because the logging area is a - small, contiguous region on the disk, there are no long - distances for the disk heads to move, even during heavy - operations, so these operations are quicker than synchronous - updates. Additionally, the complexity of the implementation - is limited, so the risk of bugs being present is low. A - disadvantage is that all meta-data is written twice, once - into the logging region and once to the proper location, so - performance pessimization might result. On - the other hand, in case of a crash, all pending meta-data - operations can be either quickly rolled back or completed - from the logging area after the system comes up again, - resulting in a fast file system startup. - - Kirk McKusick, the developer of Berkeley - FFS, solved this problem with Soft - Updates. All pending meta-data updates are kept in memory - and written out to disk in a sorted sequence - (ordered meta-data updates). This has the - effect that, in case of heavy meta-data operations, later - updates to an item catch the earlier ones - which are still in memory and have not already been written - to disk. All operations are generally performed in memory - before the update is written to disk and the data blocks are - sorted according to their position so that they will not be - on the disk ahead of their meta-data. If the system - crashes, an implicit log rewind causes all - operations which were not written to the disk appear as if - they never happened. A consistent file system state is - maintained that appears to be the one of 30 to 60 seconds - earlier. The algorithm used guarantees that all resources - in use are marked as such in their blocks and inodes. - After a crash, the only resource allocation error that - occurs is that resources are marked as used - which are actually free. fsck8 - recognizes this situation, and frees the resources that - are no longer used. It is safe to ignore the dirty state - of the file system after a crash by forcibly mounting it - with mount -f. In order to free - resources that may be unused, fsck8 needs to be run - at a later time. This is the idea behind the - background fsck8: at system - startup time, only a snapshot of the - file system is recorded and fsck8 is run afterwards. - All file systems can then be mounted - dirty, so the system startup proceeds in - multi-user mode. Then, background fsck8 is - scheduled for all file systems where this is required, to - free resources that may be unused. File systems that do - not use Soft Updates still need the usual foreground - fsck8. - - The advantage is that meta-data operations are nearly - as fast as asynchronous updates and are faster than - logging, which has to write the - meta-data twice. The disadvantages are the complexity of - the code, a higher memory consumption, and some - idiosyncrasies. After a crash, the state of the file - system appears to be somewhat older. In - situations where the standard synchronous approach would - have caused some zero-length files to remain after the - fsck8, these files do not exist at all with Soft - Updates because neither the meta-data nor the file contents - have been written to disk. Disk space is not released until - the updates have been written to disk, which may take place - some time after running rm1. This may cause problems - when installing large amounts of data on a file system - that does not have enough free space to hold all the files - twice. - - - - - - 調校核心限制 - - - tuning - kernel limits - - - - 檔案/程序限制 - - - <varname>kern.maxfiles</varname> - - - kern.maxfiles - - - The kern.maxfiles sysctl8 - variable can be raised or lowered based upon system - requirements. This variable indicates the maximum number - of file descriptors on the system. When the file descriptor - table is full, file: table is full - will show up repeatedly in the system message buffer, which - can be viewed using dmesg8. - - Each open file, socket, or fifo uses one file - descriptor. A large-scale production server may easily - require many thousands of file descriptors, depending on the - kind and number of services running concurrently. - - In older FreeBSD releases, the default value of - kern.maxfiles is derived from - in the kernel configuration file. - kern.maxfiles grows proportionally to the - value of . When compiling a custom - kernel, consider setting this kernel configuration option - according to the use of the system. From this number, the - kernel is given most of its pre-defined limits. Even though - a production machine may not have 256 concurrent users, the - resources needed may be similar to a high-scale web - server. - - The read-only sysctl8 variable - kern.maxusers 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 kern.maxusers. Some systems require - larger or smaller values of - kern.maxusers and values of - 64, 128, and - 256 are not uncommon. Going above - 256 is not recommended unless a huge - number of file descriptors is needed. Many of the tunable - values set to their defaults by - kern.maxusers may be individually - overridden at boot-time or run-time in - /boot/loader.conf. Refer to - loader.conf5 and - /boot/defaults/loader.conf for more - details and some hints. - - In older releases, the system will auto-tune - maxusers if it is set to - 0. - The auto-tuning algorithm sets - maxusers equal to the amount of - memory in the system, with a minimum of - 32, and a maximum of - 384.. When - setting this option, set maxusers to - at least 4, especially if the system - runs Xorg or is used to - compile software. The most important table set by - maxusers is the maximum number of - processes, which is set to - 20 + 16 * maxusers. If - maxusers is set to 1, - there can only be - 36 simultaneous processes, including - the 18 or so that the system starts up - at boot time and the 15 or so used by - Xorg. Even a simple task like - reading a manual page will start up nine processes to - filter, decompress, and view it. Setting - maxusers to 64 allows - up to 1044 simultaneous processes, which - should be enough for nearly all uses. If, however, the - proc table full error is displayed - when trying to start another program, or a server is - running with a large number of simultaneous users, increase - the number and rebuild. - - - maxusers does - not limit the number of users which - can log into the machine. It instead sets various table - sizes to reasonable values considering the maximum number - of users on the system and how many processes each user - will be running. - - - - - <varname>kern.ipc.soacceptqueue</varname> - - - kern.ipc.soacceptqueue - - - The kern.ipc.soacceptqueue - sysctl8 variable limits the size of the listen queue - for accepting new TCP connections. The - default value of 128 is typically too low - for robust handling of new connections on a heavily loaded - web server. For such environments, it is recommended to - increase this value to 1024 or higher. A - service such as sendmail8, or - Apache may itself limit the - listen queue size, but will often have a directive in its - configuration file to adjust the queue size. Large listen - queues do a better job of avoiding Denial of Service - (DoS) attacks. - - - - - 網路限制 - - The NMBCLUSTERS kernel configuration - option dictates the amount of network Mbufs available to the - system. A heavily-trafficked server with a low number of - Mbufs will hinder performance. Each cluster represents - approximately 2 K of memory, so a value of - 1024 represents 2 - megabytes of kernel memory reserved for network buffers. A - simple calculation can be done to figure out how many are - needed. A web server which maxes out at - 1000 simultaneous connections where each - connection uses a 6 K receive and 16 K send buffer, - requires approximately 32 MB worth of network buffers - to cover the web server. A good rule of thumb is to multiply - by 2, so - 2x32 MB / 2 KB = - 64 MB / 2 kB = - 32768. Values between - 4096 and 32768 are - recommended for machines with greater amounts of memory. - Never specify an arbitrarily high value for this parameter - as it could lead to a boot time crash. To observe network - cluster usage, use with - netstat1. - - The kern.ipc.nmbclusters loader tunable - should be used to tune this at boot time. Only older versions - of FreeBSD will require the use of the - NMBCLUSTERS kernel config8 - option. - - For busy servers that make extensive use of the - sendfile2 system call, it may be necessary to increase - the number of sendfile2 buffers via the - NSFBUFS kernel configuration option or by - setting its value in /boot/loader.conf - (see loader8 for details). A common indicator that - this parameter needs to be adjusted is when processes are seen - in the sfbufa state. The sysctl8 - variable kern.ipc.nsfbufs is read-only. - This parameter nominally scales with - kern.maxusers, however it may be necessary - to tune accordingly. - - - Even though a socket has been marked as non-blocking, - calling sendfile2 on the non-blocking socket may - result in the sendfile2 call blocking until enough - struct sf_buf's are made - available. - - - - <varname>net.inet.ip.portrange.*</varname> - - - net.inet.ip.portrange.* - - - The net.inet.ip.portrange.* - sysctl8 variables control the port number ranges - automatically bound to TCP and - UDP sockets. There are three ranges: a - low range, a default range, and a high range. Most network - programs use the default range which is controlled by - net.inet.ip.portrange.first and - net.inet.ip.portrange.last, which default - to 1024 and 5000, - respectively. Bound port ranges are used for outgoing - connections and it is possible to run the system out of - ports under certain circumstances. This most commonly - occurs when running a heavily loaded web proxy. The port - range is not an issue when running a server which handles - mainly incoming connections, such as a web server, or has - a limited number of outgoing connections, such as a mail - relay. For situations where there is a shortage of ports, - it is recommended to increase - net.inet.ip.portrange.last modestly. A - value of 10000, 20000 - or 30000 may be reasonable. Consider - firewall effects when changing the port range. Some - firewalls may block large ranges of ports, usually - low-numbered ports, and expect systems to use higher ranges - of ports for outgoing connections. For this reason, it - is not recommended that the value of - net.inet.ip.portrange.first be - lowered. - - - - <literal>TCP</literal> 頻寬延遲乘積 - - - TCP Bandwidth Delay Product - Limiting - net.inet.tcp.inflight.enable - - - TCP bandwidth delay product limiting - can be enabled by setting the - net.inet.tcp.inflight.enable - sysctl8 variable to 1. This - instructs the system to attempt to calculate the bandwidth - delay product for each connection and limit the amount of - data queued to the network to just the amount required to - maintain optimum throughput. - - This feature is useful when serving data over modems, - Gigabit Ethernet, high speed WAN links, - or any other link with a high bandwidth delay product, - especially when also using window scaling or when a large - send window has been configured. When enabling this option, - also set net.inet.tcp.inflight.debug to - 0 to disable debugging. For production - use, setting net.inet.tcp.inflight.min - to at least 6144 may be beneficial. - Setting high minimums may effectively disable bandwidth - limiting, depending on the link. The limiting feature - reduces the amount of data built up in intermediate route - and switch packet queues and reduces the amount of data - built up in the local host's interface queue. With fewer - queued packets, interactive connections, especially over - slow modems, will operate with lower - Round Trip Times. This feature only - effects server side data transmission such as uploading. - It has no effect on data reception or downloading. - - Adjusting net.inet.tcp.inflight.stab - is not recommended. This parameter - defaults to 20, representing 2 maximal - packets added to the bandwidth delay product window - calculation. The additional window is required to stabilize - the algorithm and improve responsiveness to changing - conditions, but it can also result in higher ping8 - times over slow links, though still much lower than without - the inflight algorithm. In such cases, try reducing this - parameter to 15, 10, - or 5 and reducing - net.inet.tcp.inflight.min to a value such - as 3500 to get the desired effect. - Reducing these parameters should be done as a last resort - only. - - - - - 虛擬記憶體 - - - <varname>kern.maxvnodes</varname> - - A vnode is the internal representation of a file or - directory. Increasing the number of vnodes available to - the operating system reduces disk I/O. Normally, this is - handled by the operating system and does not need to be - changed. In some cases where disk I/O is a bottleneck and - the system is running out of vnodes, this setting needs - to be increased. The amount of inactive and free - RAM will need to be taken into - account. - - To see the current number of vnodes in use: - - # sysctl vfs.numvnodes -vfs.numvnodes: 91349 - - To see the maximum vnodes: - - # sysctl kern.maxvnodes -kern.maxvnodes: 100000 - - If the current vnode usage is near the maximum, try - increasing kern.maxvnodes by a value of - 1000. Keep an eye on the number of - vfs.numvnodes. If it climbs up to the - maximum again, kern.maxvnodes will need - to be increased further. Otherwise, a shift in memory - usage as reported by top1 should be visible and - more memory should be active. - - - - - - 增加交換空間 - - 有時系統會需要更多的交換 (Swap) 空間,本章節會介紹兩種增加交換空間的方式:一種是在既有的分割區或新的硬碟增加交換空間,另一種則是在既有的分割區中建立一個交換檔。 - - 要取得更多有關如何加密交換空間的資訊、有那些可用的選項以及為何要做加密,可參考 - - - 使用新硬碟或既有分割區增加交換空間 - - 在新的磁碟上增加交換空間比起使用既有硬碟上的分割區會有較佳的效率。設定分割區與硬碟在 中有說明,另外 會討論到分割區的配置與交換分割區大小需考量的事項。 - - 使用 swapon 來增加交換分割區到系統,例: - - # swapon /dev/ada1s1b - - - 可以使用任何尚未掛載過、甚至已經有內含資料的分割區做為交換空間,但在含有資料的分割區上使用 swapon 會覆寫並清除該分割區上所有的資料,請在執行 swapon 之前確認真的要使用該分割區增加交換空間。 - - - 要在開機時自動加入此交換分割區,可加入以下項目到 /etc/fstab - - /dev/ada1s1b none swap sw 0 0 - - 請參考 fstab5 來取得在 /etc/fstab 中項目的說明。更多有關 swapon 的資訊 可以在 swapon8 找到。 - - - - 建立交換檔 - - 以下例子會建立一個 64M 的交換檔於 /usr/swap0 來替代使用分割區建立交換空間。 - - 使用交換檔開啟交換空間前需要在核心編譯或載入 md4 所需的模組,請參考 了解有關編譯自訂核心的資訊。 - - - 建立交換檔於 FreeBSD 10.<replaceable>X</replaceable> 及以後版本 - - - - 建立交換檔: - - # dd if=/dev/zero of=/usr/swap0 bs=1m count=64 - - - - 在新檔案設定適當的權限: - - # chmod 0600 /usr/swap0 - - - - 加入行到 /etc/fstab 以讓系統知道交換檔的資訊: - - md99 none swap sw,file=/usr/swap0,late 0 0 - - 已使用 md4 裝置的 md99,保留較低的裝置編號供互動操作時使用。 - - - - 交換空間會於系統啟動時增加。若要立即增加交換空間,請參考 swapon8 - - # swapon -aL - - - - - - 建立交換檔於 FreeBSD 9.<replaceable>X</replaceable> 及先前版本 - - - - 建立交換檔 /usr/swap0 - - # dd if=/dev/zero of=/usr/swap0 bs=1m count=64 - - - - 設定適當的權限於 /usr/swap0 - - # chmod 0600 /usr/swap0 - - - - /etc/rc.conf 開啟交換檔: - - swapfile="/usr/swap0" # Set to name of swap file - - - - 交換空間會於系統啟動時增加。若要立即增加交換空間,可指定一個未使用的記憶體裝置。請參考 取得更多有關記憶體裝置的資訊。 - - # mdconfig -a -t vnode -f /usr/swap0 -u 0 && swapon /dev/md0 - - - - - - - - - 電源與資源管理 - - - - - Hiten - Pandya - - Written by - - - - - Tom - Rhodes - - - - - - 以有效率的方式運用硬體資源是很重要的,電源與資源管理讓作業系統可以監控系統的限制,並且在系統溫度意外升高時能夠發出警報。早期提供電源管理的規範是進階電源管理 (Advanced Power Management, APM),APM 可根據系統的使用狀況來來控制電源用量。然而,使用 APM 要作業系統來管理系統的電源用量和溫度屬性是困難且沒有彈性的,因為硬體是由 BIOS 所管理,使用者對電源管理設定只有有限的設定性與可見性,且 APM BIOS 是由供應商提供且特定於某些硬體平台,而作業系統中必透過 APM 驅動程式做為中介存取 APM 軟體介面才能夠管理電源等級。 - - APM 有四個主要的問題。第一,電源管理是由供應商特定的 BIOS 來完成,與作業系統是分開的。例如,使用者可在 APM BIOS 設定硬碟的閒置時間值,在超過時間時 BIOS 可在未徵得作業系統的同意下降低硬碟的轉速。第二,APM 的邏輯是內嵌在 BIOS 當中的,並且在作業系統範圍之外運作,這代表使用者只能夠透過燒錄新的韌體到 ROM 來修正 APM BIOS 中的問題,而這樣的程序是危險的,若失敗,可能會讓系統進入無法復原的狀態。第三,APM 是供應商特定的技術,這代表有許多重複的工作,在一個供應商的 BIOS 找到的問題在其他的供應商卻沒有解決。最後一點,APM BIOS 並沒有足夠的空間來實作複雜的電源管理政策或可良好適應主機用途的程式。 - - Plug and Play BIOS (PNPBIOS) 在很多情況下並不可靠,PNPBIOS 是 16 位元的技術,所以作業系統必須模擬 16 位元才能存取 PNPBIOS。FreeBSD 提供了一個 APM 驅動程式來做 APM,應可用在 2000 年之前所製造的系統,該驅動程式的說明於 apm4 - - - ACPI - - - - APM - - - APM 的後繼者是進階設置與電源介面 (Advanced Configuration and Power Interface, ACPI)。ACPI 是一套由供應商聯盟所搛寫出的標準,提供了硬體資源與電源管理的介面,它是 作業系統直接設置與電源管理 (Operating System-directed configuration and Power Management) 關鍵的要素,提供了作業系統更多的控制方式與彈性。 - - 本章節將示範如何在 FreeBSD 設定 ACPI,然後提供一些如何對 ACPI 除錯的提示以及如何提交包含除錯資訊的問題回報,讓開發人員能夠診斷並修正 ACPI 的問題。 - - - 設定 <acronym>ACPI</acronym> - - 在 FreeBSD acpi4 驅動程式預設會在系統開始時載入,且應被編譯到核心當中。這個驅動程式在開機之後無法被卸載,因為系統匯流排會使用它做各種硬體互動。雖然如此,若系統遇到問題,ACPI 還是可以被關閉,在 /boot/loader.conf 中設定 hint.acpi.0.disabled="1" 之後重新開機或在載入程式提示時設定這個變數,如 中的說明。 - - - ACPIAPM 不能同時存在且應分開使用,若有偵測到有另一個正在執行,要載入的後者將會中斷。 - - - ACPI 可以用來讓系統進入睡眠模式,使用 acpiconf 旗標再加上由 15 的數字。大多數使用者只需使用 1 (快速待命到 RAM) 或 3 (待命到 RAM),選項 5 會執行軟關機 (Soft-off),如同執行 halt -p 一樣。 - - 其他的選項可使用 sysctl 來設定,請參考 acpi4 以及 acpiconf8 以取得更多資訊。 - - - - 常見問題 - - - ACPI - - - ACPI is present in all modern computers - that conform to the ia32 (x86), ia64 (Itanium), and amd64 - (AMD) architectures. The full standard has - many features including CPU performance - management, power planes control, thermal zones, various - battery systems, embedded controllers, and bus enumeration. - Most systems implement less than the full standard. For - instance, a desktop system usually only implements bus - enumeration while a laptop might have cooling and battery - management support as well. Laptops also have suspend and - resume, with their own associated complexity. - - An ACPI-compliant system has various - components. The BIOS and chipset vendors - provide various fixed tables, such as FADT, - in memory that specify things like the APIC - map (used for SMP), config registers, and - simple configuration values. Additionally, a bytecode table, - the Differentiated System Description Table - DSDT, specifies a tree-like name space of - devices and methods. - - The ACPI driver must parse the fixed - tables, implement an interpreter for the bytecode, and modify - device drivers and the kernel to accept information from the - ACPI subsystem. For FreeBSD, Intel has - provided an interpreter (ACPI-CA) that is - shared with Linux and NetBSD. The path to the - ACPI-CA source code is - src/sys/contrib/dev/acpica. The glue - code that allows ACPI-CA to work on FreeBSD is - in src/sys/dev/acpica/Osd. Finally, - drivers that implement various ACPI devices - are found in src/sys/dev/acpica. - - - ACPI - problems - - - For ACPI to work correctly, all the - parts have to work correctly. Here are some common problems, - in order of frequency of appearance, and some possible - workarounds or fixes. If a fix does not resolve the issue, - refer to for instructions - on how to submit a bug report. - - - 滑鼠問題 - - In some cases, resuming from a suspend operation will - cause the mouse to fail. A known work around is to add - hint.psm.0.flags="0x3000" to - /boot/loader.conf. - - - - 待機/喚醒 - - ACPI has three suspend to - RAM (STR) states, - S1-S3, and one suspend - to disk state (STD), called - S4. STD can be - implemented in two separate ways. The - S4BIOS is a - BIOS-assisted suspend to disk and - S4OS is implemented - entirely by the operating system. The normal state the - system is in when plugged in but not powered up is - soft off (S5). - - Use sysctl hw.acpi to check for the - suspend-related items. These example results are from a - Thinkpad: - - hw.acpi.supported_sleep_state: S3 S4 S5 -hw.acpi.s4bios: 0 - - Use acpiconf -s to test - S3, S4, and - S5. An of one - (1) indicates - S4BIOS support instead - of S4 operating system support. - - When testing suspend/resume, start with - S1, if supported. This state is most - likely to work since it does not require much driver - support. No one has implemented S2, - which is similar to S1. Next, try - S3. This is the deepest - STR state and requires a lot of driver - support to properly reinitialize the hardware. - - A common problem with suspend/resume is that many device - drivers do not save, restore, or reinitialize their - firmware, registers, or device memory properly. As a first - attempt at debugging the problem, try: - - # sysctl debug.bootverbose=1 -# sysctl debug.acpi.suspend_bounce=1 -# acpiconf -s 3 - - This test emulates the suspend/resume cycle of all - device drivers without actually going into - S3 state. In some cases, problems such - as losing firmware state, device watchdog time out, and - retrying forever, can be captured with this method. Note - that the system will not really enter S3 - state, which means devices may not lose power, and many - will work fine even if suspend/resume methods are totally - missing, unlike real S3 state. - - Harder cases require additional hardware, such as a - serial port and cable for debugging through a serial - console, a Firewire port and cable for using dcons4, - and kernel debugging skills. - - To help isolate the problem, unload as many drivers as - possible. If it works, narrow down which driver is the - problem by loading drivers until it fails again. Typically, - binary drivers like nvidia.ko, display - drivers, and USB will have the most - problems while Ethernet interfaces usually work fine. If - drivers can be properly loaded and unloaded, automate this - by putting the appropriate commands in - /etc/rc.suspend and - /etc/rc.resume. Try setting - to 1 - if the display is messed up after resume. Try setting - longer or shorter values for - to see if that - helps. - - Try loading a recent Linux distribution to see if - suspend/resume works on the same hardware. If it works on - Linux, it is likely a FreeBSD driver problem. Narrowing down - which driver causes the problem will assist developers in - fixing the problem. Since the ACPI - maintainers rarely maintain other drivers, such as sound - or ATA, any driver problems should also - be posted to the freebsd-current list and mailed to the - driver maintainer. Advanced users can include debugging - printf3s in a problematic driver to track down where - in its resume function it hangs. - - Finally, try disabling ACPI and - enabling APM instead. If suspend/resume - works with APM, stick with - APM, especially on older hardware - (pre-2000). It took vendors a while to get - ACPI support correct and older hardware - is more likely to have BIOS problems with - ACPI. - - - - 系統無回應 - - Most system hangs are a result of lost interrupts or an - interrupt storm. Chipsets may have problems based on boot, - how the BIOS configures interrupts before - correctness of the APIC - (MADT) table, and routing of the System - Control Interrupt (SCI). - - - interrupt storms - - - Interrupt storms can be distinguished from lost - interrupts by checking the output of - vmstat -i and looking at the line that - has acpi0. If the counter is increasing - at more than a couple per second, there is an interrupt - storm. If the system appears hung, try breaking to - DDB ( - CTRL - ALT - ESC - on console) and type - show interrupts. - - - APIC - disabling - - - When dealing with interrupt problems, try disabling - APIC support with - hint.apic.0.disabled="1" in - /boot/loader.conf. - - - - 當機 - - Panics are relatively rare for ACPI - and are the top priority to be fixed. The first step is to - isolate the steps to reproduce the panic, if possible, and - get a backtrace. Follow the advice for enabling - options DDB and setting up a serial - console in or setting - up a dump partition. To get a backtrace in - DDB, use tr. When - handwriting the backtrace, get at least the last five and - the top five lines in the trace. - - Then, try to isolate the problem by booting with - ACPI disabled. If that works, isolate - the ACPI subsystem by using various - values of . See - acpi4 for some examples. - - - - 系統在待機或關機後仍開機 - - First, try setting - hw.acpi.disable_on_poweroff="0" in - /boot/loader.conf. This keeps - ACPI from disabling various events during - the shutdown process. Some systems need this value set to - 1 (the default) for the same reason. - This usually fixes the problem of a system powering up - spontaneously after a suspend or poweroff. - - - - BIOS 含有有問題的 Bytecode - - - ACPI - ASL - - - Some BIOS vendors provide incorrect - or buggy bytecode. This is usually manifested by kernel - console messages like this: - - ACPI-1287: *** Error: Method execution failed [\\_SB_.PCI0.LPC0.FIGD._STA] \\ -(Node 0xc3f6d160), AE_NOT_FOUND - - Often, these problems may be resolved by updating the - BIOS to the latest revision. Most - console messages are harmless, but if there are other - problems, like the battery status is not working, these - messages are a good place to start looking for - problems. - - - - - 覆蓋預設的 <acronym>AML</acronym> - - The BIOS bytecode, known as - ACPI Machine Language - (AML), is compiled from a source language - called ACPI Source Language - (ASL). The AML is - found in the table known as the Differentiated System - Description Table (DSDT). - - ACPI - ASL - - - The goal of FreeBSD is for everyone to have working - ACPI without any user intervention. - Workarounds are still being developed for common mistakes made - by BIOS vendors. The Microsoft - interpreter (acpi.sys and - acpiec.sys) does not strictly check for - adherence to the standard, and thus many - BIOS vendors who only test - ACPI under Windows never fix their - ASL. FreeBSD developers continue to identify - and document which non-standard behavior is allowed by - Microsoft's interpreter and replicate it so that FreeBSD can - work without forcing users to fix the - ASL. - - To help identify buggy behavior and possibly fix it - manually, a copy can be made of the system's - ASL. To copy the system's - ASL to a specified file name, use - acpidump with , to show - the contents of the fixed tables, and , to - disassemble the AML: - - # acpidump -td > my.asl - - Some AML versions assume the user is - running Windows. To override this, set - hw.acpi.osname="Windows - 2009" in - /boot/loader.conf, using the most recent - Windows version listed in the ASL. - - Other workarounds may require my.asl - to be customized. If this file is edited, compile the new - ASL using the following command. Warnings - can usually be ignored, but errors are bugs that will usually - prevent ACPI from working correctly. - - # iasl -f my.asl - - Including forces creation of the - AML, even if there are errors during - compilation. Some errors, such as missing return statements, - are automatically worked around by the FreeBSD - interpreter. - - The default output filename for iasl is - DSDT.aml. Load this file instead of the - BIOS's buggy copy, which is still present - in flash memory, by editing - /boot/loader.conf as follows: - - acpi_dsdt_load="YES" -acpi_dsdt_name="/boot/DSDT.aml" - - Be sure to copy DSDT.aml to - /boot, then reboot the system. If this - fixes the problem, send a diff1 of the old and new - ASL to freebsd-acpi so that developers can - work around the buggy behavior in - acpica. - - - - - 取得與回報除錯資訊 - - - - - Nate - Lawson - - Written by - - - - - - - Peter - Schultz - - With contributions from - - - - - Tom - Rhodes - - - - - - - ACPI - problems - - - - ACPI - debugging - - - The ACPI driver has a flexible - debugging facility. A set of subsystems and the level of - verbosity can be specified. The subsystems to debug are - specified as layers and are broken down into components - (ACPI_ALL_COMPONENTS) and - ACPI hardware support - (ACPI_ALL_DRIVERS). The verbosity of - debugging output is specified as the level and ranges from - just report errors (ACPI_LV_ERROR) to - everything (ACPI_LV_VERBOSE). The level is - a bitmask so multiple options can be set at once, separated by - spaces. In practice, a serial console should be used to log - the output so it is not lost as the console message buffer - flushes. A full list of the individual layers and levels is - found in acpi4. - - Debugging output is not enabled by default. To enable it, - add options ACPI_DEBUG to the custom kernel - configuration file if ACPI is compiled into - the kernel. Add ACPI_DEBUG=1 to - /etc/make.conf to enable it globally. If - a module is used instead of a custom kernel, recompile just - the acpi.ko module as follows: - - # cd /sys/modules/acpi/acpi && make clean && make ACPI_DEBUG=1 - - Copy the compiled acpi.ko to - /boot/kernel and add the desired level - and layer to /boot/loader.conf. The - entries in this example enable debug messages for all - ACPI components and hardware drivers and - output error messages at the least verbose level: - - debug.acpi.layer="ACPI_ALL_COMPONENTS ACPI_ALL_DRIVERS" -debug.acpi.level="ACPI_LV_ERROR" - - If the required information is triggered by a specific - event, such as a suspend and then resume, do not modify - /boot/loader.conf. Instead, use - sysctl to specify the layer and level after - booting and preparing the system for the specific event. The - variables which can be set using sysctl are - named the same as the tunables in - /boot/loader.conf. - - - ACPI - problems - - - Once the debugging information is gathered, it can be sent - to freebsd-acpi so that it can be used by the FreeBSD - ACPI maintainers to identify the root cause - of the problem and to develop a solution. - - - Before submitting debugging information to this mailing - list, ensure the latest BIOS version is - installed and, if available, the embedded controller - firmware version. - - - When submitting a problem report, include the following - information: - - - - Description of the buggy behavior, including system - type, model, and anything that causes the bug to appear. - Note as accurately as possible when the bug began - occurring if it is new. - - - - The output of dmesg after running - boot -v, including any error messages - generated by the bug. - - - - The dmesg output from boot - -v with ACPI disabled, - if disabling ACPI helps to fix the - problem. - - - - Output from sysctl hw.acpi. This - lists which features the system offers. - - - - The URL to a pasted version of the - system's ASL. Do - not send the ASL - directly to the list as it can be very large. Generate a - copy of the ASL by running this - command: - - # acpidump -dt > name-system.asl - - Substitute the login name for - name and manufacturer/model for - system. For example, use - njl-FooCo6000.asl. - - - - Most FreeBSD developers watch the FreeBSD-CURRENT mailing list, but one should - submit problems to freebsd-acpi to be sure it is seen. Be - patient when waiting for a response. If the bug is not - immediately apparent, submit a bug report. - When entering a PR, - include the same information as requested above. This helps - developers to track the problem and resolve it. Do not send a - PR without emailing freebsd-acpi first as - it is likely that the problem has been reported before. - - - - 參考文獻 - - More information about ACPI may be - found in the following locations: - - - - The FreeBSD ACPI Mailing List Archives - (https://lists.freebsd.org/pipermail/freebsd-acpi/) - - - - The ACPI 2.0 Specification (http://acpi.info/spec.htm) - - - - acpi4, acpi_thermal4, acpidump8, - iasl8, and acpidb8 - - - - - - - - - - - - FreeBSD 開機程序 - - - 概述 - - booting - bootstrap - - 從開啟電腦到載入作業系統的這段流程稱為 開機程序 (Bootstrap process) 或 開機 (Booting)。FreeBSD 的開機程序提供大量的客製化彈性,包含可選擇安裝在同電腦的其他的作業系統、不同版本的作業系統或不同核心的作業系統的功能。 - - 本章會詳細說明可以設定的選項。示範如何自訂 FreeBSD 開機流程,包含其中所有會發生的事,直到啟動 FreeBSD 核心、偵測裝置及啟動 init8。這些事會發生在開機訊息的文字顏色會從亮白變成灰色之間。 - - 在閱讀本章之後,您會了解: - - - - FreeBSD 開機系統的元件以及它們如何互動。 - - - - FreeBSD 開機程式中各元件可使用的選項,用來控制開機程序。 - - - - 如何設定自訂的開機啟動畫面 (Splash screen)。 - - - - 設定 Device Hints 的基礎。 - - - - 如何開機進入單人及多人模式以及如何正確關閉 FreeBSD 系統。 - - - - - 本章僅說明 FreeBSD 在 x86 及 amd64 系統上執行的開機流程。 - - - - - FreeBSD 開機程序 - - 打開電腦並啟動作業系統的這個動作呈現了一個有趣的困境。照道理,電腦在啟動作業系統之前並不知道要如何做任何事情,這些事情之中包括從磁碟執行程式。如果電腦無法在沒有作業系統的情況下執行程式,而作業系統的程式本身又在磁碟上,那麼作業系統要如何啟動呢? - - 這個問題如同 The Adventures of Baron Munchausen 一書中的一個角色掉進了洞裡,他抓住了靴子上的拔靴帶 (Bootstrap) 才把自己拉了出來,因此在早期電腦領域用 bootstrap 一詞來指載入作業系統的機制,後來被縮短為 booting - - BIOS - - Basic Input/Output - SystemBIOS - - 在 x86 硬體上,基本輸入/輸出系統 (Basic Input/Output System, BIOS) 負責載入作業系統。 BIOS 會找到硬碟上的主開機記錄區 (Master Boot Record, MBR),該記錄區必須位於磁碟上的特定位置。BIOS 有足夠的知識可以載入並執行這個 MBR,並且假設這個 MBRBIOS 的協助下可以完成接下來載入作業系統的工作。 - - - FreeBSD 在較舊的 MBR 標準與較新的 GUID 分割區表 (GUID Partition Table, GPT) 上都能夠開機 (Booting)。GPT 磁碟分割通常會在有支援統一可延伸韌體介面 (Unified Extensible Firmware Interface, UEFI) 的電腦上找到。不論如何,FreeBSD 即使在只有傳統 BIOS 的機器上,也可以使用 gptboot8GPT 分割區開機。直接使用 UEFI 開機的開發工作正在進行中。 - - - Master Boot Record - (MBR) - - Boot Manager - - Boot Loader - - MBR 中的程式通常會稱作開機管理程式 (Boot manager),特別是那些會與使用者互動的程式。開機管理程式通常會另一部份的程式會存放於磁碟的第一個磁軌或檔案系統。開機管理程式的例子有標準 FreeBSD 開機管理程式 boot0 又稱 Boot Easy 以及 Grub 常用於各種 Linux 發行版。 - - 若只有安裝一個作業系統,MBR 會搜尋磁碟上第一個可開機的 (使用中) 切割區 (Slice),然後執行在該切割區上的程式來載入剩下的作業系統。當有多個作業系統存在時,可以安裝可顯示作業系統清單的開機管理程式,以讓使用者可以選擇要啟動的作業系統。 - - 剩餘的 FreeBSD 開機系統分成三個階段,第一個階段只知道如何讓電腦進入特定狀態並執行第二階段,第二個階段在執行第三階段之前會做的事比較多一點,第三個階段會完成載入作業系統的工作。把工作分成三個階段的原因是 MBR 有限制在階段一與階段二能夠執行程式的大小。將這些工作連結在一起讓 FreeBSD 能夠提供更有彈性的載入程式。 - - kernel - init8 - - 核心會接著開始偵測裝置並初始化這些裝置供使用。核心開機程序完成之後,核心便會傳送控制權給使用者程序 init8,這個程序會確保磁碟在可以使用的狀態,然後啟動使用者層級的資源設置來掛載檔案系統、設定網路卡以能夠連線網路、啟動那些被設定在開機時要啟動的程序。 - - 本章節將更詳細介紹這些階段並示範如何與 FreeBSD 開機程序互動。 - - - 開機管理程式 - - Boot Manager - - Master Boot Record - (MBR) - - 有時會稱在 MBR 中的開機管理程式為開機程序的 第零階段 (Stage zero),FreeBSD 預設會使用 boot0 開機管理程式。 - - 由 FreeBSD 安裝程式所安裝的 MBR 便是以 /boot/boot0 為基礎。boot0 的大小與容量被限制在 446 個位元組是由於切割表與 0x55AA 識別碼位於 MBR 的最末端。若安裝多個作業系統使用 boot0 ,則會在開機時顯示如下範例的訊息: - - - <filename>boot0</filename> 螢幕截圖 - - F1 Win -F2 FreeBSD - -Default: F2 - - - 其作他作業統若在 FreeBSD 之後才安裝則會覆蓋現有的 MBR,若這件事發生了,或者要使用 FreeBSD MBR 取代現有的 MBR 可使用以下指令: - - # fdisk -B -b /boot/boot0 device - - 其中 device 開機磁碟,例如第一個 IDE 磁碟為 ad0,第二個 IDE 控制器的第一個 IDE磁碟為 ad2,第一個 SCSI 磁碟為 da0。要建立自訂的 MBR 設定請參考 boot0cfg8 - - - - 階段一與階段二 - - 概念上,第一與第二個階段均為磁碟上同一個區域上同一個程式的一部份,由於空間上的限制,它們被分成兩部份,但是會一併安裝。它們會由 FreeBSD 安裝程式或 bsdlabel/boot/boot 複製而來。 - - 這兩個階段均位於檔案系統之外,在開機切割區的第一個磁軌,從第一個磁碟扇區 (Sector) 開始,這個位置便是 boot0 或其他開機管理程式所會儲存的地方,並會尋找可以執行的程式以繼續開機程序。 - - 第一個階段的 boot1 非常的簡單,因為它只能有 512 位元組的大小。它只能認得儲存切割區資訊的 FreeBSD bsdlabel 以及尋找並執行 boot2 - - 階段二 boot2 稍微複雜一點,能夠理解 FreeBSD 檔案系統來搜尋檔案。它可以提供一個簡單的介面來選擇要執行的核心或載入程式。它所執行的載入程式 (loader) 更複雜並能讀取開機設定檔。若開機程序在階段二中斷,則會顯示以下的互動畫面: - - - <filename>boot2</filename> 螢幕截圖 - - >> FreeBSD/i386 BOOT -Default: 0:ad(0,a)/boot/loader -boot: - - - 要更換已安裝的 boot1boot2 可使用 bsdlabel,其中 diskslice 是要開機的磁碟與切割區,例如 ad0s1 代表第一個 IDE 磁碟的第一個切割區: - - # bsdlabel -B diskslice - - - 若只使用磁碟名稱,如 ad0bsdlabel 便會以 危險專用的模式 來建立磁碟,而不會建立任何分割區。這個可能與預期的動作不同,所以在按下 Return 鍵之前請再次確認 diskslice - - - - - 階段三 - - boot-loader - - loader 是三階段開機程多的最後一個階段,載入程式位於檔案系統之中,通常在 /boot/loader - - loader 主要目地是利用擁有更複雜指令集的強大直譯器做為基礎的內建指令集提供一個互動的方式來做設定。 - - 在初始化的過程中,loader 會偵測 Console 與磁碟,並找出可以用來開機的磁碟。在由 Script 或互動輸入使用者指令的地方會設定相對的變數並啟動直譯器。 - - loader - loader configuration - - loader 接著會讀取 /boot/loader.rc,這個程式預設又會讀取 /boot/defaults/loader.conf 來設定合理的變數預設值以及讀取 /boot/loader.conf 來對這些變數做本地的更改。loader.rc 接著會依這些變數來運作,讀取選擇模組與核心。 - - 最後,預設情況下 loader 會待候鍵盤輸入 10 秒鐘,若沒有被中斷的話會接著啟動核心。若被使用者中斷,則會向使用者顯示提示字元,此時使用可以使用指令集來調整變數、卸載所有模組、載入模組,然後最後開機或重新開機。 中列出了最常使用的 loader 指令。要完整了解所有可用的指令,請參考 loader8 - - - 載入程式內建指令 - - - - - 變數 - 說明 - - - - - - autoboot - seconds - 若在指定時間 (秒) 內沒有中斷,會繼續啟動核心。此指令會顯示倒數,預設的時間為 10 秒鐘。 - - - - boot - -options - kernelname - 使用任何指定的選項或核心名稱立即啟動核心,要由指令列指定核心名稱必須先執行 unload,否則會使用先前載入過的核心。若 kernelname 不是完整的路徑則會搜尋 /boot/kernel/boot/modules 底下。 - - - - boot-conf - 依據指定的變數及最常用的 kernel 再做一次相同的自動模組設置。這只有在執行 unload 之後,尚未變更變數之前方可使用。 - - - - help - topic - 顯示自 /boot/loader.help 取得的說明訊息。若指定的主題為 index 則會顯示所有可用的主題。 - - - - include filename - … - 讀取指定的檔案並直譯每一行。若有錯誤則會立即中止 include - - - - load -t - type - filename - 由指定的檔案名稱載入核心、核心模組或指定類型的檔案。任何於 filename 之後的參數都會被傳遞到該檔案。若 filename 不是絕對位置則會搜尋 /boot/kernel/boot/modules 底下。 - - - - ls -l - path - 顯示指定路徑中的檔案,若未指定路徑則會顯示根目錄中的檔案。若有指定 ,則會連檔案大小一同顯示。 - - - - lsdev -v - 列出所有的裝置,這些裝置可能可以用來載入模組。若有指定 則會顯示更詳細的資訊。 - - - - lsmod -v - 顯示已載入的模組。若有指定 則會顯示更詳細的資訊。 - - - - more filename - 顯示指定的檔案,並於每 LINES 行顯示後會暫停。 - - - - reboot - 立即重新啟動系統。 - - - - set variable, set - variable=value - 設定指定的環境變數。 - - - - unload - 移除所有已載入的模組。 - - - -
- - 這裡有一些 loader 用法的實務範例。要使用一般的核心開機進入單使用者模式 (Single-user modesingle-user - mode) 可: - - boot -s - - 要卸載一般的核心與模組,然後載入先前或另一個指定的核心可: - - unload -load kernel.old - - 使用 kernel.GENERIC 來代表安裝程式使用的預設核心,或 kernel.old 來代表在系統升級之前或設定自訂核心前安裝的核心。 - - 使用以下指令來使用另一個核心載入一般的模組: - - unload -set kernel="kernel.old" -boot-conf - - 要載入一個已自動化的核心設置 Script 可: - - load -t userconfig_script /boot/kernel.conf - - - kernel - boot interaction - -
- - - 最終階段 - - - init8 - - - loader 或由會繞開 loaderboot2 載入核心之後,載入程式便會檢查是不有使用任何開機旗標,並根據需要調整開機的方式。 列出了常用的開機旗標,請參考 boot8 取得更多其他開機旗標的資訊。 - - - kernel - bootflags - - - - 開機時核心互動參數 - - - - - 項目 - 說明 - - - - - - - 核心初始化時,會詢問要掛載為根檔案系統的裝置。 - - - - - CDROM 做為根檔案系統開機。 - - - - - 開機進入單使用者模式。 - - - - - 核心啟動時提供更多詳細資訊。 - - - -
- - 一旦核心完成開機程序後,便會傳送控制權給使用者程序 init8,該程序位於 /sbin/init 或在 loader 中的 init_path 變數所指的程式路徑。這是開機程序的最後一個階段。 - - 開機程序會確保系統上的檔案系統的一致性 (Consistency),若 UFS 檔案系統不一致且 fsck 無法修時,init 會讓系統進入單使用者模式,以讓系統管理者能夠直接解決問題,否則系統會開機進入多使用者模式。 - - - 單使用者模式 - - single-user mode - console - - 使用者可以在開機時指定 或在 loader 設定 boot_single 變數進入這個模式。也可以透過在多使用者模式執行 shutdown now 進入此模式。進入單使用者模式時會出現此訊息: - - Enter full pathname of shell or RETURN for /bin/sh: - - 若使用者按下 Enter,系統便會進入預設的 Bourne shell。要指定使用其他的 Shell 則輸入該 Shell 的完整路徑。 - - 單使用者模式通常用來修復因檔案系統不一致或開機設定檔發生錯誤造成的無法開機,也可以用來重設遺忘的 root 的密碼,因為在單使用者模式會給予對本地系統及設定檔完整的存取權。在這個模式下沒有網路功能。 - - 雖然單使用者模式對修復系統很有幫助,但若系統放在不安全的場所便會有安全上的風險。預設,開機進入單使用者模式後,任何能夠存取實體主機的使用者便擁有系統的完整控制權。 - - 若在 /etc/ttys 系統 console 更改為 insecure,系統便會在初始化單使用者模式前先詢問 root 的密碼。這可增加一定程度的安全性,但便無法在忘記 root 密碼時重設密碼。 - - - 在 <filename>/etc/ttys</filename> 設定不安全的 Console - - # name getty type status comments -# -# If console is marked "insecure", then init will ask for the root password -# when going to single-user mode. -console none unknown off insecure - - - 不安全 (insecure) console 代表對 Console 的實體安全性評估為不安全 (insecure),所以只有知道 root 密碼的人可以使用單使用者模式。 - - - - 多使用者模式 - - multi-user mode - - init 正常找到檔案系統或在單使用者模式的使用者完成了操作並輸入 exit 離開單使用者模式,系統便會進入多使用者模式,在這個模式便會開始系統的資源設置。 - - rc files - - 資源設置系統 (Resource configuration system) 會從 /etc/defaults/rc.conf 讀取設定預設值以及從 /etc/rc.conf 讀取系統特定的設定,接著會繼續掛載系統列於 /etc/fstab 的檔案系統,也會啟動網路服務、其他的系統 Daemon,然後執行本地已安裝套件的啟動 Script。 - - 要了解更多有關資源設置系統,請參考 rc8 以及查看位於 /etc/rc.d 的 Script。 - -
-
- - - - - 設定開機啟動畫面 - - - - - Joseph J. - Barbish - - Contributed by - - - - - 正常 FreeBSD 系統開機會在 Console 顯示以一系列訊息來表示開機進度。開機啟動畫面 (Boot splash screen) 是另一種可以把所有開機偵測與服務啟動訊息隱藏的開機畫面,但即使開啟了啟動畫面,仍有有少數的開機載入程式的訊息,如:開機選項選單以及倒數時間的提示,仍會在開機時顯示。在開機程序時可以按下鍵盤上的按鍵來關閉顯示中的啟動畫面。 - - FreeBSD 有兩種基本的環境可以使用,一種是預設的傳統虛擬 Console 指令列環境,在系統完成開機之後,便會顯示 Console 登入提示。另一種環境則是設定好的圖型化環境,請參考 以取得更多有關如何安裝與設定圖型化顯示管理程式與圖型化登入管理程式的資訊。 - - 系統開機之後,啟動畫面預設會作為螢幕保護程式,一段時間未使用便會顯示啟動畫面,並且會循環更改影像的亮度,從明亮到非常暗,然後再繼續循環。啟動螢幕保護程式的設定可在 /etc/rc.conf 增加一行 saver= 來更改。有許多內建的螢幕保護程式可用,在 splash4 中有說明。saver= 的選項只會套用至虛擬 Console,對圖型化顯示管理程式並不會有任何影響。 - - 透過安裝 sysutils/bsd-splash-changer 套件或 Port,可在開機時顯示隨機挑選的啟動畫面。啟動畫面功能支援 256 色的點陣圖 (.bmp)、ZSoft PCX (.pcx) 或 TheDraw (.bin) 格式。.bmp, .pcx.bin 圖片必須放在根分割區,例如於 /boot。啟動圖片檔必須使用 320x200 像素或更低的解析度以能夠在標準 VGA 介面卡上運作,要在預設 256 色、320x200 像素或更低的解析度設定開機啟動圖片,可加入下行到 /boot/loader.conf,並替換 splash.bmp 為實際要使用的點陣圖檔: - - splash_bmp_load="YES" -bitmap_load="YES" -bitmap_name="/boot/splash.bmp" - - 要使用 PCX 檔則可替換點陣圖檔: - - splash_pcx_load="YES" -bitmap_load="YES" -bitmap_name="/boot/splash.pcx" - - 若要改使用 https://en.wikipedia.org/wiki/TheDraw 格式的 ASCII 圖可: - - splash_txt="YES" -bitmap_load="YES" -bitmap_name="/boot/splash.bin" - - 要使用較大的圖片來填滿整個顯示畫面支援的解析度最大可至 1024x768 像素,VESA 模組也必須在系統開機時載入。若使用自訂的核心,請確定自訂核心設定檔中有含有 VESA 核心設定選項。要載入 VESA 模組來顯示啟動畫面可在 /boot/loader.conf 上述例子中提到的三行之前加入下行: - - vesa_load="YES" - - 其他有用的 loader.conf 選項還有: - - - beastie_disable="YES" - - - 這個會關閉開機選項選單的顯示,但倒數計時提示仍會在。即使關閉了開機選項選單,在倒數計時提示時輸入選擇的選項還是會啟動對應的開機選項。 - - - - loader_logo="beastie" - - - 這個選項會替換預設與上色的小惡魔圖示一起顯示於開機選項選單右側的 FreeBSD 文字。 - - - - - 要取得更多資訊,請參考 splash4, loader.conf5 以及 vga4 - - - - - 裝置提示 - - - - - Tom - Rhodes - - Contributed by - - - - - - device.hints - - - 在一開始系統啟動時,開機 loader8 會讀取 device.hints5,這個檔中儲存了核心開機資訊,即變數,有時我們又會稱其為 裝置提示 (Device hints)。這些 裝置提示 (Device hints) 會傳送給裝置驅動程式做裝置的設置使用。 - - 裝置提示也可在階段 3 開機載入程式提示時指定,如 中的示範,其變數也可以使用 set 增加、使用 unset 移除、使用 show 檢視,也可覆蓋設定在 /boot/device.hints 的變數,但在開機載入程式輸入的裝置提示並不是永久有效的,在下一次重新開機久後便會失效。 - - 一旦系統開機後,便可使用 kenv1 來列出所有的變數。 - - /boot/device.hints 的語法為一個變數一行,使用井字號 # 做為註解符號,每一行的結構如下: - - hint.driver.unit.keyword="value" - - 在階段 3 開機載入程式的語法則為: - - set hint.driver.unit.keyword=value - - 其中 driver 為裝置驅動程式名稱、unit 為裝置驅動程式單位編號及 keyword 為提示關鍵字,關鍵字由以下選項所組成: - - - - at: 指定裝置所連結的匯流排 (Bus)。 - - - - port: 指定要使用的 I/O 開始位置。 - - - - irq: 指定要使用的中斷請求編號。 - - - - drq: 指定 DMA 頻道編號。 - - - - maddr: 指定裝置所使用的實體記憶體位置。 - - - - flags: 設定提供給裝置的各種旗標位元。 - - - - disabled: 若設為 1 則可關閉該裝置。 - - - - 由於裝置驅動程式可能會接受或請求更多未列於此處的提示,建議先閱讀驅動程式的操作手冊。要取得更多資訊請參考 device.hints5, kenv1, loader.conf5 以及 loader8 - - - - 關機程序 - - - shutdown8 - - - 在使用 shutdown8 控制關閉時,init8 會嘗試執行 /etc/rc.shutdown Script 接著傳送 TERM 信號給所有的程序,然後傳送 KILL 信號給未在時間內中止的程序。 - - 要在支援電源管理的架構與系統關閉 FreeBSD 主機電源,可使用 shutdown -p now 來立即關閉電源,要重新啟動 FreeBSD 系統可使用 shutdown -r now。操作人必須為 root 或為 operator 的成員才可執行 shutdown8,擁有這些身份的人也可使用 halt8reboot8,參考這些指令與 shutdown8 的操作手冊來取得更多資訊。 - - 要修改群組成員可參考 - - - 電源管理需要以載入 acpi4 模組或將其靜態編譯至自訂核心中。 - - -
- - - - - - - 安全性 - - - - - Tom - Rhodes - - Rewritten by - - - - - security - - - 概述 - - 不論實體或虛擬,安全性這個主題大到有整個產業圍繞著它,上百個標準案例已經被用來搛寫如何確保系統與網路的安全性。身為 FreeBSD 必須了解如何避免攻擊與入侵。 - - 在此章會討論幾個基本原理及技術。FreeBSD 系統的安全性有許多層面,且有許多第三方工具可以用來增加安全性。 - - 讀完這章,您將了解: - - - - 基礎 FreeBSD 系統安全概念。 - - - - FreeBSD 中的幾種加密 (Crypt) 機制。 - - - - 如何設定一次性密碼認證。 - - - - 如何設定 inetd8 中的 TCP Wrapper - - - - 如何在 FreeBSD 設定 Kerberos - - - - 如何設定 IPsec 並且建立 VPN - - - - 如何在 FreeBSD 設定並使用 OpenSSH - - - - 如何使用檔案系統 ACL - - - - 如何使用 pkg 來稽查從 Port 套件集安裝的第三方軟體套件。 - - - - 如何利用 FreeBSD 安全報告。 - - - - 什麼是程序追蹤 (Process Accounting) 以及如何在 FreeBSD 開啟。 - - - - 如何使用登入類別或資源限制資料庫控制使用者資源。 - - - - 在開始閱讀這章之前,您需要: - - - - 了解 FreeBSD 基礎及網路概念。 - - - - 其他的安全性議題會在本操作手冊的其他處說明。例如 強制存取控制 (Mandatory Access Control, MAC) 會在 討論及網路防火牆會在 討論。 - - - - 簡介 - - 保安是每個人的責任,任何系統中的弱點都可讓入侵者取得對關鍵資訊的存取權並導致整個網路的浩劫。資訊安全的其中一個核心原則便是 CIA 三字訣,代表著資訊系統的機密性 (Confidentiality)、完整性 (Integrity) 以及可用性 (Availability)。 - - CIA 三字訣是電腦安全的基石,就如同客戶與使用者期望他們的資料得到保護一樣重要。例如,一個客戶會期望他們的信用卡資訊被安全的保存 (機密性)、他們的訂單不會在私底下被竄改 (完整性) 以及他們隨時可以存取他們的訂單資訊 (可用性)。 - - 要提供 CIA,安全專家會應用防禦深度的策略。防禦深度的概念是增加數個保全階層來避免單一階層失效便導致整個安全系統瓦解。例如,系統管理者不能直接打開防火牆與評估網路或系統的安全性,還要同時稽查帳號、檢查 Binary 的完整性與確保未被安裝惡意工具。要執行有效的保安策略,必須了解威脅以及如何抵禦威脅。 - - 什麼威脅影響到電腦安全性? 威脅並不僅限於在遠端嘗試未經授權存取系統的遠端攻擊者,威脅也包含員工、惡意軟體、未經許可的網路裝置、天然災害、安全性漏洞甚至是公司競爭對手。 - - 系統與網路可以被未經授權存取,有時是因為意外,或是因遠端攻擊者,或在某些案例中,是因商業間諜或者前員工。做為使用者,重要的是做好防範準備以及當有失誤造成安全漏洞能夠承認並回報可能的問題給安全團隊。做為管理者,重要的是了解威脅並準備在發生時能夠減緩威脅。 - - 當要應用保安到系統上時,建議由基本帳號以及系統設定開始保全,接著確保網路層,使其遵守系統政策以及組織的安全程序。許多組織已經有涵蓋科技裝置設置的安全性政策,該政策應包含工作站、桌上型電腦、行動裝置、手機、上線伺服器、開發伺服器的安全設置。在大多數案例中,也都已經有標準操作程序 (SOP),當有疑慮時,請向安全團隊諮詢。 - - 簡介接下來的部份將說明如何在 FreeBSD 系統上執行這些基礎的安全設置。本章接下來的部份將介紹在 FreeBSD 系統執行安全性政策時會用到的特定工具。 - - - 防止登入 - - 要確保一個系統的安全最好的起點便是做好帳號的稽查,確保 root 使用了一個強而有力的密碼,並這個密碼未在其他地方使用過,然後關閉任何無須登入存取權的帳號。 - - 要防止登入存取帳號有兩種方法,第一種是鎖定帳號,以下範例會鎖定 toor 帳號: - - # pw lock toor - - 第二種防止登入存取的方式是狀 Shell 更改為 /usr/sbin/nologin,只有超級使用者可以更改其他使用者的 Shell: - - # chsh -s /usr/sbin/nologin toor - - /usr/sbin/nologin shell 可以避免系統分配 Shell 給嘗試登入的使用者。 - - - - 帳號升級授權 - - 在有一些案例,需要與其他使用者共用系統管理權限,FreeBSD 有兩種方式可以處理這種情況。第一種,也是較不建議的方式,是與 wheel 群組的成員共用 root 的密碼,這種方式使用者可以在需要超級使用者的存取權時輸入 su 然後輸入 wheel 的密碼,在完成需要管理存取權的指令之後,使用應輸入 exit 離開。要加入使用者到這個群組,可編輯 /etc/group 然後加入該使用者到 wheel 項目的最後,使用者必須以逗號字元分隔並不可有空白。 - - 第二種方式,也是較建議的方式,安裝 security/sudo 套件或 Port 來提升權限。這個軟體提供了額外的稽查、更細微的使用者控制,然後可以設定鎖定使用者只能執行特定需權限的指令。 - - 在安裝之後,使用 visudo 來編輯 /usr/local/etc/sudoers。這個範例會建立新 webadmin 群組,並加入 trhodes 帳號到該群組,然後設定該群組可重新啟動 apache24 的存取權: - - # pw groupadd webadmin -M trhodes -g 6000 -# visudo -%webadmin ALL=(ALL) /usr/sbin/service apache24 * - - - - 密碼編碼方式 - - 密碼是資訊科技的必要之惡,當必須使用密碼時,應要有複雜且強大的雜湊機制來加密儲存在密碼資料庫中的密碼。FreeBSD 支援 DES, MD5, SHA256, SHA512 以及 Blowfish 雜湊演算法於其 crypt() 程式庫。預設使用 SHA512,不建議改成更不安全的雜湊演算法,但可改成更安全的 Blowfish 演算法。 - - - Blowfish 不是 AES 的一部份且不符合任何聯邦資訊處理標準 (Federal Information Processing Standards, FIPS),在某些環境可能不會允許使用這種加密方式。 - - - 要知道目前用何種雜湊演算法來加密某位使用者密碼,超級使用者可以檢視在 FreeBSD 密碼資料庫中該使用者的雜湊,每個雜湊的一開始便會以符號標示其用來加密密碼所使用的雜湊機制。若使用 DES 則開始不會有任何符號,而 MD5 的符號則是 $SHA256SHA512 的符號是 $6$,Blowfish 的符號是 $2a$。在以下例子中 dru 的密碼使以預設的 SHA512 演算法加密,因為其雜湊的開始為 $6$。注意,該加密過的雜湊,不是原來的密碼,會儲存於密碼資料庫中: - - # grep dru /etc/master.passwd -dru:$6$pzIjSvCAn.PBYQBA$PXpSeWPx3g5kscj3IMiM7tUEUSPmGexxta.8Lt9TGSi2lNQqYGKszsBPuGME0:1001:1001::0:0:dru:/usr/home/dru:/bin/csh - - 雜湊機制是設定在該使用者的登入類別 (Login class),以此為例,該使用者屬於 default 登入類別,且雜湊演算法是以下行設定在 /etc/login.conf - - :passwd_format=sha512:\ - - 要更改演算法為 Blowfish,可修改該行如下: - - :passwd_format=blf:\ - - 然後依 中所描述的方式執行 cap_mkdb /etc/login.conf。注意,這個動作不會影響任何已存在的密碼雜湊,但這代表必須要求所有使用者執行 passwd 來更改其密碼才有辦法重新加密所有密碼。 - - 針對遠端登入,應使用雙重認證 (Two-factor authentication),舉例來說您同時要 有某樣東西,如:鑰匙,以及 知道某個資訊,如:密碼。自從 OpenSSH 是 FreeBSD 基礎系統的一部份,所有來算網路的登入應透過加密過的連線且使用以金鑰為基礎的認証來替代密碼。要了解更多資訊請參考 。Kerberos 的使用者可能會需要多做一些額外的更改才能在其網路上使用 OpenSSH,這些更改在 中會有說明。 - - - - 強制密碼政策 - - 強制在本地帳號使用高強度密碼的政策是系統安全的基礎之一。在 FreeBSD 密碼長度、密碼強度以及密碼複雜性可使用內建的可插拔認証模組 (Pluggable Authentication Modules, PAM) 來執行。 - - 本節將示範如何設定密碼長度下限與上限以及使用 pam_passwdqc.so 來強制使用混合字元的密碼,此模組可在使用者更改其密碼時強制要求。 - - 要設定此模組,需要先成為超級使用者,然後取消註解在 /etc/pam.d/passwd 中含有 pam_passwdqc.so 的行。然後編輯該行來配合密碼政策: - - password requisite pam_passwdqc.so min=disabled,disabled,disabled,12,10 similar=deny retry=3 enforce=users - - 這個例子會設定新密碼所需符合的需求。min 設定可以控制密碼長度下限,它有五個值因為這個模組根據密碼的複雜度定義了五種類型。而複雜度是由必須在密碼中存在的字元類型來定義,例如:文字、數字、符號以及大小寫,這些密碼類型在 pam_passwdqc8 有詳細的說明。在這個例子,密碼類型的前三項為關閉的,代表不會接受只滿足這些複雜度的密碼,不論長度為何。12 設定密碼政策可接受滿足三種字元類型複雜度且至少 12 個字元的密碼,10 設定密碼政策接受滿足四種字元類型複雜度且至少 10 個字元的密碼。 - - similar 設定則會拒絕以使用者前一次類似的密碼。retry 設定會提供使用者三次輸入新密碼的機會。 - - 一這個檔案儲存之後,更改密碼的使用者將會看到如下的訊息: - - % passwd -Changing local password for trhodes -Old Password: - -You can now choose the new password. -A valid password should be a mix of upper and lower case letters, -digits and other characters. You can use a 12 character long -password with characters from at least 3 of these 4 classes, or -a 10 character long password containing characters from all the -classes. Characters that form a common pattern are discarded by -the check. -Alternatively, if no one else can see your terminal now, you can -pick this as your password: "trait-useful&knob". -Enter new password: - - 若輸入了一個不符何密碼政策的密碼,則會被拒絕並顯示警告,然後使用者會有機會再重試,直到超過設定的允許重試次數。 - - 大多數密碼政策會讓密碼在多日過後過期。要在 FreeBSD 設定密碼年齡日期,可在 /etc/login.conf 中該使用者的登入類別設定 。在 default 登入類別已有設定範例: - - # :passwordtime=90d:\ - - 因此,要設定此登入類別的密碼在 90 天之後過期只需要移除註解符號 (#),然後儲存編輯結果並執行 cap_mkdb /etc/login.conf - - 要在個別使用者設定期限,可將有效日期或到期的天數與使用者名稱傳給 pw - - # pw usermod -p 30-apr-2015 -n trhodes - - 如這個例子,有效日期的格式為天、月以及年。要取得更多資訊可參考 pw8 - - - - 偵測 Root 工具 (Rootkit) - - rootkit 指的是嘗試未經授權取得系統 root 存取權的軟體。一旦安裝之後,這個惡意軟體將可以光明正大的開啟給另一個給攻擊者進入的大門。現實上,一但系統已被 rootkit 滲透且執行了搜索動作之後,該系統就應該從頭重新安裝,因為即使非常謹真的資安或系統工程式也可能會遺漏攻擊者留下的動西。 - - rootkit 對管理者而言唯一有幫助的是:一但偵測到,便代表某處已經被滲透,但這類型的應用程式躲藏的非常好,本節將會示範一個可以用來偵測 rootkit 的工具,security/rkhunter - - 安裝此套件或 Port 之後,系統便可使用以下指令檢查。該指令提供許多資訊且會需要手動按下 ENTER 確認: - - # rkhunter -c - - 該程序完成之後,目前狀態的訊息便會顯示在畫面上。這個訊息包含了已檢查過多少檔案、可疑的檔案、可能的 rootkit 以及其他更多資訊。在檢查的過程中,可能會產生一些有關隱藏檔案、OpenSSH 通訊協定選擇及已安裝軟體已知漏洞版本的通用的安全性警告、這些問題可以立即處理或在更詳細的分析之後再處理。 - - 每位管理者應了解在系統上執行了那些程式以及這些程式的用途。第三方工具如 rkhuntersysutils/lsof 以及原生指令如 netstatps 可以系統上大量的資訊,記錄下那一些是正常的,當有不適當的程式出現時提出疑問,然後找出答案。雖然理想要避免滲透,但也必須偵測是否已被滲透了。 - - - - Binary 檢驗 - - 檢驗系統檔案與 Binary 是很重要的,因為它可以提供系統管理者與資安團隊有關系統變更的資訊,能夠監視系統變更的軟體應用程式稱為入侵偵測系統 (Intrusion Detection System, IDS)。 - - FreeBSD 原生提供了基礎的 IDS 系統,雖然每天晚上會有安全性的信件會通知管理者相關的變更,但這些資訊是儲存在本地的,這讓惡意的使用者有機會能夠修改這些資訊來隱藏其對系統的變更。也因此,會建議建立一個獨立的 Binary 簽名並將這些簽名儲存在唯度、root 擁有的目錄或在可移除的 USB 磁碟或遠端 rsync 伺服器更好。 - - 內建 mtree 工具可以對一個目錄中的內容產生一個規格檔,產生規格檔會用到一個種子碼 (Seed) 或常數,然後在檢查規格是否有更改過時會也會需要使用這個種子碼或常數。這讓檢查一個檔案或 Binary 是否被修改變成可能的一件事。由於攻擊者並不知道種子碼,要仿冒或檢查檔案的校驗碼 (Checksum) 數值是幾乎不可能的。以下例子會產生一組 SHA256 雜湊,每一個在 /bin 的系統 Binary 都會有一個,並姐會將這些值以隱藏黨儲存在 root 的家目錄,/root/.bin_chksum_mtree - - # mtree -s 3483151339707503 -c -K cksum,sha256digest -p /bin > /root/.bin_chksum_mtree -# mtree: /bin checksum: 3427012225 - - 3483151339707503 代表種子碼,這個值應要記錄下來且不可給其它人看。 - - 檢視 /root/.bin_cksum_mtree 應會產生類似以下的輸出結果: - - # user: root -# machine: dreadnaught -# tree: /bin -# date: Mon Feb 3 10:19:53 2014 - -# . -/set type=file uid=0 gid=0 mode=0555 nlink=1 flags=none -. type=dir mode=0755 nlink=2 size=1024 \ - time=1380277977.000000000 - \133 nlink=2 size=11704 time=1380277977.000000000 \ - cksum=484492447 \ - sha256digest=6207490fbdb5ed1904441fbfa941279055c3e24d3a4049aeb45094596400662a - cat size=12096 time=1380277975.000000000 cksum=3909216944 \ - sha256digest=65ea347b9418760b247ab10244f47a7ca2a569c9836d77f074e7a306900c1e69 - chflags size=8168 time=1380277975.000000000 cksum=3949425175 \ - sha256digest=c99eb6fc1c92cac335c08be004a0a5b4c24a0c0ef3712017b12c89a978b2dac3 - chio size=18520 time=1380277975.000000000 cksum=2208263309 \ - sha256digest=ddf7c8cb92a58750a675328345560d8cc7fe14fb3ccd3690c34954cbe69fc964 - chmod size=8640 time=1380277975.000000000 cksum=2214429708 \ - sha256digest=a435972263bf814ad8df082c0752aa2a7bdd8b74ff01431ccbd52ed1e490bbe7 - - 機器的主機名稱、建立規格檔的日期與時間、以及建立此規格檔的使用者名稱皆會記錄在此報告當中,報告當中還會有在目錄中每個 Binary 的校驗碼、大小、時間以及 SHA256 編碼。 - - 要檢驗 Binary 簽名是否有被變更過,可使用先前產生的規格檔比對目前目錄的內容,然後儲存結果到檔案。這個指令需要當初產生原規格檔所使用的種子碼: - - # mtree -s 3483151339707503 -p /bin < /root/.bin_chksum_mtree >> /root/.bin_chksum_output -# mtree: /bin checksum: 3427012225 - - 這個動作應會產生與上次建立 /bin 規格檔時產生的校驗碼相同,若在此目錄的 Binary 沒有被變更過,那麼 /root/.bin_chksum_output 這個輸出檔將會是空的。要模擬變更,可以使用 touch 更改 /root/.bin_chksum_output 的日期然後再執行檢驗指令一次: - - # touch /bin/cat -# mtree -s 3483151339707503 -p /bin < /root/.bin_chksum_mtree >> /root/.bin_chksum_output -# more /root/.bin_chksum_output -cat changed - modification time expected Fri Sep 27 06:32:55 2013 found Mon Feb 3 10:28:43 2014 - - 建議對含有 Binary 以及設定檔的目錄建立規格檔,對含有敏感資料的目錄也是。通常會為 /bin, /sbin, /usr/bin, /usr/sbin, /usr/local/bin, /etc/usr/local/etc 建立規格檔。 - - 也有更進階的 IDS 系統,例如 security/aide。大多數情況 mtree 已可提供管理者所需的功能。將種子碼與校驗碼結果保存在惡意使用者無法存取的地方是非常重要的一件事。更多有關 mtree 的資訊可在 mtree8 找到。 - - - - 系統安全性調校 - - 在 FreeBSD,有許多系統功能可以使用 sysctl 調校,本節會涵蓋少數可以調校來避免阻斷服務 (Denial of Service, DoS) 攻擊的安全性功能。更多有關使用 sysctl 的資訊包含:如何暫時更改數值及如何在測試之後做永久更改可在 找到。 - - - 任何時間使用 做的設定變更都會讓造成不想要的傷害的可能性上升,影響到系統的可用性。因此應要對所有的變更做監視,若可能的話,先在測試系統上實驗,再到上線的系統上使用。 - - - 預設 FreeBSD 核心會使用安全性層級 -1 來開機,這又稱作不安全模式,因為不可變 (Immutable) 檔案旗標可以被關閉且可以讀取或寫入所有的裝置。除非有使用 sysctl 或在啟動 Script 設定修改該值,否則安全性層級將會在 -1。安全性層級可以在系統啟動時透過在 /etc/rc.conf 設定 kern_securelevel_enableYES 以及 設定 kern_securelevel 的值為想要的安全層級來提升。請參考 security7 以及 init8 以取得更多與這些設定及可用的安全性層級相關的資訊。 - - - 提高 securelevel 會導致 Xorg 無法執行以及造成其他問題,請做好除錯的準備。 - - - net.inet.tcp.blackhole 以及 net.inet.udp.blackhole 設定可以用來丟棄在已關閉連接埠 (Port) 收到的 SYN 封包且不會回傳 RST 回應,預設的動作是會回傳 RST 來表示該連接埠已被關閉,更改預設的動作可對連接埠掃描 (用在查看在系統上執行的應用程式) 提供一定程度的保護,要這麼做可設定 net.inet.tcp.blackhole2net.inet.udp.blackhole1。請參考 blackhole4 以取得更多有關這些設定的資訊。 - - net.inet.icmp.drop_redirect 以及 net.inet.ip.redirect 設定可以幫助避免 重新導向攻擊 (Redirect attacks),重新導向攻擊是 DoS 的一種,會傳送大量 ICMP 類型 5 的封包,由於這些封包並不是必要的,設定 net.inet.icmp.drop_redirect1 以及設定 net.inet.ip.redirect0 可丟棄這些封包。 - - 來源路由 (Source routing) 是一種偵測與存取在內部網路中不可路由位址的方法,由於不可路由位址通常是固故讓它不可路由的,因此可以關閉這個功能。要關閉這個功能可設定 net.inet.ip.sourceroute 以及 net.inet.ip.accept_sourceroute0 - - 當一台在網路上的機器需要傳送訊息給所有在子網路上的主機時,會發送 ICMP 回應請求訊息到廣播位址。然而,外部的主機是沒有理由可以執行這個動作的。要拒絕所有來自外部的廣播請求可設定 net.inet.icmp.bmcastecho0 - - 還有一些額外的設定在 security7 有說明。 - - - - - 一次性密碼 - - one-time passwords - - security - one-time passwords - - - 預設 FreeBSD 已內建一次性密碼 (One-time Passwords In Everything, OPIE)。OPIE 設計用來避免重送攻擊 (Replay attack),重送攻擊指的是攻擊者發現了某位使用者的密碼,然後使用該密碼來存取系統。由於在 OPIE 的環境下,一組密碼只能被使用一次,被發現的密碼對攻擊者而言便沒有什麼作用。OPIE 使用了安全的加密方式與詰問/回應系統 (Challenge/response system) 來管理密碼。FreeBSD 在實作上預設採用 MD5 加密。 - - OPIE 使用了三種不同類型的密碼,第一種是一般的 UNIX 或 Kerberos 密碼,第二種是由 opiekey 所產生的一次性密碼,第三種是用來生一次性密碼的 秘密密碼 (Secret password),秘密密碼與 UNIX 密碼無關且不應相同。 - - OPIE 來說還有另外兩個部份的資料很重要。其中一個是種子碼 (Seed) 或稱金鑰 (Key),由兩個字母與五個數字組成。另一個則是疊代次數 (Iteration count),是一個介於 1 到 100 間的數字。OPIE 會將種子碼與秘密密碼串連後,套用 MD5 加密數次後 (根據疊代次數),再將結果轉換成六個簡短的英文單字來產生一次性密碼。認証系統會持續追蹤最後使用的一次性密碼,若使用者提供的密碼加密後與前一次的密碼相同則可通過認証。由於採用了單向的加密方式,若使用過的密碼被成功擷取也無法拿來產生之後的一次性密碼。疊代次數會在每一次登入成功之後減少,來保持使用者與登入程式間的同步。當疊代次數減少至 1 時,OPIE 便要重新初始化。 - - 這個整個程序會牽涉到幾個程式。傳送疊代次數、種子碼與秘密密碼來產生一組一次性密碼或數個一次性密碼的 opiekey1。除了初始化 OPIE 之外,用來更改密碼、疊代次數或種子碼的 opiepasswd1。會讀取放在 /etc/opiekeys 的相關憑証檔來列出使用者目前的疊代次數與種子碼的 opieinfo1 - - 本章節將介紹四種不同的操作,第一是如何在安全連線下做第一次的一次性密碼設定,第二是如何使用在不安全的連線下使用 opiepasswd,第三是如何在不安全的連線下登入系統,第四是如何產生數個可以被記錄或列印下來在不安全的場所使的金鑰。 - - - 初始化 <acronym>OPIE</acronym> - - 第一次要初始化 OPIE,要在安全的場所執行以下指令: - - % opiepasswd -c -Adding unfurl: -Only use this method from the console; NEVER from remote. If you are using -telnet, xterm, or a dial-in, type ^C now or exit with no password. -Then run opiepasswd without the -c parameter. -Using MD5 to compute responses. -Enter new secret pass phrase: -Again new secret pass phrase: - -ID unfurl OTP key is 499 to4268 -MOS MALL GOAT ARM AVID COED - - 會設定採用假設指令在安全場所執行的 Console 模式,如在使用者掌控之中的電腦或者透過 SSH 連線到一台在使用者掌控之中的電腦。 - - 提示出現後,輸入用來產生一次性登入金鑰的秘密密碼,應使用一個不容易被猜出來的密碼,且應與使用者登入帳號所使用的密碼不同,密碼必須介於 10 到 127 個字元長度之間,然後請記住這個密碼。 - - ID 行會列出登入名稱 (unfurl)、預設的疊代次數 (499) 以及預設的種子碼 (to4268)。在進行登入時,系統會記住這些參數並且顯示出來,這也代表不需要另外記錄這些資訊。最後一行會列出根據這些參數與秘密密碼所產生出來的一次性密碼,在下一次登入時便要使用這個一次性密碼。 - - - - 在不安全連線下做初始化 - - 要在不安全的系統上初始化或更改秘密密碼會需要某個可使用安全的連線的地方執行 opiekey,這可能是在某一台信任的主機上的 Shell。初始化需要設定疊代次數,100 可能是不錯的數字,種子碼可以自行指定或隨機產生,在不安全連線下要被初始化主機須使用 opiepasswd1 - - % opiepasswd - -Updating unfurl: -You need the response from an OTP generator. -Old secret pass phrase: - otp-md5 498 to4268 ext - Response: GAME GAG WELT OUT DOWN CHAT -New secret pass phrase: - otp-md5 499 to4269 - Response: LINE PAP MILK NELL BUOY TROY - -ID mark OTP key is 499 gr4269 -LINE PAP MILK NELL BUOY TROY - - 要採用預設的種子碼,可直接按下 Return 做初始化。接著在輸入回應之前移到安全的連線然後給予相同的加密參數產生密碼: - - % opiekey 498 to4268 -Using the MD5 algorithm to compute response. -Reminder: Do not use opiekey from telnet or dial-in sessions. -Enter secret pass phrase: -GAME GAG WELT OUT DOWN CHAT - - 切換回不安全的連線,然後複製產生的一次性密碼貼上。 - - - - 產生單組一次性密碼 - - 在初始化 OPIE 之後進行登入會顯示如下的提示訊息: - - % telnet example.com -Trying 10.0.0.1... -Connected to example.com -Escape character is '^]'. - -FreeBSD/i386 (example.com) (ttypa) - -login: <username> -otp-md5 498 gr4269 ext -Password: - - OPIE 的提示提供了一個很有用的功能,若在密碼提示時按下 Return,便會開啟回應功能並顯示輸入的內容,這個功能在嘗試手工輸入列印出來的密碼時很有用。 - - MS-DOS - Windows - MacOS - - 此時,要產生一次性密碼來回應登入時的提示,這必須在受信任且可安全執行 opiekey1 的系統上完成。這個指令有提供 Windows, Mac OS 與 FreeBSD 版本,使用時需要疊代次數與種子碼做為在指令列的參數,剪下在要登入主機在登入時所提示的訊息。 - - 在信任的系統上執行: - - % opiekey 498 to4268 -Using the MD5 algorithm to compute response. -Reminder: Do not use opiekey from telnet or dial-in sessions. -Enter secret pass phrase: -GAME GAG WELT OUT DOWN CHAT - - 在產生一次性密碼後,回到登入畫面繼續登入。 - - - - 產生多組一次性密碼 - - 有時會無法存取信任的主機或沒有安全的連線,在這種情況下,可以使用 opiekey1 來預先產生多個一次性密碼,例如: - - % opiekey -n 5 30 zz99999 -Using the MD5 algorithm to compute response. -Reminder: Do not use opiekey from telnet or dial-in sessions. -Enter secret pass phrase: <secret password> -26: JOAN BORE FOSS DES NAY QUIT -27: LATE BIAS SLAY FOLK MUCH TRIG -28: SALT TIN ANTI LOON NEAL USE -29: RIO ODIN GO BYE FURY TIC -30: GREW JIVE SAN GIRD BOIL PHI - - 會請求產生連續五個金鑰,而 則是指定最後一個疊代的編號。注意這些列印出的結果的順序與使用的順序相反。十足的偏執狂可能會想要用手寫下結果,否則就列印出清單。每一行會同時顯示疊代次數及一次性密碼,在密碼使用過後便可劃掉。 - - - - 限制使用 <trademark class="registered">UNIX</trademark> 密碼 - - OPIE 可以根據登入階段的 IP 位置限制使用 UNIX 密碼,相關的檔案為 /etc/opieaccess,這個檔案預設便存在。請參考 opieaccess5 來取得更多有關此檔案的資訊以及當使用時要考量的安全性問題。 - - 這裡有一個範本 opieaccess - - permit 192.168.0.0 255.255.0.0 - - 這一行允許來源 IP 位址 (容易受到詐騙的位址) 符合指定值與遮罩的使用者在任何時間可使用 UNIX 密碼登入。 - - 若在 opieaccess 中沒有符合的規則,預設會拒絕非 OPIE 的登入。 - - - - - - TCP Wrapper - - - TomRhodesWritten - by - - - - TCP Wrapper - - TCP Wrapper is a host-based - access control system which extends the abilities of . It can be configured to provide - logging support, return messages, and connection restrictions - for the server daemons under the control of - inetd. Refer to tcpd8 for - more information about - TCP Wrapper and its features. - - TCP Wrapper should not be - considered a replacement for a properly configured firewall. - Instead, TCP Wrapper should be used - in conjunction with a firewall and other security enhancements - in order to provide another layer of protection in the - implementation of a security policy. - - - 初始設定 - - To enable TCP Wrapper in FreeBSD, - add the following lines to - /etc/rc.conf: - - inetd_enable="YES" -inetd_flags="-Ww" - - Then, properly configure - /etc/hosts.allow. - - - Unlike other implementations of - TCP Wrapper, the use of - hosts.deny is deprecated in FreeBSD. All - configuration options should be placed in - /etc/hosts.allow. - - - In the simplest configuration, daemon connection policies - are set to either permit or block, depending on the options in - /etc/hosts.allow. The default - configuration in FreeBSD is to allow all connections to the - daemons started with inetd. - - Basic configuration usually takes the form of - daemon : address : action, where - daemon is the daemon which - inetd started, - address is a valid hostname, - IP address, or an IPv6 address enclosed in - brackets ([ ]), and action is either - allow or deny. - TCP Wrapper uses a first rule match - semantic, meaning that the configuration file is scanned from - the beginning for a matching rule. When a match is found, the - rule is applied and the search process stops. - - For example, to allow POP3 connections - via the mail/qpopper daemon, the following - lines should be appended to - hosts.allow: - - # This line is required for POP3 connections: -qpopper : ALL : allow - - Whenever this file is edited, restart - inetd: - - # service inetd restart - - - - 進階設定 - - TCP Wrapper provides advanced - options to allow more control over the way connections are - handled. In some cases, it may be appropriate to return a - comment to certain hosts or daemon connections. In other - cases, a log entry should be recorded or an email sent to the - administrator. Other situations may require the use of a - service for local connections only. This is all possible - through the use of configuration options known as wildcards, - expansion characters, and external command execution. - - Suppose that a situation occurs where a connection should - be denied yet a reason should be sent to the host who - attempted to establish that connection. That action is - possible with . When a connection - attempt is made, executes a shell - command or script. An example exists in - hosts.allow: - - # The rest of the daemons are protected. -ALL : ALL \ - : severity auth.info \ - : twist /bin/echo "You are not welcome to use %d from %h." - - In this example, the message You are not allowed to - use daemon name from - hostname. will be - returned for any daemon not configured in - hosts.allow. This is useful for sending - a reply back to the connection initiator right after the - established connection is dropped. Any message returned - must be wrapped in quote - (") characters. - - - It may be possible to launch a denial of service attack - on the server if an attacker floods these daemons with - connection requests. - - - Another possibility is to use . - Like , implicitly - denies the connection and may be used to run external shell - commands or scripts. Unlike , - will not send a reply back to the host - who established the connection. For example, consider the - following configuration: - - # We do not allow connections from example.com: -ALL : .example.com \ - : spawn (/bin/echo %a from %h attempted to access %d >> \ - /var/log/connections.log) \ - : deny - - This will deny all connection attempts from *.example.com and log the - hostname, IP address, and the daemon to - which access was attempted to - /var/log/connections.log. This example - uses the substitution characters %a and - %h. Refer to hosts_access5 for the - complete list. - - To match every instance of a daemon, domain, or - IP address, use ALL. - Another wildcard is PARANOID which may be - used to match any host which provides an IP - address that may be forged because the IP - address differs from its resolved hostname. In this example, - all connection requests to Sendmail - which have an IP address that varies from - its hostname will be denied: - - # Block possibly spoofed requests to sendmail: -sendmail : PARANOID : deny - - - Using the PARANOID wildcard will - result in denied connections if the client or server has a - broken DNS setup. - - - To learn more about wildcards and their associated - functionality, refer to hosts_access5. - - - When adding new configuration lines, make sure that any - unneeded entries for that daemon are commented out in - hosts.allow. - - - - - - - <application>Kerberos</application> - - - - - Tillman - Hodgson - - Contributed by - - - - - - - Mark - Murray - - Based on a contribution by - - - - - Kerberos is a network - authentication protocol which was originally created by the - Massachusetts Institute of Technology (MIT) - as a way to securely provide authentication across a potentially - hostile network. The Kerberos - protocol uses strong cryptography so that both a client and - server can prove their identity without sending any unencrypted - secrets over the network. Kerberos - can be described as an identity-verifying proxy system and as a - trusted third-party authentication system. After a user - authenticates with Kerberos, their - communications can be encrypted to assure privacy and data - integrity. - - The only function of Kerberos is - to provide the secure authentication of users and servers on the - network. It does not provide authorization or auditing - functions. It is recommended that - Kerberos be used with other security - methods which provide authorization and audit services. - - The current version of the protocol is version 5, described - in RFC 4120. Several free - implementations of this protocol are available, covering a wide - range of operating systems. MIT continues to - develop their Kerberos package. It - is commonly used in the US as a cryptography - product, and has historically been subject to - US export regulations. In FreeBSD, - MIT Kerberos is - available as the security/krb5 package or - port. The Heimdal Kerberos - implementation was explicitly developed outside of the - US to avoid export regulations. The Heimdal - Kerberos distribution is included in - the base FreeBSD installation, and another distribution with more - configurable options is available as - security/heimdal in the Ports - Collection. - - In Kerberos users and services - are identified as principals which are contained - within an administrative grouping, called a - realm. A typical user principal would be of the - form - user@REALM - (realms are traditionally uppercase). - - This section provides a guide on how to set up - Kerberos using the Heimdal - distribution included in FreeBSD. - - For purposes of demonstrating a - Kerberos installation, the name - spaces will be as follows: - - - - The DNS domain (zone) will be - example.org. - - - - The Kerberos realm will be - EXAMPLE.ORG. - - - - - Use real domain names when setting up - Kerberos, even if it will run - internally. This avoids DNS problems and - assures inter-operation with other - Kerberos realms. - - - - 設定 Heimdal <acronym>KDC</acronym> - - - Kerberos5 - Key Distribution Center - - - The Key Distribution Center (KDC) is - the centralized authentication service that - Kerberos provides, the - trusted third party of the system. It is the - computer that issues Kerberos - tickets, which are used for clients to authenticate to - servers. Because the KDC is considered - trusted by all other computers in the - Kerberos realm, it has heightened - security concerns. Direct access to the KDC should be - limited. - - While running a KDC requires few - computing resources, a dedicated machine acting only as a - KDC is recommended for security - reasons. - - To begin setting up a KDC, add these - lines to /etc/rc.conf: - - kdc_enable="YES" -kadmind_enable="YES" - - Next, edit /etc/krb5.conf as - follows: - - [libdefaults] - default_realm = EXAMPLE.ORG -[realms] - EXAMPLE.ORG = { - kdc = kerberos.example.org - admin_server = kerberos.example.org - } -[domain_realm] - .example.org = EXAMPLE.ORG - - In this example, the KDC will use the - fully-qualified hostname kerberos.example.org. The - hostname of the KDC must be resolvable in the - DNS. - - Kerberos can also use the - DNS to locate KDCs, instead of a - [realms] section in - /etc/krb5.conf. For large organizations - that have their own DNS servers, the above - example could be trimmed to: - - [libdefaults] - default_realm = EXAMPLE.ORG -[domain_realm] - .example.org = EXAMPLE.ORG - - With the following lines being included in the - example.org zone - file: - - _kerberos._udp IN SRV 01 00 88 kerberos.example.org. -_kerberos._tcp IN SRV 01 00 88 kerberos.example.org. -_kpasswd._udp IN SRV 01 00 464 kerberos.example.org. -_kerberos-adm._tcp IN SRV 01 00 749 kerberos.example.org. -_kerberos IN TXT EXAMPLE.ORG - - - In order for clients to be able to find the - Kerberos services, they - must have either - a fully configured /etc/krb5.conf or a - minimally configured /etc/krb5.conf - and a properly configured - DNS server. - - - Next, create the Kerberos - database which contains the keys of all principals (users and - hosts) encrypted with a master password. It is not required - to remember this password as it will be stored in - /var/heimdal/m-key; it would be - reasonable to use a 45-character random password for this - purpose. To create the master key, run - kstash and enter a password: - - # kstash -Master key: xxxxxxxxxxxxxxxxxxxxxxx -Verifying password - Master key: xxxxxxxxxxxxxxxxxxxxxxx - - Once the master key has been created, the database should - be initialized. The Kerberos - administrative tool kadmin8 can be used on the KDC in a - mode that operates directly on the database, without using the - kadmind8 network service, as - kadmin -l. This resolves the - chicken-and-egg problem of trying to connect to the database - before it is created. At the kadmin - prompt, use init to create the realm's - initial database: - - # kadmin -l -kadmin> init EXAMPLE.ORG -Realm max ticket life [unlimited]: - - Lastly, while still in kadmin, create - the first principal using add. Stick to - the default options for the principal for now, as these can be - changed later with modify. Type - ? at the prompt to see the available - options. - - kadmin> add tillman -Max ticket life [unlimited]: -Max renewable life [unlimited]: -Attributes []: -Password: xxxxxxxx -Verifying password - Password: xxxxxxxx - - Next, start the KDC services by running - service kdc start and - service kadmind start. While there will - not be any kerberized daemons running at this point, it is - possible to confirm that the KDC is - functioning by obtaining a ticket for the - principal that was just created: - - % kinit tillman -tillman@EXAMPLE.ORG's Password: - - Confirm that a ticket was successfully obtained using - klist: - - % klist -Credentials cache: FILE:/tmp/krb5cc_1001 - Principal: tillman@EXAMPLE.ORG - - Issued Expires Principal -Aug 27 15:37:58 2013 Aug 28 01:37:58 2013 krbtgt/EXAMPLE.ORG@EXAMPLE.ORG - - The temporary ticket can be destroyed when the test is - finished: - - % kdestroy - - - - 設定伺服器使用 <application>Kerberos</application> - - - Kerberos5 - enabling services - - - The first step in configuring a server to use - Kerberos authentication is to - ensure that it has the correct configuration in - /etc/krb5.conf. The version from the - KDC can be used as-is, or it can be - regenerated on the new system. - - Next, create /etc/krb5.keytab on the - server. This is the main part of Kerberizing a - service — it corresponds to generating a secret shared - between the service and the KDC. The - secret is a cryptographic key, stored in a - keytab. The keytab contains the server's host - key, which allows it and the KDC to verify - each others' identity. It must be transmitted to the server - in a secure fashion, as the security of the server can be - broken if the key is made public. Typically, the - keytab is generated on an administrator's - trusted machine using kadmin, then securely - transferred to the server, e.g., with scp1; it can also - be created directly on the server if that is consistent with - the desired security policy. It is very important that the - keytab is transmitted to the server in a secure fashion: if - the key is known by some other party, that party can - impersonate any user to the server! Using - kadmin on the server directly is - convenient, because the entry for the host principal in the - KDC database is also created using - kadmin. - - Of course, kadmin is a kerberized - service; a Kerberos ticket is - needed to authenticate to the network service, but to ensure - that the user running kadmin is actually - present (and their session has not been hijacked), - kadmin will prompt for the password to get - a fresh ticket. The principal authenticating to the kadmin - service must be permitted to use the kadmin - interface, as specified in kadmind.acl. - See the section titled Remote administration in - info heimdal for details on designing - access control lists. Instead of enabling remote - kadmin access, the administrator could - securely connect to the KDC via the local - console or ssh1, and perform administration locally - using kadmin -l. - - After installing /etc/krb5.conf, - use add --random-key in - kadmin. This adds the server's host - principal to the database, but does not extract a copy of the - host principal key to a keytab. To generate the keytab, use - ext to extract the server's host principal - key to its own keytab: - - # kadmin -kadmin> add --random-key host/myserver.example.org -Max ticket life [unlimited]: -Max renewable life [unlimited]: -Principal expiration time [never]: -Password expiration time [never]: -Attributes []: -kadmin> ext_keytab host/myserver.example.org -kadmin> exit - - Note that ext_keytab stores the - extracted key in /etc/krb5.keytab by - default. This is good when being run on the server being - kerberized, but the --keytab - path/to/file argument - should be used when the keytab is being extracted - elsewhere: - - # kadmin -kadmin> ext_keytab --keytab=/tmp/example.keytab host/myserver.example.org -kadmin> exit - - The keytab can then be securely copied to the server - using scp1 or a removable media. Be sure to specify a - non-default keytab name to avoid inserting unneeded keys into - the system's keytab. - - At this point, the server can read encrypted messages from - the KDC using its shared key, stored in - krb5.keytab. It is now ready for the - Kerberos-using services to be - enabled. One of the most common such services is - sshd8, which supports - Kerberos via the - GSS-API. In - /etc/ssh/sshd_config, add the - line: - - GSSAPIAuthentication yes - - 做完了這個變更之後,必須重新啟動 sshd8 來使新的設定值生效:service sshd restart - - - - 設定客戶端使用 <application>Kerberos</application> - - - Kerberos5 - configure clients - - - As it was for the server, the client requires - configuration in /etc/krb5.conf. Copy - the file in place (securely) or re-enter it as needed. - - Test the client by using kinit, - klist, and kdestroy from - the client to obtain, show, and then delete a ticket for an - existing principal. Kerberos - applications should also be able to connect to - Kerberos enabled servers. If that - does not work but obtaining a ticket does, the problem is - likely with the server and not with the client or the - KDC. In the case of kerberized - ssh1, GSS-API is disabled by - default, so test using ssh -o - GSSAPIAuthentication=yes - hostname. - - When testing a Kerberized application, try using a packet - sniffer such as tcpdump to confirm that no - sensitive information is sent in the clear. - - Various Kerberos client - applications are available. With the advent of a bridge so - that applications using SASL for - authentication can use GSS-API mechanisms - as well, large classes of client applications can use - Kerberos for authentication, from - Jabber clients to IMAP clients. - - - .k5login - - - - .k5users - - - Users within a realm typically have their - Kerberos principal mapped to a - local user account. Occasionally, one needs to grant access - to a local user account to someone who does not have a - matching Kerberos principal. For - example, tillman@EXAMPLE.ORG may need - access to the local user account webdevelopers. Other - principals may also need access to that local account. - - The .k5login and - .k5users files, placed in a user's home - directory, can be used to solve this problem. For example, if - the following .k5login is placed in the - home directory of webdevelopers, both principals - listed will have access to that account without requiring a - shared password: - - tillman@example.org -jdoe@example.org - - Refer to ksu1 for more information about - .k5users. - - - - 與 <acronym>MIT</acronym> 的差異 - - The major difference between the MIT - and Heimdal implementations is that kadmin - has a different, but equivalent, set of commands and uses a - different protocol. If the KDC is - MIT, the Heimdal version of - kadmin cannot be used to administer the - KDC remotely, and vice versa. - - Client applications may also use slightly different - command line options to accomplish the same tasks. Following - the instructions at http://web.mit.edu/Kerberos/www/ - is recommended. Be careful of path issues: the - MIT port installs into - /usr/local/ by default, and the FreeBSD - system applications run instead of the - MIT versions if PATH lists - the system directories first. - - When using MIT Kerberos as a KDC on - FreeBSD, the following edits should also be made to - rc.conf: - - kerberos5_server="/usr/local/sbin/krb5kdc" -kadmind5_server="/usr/local/sbin/kadmind" -kerberos5_server_flags="" -kerberos5_server_enable="YES" -kadmind5_server_enable="YES" - - - - <application>Kerberos</application> 提示、技巧與疑難排解 - - When configuring and troubleshooting - Kerberos, keep the following points - in mind: - - - - When using either Heimdal or MIT - Kerberos from ports, ensure - that the PATH lists the port's versions of - the client applications before the system versions. - - - - If all the computers in the realm do not have - synchronized time settings, authentication may fail. - describes how to synchronize - clocks using NTP. - - - - If the hostname is changed, the host/ principal must be - changed and the keytab updated. This also applies to - special keytab entries like the HTTP/ principal used for - Apache's www/mod_auth_kerb. - - - - All hosts in the realm must be both forward and - reverse resolvable in DNS or, at a - minimum, exist in /etc/hosts. CNAMEs - will work, but the A and PTR records must be correct and - in place. The error message for unresolvable hosts is not - intuitive: Kerberos5 refuses authentication - because Read req failed: Key table entry not - found. - - - - Some operating systems that act as clients to the - KDC do not set the permissions for - ksu to be setuid root. This means that - ksu does not work. This is a - permissions problem, not a KDC - error. - - - - With MIT - Kerberos, to allow a principal - to have a ticket life longer than the default lifetime of - ten hours, use modify_principal at the - kadmin8 prompt to change the - maxlife of both the principal in - question and the - krbtgt - principal. The principal can then use - kinit -l to request a ticket with a - longer lifetime. - - - - When running a packet sniffer on the - KDC to aid in troubleshooting while - running kinit from a workstation, the - Ticket Granting Ticket (TGT) is sent - immediately, even before the password is typed. This is - because the Kerberos server - freely transmits a TGT to any - unauthorized request. However, every - TGT is encrypted in a key derived from - the user's password. When a user types their password, it - is not sent to the KDC, it is instead - used to decrypt the TGT that - kinit already obtained. If the - decryption process results in a valid ticket with a valid - time stamp, the user has valid - Kerberos credentials. These - credentials include a session key for establishing secure - communications with the - Kerberos server in the future, - as well as the actual TGT, which is - encrypted with the Kerberos - server's own key. This second layer of encryption allows - the Kerberos server to verify - the authenticity of each TGT. - - - - Host principals can have a longer ticket lifetime. If - the user principal has a lifetime of a week but the host - being connected to has a lifetime of nine hours, the user - cache will have an expired host principal and the ticket - cache will not work as expected. - - - - When setting up krb5.dict to - prevent specific bad passwords from being used as - described in kadmind8, remember that it only - applies to principals that have a password policy assigned - to them. The format used in - krb5.dict is one string per line. - Creating a symbolic link to - /usr/share/dict/words might be - useful. - - - - - - 減輕 <application>Kerberos</application> 的限制 - - - Kerberos5 - limitations and shortcomings - - - Since Kerberos is an all or - nothing approach, every service enabled on the network must - either be modified to work with - Kerberos or be otherwise secured - against network attacks. This is to prevent user credentials - from being stolen and re-used. An example is when - Kerberos is enabled on all remote - shells but the non-Kerberized POP3 mail - server sends passwords in plain text. - - The KDC is a single point of failure. - By design, the KDC must be as secure as its - master password database. The KDC should - have absolutely no other services running on it and should be - physically secure. The danger is high because - Kerberos stores all passwords - encrypted with the same master key which is stored as a file - on the KDC. - - A compromised master key is not quite as bad as one might - fear. The master key is only used to encrypt the - Kerberos database and as a seed for - the random number generator. As long as access to the - KDC is secure, an attacker cannot do much - with the master key. - - If the KDC is unavailable, network - services are unusable as authentication cannot be performed. - This can be alleviated with a single master - KDC and one or more slaves, and with - careful implementation of secondary or fall-back - authentication using PAM. - - Kerberos allows users, hosts - and services to authenticate between themselves. It does not - have a mechanism to authenticate the - KDC to the users, hosts, or services. This - means that a trojanned kinit could record - all user names and passwords. File system integrity checking - tools like security/tripwire can - alleviate this. - - - - 相關資源與延伸資訊 - - - Kerberos5 - external resources - - - - - - The Kerberos - FAQ - - - - Designing - an Authentication System: a Dialog in Four - Scenes - - - - RFC - 4120, The Kerberos Network - Authentication Service (V5) - - - - MIT - Kerberos home - page - - - - Heimdal - Kerberos home - page - - - - - - - - OpenSSL - - - TomRhodesWritten - by - - - - - security - OpenSSL - - - OpenSSL is an open source - implementation of the SSL and - TLS protocols. It provides an encryption - transport layer on top of the normal communications layer, - allowing it to be intertwined with many network applications and - services. - - The version of OpenSSL included - in FreeBSD supports the Secure Sockets Layer 3.0 (SSLv3) - and Transport Layer Security 1.0/1.1/1.2 (TLSv1/TLSv1.1/TLSv1.2) - network security - protocols and can be used as a general cryptographic - library. In FreeBSD 12.0-RELEASE and above, OpenSSL also supports - Transport Layer Security 1.3 (TLSv1.3). - - OpenSSL is often used to encrypt - authentication of mail clients and to secure web based - transactions such as credit card payments. Some ports, such as - www/apache24 and - databases/postgresql11-server, include a - compile option for building with - OpenSSL. If selected, the port will - add support using OpenSSL from the - base system. To instead have the port compile against - OpenSSL from the - security/openssl port, add the following to - /etc/make.conf: - - DEFAULT_VERSIONS+= ssl=openssl - - Another common use of OpenSSL is - to provide certificates for use with software applications. - Certificates can be used to verify the credentials of a company - or individual. If a certificate has not been signed by an - external Certificate Authority - (CA), such as http://www.verisign.com, - the application that uses the certificate will produce a - warning. There is a cost associated with obtaining a signed - certificate and using a signed certificate is not mandatory as - certificates can be self-signed. However, using an external - authority will prevent warnings and can put users at - ease. - - This section demonstrates how to create and use certificates - on a FreeBSD system. Refer to for an - example of how to create a CA for signing - one's own certificates. - - For more information about SSL, read the - free OpenSSL - Cookbook. - - - 產生憑証 - - - OpenSSL - certificate generation - - - To generate a certificate that will be signed by an - external CA, issue the following command - and input the information requested at the prompts. This - input information will be written to the certificate. At the - Common Name prompt, input the fully - qualified name for the system that will use the certificate. - If this name does not match the server, the application - verifying the certificate will issue a warning to the user, - rendering the verification provided by the certificate as - useless. - # openssl req -new -nodes -out req.pem -keyout cert.key -sha256 -newkey rsa:2048 -Generating a 2048 bit RSA private key -..................+++ -.............................................................+++ -writing new private key to 'cert.key' ------ -You are about to be asked to enter information that will be incorporated -into your certificate request. -What you are about to enter is what is called a Distinguished Name or a DN. -There are quite a few fields but you can leave some blank -For some fields there will be a default value, -If you enter '.', the field will be left blank. ------ -Country Name (2 letter code) [AU]:US -State or Province Name (full name) [Some-State]:PA -Locality Name (eg, city) []:Pittsburgh -Organization Name (eg, company) [Internet Widgits Pty Ltd]:My Company -Organizational Unit Name (eg, section) []:Systems Administrator -Common Name (eg, YOUR name) []:localhost.example.org -Email Address []:trhodes@FreeBSD.org - -Please enter the following 'extra' attributes -to be sent with your certificate request -A challenge password []: -An optional company name []:Another Name - - Other options, such as the expire time and alternate - encryption algorithms, are available when creating a - certificate. A complete list of options is described in - openssl1. - - This command will create two files in the current - directory. The certificate request, - req.pem, can be sent to a - CA who will validate the entered - credentials, sign the request, and return the signed - certificate. The second file, - cert.key, is the private key for the - certificate and should be stored in a secure location. If - this falls in the hands of others, it can be used to - impersonate the user or the server. - - Alternately, if a signature from a CA - is not required, a self-signed certificate can be created. - First, generate the RSA key: - - # openssl genrsa -rand -genkey -out cert.key 2048 -0 semi-random bytes loaded -Generating RSA private key, 2048 bit long modulus -.............................................+++ -.................................................................................................................+++ -e is 65537 (0x10001) - - Use this key to create a self-signed certificate. - Follow the usual prompts for creating a certificate: - - # openssl req -new -x509 -days 365 -key cert.key -out cert.crt -sha256 -You are about to be asked to enter information that will be incorporated -into your certificate request. -What you are about to enter is what is called a Distinguished Name or a DN. -There are quite a few fields but you can leave some blank -For some fields there will be a default value, -If you enter '.', the field will be left blank. ------ -Country Name (2 letter code) [AU]:US -State or Province Name (full name) [Some-State]:PA -Locality Name (eg, city) []:Pittsburgh -Organization Name (eg, company) [Internet Widgits Pty Ltd]:My Company -Organizational Unit Name (eg, section) []:Systems Administrator -Common Name (e.g. server FQDN or YOUR name) []:localhost.example.org -Email Address []:trhodes@FreeBSD.org - - This will create two new files in the current directory: a - private key file - cert.key, and the certificate itself, - cert.crt. These should be placed in a - directory, preferably under /etc/ssl/, - which is readable only by root. Permissions of - 0700 are appropriate for these files and - can be set using chmod. - - - - 使用憑證 - - One use for a certificate is to encrypt connections to the - Sendmail mail server in order to - prevent the use of clear text authentication. - - - Some mail clients will display an error if the user has - not installed a local copy of the certificate. Refer to the - documentation included with the software for more - information on certificate installation. - - - In FreeBSD 10.0-RELEASE and above, it is possible to create a - self-signed certificate for - Sendmail automatically. To enable - this, add the following lines to - /etc/rc.conf: - - sendmail_enable="YES" -sendmail_cert_create="YES" -sendmail_cert_cn="localhost.example.org" - - This will automatically create a self-signed certificate, - /etc/mail/certs/host.cert, a signing key, - /etc/mail/certs/host.key, and a - CA certificate, - /etc/mail/certs/cacert.pem. The - certificate will use the Common Name - specified in . After saving - the edits, restart Sendmail: - - # service sendmail restart - - If all went well, there will be no error messages in - /var/log/maillog. For a simple test, - connect to the mail server's listening port using - telnet: - - # telnet example.com 25 -Trying 192.0.34.166... -Connected to example.com. -Escape character is '^]'. -220 example.com ESMTP Sendmail 8.14.7/8.14.7; Fri, 18 Apr 2014 11:50:32 -0400 (EDT) -ehlo example.com -250-example.com Hello example.com [192.0.34.166], pleased to meet you -250-ENHANCEDSTATUSCODES -250-PIPELINING -250-8BITMIME -250-SIZE -250-DSN -250-ETRN -250-AUTH LOGIN PLAIN -250-STARTTLS -250-DELIVERBY -250 HELP -quit -221 2.0.0 example.com closing connection -Connection closed by foreign host. - - If the STARTTLS line appears in the - output, everything is working correctly. - - - - - - <acronym>VPN</acronym> over - <acronym>IPsec</acronym> - - - - - Nik - Clayton - - -
- nik@FreeBSD.org -
-
- Written by -
-
- - - - - Hiten M. - Pandya - - -
- hmp@FreeBSD.org -
-
- Written by -
-
-
- - - IPsec - - - Internet Protocol Security (IPsec) is a - set of protocols which sit on top of the Internet Protocol - (IP) layer. It allows two or more hosts to - communicate in a secure manner by authenticating and encrypting - each IP packet of a communication session. - The FreeBSD IPsec network stack is based on the - http://www.kame.net/ - implementation and supports both IPv4 and - IPv6 sessions. - - - IPsec - ESP - - - - IPsec - AH - - - IPsec is comprised of the following - sub-protocols: - - - - Encapsulated Security Payload - (ESP): this protocol - protects the IP packet data from third - party interference by encrypting the contents using - symmetric cryptography algorithms such as Blowfish and - 3DES. - - - - Authentication Header - (AH): this protocol - protects the IP packet header from third - party interference and spoofing by computing a cryptographic - checksum and hashing the IP packet - header fields with a secure hashing function. This is then - followed by an additional header that contains the hash, to - allow the information in the packet to be - authenticated. - - - - IP Payload Compression Protocol - (IPComp): this protocol - tries to increase communication performance by compressing - the IP payload in order to reduce the - amount of data sent. - - - - These protocols can either be used together or separately, - depending on the environment. - - - VPN - - - - virtual private network - VPN - - - IPsec supports two modes of operation. - The first mode, Transport Mode, protects - communications between two hosts. The second mode, - Tunnel Mode, is used to build virtual - tunnels, commonly known as Virtual Private Networks - (VPNs). Consult ipsec4 for detailed - information on the IPsec subsystem in - FreeBSD. - - 在 FreeBSD 11 與之後的版本預設會開啟 IPsec 功能,先前版本的 FreeBSD 可在自訂核心設定檔中加入以下選項然後依 的指示來重新編譯核心: - - 核心選項 IPSEC - - options IPSEC #IP security -device crypto - - 核心選項 IPSEC_DEBUG - - If IPsec debugging support is desired, - the following kernel option should also be added: - - options IPSEC_DEBUG #debug for IP security - - This rest of this chapter demonstrates the process of - setting up an IPsec VPN - between a home network and a corporate network. In the example - scenario: - - - - Both sites are connected to the Internet through a - gateway that is running FreeBSD. - - - - The gateway on each network has at least one external - IP address. In this example, the - corporate LAN's external - IP address is 172.16.5.4 and the home - LAN's external IP - address is 192.168.1.12. - - - - The internal addresses of the two networks can be either - public or private IP addresses. However, - the address space must not collide. For example, both - networks cannot use 192.168.1.x. In this - example, the corporate LAN's internal - IP address is 10.246.38.1 and the home - LAN's internal IP - address is 10.0.0.5. - - - - - - 在 FreeBSD 上設定 <acronym>VPN</acronym> - - - - - Tom - Rhodes - - -
- trhodes@FreeBSD.org -
-
- Written by -
-
-
- - To begin, security/ipsec-tools must be - installed from the Ports Collection. This software provides a - number of applications which support the configuration. - - The next requirement is to create two gif4 - pseudo-devices which will be used to tunnel packets and allow - both networks to communicate properly. As root, run the following - commands, replacing internal and - external with the real IP - addresses of the internal and external interfaces of the two - gateways: - - # ifconfig gif0 create -# ifconfig gif0 internal1 internal2 -# ifconfig gif0 tunnel external1 external2 - - Verify the setup on each gateway, using - ifconfig. Here is the output from Gateway - 1: - - gif0: flags=8051 mtu 1280 -tunnel inet 172.16.5.4 --> 192.168.1.12 -inet6 fe80::2e0:81ff:fe02:5881%gif0 prefixlen 64 scopeid 0x6 -inet 10.246.38.1 --> 10.0.0.5 netmask 0xffffff00 - - Here is the output from Gateway 2: - - gif0: flags=8051 mtu 1280 -tunnel inet 192.168.1.12 --> 172.16.5.4 -inet 10.0.0.5 --> 10.246.38.1 netmask 0xffffff00 -inet6 fe80::250:bfff:fe3a:c1f%gif0 prefixlen 64 scopeid 0x4 - - Once complete, both internal IP - addresses should be reachable using ping8: - - priv-net# ping 10.0.0.5 -PING 10.0.0.5 (10.0.0.5): 56 data bytes -64 bytes from 10.0.0.5: icmp_seq=0 ttl=64 time=42.786 ms -64 bytes from 10.0.0.5: icmp_seq=1 ttl=64 time=19.255 ms -64 bytes from 10.0.0.5: icmp_seq=2 ttl=64 time=20.440 ms -64 bytes from 10.0.0.5: icmp_seq=3 ttl=64 time=21.036 ms ---- 10.0.0.5 ping statistics --- -4 packets transmitted, 4 packets received, 0% packet loss -round-trip min/avg/max/stddev = 19.255/25.879/42.786/9.782 ms - -corp-net# ping 10.246.38.1 -PING 10.246.38.1 (10.246.38.1): 56 data bytes -64 bytes from 10.246.38.1: icmp_seq=0 ttl=64 time=28.106 ms -64 bytes from 10.246.38.1: icmp_seq=1 ttl=64 time=42.917 ms -64 bytes from 10.246.38.1: icmp_seq=2 ttl=64 time=127.525 ms -64 bytes from 10.246.38.1: icmp_seq=3 ttl=64 time=119.896 ms -64 bytes from 10.246.38.1: icmp_seq=4 ttl=64 time=154.524 ms ---- 10.246.38.1 ping statistics --- -5 packets transmitted, 5 packets received, 0% packet loss -round-trip min/avg/max/stddev = 28.106/94.594/154.524/49.814 ms - - As expected, both sides have the ability to send and - receive ICMP packets from the privately - configured addresses. Next, both gateways must be told how to - route packets in order to correctly send traffic from either - network. The following commands will achieve this - goal: - - corp-net# route add 10.0.0.0 10.0.0.5 255.255.255.0 -corp-net# route add net 10.0.0.0: gateway 10.0.0.5 -priv-net# route add 10.246.38.0 10.246.38.1 255.255.255.0 -priv-net# route add host 10.246.38.0: gateway 10.246.38.1 - - At this point, internal machines should be reachable from - each gateway as well as from machines behind the gateways. - Again, use ping8 to confirm: - - corp-net# ping 10.0.0.8 -PING 10.0.0.8 (10.0.0.8): 56 data bytes -64 bytes from 10.0.0.8: icmp_seq=0 ttl=63 time=92.391 ms -64 bytes from 10.0.0.8: icmp_seq=1 ttl=63 time=21.870 ms -64 bytes from 10.0.0.8: icmp_seq=2 ttl=63 time=198.022 ms -64 bytes from 10.0.0.8: icmp_seq=3 ttl=63 time=22.241 ms -64 bytes from 10.0.0.8: icmp_seq=4 ttl=63 time=174.705 ms ---- 10.0.0.8 ping statistics --- -5 packets transmitted, 5 packets received, 0% packet loss -round-trip min/avg/max/stddev = 21.870/101.846/198.022/74.001 ms - -priv-net# ping 10.246.38.107 -PING 10.246.38.1 (10.246.38.107): 56 data bytes -64 bytes from 10.246.38.107: icmp_seq=0 ttl=64 time=53.491 ms -64 bytes from 10.246.38.107: icmp_seq=1 ttl=64 time=23.395 ms -64 bytes from 10.246.38.107: icmp_seq=2 ttl=64 time=23.865 ms -64 bytes from 10.246.38.107: icmp_seq=3 ttl=64 time=21.145 ms -64 bytes from 10.246.38.107: icmp_seq=4 ttl=64 time=36.708 ms ---- 10.246.38.107 ping statistics --- -5 packets transmitted, 5 packets received, 0% packet loss -round-trip min/avg/max/stddev = 21.145/31.721/53.491/12.179 ms - - Setting up the tunnels is the easy part. Configuring a - secure link is a more in depth process. The following - configuration uses pre-shared (PSK) - RSA keys. Other than the - IP addresses, the - /usr/local/etc/racoon/racoon.conf on both - gateways will be identical and look similar to: - - path pre_shared_key "/usr/local/etc/racoon/psk.txt"; #location of pre-shared key file -log debug; #log verbosity setting: set to 'notify' when testing and debugging is complete - -padding # options are not to be changed -{ - maximum_length 20; - randomize off; - strict_check off; - exclusive_tail off; -} - -timer # timing options. change as needed -{ - counter 5; - interval 20 sec; - persend 1; -# natt_keepalive 15 sec; - phase1 30 sec; - phase2 15 sec; -} - -listen # address [port] that racoon will listen on -{ - isakmp 172.16.5.4 [500]; - isakmp_natt 172.16.5.4 [4500]; -} - -remote 192.168.1.12 [500] -{ - exchange_mode main,aggressive; - doi ipsec_doi; - situation identity_only; - my_identifier address 172.16.5.4; - peers_identifier address 192.168.1.12; - lifetime time 8 hour; - passive off; - proposal_check obey; -# nat_traversal off; - generate_policy off; - - proposal { - encryption_algorithm blowfish; - hash_algorithm md5; - authentication_method pre_shared_key; - lifetime time 30 sec; - dh_group 1; - } -} - -sainfo (address 10.246.38.0/24 any address 10.0.0.0/24 any) # address $network/$netmask $type address $network/$netmask $type ( $type being any or esp) -{ # $network must be the two internal networks you are joining. - pfs_group 1; - lifetime time 36000 sec; - encryption_algorithm blowfish,3des; - authentication_algorithm hmac_md5,hmac_sha1; - compression_algorithm deflate; -} - - For descriptions of each available option, refer to the - manual page for racoon.conf. - - The Security Policy Database (SPD) - needs to be configured so that FreeBSD and - racoon are able to encrypt and - decrypt network traffic between the hosts. - - This can be achieved with a shell script, similar to the - following, on the corporate gateway. This file will be used - during system initialization and should be saved as - /usr/local/etc/racoon/setkey.conf. - - flush; -spdflush; -# To the home network -spdadd 10.246.38.0/24 10.0.0.0/24 any -P out ipsec esp/tunnel/172.16.5.4-192.168.1.12/use; -spdadd 10.0.0.0/24 10.246.38.0/24 any -P in ipsec esp/tunnel/192.168.1.12-172.16.5.4/use; - - Once in place, racoon may be - started on both gateways using the following command: - - # /usr/local/sbin/racoon -F -f /usr/local/etc/racoon/racoon.conf -l /var/log/racoon.log - - The output should be similar to the following: - - corp-net# /usr/local/sbin/racoon -F -f /usr/local/etc/racoon/racoon.conf -Foreground mode. -2006-01-30 01:35:47: INFO: begin Identity Protection mode. -2006-01-30 01:35:48: INFO: received Vendor ID: KAME/racoon -2006-01-30 01:35:55: INFO: received Vendor ID: KAME/racoon -2006-01-30 01:36:04: INFO: ISAKMP-SA established 172.16.5.4[500]-192.168.1.12[500] spi:623b9b3bd2492452:7deab82d54ff704a -2006-01-30 01:36:05: INFO: initiate new phase 2 negotiation: 172.16.5.4[0]192.168.1.12[0] -2006-01-30 01:36:09: INFO: IPsec-SA established: ESP/Tunnel 192.168.1.12[0]->172.16.5.4[0] spi=28496098(0x1b2d0e2) -2006-01-30 01:36:09: INFO: IPsec-SA established: ESP/Tunnel 172.16.5.4[0]->192.168.1.12[0] spi=47784998(0x2d92426) -2006-01-30 01:36:13: INFO: respond new phase 2 negotiation: 172.16.5.4[0]192.168.1.12[0] -2006-01-30 01:36:18: INFO: IPsec-SA established: ESP/Tunnel 192.168.1.12[0]->172.16.5.4[0] spi=124397467(0x76a279b) -2006-01-30 01:36:18: INFO: IPsec-SA established: ESP/Tunnel 172.16.5.4[0]->192.168.1.12[0] spi=175852902(0xa7b4d66) - - To ensure the tunnel is working properly, switch to - another console and use tcpdump1 to view network - traffic using the following command. Replace - em0 with the network interface card as - required: - - # tcpdump -i em0 host 172.16.5.4 and dst 192.168.1.12 - - Data similar to the following should appear on the - console. If not, there is an issue and debugging the - returned data will be required. - - 01:47:32.021683 IP corporatenetwork.com > 192.168.1.12.privatenetwork.com: ESP(spi=0x02acbf9f,seq=0xa) -01:47:33.022442 IP corporatenetwork.com > 192.168.1.12.privatenetwork.com: ESP(spi=0x02acbf9f,seq=0xb) -01:47:34.024218 IP corporatenetwork.com > 192.168.1.12.privatenetwork.com: ESP(spi=0x02acbf9f,seq=0xc) - - At this point, both networks should be available and seem - to be part of the same network. Most likely both networks are - protected by a firewall. To allow traffic to flow between - them, rules need to be added to pass packets. For the - ipfw8 firewall, add the following lines to the firewall - configuration file: - - ipfw add 00201 allow log esp from any to any -ipfw add 00202 allow log ah from any to any -ipfw add 00203 allow log ipencap from any to any -ipfw add 00204 allow log udp from any 500 to any - - - The rule numbers may need to be altered depending on the - current host configuration. - - - For users of pf4 or ipf8, the following - rules should do the trick: - - pass in quick proto esp from any to any -pass in quick proto ah from any to any -pass in quick proto ipencap from any to any -pass in quick proto udp from any port = 500 to any port = 500 -pass in quick on gif0 from any to any -pass out quick proto esp from any to any -pass out quick proto ah from any to any -pass out quick proto ipencap from any to any -pass out quick proto udp from any port = 500 to any port = 500 -pass out quick on gif0 from any to any - - Finally, to allow the machine to start support for the - VPN during system initialization, add the - following lines to /etc/rc.conf: - - ipsec_enable="YES" -ipsec_program="/usr/local/sbin/setkey" -ipsec_file="/usr/local/etc/racoon/setkey.conf" # allows setting up spd policies on boot -racoon_enable="yes" -
-
- - - - OpenSSH - - - ChernLeeContributed - by - - - - - OpenSSH - - security - OpenSSH - - - OpenSSH 是一套網路連線工具,可安全的存取遠端的主機,此外,透過 SSH 連線可以建立 TCP/IP 連線通道或安全的轉送 TCP/IP 的封包。OpenSSH 會對所有傳輸的資料做加密,可有效的避免竊聽 (Eavesdropping)、或連線劫持 (Connection hijacking) 與其他網路層的攻擊。 - - OpenSSH 由 OpenBSD 專案所維護且在 FreeBSD 預設會安裝,它可同時相容 SSH 版本 1 與 2 通訊協定。 - - 當以未加密的方式在網路上傳送資料時,任何在客戶端與伺服器之間的網路竊聽程式 (Network sniffer) 皆可竊取使用者/密碼資訊或者在連線階段傳送的資料,OpenSSH 提供了數種認証與加密方式來避免這種事情發生。更多有關 OpenSSH 的資訊可於 http://www.openssh.com/ 取得。 - - 本節會簡單介紹如何使用內建的客戶端工具安全的存取其他系統及安全的傳輸檔案到 FreeBSD 系統,然後會說明如何設定在 FreeBSD 系統上的 SSH 伺服器。更多的資訊可於本章節所提及的操作手冊 (Man page) 取得。 - - - 使用 SSH 客戶端工具 - - - OpenSSH - client - - - 要登入一台 SSH 伺服器,可使用 ssh 然後指定在伺服器上存在的使用者名稱與 IP 位址或伺服器的主機名稱。若這是第一次連線到指定的伺服器,會提示該使用者伺服器的指紋做第一次檢驗: - - # ssh user@example.com -The authenticity of host 'example.com (10.0.0.1)' can't be established. -ECDSA key fingerprint is 25:cc:73:b5:b3:96:75:3d:56:19:49:d2:5c:1f:91:3b. -Are you sure you want to continue connecting (yes/no)? yes -Permanently added 'example.com' (ECDSA) to the list of known hosts. -Password for user@example.com: user_password - - SSH 會在客戶端連線時利用金鑰指紋 (Key fingerprint) 系統來驗證伺服器的真偽,當使用者在第一次連線時輸入 yes 接受了這個金鑰指紋,便會將該金鑰的複本儲存到使用者家目錄的 .ssh/known_hosts,未來嘗試登入時便會以這個存好的金鑰來驗證,若伺服器的金鑰與儲存的金鑰不同將會顯示警告訊息。若出現這個警告時,使用者應在繼續連線之前檢查金鑰變動的原因。 - - 最近版本的 OpenSSH 預設只會接受 SSHv2 的連線。客戶端預設會盡可能使用版本 2 的通訊協定,若伺服器不支援版本 2 的通訊協定便會向下相容版本 1 的協定。要強制 ssh 只能使用指定的通訊協定,可使用 ,其他的選項在 ssh1 中有說明。 - - - OpenSSH - secure copy - - - scp1 - - - 使用 scp1 可從遠端主機安全的複製一個檔案,以下範例會複製在遠端主機的 COPYRIGHT 到本地主機的目前目錄: - - # scp user@example.com:/COPYRIGHT COPYRIGHT -Password for user@example.com: ******* -COPYRIGHT 100% |*****************************| 4735 -00:00 -# - - 由於這個主機的指紋已驗證過,在提示用者輸入密碼之前伺服器的金鑰已自動檢查。 - - 傳給 scp 的參數與傳給 cp 的參數相似。第一個參數是要複製的檔案,第二個參數是目地,由於檔案是透過網路取得,檔案參數需要使用 格式。注意,在 scp 要遞迴複製目錄是使用 ,如同 cp 使用 - - 要開啟可互動的連線來複製檔案可使用 sftp,請參考 sftp1 來取得在 sftp 連線時可用的指令清單。 - - - 以金鑰為基礎的認證 - - 除了使用密碼之外,客戶端可以設定成使用金鑰來連線到遠端的主機。要產生 RSA 認証金鑰可使用 ssh-keygen。要產生成對的公鑰與私鑰,可指定金鑰的類型並依提示操作。建議使用容易記住但較難猜出的密碼來保護這個金鑰。 - - % ssh-keygen -t rsa -Generating public/private rsa key pair. -Enter file in which to save the key (/home/user/.ssh/id_rsa): -Enter passphrase (empty for no passphrase): -Enter same passphrase again: -Your identification has been saved in /home/user/.ssh/id_rsa. -Your public key has been saved in /home/user/.ssh/id_rsa.pub. -The key fingerprint is: -SHA256:54Xm9Uvtv6H4NOo6yjP/YCfODryvUU7yWHzMqeXwhq8 user@host.example.com -The key's randomart image is: -+---[RSA 2048]----+ -| | -| | -| | -| . o.. | -| .S*+*o | -| . O=Oo . . | -| = Oo= oo..| -| .oB.* +.oo.| -| =OE**.o..=| -+----[SHA256]-----+ - - - - 在此輸入密碼,密碼不可含有空白或符號。 - - - - 再輸入一次密碼驗證。 - - - - - 私鑰會儲存於 ~/.ssh/id_rsa 而公鑰會儲存於 ~/.ssh/id_rsa.pub公鑰必須複製到遠端主機的~/.ssh/authorized_keys 來讓以金鑰為基礎的認証可以運作。 - - - 許多使用者認為金鑰的設計是安全的並在產生金鑰時未使用密碼,這樣的行為其實很危險。管理者可以手動查看私鑰來檢查金鑰對是否受密碼保護,如果私鑰檔案中包含 ENCRYPTED 字詞,則代表金鑰的擁有者有使用密碼。此外,要更進一步保護最終使用者的安全,可在公鑰檔案中放入 from,例如,在 ssh-rsa 前加上 from="192.168.10.5" 將只允許指定的使用者由該 IP 位址登入。 - - - 不同版本 OpenSSH 的選項與檔案會不同,要避免發生問題請參考 ssh-keygen1 - - 若使用了密碼,在每次連線到伺服器時都會提示使用者輸入密碼。要將 SSH 金鑰載入到記憶體並讓每次連線時不必再輸入密碼,可使用 ssh-agent1ssh-add1 - - 認証可用 ssh-agent 來管理,只要將私鑰載入,ssh-agent 可用在執行其他應用程式,如 Shell 或視窗管理程式。 - - 要在 Shell 使用 ssh-agent,使用 Shell 做為參數來啟動 ssh-agent。執行 ssh-add 來加入識別碼,然後輸入私鑰的密碼。使用者將可使用 ssh 連線到任何有安裝對應公鑰的主機,例如: - - % ssh-agent csh -% ssh-add -Enter passphrase for key '/usr/home/user/.ssh/id_rsa': -Identity added: /usr/home/user/.ssh/id_rsa (/usr/home/user/.ssh/id_rsa) -% - - - - 輸入金鑰的密碼。 - - - - 要在 Xorg 使用 ssh-agent 可在 ~/.xinitrc 加入一個設定項目,這可讓 ssh-agent 對所有在 Xorg 中執行的程式提供服務。~/.xinitrc 範例如下: - - exec ssh-agent startxfce4 - - 這會在每次啟動 Xorg 時,反過來先執行 ssh-agent 再由執行 XFCE,一但 Xorg 被重新啟動,要讓所有變更生效需執行 ssh-add 來載入所有的 SSH 金鑰。 - - - - <acronym>SSH</acronym> 通道 - - - OpenSSH - tunneling - - - OpenSSH 可以建立一個通道 (Tunnel) 來封裝其他通訊協定到一個加密的連線。 - - 以下指令會告訴 ssh 建立一個供 telnet 使用的通道: - - % ssh -2 -N -f -L 5023:localhost:23 user@foo.example.com -% - - 這個例子使用了以下選項: - - - - - - - 強制 ssh 使用版本 2 的通訊協定連線到伺服器。 - - - - - - - - 代表不需下指令、只建立通道。若省略這個選項 ssh 會初始化一個正常的連線。 - - - - - - - - 強制 ssh 在背景執行。 - - - - - - - - 代表這是一個本地通道,使用 localport:remotehost:remoteport 格式。 - - - - - - - - 在指定的遠端 SSH 伺服器要使用的登入名稱。 - - - - - SSH 通道會建立一個傾聽 localhost 指定 localport 的 Socket ,然後會透過 SSH 連線轉送任何在 localport 接收的連線。以這個例子來說在客戶端的 Port 5023 會被轉送到遠端主機的 Port 23,由於 Port 23 是由 telnet 使用,所以這會透過 SSH 通道建立一個加密的 telnet 連線。 - - 這個方法可用來包裝許多不安全的 TCP 通訊協定,例如 SMTP, POP3 以及 FTP,如下例所示。 - - - 建立供 <acronym>SMTP</acronym> 使用的安全通道 - - % ssh -2 -N -f -L 5025:localhost:25 user@mailserver.example.com -user@mailserver.example.com's password: ***** -% telnet localhost 5025 -Trying 127.0.0.1... -Connected to localhost. -Escape character is '^]'. -220 mailserver.example.com ESMTP - - 這可配合 ssh-keygen 與另一個使用者帳號與來建立一個更無縫的 SSH 通道環境,可使用金鑰來代替手動輸入密碼,然後該通道便可以另一個使用者執行。 - - - - 安全存取 <acronym>POP3</acronym> 伺服器 - - 在這個例子中有一個 SSH 伺服器會接受來自外部的連線,在同個網段下有一個郵件伺服器執行 POP3 伺服器。要使用較安全的方式檢查有沒有新郵件可建立一個 SSH 連線到 SSH 伺服器然後透過通道連線到郵件伺服器: - - % ssh -2 -N -f -L 2110:mail.example.com:110 user@ssh-server.example.com -user@ssh-server.example.com's password: ****** - - 一但通道啟動並執行後,指定郵件客戶端將 POP3 請求傳送到 localhost 的 Port 2110,這個連線將會被安全的透過通道轉送到 mail.example.com - - - - 跳過防火牆 - - 有些防火牆會同時過濾傳入與傳出的連線。例如,防火牆很可能會限制來自遠端主機只能存取 Port 22 與 80 來只讓 SSH 與網頁瀏覽器連線,這會使得 Port 使用 22 或 80 以外的服務無法存取。 - - 這問題的解決方法是建立一個 SSH 連線到在防火牆防護之外主機然後使用該連線的通道連到想要使用的服務: - - % ssh -2 -N -f -L 8888:music.example.com:8000 user@unfirewalled-system.example.org -user@unfirewalled-system.example.org's password: ******* - - 在這個例子中,串流 Ogg Vorbis 客戶端現在可以指向 localhost Port 8888,連線將會被轉送到 music.example.com 於 Port 8000,成功的跳過防火牆。 - - - - - - 開啟 SSH 伺服器 - - - OpenSSH - enabling - - - 除了提供內建的 SSH 客戶端工具外,還可以設定 FreeBSD 系統為一個 SSH 伺服器,以接受來自其他 SSH 客戶端的連線。 - - 要查看 sshd 是否正在運作,可使用 service8 指令: - - # service sshd status - - 若服務未執行,請加入下行到 /etc/rc.conf - - sshd_enable="YES" - - 這會讓下次系統開機時啟動 OpenSSH 的 Daemon 程式 sshd。若要立即啟動: - - # service sshd start - - 在 FreeBSD 系統第一次啟動 sshd 時便會自動產生系統的主機金鑰且會顯示指紋在 Console 上,這個指紋可供使用者在第一次連線到伺服器時驗證用。 - - 請參考 sshd8 可取得在啟動 sshd 時可用選項的清單以及更多完整有關認証、登入程序與各種設定檔的資訊。 - - 現在,sshd 應可供所有在系統上有使用者名稱及密碼的使用者使用。 - - - - SSH 伺服器安全性 - - 在 FreeBSD 廣泛使用 sshd 做為遠端管理基礎設施的同時,所有暴露在公有網路上的系統也會時常受到暴力攻擊 (Brute force attack) 與路過攻擊 (Drive by attack)。在本節會介紹一些可用來避免這些攻擊的參數。 - - 使用在 OpenSSH 伺服器設定檔的 AllowUsers 關鍵字限制可以登入到 SSH 伺服器的使用者及來源是一個不錯的方式。例如要只允許來自 192.168.1.32root 登入,可加入下行到 /etc/ssh/sshd_config - - AllowUsers root@192.168.1.32 - - 要允許來自任何地方的 admin 登入,可只列出使用者名稱,不指定 IP 位址: - - AllowUsers admin - - 有多位使用者也應列在同一行,例如: - - AllowUsers root@192.168.1.32 admin - - 在對 /etc/ssh/sshd_config 做完變更後,執行以下指令告訴 sshd 重新載入設定檔: - - # service sshd reload - - - 在使用了這個關鍵字時,列出每一位需要登入此主機的使用者很重要,任何未被在該行指定的使用者將無法登入。同時,在 OpenSSH 伺服器設定檔使用的關鍵字是區分大小寫的,若關鍵字未正確的拼寫 (含其大小寫),則將會被忽略,永遠要記得測試對這個檔案所做的更改來確保伺服器有如預期的方式運作。請參考 sshd_config5 來檢查拼寫以及可用的關鍵字。 - - - 此外,使用者可能被強制要透過公鑰與私鑰使用雙重認證 (Two factor authentication)。當需要時,使用者可以透過使用 ssh-keygen1 產生一堆金鑰然後將公鑰傳送給管理者,這個金鑰檔會如以上在客戶端章節所述的被放在 authorized_keys。要強制使用者只能使用這個金鑰,可能需要設定以下選項: - - AuthenticationMethods publickey - - - 請不要將 /etc/ssh/sshd_config 以及 /etc/ssh/ssh_config 搞混 (注意在第一節檔名有多出個 d),第一個檔案用來設定伺服器,而第二個檔案用來設定客戶端。請參考 ssh_config5 來取得可用的客戶端設定清單。 - - - - - - - 存取控制清單 - - - TomRhodesContributed - by - - - - - ACL - - - Access Control Lists (ACLs) extend the - standard UNIX permission model in a POSIX.1e compatible way. - This permits an administrator to take advantage of a more - fine-grained permissions model. - - The FreeBSD GENERIC kernel provides - ACL support for UFS file - systems. Users who prefer to compile a custom kernel must - include the following option in their custom kernel - configuration file: - - options UFS_ACL - - If this option is not compiled in, a warning message will be - displayed when attempting to mount a file system with - ACL support. ACLs rely on - extended attributes which are natively supported in - UFS2. - - This chapter describes how to enable - ACL support and provides some usage - examples. - - - 開啟 <acronym>ACL</acronym> 支援 - - ACLs are enabled by the mount-time - administrative flag, , which may be added - to /etc/fstab. The mount-time flag can - also be automatically set in a persistent manner using - tunefs8 to modify a superblock ACLs - flag in the file system header. In general, it is preferred - to use the superblock flag for several reasons: - - - - The superblock flag cannot be changed by a remount - using as it requires a complete - umount and fresh - mount. This means that - ACLs cannot be enabled on the root file - system after boot. It also means that - ACL support on a file system cannot be - changed while the system is in use. - - - - Setting the superblock flag causes the file system to - always be mounted with ACLs enabled, - even if there is not an fstab entry - or if the devices re-order. This prevents accidental - mounting of the file system without ACL - support. - - - - - It is desirable to discourage accidental mounting - without ACLs enabled because nasty things - can happen if ACLs are enabled, then - disabled, then re-enabled without flushing the extended - attributes. In general, once ACLs are - enabled on a file system, they should not be disabled, as - the resulting file protections may not be compatible with - those intended by the users of the system, and re-enabling - ACLs may re-attach the previous - ACLs to files that have since had their - permissions changed, resulting in unpredictable - behavior. - - - File systems with ACLs enabled will - show a plus (+) sign in their permission - settings: - - drwx------ 2 robert robert 512 Dec 27 11:54 private -drwxrwx---+ 2 robert robert 512 Dec 23 10:57 directory1 -drwxrwx---+ 2 robert robert 512 Dec 22 10:20 directory2 -drwxrwx---+ 2 robert robert 512 Dec 27 11:57 directory3 -drwxr-xr-x 2 robert robert 512 Nov 10 11:54 public_html - - In this example, directory1, - directory2, and - directory3 are all taking advantage of - ACLs, whereas - public_html is not. - - - - 使用 <acronym>ACL</acronym> - - File system ACLs can be viewed using - getfacl. For instance, to view the - ACL settings on - test: - - % getfacl test - #file:test - #owner:1001 - #group:1001 - user::rw- - group::r-- - other::r-- - - To change the ACL settings on this - file, use setfacl. To remove all of the - currently defined ACLs from a file or file - system, include . However, the preferred - method is to use as it leaves the basic - fields required for ACLs to work. - - % setfacl -k test - - To modify the default ACL entries, use - : - - % setfacl -m u:trhodes:rwx,group:web:r--,o::--- test - - In this example, there were no pre-defined entries, as - they were removed by the previous command. This command - restores the default options and assigns the options listed. - If a user or group is added which does not exist on the - system, an Invalid argument error will - be displayed. - - Refer to getfacl1 and setfacl1 for more - information about the options available for these - commands. - - - - - - 監視第三方安全性問題 - - - TomRhodesContributed - by - - - - - pkg - - - In recent years, the security world has made many - improvements to how vulnerability assessment is handled. The - threat of system intrusion increases as third party utilities - are installed and configured for virtually any operating - system available today. - - Vulnerability assessment is a key factor in security. - While FreeBSD releases advisories for the base system, doing so - for every third party utility is beyond the FreeBSD Project's - capability. There is a way to mitigate third party - vulnerabilities and warn administrators of known security - issues. A FreeBSD add on utility known as - pkg includes options explicitly for - this purpose. - - pkg polls a database for security - issues. The database is updated and maintained by the FreeBSD - Security Team and ports developers. - - Please refer to instructions - for installing - pkg. - - Installation provides periodic8 configuration files - for maintaining the pkg audit - database, and provides a programmatic method of keeping it - updated. This functionality is enabled if - daily_status_security_pkgaudit_enable - is set to YES in periodic.conf5. - Ensure that daily security run emails, which are sent to - root's email account, - are being read. - - After installation, and to audit third party utilities as - part of the Ports Collection at any time, an administrator may - choose to update the database and view known vulnerabilities - of installed packages by invoking: - - # pkg audit -F - - pkg displays messages - any published vulnerabilities in installed packages: - - Affected package: cups-base-1.1.22.0_1 -Type of problem: cups-base -- HPGL buffer overflow vulnerability. -Reference: <https://www.FreeBSD.org/ports/portaudit/40a3bca2-6809-11d9-a9e7-0001020eed82.html> - -1 problem(s) in your installed packages found. - -You are advised to update or deinstall the affected package(s) immediately. - - By pointing a web browser to the displayed - URL, an administrator may obtain more - information about the vulnerability. This will include the - versions affected, by FreeBSD port version, along with other web - sites which may contain security advisories. - - pkg is a powerful utility - and is extremely useful when coupled with - ports-mgmt/portmaster. - - - - - FreeBSD 安全報告 - - - TomRhodesContributed - by - - - - - FreeBSD Security Advisories - - - Like many producers of quality operating systems, the FreeBSD - Project has a security team which is responsible for - determining the End-of-Life (EoL) date for - each FreeBSD release and to provide security updates for supported - releases which have not yet reached their - EoL. More information about the FreeBSD - security team and the supported releases is available on the - FreeBSD security - page. - - One task of the security team is to respond to reported - security vulnerabilities in the FreeBSD operating system. Once a - vulnerability is confirmed, the security team verifies the steps - necessary to fix the vulnerability and updates the source code - with the fix. It then publishes the details as a - Security Advisory. Security - advisories are published on the FreeBSD - website and mailed to the - freebsd-security-notifications, freebsd-security, and - freebsd-announce mailing lists. - - This section describes the format of a FreeBSD security - advisory. - - - 安全報告的格式 - - Here is an example of a FreeBSD security advisory: - - ============================================================================= ------BEGIN PGP SIGNED MESSAGE----- -Hash: SHA512 - -============================================================================= -FreeBSD-SA-14:04.bind Security Advisory - The FreeBSD Project - -Topic: BIND remote denial of service vulnerability - -Category: contrib -Module: bind -Announced: 2014-01-14 -Credits: ISC -Affects: FreeBSD 8.x and FreeBSD 9.x -Corrected: 2014-01-14 19:38:37 UTC (stable/9, 9.2-STABLE) - 2014-01-14 19:42:28 UTC (releng/9.2, 9.2-RELEASE-p3) - 2014-01-14 19:42:28 UTC (releng/9.1, 9.1-RELEASE-p10) - 2014-01-14 19:38:37 UTC (stable/8, 8.4-STABLE) - 2014-01-14 19:42:28 UTC (releng/8.4, 8.4-RELEASE-p7) - 2014-01-14 19:42:28 UTC (releng/8.3, 8.3-RELEASE-p14) -CVE Name: CVE-2014-0591 - -For general information regarding FreeBSD Security Advisories, -including descriptions of the fields above, security branches, and the -following sections, please visit <URL:http://security.FreeBSD.org/>. - -I. Background - -BIND 9 is an implementation of the Domain Name System (DNS) protocols. -The named(8) daemon is an Internet Domain Name Server. - -II. Problem Description - -Because of a defect in handling queries for NSEC3-signed zones, BIND can -crash with an "INSIST" failure in name.c when processing queries possessing -certain properties. This issue only affects authoritative nameservers with -at least one NSEC3-signed zone. Recursive-only servers are not at risk. - -III. Impact - -An attacker who can send a specially crafted query could cause named(8) -to crash, resulting in a denial of service. - -IV. Workaround - -No workaround is available, but systems not running authoritative DNS service -with at least one NSEC3-signed zone using named(8) are not vulnerable. - -V. Solution - -Perform one of the following: - -1) Upgrade your vulnerable system to a supported FreeBSD stable or -release / security branch (releng) dated after the correction date. - -2) To update your vulnerable system via a source code patch: - -The following patches have been verified to apply to the applicable -FreeBSD release branches. - -a) Download the relevant patch from the location below, and verify the -detached PGP signature using your PGP utility. - -[FreeBSD 8.3, 8.4, 9.1, 9.2-RELEASE and 8.4-STABLE] -# fetch http://security.FreeBSD.org/patches/SA-14:04/bind-release.patch -# fetch http://security.FreeBSD.org/patches/SA-14:04/bind-release.patch.asc -# gpg --verify bind-release.patch.asc - -[FreeBSD 9.2-STABLE] -# fetch http://security.FreeBSD.org/patches/SA-14:04/bind-stable-9.patch -# fetch http://security.FreeBSD.org/patches/SA-14:04/bind-stable-9.patch.asc -# gpg --verify bind-stable-9.patch.asc - -b) Execute the following commands as root: - -# cd /usr/src -# patch < /path/to/patch - -Recompile the operating system using buildworld and installworld as -described in <URL:https://www.FreeBSD.org/handbook/makeworld.html>. - -Restart the applicable daemons, or reboot the system. - -3) To update your vulnerable system via a binary patch: - -Systems running a RELEASE version of FreeBSD on the i386 or amd64 -platforms can be updated via the freebsd-update(8) utility: - -# freebsd-update fetch -# freebsd-update install - -VI. Correction details - -The following list contains the correction revision numbers for each -affected branch. - -Branch/path Revision -- ------------------------------------------------------------------------- -stable/8/ r260646 -releng/8.3/ r260647 -releng/8.4/ r260647 -stable/9/ r260646 -releng/9.1/ r260647 -releng/9.2/ r260647 -- ------------------------------------------------------------------------- - -To see which files were modified by a particular revision, run the -following command, replacing NNNNNN with the revision number, on a -machine with Subversion installed: - -# svn diff -cNNNNNN --summarize svn://svn.freebsd.org/base - -Or visit the following URL, replacing NNNNNN with the revision number: - -<URL:https://svnweb.freebsd.org/base?view=revision&revision=NNNNNN> - -VII. References - -<URL:https://kb.isc.org/article/AA-01078> - -<URL:http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2014-0591> - -The latest revision of this advisory is available at -<URL:http://security.FreeBSD.org/advisories/FreeBSD-SA-14:04.bind.asc> ------BEGIN PGP SIGNATURE----- - -iQIcBAEBCgAGBQJS1ZTYAAoJEO1n7NZdz2rnOvQP/2/68/s9Cu35PmqNtSZVVxVG -ZSQP5EGWx/lramNf9566iKxOrLRMq/h3XWcC4goVd+gZFrvITJSVOWSa7ntDQ7TO -XcinfRZ/iyiJbs/Rg2wLHc/t5oVSyeouyccqODYFbOwOlk35JjOTMUG1YcX+Zasg -ax8RV+7Zt1QSBkMlOz/myBLXUjlTZ3Xg2FXVsfFQW5/g2CjuHpRSFx1bVNX6ysoG -9DT58EQcYxIS8WfkHRbbXKh9I1nSfZ7/Hky/kTafRdRMrjAgbqFgHkYTYsBZeav5 -fYWKGQRJulYfeZQ90yMTvlpF42DjCC3uJYamJnwDIu8OhS1WRBI8fQfr9DRzmRua -OK3BK9hUiScDZOJB6OqeVzUTfe7MAA4/UwrDtTYQ+PqAenv1PK8DZqwXyxA9ThHb -zKO3OwuKOVHJnKvpOcr+eNwo7jbnHlis0oBksj/mrq2P9m2ueF9gzCiq5Ri5Syag -Wssb1HUoMGwqU0roS8+pRpNC8YgsWpsttvUWSZ8u6Vj/FLeHpiV3mYXPVMaKRhVm -067BA2uj4Th1JKtGleox+Em0R7OFbCc/9aWC67wiqI6KRyit9pYiF3npph+7D5Eq -7zPsUdDd+qc+UTiLp3liCRp5w6484wWdhZO6wRtmUgxGjNkxFoNnX8CitzF8AaqO -UWWemqWuz3lAZuORQ9KX -=OQzQ ------END PGP SIGNATURE----- - - Every security advisory uses the following format: - - - - Each security advisory is signed by the - PGP key of the Security Officer. The - public key for the Security Officer can be verified at - . - - - - The name of the security advisory always begins with - FreeBSD-SA- (for FreeBSD Security - Advisory), followed by the year in two digit format - (14:), followed by the advisory number - for that year (04.), followed by the - name of the affected application or subsystem - (bind). The advisory shown here is the - fourth advisory for 2014 and it affects - BIND. - - - - The Topic field summarizes the - vulnerability. - - - - The Category refers to the - affected part of the system which may be one of - core, contrib, or - ports. The core - category means that the vulnerability affects a core - component of the FreeBSD operating system. The - contrib category means that the - vulnerability affects software included with FreeBSD, - such as BIND. The - ports category indicates that the - vulnerability affects software available through the Ports - Collection. - - - - The Module field refers to the - component location. In this example, the - bind module is affected; therefore, - this vulnerability affects an application installed with - the operating system. - - - - The Announced field reflects the - date the security advisory was published. This means - that the security team has verified that the problem - exists and that a patch has been committed to the FreeBSD - source code repository. - - - - The Credits field gives credit to - the individual or organization who noticed the - vulnerability and reported it. - - - - The Affects field explains which - releases of FreeBSD are affected by this - vulnerability. - - - - The Corrected field indicates the - date, time, time offset, and releases that were - corrected. The section in parentheses shows each branch - for which the fix has been merged, and the version number - of the corresponding release from that branch. The - release identifier itself includes the version number - and, if appropriate, the patch level. The patch level is - the letter p followed by a number, - indicating the sequence number of the patch, allowing - users to track which patches have already been applied to - the system. - - - - The CVE Name field lists the - advisory number, if one exists, in the public cve.mitre.org - security vulnerabilities database. - - - - The Background field provides a - description of the affected module. - - - - The Problem Description field - explains the vulnerability. This can include - information about the flawed code and how the utility - could be maliciously used. - - - - The Impact field describes what - type of impact the problem could have on a system. - - - - The Workaround field indicates if - a workaround is available to system administrators who - cannot immediately patch the system . - - - - The Solution field provides the - instructions for patching the affected system. This is a - step by step tested and verified method for getting a - system patched and working securely. - - - - The Correction Details field - displays each affected Subversion branch with the revision - number that contains the corrected code. - - - - The References field offers sources - of additional information regarding the - vulnerability. - - - - - - - - 程序追蹤 - - - TomRhodesContributed - by - - - - - Process Accounting - - - Process accounting is a security method in which an - administrator may keep track of system resources used and - their allocation among users, provide for system monitoring, - and minimally track a user's commands. - - Process accounting has both positive and negative points. - One of the positives is that an intrusion may be narrowed down - to the point of entry. A negative is the amount of logs - generated by process accounting, and the disk space they may - require. This section walks an administrator through the basics - of process accounting. - - - If more fine-grained accounting is needed, refer to - . - - - - 開啟並使用程序追蹤 - - Before using process accounting, it must be enabled using - the following commands: - - # sysrc accounting_enable=yes -# service accounting start - - The accounting information is stored in files located in - /var/account, which is automatically created, - if necessary, the first time the accounting service starts. - These files contain sensitive information, including all the - commands issued by all users. Write access to the files is - limited to root, - and read access is limited to root and members of the - wheel group. - To also prevent members of wheel from reading the files, - change the mode of the /var/account - directory to allow access only by root. - - Once enabled, accounting will begin to track information - such as CPU statistics and executed - commands. All accounting logs are in a non-human readable - format which can be viewed using sa. If - issued without any options, sa prints - information relating to the number of per-user calls, the - total elapsed time in minutes, total CPU - and user time in minutes, and the average number of - I/O operations. Refer to sa8 for - the list of available options which control the output. - - To display the commands issued by users, use - lastcomm. For example, this command - prints out all usage of ls by trhodes on the - ttyp1 terminal: - - # lastcomm ls trhodes ttyp1 - - Many other useful options exist and are explained in - lastcomm1, acct5, and sa8. - - - - - - 限制資源 - - - TomRhodesContributed - by - - - - - Resource limits - - - FreeBSD provides several methods for an administrator to - limit the amount of system resources an individual may use. - Disk quotas limit the amount of disk space available to users. - Quotas are discussed in . - - - quotas - - - limiting users - quotas - - - disk quotas - - - Limits to other resources, such as CPU - and memory, can be set using either a flat file or a command to - configure a resource limits database. The traditional method - defines login classes by editing - /etc/login.conf. While this method is - still supported, any changes require a multi-step process of - editing this file, rebuilding the resource database, making - necessary changes to /etc/master.passwd, - and rebuilding the password database. This can become time - consuming, depending upon the number of users to - configure. - - rctl can be used to provide a more - fine-grained method for controlling resource limits. This - command supports more than user limits as it can also be used to - set resource constraints on processes and jails. - - This section demonstrates both methods for controlling - resources, beginning with the traditional method. - - - 設定登入類別 - - - limiting users - - - accounts - limiting - - - /etc/login.conf - - - In the traditional method, login classes and the resource - limits to apply to a login class are defined in - /etc/login.conf. Each user account can - be assigned to a login class, where default - is the default login class. Each login class has a set of - login capabilities associated with it. A login capability is - a - name=value - pair, where name is a well-known - identifier and value is an - arbitrary string which is processed accordingly depending on - the name. - - - Whenever /etc/login.conf is edited, - the /etc/login.conf.db must be updated - by executing the following command: - - # cap_mkdb /etc/login.conf - - - Resource limits differ from the default login capabilities - in two ways. First, for every limit, there is a - soft and hard - limit. A soft limit may be adjusted by the user or - application, but may not be set higher than the hard limit. - The hard limit may be lowered by the user, but can only be - raised by the superuser. Second, most resource limits apply - per process to a specific user. - - lists the most commonly - used resource limits. All of the available resource limits - and capabilities are described in detail in - login.conf5. - - - limiting users - coredumpsize - - - limiting users - cputime - - - limiting users - filesize - - - limiting users - maxproc - - - limiting users - memorylocked - - - limiting users - memoryuse - - - limiting users - openfiles - - - limiting users - sbsize - - - limiting users - stacksize - - - - 登入類別限制資源類型 - - - - - 限制資源 - 說明 - - - - - - coredumpsize - The limit on the size of a core file generated by - a program is subordinate to other limits on disk - usage, such as filesize or disk - quotas. This limit is often used as a less severe - method of controlling disk space consumption. Since - users do not generate core files and often do not - delete them, this setting may save them from running - out of disk space should a large program - crash. - - - - cputime - The maximum amount of CPU time - a user's process may consume. Offending processes - will be killed by the kernel. This is a limit on - CPU time - consumed, not the percentage of the - CPU as displayed in some of the - fields generated by top and - ps. - - - - filesize - The maximum size of a file the user may own. - Unlike disk quotas (), this - limit is enforced on individual files, not the set of - all files a user owns. - - - - maxproc - The maximum number of foreground and background - processes a user can run. This limit may not be - larger than the system limit specified by - kern.maxproc. Setting this limit - too small may hinder a user's productivity as some - tasks, such as compiling a large program, start lots - of processes. - - - - memorylocked - The maximum amount of memory a process may - request to be locked into main memory using - mlock2. Some system-critical programs, such as - amd8, lock into main memory so that if the - system begins to swap, they do not contribute to disk - thrashing. - - - - memoryuse - The maximum amount of memory a process may - consume at any given time. It includes both core - memory and swap usage. This is not a catch-all limit - for restricting memory consumption, but is a good - start. - - - - openfiles - The maximum number of files a process may have - open. In FreeBSD, files are used to represent sockets - and IPC channels, so be careful not - to set this too low. The system-wide limit for this - is defined by - kern.maxfiles. - - - - sbsize - The limit on the amount of network memory a user - may consume. This can be generally used to limit - network communications. - - - - stacksize - The maximum size of a process stack. This alone - is not sufficient to limit the amount of memory a - program may use, so it should be used in conjunction - with other limits. - - - -
- - There are a few other things to remember when setting - resource limits: - - - - Processes started at system startup by - /etc/rc are assigned to the - daemon login class. - - - - Although the default - /etc/login.conf is a good source of - reasonable values for most limits, they may not be - appropriate for every system. Setting a limit too high - may open the system up to abuse, while setting it too low - may put a strain on productivity. - - - - Xorg takes a lot of - resources and encourages users to run more programs - simultaneously. - - - - Many limits apply to individual processes, not the - user as a whole. For example, setting - openfiles to 50 - means that each process the user runs may open up to - 50 files. The total amount of files a - user may open is the value of openfiles - multiplied by the value of maxproc. - This also applies to memory consumption. - - - - For further information on resource limits and login - classes and capabilities in general, refer to - cap_mkdb1, getrlimit2, and - login.conf5. -
- - - 開啟並設定資源限制 - - The kern.racct.enable tunable must be - set to a non-zero value. Custom kernels require specific - configuration: - - options RACCT -options RCTL - - Once the system has rebooted into the new kernel, - rctl may be used to set rules for the - system. - - Rule syntax is controlled through the use of a subject, - subject-id, resource, and action, as seen in this example - rule: - - user:trhodes:maxproc:deny=10/user - - In this rule, the subject is user, the - subject-id is trhodes, the resource, - maxproc, is the maximum number of - processes, and the action is deny, which - blocks any new processes from being created. This means that - the user, trhodes, will be constrained to - no greater than 10 processes. Other - possible actions include logging to the console, passing a - notification to devd8, or sending a sigterm to the - process. - - Some care must be taken when adding rules. Since this - user is constrained to 10 processes, this - example will prevent the user from performing other tasks - after logging in and executing a - screen session. Once a resource limit has - been hit, an error will be printed, as in this example: - - % man test - /usr/bin/man: Cannot fork: Resource temporarily unavailable -eval: Cannot fork: Resource temporarily unavailable - - As another example, a jail can be prevented from exceeding - a memory limit. This rule could be written as: - - # rctl -a jail:httpd:memoryuse:deny=2G/jail - - Rules will persist across reboots if they have been added - to /etc/rctl.conf. The format is a rule, - without the preceding command. For example, the previous rule - could be added as: - - # Block jail from using more than 2G memory: -jail:httpd:memoryuse:deny=2G/jail - - To remove a rule, use rctl to remove it - from the list: - - # rctl -r user:trhodes:maxproc:deny=10/user - - A method for removing all rules is documented in - rctl8. However, if removing all rules for a single - user is required, this command may be issued: - - # rctl -r user:trhodes - - Many other resources exist which can be used to exert - additional control over various subjects. - See rctl8 to learn about them. - -
- - - - 使用 Sudo 分享管理權限 - - - TomRhodesContributed - by - - - - - Security - Sudo - - - 系統管理者通常會要能夠授予額外的權限給其他使用者,以讓這些使用者可以執行需權限的工作。要讓團隊成員可以存取 FreeBSD 系統來完成其特定的工作對所有管理者都會帶來挑戰,這些團隊成員通常只需要比一般使用者多出一些存取權限便可作業,但他們總是會告訴管理者若沒有超級使用者的存取權便無法完成其工作。幸好,有工具可以管理這類的需求,這樣便不需提供這麼大的權限給一般使用者。 - - 到目前為止,安全性章節已說明了如何允許已授權的使用者存取以及嘗試防止未經授權的存取,而現在有另一個問題,是由已授權的使用者擁有權限存取系統資源造成的。在很多的情況,使用者會需要存取應用程式啟動 Script 的權限或是管理者團隊需要維護系統,以往會使用標準的使用者與群組、檔案權限、甚至是 su1 指令來管理存取權,但當應用程式需要更多存取權,更多使用者需要使用系統資源時,便需要更好的解決方案,目前最常用來解決此問題的應用程式便是 Sudo - - Sudo 讓管理者可以對系統指令的存取設下更嚴格的限制並提供進階的記錄功能。如同其他工具,它可自 Port 套件集取得,於其中的 security/sudo,或使用 pkg8 工具取得,若要使用 pkg8 工具可: - - # pkg install sudo - - 安裝完成之後,可用安裝的 visudo 以文字編輯器開啟設定檔,強烈建議使用 visudo 來編輯設定檔,由於它有內建的語法檢查程式可在檔案儲存之前檢驗是否有誤。 - - 設定檔由個小節所組成,透過這些小節可做常廣泛的設定,在以下的範例中,網站應用程式維護人員 user1 需要啟動、停止與重新啟動名稱為 webservice 的網站應用程式 。要授權此使用者執行這些工作的權限,可加入此行到 /usr/local/etc/sudoers 的最後: - - user1 ALL=(ALL) /usr/sbin/service webservice * - - 現在使用者可使用此指令來啟動 webservice - - % sudo /usr/sbin/service webservice start - - 雖然這項設定可以讓一位使用者存取 webservice 服務,但在大部份組織中會有一整個網站小組負責管理該服務,因此也可以一行來授予整個群組存取權,以下步驟會建立一個網站群組、加入使用者到這個群組,然後讓該群組中的所有成員能夠管理服務: - - # pw groupadd -g 6001 -n webteam - - 同樣使用 pw8 指令來加入該使用到 webteam 群組: - - # pw groupmod -m user1 -n webteam - - 最後,在 /usr/local/etc/sudoers 中的這行設定可以讓 webteam 群組的所有成員可以管理 webservice - - %webteam ALL=(ALL) /usr/sbin/service webservice * - - su1 不同的是 Sudo 只需要一般使用者的密碼,這有一個使用者不需要共用密碼的優點,在大多數安全稽查都會發現共用密碼的問題且這種情況只有壞處可言。 - - 使用 Sudo 允許使用者執行應用程式只需要輸入使用者自己的密碼,這更安全且提供比 su1 更佳的控制權,因為 su1 只要輸入 root 密碼之後該使用者便可取得所有的 root 權限。 - - - 大多數組織已正在導入或已導入雙重認証 (Two factor authentication),在這個情境下使用者可以不用輸入密碼,Sudo 提供了 NOPASSWD 變數來供這個情境使用,可將該設定加入到上述的設定將可允許所有 webteam 群組的成員不需要輸入密碼便可管理該服務: - - %webteam ALL=(ALL) NOPASSWD: /usr/sbin/service webservice * - - - - 記錄輸出 - - 採用 Sudo 的另一個優點是能夠開啟連線階段的記錄。使用內建立記錄機制與內含的 sudoreplay 指令,所有透過 Sudo 初始化的指令會被記錄下來供往後檢驗用。要開啟這個功能要加入預設記錄目錄的項目,在以下範例中使用了使用者變數來做目錄名稱,也還有許多其他記錄檔名稱慣例,可參考 sudoreplay 的操作手冊來取得進一步資訊。 - - Defaults iolog_dir=/var/log/sudo-io/%{user} - - - 這個目錄會在記錄功能設定之後自動建立,最好讓系統以預設的權限來建立目錄比較保險,除此之外,這個設定項目也會記錄使用 sudoreplay 指令的管理者,要更改設定請閱讀並取消在 sudoers 中記錄選項的註解。 - - - 一旦這個設定加入至 sudoers 檔案之後,所有的使用者設定項目便可加上記錄存取動作的項目,在 webteam 項目加入額外設定之後的範例如下: - - %webteam ALL=(ALL) NOPASSWD: LOG_INPUT: LOG_OUTPUT: /usr/sbin/service webservice * - - 從此之後,所有 webteam 修改 webservice 應用程式狀態的成員將會被記錄下來。要列出先前與目前連線階段的記錄可: - - # sudoreplay -l - - 在輸出結果中要重播指定連線階段的記錄可搜尋 TSID= 項目,然後傳送給 sudoreplay 且不加其他選項便可以一般速度重播連線階段,例如: - - # sudoreplay user1/00/00/02 - - - 雖然所有連線階段都會被記錄,但任何管理者都可以移除連線階段,使得沒人知道它們做了什麼事,所以非常值得在入侵偵測系統 (IDS) 或類似的軟體加入每日檢查,以便在有人為修改時通知其他管理人員。 - - - sudoreplay 的擴充空間非常大,請參考說明文件來取得更多資訊。 - - -
- - - - - - Jail - - - MatteoRiondatoContributed - by - - - - jails - - - 概述 - - 由於系統管理是一項困難的工作,許多工具開發來讓系統管理者能夠更輕鬆。這些工具通常可以強化系統安裝、設定以及維護的方式。這些工具之可以用來強化 FreeBSD 系統的安全性之一的就是 Jail。Jail 早在 FreeBSD 4.X 便可使用並持續強化它的功能、效率、穩定性以及安全性。 - - Jail 建立在 chroot2 概念之上,會更改一系列程序的根目錄。這可以創造一個安全的環境,將程序與系統的其他部份分隔。在 chroot 的環境所建立的程序不能存取該環境以外的檔案或資源。也因此,滲透一個在 chroot 的環境執行的服務並不會讓整個系統被攻擊者滲透。但 chroot 有許多限制,只適合用在簡單的工作,不需要許多彈性或複雜性、進階功能的工作。隨著時間推移,許多可以逃離 chroot 的環境的方法已經被找到,讓這個方法不再是確保服務安全的理想方案。 - - Jail 用許多方式改進了傳統 chroot 環境的概念。在傳統 chroot 環境,程序僅限制在一部份檔案系統可存取的地方。其餘的系統資源、系統使用者、執行的程序以及網路子系統被 chroot 的程序及主機系統的程序所共享。Jail 透過虛擬化存取檔案系統、使用者及網路子系統來擴展這個模型,可使用更多細微的控制參數來調校 Jail 的環境存取方式,Jail 可算是一種作業系統層級的虛擬化。 - - Jail 的四個要素: - - - - 一個子樹狀目錄:進入 Jail 的起點目錄,一但在 Jail 中,程序便沒有權限離開此目錄之外。 - - - - 一個主機名稱:將會由 Jail 所使用。 - - - - 一個 IP 位址:用來分配給 Jail。Jail 的 IP 位址通常是現有網路介面的別名位址。 - - - - 一個指令:要在 Jail 中可執行的執行檔路徑名稱。該路徑是 Jail 環境根目錄的相對路徑。 - - - - Jail 有自己使用者及自己的 root 帳號,皆受到 Jail 環境的限制。Jail 中的 root 帳號不允許對指定 Jail 環境之外的系統執行操作。 - - 本章將提供 FreeBSD Jail 術語及管理指令的概述,Jail 對系統管理者及進階的使用者來二者來說皆是強大的工具。 - - 讀完這章,您將了解: - - - - Jail 是什麼及它在 FreeBSD 中提供的目的。 - - - - 如何建立、啟動及停止 Jail。 - - - - Jail 管理基礎,不論從內部或外部。 - - - - - Jail 是強大的工具,但它不是安全性問題的萬靈丹。雖然 Jail 的程序不可能自己獨自打破規則,但有許多方法可以讓在 Jail 之外無權限的使用者與在 Jail 之內有權限的使用者串通來取得主機環境的更高權限。 - - 大多數這類型的攻擊者可以由確保 Jail 根目錄不會被無權限使用者存取來減少。基本上,不受信任的使用者有 Jail 的存取權限並不會讓其可存取主機環境。 - - - - - Jail 相關術語 - - 為協助更容易理解 FreeBSD 系統有關 Jail 部份, 以及它們與 FreeBSD 其他部分的相互作用關係, 以下列出本章將使用的術語: - - - - chroot8 (指令) - - 工具,用來使用 chroot2 FreeBSD 系統呼叫 (System call) 來更改程予及其衍伸程序的根目錄。 - - - - - chroot2 (環境) - - 指程序在 chroot 中執行的環境。包含的資源如:一部份可見的檔案系統、可用的使用者及群組 ID、網路介面及其他 IPC 機制等。 - - - - - jail8 (指令) - - 允許在 Jail 環境下執行程序的系統管理工具。 - - - - - 主機 (系統、程序、使用者等) - - Jail 環境的控制系統。 主機系統可以存取所有可用的硬體資源,並能控制 Jail 環境內外的程序。主機系統與 Jail 最大的差別在於:在主機系統中的超級使用者程序並不像在 Jail 環境那樣受到限制。 - - - - - 託管 (主機、程序、使用者等) - - 存取資源受到 FreeBSD Jail 限制的託管程序、使用者或其他實體。 - - - - - - - 建立和控制 Jail - - 部份管理者將 Jail 分成兩種類型:完整的 Jail,它像一個真正的 FreeBSD 系統以及 服務的 Jail,專門用於某個應用程式或服務,可能使用管理權限執行。但這些只是概念上的區分,建立 Jail 的程序並不受這個概念的影響。當要建立一個 完整的 Jail,Userland 有兩個來源選項:使用預先編譯的 Binary (如安裝媒體上提供的 Binary) 或從原始碼編譯。 - - 要從安裝媒體安裝 Userland,需要先建立根目錄供 Jail 使用。這個動作可以透過設定 DESTDIR 來到適當的位置來完成。 - - 啟動 Shell 並定義 DESTDIR - - # sh -# export DESTDIR=/here/is/the/jail - - 當使用安裝 ISO 時,可依 mdconfig8 中的說明掛載安裝媒體: - - # mount -t cd9660 /dev/`mdconfig -f cdimage.iso` /mnt -# cd /mnt/usr/freebsd-dist/ - - 或者自鏡像站下載 Tarball 壓縮檔: - - # sh -# export DESTRELEASE=12.0-RELEASE -# export DESTARCH=`uname -m` -# export SOURCEURL=http://ftp.freebsd.org/pub/FreeBSD/releases/$DESTARCH/$DESTRELEASE/ -# for set in base ports; do fetch $SOURCEURL/$set.txz ; done - - 從安裝媒體上的 Tarball 中取出 Binary 並放到宣告的位置,至少需要取出 Base set 的部份,若需要也可完整安裝。 - - 只安裝基礎系統 (Base system): - - # tar -xf base.txz -C $DESTDIR - - 安裝全部不含核心: - - # for set in base ports; do tar -xf $set.txz -C $DESTDIR ; done - - jail8 操作手冊說明的程序建置 Jail: - - # setenv D /here/is/the/jail -# mkdir -p $D -# cd /usr/src -# make buildworld -# make installworld DESTDIR=$D -# make distribution DESTDIR=$D -# mount -t devfs devfs $D/dev - - - - 選擇 Jail 的位置是建置 Jail 最好的起點,這是在 Jail 主機上儲存 Jail 的實體位置。較好的選擇是 /usr/jail/jailname,其中 jailname 是用來辦識 Jail 的主機名稱。通常在 /usr/ 會有足夠的空間供 Jail 檔案系統使用,對 完整的 Jail 來說,便是複製 FreeBSD 基礎系統預設安裝的每一個檔案。 - - - - 若您已經使用 make worldmake buildworld 重新編譯您的 Userland,您可以跳過這個步驟並安裝您已存在的 Userland 到新的 Jail。 - - - - 這個指令將會在檔案系統中 Jail 所在的實體位置產生樹狀目錄及必要的 Binary、程式庫、操作手冊與相關檔案。 - - - - makedistribution 目標會安裝所有需要的設定檔。簡單來說,它會安裝所有 /usr/src/etc/ 中可安裝的檔案到 Jail 環境的 /etc目錄:$D/etc/ - - - - 在 Jail 中掛載 devfs8 檔案系統並非必要的動作。從另一個角度來說,任何或大部份的應用程式會依該程式的目的會需要存取至少一個裝置,在 Jail 中控制存取的裝置非常重要,不恰當的設定可能會讓攻擊者可以在 Jail 中做不軌的事。對 devfs8 的控制是透過 Ruleset,在 devfs8devfs.conf5 操作手冊中有詳細說明。 - - - - Jail 安裝完成之後,便可使用 jail8 工具來啟動。jail8 工具需要四個必要參數,在 有說明。其他參數也可能需要指定,例如要使用特定使用者的身份來執行要 Jail 的程序。 參數依 Jail 的類型所需而定,對一個 虛擬系統 來說,/etc/rc 是不錯的選擇,因為該檔案可以模仿真實 FreeBSD 的啟動順序。對於 服務型 的 Jail 來說,則看在 Jail 中要執行的服務或應用程式來決定。 - - Jail 通常會需要隨著開機執行,使用 FreeBSD rc 機制可讓以簡單的達成這件事。 - - - - jail.conf 中設定 jail 參數: - www { - host.hostname = www.example.org; # Hostname - ip4.addr = 192.168.0.10; # IP address of the jail - path ="/usr/jail/www"; # Path to the jail - devfs_ruleset = "www_ruleset"; # devfs ruleset - mount.devfs; # Mount devfs inside the jail - exec.start = "/bin/sh /etc/rc"; # Start command - exec.stop = "/bin/sh /etc/rc.shutdown"; # Stop command -} - - rc.conf 中設定開機時啟動 Jail: - - jail_enable="YES" # Set to NO to disable starting of any jails - - 預設要啟動的 Jail 可在 jail.conf5 設定,會把 Jail 當作是一個完全虛擬的系統,然後執行 Jail 中的 /etc/rc Script。針對服務型的 Jail 則需透過設定 exec.start 選項來適當更改 Jail 的預設啟動指令。 - - - 要取得完整可用選項的清單,請參考 jail.conf5操作手冊。 - - - - - 若 Jail 項目已經在 jail.conf 中設定好,可以手動用 service8 來啟動或停止某個 Jail 項目: - - # service jail start www -# service jail stop www - - Jail 可以使用 jexec8 來關機。先使用 jls8 來辦識 Jail 的 JID,然後使用 jexec8 在該 Jail 中執行關機 Script。 - - # jls - JID IP Address Hostname Path - 3 192.168.0.10 www /usr/jail/www -# jexec 3 /etc/rc.shutdown - - 更多有關 Jail 的資訊可在 jail8 操作手冊取得。 - - - - 調校與管理 - - 還有許多選項可以對所有 Jail 做設定,以及各種可讓 Jail 與主機 FreeBSD 系統結合的方法來提供更高層級的應用程式使用。 本節將介紹: - - - - Some of the options available for tuning the behavior - and security restrictions implemented by a jail - installation. - - - - Some of the high-level applications for jail management, - which are available through the FreeBSD Ports Collection, and - can be used to implement overall jail-based - solutions. - - - - - 在 FreeBSD 中調校 Jail 的系統工具 - - Fine tuning of a jail's configuration is mostly done by - setting sysctl8 variables. A special subtree of sysctl - exists as a basis for organizing all the relevant options: the - security.jail.* hierarchy of FreeBSD kernel - options. Here is a list of the main jail-related sysctls, - complete with their default value. Names should be - self-explanatory, but for more information about them, please - refer to the jail8 and sysctl8 manual - pages. - - - - security.jail.set_hostname_allowed: - 1 - - - - security.jail.socket_unixiproute_only: - 1 - - - - security.jail.sysvipc_allowed: - 0 - - - - security.jail.enforce_statfs: - 2 - - - - security.jail.allow_raw_sockets: - 0 - - - - security.jail.chflags_allowed: - 0 - - - - security.jail.jailed: 0 - - - - These variables can be used by the system administrator of - the host system to add or remove some of - the limitations imposed by default on the root user. Note that there - are some limitations which cannot be removed. The - root user is not - allowed to mount or unmount file systems from within a - jail8. The root inside a jail may not - load or unload devfs8 rulesets, set firewall rules, or - do many other administrative tasks which require modifications - of in-kernel data, such as setting the - securelevel of the kernel. - - The base system of FreeBSD contains a basic set of tools for - viewing information about the active jails, and attaching to a - jail to run administrative commands. The jls8 and - jexec8 commands are part of the base FreeBSD system, and - can be used to perform the following simple tasks: - - - - Print a list of active jails and their corresponding - jail identifier (JID), - IP address, hostname and path. - - - - Attach to a running jail, from its host system, and - run a command inside the jail or perform administrative - tasks inside the jail itself. This is especially useful - when the root - user wants to cleanly shut down a jail. The jexec8 - utility can also be used to start a shell in a jail to do - administration in it; for example: - - # jexec 1 tcsh - - - - - - 在 FreeBSD Port 套件集中的高層級管理工具 - - Among the many third-party utilities for jail - administration, one of the most complete and useful is - sysutils/ezjail. It is a set of scripts - that contribute to jail8 management. Please refer to - the - handbook section on ezjail - for more information. - - - - 持續 Jail 的修補與更新 - - Jails should be kept up to date from the host operating - system as attempting to patch userland from within the jail - may likely fail as the default behavior in FreeBSD is to - disallow the use of chflags1 in a jail which prevents - the replacement of some files. It is possible to change this - behavior but it is recommended to use freebsd-update8 - to maintain jails instead. Use to specify - the path of the jail to be updated. - - # freebsd-update -b /here/is/the/jail fetch -# freebsd-update -b /here/is/the/jail install - - - - - - 更新多個 Jail - - - - - Daniel - Gerzo - - Contributed by - - - - - - Simon - L. B. Nielsen - - Based upon an idea presented by - - - - - - Ken - Tom - - And an article written by - - - - - The management of multiple jails can become problematic - because every jail has to be rebuilt from scratch whenever it is - upgraded. This can be time consuming and tedious if a lot of - jails are created and manually updated. - - This section demonstrates one method to resolve this issue - by safely sharing as much as is possible between jails using - read-only mount_nullfs8 mounts, so that updating is - simpler. This makes it more attractive to put single services, - such as HTTP, DNS, and - SMTP, into individual jails. Additionally, - it provides a simple way to add, remove, and upgrade - jails. - - - Simpler solutions exist, such as - ezjail, which provides an easier - method of administering FreeBSD jails but is less versatile than - this setup. ezjail is covered in - more detail in . - - - The goals of the setup described in this section are: - - - - Create a simple and easy to understand jail structure - that does not require running a full installworld on each - and every jail. - - - - Make it easy to add new jails or remove existing - ones. - - - - Make it easy to update or upgrade existing jails. - - - - Make it possible to run a customized FreeBSD branch. - - - - Be paranoid about security, reducing as much as - possible the possibility of compromise. - - - - Save space and inodes, as much as possible. - - - - This design relies on a single, read-only master template - which is mounted into each jail and one read-write device per - jail. A device can be a separate physical disc, a partition, or - a vnode backed memory device. This example uses read-write - nullfs mounts. - - The file system layout is as follows: - - - - The jails are based under the - /home partition. - - - - Each jail will be mounted under the - /home/j directory. - - - - The template for each jail and the read-only partition - for all of the jails is - /home/j/mroot. - - - - A blank directory will be created for each jail under - the /home/j directory. - - - - Each jail will have a /s directory - that will be linked to the read-write portion of the - system. - - - - Each jail will have its own read-write system that is - based upon /home/j/skel. - - - - The read-write portion of each jail will be created in - /home/js. - - - - - - - 建立範本 - - This section describes the steps needed to create the - master template. - - It is recommended to first update the host FreeBSD system to - the latest -RELEASE branch using the instructions in . Additionally, this template uses the - sysutils/cpdup package or port and - portsnap will be used to download - the FreeBSD Ports Collection. - - - - First, create a directory structure for the read-only - file system which will contain the FreeBSD binaries for the - jails. Then, change directory to the FreeBSD source tree and - install the read-only file system to the jail - template: - - # mkdir /home/j /home/j/mroot -# cd /usr/src -# make installworld DESTDIR=/home/j/mroot - - - - Next, prepare a FreeBSD Ports Collection for the jails as - well as a FreeBSD source tree, which is required for - mergemaster: - - # cd /home/j/mroot -# mkdir usr/ports -# portsnap -p /home/j/mroot/usr/ports fetch extract -# cpdup /usr/src /home/j/mroot/usr/src - - - - Create a skeleton for the read-write portion of the - system: - - # mkdir /home/j/skel /home/j/skel/home /home/j/skel/usr-X11R6 /home/j/skel/distfiles -# mv etc /home/j/skel -# mv usr/local /home/j/skel/usr-local -# mv tmp /home/j/skel -# mv var /home/j/skel -# mv root /home/j/skel - - - - Use mergemaster to install - missing configuration files. Then, remove the extra - directories that mergemaster - creates: - - # mergemaster -t /home/j/skel/var/tmp/temproot -D /home/j/skel -i -# cd /home/j/skel -# rm -R bin boot lib libexec mnt proc rescue sbin sys usr dev - - - - Now, symlink the read-write file system to the - read-only file system. Ensure that the symlinks are - created in the correct s/ locations - as the creation of directories in the wrong locations will - cause the installation to fail. - - # cd /home/j/mroot -# mkdir s -# ln -s s/etc etc -# ln -s s/home home -# ln -s s/root root -# ln -s ../s/usr-local usr/local -# ln -s ../s/usr-X11R6 usr/X11R6 -# ln -s ../../s/distfiles usr/ports/distfiles -# ln -s s/tmp tmp -# ln -s s/var var - - - - As a last step, create a generic - /home/j/skel/etc/make.conf containing - this line: - - WRKDIRPREFIX?= /s/portbuild - - This makes it possible to compile FreeBSD ports inside - each jail. Remember that the ports directory is part of - the read-only system. The custom path for - WRKDIRPREFIX allows builds to be done - in the read-write portion of every jail. - - - - - - 建立 Jail - - The jail template can now be used to setup and configure - the jails in /etc/rc.conf. This example - demonstrates the creation of 3 jails: NS, - MAIL and WWW. - - - - Add the following lines to - /etc/fstab, so that the read-only - template for the jails and the read-write space will be - available in the respective jails: - - /home/j/mroot /home/j/ns nullfs ro 0 0 -/home/j/mroot /home/j/mail nullfs ro 0 0 -/home/j/mroot /home/j/www nullfs ro 0 0 -/home/js/ns /home/j/ns/s nullfs rw 0 0 -/home/js/mail /home/j/mail/s nullfs rw 0 0 -/home/js/www /home/j/www/s nullfs rw 0 0 - - To prevent - fsck from checking - nullfs mounts during boot and - dump from backing up the - read-only nullfs mounts of the jails, the last two - columns are both set to 0. - - - - Configure the jails in - /etc/rc.conf: - - jail_enable="YES" -jail_set_hostname_allow="NO" -jail_list="ns mail www" -jail_ns_hostname="ns.example.org" -jail_ns_ip="192.168.3.17" -jail_ns_rootdir="/usr/home/j/ns" -jail_ns_devfs_enable="YES" -jail_mail_hostname="mail.example.org" -jail_mail_ip="192.168.3.18" -jail_mail_rootdir="/usr/home/j/mail" -jail_mail_devfs_enable="YES" -jail_www_hostname="www.example.org" -jail_www_ip="62.123.43.14" -jail_www_rootdir="/usr/home/j/www" -jail_www_devfs_enable="YES" - - The - jail_name_rootdir - variable is set to - /usr/home instead - of /home because - the physical path of /home on a default FreeBSD - installation is /usr/home. The - jail_name_rootdir - variable must not be set to a path - which includes a symbolic link, otherwise the jails will - refuse to start. - - - - Create the required mount points for the read-only - file system of each jail: - - # mkdir /home/j/ns /home/j/mail /home/j/www - - - - Install the read-write template into each jail using - sysutils/cpdup: - - - # mkdir /home/js -# cpdup /home/j/skel /home/js/ns -# cpdup /home/j/skel /home/js/mail -# cpdup /home/j/skel /home/js/www - - - - In this phase, the jails are built and prepared to - run. First, mount the required file systems for each - jail, and then start them: - - # mount -a -# service jail start - - - - The jails should be running now. To check if they have - started correctly, use jls. Its output - should be similar to the following: - - # jls - JID IP Address Hostname Path - 3 192.168.3.17 ns.example.org /home/j/ns - 2 192.168.3.18 mail.example.org /home/j/mail - 1 62.123.43.14 www.example.org /home/j/www - - At this point, it should be possible to log onto each - jail, add new users, or configure daemons. The - JID column indicates the jail - identification number of each running jail. Use the following - command to perform administrative tasks in the jail whose - JID is 3: - - # jexec 3 tcsh - - - - 升級 - - The design of this setup provides an easy way to upgrade - existing jails while minimizing their downtime. Also, it - provides a way to roll back to the older version should a - problem occur. - - - - The first step is to upgrade the host system. Then, - create a new temporary read-only template in - /home/j/mroot2. - - # mkdir /home/j/mroot2 -# cd /usr/src -# make installworld DESTDIR=/home/j/mroot2 -# cd /home/j/mroot2 -# cpdup /usr/src usr/src -# mkdir s - - The installworld creates a - few unnecessary directories, which should be - removed: - - # chflags -R 0 var -# rm -R etc var root usr/local tmp - - - - Recreate the read-write symlinks for the master file - system: - - # ln -s s/etc etc -# ln -s s/root root -# ln -s s/home home -# ln -s ../s/usr-local usr/local -# ln -s ../s/usr-X11R6 usr/X11R6 -# ln -s s/tmp tmp -# ln -s s/var var - - - - Next, stop the jails: - - # service jail stop - - - - Unmount the original file systems as the read-write - systems are attached to the read-only system - (/s): - - - # umount /home/j/ns/s -# umount /home/j/ns -# umount /home/j/mail/s -# umount /home/j/mail -# umount /home/j/www/s -# umount /home/j/www - - - - Move the old read-only file system and replace it with - the new one. This will serve as a backup and archive of - the old read-only file system should something go wrong. - The naming convention used here corresponds to when a new - read-only file system has been created. Move the original - FreeBSD Ports Collection over to the new file system to save - some space and inodes: - - # cd /home/j -# mv mroot mroot.20060601 -# mv mroot2 mroot -# mv mroot.20060601/usr/ports mroot/usr - - - - At this point the new read-only template is ready, so - the only remaining task is to remount the file systems and - start the jails: - - # mount -a -# service jail start - - - - Use jls to check if the jails started - correctly. Run mergemaster in each jail to - update the configuration files. - - - - - - 使用 <application>ezjail</application> 管理 Jail - - - - - Warren - Block - Originally contributed by - - - - - Creating and managing multiple jails can quickly become - tedious and error-prone. Dirk Engling's - ezjail automates and greatly - simplifies many jail tasks. A basejail is - created as a template. Additional jails use - mount_nullfs8 to share many of the basejail directories - without using additional disk space. Each additional jail takes - only a few megabytes of disk space before applications are - installed. Upgrading the copy of the userland in the basejail - automatically upgrades all of the other jails. - - Additional benefits and features are described in detail on - the ezjail web site, . - - - 安裝 <application>ezjail</application> - - Installing ezjail consists of - adding a loopback interface for use in jails, installing the - port or package, and enabling the service. - - - - To keep jail loopback traffic off the host's loopback - network interface lo0, a second - loopback interface is created by adding an entry to - /etc/rc.conf: - - cloned_interfaces="lo1" - - The second loopback interface lo1 - will be created when the system starts. It can also be - created manually without a restart: - - # service netif cloneup -Created clone interfaces: lo1. - - Jails can be allowed to use aliases of this secondary - loopback interface without interfering with the - host. - - Inside a jail, access to the loopback address - 127.0.0.1 is - redirected to the first IP address - assigned to the jail. To make the jail loopback - correspond with the new lo1 interface, - that interface must be specified first in the list of - interfaces and IP addresses given when - creating a new jail. - - Give each jail a unique loopback address in the - 127.0.0.0/8 netblock. - - - - Install - sysutils/ezjail: - - # cd /usr/ports/sysutils/ezjail -# make install clean - - - - Enable ezjail by adding - this line to /etc/rc.conf: - - ezjail_enable="YES" - - - - The service will automatically start on system boot. - It can be started immediately for the current - session: - - # service ezjail start - - - - - - 初始設定 - - With ezjail installed, the - basejail directory structure can be created and populated. - This step is only needed once on the jail host - computer. - - In both of these examples, causes the - ports tree to be retrieved with portsnap8 into the - basejail. That single copy of the ports directory will be - shared by all the jails. Using a separate copy of the ports - directory for jails isolates them from the host. The - ezjail FAQ - explains in more detail: . - - - - - - To Populate the Jail with FreeBSD-RELEASE - - For a basejail based on the FreeBSD RELEASE matching - that of the host computer, use - install. For example, on a host - computer running FreeBSD 10-STABLE, the latest - RELEASE version of FreeBSD -10 will be installed in - the jail): - - # ezjail-admin install -p - - - - To Populate the Jail with - <command>installworld</command> - - The basejail can be installed from binaries - created by buildworld on - the host with - ezjail-admin update. - - In this example, FreeBSD 10-STABLE has been - built from source. The jail directories are created. - Then installworld is - executed, installing the host's - /usr/obj into the - basejail. - - # ezjail-admin update -i -p - - The host's /usr/src is used - by default. A different source directory on the host - can be specified with and a path, - or set with ezjail_sourcetree in - /usr/local/etc/ezjail.conf. - - - - - - - The basejail's ports tree is shared by other jails. - However, downloaded distfiles are stored in the jail that - downloaded them. By default, these files are stored in - /var/ports/distfiles within each - jail. /var/ports inside each jail is - also used as a work directory when building ports. - - - - The FTP protocol is used by default - to download packages for the installation of the basejail. - Firewall or proxy configurations can prevent or interfere - with FTP transfers. The - HTTP protocol works differently and - avoids these problems. It can be chosen by specifying a - full URL for a particular download mirror - in /usr/local/etc/ezjail.conf: - - ezjail_ftphost=http://ftp.FreeBSD.org - - See for a list of - sites. - - - - - 建立並啟動新的 Jail - - New jails are created with - ezjail-admin create. In these examples, - the lo1 loopback interface is used as - described above. - - - Create and Start a New Jail - - - Create the jail, specifying a name and the loopback - and network interfaces to use, along with their - IP addresses. In this example, the - jail is named dnsjail. - - # ezjail-admin create dnsjail 'lo1|127.0.1.1,em0|192.168.1.50' - - - Most network services run in jails without - problems. A few network services, most notably - ping8, use - raw network sockets. In jails, raw - network sockets are disabled by default for security. - Services that require them will not work. - - Occasionally, a jail genuinely needs raw sockets. - For example, network monitoring applications often use - ping8 to check the availability of other - computers. When raw network sockets are actually needed - in a jail, they can be enabled by editing the - ezjail - configuration file for the individual jail, - /usr/local/etc/ezjail/jailname. - Modify the parameters - entry: - - export jail_jailname_parameters="allow.raw_sockets=1" - - Do not enable raw network sockets unless services in - the jail actually require them. - - - - - Start the jail: - - # ezjail-admin start dnsjail - - - - Use a console on the jail: - - # ezjail-admin console dnsjail - - - - The jail is operating and additional configuration can be - completed. Typical settings added at this point - include: - - - - Set the - <systemitem class="username">root</systemitem> - Password - - Connect to the jail and set the - root user's - password: - - # ezjail-admin console dnsjail -# passwd -Changing local password for root -New Password: -Retype New Password: - - - - Time Zone Configuration - - The jail's time zone can be set with tzsetup8. - To avoid spurious error messages, the adjkerntz8 - entry in /etc/crontab can be - commented or removed. This job attempts to update the - computer's hardware clock with time zone changes, but - jails are not allowed to access that hardware. - - - - <acronym>DNS</acronym> Servers - - Enter domain name server lines in - /etc/resolv.conf so - DNS works in the jail. - - - - Edit <filename>/etc/hosts</filename> - - Change the address and add the jail name to the - localhost entries in - /etc/hosts. - - - - Configure <filename>/etc/rc.conf</filename> - - Enter configuration settings in - /etc/rc.conf. This is much like - configuring a full computer. The host name and - IP address are not set here. Those - values are already provided by the jail - configuration. - - - - With the jail configured, the applications for which the - jail was created can be installed. - - - Some ports must be built with special options to be used - in a jail. For example, both of the network monitoring - plugin packages - net-mgmt/nagios-plugins and - net-mgmt/monitoring-plugins - have a JAIL option which must be enabled - for them to work correctly inside a jail. - - - - - 更新 Jail - - - 更新作業系統 - - Because the basejail's copy of the userland is shared by - the other jails, updating the basejail automatically updates - all of the other jails. Either source or binary updates can - be used. - - To build the world from source on the host, then - install it in the basejail, use: - - # ezjail-admin update -b - - If the world has already been compiled on the host, - install it in the basejail with: - - # ezjail-admin update -i - - Binary updates use freebsd-update8. These - updates have the same limitations as if - freebsd-update8 were being run directly. The most - important one is that only -RELEASE versions of FreeBSD are - available with this method. - - Update the basejail to the latest patched release of - the version of FreeBSD on the host. For example, updating from - RELEASE-p1 to RELEASE-p2. - - # ezjail-admin update -u - - To upgrade the basejail to a new version, first - upgrade the host system as described in . Once the host has - been upgraded and rebooted, the basejail can then be - upgraded. freebsd-update8 has no way of determining - which version is currently installed in the basejail, so the - original version must be specified. Use file1 to - determine the original version in the basejail: - - # file /usr/jails/basejail/bin/sh -/usr/jails/basejail/bin/sh: ELF 64-bit LSB executable, x86-64, version 1 (FreeBSD), dynamically linked (uses shared libs), for FreeBSD 9.3, stripped - - Now use this information to perform the upgrade from - 9.3-RELEASE to the current version of - the host system: - - # ezjail-admin update -U -s 9.3-RELEASE - - After updating the basejail, mergemaster8 must - be run to update each jail's configuration files. - - How to use mergemaster8 depends on the purpose - and trustworthiness of a jail. If a jail's services or - users are not trusted, then mergemaster8 should only - be run from within that jail: - - - 在不信任的 Jail 做 <citerefentry><refentrytitle>mergemaster</refentrytitle><manvolnum>8</manvolnum></citerefentry> - - Delete the link from the jail's - /usr/src into the basejail and - create a new /usr/src in the jail - as a mountpoint. Mount the host computer's - /usr/src read-only on the jail's - new /usr/src mountpoint: - - # rm /usr/jails/jailname/usr/src -# mkdir /usr/jails/jailname/usr/src -# mount -t nullfs -o ro /usr/src /usr/jails/jailname/usr/src - - Get a console in the jail: - - # ezjail-admin console jailname - - Inside the jail, run mergemaster. - Then exit the jail console: - - # cd /usr/src -# mergemaster -U -# exit - - Finally, unmount the jail's - /usr/src: - - # umount /usr/jails/jailname/usr/src - - - - - 在信任的 Jail 做 <citerefentry><refentrytitle>mergemaster</refentrytitle><manvolnum>8</manvolnum></citerefentry> - - If the users and services in a jail are trusted, - mergemaster8 can be run from the host: - - # mergemaster -U -D /usr/jails/jailname - - - - - 更新 Port - - The ports tree in the basejail is shared by the other - jails. Updating that copy of the ports tree gives the other - jails the updated version also. - - The basejail ports tree is updated with - portsnap8: - - # ezjail-admin update -P - - - - - 控制 Jail - - - 停止與啟動 Jail - - ezjail automatically starts - jails when the computer is started. Jails can be manually - stopped and restarted with stop and - start: - - # ezjail-admin stop sambajail -Stopping jails: sambajail. - - By default, jails are started automatically when the - host computer starts. Autostarting can be disabled - with config: - - # ezjail-admin config -r norun seldomjail - - This takes effect the next time the host computer is - started. A jail that is already running will not be - stopped. - - Enabling autostart is very similar: - - # ezjail-admin config -r run oftenjail - - - - 封存與還原 Jail - - Use archive to create a - .tar.gz archive of a jail. The file - name is composed from the name of the jail and the current - date. Archive files are written to the archive directory, - /usr/jails/ezjail_archives. A - different archive directory can be chosen by setting - ezjail_archivedir in the configuration - file. - - The archive file can be copied elsewhere as a backup, or - an existing jail can be restored from it with - restore. A new jail can be created from - the archive, providing a convenient way to clone existing - jails. - - Stop and archive a jail named - wwwserver: - - # ezjail-admin stop wwwserver -Stopping jails: wwwserver. -# ezjail-admin archive wwwserver -# ls /usr/jails/ezjail-archives/ -wwwserver-201407271153.13.tar.gz - - Create a new jail named - wwwserver-clone from the archive created - in the previous step. Use the em1 - interface and assign a new IP address to - avoid conflict with the original: - - # ezjail-admin create -a /usr/jails/ezjail_archives/wwwserver-201407271153.13.tar.gz wwwserver-clone 'lo1|127.0.3.1,em1|192.168.1.51' - - - - - 完整範例:在 Jail 中安裝 <application>BIND</application> - - Putting the BIND - DNS server in a jail improves security by - isolating it. This example creates a simple caching-only name - server. - - - - The jail will be called - dns1. - - - - The jail will use IP address - 192.168.1.240 on the host's - re0 interface. - - - - The upstream ISP's DNS servers are - at 10.0.0.62 and - 10.0.0.61. - - - - The basejail has already been created and a ports tree - installed as shown in - . - - - - - 在 Jail 中執行 BIND - - Create a cloned loopback interface by adding a line to - /etc/rc.conf: - - cloned_interfaces="lo1" - - Immediately create the new loopback interface: - - # service netif cloneup -Created clone interfaces: lo1. - - Create the jail: - - # ezjail-admin create dns1 'lo1|127.0.2.1,re0|192.168.1.240' - - Start the jail, connect to a console running on it, and - perform some basic configuration: - - # ezjail-admin start dns1 -# ezjail-admin console dns1 -# passwd -Changing local password for root -New Password: -Retype New Password: -# tzsetup -# sed -i .bak -e '/adjkerntz/ s/^/#/' /etc/crontab -# sed -i .bak -e 's/127.0.0.1/127.0.2.1/g; s/localhost.my.domain/dns1.my.domain dns1/' /etc/hosts - - Temporarily set the upstream DNS - servers in /etc/resolv.conf so ports - can be downloaded: - - nameserver 10.0.0.62 -nameserver 10.0.0.61 - - Still using the jail console, install - dns/bind99. - - # make -C /usr/ports/dns/bind99 install clean - - Configure the name server by editing - /usr/local/etc/namedb/named.conf. - - Create an Access Control List (ACL) - of addresses and networks that are permitted to send - DNS queries to this name server. This - section is added just before the options - section already in the file: - - ... -// or cause huge amounts of useless Internet traffic. - -acl "trusted" { - 192.168.1.0/24; - localhost; - localnets; -}; - -options { -... - - Use the jail IP address in the - listen-on setting to accept - DNS queries from other computers on the - network: - - listen-on { 192.168.1.240; }; - - A simple caching-only DNS name server - is created by changing the forwarders - section. The original file contains: - - /* - forwarders { - 127.0.0.1; - }; -*/ - - Uncomment the section by removing the - /* and */ lines. - Enter the IP addresses of the upstream - DNS servers. Immediately after the - forwarders section, add references to the - trusted ACL defined - earlier: - - forwarders { - 10.0.0.62; - 10.0.0.61; - }; - - allow-query { any; }; - allow-recursion { trusted; }; - allow-query-cache { trusted; }; - - Enable the service in - /etc/rc.conf: - - named_enable="YES" - - Start and test the name server: - - # service named start -wrote key file "/usr/local/etc/namedb/rndc.key" -Starting named. -# /usr/local/bin/dig @192.168.1.240 freebsd.org - - A response that includes - - ;; Got answer; - - shows that the new DNS server is - working. A long delay followed by a response - including - - ;; connection timed out; no servers could be reached - - shows a problem. Check the configuration settings and - make sure any local firewalls allow the new - DNS access to the upstream - DNS servers. - - The new DNS server can use itself for - local name resolution, just like other local computers. Set - the address of the DNS server in the - client computer's - /etc/resolv.conf: - - nameserver 192.168.1.240 - - A local DHCP server can be configured - to provide this address for a local DNS - server, providing automatic configuration on - DHCP clients. - - - - - - - - - - 強制存取控制 (MAC) - - - TomRhodesWritten - by - - - - - 概述 - - MAC - - Mandatory Access Control - MAC - - - FreeBSD supports security extensions based on the - POSIX.1e draft. These security mechanisms include file system - Access Control Lists () and Mandatory - Access Control (MAC). MAC - allows access control modules to be loaded in order to implement - security policies. Some modules provide protections for a - narrow subset of the system, hardening a particular service. - Others provide comprehensive labeled security across all - subjects and objects. The mandatory part of the definition - indicates that enforcement of controls is performed by - administrators and the operating system. This is in contrast to - the default security mechanism of Discretionary Access Control - (DAC) where enforcement is left to the - discretion of users. - - This chapter focuses on the MAC framework - and the set of pluggable security policy modules FreeBSD provides - for enabling various security mechanisms. - - 讀完這章,您將了解: - - - - The terminology associated with the - MAC framework. - - - - The capabilities of MAC security - policy modules as well as the difference between a labeled - and non-labeled policy. - - - - The considerations to take into account before - configuring a system to use the - MAC framework. - - - Which MAC security policy modules - are included in FreeBSD and how to configure them. - - - - How to implement a more secure environment using the - MAC framework. - - - - How to test the MAC configuration - to ensure the framework has been properly - implemented. - - - - 在開始閱讀這章之前,您需要: - - - - 了解 UNIX 及 FreeBSD 基礎 ()。 - - - - Have some familiarity with security and how it pertains - to FreeBSD (). - - - - - Improper MAC configuration may cause - loss of system access, aggravation of users, or inability to - access the features provided by - Xorg. More importantly, - MAC should not be relied upon to completely - secure a system. The MAC framework only - augments an existing security policy. Without sound security - practices and regular security checks, the system will never - be completely secure. - - The examples contained within this chapter are for - demonstration purposes and the example settings should - not be implemented on a production - system. Implementing any security policy takes a good deal of - understanding, proper design, and thorough testing. - - - While this chapter covers a broad range of security issues - relating to the MAC framework, the - development of new MAC security policy - modules will not be covered. A number of security policy - modules included with the MAC framework have - specific characteristics which are provided for both testing and - new module development. Refer to mac_test4, - mac_stub4 and mac_none4 for more information on - these security policy modules and the various mechanisms they - provide. - - - - 關鍵詞 - - The following key terms are used when referring to the - MAC framework: - - - - compartment: a set of programs and - data to be partitioned or separated, where users are given - explicit access to specific component of a system. A - compartment represents a grouping, such as a work group, - department, project, or topic. Compartments make it - possible to implement a need-to-know-basis security - policy. - - - - integrity: the level of trust which - can be placed on data. As the integrity of the data is - elevated, so does the ability to trust that data. - - - - level: the increased or decreased - setting of a security attribute. As the level increases, - its security is considered to elevate as well. - - - - label: a security attribute which - can be applied to files, directories, or other items in the - system. It could be considered a confidentiality stamp. - When a label is placed on a file, it describes the security - properties of that file and will only permit access by - files, users, and resources with a similar security setting. - The meaning and interpretation of label values depends on - the policy configuration. Some policies treat a label as - representing the integrity or secrecy of an object while - other policies might use labels to hold rules for - access. - - - - multilabel: this property is a file - system option which can be set in single-user mode using - tunefs8, during boot using fstab5, or during - the creation of a new file system. This option permits - an administrator to apply different MAC - labels on different objects. This option only applies to - security policy modules which support labeling. - - - - single label: a policy where the - entire file system uses one label to enforce access control - over the flow of data. Whenever - is not set, all files will conform to the same label - setting. - - - - object: an entity through which - information flows under the direction of a - subject. This includes directories, - files, fields, screens, keyboards, memory, magnetic storage, - printers or any other data storage or moving device. An - object is a data container or a system resource. Access to - an object effectively means access to its data. - - - - subject: any active entity that - causes information to flow between - objects such as a user, user process, - or system process. On FreeBSD, this is almost always a - thread acting in a process on behalf of a user. - - - - policy: a collection of rules - which defines how objectives are to be achieved. A policy - usually documents how certain items are to be handled. This - chapter considers a policy to be a collection of rules which - controls the flow of data and information and defines who - has access to that data and information. - - - - high-watermark: this type of - policy permits the raising of security levels for the - purpose of accessing higher level information. In most - cases, the original level is restored after the process is - complete. Currently, the FreeBSD MAC - framework does not include this type of policy. - - - - low-watermark: this type of policy - permits lowering security levels for the purpose of - accessing information which is less secure. In most cases, - the original security level of the user is restored after - the process is complete. The only security policy module in - FreeBSD to use this is mac_lomac4. - - - - sensitivity: usually used when - discussing Multilevel Security (MLS). A - sensitivity level describes how important or secret the data - should be. As the sensitivity level increases, so does the - importance of the secrecy, or confidentiality, of the - data. - - - - - - 了解 MAC 標籤 - - A MAC label is a security attribute - which may be applied to subjects and objects throughout the - system. When setting a label, the administrator must - understand its implications in order to prevent unexpected or - undesired behavior of the system. The attributes available on - an object depend on the loaded policy module, as policy modules - interpret their attributes in different ways. - - The security label on an object is used as a part of a - security access control decision by a policy. With some - policies, the label contains all of the information necessary - to make a decision. In other policies, the labels may be - processed as part of a larger rule set. - - There are two types of label policies: single label and - multi label. By default, the system will use single label. The - administrator should be aware of the pros and cons of each in - order to implement policies which meet the requirements of the - system's security model. - - A single label security policy only permits one label to be - used for every subject or object. Since a single label policy - enforces one set of access permissions across the entire system, - it provides lower administration overhead, but decreases the - flexibility of policies which support labeling. However, in - many environments, a single label policy may be all that is - required. - - A single label policy is somewhat similar to - DAC as root configures the policies so - that users are placed in the appropriate categories and access - levels. A notable difference is that many policy modules can - also restrict root. - Basic control over objects will then be released to the group, - but root may revoke or - modify the settings at any time. - - When appropriate, a multi label policy can be set on a - UFS file system by passing - to tunefs8. A multi label - policy permits each subject or object to have its own - independent MAC label. The decision to use a - multi label or single label policy is only required for policies - which implement the labeling feature, such as - biba, lomac, and - mls. Some policies, such as - seeotheruids, portacl and - partition, do not use labels at all. - - Using a multi label policy on a partition and establishing a - multi label security model can increase administrative overhead - as everything in that file system has a label. This includes - directories, files, and even device nodes. - - The following command will set - on the specified UFS file system. This may - only be done in single-user mode and is not a requirement for - the swap file system: - - # tunefs -l enable / - - - Some users have experienced problems with setting the - flag on the root partition. If - this is the case, please review . - - - Since the multi label policy is set on a per-file system - basis, a multi label policy may not be needed if the file system - layout is well designed. Consider an example security - MAC model for a FreeBSD web server. This - machine uses the single label, biba/high, for - everything in the default file systems. If the web server needs - to run at biba/low to prevent write up - capabilities, it could be installed to a separate - UFS /usr/local file - system set at biba/low. - - - 標籤設定 - - Virtually all aspects of label policy module configuration - will be performed using the base system utilities. These - commands provide a simple interface for object or subject - configuration or the manipulation and verification of - the configuration. - - All configuration may be done using - setfmac, which is used to set - MAC labels on system objects, and - setpmac, which is used to set the labels on - system subjects. For example, to set the - biba MAC label to - high on test: - - # setfmac biba/high test - - If the configuration is successful, the prompt will be - returned without error. A common error is - Permission denied which usually occurs - when the label is being set or modified on a restricted - object. Other conditions may produce different failures. For - instance, the file may not be owned by the user attempting to - relabel the object, the object may not exist, or the object - may be read-only. A mandatory policy will not allow the - process to relabel the file, maybe because of a property of - the file, a property of the process, or a property of the - proposed new label value. For example, if a user running at - low integrity tries to change the label of a high integrity - file, or a user running at low integrity tries to change the - label of a low integrity file to a high integrity label, these - operations will fail. - - The system administrator may use - setpmac to override the policy module's - settings by assigning a different label to the invoked - process: - - # setfmac biba/high test -Permission denied -# setpmac biba/low setfmac biba/high test -# getfmac test -test: biba/high - - For currently running processes, such as - sendmail, - getpmac is usually used instead. This - command takes a process ID (PID) in place - of a command name. If users attempt to manipulate a file not - in their access, subject to the rules of the loaded policy - modules, the Operation not permitted - error will be displayed. - - - - 預先定義的標籤 - - A few FreeBSD policy modules which support the labeling - feature offer three predefined labels: low, - equal, and high, - where: - - - - low is considered the lowest label - setting an object or subject may have. Setting this on - objects or subjects blocks their access to objects or - subjects marked high. - - - - equal sets the subject or object to - be disabled or unaffected and should only be placed on - objects considered to be exempt from the policy. - - - - high grants an object or subject - the highest setting available in the Biba and - MLS policy modules. - - - - Such policy modules include mac_biba4, - mac_mls4 and mac_lomac4. Each of the predefined - labels establishes a different information flow directive. - Refer to the manual page of the module to determine the traits - of the generic label configurations. - - - - 數值標籤 - - The Biba and MLS policy modules support - a numeric label which may be set to indicate the precise level - of hierarchical control. This numeric level is used to - partition or sort information into different groups of - classification, only permitting access to that group or a - higher group level. For example: - - biba/10:2+3+6(5:2+3-20:2+3+4+5+6) - - may be interpreted as Biba Policy Label/Grade - 10:Compartments 2, 3 and 6: (grade 5 ...) - - In this example, the first grade would be considered the - effective grade with effective compartments, the second grade - is the low grade, and the last one is the high grade. In most - configurations, such fine-grained settings are not needed as - they are considered to be advanced configurations. - - System objects only have a current grade and compartment. - System subjects reflect the range of available rights in the - system, and network interfaces, where they are used for access - control. - - The grade and compartments in a subject and object pair - are used to construct a relationship known as - dominance, in which a subject dominates - an object, the object dominates the subject, neither dominates - the other, or both dominate each other. The both - dominate case occurs when the two labels are equal. - Due to the information flow nature of Biba, a user has rights - to a set of compartments that might correspond to projects, - but objects also have a set of compartments. Users may have - to subset their rights using su or - setpmac in order to access objects in a - compartment from which they are not restricted. - - - - 使用者標籤 - - Users are required to have labels so that their files and - processes properly interact with the security policy defined - on the system. This is configured in - /etc/login.conf using login classes. - Every policy module that uses labels will implement the user - class setting. - - To set the user class default label which will be enforced - by MAC, add a entry. - An example entry containing every - policy module is displayed below. Note that in a real - configuration, the administrator would never enable every - policy module. It is recommended that the rest of this - chapter be reviewed before any configuration is - implemented. - - default:\ - :copyright=/etc/COPYRIGHT:\ - :welcome=/etc/motd:\ - :setenv=MAIL=/var/mail/$,BLOCKSIZE=K:\ - :path=~/bin:/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/sbin:/usr/local/bin:\ - :manpath=/usr/share/man /usr/local/man:\ - :nologin=/usr/sbin/nologin:\ - :cputime=1h30m:\ - :datasize=8M:\ - :vmemoryuse=100M:\ - :stacksize=2M:\ - :memorylocked=4M:\ - :memoryuse=8M:\ - :filesize=8M:\ - :coredumpsize=8M:\ - :openfiles=24:\ - :maxproc=32:\ - :priority=0:\ - :requirehome:\ - :passwordtime=91d:\ - :umask=022:\ - :ignoretime@:\ - :label=partition/13,mls/5,biba/10(5-15),lomac/10[2]: - - While users can not modify the default value, they may - change their label after they login, subject to the - constraints of the policy. The example above tells the Biba - policy that a process's minimum integrity is - 5, its maximum is 15, - and the default effective label is 10. The - process will run at 10 until it chooses to - change label, perhaps due to the user using - setpmac, which will be constrained by Biba - to the configured range. - - After any change to login.conf, the - login class capability database must be rebuilt using - cap_mkdb. - - Many sites have a large number of users requiring - several different user classes. In depth planning is - required as this can become difficult to manage. - - - - 網路介面標籤 - - Labels may be set on network interfaces to help control - the flow of data across the network. Policies using network - interface labels function in the same way that policies - function with respect to objects. Users at high settings in - Biba, for example, will not be permitted to access network - interfaces with a label of low. - - When setting the MAC label on network - interfaces, may be passed to - ifconfig: - - # ifconfig bge0 maclabel biba/equal - - This example will set the MAC label of - biba/equal on the bge0 - interface. When using a setting similar to - biba/high(low-high), the entire label - should be quoted to prevent an error from being - returned. - - Each policy module which supports labeling has a tunable - which may be used to disable the MAC label - on network interfaces. Setting the label to - will have a similar effect. Review - the output of sysctl, the policy manual - pages, and the information in the rest of this chapter for - more information on those tunables. - - - - - 規劃安全架構 - - Before implementing any MAC policies, a - planning phase is recommended. During the planning stages, an - administrator should consider the implementation requirements - and goals, such as: - - - - How to classify information and resources available on - the target systems. - - - - Which information or resources to restrict access to - along with the type of restrictions that should be - applied. - - - - Which MAC modules will be required to - achieve this goal. - - - - A trial run of the trusted system and its configuration - should occur before a - MAC implementation is used on production - systems. Since different environments have different needs and - requirements, establishing a complete security profile will - decrease the need of changes once the system goes live. - - Consider how the MAC framework augments - the security of the system as a whole. The various security - policy modules provided by the MAC framework - could be used to protect the network and file systems or to - block users from accessing certain ports and sockets. Perhaps - the best use of the policy modules is to load several security - policy modules at a time in order to provide a - MLS environment. This approach differs from - a hardening policy, which typically hardens elements of a system - which are used only for specific purposes. The downside to - MLS is increased administrative - overhead. - - The overhead is minimal when compared to the lasting effect - of a framework which provides the ability to pick and choose - which policies are required for a specific configuration and - which keeps performance overhead down. The reduction of support - for unneeded policies can increase the overall performance of - the system as well as offer flexibility of choice. A good - implementation would consider the overall security requirements - and effectively implement the various security policy modules - offered by the framework. - - A system utilizing MAC guarantees that a - user will not be permitted to change security attributes at - will. All user utilities, programs, and scripts must work - within the constraints of the access rules provided by the - selected security policy modules and control of the - MAC access rules is in the hands of the - system administrator. - - It is the duty of the system administrator to carefully - select the correct security policy modules. For an environment - that needs to limit access control over the network, the - mac_portacl4, mac_ifoff4, and mac_biba4 - policy modules make good starting points. For an environment - where strict confidentiality of file system objects is required, - consider the mac_bsdextended4 and mac_mls4 policy - modules. - - Policy decisions could be made based on network - configuration. If only certain users should be permitted - access to ssh1, the mac_portacl4 policy module is - a good choice. In the case of file systems, access to objects - might be considered confidential to some users, but not to - others. As an example, a large development team might be - broken off into smaller projects where developers in project A - might not be permitted to access objects written by developers - in project B. Yet both projects might need to access objects - created by developers in project C. Using the different - security policy modules provided by the MAC - framework, users could be divided into these groups and then - given access to the appropriate objects. - - Each security policy module has a unique way of dealing with - the overall security of a system. Module selection should be - based on a well thought out security policy which may require - revision and reimplementation. Understanding the different - security policy modules offered by the MAC - framework will help administrators choose the best policies - for their situations. - - The rest of this chapter covers the available modules, - describes their use and configuration, and in some cases, - provides insight on applicable situations. - - - Implementing MAC is much like - implementing a firewall since care must be taken to prevent - being completely locked out of the system. The ability to - revert back to a previous configuration should be considered - and the implementation of MAC over a remote - connection should be done with extreme caution. - - - - - 可用的 MAC 管理政策 - - The default FreeBSD kernel - includes options MAC. This means that every - module included with the MAC framework can be - loaded with kldload as a run-time kernel - module. After testing the module, add the module name to - /boot/loader.conf so that it will load - during boot. Each module also provides a kernel option for - those administrators who choose to compile their own custom - kernel. - - FreeBSD includes a group of policies that will cover most - security requirements. Each policy is summarized below. The - last three policies support integer settings in place of the - three default labels. - - - MAC See Other UIDs 政策 - - - MAC See Other UIDs Policy - - Module name: - mac_seeotheruids.ko - - Kernel configuration line: - options MAC_SEEOTHERUIDS - - Boot option: - mac_seeotheruids_load="YES" - - The mac_seeotheruids4 module extends the - security.bsd.see_other_uids and - security.bsd.see_other_gids - sysctl tunables. This option does not - require any labels to be set before configuration and can - operate transparently with other modules. - - After loading the module, the following - sysctl tunables may be used to control its - features: - - - - security.mac.seeotheruids.enabled - enables the module and implements the default settings - which deny users the ability to view processes and sockets - owned by other users. - - - - - security.mac.seeotheruids.specificgid_enabled - allows specified groups to be exempt from this policy. To - exempt specific groups, use the - security.mac.seeotheruids.specificgid=XXX - sysctl tunable, replacing - XXX with the numeric group ID - to be exempted. - - - - - security.mac.seeotheruids.primarygroup_enabled - is used to exempt specific primary groups from this - policy. When using this tunable, - security.mac.seeotheruids.specificgid_enabled - may not be set. - - - - - - MAC BSD Extended 政策 - - - MAC - File System Firewall Policy - - Module name: - mac_bsdextended.ko - - Kernel configuration line: - options MAC_BSDEXTENDED - - Boot option: - mac_bsdextended_load="YES" - - The mac_bsdextended4 module enforces a file system - firewall. It provides an extension to the standard file - system permissions model, permitting an administrator to - create a firewall-like ruleset to protect files, utilities, - and directories in the file system hierarchy. When access to - a file system object is attempted, the list of rules is - iterated until either a matching rule is located or the end is - reached. This behavior may be changed using - security.mac.bsdextended.firstmatch_enabled. - Similar to other firewall modules in FreeBSD, a file containing - the access control rules can be created and read by the system - at boot time using an rc.conf5 variable. - - The rule list may be entered using ugidfw8 which - has a syntax similar to ipfw8. More tools can be - written by using the functions in the libugidfw3 - library. - - After the mac_bsdextended4 module has been loaded, - the following command may be used to list the current rule - configuration: - - # ugidfw list -0 slots, 0 rules - - By default, no rules are defined and everything is - completely accessible. To create a rule which blocks all - access by users but leaves root unaffected: - - # ugidfw add subject not uid root new object not uid root mode n - - While this rule is simple to implement, it is a very bad - idea as it blocks all users from issuing any commands. A - more realistic example blocks user1 all access, including - directory listings, to user2's - home directory: - - # ugidfw set 2 subject uid user1 object uid user2 mode n -# ugidfw set 3 subject uid user1 object gid user2 mode n - - Instead of user1, could be used - in order to enforce the same access restrictions for all - users. However, the root user is unaffected by - these rules. - - - Extreme caution should be taken when working with this - module as incorrect use could block access to certain - parts of the file system. - - - - - MAC Interface Silencing 政策 - - - MAC Interface Silencing Policy - - Module name: mac_ifoff.ko - - Kernel configuration line: options - MAC_IFOFF - - Boot option: - mac_ifoff_load="YES" - - The mac_ifoff4 module is used to disable network - interfaces on the fly and to keep network interfaces from - being brought up during system boot. It does not use labels - and does not depend on any other - MAC modules. - - Most of this module's control is performed through these - sysctl tunables: - - - - security.mac.ifoff.lo_enabled - enables or disables all traffic on the loopback, - lo4, interface. - - - - security.mac.ifoff.bpfrecv_enabled - enables or disables all traffic on the Berkeley Packet - Filter interface, bpf4. - - - - security.mac.ifoff.other_enabled - enables or disables traffic on all other - interfaces. - - - - One of the most common uses of mac_ifoff4 is - network monitoring in an environment where network traffic - should not be permitted during the boot sequence. Another - use would be to write a script which uses an application such - as security/aide to automatically block - network traffic if it finds new or altered files in protected - directories. - - - - MAC Port Access Control 政策 - - - MAC Port Access Control List Policy - - Module name: mac_portacl.ko - - Kernel configuration line: - MAC_PORTACL - - Boot option: - mac_portacl_load="YES" - - The mac_portacl4 module is used to limit binding to - local TCP and UDP ports, - making it possible to allow non-root users to bind to - specified privileged ports below 1024. - - Once loaded, this module enables the - MAC policy on all sockets. The following - tunables are available: - - - - security.mac.portacl.enabled - enables or disables the policy completely. - - - - security.mac.portacl.port_high - sets the highest port number that mac_portacl4 - protects. - - - - security.mac.portacl.suser_exempt, - when set to a non-zero value, exempts the root user from this - policy. - - - - security.mac.portacl.rules - specifies the policy as a text string of the form - rule[,rule,...], with as many rules as - needed, and where each rule is of the form - idtype:id:protocol:port. The - idtype is either - uid or gid. The - protocol parameter can be - tcp or udp. The - port parameter is the port number - to allow the specified user or group to bind to. Only - numeric values can be used for the user ID, group ID, - and port parameters. - - - - By default, ports below 1024 can only be used by - privileged processes which run as root. For mac_portacl4 - to allow non-privileged processes to bind to ports below 1024, - set the following tunables as - follows: - - # sysctl security.mac.portacl.port_high=1023 -# sysctl net.inet.ip.portrange.reservedlow=0 -# sysctl net.inet.ip.portrange.reservedhigh=0 - - To prevent the root user from being affected - by this policy, set - security.mac.portacl.suser_exempt to a - non-zero value. - - # sysctl security.mac.portacl.suser_exempt=1 - - To allow the www - user with UID 80 to bind to port 80 - without ever needing root privilege: - - # sysctl security.mac.portacl.rules=uid:80:tcp:80 - - This next example permits the user with the - UID of 1001 to bind to - TCP ports 110 (POP3) and 995 - (POP3s): - - # sysctl security.mac.portacl.rules=uid:1001:tcp:110,uid:1001:tcp:995 - - - - MAC Partition 政策 - - - MAC Process Partition Policy - - Module name: mac_partition.ko - - Kernel configuration line: - options MAC_PARTITION - - Boot option: - mac_partition_load="YES" - - The mac_partition4 policy drops processes into - specific partitions based on their - MAC label. Most configuration for this - policy is done using setpmac8. One - sysctl tunable is available for this - policy: - - - - security.mac.partition.enabled - enables the enforcement of MAC process - partitions. - - - - When this policy is enabled, users will only be permitted - to see their processes, and any others within their partition, - but will not be permitted to work with utilities outside the - scope of this partition. For instance, a user in the - insecure class will not be permitted to - access top as well as many other commands - that must spawn a process. - - This example adds top to the label set - on users in the insecure class. All - processes spawned by users in the insecure - class will stay in the partition/13 - label. - - # setpmac partition/13 top - - This command displays the partition label and the process - list: - - # ps Zax - - This command displays another user's process partition - label and that user's currently running processes: - - # ps -ZU trhodes - - - Users can see processes in root's label unless the - mac_seeotheruids4 policy is loaded. - - - - - MAC Multi-Level Security 模組 - - - MAC Multi-Level Security Policy - - Module name: mac_mls.ko - - Kernel configuration line: - options MAC_MLS - - Boot option: mac_mls_load="YES" - - The mac_mls4 policy controls access between - subjects and objects in the system by enforcing a strict - information flow policy. - - In MLS environments, a - clearance level is set in the label of each - subject or object, along with compartments. Since these - clearance levels can reach numbers greater than several - thousand, it would be a daunting task to thoroughly configure - every subject or object. To ease this administrative - overhead, three labels are included in this policy: - mls/low, mls/equal, and - mls/high, where: - - - - Anything labeled with mls/low will - have a low clearance level and not be permitted to access - information of a higher level. This label also prevents - objects of a higher clearance level from writing or - passing information to a lower level. - - - - mls/equal should be placed on - objects which should be exempt from the policy. - - - - mls/high is the highest level of - clearance possible. Objects assigned this label will hold - dominance over all other objects in the system; however, - they will not permit the leaking of information to objects - of a lower class. - - - - MLS provides: - - - - A hierarchical security level with a set of - non-hierarchical categories. - - - - Fixed rules of no read up, no write - down. This means that a subject can have read - access to objects on its own level or below, but not - above. Similarly, a subject can have write access to - objects on its own level or above, but not beneath. - - - - Secrecy, or the prevention of inappropriate disclosure - of data. - - - - A basis for the design of systems that concurrently - handle data at multiple sensitivity levels without leaking - information between secret and confidential. - - - - The following sysctl tunables are - available: - - - - security.mac.mls.enabled is used to - enable or disable the MLS - policy. - - - - security.mac.mls.ptys_equal - labels all pty4 devices as - mls/equal during creation. - - - - security.mac.mls.revocation_enabled - revokes access to objects after their label changes to a - label of a lower grade. - - - - security.mac.mls.max_compartments - sets the maximum number of compartment levels allowed on a - system. - - - - To manipulate MLS labels, use - setfmac8. To assign a label to an object: - - # setfmac mls/5 test - - To get the MLS label for the file - test: - - # getfmac test - - Another approach is to create a master policy file in - /etc/ which specifies the - MLS policy information and to feed that - file to setfmac. - - When using the MLS policy module, an - administrator plans to control the flow of sensitive - information. The default block read up block write - down sets everything to a low state. Everything - is accessible and an administrator slowly augments the - confidentiality of the information. - - Beyond the three basic label options, an administrator - may group users and groups as required to block the - information flow between them. It might be easier to look at - the information in clearance levels using descriptive words, - such as classifications of Confidential, - Secret, and Top Secret. - Some administrators instead create different groups based on - project levels. Regardless of the classification method, a - well thought out plan must exist before implementing a - restrictive policy. - - Some example situations for the MLS - policy module include an e-commerce web server, a file server - holding critical company information, and financial - institution environments. - - - - MAC Biba 模組 - - - MAC Biba Integrity Policy - - Module name: mac_biba.ko - - Kernel configuration line: options - MAC_BIBA - - Boot option: mac_biba_load="YES" - - The mac_biba4 module loads the - MAC Biba policy. This policy is similar to - the MLS policy with the exception that the - rules for information flow are slightly reversed. This is to - prevent the downward flow of sensitive information whereas the - MLS policy prevents the upward flow of - sensitive information. - - In Biba environments, an integrity label is - set on each subject or object. These labels are made up of - hierarchical grades and non-hierarchical components. As a - grade ascends, so does its integrity. - - Supported labels are biba/low, - biba/equal, and - biba/high, where: - - - - biba/low is considered the lowest - integrity an object or subject may have. Setting this on - objects or subjects blocks their write access to objects - or subjects marked as biba/high, but - will not prevent read access. - - - - biba/equal should only be placed on - objects considered to be exempt from the policy. - - - - biba/high permits writing to - objects set at a lower label, but does not permit reading - that object. It is recommended that this label be - placed on objects that affect the integrity of the entire - system. - - - - Biba provides: - - - - Hierarchical integrity levels with a set of - non-hierarchical integrity categories. - - - - Fixed rules are no write up, no read - down, the opposite of - MLS. A subject can have write access - to objects on its own level or below, but not above. - Similarly, a subject can have read access to objects on - its own level or above, but not below. - - - - Integrity by preventing inappropriate modification of - data. - - - - Integrity levels instead of MLS - sensitivity levels. - - - - The following tunables can be used to manipulate the Biba - policy: - - - - security.mac.biba.enabled is used - to enable or disable enforcement of the Biba policy on the - target machine. - - - - security.mac.biba.ptys_equal is - used to disable the Biba policy on pty4 - devices. - - - - security.mac.biba.revocation_enabled - forces the revocation of access to objects if the label is - changed to dominate the subject. - - - - To access the Biba policy setting on system objects, use - setfmac and - getfmac: - - # setfmac biba/low test -# getfmac test -test: biba/low - - Integrity, which is different from sensitivity, is used to - guarantee that information is not manipulated by untrusted - parties. This includes information passed between subjects - and objects. It ensures that users will only be able to - modify or access information they have been given explicit - access to. The mac_biba4 security policy module - permits an administrator to configure which files and programs - a user may see and invoke while assuring that the programs and - files are trusted by the system for that user. - - During the initial planning phase, an administrator must - be prepared to partition users into grades, levels, and areas. - The system will default to a high label once this policy - module is enabled, and it is up to the administrator to - configure the different grades and levels for users. Instead - of using clearance levels, a good planning method could - include topics. For instance, only allow developers - modification access to the source code repository, source - code compiler, and other development utilities. Other users - would be grouped into other categories such as testers, - designers, or end users and would only be permitted read - access. - - A lower integrity subject is unable to write to a higher - integrity subject and a higher integrity subject cannot list - or read a lower integrity object. Setting a label at the - lowest possible grade could make it inaccessible to subjects. - Some prospective environments for this security policy module - would include a constrained web server, a development and test - machine, and a source code repository. A less useful - implementation would be a personal workstation, a machine used - as a router, or a network firewall. - - - - MAC Low-watermark 模組 - - - MAC LOMAC - - Module name: mac_lomac.ko - - Kernel configuration line: options - MAC_LOMAC - - Boot option: - mac_lomac_load="YES" - - Unlike the MAC Biba policy, the - mac_lomac4 policy permits access to lower integrity - objects only after decreasing the integrity level to not - disrupt any integrity rules. - - The Low-watermark integrity policy works almost - identically to Biba, with the exception of using floating - labels to support subject demotion via an auxiliary grade - compartment. This secondary compartment takes the form - [auxgrade]. When assigning a policy with - an auxiliary grade, use the syntax - lomac/10[2], where - 2 is the auxiliary grade. - - This policy relies on the ubiquitous labeling of all - system objects with integrity labels, permitting subjects to - read from low integrity objects and then downgrading the label - on the subject to prevent future writes to high integrity - objects using [auxgrade]. The policy may - provide greater compatibility and require less initial - configuration than Biba. - - Like the Biba and MLS policies, - setfmac and setpmac - are used to place labels on system objects: - - # setfmac /usr/home/trhodes lomac/high[low] -# getfmac /usr/home/trhodes lomac/high[low] - - The auxiliary grade low is a feature - provided only by the MAC - LOMAC policy. - - - - - User Lock Down - - This example considers a relatively small storage system - with fewer than fifty users. Users will have login - capabilities and are permitted to store data and access - resources. - - For this scenario, the mac_bsdextended4 and - mac_seeotheruids4 policy modules could co-exist and block - access to system objects while hiding user processes. - - Begin by adding the following line to - /boot/loader.conf: - - mac_seeotheruids_load="YES" - - The mac_bsdextended4 security policy module may be - activated by adding this line to - /etc/rc.conf: - - ugidfw_enable="YES" - - Default rules stored in - /etc/rc.bsdextended will be loaded at - system initialization. However, the default entries may need - modification. Since this machine is expected only to service - users, everything may be left commented out except the last - two lines in order to force the loading of user owned system - objects by default. - - Add the required users to this machine and reboot. For - testing purposes, try logging in as a different user across - two consoles. Run ps aux to see if processes - of other users are visible. Verify that running ls1 on - another user's home directory fails. - - Do not try to test with the root user unless the specific - sysctls have been modified to block super - user access. - - - When a new user is added, their mac_bsdextended4 - rule will not be in the ruleset list. To update the ruleset - quickly, unload the security policy module and reload it again - using kldunload8 and kldload8. - - - - - 在 MAC Jail 中使用 Nagios - - - Nagios in a MAC Jail - - - This section demonstrates the steps that are needed to - implement the Nagios network - monitoring system in a MAC environment. This - is meant as an example which still requires the administrator to - test that the implemented policy meets the security requirements - of the network before using in a production environment. - - This example requires to be set - on each file system. It also assumes that - net-mgmt/nagios-plugins, - net-mgmt/nagios, and - www/apache22 are all installed, configured, - and working correctly before attempting the integration into the - MAC framework. - - - 建立不安全的使用者類別 - - Begin the procedure by adding the following user class - to /etc/login.conf: - - insecure:\ -:copyright=/etc/COPYRIGHT:\ -:welcome=/etc/motd:\ -:setenv=MAIL=/var/mail/$,BLOCKSIZE=K:\ -:path=~/bin:/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/sbin:/usr/local/bin -:manpath=/usr/share/man /usr/local/man:\ -:nologin=/usr/sbin/nologin:\ -:cputime=1h30m:\ -:datasize=8M:\ -:vmemoryuse=100M:\ -:stacksize=2M:\ -:memorylocked=4M:\ -:memoryuse=8M:\ -:filesize=8M:\ -:coredumpsize=8M:\ -:openfiles=24:\ -:maxproc=32:\ -:priority=0:\ -:requirehome:\ -:passwordtime=91d:\ -:umask=022:\ -:ignoretime@:\ -:label=biba/10(10-10): - - Then, add the following line to the default user class - section: - - :label=biba/high: - - Save the edits and issue the following command to rebuild - the database: - - # cap_mkdb /etc/login.conf - - - - 設定使用者 - - Set the root - user to the default class using: - - # pw usermod root -L default - - All user accounts that are not root will now require a login - class. The login class is required, otherwise users will be - refused access to common commands. The following - sh script should do the trick: - - # for x in `awk -F: '($3 >= 1001) && ($3 != 65534) { print $1 }' \ - /etc/passwd`; do pw usermod $x -L default; done; - - Next, drop the nagios and www accounts into the insecure - class: - - # pw usermod nagios -L insecure -# pw usermod www -L insecure - - - - 建立關聯檔 (Context File) - - A contexts file should now be created as - /etc/policy.contexts: - - # This is the default BIBA policy for this system. - -# System: -/var/run(/.*)? biba/equal - -/dev/(/.*)? biba/equal - -/var biba/equal -/var/spool(/.*)? biba/equal - -/var/log(/.*)? biba/equal - -/tmp(/.*)? biba/equal -/var/tmp(/.*)? biba/equal - -/var/spool/mqueue biba/equal -/var/spool/clientmqueue biba/equal - -# For Nagios: -/usr/local/etc/nagios(/.*)? biba/10 - -/var/spool/nagios(/.*)? biba/10 - -# For apache -/usr/local/etc/apache(/.*)? biba/10 - - This policy enforces security by setting restrictions on - the flow of information. In this specific configuration, - users, including root, should never be - allowed to access Nagios. - Configuration files and processes that are a part of - Nagios will be completely self - contained or jailed. - - This file will be read after running - setfsmac on every file system. This - example sets the policy on the root file system: - - # setfsmac -ef /etc/policy.contexts / - - Next, add these edits to the main section of - /etc/mac.conf: - - default_labels file ?biba -default_labels ifnet ?biba -default_labels process ?biba -default_labels socket ?biba - - - - 載入程式設定 - - To finish the configuration, add the following lines to - /boot/loader.conf: - - mac_biba_load="YES" -mac_seeotheruids_load="YES" -security.mac.biba.trust_all_interfaces=1 - - And the following line to the network card configuration - stored in /etc/rc.conf. If the primary - network configuration is done via DHCP, - this may need to be configured manually after every system - boot: - - maclabel biba/equal - - - - 測試設定 - - - MAC Configuration Testing - - - First, ensure that the web server and - Nagios will not be started on - system initialization and reboot. Ensure that root cannot access any of the - files in the Nagios configuration - directory. If root - can list the contents of - /var/spool/nagios, something is wrong. - Instead, a permission denied error should be - returned. - - If all seems well, Nagios, - Apache, and - Sendmail can now be started: - - # cd /etc/mail && make stop && \ -setpmac biba/equal make start && setpmac biba/10\(10-10\) apachectl start && \ -setpmac biba/10\(10-10\) /usr/local/etc/rc.d/nagios.sh forcestart - - Double check to ensure that everything is working - properly. If not, check the log files for error messages. If - needed, use sysctl8 to disable the mac_biba4 - security policy module and try starting everything again as - usual. - - - The root user - can still change the security enforcement and edit its - configuration files. The following command will permit the - degradation of the security policy to a lower grade for a - newly spawned shell: - - # setpmac biba/10 csh - - To block this from happening, force the user into a - range using login.conf5. If setpmac8 attempts - to run a command outside of the compartment's range, an - error will be returned and the command will not be executed. - In this case, set root to - biba/high(high-high). - - - - - - MAC 架構疑難排解 - - - MAC Troubleshooting - - - This section discusses common configuration errors and how - to resolve them. - - - - The flag does not stay - enabled on the root (/) - partition: - - - The following steps may resolve this transient - error: - - - - Edit /etc/fstab and set the - root partition to for - read-only. - - - - Reboot into single user mode. - - - - Run tunefs on /. - - - - Reboot the system. - - - - Run mount - / and change the - back to in - /etc/fstab and reboot the system - again. - - - - Double-check the output from - mount to ensure that - has been properly set on - the root file system. - - - - - - - After establishing a secure environment with - MAC, Xorg no - longer starts: - - This could be caused by the MAC - partition policy or by a mislabeling - in one of the MAC labeling policies. - To debug, try the following: - - - - Check the error message. If the user is in the - insecure class, the - partition policy may be the - culprit. Try setting the user's class back to the - default class and rebuild the - database with cap_mkdb. If this - does not alleviate the problem, go to step two. - - - - Double-check that the label policies are set - correctly for the user, - Xorg, and the - /dev entries. - - - - If neither of these resolve the problem, send the - error message and a description of the environment to - the FreeBSD general questions mailing list. - - - - - - - The _secure_path: unable to stat - .login_conf error appears: - - This error can appear when a user attempts to switch - from the root - user to another user in the system. This message - usually occurs when the user has a higher label setting - than that of the user they are attempting to become. - For instance, if joe has a default label - of and root has a label of - , root cannot view - joe's home - directory. This will happen whether or not root has used - su to become joe as the Biba - integrity model will not permit root to view objects set - at a lower integrity level. - - - - - The system no longer recognizes root: - - When this occurs, whoami returns - 0 and su returns - who are you?. - - This can happen if a labeling policy has been - disabled by sysctl8 or the policy module was - unloaded. If the policy is disabled, the login - capabilities database needs to be reconfigured. Double - check /etc/login.conf to ensure - that all options have been - removed and rebuild the database with - cap_mkdb. - - This may also happen if a policy restricts access to - master.passwd. This is usually - caused by an administrator altering the file under a - label which conflicts with the general policy being used - by the system. In these cases, the user information - would be read by the system and access would be blocked - as the file has inherited the new label. Disable the - policy using sysctl8 and everything should return - to normal. - - - - - - - - - - - - - - 安全事件稽查 - - - - - Tom - Rhodes - - Written by - - - - - Robert - Watson - - - - - - - 概述 - - AUDIT - - Security Event Auditing - MAC - - - The FreeBSD operating system includes support for security - event auditing. Event auditing supports reliable, fine-grained, - and configurable logging of a variety of security-relevant - system events, including logins, configuration changes, and file - and network access. These log records can be invaluable for - live system monitoring, intrusion detection, and postmortem - analysis. FreeBSD implements Sun's published Basic Security - Module (BSM) Application Programming - Interface (API) and file format, and is - interoperable with the Solaris and Mac OS X audit - implementations. - - This chapter focuses on the installation and configuration - of event auditing. It explains audit policies and provides an - example audit configuration. - - 讀完這章,您將了解: - - - - What event auditing is and how it works. - - - - How to configure event auditing on FreeBSD for users and - processes. - - - - How to review the audit trail using the audit reduction - and review tools. - - - - 在開始閱讀這章之前,您需要: - - - - 了解 UNIX 及 FreeBSD 基礎 ()。 - - - - Be familiar with the basics of kernel - configuration/compilation (). - - - - Have some familiarity with security and how it pertains - to FreeBSD (). - - - - - The audit facility has some known limitations. Not all - security-relevant system events are auditable and some login - mechanisms, such as Xorg-based - display managers and third-party daemons, do not properly - configure auditing for user login sessions. - - The security event auditing facility is able to generate - very detailed logs of system activity. On a busy system, - trail file data can be very large when configured for high - detail, exceeding gigabytes a week in some configurations. - Administrators should take into account the disk space - requirements associated with high volume audit configurations. - For example, it may be desirable to dedicate a file system to - /var/audit so that other file systems are - not affected if the audit file system becomes full. - - - - - 關鍵詞 - - The following terms are related to security event - auditing: - - - - event: an auditable event is any - event that can be logged using the audit subsystem. - Examples of security-relevant events include the creation of - a file, the building of a network connection, or a user - logging in. Events are either attributable, - meaning that they can be traced to an authenticated user, or - non-attributable. Examples of - non-attributable events are any events that occur before - authentication in the login process, such as bad password - attempts. - - - - class: a named set of related - events which are used in selection expressions. Commonly - used classes of events include file creation - (fc), exec (ex), and - login_logout (lo). - - - - record: an audit log entry - describing a security event. Records contain a record - event type, information on the subject (user) performing the - action, date and time information, information on any - objects or arguments, and a success or failure - condition. - - - - trail: a log file consisting of a - series of audit records describing security events. Trails - are in roughly chronological order with respect to the time - events completed. Only authorized processes are allowed to - commit records to the audit trail. - - - - selection expression: a string - containing a list of prefixes and audit event class names - used to match events. - - - - preselection: the process by which - the system identifies which events are of interest to the - administrator. The preselection configuration uses a series - of selection expressions to identify which classes of events - to audit for which users, as well as global settings that - apply to both authenticated and unauthenticated - processes. - - - - reduction: the process by which - records from existing audit trails are selected for - preservation, printing, or analysis. Likewise, the process - by which undesired audit records are removed from the audit - trail. Using reduction, administrators can implement - policies for the preservation of audit data. For example, - detailed audit trails might be kept for one month, but after - that, trails might be reduced in order to preserve only - login information for archival purposes. - - - - - - 稽查設定 - - User space support for event auditing is installed as part - of the base FreeBSD operating system. Kernel support is available - in the GENERIC kernel by default, - and auditd8 can be enabled - by adding the following line to - /etc/rc.conf: - - auditd_enable="YES" - - Then, start the audit daemon: - - # service auditd start - - Users who prefer to compile a custom kernel must include the - following line in their custom kernel configuration file: - - options AUDIT - - - 事件選擇表示法 - - Selection expressions are used in a number of places in - the audit configuration to determine which events should be - audited. Expressions contain a list of event classes to - match. Selection expressions are evaluated from left to - right, and two expressions are combined by appending one onto - the other. - - summarizes the default - audit event classes: - - - 預設稽查事件類別 - - - - - 類別名稱 - 說明 - 動作 - - - - - - all - all - Match all event classes. - - - - aa - authentication and authorization - - - - - ad - administrative - Administrative actions performed on the system as - a whole. - - - - ap - application - Application defined action. - - - - cl - file close - Audit calls to the - close system call. - - - - ex - exec - Audit program execution. Auditing of command - line arguments and environmental variables is - controlled via audit_control5 using the - argv and envv - parameters to the policy - setting. - - - - fa - file attribute access - Audit the access of object attributes such as - stat1 and pathconf2. - - - - fc - file create - Audit events where a file is created as a - result. - - - - fd - file delete - Audit events where file deletion occurs. - - - - fm - file attribute modify - Audit events where file attribute modification - occurs, such as by chown8, chflags1, and - flock2. - - - - fr - file read - Audit events in which data is read or files are - opened for reading. - - - - fw - file write - Audit events in which data is written or files - are written or modified. - - - - io - ioctl - Audit use of the ioctl - system call. - - - - ip - ipc - Audit various forms of Inter-Process - Communication, including POSIX pipes and System V - IPC operations. - - - - lo - login_logout - Audit login1 and logout1 - events. - - - - na - non attributable - Audit non-attributable events. - - - - no - invalid class - Match no audit events. - - - - nt - network - Audit events related to network actions such as - connect2 and accept2. - - - - ot - other - Audit miscellaneous events. - - - - pc - process - Audit process operations such as exec3 and - exit3. - - - -
- - These audit event classes may be customized by modifying - the audit_class and - audit_event configuration files. - - Each audit event class may be combined with a prefix - indicating whether successful/failed operations are matched, - and whether the entry is adding or removing matching for the - class and type. summarizes - the available prefixes: - - - 稽查事件類別字首 - - - - - 字首 - 動作 - - - - - - + - Audit successful events in this class. - - - - - - Audit failed events in this class. - - - - ^ - Audit neither successful nor failed events in - this class. - - - - ^+ - Do not audit successful events in this - class. - - - - ^- - Do not audit failed events in this class. - - - -
- - If no prefix is present, both successful and failed - instances of the event will be audited. - - The following example selection string selects both - successful and failed login/logout events, but only successful - execution events: - - lo,+ex -
- - - 設定檔 - - The following configuration files for security event - auditing are found in - /etc/security: - - - - audit_class: contains the - definitions of the audit classes. - - - - audit_control: controls aspects - of the audit subsystem, such as default audit classes, - minimum disk space to leave on the audit log volume, and - maximum audit trail size. - - - - audit_event: textual names and - descriptions of system audit events and a list of which - classes each event is in. - - - - audit_user: user-specific audit - requirements to be combined with the global defaults at - login. - - - - audit_warn: a customizable shell - script used by auditd8 to generate warning messages - in exceptional situations, such as when space for audit - records is running low or when the audit trail file has - been rotated. - - - - - Audit configuration files should be edited and - maintained carefully, as errors in configuration may result - in improper logging of events. - - - In most cases, administrators will only need to modify - audit_control and - audit_user. The first file controls - system-wide audit properties and policies and the second file - may be used to fine-tune auditing by user. - - - The <filename>audit_control</filename> File - - A number of defaults for the audit subsystem are - specified in audit_control: - - dir:/var/audit -dist:off -flags:lo,aa -minfree:5 -naflags:lo,aa -policy:cnt,argv -filesz:2M -expire-after:10M - - The entry is used to set one or - more directories where audit logs will be stored. If more - than one directory entry appears, they will be used in order - as they fill. It is common to configure audit so that audit - logs are stored on a dedicated file system, in order to - prevent interference between the audit subsystem and other - subsystems if the file system fills. - - If the field is set to - on or yes, hard links - will be created to all trail files in - /var/audit/dist. - - The field sets the system-wide - default preselection mask for attributable events. In the - example above, successful and failed login/logout events as - well as authentication and authorization are audited for all - users. - - The entry defines the minimum - percentage of free space for the file system where the audit - trail is stored. - - The entry specifies audit - classes to be audited for non-attributed events, such as the - login/logout process and authentication and - authorization. - - The entry specifies a - comma-separated list of policy flags controlling various - aspects of audit behavior. The cnt - indicates that the system should continue running despite an - auditing failure (this flag is highly recommended). The - other flag, argv, causes command line - arguments to the execve2 system call to be audited as - part of command execution. - - The entry specifies the maximum - size for an audit trail before automatically terminating and - rotating the trail file. A value of 0 - disables automatic log rotation. If the requested file size - is below the minimum of 512k, it will be ignored and a log - message will be generated. - - The field specifies when - audit log files will expire and be removed. - - - - The <filename>audit_user</filename> File - - The administrator can specify further audit requirements - for specific users in audit_user. - Each line configures auditing for a user via two fields: - the alwaysaudit field specifies a set of - events that should always be audited for the user, and the - neveraudit field specifies a set of - events that should never be audited for the user. - - The following example entries audit login/logout events - and successful command execution for root and file creation and - successful command execution for www. If used with the - default audit_control, the - lo entry for root is redundant, and - login/logout events will also be audited for www. - - root:lo,+ex:no -www:fc,+ex:no - - -
- - - 查看稽查線索 - - Since audit trails are stored in the BSM - binary format, several built-in tools are available to modify or - convert these trails to text. To convert trail files to a - simple text format, use praudit. To reduce - the audit trail file for analysis, archiving, or printing - purposes, use auditreduce. This utility - supports a variety of selection parameters, including event - type, event class, user, date or time of the event, and the file - path or object acted on. - - For example, to dump the entire contents of a specified - audit log in plain text: - - # praudit /var/audit/AUDITFILE - - Where AUDITFILE is the audit log - to dump. - - Audit trails consist of a series of audit records made up of - tokens, which praudit prints sequentially, - one per line. Each token is of a specific type, such as - header (an audit record header) or - path (a file path from a name lookup). The - following is an example of an - execve event: - - header,133,10,execve(2),0,Mon Sep 25 15:58:03 2006, + 384 msec -exec arg,finger,doug -path,/usr/bin/finger -attribute,555,root,wheel,90,24918,104944 -subject,robert,root,wheel,root,wheel,38439,38032,42086,128.232.9.100 -return,success,0 -trailer,133 - - This audit represents a successful - execve call, in which the command - finger doug has been run. The - exec arg token contains the processed command - line presented by the shell to the kernel. The - path token holds the path to the executable - as looked up by the kernel. The attribute - token describes the binary and includes the file mode. The - subject token stores the audit user ID, - effective user ID and group ID, real user ID and group ID, - process ID, session ID, port ID, and login address. Notice that - the audit user ID and real user ID differ as the user - robert switched to the - root account before - running this command, but it is audited using the original - authenticated user. The return token - indicates the successful execution and the - trailer concludes the record. - - XML output format is also supported and - can be selected by including . - - Since audit logs may be very large, a subset of records can - be selected using auditreduce. This example - selects all audit records produced for the user - trhodes stored in - AUDITFILE: - - # auditreduce -u trhodes /var/audit/AUDITFILE | praudit - - Members of the audit group have permission to - read audit trails in /var/audit. By - default, this group is empty, so only the root user can read audit trails. - Users may be added to the audit group in order to - delegate audit review rights. As the ability to track audit log - contents provides significant insight into the behavior of users - and processes, it is recommended that the delegation of audit - review rights be performed with caution. - - - 使用 Audit Pipes 即時監視 - - Audit pipes are cloning pseudo-devices which allow - applications to tap the live audit record stream. This is - primarily of interest to authors of intrusion detection and - system monitoring applications. However, the audit pipe - device is a convenient way for the administrator to allow live - monitoring without running into problems with audit trail file - ownership or log rotation interrupting the event stream. To - track the live audit event stream: - - # praudit /dev/auditpipe - - By default, audit pipe device nodes are accessible only to - the root user. To - make them accessible to the members of the audit group, add a - devfs rule to - /etc/devfs.rules: - - add path 'auditpipe*' mode 0440 group audit - - See devfs.rules5 for more information on - configuring the devfs file system. - - - It is easy to produce audit event feedback cycles, in - which the viewing of each audit event results in the - generation of more audit events. For example, if all - network I/O is audited, and - praudit is run from an - SSH session, a continuous stream of audit - events will be generated at a high rate, as each event being - printed will generate another event. For this reason, it is - advisable to run praudit on an audit pipe - device from sessions without fine-grained - I/O auditing. - - - - - 翻轉與壓縮 Audit Trail 檔 - - Audit trails are written to by the kernel and - managed by the audit daemon, auditd8. - Administrators should not attempt to use - newsyslog.conf5 or other tools to directly rotate - audit logs. Instead, audit should - be used to shut down auditing, reconfigure the audit system, - and perform log rotation. The following command causes the - audit daemon to create a new audit log and signal the kernel - to switch to using the new log. The old log will be - terminated and renamed, at which point it may then be - manipulated by the administrator: - - # audit -n - - If auditd8 is not currently running, this command - will fail and an error message will be produced. - - Adding the following line to - /etc/crontab will schedule this rotation - every twelve hours: - - 0 */12 * * * root /usr/sbin/audit -n - - The change will take effect once - /etc/crontab is saved. - - Automatic rotation of the audit trail file based on file - size is possible using in - audit_control as described in . - - As audit trail files can become very large, it is often - desirable to compress or otherwise archive trails once they - have been closed by the audit daemon. The - audit_warn script can be used to perform - customized operations for a variety of audit-related events, - including the clean termination of audit trails when they are - rotated. For example, the following may be added to - /etc/security/audit_warn to compress - audit trails on close: - - # -# Compress audit trail files on close. -# -if [ "$1" = closefile ]; then - gzip -9 $2 -fi - - Other archiving activities might include copying trail - files to a centralized server, deleting old trail files, or - reducing the audit trail to remove unneeded records. This - script will be run only when audit trail files are cleanly - terminated, so will not be run on trails left unterminated - following an improper shutdown. - - -
- - - - - - - 儲存設備 - - - 概述 - - 本章涵蓋如何在 FreeBSD 下使用磁碟及儲存媒體,這包含 SCSIIDE 磁碟、CDDVD 媒體、記憶體磁碟及 USB 儲存裝置。 - - 讀完這章,您將了解: - - - - 如何在 FreeBSD 系統加入額外的硬碟。 - - - - 如何在 FreeBSD 擴增磁碟分割區的大小。 - - - - 如何設定 FreeBSD 使用 USB 儲存裝置。 - - - - 如何在 FreeBSD 系統使用 CDDVD 媒體。 - - - - 如何使用在 FreeBSD 下可用的備份程式。 - - - - 如何設定記憶體磁碟。 - - - - 什麼是檔案系統快照 (Snapshot) 以及如何有效使用。 - - - - 如何使用配額 (Quota) 來限制磁碟空間使用量。 - - - - 如何加密磁碟及交換空間來防範攻擊者。 - - - - 如何設定高可用性 (Highly available) 的儲存網路。 - - - - 在開始閱讀這章之前,您需要: - - - - 了解如何 設定並安裝新的 FreeBSD 核心。 - - - - - - - 加入磁碟 - - - - - David - O'Brien - - Originally contributed by - - - - - - disks - adding - - - 本節將說明如何加入新的 SATA 磁碟到目前只有一個磁碟的機器上。 首先要關閉電腦並依照電腦、控制器及磁碟製造商的操作指南將磁碟安裝到電腦。重新啟動系統並登入 root - - 查看 /var/run/dmesg.boot 來確認已經找到新的磁碟。在本例中,會以 ada1 代表新加入的 SATA 磁碟。 - - partitions - - gpart - - - 在本例中,會在新的磁碟上建立單一大型分割區,使用 GPT 分割表格式而非較舊與通用性較差的 MBR 結構。 - - - 若新加入的磁碟不是空白的,可以使用 gpart delete 來移除舊的分割區資訊。請參考 gpart8 取得詳細資訊。 - - - 建立完分割表格式後接著加入一個分割區,要在新的磁碟增進效能可使用較大的硬體區塊大小 (Block size),此分割區會對齊 1 MB 的邊界: - - # gpart create -s GPT ada1 -# gpart add -t freebsd-ufs -a 1M ada1 - - 依據使用情況,也可以使用較小的分割區。請參考 gpart8 來取得建立較小分割區的選項。 - - 磁碟分割區資訊可以使用 gpart show 檢視: - - % gpart show ada1 -=> 34 1465146988 ada1 GPT (699G) - 34 2014 - free - (1.0M) - 2048 1465143296 1 freebsd-ufs (699G) - 1465145344 1678 - free - (839K) - - 在新磁碟的新分割區上建立檔案系統: - - # newfs -U /dev/ada1p1 - - 建立一個空的目錄做來做為掛載點 (mountpoint),一個在原有磁碟的檔案系統上可用來掛載新磁碟的位置: - - # mkdir /newdisk - - 最後,將磁碟項目加入到 /etc/fstab,讓啟動時會自動掛載新的磁碟: - - /dev/ada1p1 /newdisk ufs rw 2 2 - - 新的磁碟也可手動掛載,無須重新啟動系統: - - # mount /newdisk - - - - - 重設大小與擴增磁碟 - - - - - Allan - Jude - - Originally contributed by - - - - - - disks - resizing - - - 磁碟的容量可以增加且不需要更動任何已存在的資料。這時常會用在虛擬機器,當虛擬磁碟太小且需要增加時。有時磁碟映像檔會被寫入到 USB 隨身碟,但卻沒有使用全部的容量。此節我們將說明如合重設大小或 擴增 磁碟內容來使用增加的容量。 - - 要取得要重設大小的磁碟的代號可以查看 /var/run/dmesg.boot。在本例中,在系統上只有一個 SATA 磁碟,該磁碟會以 ada0 表示。 - - partitions - - gpart - - - 列出在磁碟上的分割區來查看目前的設定: - - # gpart show ada0 -=> 34 83886013 ada0 GPT (48G) [CORRUPT] - 34 128 1 freebsd-boot (64k) - 162 79691648 2 freebsd-ufs (38G) - 79691810 4194236 3 freebsd-swap (2G) - 83886046 1 - free - (512B) - - - 若磁碟已使用 GPT 分割表格式做格式化,可能會顯示為 已損壞 (corrupted) 因為 GPT 備份分割區已不存在於磁碟結尾。 使用 gpart 來修正備份分割區: - - # gpart recover ada0 -ada0 recovered - - - 現在在磁碟上的額外空間已經可以被新的分割區使用,或者可以拿來擴充既有的分割區: - - # gpart show ada0 -=> 34 102399933 ada0 GPT (48G) - 34 128 1 freebsd-boot (64k) - 162 79691648 2 freebsd-ufs (38G) - 79691810 4194236 3 freebsd-swap (2G) - 83886046 18513921 - free - (8.8G) - - 分割區只能在連續的未使用空間上重設大小。在這個例子中,磁碟上最後的分割區為交換 (Swap) 分割區,而第二個分割區才是需要重設大小的分割區。由於交換分割區中只會有暫存的資料,所以此時可以安全的卸載、刪除,然後在重設第二個分割區大小之後再重建最後一個分割區。 - - 停用交換分割區: - - # swapoff /dev/ada0p3 - - 刪除 ada0 磁碟上的第三個分割區,可使用 參數來指定分割區。 - - -# gpart delete -i 3 ada0 -ada0p3 deleted -# gpart show ada0 -=> 34 102399933 ada0 GPT (48G) - 34 128 1 freebsd-boot (64k) - 162 79691648 2 freebsd-ufs (38G) - 79691810 22708157 - free - (10G) - - - 在掛載的檔案系統上修改分割區表可能會造成資料遺失。最好的方式是在未掛載檔案系統的情況下 (使用 Live CD-ROMUSB 裝置) 執行以下步驟。雖然如此,若仍要這樣做的話,在關閉 GEOM 安全性功能之後可以在掛載的檔案系統上修改分割區表: - - # sysctl kern.geom.debugflags=16 - - - 重設分割區大小並保留要用來重建交換分割區的空間,要重設大小的分割區可以用 來指定,而要重設的大小可用 來指定,若要對齊分割區可以使用 。這個動作只會修改分割區大小,分割區中的檔案系統需在另一個步驟擴增。 - - # gpart resize -i 2 -s 47G -a 4k ada0 -ada0p2 resized -# gpart show ada0 -=> 34 102399933 ada0 GPT (48G) - 34 128 1 freebsd-boot (64k) - 162 98566144 2 freebsd-ufs (47G) - 98566306 3833661 - free - (1.8G) - - 重建交換分割區並且啟動,若不使用 指定大小則會使用所有剩餘的空間: - - # gpart add -t freebsd-swap -a 4k ada0 -ada0p3 added -# gpart show ada0 -=> 34 102399933 ada0 GPT (48G) - 34 128 1 freebsd-boot (64k) - 162 98566144 2 freebsd-ufs (47G) - 98566306 3833661 3 freebsd-swap (1.8G) -# swapon /dev/ada0p3 - - 擴增 UFS 檔案系統來使用重設分割區大小之後的新容量: - - # growfs /dev/ada0p2 -Device is mounted read-write; resizing will result in temporary write suspension for /. -It's strongly recommended to make a backup before growing the file system. -OK to grow file system on /dev/ada0p2, mounted on /, from 38GB to 47GB? [Yes/No] Yes -super-block backups (for fsck -b #) at: - 80781312, 82063552, 83345792, 84628032, 85910272, 87192512, 88474752, - 89756992, 91039232, 92321472, 93603712, 94885952, 96168192, 97450432 - - 若檔案系統使用 ZFS,重設大小需執行 子指令並使用 來觸發動作: - - # zpool online -e zroot /dev/ada0p2 - - 現在分割區與檔案系統已透過重設大小來使用新增加的磁碟空間。 - - - - - <acronym>USB</acronym> 儲存裝置 - - - - - Marc - Fonvieille - - Contributed by - - - - - - USB - disks - - - 許多外部儲存裝置的解決方案,例如硬碟、USB 隨身碟及 -CDDVD 燒錄機皆使用通用序列匯流排 (Universal Serial Bus, USB),FreeBSD 提供了對 USB 1.x, 2.0 及 3.0 裝置的支援。 - - - 部份硬體尚不相容 USB 3.0,包含 Haswell (Lynx point) 晶片組,若 FreeBSD 開機出現 failed with error 19 訊息,請在系統 BIOS 關閉 xHCI/USB3。 - - - USB 儲存裝置的支援已內建於 GENERIC 核心,若為自訂的核心,請確定在核心設定檔中有下列幾行設定: - - device scbus # SCSI bus (required for ATA/SCSI) -device da # Direct Access (disks) -device pass # Passthrough device (direct ATA/SCSI access) -device uhci # provides USB 1.x support -device ohci # provides USB 1.x support -device ehci # provides USB 2.0 support -device xhci # provides USB 3.0 support -device usb # USB Bus (required) -device umass # Disks/Mass storage - Requires scbus and da -device cd # needed for CD and DVD burners - - FreeBSD 使用 umass4 驅動程式透過 SCSI 子系統來存取 USB 儲存裝置,因此任何在系統的 USB 裝置都會以 SCSI 裝置呈現,若 USB 裝置是 CDDVD 燒錄機,請不要在自訂核心設定檔中引用 - - 本節後續的部份將示範如何檢查 FreeBSD 能夠辦識 USB 儲存裝置以及如何設定該裝置。 - - - 裝置設定 - - 要測試 USB 設定,請先插入 USB 裝置,然後使用 dmesg 來確認系統訊息緩衝區中有出現該磁碟機,該訊息如下: - - umass0: <STECH Simple Drive, class 0/0, rev 2.00/1.04, addr 3> on usbus0 -umass0: SCSI over Bulk-Only; quirks = 0x0100 -umass0:4:0:-1: Attached to scbus4 -da0 at umass-sim0 bus 0 scbus4 target 0 lun 0 -da0: <STECH Simple Drive 1.04> Fixed Direct Access SCSI-4 device -da0: Serial Number WD-WXE508CAN263 -da0: 40.000MB/s transfers -da0: 152627MB (312581808 512 byte sectors: 255H 63S/T 19457C) -da0: quirks=0x2<NO_6_BYTE> - - 不同的裝置會有不同的廠牌、裝置節點 (da0)、速度與大小。 - - USB 裝置可以做為 SCSI 檢視時,便可使用 camcontrol 來列出連接到系統的 USB 儲存裝置: - - # camcontrol devlist -<STECH Simple Drive 1.04> at scbus4 target 0 lun 0 (pass3,da0) - - 或者,可以使用 usbconfig 來列出裝置,請參考 usbconfig8 來取得更多有關此指令的資訊。 - - # usbconfig -ugen0.3: <Simple Drive STECH> at usbus0, cfg=0 md=HOST spd=HIGH (480Mbps) pwr=ON (2mA) - - 若該裝置尚未被格式化,請參考 中有關如何在 USB 磁碟格式化與建立分割區的說明。若磁碟中有檔案系統,可由 root 依據 中的說明掛載磁碟。 - - - 要允許未被信任的使用者掛載任意媒體,可開啟 vfs.usermount,詳細說明如下。從安全性的角度來看這並不是安全的,大多的檔案系統並不會防範惡意裝置。 - - - 要讓裝置可讓一般使用者掛載,其中一個解決方案便是使用 pw8 讓所有裝置的使用者成為 operator 群組的成員。接著,將下列幾行加入 /etc/devfs.rules 來確保 operator 能夠讀取與寫入裝置: - - [localrules=5] -add path 'da*' mode 0660 group operator - - - 若系統也同時安裝了內建 SCSI 磁碟,請更改第二行如下: - - add path 'da[3-9]*' mode 0660 group operator - - 這會從 operator 群組中排除前三個 SCSI 磁碟 (da0da2),接著取代 3 為內部 SCSI 磁碟的編號。請參考 devfs.rules5 來取得更多有關此檔案的資訊。 - - - 接著,在 /etc/rc.conf 開啟規則: - - devfs_system_ruleset="localrules" - - 然後,加入以下行到 /etc/sysctl.conf 指示系統允許正常使用者掛載檔案系統: - - vfs.usermount=1 - - 這樣只會在下次重新開機時生效,可使用 sysctl 來立即設定這個變數: - - # sysctl vfs.usermount=1 -vfs.usermount: 0 -> 1 - - 最後一個步驟是建立要掛載檔案系統要的目錄,要掛載檔案系統的使用者需要擁有這個目錄。其中一個辦法是讓 root 建立由該使用者擁有的子目錄 /mnt/username。在下面的例子,將 username 替換為該使用者的登入名稱並將 usergroup 替換為該使用者的主要群組: - - # mkdir /mnt/username -# chown username:usergroup /mnt/username - - 假如已經插入 USB 隨身碟,且已出現 /dev/da0s1 裝置。若裝置使用 FAT 格式的檔案系統,則使用者可使用以下指令掛載該檔案系統: - - % mount -t msdosfs -o -m=644,-M=755 /dev/da0s1 /mnt/username - - 在裝置可以被拔除前,必須先卸載: - - % umount /mnt/username - - 裝置移除之後,系統訊息緩衝區會顯示如下的訊息: - - umass0: at uhub3, port 2, addr 3 (disconnected) -da0 at umass-sim0 bus 0 scbus4 target 0 lun 0 -da0: <STECH Simple Drive 1.04> s/n WD-WXE508CAN263 detached -(da0:umass-sim0:0:0:0): Periph destroyed - - - - 自動掛載可移除的媒體 - - 可以取消註解在 /etc/auto_master 中的下行來自動掛載 USB 裝置: - - /media -media -nosuid - - 然後加入這些行到 /etc/devd.conf - - notify 100 { - match "system" "GEOM"; - match "subsystem" "DEV"; - action "/usr/sbin/automount -c"; -}; - - autofs5 以及 devd8 已經正在執行,則需重新載入設定: - - # service automount restart -# service devd restart - - 要設定讓 autofs5 在開機時啟動可以加入此行到 /etc/rc.conf - - autofs_enable="YES" - - autofs5 需要開啟 devd8,預設已經開啟。 - - 立即啟動服務: - - # service automount start -# service automountd start -# service autounmountd start -# service devd start - - 可以被自動掛載的檔案系統會在 /media/ 中以目錄呈現,會以檔案系統的標籤來命名目錄,若標籤遺失,則會以裝置節點命名。 - - 檔案系統會在第一次存取時自動掛載,並在一段時間未使用後自動卸載。自動掛載的磁碟也可手動卸載: - - # automount -fu - - 這個機制一般會用在記憶卡與 USB 隨身碟,也可用在任何 Block 裝置,包含光碟機或 iSCSI LUN - - - - - - 建立與使用 <acronym>CD</acronym> 媒體 - - - - - Mike - Meyer - - Contributed by - - - - - - CD-ROMs - creating - - - Compact Disc (CD) media provide a number - of features that differentiate them from conventional disks. - They are designed so that they can be read continuously without - delays to move the head between tracks. While - CD media do have tracks, these refer to a - section of data to be read continuously, and not a physical - property of the disk. The ISO 9660 file - system was designed to deal with these differences. - - ISO - 9660 - - file systems - ISO 9660 - - - - CD burner - ATAPI - - - The FreeBSD Ports Collection provides several utilities for - burning and duplicating audio and data CDs. - This chapter demonstrates the use of several command line - utilities. For CD burning software with a - graphical utility, consider installing the - sysutils/xcdroast or - sysutils/k3b packages or ports. - - - - 支援的裝置 - - - - - Marc - Fonvieille - - Contributed by - - - - - - CD burner - ATAPI/CAM driver - - - The GENERIC kernel provides support - for SCSI, USB, and - ATAPI CD readers and - burners. If a custom kernel is used, the options that need to - be present in the kernel configuration file vary by the type - of device. - - For a SCSI burner, make sure these - options are present: - - device scbus # SCSI bus (required for ATA/SCSI) -device da # Direct Access (disks) -device pass # Passthrough device (direct ATA/SCSI access) -device cd # needed for CD and DVD burners - - For a USB burner, make sure these - options are present: - - device scbus # SCSI bus (required for ATA/SCSI) -device da # Direct Access (disks) -device pass # Passthrough device (direct ATA/SCSI access) -device cd # needed for CD and DVD burners -device uhci # provides USB 1.x support -device ohci # provides USB 1.x support -device ehci # provides USB 2.0 support -device xhci # provides USB 3.0 support -device usb # USB Bus (required) -device umass # Disks/Mass storage - Requires scbus and da - - For an ATAPI burner, make sure these - options are present: - - device ata # Legacy ATA/SATA controllers -device scbus # SCSI bus (required for ATA/SCSI) -device pass # Passthrough device (direct ATA/SCSI access) -device cd # needed for CD and DVD burners - - - On FreeBSD versions prior to 10.x, this line is also - needed in the kernel configuration file if the burner is an - ATAPI device: - - device atapicam - - Alternately, this driver can be loaded at boot time by - adding the following line to - /boot/loader.conf: - - atapicam_load="YES" - - This will require a reboot of the system as this driver - can only be loaded at boot time. - - - To verify that FreeBSD recognizes the device, run - dmesg and look for an entry for the device. - On systems prior to 10.x, the device name in the first line of - the output will be acd0 instead of - cd0. - - % dmesg | grep cd -cd0 at ahcich1 bus 0 scbus1 target 0 lun 0 -cd0: <HL-DT-ST DVDRAM GU70N LT20> Removable CD-ROM SCSI-0 device -cd0: Serial Number M3OD3S34152 -cd0: 150.000MB/s transfers (SATA 1.x, UDMA6, ATAPI 12bytes, PIO 8192bytes) -cd0: Attempt to query device size failed: NOT READY, Medium not present - tray closed - - - - 燒錄 <acronym>CD</acronym> - - In FreeBSD, cdrecord can be used to burn - CDs. This command is installed with the - sysutils/cdrtools package or port. - - While cdrecord has many options, basic - usage is simple. Specify the name of the - ISO file to burn and, if the system has - multiple burner devices, specify the name of the device to - use: - - # cdrecord dev=device imagefile.iso - - To determine the device name of the burner, use - which might produce results like - this: - - - CD-ROMs - burning - - # cdrecord -scanbus -ProDVD-ProBD-Clone 3.00 (amd64-unknown-freebsd10.0) Copyright (C) 1995-2010 Jörg Schilling -Using libscg version 'schily-0.9' -scsibus0: - 0,0,0 0) 'SEAGATE ' 'ST39236LW ' '0004' Disk - 0,1,0 1) 'SEAGATE ' 'ST39173W ' '5958' Disk - 0,2,0 2) * - 0,3,0 3) 'iomega ' 'jaz 1GB ' 'J.86' Removable Disk - 0,4,0 4) 'NEC ' 'CD-ROM DRIVE:466' '1.26' Removable CD-ROM - 0,5,0 5) * - 0,6,0 6) * - 0,7,0 7) * -scsibus1: - 1,0,0 100) * - 1,1,0 101) * - 1,2,0 102) * - 1,3,0 103) * - 1,4,0 104) * - 1,5,0 105) 'YAMAHA ' 'CRW4260 ' '1.0q' Removable CD-ROM - 1,6,0 106) 'ARTEC ' 'AM12S ' '1.06' Scanner - 1,7,0 107) * - - Locate the entry for the CD burner and - use the three numbers separated by commas as the value for - . In this case, the Yamaha burner device - is 1,5,0, so the appropriate input to - specify that device is . Refer to - the manual page for cdrecord for other ways - to specify this value and for information on writing audio - tracks and controlling the write speed. - - Alternately, run the following command to get the device - address of the burner: - - # camcontrol devlist -<MATSHITA CDRW/DVD UJDA740 1.00> at scbus1 target 0 lun 0 (cd0,pass0) - - Use the numeric values for scbus, - target, and lun. For - this example, 1,0,0 is the device name to - use. - - - - 寫入資料到一個 <acronym>ISO</acronym> 檔案系統 - - In order to produce a data CD, the data - files that are going to make up the tracks on the - CD must be prepared before they can be - burned to the CD. In FreeBSD, - sysutils/cdrtools installs - mkisofs, which can be used to produce an - ISO 9660 file system that is an image of a - directory tree within a UNIX file system. The simplest - usage is to specify the name of the ISO - file to create and the path to the files to place into the - ISO 9660 file system: - - # mkisofs -o imagefile.iso /path/to/tree - - - file systems - ISO 9660 - - - This command maps the file names in the specified path to - names that fit the limitations of the standard - ISO 9660 file system, and will exclude - files that do not meet the standard for ISO - file systems. - - - file systems - Joliet - - - A number of options are available to overcome the - restrictions imposed by the standard. In particular, - enables the Rock Ridge extensions common - to UNIX systems and enables Joliet - extensions used by Microsoft systems. - - For CDs that are going to be used only - on FreeBSD systems, can be used to disable - all filename restrictions. When used with - , it produces a file system image that is - identical to the specified FreeBSD tree, even if it violates the - ISO 9660 standard. - - - CD-ROMs - creating bootable - - - The last option of general use is . - This is used to specify the location of a boot image for use - in producing an El Torito bootable - CD. This option takes an argument which is - the path to a boot image from the top of the tree being - written to the CD. By default, - mkisofs creates an ISO - image in floppy disk emulation mode, and thus - expects the boot image to be exactly 1200, 1440 or - 2880 KB in size. Some boot loaders, like the one used by - the FreeBSD distribution media, do not use emulation mode. In - this case, should be used. So, - if /tmp/myboot holds a bootable FreeBSD - system with the boot image in - /tmp/myboot/boot/cdboot, this command - would produce - /tmp/bootable.iso: - - # mkisofs -R -no-emul-boot -b boot/cdboot -o /tmp/bootable.iso /tmp/myboot - - The resulting ISO image can be mounted - as a memory disk with: - - # mdconfig -a -t vnode -f /tmp/bootable.iso -u 0 -# mount -t cd9660 /dev/md0 /mnt - - One can then verify that /mnt and - /tmp/myboot are identical. - - There are many other options available for - mkisofs to fine-tune its behavior. Refer - to mkisofs8 for details. - - - It is possible to copy a data CD to - an image file that is functionally equivalent to the image - file created with mkisofs. To do so, use - dd with the device name as the input - file and the name of the ISO to create as - the output file: - - # dd if=/dev/cd0 of=file.iso bs=2048 - - The resulting image file can be burned to - CD as described in . - - - - - 使用資料 <acronym>CD</acronym> - - Once an ISO has been burned to a - CD, it can be mounted by specifying the - file system type, the name of the device containing the - CD, and an existing mount point: - - # mount -t cd9660 /dev/cd0 /mnt - - Since mount assumes that a file system - is of type ufs, a Incorrect - super block error will occur if -t - cd9660 is not included when mounting a data - CD. - - While any data CD can be mounted this - way, disks with certain ISO 9660 extensions - might behave oddly. For example, Joliet disks store all - filenames in two-byte Unicode characters. If some non-English - characters show up as question marks, specify the local - charset with . For more information, refer - to mount_cd96608. - - - In order to do this character conversion with the help - of , the kernel requires the - cd9660_iconv.ko module to be loaded. - This can be done either by adding this line to - loader.conf: - - cd9660_iconv_load="YES" - - and then rebooting the machine, or by directly loading - the module with kldload. - - - Occasionally, Device not configured - will be displayed when trying to mount a data - CD. This usually means that the - CD drive has not detected a disk in - the tray, or that the drive is not visible on the bus. It - can take a couple of seconds for a CD - drive to detect media, so be - patient. - - Sometimes, a SCSI - CD drive may be missed because it did not - have enough time to answer the bus reset. To resolve this, - a custom kernel can be created which increases the default - SCSI delay. Add the following option to - the custom kernel configuration file and rebuild the kernel - using the instructions in : - - options SCSI_DELAY=15000 - - This tells the SCSI bus to pause 15 - seconds during boot, to give the CD - drive every possible chance to answer the bus reset. - - - It is possible to burn a file directly to - CD, without creating an - ISO 9660 file system. This is known as - burning a raw data CD and some people do - this for backup purposes. - - This type of disk can not be mounted as a normal data - CD. In order to retrieve the data burned - to such a CD, the data must be read from - the raw device node. For example, this command will extract - a compressed tar file located on the second - CD device into the current working - directory: - - # tar xzvf /dev/cd1 - - In order to mount a data CD, the - data must be written using - mkisofs. - - - - - 複製音樂 <acronym>CD</acronym> - - To duplicate an audio CD, extract the - audio data from the CD to a series of - files, then write these files to a blank - CD. - - describes how to - duplicate and burn an audio CD. If the - FreeBSD version is less than 10.0 and the device is - ATAPI, the module - must be first loaded using the instructions in . - - - Duplicating an Audio <acronym>CD</acronym> - - - The sysutils/cdrtools package or - port installs cdda2wav. This command - can be used to extract all of the audio tracks, with each - track written to a separate WAV file in - the current working directory: - - % cdda2wav -vall -B -Owav - - A device name does not need to be specified if there - is only one CD device on the system. - Refer to the cdda2wav manual page for - instructions on how to specify a device and to learn more - about the other options available for this command. - - - - Use cdrecord to write the - .wav files: - - % cdrecord -v dev=2,0 -dao -useinfo *.wav - - Make sure that 2,0 is set - appropriately, as described in . - - - - - - - - 建立與使用 <acronym>DVD</acronym> 媒體 - - - - - Marc - Fonvieille - - Contributed by - - - - - - Andy - Polyakov - - With inputs from - - - - - - DVD - burning - - - Compared to the CD, the - DVD is the next generation of optical media - storage technology. The DVD can hold more - data than any CD and is the standard for - video publishing. - - Five physical recordable formats can be defined for a - recordable DVD: - - - - DVD-R: This was the first DVD - recordable format available. The DVD-R standard is defined - by the DVD - Forum. This format is write once. - - - - DVD-RW: This is the rewritable - version of the DVD-R standard. A - DVD-RW can be rewritten about 1000 - times. - - - - DVD-RAM: This is a rewritable format - which can be seen as a removable hard drive. However, this - media is not compatible with most - DVD-ROM drives and DVD-Video players as - only a few DVD writers support the - DVD-RAM format. Refer to for more information on - DVD-RAM use. - - - - DVD+RW: This is a rewritable format - defined by the - DVD+RW Alliance. A - DVD+RW can be rewritten about 1000 - times. - - - - DVD+R: This format is the write once variation of the - DVD+RW format. - - - - A single layer recordable DVD can hold up - to 4,700,000,000 bytes which is actually 4.38 GB or - 4485 MB as 1 kilobyte is 1024 bytes. - - - A distinction must be made between the physical media and - the application. For example, a DVD-Video is a specific file - layout that can be written on any recordable - DVD physical media such as DVD-R, DVD+R, or - DVD-RW. Before choosing the type of media, - ensure that both the burner and the DVD-Video player are - compatible with the media under consideration. - - - - 設定 - - To perform DVD recording, use - growisofs1. This command is part of the - sysutils/dvd+rw-tools utilities which - support all DVD media types. - - These tools use the SCSI subsystem to - access the devices, therefore ATAPI/CAM support must be loaded - or statically compiled into the kernel. This support is not - needed if the burner uses the USB - interface. Refer to for more - details on USB device configuration. - - DMA access must also be enabled for - ATAPI devices, by adding the following line - to /boot/loader.conf: - - hw.ata.atapi_dma="1" - - Before attempting to use - dvd+rw-tools, consult the Hardware - Compatibility Notes. - - - For a graphical user interface, consider using - sysutils/k3b which provides a user - friendly interface to growisofs1 and many other - burning tools. - - - - - 燒錄資料 <acronym>DVD</acronym> - - Since growisofs1 is a front-end to mkisofs, it will invoke - mkisofs8 to create the file system layout and perform - the write on the DVD. This means that an - image of the data does not need to be created before the - burning process. - - To burn to a DVD+R or a DVD-R the data in - /path/to/data, use the following - command: - - # growisofs -dvd-compat -Z /dev/cd0 -J -R /path/to/data - - In this example, is passed to - mkisofs8 to create an ISO 9660 file system with Joliet - and Rock Ridge extensions. Refer to mkisofs8 for more - details. - - For the initial session recording, is - used for both single and multiple sessions. Replace - /dev/cd0, with the name of the - DVD device. Using - indicates that the disk will be - closed and that the recording will be unappendable. This - should also provide better media compatibility with - DVD-ROM drives. - - To burn a pre-mastered image, such as - imagefile.iso, use: - - # growisofs -dvd-compat -Z /dev/cd0=imagefile.iso - - The write speed should be detected and automatically set - according to the media and the drive being used. To force the - write speed, use . Refer to - growisofs1 for example usage. - - - In order to support working files larger than 4.38GB, an - UDF/ISO-9660 hybrid file system must be created by passing - to mkisofs8 and - all related programs, such as growisofs1. This is - required only when creating an ISO image file or when - writing files directly to a disk. Since a disk created this - way must be mounted as an UDF file system with - mount_udf8, it will be usable only on an UDF aware - operating system. Otherwise it will look as if it contains - corrupted files. - - To create this type of ISO file: - - % mkisofs -R -J -udf -iso-level 3 -o imagefile.iso /path/to/data - - To burn files directly to a disk: - - # growisofs -dvd-compat -udf -iso-level 3 -Z /dev/cd0 -J -R /path/to/data - - When an ISO image already contains large files, no - additional options are required for growisofs1 to - burn that image on a disk. - - Be sure to use an up-to-date version of - sysutils/cdrtools, which contains - mkisofs8, as an older version may not contain large - files support. If the latest version does not work, install - sysutils/cdrtools-devel and read its - mkisofs8. - - - - - 燒錄 <acronym>DVD</acronym>-Video - - - DVD - DVD-Video - - - A DVD-Video is a specific file layout based on the ISO - 9660 and micro-UDF (M-UDF) specifications. Since DVD-Video - presents a specific data structure hierarchy, a particular - program such as multimedia/dvdauthor is - needed to author the DVD. - - If an image of the DVD-Video file system already exists, - it can be burned in the same way as any other image. If - dvdauthor was used to make the - DVD and the result is in - /path/to/video, the following command - should be used to burn the DVD-Video: - - # growisofs -Z /dev/cd0 -dvd-video /path/to/video - - is passed to mkisofs8 - to instruct it to create a DVD-Video file system layout. - This option implies the - growisofs1 option. - - - - 使用 <acronym>DVD+RW</acronym> - - - DVD - DVD+RW - - - Unlike CD-RW, a virgin DVD+RW needs to - be formatted before first use. It is - recommended to let growisofs1 take - care of this automatically whenever appropriate. However, it - is possible to use dvd+rw-format to format - the DVD+RW: - - # dvd+rw-format /dev/cd0 - - Only perform this operation once and keep in mind that - only virgin DVD+RW medias need to be - formatted. Once formatted, the DVD+RW can - be burned as usual. - - To burn a totally new file system and not just append some - data onto a DVD+RW, the media does not need - to be blanked first. Instead, write over the previous - recording like this: - - # growisofs -Z /dev/cd0 -J -R /path/to/newdata - - The DVD+RW format supports appending - data to a previous recording. This operation consists of - merging a new session to the existing one as it is not - considered to be multi-session writing. growisofs1 - will grow the ISO 9660 file system - present on the media. - - For example, to append data to a - DVD+RW, use the following: - - # growisofs -M /dev/cd0 -J -R /path/to/nextdata - - The same mkisofs8 options used to burn the - initial session should be used during next writes. - - - Use for better media - compatibility with DVD-ROM drives. When - using DVD+RW, this option will not - prevent the addition of data. - - - To blank the media, use: - - # growisofs -Z /dev/cd0=/dev/zero - - - - 使用 <acronym>DVD-RW</acronym> - - - DVD - DVD-RW - - - A DVD-RW accepts two disc formats: - incremental sequential and restricted overwrite. By default, - DVD-RW discs are in sequential - format. - - A virgin DVD-RW can be directly written - without being formatted. However, a non-virgin - DVD-RW in sequential format needs to be - blanked before writing a new initial session. - - To blank a DVD-RW in sequential - mode: - - # dvd+rw-format -blank=full /dev/cd0 - - - A full blanking using will - take about one hour on a 1x media. A fast blanking can be - performed using , if the - DVD-RW will be recorded in Disk-At-Once - (DAO) mode. To burn the DVD-RW in DAO - mode, use the command: - - # growisofs -use-the-force-luke=dao -Z /dev/cd0=imagefile.iso - - Since growisofs1 automatically attempts to detect - fast blanked media and engage DAO write, - should not be - required. - - One should instead use restricted overwrite mode with - any DVD-RW as this format is more - flexible than the default of incremental sequential. - - - To write data on a sequential DVD-RW, - use the same instructions as for the other - DVD formats: - - # growisofs -Z /dev/cd0 -J -R /path/to/data - - To append some data to a previous recording, use - with growisofs1. However, if data - is appended on a DVD-RW in incremental - sequential mode, a new session will be created on the disc and - the result will be a multi-session disc. - - A DVD-RW in restricted overwrite format - does not need to be blanked before a new initial session. - Instead, overwrite the disc with . It is - also possible to grow an existing ISO 9660 file system written - on the disc with . The result will be a - one-session DVD. - - To put a DVD-RW in restricted overwrite - format, the following command must be used: - - # dvd+rw-format /dev/cd0 - - To change back to sequential format, use: - - # dvd+rw-format -blank=full /dev/cd0 - - - - 多階段燒錄 (Multi-Session) - - Few DVD-ROM drives support - multi-session DVDs and most of the time only read the first - session. DVD+R, DVD-R and DVD-RW in - sequential format can accept multiple sessions. The notion - of multiple sessions does not exist for the - DVD+RW and the DVD-RW - restricted overwrite formats. - - Using the following command after an initial non-closed - session on a DVD+R, DVD-R, or DVD-RW in - sequential format, will add a new session to the disc: - - # growisofs -M /dev/cd0 -J -R /path/to/nextdata - - Using this command with a DVD+RW or a - DVD-RW in restricted overwrite mode will - append data while merging the new session to the existing one. - The result will be a single-session disc. Use this method to - add data after an initial write on these types of - media. - - - Since some space on the media is used between each - session to mark the end and start of sessions, one should - add sessions with a large amount of data to optimize media - space. The number of sessions is limited to 154 for a - DVD+R, about 2000 for a DVD-R, and 127 for a DVD+R Double - Layer. - - - - - 取得更多資訊 - - To obtain more information about a DVD, - use dvd+rw-mediainfo - /dev/cd0 while the - disc in the specified drive. - - More information about - dvd+rw-tools can be found in - growisofs1, on the dvd+rw-tools - web site, and in the cdwrite - mailing list archives. - - - When creating a problem report related to the use of - dvd+rw-tools, always include the - output of dvd+rw-mediainfo. - - - - - 使用 <acronym>DVD-RAM</acronym> - - - DVD - DVD-RAM - - - DVD-RAM writers can use either a - SCSI or ATAPI interface. - For ATAPI devices, DMA access has to be - enabled by adding the following line to - /boot/loader.conf: - - hw.ata.atapi_dma="1" - - A DVD-RAM can be seen as a removable - hard drive. Like any other hard drive, the - DVD-RAM must be formatted before it can be - used. In this example, the whole disk space will be formatted - with a standard UFS2 file system: - - # dd if=/dev/zero of=/dev/acd0 bs=2k count=1 -# bsdlabel -Bw acd0 -# newfs /dev/acd0 - - The DVD device, - acd0, must be changed according to the - configuration. - - Once the DVD-RAM has been formatted, it - can be mounted as a normal hard drive: - - # mount /dev/acd0 /mnt - - Once mounted, the DVD-RAM will be both - readable and writeable. - - - - - 建立與使用軟碟 - - - - This section explains how to format a 3.5 inch floppy disk - in FreeBSD. - - - Steps to Format a Floppy - - A floppy disk needs to be low-level formatted before it - can be used. This is usually done by the vendor, but - formatting is a good way to check media integrity. To - low-level format the floppy disk on FreeBSD, use - fdformat1. When using this utility, make note of any - error messages, as these can help determine if the disk is - good or bad. - - - To format the floppy, insert a new 3.5 inch floppy disk - into the first floppy drive and issue: - - # /usr/sbin/fdformat -f 1440 /dev/fd0 - - - - After low-level formatting the disk, create a disk label - as it is needed by the system to determine the size of the - disk and its geometry. The supported geometry values are - listed in /etc/disktab. - - To write the disk label, use bsdlabel8: - - # /sbin/bsdlabel -B -w /dev/fd0 fd1440 - - - - The floppy is now ready to be high-level formatted with - a file system. The floppy's file system can be either UFS - or FAT, where FAT is generally a better choice for - floppies. - - To format the floppy with FAT, issue: - - # /sbin/newfs_msdos /dev/fd0 - - - - The disk is now ready for use. To use the floppy, mount it - with mount_msdosfs8. One can also install and use - emulators/mtools from the Ports - Collection. - - - - 備份基礎概念 - - - - 為了要能夠從磁碟故障、意外刪除文件、隨機文件損壞或完全機器毀壞,包含本地備份毀壞進行恢復,執行備份計劃是必要的。 - - 備份的類型與排程會依情況有所不同,取決於資料的重要性、檔案還原所需的程度以及可接受的停機時間。一些可用來備份的技術有: - - - - 封存整個檔案系統,備份至永久、異地媒體。這可在以上所列的所有問題發生時提供保護,但要還原會較慢且不方便,特別是對於沒有權限的使用者。 - - - - 檔案系統快照 (Snapshot),對於還原已刪除的檔案或先前版本的檔案非常有用。 - - - - 整個檔案系統或磁碟的複本,使用排程的 net/rsync 來與網路上的另一個系統同步。 - - - - 硬體或軟體 RAID,來最小化或避免當磁碟故障時的停機時間。 - - - - 通常會混合使用各種備份技術,例如,建立一個排程每週自動做儲存於異地的完整系統備份,並使用每小時的 ZFS 快照來輔助備份。此外,在對檔案做編輯或刪除前手動備份各別目錄或檔案。 - - 本章節會介紹一些可以用來在 FreeBSD 上建立與管理系統備份的工具。 - - - 檔案系統備份 - - - backup software - dump / restore - - - dump - - - restore - - - 要備份一個檔案系統,會用到 dump8 這個傳統 UNIX 程式來建立備份,並可使用 restore8 來還原備份。這兩個工具可在磁碟區塊的層級運作,這個層級比由檔案系統建立檔案、連結與目錄的抽象層級還要低,因此不像其他的備份軟體,dump 必須一次備份整個檔案系統,且無法只備份部份檔案系統或跨多個檔案系統的目錄樹,dump 會備份構成檔案與目錄的原始資料區塊,而非直接備份檔案與目錄。 - - - 在根目錄使用 dump,會無法備份 /home, /usr 或其他許多的目錄,由於這些目錄通常是其他檔案系統的掛載點或連結到其他檔案系統的符號連結。 - - - 還原資料時,restore 預設會儲存暫存檔案於 /tmp/,當使用一個 /tmp 較小的復原磁碟時,請設定 TMPDIR 到一個擁有較多可用空間的目錄以讓還原可以順利執行。 - - 當使用 dump 時,請小心最早自 AT&T UNIX,circa 1975 的版本 6 仍有一些問題存在,預設的參數會假設備份到一個 9 軌的磁帶,這並非其他類型的媒體或現今可用的高密度磁帶,必須另外在指令列修改這個預設值。 - - - .rhosts - - 雖然可以使用 rdump8rrestore8 工具可以跨網路備份一個檔案系統到另一個系統或備份到連結另一台電腦的磁帶機,但這使用兩個工具備份的安全性並不足夠。 - - 可改以在較安全的 SSH 連線上使用 dumprestore。以下例子會建立一個完整、壓縮的 /usr 備份並透過 SSH 連線傳送備份檔案到指定的主機。 - - - 在 <application>ssh</application> 使用 <command>dump</command> - - # /sbin/dump -0uan -f - /usr | gzip -2 | ssh -c blowfish \ - targetuser@targetmachine.example.com dd of=/mybigfiles/dump-usr-l0.gz - - - 這個例子會設定 RSH,以便透過 SSH 連線寫入備份到遠端系統的磁帶機: - - - 在 <application>ssh</application> 使用 <command>dump</command> 透過 <envar>RSH</envar> 設定 - - # env RSH=/usr/bin/ssh /sbin/dump -0uan -f targetuser@targetmachine.example.com:/dev/sa0 /usr - - - - - 目錄備份 - - - backup software - tar - - - 系統已有內建數個工具可在需要時用來備份與還原指定的檔案與目錄。 - - 要備份一個目錄中的所有檔案最好的選擇是 tar1,這個工具最早可以追朔自 AT&T UNIX 版本 6 時,因此預設會做一個遞迴備份到一個磁帶機,可以使用參數來改指定備份檔案的名稱。 - - tar - - 這個例子會建立目前目錄的壓縮備份並儲存至 /tmp/mybackup.tgz,在建立備份檔案時,要確認備份檔案不要儲存到與目前備份目錄相同的目錄。 - - - 使用 <command>tar</command> 備份目前目錄 - - # tar czvf /tmp/mybackup.tgz . - - - 要還原整個備份,先 cd 進入要放置還原檔的目錄並指定備份的名稱。注意,這個動作會覆寫任何在該還原目錄中任何較新版的檔案,當不確定時,可先還原到一個暫時的目錄或指定備份檔中的檔案做還原。 - - - 使用 <command>tar</command> 還原目前目錄 - - # tar xzvf /tmp/mybackup.tgz - - - 除此之外還有許多可用的參數在 tar1 中會有說明。本工具也支援使用排除模式 (Exclude pattern) 來指定那些檔案應該在備份指定目錄或自備份還原檔案時排除。 - - - backup software - cpio - - - 要使用指定的檔案與目錄清單做備份使用 cpio1 是不錯的選擇。它並不像 tarcpio 並不知道如何走訪目錄樹,所以必須提供檔案的清單才能做備份。 - - 例如,檔案的清單可以使用 lsfind 來產生。以下例子會建立一個目前目錄的遞迴清單然後轉送 (Piped) 給 cpio 來建立名稱為 /tmp/mybackup.cpio 的備份檔。 - - - 使用 <command>ls</command> 與 <command>cpio</command> 來製作目前目錄的遞迴備份 - - # ls -R | cpio -ovF /tmp/mybackup.cpio - - - - backup software - pax - - pax - POSIX - IEEE - - 有一個備份工具嘗試整合 tarcpio 所提供的功能,便是 pax1。經歷數年,各種版本的 tarcpio 變的有一些無法相容。POSIX 開發出 pax,嘗試讀取與寫入各種版本的 cpio and tar 格式並加入自己的新格式。 - - 以先前的例子改使用 pax 會是: - - - 使用 <command>pax</command> 備份目前目錄 - - # pax -wf /tmp/mybackup.pax . - - - - - 使用資料磁帶備份 - - tape media - - 隨著磁帶的技術持續發展,當今的備份系統將異地備份與本地可移除媒體做了結合。FreeBSD 支援任何使用 SCSI 的磁帶機,如 LTODAT,並有限制的支援 SATAUSB 磁帶機。 - - SCSI 磁帶機在 FreeBSD 會使用 sa4 驅動程式以及 /dev/sa0, /dev/nsa0/dev/esa0 裝置,實體裝置名稱為 /dev/sa0,當使用 /dev/nsa0 時,備份程式在寫入檔案之後不會倒帶,這可允許寫入超過一個檔案到磁帶,而使用 /dev/esa0 時,當關閉裝置後便會退出磁帶。 - - 在 FreeBSD 中會使用 mt 來做磁帶機的控制操作,例如在磁帶中搜尋檔案或寫入磁帶控制記號到磁帶。例如,要保留磁帶上的前三個檔案,可以在寫入新檔案前跳過這些檔案: - - # mt -f /dev/nsa0 fsf 3 - - 這個工具尚支援許多操作,請參考 mt1 了解詳情。 - - 要使用 tar 寫入單一檔案到磁帶,可指定磁帶裝置的名稱以及要備份的檔案: - - # tar cvf /dev/sa0 file - - 要從磁帶上的 tar 封存檔還原檔案到目前的目錄可: - - # tar xvf /dev/sa0 - - 要備份一個 UFS 檔案系統可使用 dump。以下例子會備份 /usr 並在完成時不做倒帶: - - # dump -0aL -b64 -f /dev/nsa0 /usr - - 要以互動的方式從磁帶上的 dump 檔案還原到目前目錄: - - # restore -i -f /dev/nsa0 - - - - 第三方備份工具 - - - backup software - - - FreeBSD Port 套件集提供了許多第三方工具可用於排程建立備份,簡化磁帶備份並讓備份更簡單方便。許多這類的應用程式是以客戶端/伺服器為基礎,可用來自動化單一系統或網路上所有電腦的備份。 - - 較熱門的工具包含 Amanda, Bacula, rsync 以及 duplicity - - - - 緊急還原 - - 除了正常的備份外,建議將下以步驟做為緊急準備計劃的一部份。 - - - bsdlabel - - 替以下指令的輸出建立一份可列印的複本: - - - - gpart show - - - - more /etc/fstab - - - - dmesg - - - - livefs - CD - - 在安全的地方保存這份列印結果與安裝媒體的複本,在緊急還原時可能會需要,接著開機進入安裝媒體並選擇 Live CD 以存取救援 Shell (Rescue shell),這個救援模式可以用來檢視目前系統的狀態,若有需要,可重新格式化磁碟然後自備份還原資料。 - - - FreeBSD/i386 11.2-RELEASE 的安裝媒體未內含救援 Shell,針對該版本,可改自 ftp://ftp.FreeBSD.org/pub/FreeBSD/releases/i386/ISO-IMAGES/11.2/FreeBSD-11.2-RELEASE-i386-livefs.iso 下載 Livefs CD 映像檔並燒錄。 - - - 然後,測試救援 Shell 下的備份。記錄下整個程序,將這份記錄隨媒體、列印結果、備份檔一併保存,這份記錄可以避免在緊張壓力下做緊急還原時因不慎造成備份的毀壞。 - - 要再安全性一點,則可將最新的備份儲存在與實體電腦與磁碟機有一段明顯距離的遠端位置。 - - - - - - 記憶體磁碟 - - - - - Marc - Fonvieille - - Reorganized and enhanced by - - - - - In addition to physical disks, FreeBSD also supports the - creation and use of memory disks. One possible use for a - memory disk is to access the contents of an - ISO file system without the overhead of first - burning it to a CD or DVD, - then mounting the CD/DVD media. - - In FreeBSD, the md4 driver is used to provide support - for memory disks. The GENERIC kernel - includes this driver. When using a custom kernel configuration - file, ensure it includes this line: - - device md - - - 連接與解除連接既有的映象檔 - - - disks - memory - - - To mount an existing file system image, use - mdconfig to specify the name of the - ISO file and a free unit number. Then, - refer to that unit number to mount it on an existing mount - point. Once mounted, the files in the ISO - will appear in the mount point. This example attaches - diskimage.iso to the memory device - /dev/md0 then mounts that memory device - on /mnt: - - # mdconfig -f diskimage.iso -u 0 -# mount -t cd9660 /dev/md0 /mnt - - Notice that was used to mount - an ISO format. If a unit number is not specified with - , mdconfig will - automatically allocate an unused memory device and output - the name of the allocated unit, such as - md4. Refer to mdconfig8 for more - details about this command and its options. - - - disks - detaching a memory disk - - - When a memory disk is no longer in use, its resources - should be released back to the system. First, unmount the - file system, then use mdconfig to detach - the disk from the system and release its resources. To - continue this example: - - # umount /mnt -# mdconfig -d -u 0 - - To determine if any memory disks are still attached to the - system, type mdconfig -l. - - - - 建立以檔案或記憶體為基底的磁碟 - - - disks - memory file system - - FreeBSD also supports memory disks where the storage to use - is allocated from either a hard disk or an area of memory. - The first method is commonly referred to as a file-backed file - system and the second method as a memory-backed file system. - Both types can be created using - mdconfig. - - To create a new memory-backed file system, specify a type - of swap and the size of the memory disk to - create. Then, format the memory disk with a file system and - mount as usual. This example creates a 5M memory disk on unit - 1. That memory disk is then formatted with - the UFS file system before it is - mounted: - - # mdconfig -a -t swap -s 5m -u 1 -# newfs -U md1 -/dev/md1: 5.0MB (10240 sectors) block size 16384, fragment size 2048 - using 4 cylinder groups of 1.27MB, 81 blks, 192 inodes. - with soft updates -super-block backups (for fsck -b #) at: - 160, 2752, 5344, 7936 -# mount /dev/md1 /mnt -# df /mnt -Filesystem 1K-blocks Used Avail Capacity Mounted on -/dev/md1 4718 4 4338 0% /mnt - - To create a new file-backed memory disk, first allocate an - area of disk to use. This example creates an empty 5MB file - named newimage: - - # dd if=/dev/zero of=newimage bs=1k count=5k -5120+0 records in -5120+0 records out - - Next, attach that file to a memory disk, label the memory - disk and format it with the UFS file - system, mount the memory disk, and verify the size of the - file-backed disk: - - # mdconfig -f newimage -u 0 -# bsdlabel -w md0 auto -# newfs -U md0a -/dev/md0a: 5.0MB (10224 sectors) block size 16384, fragment size 2048 - using 4 cylinder groups of 1.25MB, 80 blks, 192 inodes. -super-block backups (for fsck -b #) at: - 160, 2720, 5280, 7840 -# mount /dev/md0a /mnt -# df /mnt -Filesystem 1K-blocks Used Avail Capacity Mounted on -/dev/md0a 4710 4 4330 0% /mnt - - It takes several commands to create a file- or - memory-backed file system using mdconfig. - FreeBSD also comes with mdmfs which - automatically configures a memory disk, formats it with the - UFS file system, and mounts it. For - example, after creating newimage - with dd, this one command is equivalent to - running the bsdlabel, - newfs, and mount - commands shown above: - - # mdmfs -F newimage -s 5m md0 /mnt - - To instead create a new memory-based memory disk with - mdmfs, use this one command: - - # mdmfs -s 5m md1 /mnt - - If the unit number is not specified, - mdmfs will automatically select an unused - memory device. For more details about - mdmfs, refer to mdmfs8. - - - - - - 檔案系統快照 - - - - - Tom - Rhodes - - Contributed by - - - - - - file systems - snapshots - - - FreeBSD offers a feature in conjunction with - Soft Updates: file system - snapshots. - - UFS snapshots allow a user to create images of specified - file systems, and treat them as a file. Snapshot files must be - created in the file system that the action is performed on, and - a user may create no more than 20 snapshots per file system. - Active snapshots are recorded in the superblock so they are - persistent across unmount and remount operations along with - system reboots. When a snapshot is no longer required, it can - be removed using rm1. While snapshots may be removed in - any order, all the used space may not be acquired because - another snapshot will possibly claim some of the released - blocks. - - The un-alterable file flag is set - by mksnap_ffs8 after initial creation of a snapshot file. - unlink1 makes an exception for snapshot files since it - allows them to be removed. - - Snapshots are created using mount8. To place a - snapshot of /var in the - file /var/snapshot/snap, use the following - command: - - # mount -u -o snapshot /var/snapshot/snap /var - - Alternatively, use mksnap_ffs8 to create the - snapshot: - - # mksnap_ffs /var /var/snapshot/snap - - One can find snapshot files on a file system, such as - /var, using - find1: - - # find /var -flags snapshot - - Once a snapshot has been created, it has several - uses: - - - - Some administrators will use a snapshot file for backup - purposes, because the snapshot can be transferred to - CDs or tape. - - - - The file system integrity checker, fsck8, may be - run on the snapshot. Assuming that the file system was - clean when it was mounted, this should always provide a - clean and unchanging result. - - - - Running dump8 on the snapshot will produce a dump - file that is consistent with the file system and the - timestamp of the snapshot. dump8 can also take a - snapshot, create a dump image, and then remove the snapshot - in one command by using . - - - - The snapshot can be mounted as a frozen image of the - file system. To mount8 the snapshot - /var/snapshot/snap run: - - # mdconfig -a -t vnode -o readonly -f /var/snapshot/snap -u 4 -# mount -r /dev/md4 /mnt - - - - The frozen /var is now available - through /mnt. Everything will initially be - in the same state it was during the snapshot creation time. The - only exception is that any earlier snapshots will appear as zero - length files. To unmount the snapshot, use: - - # umount /mnt -# mdconfig -d -u 4 - - For more information about and - file system snapshots, including technical papers, visit - Marshall Kirk McKusick's website at http://www.mckusick.com/. - - - - 磁碟配額 - - - accounting - disk space - - disk quotas - - 磁碟配額可以用來限制使用者或群組成員能夠在各別檔案系統上使用的磁碟空間量或檔案數量。這個可避免一個使用者或群組成員耗盡所有磁碟的可用空間。 - - 本節將說明如何設定 UFS 檔案系統的磁碟配額。要在 ZFS 檔案系統上設定配額,請參考 - - - 開啟磁碟配額 - - 查看 FreeBSD 核心是否支援磁碟配額: - - % sysctl kern.features.ufs_quota -kern.features.ufs_quota: 1 - - 在本例中,數值 1 代表支援磁碟配額,若為 0,則需加入下列設定到自訂核心設定檔然後依照 的指示重新編譯核心: - - options QUOTA - - 接著,在 /etc/rc.conf 開啟磁碟配額: - - quota_enable="YES" - - - disk quotas - checking - - 正常在開機時,會使用 quotacheck8 檢查每個檔案系統的配額完整性,這個程式會確保在配額資料庫中的資料正確的反映了檔案系統上的資料。這是一個耗費時間的程序,會明顯的影響系統開機的時間,要跳過這個步驟可以加入此變數到 /etc/rc.conf - - check_quotas="NO" - - 最後,編輯 /etc/fstab 來開啟在各個檔案系統上的磁碟配額。要開啟在檔案系統上對每個使用者的配額要加入 選項到 /etc/fstab 要開啟配額的檔案系統的項目中。例如: - - /dev/da1s2g /home ufs rw,userquota 1 2 - - 要開啟群組配額,則使用 。要同時開啟使用者及群組配額,可使用逗號隔開選項: - - /dev/da1s2g /home ufs rw,userquota,groupquota 1 2 - - 預設配額檔案會儲存在檔案系統的根目錄的 quota.userquota.group,請參考 fstab5 來取得更多資訊,較不建議指定其他位置來儲存配額檔案。 - - 設定完成之後,重新啟動系統,/etc/rc 會自動執行適當的指令對所有在 /etc/fstab 中開啟配磁的檔案系統建立初始的配額檔。 - - 在一般的操作中,並不需要手動執行 quotacheck8, quotaon8 或是 quotaoff8,雖然如此,仍應閱讀這些指令的操作手冊來熟悉這些指令的操作。 - - - - 設定配額限制 - - - disk quotas - limits - - - 要確認配額已經開啟,可執行: - - # quota -v - - 每個有開啟配額的檔案系統應該會有一行磁碟用量及目前配額限制的摘要。 - - 現在系統已準備好可以使用 edquota 分配配額限制。 - - 有數個選項可以強制限制使用者或群組對磁碟空間的使用量以及可以建立多少檔案。可以用磁碟空間 (block 配額),檔案數量 (inode 配額) 或同時使用來分配。每種限制又可進一步細分為兩個類型:硬性 (Hard) 及軟性 (Soft) 限制。 - - hard limit - 硬性限制無法被超額使用。一旦使用者超出了硬性限制,該使用者在該檔案系統將無法再使用任何空間。舉例來說,若一個使用者在一個檔案系統上有 500 KB 的硬性限制,且目前已經使用了 490 KB,該使用者只能再使用 10 KB 的空間,若嘗試使用 11 KB 的空間將會失敗。 - - soft limit - 軟性限制在有限的時間內可以被超額使用,即為寬限期 (Grace period),預設為一週。若一個使用者超出限制並超過寬限期,則軟性限制將轉為硬性限制並且將不允許再使用空間。當使用者使用的空間回到低於軟性限制內,寬限期就會被重置。 - - 在下面的例子中,會編輯 test 的配額。當執行 edquota 時,將會使用 EDITOR 指定的編輯器來編輯配額限制。預設的編輯器為 vi - - # edquota -u test -Quotas for user test: -/usr: kbytes in use: 65, limits (soft = 50, hard = 75) - inodes in use: 7, limits (soft = 50, hard = 60) -/usr/var: kbytes in use: 0, limits (soft = 50, hard = 75) - inodes in use: 0, limits (soft = 50, hard = 60) - - 正常每個開啟配額的檔案系統會有兩行需要設定,一行代表區塊限制 (Block limit) 而另一行代表節點限制 (inode limit),更改行內的值來修改配額限制。舉例來說,要在 /usr 提高區塊的軟性限制到 500 以及硬性限制到 600,可更改行內的值如下: - - /usr: kbytes in use: 65, limits (soft = 500, hard = 600) - - 新的配額限制將在離開編輯器後生效。 - - 有時會想要針對一群使用者設定配額限,這時可以透過指定想要的配額給第一個使用者,若然後使用 來複製配額到指定範圍的使用者 ID (UID)。以下指定將複製配額限制給 UID 10,00019,999 的使用者: - - # edquota -p test 10000-19999 - - 要取得更多資訊,請參考 edquota8 - - - - 檢查配額限制與磁碟使用狀況 - - - disk quotas - checking - - - 要檢查各別使用者或群組的配額與磁碟用量可使用 quota1。使用者僅可查看自己的配額以及所屬群組的配額,只有使超級使用者可以檢視所有使用者及群組的配額。要取得某個有開啟配額的檔案系統的所有配額及磁碟用量摘要,可使用 repquota8 - - 正常情況,使用者未使用任何磁碟空間的檔案系統並不會顯示在 quota 的輸出結果中,即使該使用者有在該檔案系統設定配額限制,使用 可以顯示這些檔案系統。以下是使用使用 quota -v 查詢某個使用者在兩個檔案系統上的配額限制的範例輸出。 - - Disk quotas for user test (uid 1002): - Filesystem usage quota limit grace files quota limit grace - /usr 65* 50 75 5days 7 50 60 - /usr/var 0 50 75 0 50 60 - - grace period - - 在這個例子當中,使用者在 /usr 的軟性限制 50 KB 已經超出了 15 KB 並已經過了 5 天寬限期。星號 * 代表該使用者目前已超出配額限制。 - - - - NFS 上的配額 - - NFS - - NFS 伺服器上,配額會由配額子系統強制執行,rpc.rquotad8 Daemon 會提供配額資訊給 NFS 客戶端的 quota,讓在那些主機的使用者可以查看它們的配額統計資訊。 - - NFS 伺服器上將 /etc/inetd.confrpc.rquotad 行前的 # 移除來開啟: - - rquotad/1 dgram rpc/udp wait root /usr/libexec/rpc.rquotad rpc.rquotad - - 然後重新啟動 inetd - - # service inetd restart - - - - - - 磁碟分割區加密 - - - - - Lucky - Green - - Contributed by - -
- shamrock@cypherpunks.to -
-
-
-
-
- - - disks - encrypting - - - FreeBSD offers excellent online protections against - unauthorized data access. File permissions and Mandatory Access Control (MAC) help - prevent unauthorized users from accessing data while the - operating system is active and the computer is powered up. - However, the permissions enforced by the operating system are - irrelevant if an attacker has physical access to a computer and - can move the computer's hard drive to another system to copy and - analyze the data. - - Regardless of how an attacker may have come into possession - of a hard drive or powered-down computer, the - GEOM-based cryptographic subsystems built - into FreeBSD are able to protect the data on the computer's file - systems against even highly-motivated attackers with significant - resources. Unlike encryption methods that encrypt individual - files, the built-in gbde and - geli utilities can be used to transparently - encrypt entire file systems. No cleartext ever touches the hard - drive's platter. - - This chapter demonstrates how to create an encrypted file - system on FreeBSD. It first demonstrates the process using - gbde and then demonstrates the same example - using geli. - - - 使用 <application>gbde</application> 做磁碟加密 - - The objective of the gbde4 facility is to provide a - formidable challenge for an attacker to gain access to the - contents of a cold storage device. - However, if the computer is compromised while up and running - and the storage device is actively attached, or the attacker - has access to a valid passphrase, it offers no protection to - the contents of the storage device. Thus, it is important to - provide physical security while the system is running and to - protect the passphrase used by the encryption - mechanism. - - This facility provides several barriers to protect the - data stored in each disk sector. It encrypts the contents of - a disk sector using 128-bit AES in - CBC mode. Each sector on the disk is - encrypted with a different AES key. For - more information on the cryptographic design, including how - the sector keys are derived from the user-supplied passphrase, - refer to gbde4. - - FreeBSD provides a kernel module for - gbde which can be loaded with this - command: - - # kldload geom_bde - - If using a custom kernel configuration file, ensure it - contains this line: - - options GEOM_BDE - - The following example demonstrates adding a new hard drive - to a system that will hold a single encrypted partition that - will be mounted as /private. - - - Encrypting a Partition with - <application>gbde</application> - - - Add the New Hard Drive - - Install the new drive to the system as explained in - . For the purposes of this - example, a new hard drive partition has been added as - /dev/ad4s1c and - /dev/ad0s1* - represents the existing standard FreeBSD partitions. - - # ls /dev/ad* -/dev/ad0 /dev/ad0s1b /dev/ad0s1e /dev/ad4s1 -/dev/ad0s1 /dev/ad0s1c /dev/ad0s1f /dev/ad4s1c -/dev/ad0s1a /dev/ad0s1d /dev/ad4 - - - - Create a Directory to Hold <command>gbde</command> - Lock Files - - # mkdir /etc/gbde - - The gbde lock file - contains information that gbde - requires to access encrypted partitions. Without access - to the lock file, gbde will not - be able to decrypt the data contained in the encrypted - partition without significant manual intervention which is - not supported by the software. Each encrypted partition - uses a separate lock file. - - - - Initialize the <command>gbde</command> - Partition - - A gbde partition must be - initialized before it can be used. This initialization - needs to be performed only once. This command will open - the default editor, in order to set various configuration - options in a template. For use with the - UFS file system, set the sector_size to - 2048: - - # gbde init /dev/ad4s1c -i -L /etc/gbde/ad4s1c.lock -# $FreeBSD$ -# -# Sector size is the smallest unit of data which can be read or written. -# Making it too small decreases performance and decreases available space. -# Making it too large may prevent filesystems from working. 512 is the -# minimum and always safe. For UFS, use the fragment size -# -sector_size = 2048 -[...] - - Once the edit is saved, the user will be asked twice - to type the passphrase used to secure the data. The - passphrase must be the same both times. The ability of - gbde to protect data depends - entirely on the quality of the passphrase. For tips on - how to select a secure passphrase that is easy to - remember, see http://world.std.com/~reinhold/diceware.htm. - - This initialization creates a lock file for the - gbde partition. In this - example, it is stored as - /etc/gbde/ad4s1c.lock. Lock files - must end in .lock in order to be correctly - detected by the /etc/rc.d/gbde start - up script. - - - Lock files must be backed up - together with the contents of any encrypted partitions. - Without the lock file, the legitimate owner will be - unable to access the data on the encrypted - partition. - - - - - Attach the Encrypted Partition to the - Kernel - - # gbde attach /dev/ad4s1c -l /etc/gbde/ad4s1c.lock - - This command will prompt to input the passphrase that - was selected during the initialization of the encrypted - partition. The new encrypted device will appear in - /dev as - /dev/device_name.bde: - - # ls /dev/ad* -/dev/ad0 /dev/ad0s1b /dev/ad0s1e /dev/ad4s1 -/dev/ad0s1 /dev/ad0s1c /dev/ad0s1f /dev/ad4s1c -/dev/ad0s1a /dev/ad0s1d /dev/ad4 /dev/ad4s1c.bde - - - - Create a File System on the Encrypted - Device - - Once the encrypted device has been attached to the - kernel, a file system can be created on the device. This - example creates a UFS file system with - soft updates enabled. Be sure to specify the partition - which has a - *.bde - extension: - - # newfs -U /dev/ad4s1c.bde - - - - Mount the Encrypted Partition - - Create a mount point and mount the encrypted file - system: - - # mkdir /private -# mount /dev/ad4s1c.bde /private - - - - Verify That the Encrypted File System is - Available - - The encrypted file system should now be visible and - available for use: - - % df -H -Filesystem Size Used Avail Capacity Mounted on -/dev/ad0s1a 1037M 72M 883M 8% / -/devfs 1.0K 1.0K 0B 100% /dev -/dev/ad0s1f 8.1G 55K 7.5G 0% /home -/dev/ad0s1e 1037M 1.1M 953M 0% /tmp -/dev/ad0s1d 6.1G 1.9G 3.7G 35% /usr -/dev/ad4s1c.bde 150G 4.1K 138G 0% /private - - - - After each boot, any encrypted file systems must be - manually re-attached to the kernel, checked for errors, and - mounted, before the file systems can be used. To configure - these steps, add the following lines to - /etc/rc.conf: - - gbde_autoattach_all="YES" -gbde_devices="ad4s1c" -gbde_lockdir="/etc/gbde" - - This requires that the passphrase be entered at the - console at boot time. After typing the correct passphrase, - the encrypted partition will be mounted automatically. - Additional gbde boot options are - available and listed in rc.conf5. - - - - sysinstall is incompatible - with gbde-encrypted devices. All - *.bde devices must be detached from the - kernel before starting sysinstall - or it will crash during its initial probing for devices. To - detach the encrypted device used in the example, use the - following command: - - # gbde detach /dev/ad4s1c - - - - - - 使用 <command>geli</command> 做磁碟加密 - - - - - Daniel - Gerzo - - Contributed by - - - - - An alternative cryptographic GEOM class - is available using geli. This control - utility adds some features and uses a different scheme for - doing cryptographic work. It provides the following - features: - - - - Utilizes the crypto9 framework and - automatically uses cryptographic hardware when it is - available. - - - - Supports multiple cryptographic algorithms such as - AES, Blowfish, and - 3DES. - - - - Allows the root partition to be encrypted. The - passphrase used to access the encrypted root partition - will be requested during system boot. - - - - Allows the use of two independent keys. - - - - It is fast as it performs simple sector-to-sector - encryption. - - - - Allows backup and restore of master keys. If a user - destroys their keys, it is still possible to get access to - the data by restoring keys from the backup. - - - - Allows a disk to attach with a random, one-time key - which is useful for swap partitions and temporary file - systems. - - - - More features and usage examples can be found in - geli8. - - The following example describes how to generate a key file - which will be used as part of the master key for the encrypted - provider mounted under /private. The key - file will provide some random data used to encrypt the master - key. The master key will also be protected by a passphrase. - The provider's sector size will be 4kB. The example describes - how to attach to the geli provider, create - a file system on it, mount it, work with it, and finally, how - to detach it. - - - Encrypting a Partition with - <command>geli</command> - - - Load <command>geli</command> Support - - Support for geli is available as a - loadable kernel module. To configure the system to - automatically load the module at boot time, add the - following line to - /boot/loader.conf: - - geom_eli_load="YES" - - To load the kernel module now: - - # kldload geom_eli - - For a custom kernel, ensure the kernel configuration - file contains these lines: - - options GEOM_ELI -device crypto - - - - Generate the Master Key - - The following commands generate a master key - (/root/da2.key) that is protected - with a passphrase. The data source for the key file is - /dev/random and the sector size of - the provider (/dev/da2.eli) is 4kB as - a bigger sector size provides better performance: - - # dd if=/dev/random of=/root/da2.key bs=64 count=1 -# geli init -s 4096 -K /root/da2.key /dev/da2 -Enter new passphrase: -Reenter new passphrase: - - It is not mandatory to use both a passphrase and a key - file as either method of securing the master key can be - used in isolation. - - If the key file is given as -, standard - input will be used. For example, this command generates - three key files: - - # cat keyfile1 keyfile2 keyfile3 | geli init -K - /dev/da2 - - - - Attach the Provider with the Generated Key - - To attach the provider, specify the key file, the name - of the disk, and the passphrase: - - # geli attach -k /root/da2.key /dev/da2 -Enter passphrase: - - This creates a new device with an - .eli extension: - - # ls /dev/da2* -/dev/da2 /dev/da2.eli - - - - Create the New File System - - Next, format the device with the - UFS file system and mount it on an - existing mount point: - - # dd if=/dev/random of=/dev/da2.eli bs=1m -# newfs /dev/da2.eli -# mount /dev/da2.eli /private - - The encrypted file system should now be available for - use: - - # df -H -Filesystem Size Used Avail Capacity Mounted on -/dev/ad0s1a 248M 89M 139M 38% / -/devfs 1.0K 1.0K 0B 100% /dev -/dev/ad0s1f 7.7G 2.3G 4.9G 32% /usr -/dev/ad0s1d 989M 1.5M 909M 0% /tmp -/dev/ad0s1e 3.9G 1.3G 2.3G 35% /var -/dev/da2.eli 150G 4.1K 138G 0% /private - - - - Once the work on the encrypted partition is done, and the - /private partition is no longer needed, - it is prudent to put the device into cold storage by - unmounting and detaching the geli encrypted - partition from the kernel: - - # umount /private -# geli detach da2.eli - - A rc.d script is provided to - simplify the mounting of geli-encrypted - devices at boot time. For this example, add these lines to - /etc/rc.conf: - - geli_devices="da2" -geli_da2_flags="-k /root/da2.key" - - This configures /dev/da2 as a - geli provider with a master key of - /root/da2.key. The system will - automatically detach the provider from the kernel before the - system shuts down. During the startup process, the script - will prompt for the passphrase before attaching the provider. - Other kernel messages might be shown before and after the - password prompt. If the boot process seems to stall, look - carefully for the password prompt among the other messages. - Once the correct passphrase is entered, the provider is - attached. The file system is then mounted, typically by an - entry in /etc/fstab. Refer to for instructions on how to - configure a file system to mount at boot time. - -
- - - - 交換空間加密 - - - - - Christian - Brueffer - - Written by - - - - - - swap - encrypting - - - Like the encryption of disk partitions, encryption of swap - space is used to protect sensitive information. Consider an - application that deals with passwords. As long as these - passwords stay in physical memory, they are not written to disk - and will be cleared after a reboot. However, if FreeBSD starts - swapping out memory pages to free space, the passwords may be - written to the disk unencrypted. Encrypting swap space can be a - solution for this scenario. - - This section demonstrates how to configure an encrypted - swap partition using gbde8 or geli8 encryption. - It assumes that - /dev/ada0s1b is the swap partition. - - - 設定已加密的交換空間 - - Swap partitions are not encrypted by default and should be - cleared of any sensitive data before continuing. To overwrite - the current swap partition with random garbage, execute the - following command: - - # dd if=/dev/random of=/dev/ada0s1b bs=1m - - To encrypt the swap partition using gbde8, add the - .bde suffix to the swap line in - /etc/fstab: - - # Device Mountpoint FStype Options Dump Pass# -/dev/ada0s1b.bde none swap sw 0 0 - - To instead encrypt the swap partition using geli8, - use the - .eli suffix: - - # Device Mountpoint FStype Options Dump Pass# -/dev/ada0s1b.eli none swap sw 0 0 - - By default, geli8 uses the AES - algorithm with a key length of 128 bits. Normally the default - settings will suffice. If desired, these defaults can be - altered in the options field in - /etc/fstab. The possible flags - are: - - - - aalgo - - Data integrity verification algorithm used to ensure - that the encrypted data has not been tampered with. See - geli8 for a list of supported algorithms. - - - - - ealgo - - Encryption algorithm used to protect the data. See - geli8 for a list of supported algorithms. - - - - - keylen - - The length of the key used for the encryption - algorithm. See geli8 for the key lengths that - are supported by each encryption algorithm. - - - - - sectorsize - - The size of the blocks data is broken into before - it is encrypted. Larger sector sizes increase - performance at the cost of higher storage - overhead. The recommended size is 4096 bytes. - - - - - This example configures an encrypted swap partition using - the Blowfish algorithm with a key length of 128 bits and a - sectorsize of 4 kilobytes: - - # Device Mountpoint FStype Options Dump Pass# -/dev/ada0s1b.eli none swap sw,ealgo=blowfish,keylen=128,sectorsize=4096 0 0 - - - - - 加密的交換空間檢驗 - - Once the system has rebooted, proper operation of the - encrypted swap can be verified using - swapinfo. - - If gbde8 is being used: - - % swapinfo -Device 1K-blocks Used Avail Capacity -/dev/ada0s1b.bde 542720 0 542720 0% - - If geli8 is being used: - - % swapinfo -Device 1K-blocks Used Avail Capacity -/dev/ada0s1b.eli 542720 0 542720 0% - - - - - - 高可用存儲空間 (<acronym>HAST</acronym>) - - - - - Daniel - Gerzo - - Contributed by - - - - - - - Freddie - Cash - - With inputs from - - - - - Pawel Jakub - Dawidek - - - - - - Michael W. - Lucas - - - - - - Viktor - Petersson - - - - - - - HAST - high availability - - - High availability is one of the main requirements in - serious business applications and highly-available storage is a - key component in such environments. In FreeBSD, the Highly - Available STorage (HAST) framework allows - transparent storage of the same data across several physically - separated machines connected by a TCP/IP - network. HAST can be understood as a - network-based RAID1 (mirror), and is similar to the DRBD® - storage system used in the GNU/Linux platform. In combination - with other high-availability features of FreeBSD like - CARP, HAST makes it - possible to build a highly-available storage cluster that is - resistant to hardware failures. - - The following are the main features of - HAST: - - - - Can be used to mask I/O errors on - local hard drives. - - - - File system agnostic as it works with any file system - supported by FreeBSD. - - - - Efficient and quick resynchronization as only the blocks - that were modified during the downtime of a node are - synchronized. - - - - - - Can be used in an already deployed environment to add - additional redundancy. - - - - Together with CARP, - Heartbeat, or other tools, it can - be used to build a robust and durable storage system. - - - - After reading this section, you will know: - - - - What HAST is, how it works, and - which features it provides. - - - - How to set up and use HAST on - FreeBSD. - - - - How to integrate CARP and - devd8 to build a robust storage system. - - - - Before reading this section, you should: - - - - 了解 UNIX 及 FreeBSD 基礎 ()。 - - - - Know how to configure network - interfaces and other core FreeBSD subsystems (). - - - - Have a good understanding of FreeBSD - networking (). - - - - The HAST project was sponsored by The - FreeBSD Foundation with support from http://www.omc.net/ - and http://www.transip.nl/. - - - HAST 運作模式 - - HAST provides synchronous block-level - replication between two physical machines: the - primary, also known as the - master node, and the - secondary, or slave - node. These two machines together are referred to as a - cluster. - - Since HAST works in a primary-secondary - configuration, it allows only one of the cluster nodes to be - active at any given time. The primary node, also called - active, is the one which will handle all - the I/O requests to - HAST-managed devices. The secondary node - is automatically synchronized from the primary node. - - The physical components of the HAST - system are the local disk on primary node, and the disk on the - remote, secondary node. - - HAST operates synchronously on a block - level, making it transparent to file systems and applications. - HAST provides regular GEOM providers in - /dev/hast/ for use by other tools or - applications. There is no difference between using - HAST-provided devices and raw disks or - partitions. - - Each write, delete, or flush operation is sent to both the - local disk and to the remote disk over - TCP/IP. Each read operation is served from - the local disk, unless the local disk is not up-to-date or an - I/O error occurs. In such cases, the read - operation is sent to the secondary node. - - HAST tries to provide fast failure - recovery. For this reason, it is important to reduce - synchronization time after a node's outage. To provide fast - synchronization, HAST manages an on-disk - bitmap of dirty extents and only synchronizes those during a - regular synchronization, with an exception of the initial - sync. - - There are many ways to handle synchronization. - HAST implements several replication modes - to handle different synchronization methods: - - - - memsync: This mode reports a - write operation as completed when the local write - operation is finished and when the remote node - acknowledges data arrival, but before actually storing the - data. The data on the remote node will be stored directly - after sending the acknowledgement. This mode is intended - to reduce latency, but still provides good reliability. - This mode is the default. - - - - fullsync: This mode reports a - write operation as completed when both the local write and - the remote write complete. This is the safest and the - slowest replication mode. - - - - async: This mode reports a write - operation as completed when the local write completes. - This is the fastest and the most dangerous replication - mode. It should only be used when replicating to a - distant node where latency is too high for other - modes. - - - - - - HAST 設定 - - The HAST framework consists of several - components: - - - - The hastd8 daemon which provides data - synchronization. When this daemon is started, it will - automatically load geom_gate.ko. - - - - The userland management utility, - hastctl8. - - - - The hast.conf5 configuration file. This file - must exist before starting - hastd. - - - - Users who prefer to statically build - GEOM_GATE support into the kernel should - add this line to the custom kernel configuration file, then - rebuild the kernel using the instructions in : - - options GEOM_GATE - - The following example describes how to configure two nodes - in master-slave/primary-secondary operation using - HAST to replicate the data between the two. - The nodes will be called hasta, with an - IP address of - 172.16.0.1, and hastb, - with an IP address of - 172.16.0.2. Both nodes will have a - dedicated hard drive /dev/ad6 of the same - size for HAST operation. The - HAST pool, sometimes referred to as a - resource or the GEOM provider in /dev/hast/, will be called - test. - - Configuration of HAST is done using - /etc/hast.conf. This file should be - identical on both nodes. The simplest configuration - is: - - resource test { - on hasta { - local /dev/ad6 - remote 172.16.0.2 - } - on hastb { - local /dev/ad6 - remote 172.16.0.1 - } -} - - For more advanced configuration, refer to - hast.conf5. - - - It is also possible to use host names in the - remote statements if the hosts are - resolvable and defined either in - /etc/hosts or in the local - DNS. - - - Once the configuration exists on both nodes, the - HAST pool can be created. Run these - commands on both nodes to place the initial metadata onto the - local disk and to start hastd8: - - # hastctl create test -# service hastd onestart - - - It is not possible to use - GEOM - providers with an existing file system or to convert an - existing storage to a HAST-managed pool. - This procedure needs to store some metadata on the provider - and there will not be enough required space available on an - existing provider. - - - A HAST node's primary or - secondary role is selected by an - administrator, or software like - Heartbeat, using hastctl8. - On the primary node, hasta, issue this - command: - - # hastctl role primary test - - Run this command on the secondary node, - hastb: - - # hastctl role secondary test - - Verify the result by running hastctl on - each node: - - # hastctl status test - - Check the status line in the output. - If it says degraded, something is wrong - with the configuration file. It should say - complete on each node, meaning that the - synchronization between the nodes has started. The - synchronization completes when hastctl - status reports 0 bytes of dirty - extents. - - The next step is to create a file system on the - GEOM provider and mount it. This must be - done on the primary node. Creating the - file system can take a few minutes, depending on the size of - the hard drive. This example creates a UFS - file system on /dev/hast/test: - - # newfs -U /dev/hast/test -# mkdir /hast/test -# mount /dev/hast/test /hast/test - - Once the HAST framework is configured - properly, the final step is to make sure that - HAST is started automatically during - system boot. Add this line to - /etc/rc.conf: - - hastd_enable="YES" - - - 容錯移轉設定 - - The goal of this example is to build a robust storage - system which is resistant to the failure of any given node. - If the primary node fails, the secondary node is there to - take over seamlessly, check and mount the file system, and - continue to work without missing a single bit of - data. - - To accomplish this task, the Common Address Redundancy - Protocol (CARP) is used to provide for - automatic failover at the IP layer. - CARP allows multiple hosts on the same - network segment to share an IP address. - Set up CARP on both nodes of the cluster - according to the documentation available in . In this example, each node will have - its own management IP address and a - shared IP address of - 172.16.0.254. The primary - HAST node of the cluster must be the - master CARP node. - - The HAST pool created in the previous - section is now ready to be exported to the other hosts on - the network. This can be accomplished by exporting it - through NFS or - Samba, using the shared - IP address - 172.16.0.254. The only problem - which remains unresolved is an automatic failover should the - primary node fail. - - In the event of CARP interfaces going - up or down, the FreeBSD operating system generates a - devd8 event, making it possible to watch for state - changes on the CARP interfaces. A state - change on the CARP interface is an - indication that one of the nodes failed or came back online. - These state change events make it possible to run a script - which will automatically handle the HAST failover. - - To catch state changes on the - CARP interfaces, add this configuration - to /etc/devd.conf on each node: - - notify 30 { - match "system" "IFNET"; - match "subsystem" "carp0"; - match "type" "LINK_UP"; - action "/usr/local/sbin/carp-hast-switch master"; -}; - -notify 30 { - match "system" "IFNET"; - match "subsystem" "carp0"; - match "type" "LINK_DOWN"; - action "/usr/local/sbin/carp-hast-switch slave"; -}; - - - If the systems are running FreeBSD 10 or higher, - replace carp0 with the name of the - CARP-configured interface. - - - Restart devd8 on both nodes to put the new - configuration into effect: - - # service devd restart - - When the specified interface state changes by going up - or down , the system generates a notification, allowing the - devd8 subsystem to run the specified automatic - failover script, - /usr/local/sbin/carp-hast-switch. - For further clarification about this configuration, refer to - devd.conf5. - - Here is an example of an automated failover - script: - - #!/bin/sh - -# Original script by Freddie Cash <fjwcash@gmail.com> -# Modified by Michael W. Lucas <mwlucas@BlackHelicopters.org> -# and Viktor Petersson <vpetersson@wireload.net> - -# The names of the HAST resources, as listed in /etc/hast.conf -resources="test" - -# delay in mounting HAST resource after becoming master -# make your best guess -delay=3 - -# logging -log="local0.debug" -name="carp-hast" - -# end of user configurable stuff - -case "$1" in - master) - logger -p $log -t $name "Switching to primary provider for ${resources}." - sleep ${delay} - - # Wait for any "hastd secondary" processes to stop - for disk in ${resources}; do - while $( pgrep -lf "hastd: ${disk} \(secondary\)" > /dev/null 2>&1 ); do - sleep 1 - done - - # Switch role for each disk - hastctl role primary ${disk} - if [ $? -ne 0 ]; then - logger -p $log -t $name "Unable to change role to primary for resource ${disk}." - exit 1 - fi - done - - # Wait for the /dev/hast/* devices to appear - for disk in ${resources}; do - for I in $( jot 60 ); do - [ -c "/dev/hast/${disk}" ] && break - sleep 0.5 - done - - if [ ! -c "/dev/hast/${disk}" ]; then - logger -p $log -t $name "GEOM provider /dev/hast/${disk} did not appear." - exit 1 - fi - done - - logger -p $log -t $name "Role for HAST resources ${resources} switched to primary." - - - logger -p $log -t $name "Mounting disks." - for disk in ${resources}; do - mkdir -p /hast/${disk} - fsck -p -y -t ufs /dev/hast/${disk} - mount /dev/hast/${disk} /hast/${disk} - done - - ;; - - slave) - logger -p $log -t $name "Switching to secondary provider for ${resources}." - - # Switch roles for the HAST resources - for disk in ${resources}; do - if ! mount | grep -q "^/dev/hast/${disk} on " - then - else - umount -f /hast/${disk} - fi - sleep $delay - hastctl role secondary ${disk} 2>&1 - if [ $? -ne 0 ]; then - logger -p $log -t $name "Unable to switch role to secondary for resource ${disk}." - exit 1 - fi - logger -p $log -t $name "Role switched to secondary for resource ${disk}." - done - ;; -esac - - In a nutshell, the script takes these actions when a - node becomes master: - - - - Promotes the HAST pool to - primary on the other node. - - - - Checks the file system under the - HAST pool. - - - - Mounts the pool. - - - - When a node becomes secondary: - - - - Unmounts the HAST pool. - - - - Degrades the HAST pool to - secondary. - - - - - This is just an example script which serves as a proof - of concept. It does not handle all the possible scenarios - and can be extended or altered in any way, for example, to - start or stop required services. - - - - For this example, a standard UFS - file system was used. To reduce the time needed for - recovery, a journal-enabled UFS or - ZFS file system can be used - instead. - - - More detailed information with additional examples can - be found at http://wiki.FreeBSD.org/HAST. - - - - - 疑難排解 - - HAST should generally work without - issues. However, as with any other software product, there - may be times when it does not work as supposed. The sources - of the problems may be different, but the rule of thumb is to - ensure that the time is synchronized between the nodes of the - cluster. - - When troubleshooting HAST, the - debugging level of hastd8 should be increased by - starting hastd with -d. - This argument may be specified multiple times to further - increase the debugging level. Consider also using - -F, which starts hastd - in the foreground. - - - 自 Split-brain 情況復原 - - Split-brain occurs when the nodes - of the cluster are unable to communicate with each other, - and both are configured as primary. This is a dangerous - condition because it allows both nodes to make incompatible - changes to the data. This problem must be corrected - manually by the system administrator. - - The administrator must either decide which node has more - important changes, or perform the merge manually. Then, let - HAST perform full synchronization of the - node which has the broken data. To do this, issue these - commands on the node which needs to be - resynchronized: - - # hastctl role init test -# hastctl create test -# hastctl role secondary test - - - -
- - - - - - - GEOM: 模組化磁碟轉換框架 - - - - - Tom - Rhodes - - Written by - - - - - - 概述 - - - GEOM - - - GEOM Disk Framework - GEOM - - - 在 FreeBSD 中,GEOM 可允許對類別做存取與控制,例如:主開機記錄 (Master Boot Record) 與 BSD 標籤,透過利用提供者,或在 /dev 中的磁碟裝置。透過支援各種 RAID 的配置,GEOM 透明的提供了對作業系統與作業系統工具的存取。 - - This chapter covers the use of disks under the - GEOM framework in FreeBSD. This includes the - major RAID control utilities which use the - framework for configuration. This chapter is not a definitive - guide to RAID configurations and only - GEOM-supported RAID - classifications are discussed. - - 讀完這章,您將了解: - - - - What type of RAID support is - available through GEOM. - - - - How to use the base utilities to configure, maintain, - and manipulate the various RAID - levels. - - - - How to mirror, stripe, encrypt, and remotely connect - disk devices through GEOM. - - - - How to troubleshoot disks attached to the - GEOM framework. - - - - 在開始閱讀這章之前,您需要: - - - - Understand how FreeBSD treats disk devices (). - - - - 了解如何設定並安裝新的核心 ()。 - - - - - - - RAID0 - 串連 (Striping) - - - - - Tom - Rhodes - - Written by - - - - - Murray - Stokely - - - - - - - GEOM - - - Striping - - - 串連會合併數個磁碟成單一個磁碟區 (Volume),可以透過使用硬體 RAID 控制器來做到串連。GEOM 磁碟子系統提供了軟體支援的磁碟串連,也就是所謂的 RAID0,而不需要 RAID 磁碟控制器。 - - RAID0 中,資料會被切割成數個資料區塊 (Block) 寫入到磁碟陣列中的每一個磁碟機。如下圖所示,取代以往等候系統寫入 256k 到一個磁碟的時間, RAID0 可以同時寫入 64k 到磁碟陣列中四個磁碟的每個磁碟,這可提供優異的 I/O 效能,若使用多個磁碟控制器可增加更多的效能。 - - - - - - - - Disk Striping Illustration - - - - RAID0 串連中的每個磁碟必須要相同大小,因為 I/O 的請求是平行交錯讀取或寫入到多個磁碟的。 - - - RAID0提供任何備援 (Redundancy) 功能。這意謂著若磁碟陣列中的其中一個磁碟故障,所有在該磁碟上的資料便會遺失。若資料很重要,請規畫備份策略,定期儲存備份到遠端系統或裝置。 - - - The process for creating a software, - GEOM-based RAID0 on a FreeBSD - system using commodity disks is as follows. Once the stripe is - created, refer to gstripe8 for more information on how - to control an existing stripe. - - - Creating a Stripe of Unformatted <acronym>ATA</acronym> - Disks - - - Load the geom_stripe.ko - module: - - # kldload geom_stripe - - - - Ensure that a suitable mount point exists. If this - volume will become a root partition, then temporarily use - another mount point such as - /mnt. - - - - Determine the device names for the disks which will - be striped, and create the new stripe device. For example, - to stripe two unused and unpartitioned - ATA disks with device names of - /dev/ad2 and - /dev/ad3: - - # gstripe label -v st0 /dev/ad2 /dev/ad3 -Metadata value stored on /dev/ad2. -Metadata value stored on /dev/ad3. -Done. - - - - Write a standard label, also known as a partition table, - on the new volume and install the default bootstrap - code: - - # bsdlabel -wB /dev/stripe/st0 - - - - This process should create two other devices in - /dev/stripe in addition to - st0. Those include - st0a and st0c. At - this point, a UFS file system can be - created on st0a using - newfs: - - # newfs -U /dev/stripe/st0a - - Many numbers will glide across the screen, and after a - few seconds, the process will be complete. The volume has - been created and is ready to be mounted. - - - - To manually mount the created disk stripe: - - # mount /dev/stripe/st0a /mnt - - - - To mount this striped file system automatically during - the boot process, place the volume information in - /etc/fstab. In this example, a - permanent mount point, named stripe, is - created: - - # mkdir /stripe -# echo "/dev/stripe/st0a /stripe ufs rw 2 2" \ ->> /etc/fstab - - - - The geom_stripe.ko module must also - be automatically loaded during system initialization, by - adding a line to - /boot/loader.conf: - - # sysrc -f /boot/loader.conf geom_stripe_load=YES - - - - - - RAID1 - 鏡像 (Mirroring) - - - GEOM - - - Disk Mirroring - - - RAID1 - - - RAID1鏡像是一項寫入相同資料到超過一個磁碟機的技術。鏡像通常用來保護資料因磁碟機故障導致的損失,每個在鏡像中的磁碟機會擁有完全相同的資料,當各別磁碟機故障時,鏡像會繼續運作,由還可運作的磁碟機提供資料。電腦會繼續執行,等到管理者有時間更換故障的硬碟,而不會被使用者中斷運作。 - - Two common situations are illustrated in these examples. - The first creates a mirror out of two new drives and uses it as - a replacement for an existing single drive. The second example - creates a mirror on a single new drive, copies the old drive's - data to it, then inserts the old drive into the mirror. While - this procedure is slightly more complicated, it only requires - one new drive. - - Traditionally, the two drives in a mirror are identical in - model and capacity, but gmirror8 does not require that. - Mirrors created with dissimilar drives will have a capacity - equal to that of the smallest drive in the mirror. Extra space - on larger drives will be unused. Drives inserted into the - mirror later must have at least as much capacity as the smallest - drive already in the mirror. - - - The mirroring procedures shown here are non-destructive, - but as with any major disk operation, make a full backup - first. - - - - While dump8 is used in these procedures - to copy file systems, it does not work on file systems with - soft updates journaling. See tunefs8 for information - on detecting and disabling soft updates journaling. - - - - Metadata 問題 - - Many disk systems store metadata at the end of each disk. - Old metadata should be erased before reusing the disk for a - mirror. Most problems are caused by two particular types of - leftover metadata: GPT partition tables and - old metadata from a previous mirror. - - GPT metadata can be erased with - gpart8. This example erases both primary and backup - GPT partition tables from disk - ada8: - - # gpart destroy -F ada8 - - A disk can be removed from an active mirror and the - metadata erased in one step using gmirror8. Here, the - example disk ada8 is removed from the - active mirror gm4: - - # gmirror remove gm4 ada8 - - If the mirror is not running, but old mirror metadata is - still on the disk, use gmirror clear to - remove it: - - # gmirror clear ada8 - - gmirror8 stores one block of metadata at the end of - the disk. Because GPT partition schemes - also store metadata at the end of the disk, mirroring entire - GPT disks with gmirror8 is not - recommended. MBR partitioning is used here - because it only stores a partition table at the start of the - disk and does not conflict with the mirror metadata. - - - - 使用兩個新磁碟建立鏡像 - - In this example, FreeBSD has already been installed on a - single disk, ada0. Two new disks, - ada1 and ada2, have - been connected to the system. A new mirror will be created on - these two disks and used to replace the old single - disk. - - The geom_mirror.ko kernel module must - either be built into the kernel or loaded at boot- or - run-time. Manually load the kernel module now: - - # gmirror load - - Create the mirror with the two new drives: - - # gmirror label -v gm0 /dev/ada1 /dev/ada2 - - gm0 is a user-chosen device name - assigned to the new mirror. After the mirror has been - started, this device name appears in - /dev/mirror/. - - MBR and - bsdlabel partition tables can now - be created on the mirror with gpart8. This example - uses a traditional file system layout, with partitions for - /, swap, /var, - /tmp, and /usr. A - single / and a swap partition - will also work. - - Partitions on the mirror do not have to be the same size - as those on the existing disk, but they must be large enough - to hold all the data already present on - ada0. - - # gpart create -s MBR mirror/gm0 -# gpart add -t freebsd -a 4k mirror/gm0 -# gpart show mirror/gm0 -=> 63 156301423 mirror/gm0 MBR (74G) - 63 63 - free - (31k) - 126 156301299 1 freebsd (74G) - 156301425 61 - free - (30k) - - # gpart create -s BSD mirror/gm0s1 -# gpart add -t freebsd-ufs -a 4k -s 2g mirror/gm0s1 -# gpart add -t freebsd-swap -a 4k -s 4g mirror/gm0s1 -# gpart add -t freebsd-ufs -a 4k -s 2g mirror/gm0s1 -# gpart add -t freebsd-ufs -a 4k -s 1g mirror/gm0s1 -# gpart add -t freebsd-ufs -a 4k mirror/gm0s1 -# gpart show mirror/gm0s1 -=> 0 156301299 mirror/gm0s1 BSD (74G) - 0 2 - free - (1.0k) - 2 4194304 1 freebsd-ufs (2.0G) - 4194306 8388608 2 freebsd-swap (4.0G) - 12582914 4194304 4 freebsd-ufs (2.0G) - 16777218 2097152 5 freebsd-ufs (1.0G) - 18874370 137426928 6 freebsd-ufs (65G) - 156301298 1 - free - (512B) - - Make the mirror bootable by installing bootcode in the - MBR and bsdlabel and setting the active - slice: - - # gpart bootcode -b /boot/mbr mirror/gm0 -# gpart set -a active -i 1 mirror/gm0 -# gpart bootcode -b /boot/boot mirror/gm0s1 - - Format the file systems on the new mirror, enabling - soft-updates. - - # newfs -U /dev/mirror/gm0s1a -# newfs -U /dev/mirror/gm0s1d -# newfs -U /dev/mirror/gm0s1e -# newfs -U /dev/mirror/gm0s1f - - File systems from the original ada0 - disk can now be copied onto the mirror with dump8 and - restore8. - - # mount /dev/mirror/gm0s1a /mnt -# dump -C16 -b64 -0aL -f - / | (cd /mnt && restore -rf -) -# mount /dev/mirror/gm0s1d /mnt/var -# mount /dev/mirror/gm0s1e /mnt/tmp -# mount /dev/mirror/gm0s1f /mnt/usr -# dump -C16 -b64 -0aL -f - /var | (cd /mnt/var && restore -rf -) -# dump -C16 -b64 -0aL -f - /tmp | (cd /mnt/tmp && restore -rf -) -# dump -C16 -b64 -0aL -f - /usr | (cd /mnt/usr && restore -rf -) - - Edit /mnt/etc/fstab to point to - the new mirror file systems: - - # Device Mountpoint FStype Options Dump Pass# -/dev/mirror/gm0s1a / ufs rw 1 1 -/dev/mirror/gm0s1b none swap sw 0 0 -/dev/mirror/gm0s1d /var ufs rw 2 2 -/dev/mirror/gm0s1e /tmp ufs rw 2 2 -/dev/mirror/gm0s1f /usr ufs rw 2 2 - - If the geom_mirror.ko kernel module - has not been built into the kernel, - /mnt/boot/loader.conf is edited to load - the module at boot: - - geom_mirror_load="YES" - - Reboot the system to test the new mirror and verify that - all data has been copied. The BIOS will - see the mirror as two individual drives rather than a mirror. - Because the drives are identical, it does not matter which is - selected to boot. - - See if there are - problems booting. Powering down and disconnecting the - original ada0 disk will allow it to be - kept as an offline backup. - - In use, the mirror will behave just like the original - single drive. - - - - 使用既有磁碟建立鏡像 - - In this example, FreeBSD has already been installed on a - single disk, ada0. A new disk, - ada1, has been connected to the system. - A one-disk mirror will be created on the new disk, the - existing system copied onto it, and then the old disk will be - inserted into the mirror. This slightly complex procedure is - required because gmirror needs to put a - 512-byte block of metadata at the end of each disk, and the - existing ada0 has usually had all of its - space already allocated. - - Load the geom_mirror.ko kernel - module: - - # gmirror load - - Check the media size of the original disk with - diskinfo: - - # diskinfo -v ada0 | head -n3 -/dev/ada0 - 512 # sectorsize - 1000204821504 # mediasize in bytes (931G) - - Create a mirror on the new disk. To make certain that the - mirror capacity is not any larger than the original - ada0 drive, gnop8 is used to - create a fake drive of the exact same size. This drive does - not store any data, but is used only to limit the size of the - mirror. When gmirror8 creates the mirror, it will - restrict the capacity to the size of - gzero.nop, even if the new - ada1 drive has more space. Note that the - 1000204821504 in the second line is - equal to ada0's media size as shown by - diskinfo above. - - # geom zero load -# gnop create -s 1000204821504 gzero -# gmirror label -v gm0 gzero.nop ada1 -# gmirror forget gm0 - - Since gzero.nop does not store any - data, the mirror does not see it as connected. The mirror is - told to forget unconnected components, removing - references to gzero.nop. The result is a - mirror device containing only a single disk, - ada1. - - After creating gm0, view the - partition table on ada0. This output is - from a 1 TB drive. If there is some unallocated space at - the end of the drive, the contents may be copied directly from - ada0 to the new mirror. - - However, if the output shows that all of the space on the - disk is allocated, as in the following listing, there is no - space available for the 512-byte mirror metadata at the end of - the disk. - - # gpart show ada0 -=> 63 1953525105 ada0 MBR (931G) - 63 1953525105 1 freebsd [active] (931G) - - In this case, the partition table must be edited to reduce - the capacity by one sector on mirror/gm0. - The procedure will be explained later. - - In either case, partition tables on the primary disk - should be first copied using gpart backup - and gpart restore. - - # gpart backup ada0 > table.ada0 -# gpart backup ada0s1 > table.ada0s1 - - These commands create two files, - table.ada0 and - table.ada0s1. This example is from a - 1 TB drive: - - # cat table.ada0 -MBR 4 -1 freebsd 63 1953525105 [active] - - # cat table.ada0s1 -BSD 8 -1 freebsd-ufs 0 4194304 -2 freebsd-swap 4194304 33554432 -4 freebsd-ufs 37748736 50331648 -5 freebsd-ufs 88080384 41943040 -6 freebsd-ufs 130023424 838860800 -7 freebsd-ufs 968884224 984640881 - - If no free space is shown at the end of the disk, the size - of both the slice and the last partition must be reduced by - one sector. Edit the two files, reducing the size of both the - slice and last partition by one. These are the last numbers - in each listing. - - # cat table.ada0 -MBR 4 -1 freebsd 63 1953525104 [active] - - # cat table.ada0s1 -BSD 8 -1 freebsd-ufs 0 4194304 -2 freebsd-swap 4194304 33554432 -4 freebsd-ufs 37748736 50331648 -5 freebsd-ufs 88080384 41943040 -6 freebsd-ufs 130023424 838860800 -7 freebsd-ufs 968884224 984640880 - - If at least one sector was unallocated at the end of the - disk, these two files can be used without modification. - - Now restore the partition table into - mirror/gm0: - - # gpart restore mirror/gm0 < table.ada0 -# gpart restore mirror/gm0s1 < table.ada0s1 - - Check the partition table with - gpart show. This example has - gm0s1a for /, - gm0s1d for /var, - gm0s1e for /usr, - gm0s1f for /data1, - and gm0s1g for - /data2. - - # gpart show mirror/gm0 -=> 63 1953525104 mirror/gm0 MBR (931G) - 63 1953525042 1 freebsd [active] (931G) - 1953525105 62 - free - (31k) - -# gpart show mirror/gm0s1 -=> 0 1953525042 mirror/gm0s1 BSD (931G) - 0 2097152 1 freebsd-ufs (1.0G) - 2097152 16777216 2 freebsd-swap (8.0G) - 18874368 41943040 4 freebsd-ufs (20G) - 60817408 20971520 5 freebsd-ufs (10G) - 81788928 629145600 6 freebsd-ufs (300G) - 710934528 1242590514 7 freebsd-ufs (592G) - 1953525042 63 - free - (31k) - - Both the slice and the last partition must have at least - one free block at the end of the disk. - - Create file systems on these new partitions. The number - of partitions will vary to match the original disk, - ada0. - - # newfs -U /dev/mirror/gm0s1a -# newfs -U /dev/mirror/gm0s1d -# newfs -U /dev/mirror/gm0s1e -# newfs -U /dev/mirror/gm0s1f -# newfs -U /dev/mirror/gm0s1g - - Make the mirror bootable by installing bootcode in the - MBR and bsdlabel and setting the active - slice: - - # gpart bootcode -b /boot/mbr mirror/gm0 -# gpart set -a active -i 1 mirror/gm0 -# gpart bootcode -b /boot/boot mirror/gm0s1 - - Adjust /etc/fstab to use the new - partitions on the mirror. Back up this file first by copying - it to /etc/fstab.orig. - - # cp /etc/fstab /etc/fstab.orig - - Edit /etc/fstab, replacing - /dev/ada0 with - mirror/gm0. - - # Device Mountpoint FStype Options Dump Pass# -/dev/mirror/gm0s1a / ufs rw 1 1 -/dev/mirror/gm0s1b none swap sw 0 0 -/dev/mirror/gm0s1d /var ufs rw 2 2 -/dev/mirror/gm0s1e /usr ufs rw 2 2 -/dev/mirror/gm0s1f /data1 ufs rw 2 2 -/dev/mirror/gm0s1g /data2 ufs rw 2 2 - - If the geom_mirror.ko kernel module - has not been built into the kernel, edit - /boot/loader.conf to load it at - boot: - - geom_mirror_load="YES" - - File systems from the original disk can now be copied onto - the mirror with dump8 and restore8. Each file - system dumped with dump -L will create a - snapshot first, which can take some time. - - # mount /dev/mirror/gm0s1a /mnt -# dump -C16 -b64 -0aL -f - / | (cd /mnt && restore -rf -) -# mount /dev/mirror/gm0s1d /mnt/var -# mount /dev/mirror/gm0s1e /mnt/usr -# mount /dev/mirror/gm0s1f /mnt/data1 -# mount /dev/mirror/gm0s1g /mnt/data2 -# dump -C16 -b64 -0aL -f - /usr | (cd /mnt/usr && restore -rf -) -# dump -C16 -b64 -0aL -f - /var | (cd /mnt/var && restore -rf -) -# dump -C16 -b64 -0aL -f - /data1 | (cd /mnt/data1 && restore -rf -) -# dump -C16 -b64 -0aL -f - /data2 | (cd /mnt/data2 && restore -rf -) - - Restart the system, booting from - ada1. If everything is working, the - system will boot from mirror/gm0, which - now contains the same data as ada0 had - previously. See if - there are problems booting. - - At this point, the mirror still consists of only the - single ada1 disk. - - After booting from mirror/gm0 - successfully, the final step is inserting - ada0 into the mirror. - - - When ada0 is inserted into the - mirror, its former contents will be overwritten by data from - the mirror. Make certain that - mirror/gm0 has the same contents as - ada0 before adding - ada0 to the mirror. If the contents - previously copied by dump8 and restore8 are - not identical to what was on ada0, - revert /etc/fstab to mount the file - systems on ada0, reboot, and start the - whole procedure again. - - - # gmirror insert gm0 ada0 -GEOM_MIRROR: Device gm0: rebuilding provider ada0 - - Synchronization between the two disks will start - immediately. Use gmirror status to view - the progress. - - # gmirror status - Name Status Components -mirror/gm0 DEGRADED ada1 (ACTIVE) - ada0 (SYNCHRONIZING, 64%) - - After a while, synchronization will finish. - - GEOM_MIRROR: Device gm0: rebuilding provider ada0 finished. -# gmirror status - Name Status Components -mirror/gm0 COMPLETE ada1 (ACTIVE) - ada0 (ACTIVE) - - mirror/gm0 now consists - of the two disks ada0 and - ada1, and the contents are automatically - synchronized with each other. In use, - mirror/gm0 will behave just like the - original single drive. - - - - 疑難排解 - - If the system no longer boots, BIOS - settings may have to be changed to boot from one of the new - mirrored drives. Either mirror drive can be used for booting, - as they contain identical data. - - If the boot stops with this message, something is wrong - with the mirror device: - - Mounting from ufs:/dev/mirror/gm0s1a failed with error 19. - -Loader variables: - vfs.root.mountfrom=ufs:/dev/mirror/gm0s1a - vfs.root.mountfrom.options=rw - -Manual root filesystem specification: - <fstype>:<device> [options] - Mount <device> using filesystem <fstype> - and with the specified (optional) option list. - - eg. ufs:/dev/da0s1a - zfs:tank - cd9660:/dev/acd0 ro - (which is equivalent to: mount -t cd9660 -o ro /dev/acd0 /) - - ? List valid disk boot devices - . Yield 1 second (for background tasks) - <empty line> Abort manual input - -mountroot> - - Forgetting to load the geom_mirror.ko - module in /boot/loader.conf can cause - this problem. To fix it, boot from a FreeBSD - installation media and choose Shell at the - first prompt. Then load the mirror module and mount the - mirror device: - - # gmirror load -# mount /dev/mirror/gm0s1a /mnt - - Edit /mnt/boot/loader.conf, adding a - line to load the mirror module: - - geom_mirror_load="YES" - - Save the file and reboot. - - Other problems that cause error 19 - require more effort to fix. Although the system should boot - from ada0, another prompt to select a - shell will appear if /etc/fstab is - incorrect. Enter ufs:/dev/ada0s1a at the - boot loader prompt and press Enter. Undo the - edits in /etc/fstab then mount the file - systems from the original disk (ada0) - instead of the mirror. Reboot the system and try the - procedure again. - - Enter full pathname of shell or RETURN for /bin/sh: -# cp /etc/fstab.orig /etc/fstab -# reboot - - - - 自磁碟故障復原 - - The benefit of disk mirroring is that an individual disk - can fail without causing the mirror to lose any data. In the - above example, if ada0 fails, the mirror - will continue to work, providing data from the remaining - working drive, ada1. - - To replace the failed drive, shut down the system and - physically replace the failed drive with a new drive of equal - or greater capacity. Manufacturers use somewhat arbitrary - values when rating drives in gigabytes, and the only way to - really be sure is to compare the total count of sectors shown - by diskinfo -v. A drive with larger - capacity than the mirror will work, although the extra space - on the new drive will not be used. - - After the computer is powered back up, the mirror will be - running in a degraded mode with only one drive. - The mirror is told to forget drives that are not currently - connected: - - # gmirror forget gm0 - - Any old metadata should be cleared from the replacement - disk using the instructions in - . Then the replacement - disk, ada4 for this example, is inserted - into the mirror: - - # gmirror insert gm0 /dev/ada4 - - Resynchronization begins when the new drive is inserted - into the mirror. This process of copying mirror data to a new - drive can take a while. Performance of the mirror will be - greatly reduced during the copy, so inserting new drives is - best done when there is low demand on the computer. - - Progress can be monitored with gmirror - status, which shows drives that are being - synchronized and the percentage of completion. During - resynchronization, the status will be - DEGRADED, changing to - COMPLETE when the process is - finished. - - - - - - - <acronym>RAID</acronym>3 - 位元級串連與獨立奇偶校驗 - - - - - Mark - Gladman - - Written by - - - - - Daniel - Gerzo - - - - - - - - Tom - Rhodes - - Based on documentation by - - - - - Murray - Stokely - - - - - - - GEOM - - - RAID3 - - - RAID3 is a method used to combine several - disk drives into a single volume with a dedicated parity disk. - In a RAID3 system, data is split up into a - number of bytes that are written across all the drives in the - array except for one disk which acts as a dedicated parity disk. - This means that disk reads from a RAID3 - implementation access all disks in the array. Performance can - be enhanced by using multiple disk controllers. The - RAID3 array provides a fault tolerance of 1 - drive, while providing a capacity of 1 - 1/n times the total - capacity of all drives in the array, where n is the number of - hard drives in the array. Such a configuration is mostly - suitable for storing data of larger sizes such as multimedia - files. - - At least 3 physical hard drives are required to build a - RAID3 array. Each disk must be of the same - size, since I/O requests are interleaved to - read or write to multiple disks in parallel. Also, due to the - nature of RAID3, the number of drives must be - equal to 3, 5, 9, 17, and so on, or 2^n + 1. - - This section demonstrates how to create a software - RAID3 on a FreeBSD system. - - - While it is theoretically possible to boot from a - RAID3 array on FreeBSD, that configuration is - uncommon and is not advised. - - - - 建立 Dedicated <acronym>RAID</acronym>3 陣列 - - In FreeBSD, support for RAID3 is - implemented by the graid38 GEOM - class. Creating a dedicated RAID3 array on - FreeBSD requires the following steps. - - - - First, load the geom_raid3.ko - kernel module by issuing one of the following - commands: - - # graid3 load - - or: - - # kldload geom_raid3 - - - - Ensure that a suitable mount point exists. This - command creates a new directory to use as the mount - point: - - # mkdir /multimedia - - - - Determine the device names for the disks which will be - added to the array, and create the new - RAID3 device. The final device listed - will act as the dedicated parity disk. This example uses - three unpartitioned ATA drives: - ada1 and - ada2 for - data, and - ada3 for - parity. - - # graid3 label -v gr0 /dev/ada1 /dev/ada2 /dev/ada3 -Metadata value stored on /dev/ada1. -Metadata value stored on /dev/ada2. -Metadata value stored on /dev/ada3. -Done. - - - - Partition the newly created gr0 - device and put a UFS file system on - it: - - # gpart create -s GPT /dev/raid3/gr0 -# gpart add -t freebsd-ufs /dev/raid3/gr0 -# newfs -j /dev/raid3/gr0p1 - - Many numbers will glide across the screen, and after a - bit of time, the process will be complete. The volume has - been created and is ready to be mounted: - - # mount /dev/raid3/gr0p1 /multimedia/ - - The RAID3 array is now ready to - use. - - - - Additional configuration is needed to retain this setup - across system reboots. - - - - The geom_raid3.ko module must be - loaded before the array can be mounted. To automatically - load the kernel module during system initialization, add - the following line to - /boot/loader.conf: - - geom_raid3_load="YES" - - - - The following volume information must be added to - /etc/fstab in order to - automatically mount the array's file system during the - system boot process: - - /dev/raid3/gr0p1 /multimedia ufs rw 2 2 - - - - - - - - 軟體 <acronym>RAID</acronym> 裝置 - - - - - Warren - Block - - Originally contributed by - - - - - - GEOM - - - Software RAID Devices - Hardware-assisted RAID - - - Some motherboards and expansion cards add some simple - hardware, usually just a ROM, that allows the - computer to boot from a RAID array. After - booting, access to the RAID array is handled - by software running on the computer's main processor. This - hardware-assisted software - RAID gives RAID - arrays that are not dependent on any particular operating - system, and which are functional even before an operating system - is loaded. - - Several levels of RAID are supported, - depending on the hardware in use. See graid8 for a - complete list. - - graid8 requires the geom_raid.ko - kernel module, which is included in the - GENERIC kernel starting with FreeBSD 9.1. - If needed, it can be loaded manually with - graid load. - - - 建立陣列 - - Software RAID devices often have a menu - that can be entered by pressing special keys when the computer - is booting. The menu can be used to create and delete - RAID arrays. graid8 can also create - arrays directly from the command line. - - graid label is used to create a new - array. The motherboard used for this example has an Intel - software RAID chipset, so the Intel - metadata format is specified. The new array is given a label - of gm0, it is a mirror - (RAID1), and uses drives - ada0 and - ada1. - - - Some space on the drives will be overwritten when they - are made into a new array. Back up existing data - first! - - - # graid label Intel gm0 RAID1 ada0 ada1 -GEOM_RAID: Intel-a29ea104: Array Intel-a29ea104 created. -GEOM_RAID: Intel-a29ea104: Disk ada0 state changed from NONE to ACTIVE. -GEOM_RAID: Intel-a29ea104: Subdisk gm0:0-ada0 state changed from NONE to ACTIVE. -GEOM_RAID: Intel-a29ea104: Disk ada1 state changed from NONE to ACTIVE. -GEOM_RAID: Intel-a29ea104: Subdisk gm0:1-ada1 state changed from NONE to ACTIVE. -GEOM_RAID: Intel-a29ea104: Array started. -GEOM_RAID: Intel-a29ea104: Volume gm0 state changed from STARTING to OPTIMAL. -Intel-a29ea104 created -GEOM_RAID: Intel-a29ea104: Provider raid/r0 for volume gm0 created. - - A status check shows the new mirror is ready for - use: - - # graid status - Name Status Components -raid/r0 OPTIMAL ada0 (ACTIVE (ACTIVE)) - ada1 (ACTIVE (ACTIVE)) - - The array device appears in - /dev/raid/. The first array is called - r0. Additional arrays, if present, will - be r1, r2, and so - on. - - The BIOS menu on some of these devices - can create arrays with special characters in their names. To - avoid problems with those special characters, arrays are given - simple numbered names like r0. To show - the actual labels, like gm0 in the - example above, use sysctl8: - - # sysctl kern.geom.raid.name_format=1 - - - - 多磁碟區 - - Some software RAID devices support - more than one volume on an array. - Volumes work like partitions, allowing space on the physical - drives to be split and used in different ways. For example, - Intel software RAID devices support two - volumes. This example creates a 40 G mirror for safely - storing the operating system, followed by a 20 G - RAID0 (stripe) volume for fast temporary - storage: - - # graid label -S 40G Intel gm0 RAID1 ada0 ada1 -# graid add -S 20G gm0 RAID0 - - Volumes appear as additional - rX entries - in /dev/raid/. An array with two volumes - will show r0 and - r1. - - See graid8 for the number of volumes supported by - different software RAID devices. - - - - 轉換單一磁碟為鏡像 - - Under certain specific conditions, it is possible to - convert an existing single drive to a graid8 array - without reformatting. To avoid data loss during the - conversion, the existing drive must meet these minimum - requirements: - - - - The drive must be partitioned with the - MBR partitioning scheme. - GPT or other partitioning schemes with - metadata at the end of the drive will be overwritten and - corrupted by the graid8 metadata. - - - - There must be enough unpartitioned and unused space at - the end of the drive to hold the graid8 metadata. - This metadata varies in size, but the largest occupies - 64 M, so at least that much free space is - recommended. - - - - If the drive meets these requirements, start by making a - full backup. Then create a single-drive mirror with that - drive: - - # graid label Intel gm0 RAID1 ada0 NONE - - graid8 metadata was written to the end of the drive - in the unused space. A second drive can now be inserted into - the mirror: - - # graid insert raid/r0 ada1 - - Data from the original drive will immediately begin to be - copied to the second drive. The mirror will operate in - degraded status until the copy is complete. - - - - 插入新磁碟到陣列 - - Drives can be inserted into an array as replacements for - drives that have failed or are missing. If there are no - failed or missing drives, the new drive becomes a spare. For - example, inserting a new drive into a working two-drive mirror - results in a two-drive mirror with one spare drive, not a - three-drive mirror. - - In the example mirror array, data immediately begins to be - copied to the newly-inserted drive. Any existing information - on the new drive will be overwritten. - - # graid insert raid/r0 ada1 -GEOM_RAID: Intel-a29ea104: Disk ada1 state changed from NONE to ACTIVE. -GEOM_RAID: Intel-a29ea104: Subdisk gm0:1-ada1 state changed from NONE to NEW. -GEOM_RAID: Intel-a29ea104: Subdisk gm0:1-ada1 state changed from NEW to REBUILD. -GEOM_RAID: Intel-a29ea104: Subdisk gm0:1-ada1 rebuild start at 0. - - - - 從陣列移除磁碟 - - Individual drives can be permanently removed from a - from an array and their metadata erased: - - # graid remove raid/r0 ada1 -GEOM_RAID: Intel-a29ea104: Disk ada1 state changed from ACTIVE to OFFLINE. -GEOM_RAID: Intel-a29ea104: Subdisk gm0:1-[unknown] state changed from ACTIVE to NONE. -GEOM_RAID: Intel-a29ea104: Volume gm0 state changed from OPTIMAL to DEGRADED. - - - - 停止陣列 - - An array can be stopped without removing metadata from the - drives. The array will be restarted when the system is - booted. - - # graid stop raid/r0 - - - - 檢查陣列狀態 - - Array status can be checked at any time. After a drive - was added to the mirror in the example above, data is being - copied from the original drive to the new drive: - - # graid status - Name Status Components -raid/r0 DEGRADED ada0 (ACTIVE (ACTIVE)) - ada1 (ACTIVE (REBUILD 28%)) - - Some types of arrays, like RAID0 or - CONCAT, may not be shown in the status - report if disks have failed. To see these partially-failed - arrays, add : - - # graid status -ga - Name Status Components -Intel-e2d07d9a BROKEN ada6 (ACTIVE (ACTIVE)) - - - - 刪除陣列 - - Arrays are destroyed by deleting all of the volumes from - them. When the last volume present is deleted, the array is - stopped and metadata is removed from the drives: - - # graid delete raid/r0 - - - - 刪除預期之外的陣列 - - Drives may unexpectedly contain graid8 metadata, - either from previous use or manufacturer testing. - graid8 will detect these drives and create an array, - interfering with access to the individual drive. To remove - the unwanted metadata: - - - - Boot the system. At the boot menu, select - 2 for the loader prompt. Enter: - - OK set kern.geom.raid.enable=0 -OK boot - - The system will boot with graid8 - disabled. - - - - Back up all data on the affected drive. - - - - As a workaround, graid8 array detection - can be disabled by adding - - kern.geom.raid.enable=0 - - to /boot/loader.conf. - - To permanently remove the graid8 metadata - from the affected drive, boot a FreeBSD installation - CD-ROM or memory stick, and select - Shell. Use status - to find the name of the array, typically - raid/r0: - - # graid status - Name Status Components -raid/r0 OPTIMAL ada0 (ACTIVE (ACTIVE)) - ada1 (ACTIVE (ACTIVE)) - - Delete the volume by name: - - # graid delete raid/r0 - - If there is more than one volume shown, repeat the - process for each volume. After the last array has been - deleted, the volume will be destroyed. - - Reboot and verify data, restoring from backup if - necessary. After the metadata has been removed, the - kern.geom.raid.enable=0 entry in - /boot/loader.conf can also be - removed. - - - - - - - <acronym>GEOM</acronym> Gate Network - - GEOM provides a simple mechanism for - providing remote access to devices such as disks, - CDs, and file systems through the use of the - GEOM Gate network daemon, - ggated. The system with the device - runs the server daemon which handles requests made by clients - using ggatec. The devices should not - contain any sensitive data as the connection between the client - and the server is not encrypted. - - Similar to NFS, which is discussed in - , ggated - is configured using an exports file. This file specifies which - systems are permitted to access the exported resources and what - level of access they are offered. For example, to give the - client 192.168.1.5 - read and write access to the fourth slice on the first - SCSI disk, create - /etc/gg.exports with this line: - - 192.168.1.5 RW /dev/da0s4d - - Before exporting the device, ensure it is not currently - mounted. Then, start ggated: - - # ggated - - Several options are available for specifying an alternate - listening port or changing the default location of the exports - file. Refer to ggated8 for details. - - To access the exported device on the client machine, first - use ggatec to specify the - IP address of the server and the device name - of the exported device. If successful, this command will - display a ggate device name to mount. Mount - that specified device name on a free mount point. This example - connects to the /dev/da0s4d partition on - 192.168.1.1, then mounts - /dev/ggate0 on - /mnt: - - # ggatec create -o rw 192.168.1.1 /dev/da0s4d -ggate0 -# mount /dev/ggate0 /mnt - - The device on the server may now be accessed through - /mnt on the client. For more details about - ggatec and a few usage examples, refer to - ggatec8. - - - The mount will fail if the device is currently mounted on - either the server or any other client on the network. If - simultaneous access is needed to network resources, use - NFS instead. - - - When the device is no longer needed, unmount it with - umount so that the resource is available to - other clients. - - - - 磁碟裝置標籤 - - - GEOM - - - Disk Labels - - - During system initialization, the FreeBSD kernel creates - device nodes as devices are found. This method of probing for - devices raises some issues. For instance, what if a new disk - device is added via USB? It is likely that - a flash device may be handed the device name of - da0 and the original - da0 shifted to - da1. This will cause issues mounting - file systems if they are listed in - /etc/fstab which may also prevent the - system from booting. - - One solution is to chain SCSI devices - in order so a new device added to the SCSI - card will be issued unused device numbers. But what about - USB devices which may replace the primary - SCSI disk? This happens because - USB devices are usually probed before the - SCSI card. One solution is to only insert - these devices after the system has been booted. Another method - is to use only a single ATA drive and never - list the SCSI devices in - /etc/fstab. - - A better solution is to use glabel to - label the disk devices and use the labels in - /etc/fstab. Because - glabel stores the label in the last sector of - a given provider, the label will remain persistent across - reboots. By using this label as a device, the file system may - always be mounted regardless of what device node it is accessed - through. - - - glabel can create both transient and - permanent labels. Only permanent labels are consistent across - reboots. Refer to glabel8 for more information on the - differences between labels. - - - - 標籤類型與範例 - - Permanent labels can be a generic or a file system label. - Permanent file system labels can be created with - tunefs8 or newfs8. These types of labels are - created in a sub-directory of /dev, and - will be named according to the file system type. For example, - UFS2 file system labels will be created in - /dev/ufs. Generic permanent labels can - be created with glabel label. These are - not file system specific and will be created in - /dev/label. - - Temporary labels are destroyed at the next reboot. These - labels are created in /dev/label and are - suited to experimentation. A temporary label can be created - using glabel create. - - - - To create a permanent label for a - UFS2 file system without destroying any - data, issue the following command: - - # tunefs -L home /dev/da3 - - A label should now exist in /dev/ufs - which may be added to /etc/fstab: - - /dev/ufs/home /home ufs rw 2 2 - - - The file system must not be mounted while attempting - to run tunefs. - - - Now the file system may be mounted: - - # mount /home - - From this point on, so long as the - geom_label.ko kernel module is loaded at - boot with /boot/loader.conf or the - GEOM_LABEL kernel option is present, - the device node may change without any ill effect on the - system. - - File systems may also be created with a default label - by using the flag with - newfs. Refer to newfs8 for - more information. - - The following command can be used to destroy the - label: - - # glabel destroy home - - The following example shows how to label the partitions of - a boot disk. - - - 在開機磁碟標記分割區標籤 - - By permanently labeling the partitions on the boot disk, - the system should be able to continue to boot normally, even - if the disk is moved to another controller or transferred to - a different system. For this example, it is assumed that a - single ATA disk is used, which is - currently recognized by the system as - ad0. It is also assumed that the - standard FreeBSD partition scheme is used, with - /, - /var, - /usr and - /tmp, as - well as a swap partition. - - Reboot the system, and at the loader8 prompt, - press 4 to boot into single user mode. - Then enter the following commands: - - # glabel label rootfs /dev/ad0s1a -GEOM_LABEL: Label for provider /dev/ad0s1a is label/rootfs -# glabel label var /dev/ad0s1d -GEOM_LABEL: Label for provider /dev/ad0s1d is label/var -# glabel label usr /dev/ad0s1f -GEOM_LABEL: Label for provider /dev/ad0s1f is label/usr -# glabel label tmp /dev/ad0s1e -GEOM_LABEL: Label for provider /dev/ad0s1e is label/tmp -# glabel label swap /dev/ad0s1b -GEOM_LABEL: Label for provider /dev/ad0s1b is label/swap -# exit - - The system will continue with multi-user boot. After - the boot completes, edit /etc/fstab and - replace the conventional device names, with their respective - labels. The final /etc/fstab will - look like this: - - # Device Mountpoint FStype Options Dump Pass# -/dev/label/swap none swap sw 0 0 -/dev/label/rootfs / ufs rw 1 1 -/dev/label/tmp /tmp ufs rw 2 2 -/dev/label/usr /usr ufs rw 2 2 -/dev/label/var /var ufs rw 2 2 - - The system can now be rebooted. If everything went - well, it will come up normally and mount - will show: - - # mount -/dev/label/rootfs on / (ufs, local) -devfs on /dev (devfs, local) -/dev/label/tmp on /tmp (ufs, local, soft-updates) -/dev/label/usr on /usr (ufs, local, soft-updates) -/dev/label/var on /var (ufs, local, soft-updates) - - - The glabel8 class - supports a label type for UFS file - systems, based on the unique file system id, - ufsid. These labels may be found in - /dev/ufsid and are - created automatically during system startup. It is possible - to use ufsid labels to mount partitions - using /etc/fstab. Use glabel - status to receive a list of file systems and their - corresponding ufsid labels: - - % glabel status - Name Status Components -ufsid/486b6fc38d330916 N/A ad4s1d -ufsid/486b6fc16926168e N/A ad4s1f - - In the above example, ad4s1d - represents /var, - while ad4s1f represents - /usr. - Using the ufsid values shown, these - partitions may now be mounted with the following entries in - /etc/fstab: - - /dev/ufsid/486b6fc38d330916 /var ufs rw 2 2 -/dev/ufsid/486b6fc16926168e /usr ufs rw 2 2 - - Any partitions with ufsid labels can be - mounted in this way, eliminating the need to manually create - permanent labels, while still enjoying the benefits of device - name independent mounting. - - - - - UFS Journaling 透過 <acronym>GEOM</acronym> - - - GEOM - - - Journaling - - - Support for journals on - UFS file systems is available on FreeBSD. The - implementation is provided through the GEOM - subsystem and is configured using gjournal. - Unlike other file system journaling implementations, the - gjournal method is block based and not - implemented as part of the file system. It is a - GEOM extension. - - Journaling stores a log of file system transactions, such as - changes that make up a complete disk write operation, before - meta-data and file writes are committed to the disk. This - transaction log can later be replayed to redo file system - transactions, preventing file system inconsistencies. - - This method provides another mechanism to protect against - data loss and inconsistencies of the file system. Unlike Soft - Updates, which tracks and enforces meta-data updates, and - snapshots, which create an image of the file system, a log is - stored in disk space specifically for this task. For better - performance, the journal may be stored on another disk. In this - configuration, the journal provider or storage device should be - listed after the device to enable journaling on. - - The GENERIC kernel provides support for - gjournal. To automatically load the - geom_journal.ko kernel module at boot time, - add the following line to - /boot/loader.conf: - - geom_journal_load="YES" - - If a custom kernel is used, ensure the following line is in - the kernel configuration file: - - options GEOM_JOURNAL - - Once the module is loaded, a journal can be created on a new - file system using the following steps. In this example, - da4 is a new SCSI - disk: - - # gjournal load -# gjournal label /dev/da4 - - This will load the module and create a - /dev/da4.journal device node on - /dev/da4. - - A UFS file system may now be created on - the journaled device, then mounted on an existing mount - point: - - # newfs -O 2 -J /dev/da4.journal -# mount /dev/da4.journal /mnt - - - In the case of several slices, a journal will be created - for each individual slice. For instance, if - ad4s1 and ad4s2 are - both slices, then gjournal will create - ad4s1.journal and - ad4s2.journal. - - - Journaling may also be enabled on current file systems by - using tunefs. However, - always make a backup before attempting to - alter an existing file system. In most cases, - gjournal will fail if it is unable to create - the journal, but this does not protect against data loss - incurred as a result of misusing tunefs. - Refer to gjournal8 and tunefs8 for more - information about these commands. - - It is possible to journal the boot disk of a FreeBSD system. - Refer to the article Implementing UFS - Journaling on a Desktop PC for detailed - instructions. - - - - - - - - - - Z 檔案系統 (<acronym>ZFS</acronym>) - - - - - Tom - Rhodes - - Written by - - - - Allan - Jude - - Written by - - - - Benedict - Reuschling - - Written by - - - - Warren - Block - - Written by - - - - - Z 檔案系統ZFS 是設計來克服許多在以往設計中發現的主要問題的一個先進的檔案系統。 - - 最初由 Sun 所開發,後來的開放源始碼 ZFS 開發已移到 OpenZFS 計劃。 - - ZFS 的設計目標主要有三個: - - - - 資料完整性:所有資料都會有一個資料的校驗碼 (checksum),資料寫入時會計算校驗碼然後一併寫入,往後讀取資料時會再計算一次校驗碼,若校驗碼與當初寫入時不相符,便可偵測到資料錯誤,此時若有可用的資料備援 (Data redundancy),ZFS 會嘗試自動修正錯誤。 - - - - 儲存池:實體的儲存裝置都會先被加入到一個儲存池 (Pool),這個共用的儲存池可用來配置儲存空間,儲存池的空間可被所有的檔案系統使用且透過加入新的儲存裝置來增加空間。 - - - - 效能:提供多個快取機制來增加效能。先進、以記憶體為基礎的讀取快取可使用 ARC。第二層以磁碟為基礎的讀取快取可使用 L2ARC,以磁碟為基礎的同步寫入快取則可使用 ZIL。 - - - - 完整的功能清單與術語在 中有詳述。 - - - 什麼使 <acronym>ZFS</acronym> 與眾不同 - - ZFS 與以往任何的檔案系統有顯著的不同,因為它不只是一個檔案系統,ZFS 的獨特優點來自結合了以往被分開的磁碟區管理程式 (Volume Manager) 及檔案系統兩個角色,讓檔案系統也能夠察覺磁碟底層結構的變動。傳統在一個磁碟上只能建立一個檔案系統,若有兩個磁碟則會需要建立兩個分開的檔案系統,在傳統要解決這個問題要使用硬體 RAID 來製作一個空間實際上由數顆實體磁碟所組成的單一的邏輯磁碟給作業系統,作業系統便可在這個邏輯磁碟上放置檔案系統,即使是在那些使用 GEOM 提供的軟體 RAID 解決方案也是一樣,把 UFS 檔案系統放在 RAID Transform 上面當做是一個單一的裝置。ZFS 結合了磁碟區管理程式 (Volume Manager) 與檔案系統來解決這個問題並讓建立多個檔案系統可以共用一個儲存池 (Pool)。ZFS 最大的優點是可以察覺實體磁碟配置的變動,當有額外的磁碟加入到儲存池時可以自動擴增現有的檔案系統,所有的檔案系統便可使用這個新的空間。ZFS 也有數個不同的屬性可以套用到各別檔案系統上,比起單一檔案系統,對建立數個不同檔案系統與資料集 (Dataset) 時有許多的好處。 - - - - 快速入門指南 - - 這裡有一個啟動機制,可讓 FreeBSD 在系統初始化時掛載 ZFS 儲存池。要開啟這個功能,可加入此行到 /etc/rc.conf - - zfs_enable="YES" - - 然後啟動服務: - - # service zfs start - - 本節的例子會假設有三個 SCSI 磁碟,名稱分別為 da0, da1da2SATA 硬體的使用者裝置名稱改為 ada - - - 單磁碟儲存池 - - 要使用一個磁碟裝置建立一個簡單、無備援的儲存池可: - - # zpool create example /dev/da0 - - 要檢視這個新的儲存池,可查看 df 的輸出結果: - - # df -Filesystem 1K-blocks Used Avail Capacity Mounted on -/dev/ad0s1a 2026030 235230 1628718 13% / -devfs 1 1 0 100% /dev -/dev/ad0s1d 54098308 1032846 48737598 2% /usr -example 17547136 0 17547136 0% /example - - 這個輸出結果說明 example 儲存池已建立且被掛載,現在已經可以作為檔案系統存取,可以在上面建立檔案且使用者可以瀏覽: - - # cd /example -# ls -# touch testfile -# ls -al -total 4 -drwxr-xr-x 2 root wheel 3 Aug 29 23:15 . -drwxr-xr-x 21 root wheel 512 Aug 29 23:12 .. --rw-r--r-- 1 root wheel 0 Aug 29 23:15 testfile - - 但是,這個儲存池並未運用到任何 ZFS 功能,若要在這個儲存池上建立一個有開啟壓縮功能的資料集: - - # zfs create example/compressed -# zfs set compression=gzip example/compressed - - example/compressed 資料集現在是一個 ZFS 壓縮的檔案系統,可以試著複製較大的檔案到 /example/compressed - - 壓縮功能也可以使用以下指令關閉: - - # zfs set compression=off example/compressed - - 要卸載檔案系統,使用 zfs umount 然後再使用 df 確認: - - # zfs umount example/compressed -# df -Filesystem 1K-blocks Used Avail Capacity Mounted on -/dev/ad0s1a 2026030 235232 1628716 13% / -devfs 1 1 0 100% /dev -/dev/ad0s1d 54098308 1032864 48737580 2% /usr -example 17547008 0 17547008 0% /example - - 要重新掛載檔案系統以便再次使用,使用 zfs mount 然後以 df 檢查: - - # zfs mount example/compressed -# df -Filesystem 1K-blocks Used Avail Capacity Mounted on -/dev/ad0s1a 2026030 235234 1628714 13% / -devfs 1 1 0 100% /dev -/dev/ad0s1d 54098308 1032864 48737580 2% /usr -example 17547008 0 17547008 0% /example -example/compressed 17547008 0 17547008 0% /example/compressed - - 儲存池與檔案系統也可以從 mount 的結果查詢到: - - # mount -/dev/ad0s1a on / (ufs, local) -devfs on /dev (devfs, local) -/dev/ad0s1d on /usr (ufs, local, soft-updates) -example on /example (zfs, local) -example/compressed on /example/compressed (zfs, local) - - 在建立之後,ZFS 的資料集可如同其他檔案系統一般使用,且有許多額外功能可在每個資料集上設定。例如,建立一個預計存放重要的資料的新檔案系統 data,要設定每個資料區塊 (Data block) 要保留兩份備份: - - # zfs create example/data -# zfs set copies=2 example/data - - 現在,可以使用 df 指令來查看資料與空間的使用率: - - # df -Filesystem 1K-blocks Used Avail Capacity Mounted on -/dev/ad0s1a 2026030 235234 1628714 13% / -devfs 1 1 0 100% /dev -/dev/ad0s1d 54098308 1032864 48737580 2% /usr -example 17547008 0 17547008 0% /example -example/compressed 17547008 0 17547008 0% /example/compressed -example/data 17547008 0 17547008 0% /example/data - - 注意,從這個可以發現每個在儲存池上的檔案系統都擁有相同的可用空間,這是為什麼要在這些範例使用 df 的原因,為了要顯示檔案系統只會用它們所需要使用到的空間,且均取自同一個儲存池。ZFS 淘汰了磁碟區 (Volume) 與分割區 (Partition) 的概念,且允許多個檔案系統共用相同的儲存池。 - - 不需要使用時可摧毀檔案系統後再摧毀儲存池: - - # zfs destroy example/compressed -# zfs destroy example/data -# zpool destroy example - - - - RAID-Z - - 磁碟損壞時,要避免資料因磁碟故障造成遺失便是使用 RAIDZFS 在它的儲存池設計中支援了這項功能。RAID-Z 儲存池需要使用三個或更多的磁碟,但可以提供比鏡像 (Mirror) 儲存池更多的可用空間。 - - 這個例子會建立一個 RAID-Z 儲存池,並指定要加入這個儲存池的磁碟: - - # zpool create storage raidz da0 da1 da2 - - - Sun 建議用在 RAID-Z 設定的裝置數在三到九個之間。若需要由 10 個或更多磁碟組成單一儲存池的環境,可考慮分成較小的 RAID-Z 群組。若只有兩個可用的磁碟且需要做備援 (Redundancy),可考慮使用 ZFS 鏡像 (Mirror)。請參考 zpool8 取得更多詳細資訊。 - - - 先前的例子已經建立了 storage 儲存池 (zpool),現在這個例子會在該儲存池中建立一個新的檔案系統,名稱為 home - - # zfs create storage/home - - 可以設定開啟壓縮及保留目錄及檔案額外備份的功能: - - # zfs set copies=2 storage/home -# zfs set compression=gzip storage/home - - 要讓這個空間作為使用者的新家目錄位置,需複製使用者資料到這個目錄並建立適合的符號連結 (Symbolic link): - - # cp -rp /home/* /storage/home -# rm -rf /home /usr/home -# ln -s /storage/home /home -# ln -s /storage/home /usr/home - - 現在使用者的資料會儲存在新建立的 /storage/home,可以加入新使用者並登入該使用者來測試。 - - 試著建立檔案系統快照 (Snapshot),稍後可用來還原 (Rollback): - - # zfs snapshot storage/home@08-30-08 - - 快照只可以使用整個檔案系統製作,無法使用各別目錄或檔案。 - - @ 字元用來區隔檔案系統名稱 (File system) 或磁碟區 (Volume) 名稱,若有重要的目錄意外被刪除,檔案系統可以備份然後還原到先前目錄還存在時的快照 (Snapshot): - - # zfs rollback storage/home@08-30-08 - - 要列出所有可用的快照,可在檔案系統的 .zfs/snapshot 目錄執行 ls,舉例來說,要查看先前已做的快照: - - # ls /storage/home/.zfs/snapshot - - 也可以寫一個 Script 來對使用者資料做例行性的快照,但隨著時間快照可能消耗大量的磁碟空間。先前的快照可以使用指令移除: - - # zfs destroy storage/home@08-30-08 - - 在測試之後,便可讓 /storage/home 成為真正的 /home 使用此指令: - - # zfs set mountpoint=/home storage/home - - 執行 dfmount 來確認系統現在是否以把檔案系統做為真正的 /home - - # mount -/dev/ad0s1a on / (ufs, local) -devfs on /dev (devfs, local) -/dev/ad0s1d on /usr (ufs, local, soft-updates) -storage on /storage (zfs, local) -storage/home on /home (zfs, local) -# df -Filesystem 1K-blocks Used Avail Capacity Mounted on -/dev/ad0s1a 2026030 235240 1628708 13% / -devfs 1 1 0 100% /dev -/dev/ad0s1d 54098308 1032826 48737618 2% /usr -storage 26320512 0 26320512 0% /storage -storage/home 26320512 0 26320512 0% /home - - 這個動作完成 RAID-Z 最後的設定,有關已建立的檔案系統每日狀態更新可以做為 periodic8 的一部份在每天晚上執行。加入此行到 /etc/periodic.conf - - daily_status_zfs_enable="YES" - - - - 復原 <acronym>RAID-Z</acronym> - - 每個軟體 RAID 都有監控其狀態 (state) 的方式,而 RAID-Z 裝置的狀態可以使用這個指令來查看: - - # zpool status -x - - 如果所有儲存池為上線 (Online) 且正常,則訊息會顯示: - - all pools are healthy - - 如果有發生問題,可能磁碟會呈現離線 (Offline) 的狀態,此時儲存池的狀態會是: - - pool: storage - state: DEGRADED -status: One or more devices has been taken offline by the administrator. - Sufficient replicas exist for the pool to continue functioning in a - degraded state. -action: Online the device using 'zpool online' or replace the device with - 'zpool replace'. - scrub: none requested -config: - - NAME STATE READ WRITE CKSUM - storage DEGRADED 0 0 0 - raidz1 DEGRADED 0 0 0 - da0 ONLINE 0 0 0 - da1 OFFLINE 0 0 0 - da2 ONLINE 0 0 0 - -errors: No known data errors - - 這代表著裝置在之前被管理者使用此指令拿下線: - - # zpool offline storage da1 - - 現在系統可以關機然後更換 da1,當系統恢復上線,則可以替換掉儲存池中故障的磁碟: - - # zpool replace storage da1 - - 到這裡,可以再檢查狀態一次,這時不需使用 參數來顯示所有的儲存池: - - # zpool status storage - pool: storage - state: ONLINE - scrub: resilver completed with 0 errors on Sat Aug 30 19:44:11 2008 -config: - - NAME STATE READ WRITE CKSUM - storage ONLINE 0 0 0 - raidz1 ONLINE 0 0 0 - da0 ONLINE 0 0 0 - da1 ONLINE 0 0 0 - da2 ONLINE 0 0 0 - -errors: No known data errors - - 在這個例子中,所有的磁碟均已正常運作。 - - - - 資料檢驗 - - ZFS 使用校驗碼 (Checksum) 來檢驗資料的完整性 (Integrity),會在建立檔案系統時便自動開啟。 - - - 校驗碼 (Checksum) 可以關閉,但並建議!校驗碼只會使用非常少的儲存空間來確保資料的完整性。若關閉校驗碼會使許多 ZFS 功能無法正常運作,且關閉校驗碼對並不會明顯的改善效能。 - - - 檢驗校驗碼這個動作即所謂的清潔 (Scrub),可以使用以下指令來檢驗 storage 儲存池的資料完整性: - - # zpool scrub storage - - 清潔所需要的時間依儲存的資料量而定,較大的資料量相對會需要花費較長的時間來檢驗。清潔會對 I/O 有非常密集的操作且一次只能進行一個清潔動作。在清潔完成之後,可以使用 status 來查看狀態: - - # zpool status storage - pool: storage - state: ONLINE - scrub: scrub completed with 0 errors on Sat Jan 26 19:57:37 2013 -config: - - NAME STATE READ WRITE CKSUM - storage ONLINE 0 0 0 - raidz1 ONLINE 0 0 0 - da0 ONLINE 0 0 0 - da1 ONLINE 0 0 0 - da2 ONLINE 0 0 0 - -errors: No known data errors - - 查詢結果會顯示上次完成清潔的時間來協助追蹤是否要再做清潔。定期清潔可以協助保護資料不會默默損壞且確保儲存池的完整性。 - - 請參考 zfs8zpool8 來取得其他 ZFS 選項。 - - - - - <command>zpool</command> 管理 - - ZFS 管理分成兩個主要的工具。zpool 工具用來控制儲存池的運作並可處理磁碟的新增、移除、更換與管理。zfs 工具用來建立、摧毀與管理檔案系統 (File system) 與磁碟區 (Volume) 的資料集。 - - - 建立與摧毀儲存池 - - 建立 ZFS 儲存池 (zpool) 要做幾個涉及長遠規劃的決定,因為建立儲存池之後便無法再更改儲存池的結構。最重要的決定是要使用那一種型態的 vdev 來將實體磁碟設為同一群組。請參考 vdev 型態 的清單來取得有關可用選項的詳細資訊。大部份的 vdev 型態不允許在建立儲存池之後再加入額外的磁碟,鏡像 (Mirror) 是可以允許加入額外的磁碟到 vdev 的其中一個例外,另一個則是串連 (Stripe),可以加入額外的磁碟到 vdev 來升級為鏡像。雖然可以加入額外的 vdev 來擴充儲存池,但儲存池的配置在建立之後便無法更改,若要要更改,則必須先備份資料,把儲存池摧毀後再重新建立。 - - 建立一個簡單的鏡像儲存池: - - # zpool create mypool mirror /dev/ada1 /dev/ada2 -# zpool status - pool: mypool - state: ONLINE - scan: none requested -config: - - NAME STATE READ WRITE CKSUM - mypool ONLINE 0 0 0 - mirror-0 ONLINE 0 0 0 - ada1 ONLINE 0 0 0 - ada2 ONLINE 0 0 0 - -errors: No known data errors - - 可以一次建立數個 vdev,磁碟群組間使用 vdev 型態關鍵字來區隔,在這個例子使用 mirror - - # zpool create mypool mirror /dev/ada1 /dev/ada2 mirror /dev/ada3 /dev/ada4 - pool: mypool - state: ONLINE - scan: none requested -config: - - NAME STATE READ WRITE CKSUM - mypool ONLINE 0 0 0 - mirror-0 ONLINE 0 0 0 - ada1 ONLINE 0 0 0 - ada2 ONLINE 0 0 0 - mirror-1 ONLINE 0 0 0 - ada3 ONLINE 0 0 0 - ada4 ONLINE 0 0 0 - -errors: No known data errors - - 儲存池也可以不使用整個磁碟而改使用分割區 (Partition) 來建立。把 ZFS 放到不同的分割區可讓同一個磁碟有其他的分割區可做其他用途,尤其是有 Bootcode 與檔案系統要用來開機的分割區,這讓磁碟可以用來開機也同樣可以做為儲存池的一部份。在 FreeBSD 用分割區來替代整個磁碟並不會對效能有影響。使用分割區也讓管理者可以對磁碟容量做 少算的預備,使用比完整容量少的容量,未來若要替換的磁碟號稱與原磁碟相同,但實際上卻比較小時,也可符合這個較小的分割區容量,以使用替換的磁碟。 - - 使用分割區建立一個 RAID-Z2 儲存池: - - # zpool create mypool raidz2 /dev/ada0p3 /dev/ada1p3 /dev/ada2p3 /dev/ada3p3 /dev/ada4p3 /dev/ada5p3 -# zpool status - pool: mypool - state: ONLINE - scan: none requested -config: - - NAME STATE READ WRITE CKSUM - mypool ONLINE 0 0 0 - raidz2-0 ONLINE 0 0 0 - ada0p3 ONLINE 0 0 0 - ada1p3 ONLINE 0 0 0 - ada2p3 ONLINE 0 0 0 - ada3p3 ONLINE 0 0 0 - ada4p3 ONLINE 0 0 0 - ada5p3 ONLINE 0 0 0 - -errors: No known data errors - - 不需使用的儲存池可以摧毀,來讓磁碟可以再次使用。摧毀一個儲存池要先卸載所有該儲存池的資料集。若資料集在使用中,卸載的操作會失敗且儲存池不會被摧毀。儲存池的摧毀可以使用 來強制執行,但這可能造成那些有開啟這些資料集之中檔案的應用程式無法辨識的行為。 - - - - 加入與移除裝置 - - 加入磁碟到儲存池 (zpool) 會有兩種情形:使用 zpool attach 加入一個磁碟到既有的 vdev,或使用 zpool add 加入 vdev 到儲存池。只有部份 vdev 型態 允許在 vdev 建立之後加入磁碟。 - - 由單一磁碟所建立的儲存池缺乏備援 (Redundancy) 功能,可以偵測到資料的損壞但無法修復,因為資料沒有其他備份可用。備份數 (Copies) 屬性可以讓您從較小的故障中復原,如磁碟壞軌 (Bad sector),但無法提供與鏡像或 RAID-Z 同樣層級的保護。由單一磁碟所建立的儲存池可以使用 zpool attach 來加入額外的磁碟到 vdev,來建立鏡像。zpool attach 也可用來加入額外的磁碟到鏡像群組,來增加備援與讀取效率。若使用的磁碟已有分割區,可以複製該磁碟的分割區配置到另一個,使用 gpart backupgpart restore 可讓這件事變的很簡單。 - - 加入 ada1p3 來升級單一磁碟串連 (stripe) vdev ada0p3 採用鏡像型態 (mirror): - - # zpool status - pool: mypool - state: ONLINE - scan: none requested -config: - - NAME STATE READ WRITE CKSUM - mypool ONLINE 0 0 0 - ada0p3 ONLINE 0 0 0 - -errors: No known data errors -# zpool attach mypool ada0p3 ada1p3 -Make sure to wait until resilver is done before rebooting. - -If you boot from pool 'mypool', you may need to update -boot code on newly attached disk 'ada1p3'. - -Assuming you use GPT partitioning and 'da0' is your new boot disk -you may use the following command: - - gpart bootcode -b /boot/pmbr -p /boot/gptzfsboot -i 1 da0 -# gpart bootcode -b /boot/pmbr -p /boot/gptzfsboot -i 1 ada1 -bootcode written to ada1 -# zpool status - pool: mypool - state: ONLINE -status: One or more devices is currently being resilvered. The pool will - continue to function, possibly in a degraded state. -action: Wait for the resilver to complete. - scan: resilver in progress since Fri May 30 08:19:19 2014 - 527M scanned out of 781M at 47.9M/s, 0h0m to go - 527M resilvered, 67.53% done -config: - - NAME STATE READ WRITE CKSUM - mypool ONLINE 0 0 0 - mirror-0 ONLINE 0 0 0 - ada0p3 ONLINE 0 0 0 - ada1p3 ONLINE 0 0 0 (resilvering) - -errors: No known data errors -# zpool status - pool: mypool - state: ONLINE - scan: resilvered 781M in 0h0m with 0 errors on Fri May 30 08:15:58 2014 -config: - - NAME STATE READ WRITE CKSUM - mypool ONLINE 0 0 0 - mirror-0 ONLINE 0 0 0 - ada0p3 ONLINE 0 0 0 - ada1p3 ONLINE 0 0 0 - -errors: No known data errors - - 若不想選擇加入磁碟到既有的 vdev ,對 RAID-Z 來說,可選擇另一種方式,便是加入另一個 vdev 到儲存池。額外的 vdev 可以提供更高的效能,分散寫入資料到 vdev 之間,每個 vdev 會負責自己的備援。也可以混合使用不同的 vdev 型態,但並不建議,例如混合使用 mirrorRAID-Z,加入一個無備援的 vdev 到一個含有 mirror 或 RAID-Z vdev 的儲存池會讓資料損壞的風險擴大整個儲存池,由於會分散寫入資料,若在無備援的磁碟上發生故障的結果便是遺失大半寫到儲存池的資料區塊。 - - 在每個 vdev 間的資料是串連的,例如,有兩個 mirror vdev,便跟 RAID 10 一樣在兩個 mirror 間分散寫入資料,且會做空間的分配,因此 vdev 會在同時達到全滿 100% 的用量。若 vdev 間的可用空間量不同則會影響到效能,因為資料量會不成比例的寫入到使用量較少的 vdev。 - - 當連接額外的裝置到一個可以開機的儲存池,要記得更新 Bootcode。 - - 連接第二個 mirror 群組 (ada2p3ada3p3) 到既有的 mirror: - - # zpool status - pool: mypool - state: ONLINE - scan: resilvered 781M in 0h0m with 0 errors on Fri May 30 08:19:35 2014 -config: - - NAME STATE READ WRITE CKSUM - mypool ONLINE 0 0 0 - mirror-0 ONLINE 0 0 0 - ada0p3 ONLINE 0 0 0 - ada1p3 ONLINE 0 0 0 - -errors: No known data errors -# zpool add mypool mirror ada2p3 ada3p3 -# gpart bootcode -b /boot/pmbr -p /boot/gptzfsboot -i 1 ada2 -bootcode written to ada2 -# gpart bootcode -b /boot/pmbr -p /boot/gptzfsboot -i 1 ada3 -bootcode written to ada3 -# zpool status - pool: mypool - state: ONLINE - scan: scrub repaired 0 in 0h0m with 0 errors on Fri May 30 08:29:51 2014 -config: - - NAME STATE READ WRITE CKSUM - mypool ONLINE 0 0 0 - mirror-0 ONLINE 0 0 0 - ada0p3 ONLINE 0 0 0 - ada1p3 ONLINE 0 0 0 - mirror-1 ONLINE 0 0 0 - ada2p3 ONLINE 0 0 0 - ada3p3 ONLINE 0 0 0 - -errors: No known data errors - - 現在已無法從儲存池上移除 vdev,且磁碟只能夠在有足夠備援空間的情況下從 mirror 移除,若在 mirror 群組中只剩下一個磁碟,便會取消 mirror 然後還原為 stripe,若剩下的那個磁碟故障,便會影響到整個儲存池。 - - 從一個三方 mirror 群組移除一個磁碟: - - # zpool status - pool: mypool - state: ONLINE - scan: scrub repaired 0 in 0h0m with 0 errors on Fri May 30 08:29:51 2014 -config: - - NAME STATE READ WRITE CKSUM - mypool ONLINE 0 0 0 - mirror-0 ONLINE 0 0 0 - ada0p3 ONLINE 0 0 0 - ada1p3 ONLINE 0 0 0 - ada2p3 ONLINE 0 0 0 - -errors: No known data errors -# zpool detach mypool ada2p3 -# zpool status - pool: mypool - state: ONLINE - scan: scrub repaired 0 in 0h0m with 0 errors on Fri May 30 08:29:51 2014 -config: - - NAME STATE READ WRITE CKSUM - mypool ONLINE 0 0 0 - mirror-0 ONLINE 0 0 0 - ada0p3 ONLINE 0 0 0 - ada1p3 ONLINE 0 0 0 - -errors: No known data errors - - - - 檢查儲存池狀態 - - 儲存池的狀態很重要,若有磁碟機離線或偵測到讀取、寫入或校驗碼 (Checksum) 錯誤,對應的錯誤計數便會增加。status 會顯示儲存池中每一個磁碟機的設定與狀態及整個儲存池的狀態。需要處置的方式與有關最近清潔 (Scrub) 的詳細資訊也會一併顯示。 - - # zpool status - pool: mypool - state: ONLINE - scan: scrub repaired 0 in 2h25m with 0 errors on Sat Sep 14 04:25:50 2013 -config: - - NAME STATE READ WRITE CKSUM - mypool ONLINE 0 0 0 - raidz2-0 ONLINE 0 0 0 - ada0p3 ONLINE 0 0 0 - ada1p3 ONLINE 0 0 0 - ada2p3 ONLINE 0 0 0 - ada3p3 ONLINE 0 0 0 - ada4p3 ONLINE 0 0 0 - ada5p3 ONLINE 0 0 0 - -errors: No known data errors - - - - 清除錯誤 - - 當偵測到錯誤發生,讀取、寫入或校驗碼 (Checksum) 的計數便會增加。使用 zpool clear mypool 可以清除錯誤訊息及重置計數。清空錯誤狀態對當儲存池發生錯誤要使用自動化 Script 通知的管理者來說會很重要,因在舊的錯誤尚未清除前不會回報後續的錯誤。 - - - - 更換運作中的裝置 - - 可能有一些情況會需要更換磁碟為另一個磁碟,當要更換運作中的磁碟,此程序會維持舊有的磁碟在更換的過程為上線的狀態,儲存池不會進入降級 (Degraded) 的狀態,來減少資料遺失的風險。zpool replace 會複製所有舊磁碟的資料到新磁碟,操作完成之後舊磁碟便會與 vdev 中斷連線。若新磁碟容量較舊磁碟大,也可以會增加儲存池來使用新的空間,請參考 擴增儲存池。 - - 更換儲存池中正在運作的狀置: - - # zpool status - pool: mypool - state: ONLINE - scan: none requested -config: - - NAME STATE READ WRITE CKSUM - mypool ONLINE 0 0 0 - mirror-0 ONLINE 0 0 0 - ada0p3 ONLINE 0 0 0 - ada1p3 ONLINE 0 0 0 - -errors: No known data errors -# zpool replace mypool ada1p3 ada2p3 -Make sure to wait until resilver is done before rebooting. - -If you boot from pool 'zroot', you may need to update -boot code on newly attached disk 'ada2p3'. - -Assuming you use GPT partitioning and 'da0' is your new boot disk -you may use the following command: - - gpart bootcode -b /boot/pmbr -p /boot/gptzfsboot -i 1 da0 -# gpart bootcode -b /boot/pmbr -p /boot/gptzfsboot -i 1 ada2 -# zpool status - pool: mypool - state: ONLINE -status: One or more devices is currently being resilvered. The pool will - continue to function, possibly in a degraded state. -action: Wait for the resilver to complete. - scan: resilver in progress since Mon Jun 2 14:21:35 2014 - 604M scanned out of 781M at 46.5M/s, 0h0m to go - 604M resilvered, 77.39% done -config: - - NAME STATE READ WRITE CKSUM - mypool ONLINE 0 0 0 - mirror-0 ONLINE 0 0 0 - ada0p3 ONLINE 0 0 0 - replacing-1 ONLINE 0 0 0 - ada1p3 ONLINE 0 0 0 - ada2p3 ONLINE 0 0 0 (resilvering) - -errors: No known data errors -# zpool status - pool: mypool - state: ONLINE - scan: resilvered 781M in 0h0m with 0 errors on Mon Jun 2 14:21:52 2014 -config: - - NAME STATE READ WRITE CKSUM - mypool ONLINE 0 0 0 - mirror-0 ONLINE 0 0 0 - ada0p3 ONLINE 0 0 0 - ada2p3 ONLINE 0 0 0 - -errors: No known data errors - - - - 處理故障裝置 - - 當儲存池中的磁碟故障,該故障硬碟所屬的 vdev 便會進入降級 (Degraded) 狀態,所有的資料仍可使用,但效能可能會降低,因為遺失的資料必須從可用的備援資料計算才能取得。要將 vdev 恢復完整運作的狀態必須更換故障的實體裝置。然後 ZFS 便會開始修復 (Resilver,古代鏡子的修復稱 Resilver) 作業,會從可用的備援資料計算出故障磁碟中的資料並寫入到替換的裝置上。完成後 vdev 便會重新返回上線 (Online) 的狀態。 - - 若 vdev 沒有任何備援資料或有多個裝置故障,沒有足夠的備援資料可以補償,儲存池便會進入故障 (Faulted) 的狀態。 - - 更換故障的磁碟時,故障磁碟的名稱會更換為裝置的 GUID,若替換裝置要使用相同的裝置名稱,則在 zpool replace 不須加上新裝置名稱參數。 - - 使用 zpool replace 更換故障的磁碟: - - # zpool status - pool: mypool - state: DEGRADED -status: One or more devices could not be opened. Sufficient replicas exist for - the pool to continue functioning in a degraded state. -action: Attach the missing device and online it using 'zpool online'. - see: http://illumos.org/msg/ZFS-8000-2Q - scan: none requested -config: - - NAME STATE READ WRITE CKSUM - mypool DEGRADED 0 0 0 - mirror-0 DEGRADED 0 0 0 - ada0p3 ONLINE 0 0 0 - 316502962686821739 UNAVAIL 0 0 0 was /dev/ada1p3 - -errors: No known data errors -# zpool replace mypool 316502962686821739 ada2p3 -# zpool status - pool: mypool - state: DEGRADED -status: One or more devices is currently being resilvered. The pool will - continue to function, possibly in a degraded state. -action: Wait for the resilver to complete. - scan: resilver in progress since Mon Jun 2 14:52:21 2014 - 641M scanned out of 781M at 49.3M/s, 0h0m to go - 640M resilvered, 82.04% done -config: - - NAME STATE READ WRITE CKSUM - mypool DEGRADED 0 0 0 - mirror-0 DEGRADED 0 0 0 - ada0p3 ONLINE 0 0 0 - replacing-1 UNAVAIL 0 0 0 - 15732067398082357289 UNAVAIL 0 0 0 was /dev/ada1p3/old - ada2p3 ONLINE 0 0 0 (resilvering) - -errors: No known data errors -# zpool status - pool: mypool - state: ONLINE - scan: resilvered 781M in 0h0m with 0 errors on Mon Jun 2 14:52:38 2014 -config: - - NAME STATE READ WRITE CKSUM - mypool ONLINE 0 0 0 - mirror-0 ONLINE 0 0 0 - ada0p3 ONLINE 0 0 0 - ada2p3 ONLINE 0 0 0 - -errors: No known data errors - - - - 清潔儲存池 - - 建議儲存池要定期清潔 (Scrub),最好是每一個月清潔一次。 scrub 作業對磁碟操作非常的密集,在執行時會降低磁碟的效能。在排程 scrub 時避免在使用高峰的時期,或使用 vfs.zfs.scrub_delay 來調整 scrub 的相對優先權來避免影響其他的工作。 - - # zpool scrub mypool -# zpool status - pool: mypool - state: ONLINE - scan: scrub in progress since Wed Feb 19 20:52:54 2014 - 116G scanned out of 8.60T at 649M/s, 3h48m to go - 0 repaired, 1.32% done -config: - - NAME STATE READ WRITE CKSUM - mypool ONLINE 0 0 0 - raidz2-0 ONLINE 0 0 0 - ada0p3 ONLINE 0 0 0 - ada1p3 ONLINE 0 0 0 - ada2p3 ONLINE 0 0 0 - ada3p3 ONLINE 0 0 0 - ada4p3 ONLINE 0 0 0 - ada5p3 ONLINE 0 0 0 - -errors: No known data errors - - 若發生需要取消清潔作業的事,可以下 zpool scrub -s mypool - - - - 自我修復 - - 校驗碼 (Checksum) 會隨資料區塊一併儲存,這使得檔案系統可以做到自我修復。這個功能可以在校驗碼與儲存池中的另一個裝置不同時自動修復資料。舉例來說,有兩個磁碟做鏡像 (Mirror),其中一個磁碟機開始失常並無法正常儲存資料,甚至是資料放在長期封存的儲存裝置上,已經很久沒有被存取。傳統的檔案系統需要執行演算法來檢查並修復資料如 fsck8,這些指令耗費時間,且在嚴重時需要管理者手動決定要做那一種修復操作。當 ZFS 偵測到資料區塊的校驗碼不對時,它除了把資料交給需要的應用程式外,也會修正在磁碟上錯誤的資料。這件事不需要與系統管理者作任何互動便會在一般的儲存池操作時完成。 - - 接下來的例子會示範自我修復會如何運作。建立一個使用磁碟 /dev/ada0/dev/ada1 做鏡像的儲存池。 - - # zpool create healer mirror /dev/ada0 /dev/ada1 -# zpool status healer - pool: healer - state: ONLINE - scan: none requested -config: - - NAME STATE READ WRITE CKSUM - healer ONLINE 0 0 0 - mirror-0 ONLINE 0 0 0 - ada0 ONLINE 0 0 0 - ada1 ONLINE 0 0 0 - -errors: No known data errors -# zpool list -NAME SIZE ALLOC FREE CKPOINT EXPANDSZ FRAG CAP DEDUP HEALTH ALTROOT -healer 960M 92.5K 960M - - 0% 0% 1.00x ONLINE - - - 將部份需要使用自我修復功能來保護的重要資料複製到該儲存池,建立一個儲存池的校驗碼供稍後做比較時使用。 - - # cp /some/important/data /healer -# zfs list -NAME SIZE ALLOC FREE CAP DEDUP HEALTH ALTROOT -healer 960M 67.7M 892M 7% 1.00x ONLINE - -# sha1 /healer > checksum.txt -# cat checksum.txt -SHA1 (/healer) = 2753eff56d77d9a536ece6694bf0a82740344d1f - - 寫入隨機的資料到鏡像的第一個磁碟來模擬資料損毀的情況。要避免 ZFS 偵測到錯誤時馬上做修復,接著要將儲存池匯出,待模擬資料損毀之後再匯入。 - - - 這是一個危險的操作,會破壞重要的資料。在這裡使用僅為了示範用,不應在儲存池正常運作時嘗試使用,也不應將這個故意損壞資料的例子用在任何其他的檔案系統上,所以請勿使用任何不屬於該儲存池的其他磁碟裝置名稱並確定在執行指令前已對儲存池做正確的備份! - - - # zpool export healer -# dd if=/dev/random of=/dev/ada1 bs=1m count=200 -200+0 records in -200+0 records out -209715200 bytes transferred in 62.992162 secs (3329227 bytes/sec) -# zpool import healer - - 儲存池的狀態顯示有一個裝置發生了錯誤。注意,應用程式從儲存池讀取的資料中並沒有任何的錯誤資料,ZFS 會自 ada0 裝置提供有正確校驗碼的資料。結果裡面 CKSUM 欄位含有非零值便是有錯誤校驗碼的裝置。 - - # zpool status healer - pool: healer - state: ONLINE - status: One or more devices has experienced an unrecoverable error. An - attempt was made to correct the error. Applications are unaffected. - action: Determine if the device needs to be replaced, and clear the errors - using 'zpool clear' or replace the device with 'zpool replace'. - see: http://illumos.org/msg/ZFS-8000-4J - scan: none requested - config: - - NAME STATE READ WRITE CKSUM - healer ONLINE 0 0 0 - mirror-0 ONLINE 0 0 0 - ada0 ONLINE 0 0 0 - ada1 ONLINE 0 0 1 - -errors: No known data errors - - 錯誤已經被偵測到並且由未被影響的 ada0 鏡像磁碟上的備援提供資料。可與原來的校驗碼做比較來看儲存池是否已修復為一致。 - - # sha1 /healer >> checksum.txt -# cat checksum.txt -SHA1 (/healer) = 2753eff56d77d9a536ece6694bf0a82740344d1f -SHA1 (/healer) = 2753eff56d77d9a536ece6694bf0a82740344d1f - - 儲存池在故意竄改資料前與後的兩個校驗碼仍相符顯示了 ZFS 在校驗碼不同時偵測與自動修正錯誤的能力。注意,這只在當儲存池中有足夠的備援時才可做到,由單一裝置組成的儲存池並沒有自我修復的能力。這也是為什麼在 ZFS 中校驗碼如此重要,任何原因都不該關閉。不需要 fsck8 或類似的檔案系統一致性檢查程式便能夠偵測與修正問題,且儲存儲存池在發生問題時仍可正常運作。接著需要做清潔作業來覆蓋在 ada1 上的錯誤資料。 - - # zpool scrub healer -# zpool status healer - pool: healer - state: ONLINE -status: One or more devices has experienced an unrecoverable error. An - attempt was made to correct the error. Applications are unaffected. -action: Determine if the device needs to be replaced, and clear the errors - using 'zpool clear' or replace the device with 'zpool replace'. - see: http://illumos.org/msg/ZFS-8000-4J - scan: scrub in progress since Mon Dec 10 12:23:30 2012 - 10.4M scanned out of 67.0M at 267K/s, 0h3m to go - 9.63M repaired, 15.56% done -config: - - NAME STATE READ WRITE CKSUM - healer ONLINE 0 0 0 - mirror-0 ONLINE 0 0 0 - ada0 ONLINE 0 0 0 - ada1 ONLINE 0 0 627 (repairing) - -errors: No known data errors - - 清潔作業會從 ada0 讀取資料並重新寫入任何在 ada1 上有錯誤校驗碼的資料。這個操作可以由 zpool status 的輸出中呈現修復中 (repairing) 的項目來辨識。這個作業完成後,儲存池的狀態會更改為: - - # zpool status healer - pool: healer - state: ONLINE -status: One or more devices has experienced an unrecoverable error. An - attempt was made to correct the error. Applications are unaffected. -action: Determine if the device needs to be replaced, and clear the errors - using 'zpool clear' or replace the device with 'zpool replace'. - see: http://illumos.org/msg/ZFS-8000-4J - scan: scrub repaired 66.5M in 0h2m with 0 errors on Mon Dec 10 12:26:25 2012 -config: - - NAME STATE READ WRITE CKSUM - healer ONLINE 0 0 0 - mirror-0 ONLINE 0 0 0 - ada0 ONLINE 0 0 0 - ada1 ONLINE 0 0 2.72K - -errors: No known data errors - - 清潔操作完成便同步了 ada0ada1 間的所有資料。執行 zpool clear 可以清除 (Clear) 儲存池狀態的錯誤訊息。 - - # zpool clear healer -# zpool status healer - pool: healer - state: ONLINE - scan: scrub repaired 66.5M in 0h2m with 0 errors on Mon Dec 10 12:26:25 2012 -config: - - NAME STATE READ WRITE CKSUM - healer ONLINE 0 0 0 - mirror-0 ONLINE 0 0 0 - ada0 ONLINE 0 0 0 - ada1 ONLINE 0 0 0 - -errors: No known data errors - - 儲存池現在恢復完整運作的狀態且清除所有的錯誤了。 - - - - 擴增儲存池 - - 可用的備援儲存池大小會受到每個 vdev 中容量最小的裝置限制。最小的裝置可以替換成較大的裝置,在更換 (Replace) 或修復 (Resilver) 作業後,儲存池可以成長到該新裝置的可用容量。例如,要做一個 1 TB 磁碟機與一個 2 TB 磁碟機的鏡像,可用的空間會是 1 TB,當 1 TB 磁碟機備更換成另一個 2 TB 的磁碟機時,修復程序會複製既有的資料到新的磁碟機,由於現在兩個裝置都有 2 TB 的容量,所以鏡像的可用空間便會成長到 2 TB。 - - 可以在每個裝置用 zpool online -e 來觸發擴充的動作,在擴充完所有裝置後,儲存池便可使用額外的空間。 - - - - 匯入與匯出儲存池 - - 儲存池在移動到其他系統之前需要做匯出 (Export),會卸載所有的資料集,然後標記每個裝置為已匯出,為了避免被其他磁碟子系統存取,因此仍會鎖定這些裝置。這個動作讓儲存池可以在支援 ZFS 的其他機器、其他作業系統做匯入 (Import),甚至是不同的硬體架構 (有一些注意事項,請參考 zpool8)。當資料集有被開啟的檔案,可使用 zpool export -f 來強制匯出儲存池,使用這個指令需要小心,資料集是被強制卸載的,因此有可能造成在該資料集開啟檔案的應用程式發生無法預期的結果。 - - 匯出未使用的儲存池: - - # zpool export mypool - - 匯入儲存池會自動掛載資料集,若不想自動掛載,可以使用 zpool import -Nzpool import -o 可以設定在匯入時暫時使用的屬性。zpool import altroot= 允許匯入時指定基礎掛載點 (Base mount point) 來替換檔案系統根目錄。若儲存池先前用在不同的系統且不正常匯出,可能會需要使用 zpool import -f 來強制匯入。zpool import -a 會匯入所有沒有被其他系統使用的儲存池。 - - 列出所有可以匯入的儲存池: - - # zpool import - pool: mypool - id: 9930174748043525076 - state: ONLINE - action: The pool can be imported using its name or numeric identifier. - config: - - mypool ONLINE - ada2p3 ONLINE - - 使用替代的根目錄匯入儲存池: - - # zpool import -o altroot=/mnt mypool -# zfs list -zfs list -NAME USED AVAIL REFER MOUNTPOINT -mypool 110K 47.0G 31K /mnt/mypool - - - - 升級儲存儲存池 - - 在升級 FreeBSD 之後或儲存池是由其他使用舊版 ZFS 的系統匯入,儲存池可以手動升級到最新版本的 ZFS 來支援新的功能。在升級前請評估儲存池是否還要在舊的系統做匯入,由於升級是一個單向的程序,舊的儲存池可以升級,但有新功能的儲存池無法降級。 - - 升級一個 v28 的儲存以支援功能旗標 (Feature Flags): - - # zpool status - pool: mypool - state: ONLINE -status: The pool is formatted using a legacy on-disk format. The pool can - still be used, but some features are unavailable. -action: Upgrade the pool using 'zpool upgrade'. Once this is done, the - pool will no longer be accessible on software that does not support feat - flags. - scan: none requested -config: - - NAME STATE READ WRITE CKSUM - mypool ONLINE 0 0 0 - mirror-0 ONLINE 0 0 0 - ada0 ONLINE 0 0 0 - ada1 ONLINE 0 0 0 - -errors: No known data errors -# zpool upgrade -This system supports ZFS pool feature flags. - -The following pools are formatted with legacy version numbers and can -be upgraded to use feature flags. After being upgraded, these pools -will no longer be accessible by software that does not support feature -flags. - -VER POOL ---- ------------ -28 mypool - -Use 'zpool upgrade -v' for a list of available legacy versions. -Every feature flags pool has all supported features enabled. -# zpool upgrade mypool -This system supports ZFS pool feature flags. - -Successfully upgraded 'mypool' from version 28 to feature flags. -Enabled the following features on 'mypool': - async_destroy - empty_bpobj - lz4_compress - multi_vdev_crash_dump - - ZFS 的新功能在 zpool upgrade 尚未完成之前無法使用。可以用 zpool upgrade -v 來查看升級後有那些新功能,也同時會列出已經支援那些功能。 - - 升級儲存池支援新版的功能旗標 (Feature flags): - - # zpool status - pool: mypool - state: ONLINE -status: Some supported features are not enabled on the pool. The pool can - still be used, but some features are unavailable. -action: Enable all features using 'zpool upgrade'. Once this is done, - the pool may no longer be accessible by software that does not support - the features. See zpool-features(7) for details. - scan: none requested -config: - - NAME STATE READ WRITE CKSUM - mypool ONLINE 0 0 0 - mirror-0 ONLINE 0 0 0 - ada0 ONLINE 0 0 0 - ada1 ONLINE 0 0 0 - -errors: No known data errors -# zpool upgrade -This system supports ZFS pool feature flags. - -All pools are formatted using feature flags. - - -Some supported features are not enabled on the following pools. Once a -feature is enabled the pool may become incompatible with software -that does not support the feature. See zpool-features(7) for details. - -POOL FEATURE ---------------- -zstore - multi_vdev_crash_dump - spacemap_histogram - enabled_txg - hole_birth - extensible_dataset - bookmarks - filesystem_limits -# zpool upgrade mypool -This system supports ZFS pool feature flags. - -Enabled the following features on 'mypool': - spacemap_histogram - enabled_txg - hole_birth - extensible_dataset - bookmarks - filesystem_limits - - - 在使用儲存池來開機的系統上的 Boot code 也必須一併更新來支援新的儲存池版本,可在含有 Boot code 的分割區使用 gpart bootcode 來更新。目前有兩種 Boot code 可使用,需視系統開機的方式使用:GPT (最常用的選項) 以及 EFI (較新的系統)。 - - 針對傳統使用 GPT 開機的系統,可以使用以下指令: - - # gpart bootcode -b /boot/pmbr -p /boot/gptzfsboot -i 1 ada1 - - 針對使用 EFI 開機的系統可以執行以下指令: - - # gpart bootcode -p /boot/boot1.efifat -i 1 ada1 - - 套用 Boot code 到所有儲存池中可開機的磁碟。請參考 gpart8 以取得更多資訊。 - - - - - 顯示已記錄的儲存池歷史日誌 - - 修改儲存池的指令會被記錄下來,會記錄的動作包含資料集的建立,屬性更改或更換磁碟。這個歷史記錄用來查看儲存池是如何建立、由誰執行、什麼動作及何時。歷史記錄並非儲存在日誌檔 (Log file),而是儲存在儲存池。查看這個歷史記錄的指令名稱為 zpool history - - # zpool history -History for 'tank': -2013-02-26.23:02:35 zpool create tank mirror /dev/ada0 /dev/ada1 -2013-02-27.18:50:58 zfs set atime=off tank -2013-02-27.18:51:09 zfs set checksum=fletcher4 tank -2013-02-27.18:51:18 zfs create tank/backup - - 輸出結果顯示曾在該儲存池上執行的 zpoolzfs 指令以及時間戳記。只有會修改儲存池或類似的指令會被記錄下來,像是 zfs list 這種指令並不會被記錄。當不指定儲存池名稱時,會列出所有儲存池的歷史記錄。 - - 在提供選項 zpool history 可以顯更多詳細資訊。 會顯示使用者觸發的事件外,也會顯示內部記錄的 ZFS 事件。 - - # zpool history -i -History for 'tank': -2013-02-26.23:02:35 [internal pool create txg:5] pool spa 28; zfs spa 28; zpl 5;uts 9.1-RELEASE 901000 amd64 -2013-02-27.18:50:53 [internal property set txg:50] atime=0 dataset = 21 -2013-02-27.18:50:58 zfs set atime=off tank -2013-02-27.18:51:04 [internal property set txg:53] checksum=7 dataset = 21 -2013-02-27.18:51:09 zfs set checksum=fletcher4 tank -2013-02-27.18:51:13 [internal create txg:55] dataset = 39 -2013-02-27.18:51:18 zfs create tank/backup - - 更多詳細的資訊可加上 來取得,歷史記錄會以較長的格式顯示,包含的資訊有執行指令的使用者名稱、主機名稱以及更改的項目。 - - # zpool history -l -History for 'tank': -2013-02-26.23:02:35 zpool create tank mirror /dev/ada0 /dev/ada1 [user 0 (root) on :global] -2013-02-27.18:50:58 zfs set atime=off tank [user 0 (root) on myzfsbox:global] -2013-02-27.18:51:09 zfs set checksum=fletcher4 tank [user 0 (root) on myzfsbox:global] -2013-02-27.18:51:18 zfs create tank/backup [user 0 (root) on myzfsbox:global] - - 輸出結果顯示 root 使用者使用 /dev/ada0/dev/ada1 建立鏡像的儲存池。主機名稱 myzfsbox 在建立完儲存池後也同樣會顯示。由於儲存池可以從一個系統匯出再匯入到另一個系統,因此主機名稱也很重要,這樣一來可以清楚的辦識在其他系統上執行的每一個指令的主機名稱。 - - 兩個 zpool history 選項可以合併使用來取得最完整的儲存池詳細資訊。儲存池歷史記錄在追蹤執行什麼動作或要取得除錯所需的輸出結果提供了非常有用的資訊。 - - - - 監視效能 - - 內建的監視系統可以即時顯示儲存池的 I/O 統計資訊。它會顯示儲存池剩餘的空間與使用的空間,每秒執行了多少讀取與寫入的操作,有多少 I/O 頻寬被使用。預設會監視所有在系統中的儲存池都並顯示出來,可以提供儲存池名稱來只顯示該儲存池的監視資訊。舉一個簡單的例子: - - # zpool iostat - capacity operations bandwidth -pool alloc free read write read write ----------- ----- ----- ----- ----- ----- ----- -data 288G 1.53T 2 11 11.3K 57.1K - - 要持續監視 I/O 的活動可以在最後的參數指定一個數字,這個數字代表每次更新資訊所間隔的秒數。在每次經過間隔的時間後會列出新一行的統計資訊,按下 Ctrl C 可以中止監視。或者在指令列的間隔時間之後再指定一個數字,代表總共要顯示的統計資訊筆數。 - - 使用 可以顯示更詳細的 I/O 統計資訊。每個在儲存池中的裝置會以一行統計資訊顯示。這可以幫助了解每一個裝置做了多少讀取與寫入的操作,並可協助確認是否有各別裝置拖慢了整個儲存池的速度。以下範例會顯示有兩個裝置的鏡像儲存池: - - # zpool iostat -v - capacity operations bandwidth -pool alloc free read write read write ------------------------ ----- ----- ----- ----- ----- ----- -data 288G 1.53T 2 12 9.23K 61.5K - mirror 288G 1.53T 2 12 9.23K 61.5K - ada1 - - 0 4 5.61K 61.7K - ada2 - - 1 4 5.04K 61.7K ------------------------ ----- ----- ----- ----- ----- ----- - - - - 分割儲存儲存池 - - 由一個或多個鏡像 vdev 所組成的儲存池可以切分開成兩個儲存池。除非有另外指定,否則每個鏡像的最後一個成員會被分離來然用來建立一個含有相同資料的新儲存池。在做這個操作的第一次應先使用 ,會顯示預計會做的操作而不會真的執行,這可以協助確認操作是否與使用者所要的相同。 - - - - - <command>zfs</command> 管理 - - zfs 工具負責建立、摧毀與管理在一個儲存池中所有的 ZFS 資料集。儲存池使用 zpool 來管理。 - - - 建立與摧毀資料集 - - 不同於傳統的磁碟與磁碟區管理程式 (Volume manager) ,在 ZFS 中的空間並會預先分配。傳統的檔案系統在分割與分配空間完後,若沒有增加新的磁碟便無法再增加額外的檔案系統。在 ZFS,可以隨時建立新的檔案系統,每個資料集 (Dataset) 都有自己的屬性,包含壓縮 (Compression)、去重複 (Deduplication)、快取 (Caching) 與配額 (Quota) 功能以及其他有用的屬性如唯讀 (Readonly)、區分大小寫 (Case sensitivity)、網路檔案分享 (Network file sharing) 以及掛載點 (Mount point)。資料集可以存在於其他資料集中,且子資料集會繼承其父資料集的屬性。每個資料集都可以作為一個單位來管理、委託 (Delegate)、備份 (Replicate)、快照 (Snapshot)、監禁 (Jail) 與摧毀 (Destroy),替每種不同類型或集合的檔案建立各別的資料集還有許多的好處。唯一的缺點是在當有非常大數量的資料集時,部份指令例如 zfs list 會變的較緩慢,且掛載上百個或其至上千個資料集可能會使 FreeBSD 的開機程序變慢。 - - 建立一個新資料集並開啟 LZ4 壓縮: - - # zfs list -NAME USED AVAIL REFER MOUNTPOINT -mypool 781M 93.2G 144K none -mypool/ROOT 777M 93.2G 144K none -mypool/ROOT/default 777M 93.2G 777M / -mypool/tmp 176K 93.2G 176K /tmp -mypool/usr 616K 93.2G 144K /usr -mypool/usr/home 184K 93.2G 184K /usr/home -mypool/usr/ports 144K 93.2G 144K /usr/ports -mypool/usr/src 144K 93.2G 144K /usr/src -mypool/var 1.20M 93.2G 608K /var -mypool/var/crash 148K 93.2G 148K /var/crash -mypool/var/log 178K 93.2G 178K /var/log -mypool/var/mail 144K 93.2G 144K /var/mail -mypool/var/tmp 152K 93.2G 152K /var/tmp -# zfs create -o compress=lz4 mypool/usr/mydataset -# zfs list -NAME USED AVAIL REFER MOUNTPOINT -mypool 781M 93.2G 144K none -mypool/ROOT 777M 93.2G 144K none -mypool/ROOT/default 777M 93.2G 777M / -mypool/tmp 176K 93.2G 176K /tmp -mypool/usr 704K 93.2G 144K /usr -mypool/usr/home 184K 93.2G 184K /usr/home -mypool/usr/mydataset 87.5K 93.2G 87.5K /usr/mydataset -mypool/usr/ports 144K 93.2G 144K /usr/ports -mypool/usr/src 144K 93.2G 144K /usr/src -mypool/var 1.20M 93.2G 610K /var -mypool/var/crash 148K 93.2G 148K /var/crash -mypool/var/log 178K 93.2G 178K /var/log -mypool/var/mail 144K 93.2G 144K /var/mail -mypool/var/tmp 152K 93.2G 152K /var/tmp - - 摧毀資料集會比刪除所有在資料集上所殘留的檔案來的快,由於摧毀資料集並不會掃描所有檔案並更新所有相關的 Metadata。 - - 摧毀先前建立的資料集: - - # zfs list -NAME USED AVAIL REFER MOUNTPOINT -mypool 880M 93.1G 144K none -mypool/ROOT 777M 93.1G 144K none -mypool/ROOT/default 777M 93.1G 777M / -mypool/tmp 176K 93.1G 176K /tmp -mypool/usr 101M 93.1G 144K /usr -mypool/usr/home 184K 93.1G 184K /usr/home -mypool/usr/mydataset 100M 93.1G 100M /usr/mydataset -mypool/usr/ports 144K 93.1G 144K /usr/ports -mypool/usr/src 144K 93.1G 144K /usr/src -mypool/var 1.20M 93.1G 610K /var -mypool/var/crash 148K 93.1G 148K /var/crash -mypool/var/log 178K 93.1G 178K /var/log -mypool/var/mail 144K 93.1G 144K /var/mail -mypool/var/tmp 152K 93.1G 152K /var/tmp -# zfs destroy mypool/usr/mydataset -# zfs list -NAME USED AVAIL REFER MOUNTPOINT -mypool 781M 93.2G 144K none -mypool/ROOT 777M 93.2G 144K none -mypool/ROOT/default 777M 93.2G 777M / -mypool/tmp 176K 93.2G 176K /tmp -mypool/usr 616K 93.2G 144K /usr -mypool/usr/home 184K 93.2G 184K /usr/home -mypool/usr/ports 144K 93.2G 144K /usr/ports -mypool/usr/src 144K 93.2G 144K /usr/src -mypool/var 1.21M 93.2G 612K /var -mypool/var/crash 148K 93.2G 148K /var/crash -mypool/var/log 178K 93.2G 178K /var/log -mypool/var/mail 144K 93.2G 144K /var/mail -mypool/var/tmp 152K 93.2G 152K /var/tmp - - 在最近版本的 ZFSzfs destroy 是非同步的,且釋放出的空間會許要花費數分鐘才會出現在儲存池上,可使用 zpool get freeing poolname 來查看 freeing 屬性,這個屬性會指出資料集在背景已經釋放多少資料區塊了。若有子資料集,如快照 (Snapshot) 或其他資料集存在的話,則會無法摧毀父資料集。要摧毀一個資料集及其所有子資料集,可使用 來做遞迴摧毀資料集及其所有子資料集,可用 來列出會被這個操作所摧毀的資料集及快照,而不會真的摧毀,因摧毀快照所釋放出的空間也會同時顯示。 - - - - 建立與摧毀磁碟區 - - 磁碟區 (Volume) 是特殊類型的資料集,不會被掛載成一個檔案系統,而是會被當做儲存區塊裝置出現在 /dev/zvol/poolname/dataset 下。這讓磁碟區可供其他檔案系統使用、拿來備份虛擬機器的磁碟或是使用 iSCSIHAST 通訊協定匯出。 - - 磁碟區可以被格式化成任何檔案系統,或不使用檔案系統來儲存原始資料。對一般使用者,磁碟區就像是一般的磁碟,可以放置一般的檔案系統在這些 zvols 上,並提供一般磁碟或檔案系統一般所沒有的功能。例如,使用壓縮屬性在一個 250 MB 的磁碟區可建立一個壓縮的 FAT 檔案系統。 - - # zfs create -V 250m -o compression=on tank/fat32 -# zfs list tank -NAME USED AVAIL REFER MOUNTPOINT -tank 258M 670M 31K /tank -# newfs_msdos -F32 /dev/zvol/tank/fat32 -# mount -t msdosfs /dev/zvol/tank/fat32 /mnt -# df -h /mnt | grep fat32 -Filesystem Size Used Avail Capacity Mounted on -/dev/zvol/tank/fat32 249M 24k 249M 0% /mnt -# mount | grep fat32 -/dev/zvol/tank/fat32 on /mnt (msdosfs, local) - - 摧毀一個磁碟區與摧毀一個一般的檔案系統資料集差不多。操作上幾乎是即時的,但在背景會需要花費數分鐘來讓釋放空間再次可用。 - - - - 重新命名資料集 - - 資料集的名稱可以使用 zfs rename 更改。父資料集也同樣可以使用這個指令來更改名稱。重新命名一個資料集到另一個父資料集也會更改自父資料集繼承的屬性值。重新命名資料集後,會被卸載然後重新掛載到新的位置 (依繼承的新父資料集而定),可使用 來避免重新掛載。 - - 重新命名一個資料集並移動該資料集到另一個父資料集: - - # zfs list -NAME USED AVAIL REFER MOUNTPOINT -mypool 780M 93.2G 144K none -mypool/ROOT 777M 93.2G 144K none -mypool/ROOT/default 777M 93.2G 777M / -mypool/tmp 176K 93.2G 176K /tmp -mypool/usr 704K 93.2G 144K /usr -mypool/usr/home 184K 93.2G 184K /usr/home -mypool/usr/mydataset 87.5K 93.2G 87.5K /usr/mydataset -mypool/usr/ports 144K 93.2G 144K /usr/ports -mypool/usr/src 144K 93.2G 144K /usr/src -mypool/var 1.21M 93.2G 614K /var -mypool/var/crash 148K 93.2G 148K /var/crash -mypool/var/log 178K 93.2G 178K /var/log -mypool/var/mail 144K 93.2G 144K /var/mail -mypool/var/tmp 152K 93.2G 152K /var/tmp -# zfs rename mypool/usr/mydataset mypool/var/newname -# zfs list -NAME USED AVAIL REFER MOUNTPOINT -mypool 780M 93.2G 144K none -mypool/ROOT 777M 93.2G 144K none -mypool/ROOT/default 777M 93.2G 777M / -mypool/tmp 176K 93.2G 176K /tmp -mypool/usr 616K 93.2G 144K /usr -mypool/usr/home 184K 93.2G 184K /usr/home -mypool/usr/ports 144K 93.2G 144K /usr/ports -mypool/usr/src 144K 93.2G 144K /usr/src -mypool/var 1.29M 93.2G 614K /var -mypool/var/crash 148K 93.2G 148K /var/crash -mypool/var/log 178K 93.2G 178K /var/log -mypool/var/mail 144K 93.2G 144K /var/mail -mypool/var/newname 87.5K 93.2G 87.5K /var/newname -mypool/var/tmp 152K 93.2G 152K /var/tmp - - 快照也可以像這樣重新命名,由於快照的本質使其無法被重新命名到另一個父資料集。要遞迴重新命名快照可指定 ,然後在子資料集中所有同名的快照也會一併被重新命名。 - - # zfs list -t snapshot -NAME USED AVAIL REFER MOUNTPOINT -mypool/var/newname@first_snapshot 0 - 87.5K - -# zfs rename mypool/var/newname@first_snapshot new_snapshot_name -# zfs list -t snapshot -NAME USED AVAIL REFER MOUNTPOINT -mypool/var/newname@new_snapshot_name 0 - 87.5K - - - - - 設定資料集屬性 - - 每個 ZFS 資料集有數個屬性可以用來控制其行為。大部份的屬性會自動繼承自其父資料集,但可以被自己覆蓋。設定資料集上的屬性可使用 zfs set property=value dataset。大部份屬性有限制可用的值,zfs get 會顯示每個可以使用的屬性及其可用的值。大部份可以使用 zfs inherit 還原成其繼承的值。 - - 也可設定使用者自訂的屬性。這些屬性也會成為資料集設定的一部份,且可以被用來提供資料集或其內容的額外資訊。要別分自訂屬性與 ZFS 提供的屬性,會使用冒號 (:) 建立一個自訂命名空間供自訂屬性使用。 - - # zfs set custom:costcenter=1234 tank -# zfs get custom:costcenter tank -NAME PROPERTY VALUE SOURCE -tank custom:costcenter 1234 local - - 要移除自訂屬性,可用 zfs inherit 加上 。若父資料集未定義任何自訂屬性,將會將該屬性完全移除 (更改動作仍會記錄於儲存池的歷史記錄)。 - - # zfs inherit -r custom:costcenter tank -# zfs get custom:costcenter tank -NAME PROPERTY VALUE SOURCE -tank custom:costcenter - - -# zfs get all tank | grep custom:costcenter -# - - - 取得與設定共享屬性 - - Two commonly used and useful dataset properties are the - NFS and SMB share - options. Setting these define if and how - ZFS datasets may be shared on the network. - At present, only setting sharing via NFS is - supported on FreeBSD. To get the current status of - a share, enter: - - # zfs get sharenfs mypool/usr/home -NAME PROPERTY VALUE SOURCE -mypool/usr/home sharenfs on local -# zfs get sharesmb mypool/usr/home -NAME PROPERTY VALUE SOURCE -mypool/usr/home sharesmb off local - - To enable sharing of a dataset, enter: - - # zfs set sharenfs=on mypool/usr/home - - It is also possible to set additional options for sharing - datasets through NFS, such as - , and - . To set additional options to a - dataset shared through NFS, enter: - - # zfs set sharenfs="-alldirs,-maproot=root,-network=192.168.1.0/24" mypool/usr/home - - - - - 管理快照 (Snapshot) - - 快照 (Snapshot) 是 ZFS 最強大的功能之一。快照提供了資料集唯讀、單一時間點 (Point-in-Time) 的複製功能,使用了寫入時複製 (Copy-On-Write, COW) 的技術,可以透過保存在磁碟上的舊版資料快速的建立快照。若沒有快照存在,在資料被覆蓋或刪除時,便回收空間供未來使用。由於只記錄前一個版本與目前資料集的差異,因此快照可節省磁碟空間。快照只允許在整個資料集上使用,無法在各別檔案或目錄。當建立了一個資料集的快照時,便備份了所有內含的資料,這包含了檔案系統屬性、檔案、目錄、權限等等。第一次建立快照時只會使用到更改參照到資料區塊的空間,不會用到其他額外的空間。使用 可以對使用同名的資料集及其所有子資料集的建立一個遞迴快照,提供一致且即時 (Moment-in-time) 的完整檔案系統快照功能,這對於那些彼此有相關或相依檔案存放在不同資料集的應用程式非常重要。不使用快照所備份的資料其實是分散不同時間點的。 - - ZFS 中的快照提供了多種功能,即使是在其他缺乏快照功能的檔案系統上。一個使用快照的典型例子是在安裝軟體或執行系統升級這種有風險的動作時,能有一個快速的方式可以備份檔案系統目前的狀態,若動作失敗,可以使用快照還原 (Roll back) 到與快照建立時相同的系統狀態,若升級成功,便可刪除快照來釋放空間。若沒有快照功能,升級失敗通常會需要使用備份來恢復 (Restore) 系統,而這個動作非常繁瑣、耗時且可能會需要停機一段時間系統無法使用。使用快照可以快速的還原,即使系統正在執行一般的運作,只而要短暫或甚至不需停機。能夠節省大量在有數 TB 的儲存系統上從備份複製所需資料的時間。快照並非要用來取代儲存池的完整備份,但可以用在快速且簡單的保存某個特定時間點的資料集。 - - - 建立快照 - - 快照可以使用 zfs snapshot dataset@snapshotname 來建立。加入 可以遞迴對所有同名的子資料集建立快照。 - - 建立一個整個儲存池的遞迴快照: - - # zfs list -t all -NAME USED AVAIL REFER MOUNTPOINT -mypool 780M 93.2G 144K none -mypool/ROOT 777M 93.2G 144K none -mypool/ROOT/default 777M 93.2G 777M / -mypool/tmp 176K 93.2G 176K /tmp -mypool/usr 616K 93.2G 144K /usr -mypool/usr/home 184K 93.2G 184K /usr/home -mypool/usr/ports 144K 93.2G 144K /usr/ports -mypool/usr/src 144K 93.2G 144K /usr/src -mypool/var 1.29M 93.2G 616K /var -mypool/var/crash 148K 93.2G 148K /var/crash -mypool/var/log 178K 93.2G 178K /var/log -mypool/var/mail 144K 93.2G 144K /var/mail -mypool/var/newname 87.5K 93.2G 87.5K /var/newname -mypool/var/newname@new_snapshot_name 0 - 87.5K - -mypool/var/tmp 152K 93.2G 152K /var/tmp -# zfs snapshot -r mypool@my_recursive_snapshot -# zfs list -t snapshot -NAME USED AVAIL REFER MOUNTPOINT -mypool@my_recursive_snapshot 0 - 144K - -mypool/ROOT@my_recursive_snapshot 0 - 144K - -mypool/ROOT/default@my_recursive_snapshot 0 - 777M - -mypool/tmp@my_recursive_snapshot 0 - 176K - -mypool/usr@my_recursive_snapshot 0 - 144K - -mypool/usr/home@my_recursive_snapshot 0 - 184K - -mypool/usr/ports@my_recursive_snapshot 0 - 144K - -mypool/usr/src@my_recursive_snapshot 0 - 144K - -mypool/var@my_recursive_snapshot 0 - 616K - -mypool/var/crash@my_recursive_snapshot 0 - 148K - -mypool/var/log@my_recursive_snapshot 0 - 178K - -mypool/var/mail@my_recursive_snapshot 0 - 144K - -mypool/var/newname@new_snapshot_name 0 - 87.5K - -mypool/var/newname@my_recursive_snapshot 0 - 87.5K - -mypool/var/tmp@my_recursive_snapshot 0 - 152K - - - 建立的快照不會顯示在一般的 zfs list 操作結果,要列出快照需在 zfs list 後加上 ,使用 可以同時列出檔案系統的內容及快照。 - - 快照並不會直接掛載,因此 MOUNTPOINT 欄位的路徑如此顯示。在 AVAIL 欄位不會有可用的磁碟空間,因為快照建立之後便無法再寫入。比較快照與其原來建立時的資料集: - - # zfs list -rt all mypool/usr/home -NAME USED AVAIL REFER MOUNTPOINT -mypool/usr/home 184K 93.2G 184K /usr/home -mypool/usr/home@my_recursive_snapshot 0 - 184K - - - 同時顯示資料集與快照可以了解快照如何使用 COW 技術來運作。快照只會保存有更動 (差異) 的資料,並非整個檔案系統的內容,這個意思是說,快照只會在有做更動時使用一小部份的空間,複製一個檔案到該資料集,可以讓空間使用量變的更明顯,然後再做第二個快照: - - # cp /etc/passwd /var/tmp -# zfs snapshot mypool/var/tmp@after_cp -# zfs list -rt all mypool/var/tmp -NAME USED AVAIL REFER MOUNTPOINT -mypool/var/tmp 206K 93.2G 118K /var/tmp -mypool/var/tmp@my_recursive_snapshot 88K - 152K - -mypool/var/tmp@after_cp 0 - 118K - - - 第二快照只會包含了資料集做了複製動作後的更動,這樣的機制可以節省大量的空間。注意在複製之後快照 mypool/var/tmp@my_recursive_snapshotUSED 欄位中的大小也更改了,這說明了這個更動在前次快照與之後快照間的關係。 - - - - 比對快照 - - ZFS 提供了內建指令可以用來比對兩個快照 (Snapshot) 之間的差異,在使用者想要查看一段時間之間檔案系統所的變更時非常有用。例如 zfs diff 可以讓使用者在最後一次快照中找到意外刪除的檔案。對前面一節所做的兩個快照使用這個指令會產生以下結果: - - # zfs list -rt all mypool/var/tmp -NAME USED AVAIL REFER MOUNTPOINT -mypool/var/tmp 206K 93.2G 118K /var/tmp -mypool/var/tmp@my_recursive_snapshot 88K - 152K - -mypool/var/tmp@after_cp 0 - 118K - -# zfs diff mypool/var/tmp@my_recursive_snapshot -M /var/tmp/ -+ /var/tmp/passwd - - 指令會列出指定快照 (在這個例子中為 mypool/var/tmp@my_recursive_snapshot) 與目前檔案系統間的更改。第一個欄位是更改的類型: - - - - - - + - 加入了該路徑或檔案。 - - - - - - 刪除了該路徑或檔案。 - - - - M - 修改了該路徑或檔案。 - - - - R - 重新命名了該路徑或檔案。 - - - - - - 對照這個表格來看輸出的結果,可以明顯的看到 passwd 是在快照 mypool/var/tmp@my_recursive_snapshot 建立之後才加入的,結果也同樣看的到掛載到 /var/tmp 的父目錄已經做過修改。 - - 在使用 ZFS 備份功能來傳輸一個資料集到另一個主機備份時比對兩個快照也同樣很有用。 - - 比對兩個快照需要提供兩個資料集的完整資料集名稱與快照名稱: - - # cp /var/tmp/passwd /var/tmp/passwd.copy -# zfs snapshot mypool/var/tmp@diff_snapshot -# zfs diff mypool/var/tmp@my_recursive_snapshot mypool/var/tmp@diff_snapshot -M /var/tmp/ -+ /var/tmp/passwd -+ /var/tmp/passwd.copy -# zfs diff mypool/var/tmp@my_recursive_snapshot mypool/var/tmp@after_cp -M /var/tmp/ -+ /var/tmp/passwd - - 備份管理者可以比對兩個自傳送主機所接收到的兩個快照並查看實際在資料集中的變更。請參考 備份 一節來取得更多資訊。 - - - - 使用快照還原 - - 只要至少有一個可用的快照便可以隨時還原。大多數在已不需要目前資料集,想要改用較舊版的資料的情況,例如,本地開發的測試發生錯誤、不良的系統更新破壞了系統的整體功能或需要還原意外刪除檔案或目錄 ... 等,都是非常常見的情形。幸運的,要還原到某個快照只需要簡單輸入 zfs rollback snapshotname。會依快照所做的變更數量來決定處理的時間,還原的操作會在一段時間後完成。在這段時間中,資料集會一直保持一致的狀態,類似一個符合 ACID 原則的資料庫在做還原。還原可在資料集處於上線及可存取的情況下完成,不需要停機。還原到快照之後,資料集便回到當初執行快照時相同的狀態,所有沒有在快照中的其他資料便會被丟棄,因此往後若還有可能需要部份資料時,建議在還原到前一個快照之前先對目前的資料集做快照,這樣一來,使用者便可以在快照之間來回快換,而不會遺失重要的資料。 - - 在第一個範例中,因為 rm 操作不小心移除了預期外的資料,要還原到快照。 - - # zfs list -rt all mypool/var/tmp -NAME USED AVAIL REFER MOUNTPOINT -mypool/var/tmp 262K 93.2G 120K /var/tmp -mypool/var/tmp@my_recursive_snapshot 88K - 152K - -mypool/var/tmp@after_cp 53.5K - 118K - -mypool/var/tmp@diff_snapshot 0 - 120K - -# ls /var/tmp -passwd passwd.copy vi.recover -# rm /var/tmp/passwd* -# ls /var/tmp -vi.recover - - 在此時,使用者發現到刪除了太多檔案並希望能夠還原。ZFS 提供了簡單的方可以取回檔案,便是使用還原 (Rollback),但這只在有定期對重要的資料使用快照時可用。要拿回檔案並從最後一次快照重新開始,可執行以下指令: - - # zfs rollback mypool/var/tmp@diff_snapshot -# ls /var/tmp -passwd passwd.copy vi.recover - - 還原操作會將資料集還原為最後一次快照的狀態。這也可以還原到更早之前,有其他在其之後建立的快照。要這麼做時,ZFS 會發出這個警告: - - # zfs list -rt snapshot mypool/var/tmp -AME USED AVAIL REFER MOUNTPOINT -mypool/var/tmp@my_recursive_snapshot 88K - 152K - -mypool/var/tmp@after_cp 53.5K - 118K - -mypool/var/tmp@diff_snapshot 0 - 120K - -# zfs rollback mypool/var/tmp@my_recursive_snapshot -cannot rollback to 'mypool/var/tmp@my_recursive_snapshot': more recent snapshots exist -use '-r' to force deletion of the following snapshots: -mypool/var/tmp@after_cp -mypool/var/tmp@diff_snapshot - - 這個警告是因在該快照與資料集的目前狀態之間有其他快照存在,然而使用者想要還原到該快照。要完成這樣的還原動作,必須刪除在這之間的快照,因為 ZFS 無法追蹤不同資料集狀態間的變更。在使用者未指定 來確認這個動作前,ZFS 不會刪除受影響的快照。若確定要這麼做,那麼必須要知道會遺失所有在這之間的快照,然後可執行以下指令: - - # zfs rollback -r mypool/var/tmp@my_recursive_snapshot -# zfs list -rt snapshot mypool/var/tmp -NAME USED AVAIL REFER MOUNTPOINT -mypool/var/tmp@my_recursive_snapshot 8K - 152K - -# ls /var/tmp -vi.recover - - 可從 zfs list -t snapshot 的結果來確認 zfs rollback -r 會移除的快照。 - - - - 從快照還原個別檔案 - - 快照會掛載在父資料集下的隱藏目錄:.zfs/snapshots/snapshotname。預設不會顯示這些目錄,即使是用 ls -a 指令。雖然該目錄不會顯示,但該目錄實際存在,而且可以像一般的目錄一樣存取。一個名稱為 snapdir 的屬性可以控制是否在目錄清單中顯示這些隱藏目錄,設定該屬性為可見 (visible) 可以讓這些目錄出現在 ls 以及其他處理目錄內容的指令中。 - - # zfs get snapdir mypool/var/tmp -NAME PROPERTY VALUE SOURCE -mypool/var/tmp snapdir hidden default -# ls -a /var/tmp -. .. passwd vi.recover -# zfs set snapdir=visible mypool/var/tmp -# ls -a /var/tmp -. .. .zfs passwd vi.recover - - 要還原個別檔案到先前的狀態非常簡單,只要從快照中複製檔案到父資料集。在 .zfs/snapshot 目錄結構下有一個與先前所做的快照名稱相同的目錄,可以很容易的找到。在下個範例中,我們會示範從隱藏的 .zfs 目錄還原一個檔案,透過從含有該檔案的最新版快照複製: - - # rm /var/tmp/passwd -# ls -a /var/tmp -. .. .zfs vi.recover -# ls /var/tmp/.zfs/snapshot -after_cp my_recursive_snapshot -# ls /var/tmp/.zfs/snapshot/after_cp -passwd vi.recover -# cp /var/tmp/.zfs/snapshot/after_cp/passwd /var/tmp - - 執行 ls .zfs/snapshot 時,雖然 snapdir 可能已經設為隱藏,但仍可能可以顯示該目錄中的內容,這取決於管理者是否要顯示這些目錄,可以只顯示特定的資料集,而其他的則不顯示。從這個隱藏的 .zfs/snapshot 複製檔案或目錄非常簡單,除此之外,嘗試其他的動作則會出現以下錯誤: - - # cp /etc/rc.conf /var/tmp/.zfs/snapshot/after_cp/ -cp: /var/tmp/.zfs/snapshot/after_cp/rc.conf: Read-only file system - - 這個錯誤用來提醒使用者快照是唯讀的,在建立之後不能更改。無法複製檔案進去或從該快照目錄中移除,因為這會變更該資料集所代表的狀態。 - - 快照所消耗的空間是依據自快照之後父檔案系統做了多少變更來決定,快照的 written 屬性可以用來追蹤有多少空間被快照所使用。 - - 使用 zfs destroy dataset@snapshot 可以摧毀快照並回收空間。加上 可以遞迴移除所有在父資料集下使用同名的快照。加入 來顯示將要移除的快照清單以及估計回收的空間,而不會實際執行摧毀的操作。 - - - - - 管理複本 (Clone) - - 複本 (Clone) 是快照的複製,但更像是一般的資料集,與快照不同的是,複本是非唯讀的 (可寫),且可掛載,可以有自己的屬性。使用 zfs clone 建立複本之後,便無法再摧毀用來建立複本的快照。複本與快照的父/子關係可以使用 zfs promote 來對換。提升複本之後 ,快照便會成為複本的子資料集,而不是原來的父資料集,這個動作會改變空間計算的方式,但並不會實際改變空間的使用量。複本可以被掛載到 ZFS 檔案系統階層中的任何一點,並非只能位於原來快照的位置底下。 - - 要示範複本功能會用到這個範例資料集: - - # zfs list -rt all camino/home/joe -NAME USED AVAIL REFER MOUNTPOINT -camino/home/joe 108K 1.3G 87K /usr/home/joe -camino/home/joe@plans 21K - 85.5K - -camino/home/joe@backup 0K - 87K - - - 會使用到複本一般是要在可以保留快照以便出錯時可還原的情況下使用指定的資料集做實驗,由於快照並無法做更改,所以會建立一個可以讀/寫的快照複本。當在複本中做完想要執行的動作後,便可以提升複本成資料集,然後移除舊的檔案系統。嚴格來說這並非必要,因為複本與資料集可同時存在,不會有任何問題。 - - # zfs clone camino/home/joe@backup camino/home/joenew -# ls /usr/home/joe* -/usr/home/joe: -backup.txz plans.txt - -/usr/home/joenew: -backup.txz plans.txt -# df -h /usr/home -Filesystem Size Used Avail Capacity Mounted on -usr/home/joe 1.3G 31k 1.3G 0% /usr/home/joe -usr/home/joenew 1.3G 31k 1.3G 0% /usr/home/joenew - - 建立完的複本便有與建立快照時狀態相同的資料集,現在複本可以獨立於原來的資料集來做更改。剩下唯一與資料集之間的關係便是快照,ZFS 會在屬性 origin 記錄這個關係,一旦在快照與複本之間的相依關係因為使用 zfs promote 提升而移除時,複本的 origin 也會因為成為一個完全獨立的資料集而移除。以下範例會示範這個動作: - - # zfs get origin camino/home/joenew -NAME PROPERTY VALUE SOURCE -camino/home/joenew origin camino/home/joe@backup - -# zfs promote camino/home/joenew -# zfs get origin camino/home/joenew -NAME PROPERTY VALUE SOURCE -camino/home/joenew origin - - - - 做為部份更改之後,例如複製 loader.conf 到提升後的複本,這個例子中的舊目錄便無須保留,取而代之的是提升後的複本,這個動作可以用兩個連續的指令來完成:在舊資料集上執行 zfs destroy 並在與舊資料相似名稱 (也可能用完全不同的名稱) 的複本上執行 zfs rename - - # cp /boot/defaults/loader.conf /usr/home/joenew -# zfs destroy -f camino/home/joe -# zfs rename camino/home/joenew camino/home/joe -# ls /usr/home/joe -backup.txz loader.conf plans.txt -# df -h /usr/home -Filesystem Size Used Avail Capacity Mounted on -usr/home/joe 1.3G 128k 1.3G 0% /usr/home/joe - - 快照的複本現在可以如同一般資料集一樣使用,它的內容包含了所有來自原始快照的資料以及後來加入的檔案,例如 loader.conf。複本可以在許多不同的情境下使用提供 ZFS 的使用者有用的功能,例如,Jail 可以透過含有已安裝了各種應用程式集的快照來提供,使用者可以複製這些快照然後加入自己想要嘗試的應用程式,一但更改可以滿足需求,便可提升複本為完整的資料集然後提供給終端使用者,讓終端使用者可以如同實際擁有資料集一般的使用,這個以節省提供這些 Jail 的時間與管理成本。 - - - - 備份 (Replication) - - 將資料保存在單一地點的單一儲存池上會讓資料暴露在盜竊、自然或人為的風險之下,定期備份整個儲存池非常重要,ZFS 提供了內建的序列化 (Serialization) 功能可以將資料以串流傳送到標準輸出。使用這項技術,不僅可以將資料儲存到另一個已連結到本地系統的儲存池,也可以透過網路將資料傳送到另一個系統,這種備份方式以快照為基礎 (請參考章節 ZFS 快照(Snapshot))。用來備份資料的指令為 zfs sendzfs receive - - 以下例子將示範使用兩個儲存池來做 ZFS 備份: - - # zpool list -NAME SIZE ALLOC FREE CKPOINT EXPANDSZ FRAG CAP DEDUP HEALTH ALTROOT -backup 960M 77K 896M - - 0% 0% 1.00x ONLINE - -mypool 984M 43.7M 940M - - 0% 4% 1.00x ONLINE - - - 名為 mypool 的儲存池為主要的儲存池,資料會定期寫入與讀取的位置。第二個儲存池 backup 用來待命 (Standby),萬一主要儲存池無法使用時可替換。注意,ZFS 並不會自動做容錯移轉 (Fail-over),必須要由系統管理者在需要的時候手動完成。快照會用來提供一個與檔系統一致的版本來做備份,mypool 的快照建立之後,便可以複製到 backup 儲存池,只有快照可以做備份,最近一次快照之後所做的變更不會含在內容裡面。 - - # zfs snapshot mypool@backup1 -# zfs list -t snapshot -NAME USED AVAIL REFER MOUNTPOINT -mypool@backup1 0 - 43.6M - - - 快照存在以後,便可以使用 zfs send 來建立一個代表快照內容的串流,這個串流可以儲存成檔案或由其他儲存池接收。串流會寫入到標準輸出,但是必須要重新導向到一個檔案或轉接到其他地方,否則會錯誤: - - # zfs send mypool@backup1 -Error: Stream can not be written to a terminal. -You must redirect standard output. - - 要使用 zfs send 備份一個資料集,可重新導向到一個位於在已掛載到備份儲存池上的檔案。確定該儲存池有足夠的空間容納要傳送的快照,這裡指的是該快照中內含的所有資料,並非只有上次快照到該快照間的變更。 - - # zfs send mypool@backup1 > /backup/backup1 -# zpool list -NAME SIZE ALLOC FREE CKPOINT EXPANDSZ FRAG CAP DEDUP HEALTH ALTROOT -backup 960M 63.7M 896M - - 0% 6% 1.00x ONLINE - -mypool 984M 43.7M 940M - - 0% 4% 1.00x ONLINE - - - zfs send 會傳輸在快照 backup1 中所有的資料到儲存池 backup。可以使用 cron8 排程來自動完成建立與傳送快照的動作。 - - 若不想將備份以封存檔案儲存,ZFS 可用實際的檔案系統來接收資料,讓備份的資料可以直接被存取。要取得實際包含在串流中的資料可以用 zfs receive 將串流轉換回檔案與目錄。以下例子會以管線符號連接 zfs sendzfs receive,將資料從一個儲存池複製到另一個,傳輸完成後可以直接使用接收儲存池上的資料。一個資料集只可以被複製到另一個空的資料集。 - - # zfs snapshot mypool@replica1 -# zfs send -v mypool@replica1 | zfs receive backup/mypool -send from @ to mypool@replica1 estimated size is 50.1M -total estimated size is 50.1M -TIME SENT SNAPSHOT - -# zpool list -NAME SIZE ALLOC FREE CKPOINT EXPANDSZ FRAG CAP DEDUP HEALTH ALTROOT -backup 960M 63.7M 896M - - 0% 6% 1.00x ONLINE - -mypool 984M 43.7M 940M - - 0% 4% 1.00x ONLINE - - - - 漸進式備份 - - zfs send 也可以比較兩個快照之間的差異,並且只傳送兩者之間的差異,這麼做可以節省磁碟空間及傳輸時間。例如: - - # zfs snapshot mypool@replica2 -# zfs list -t snapshot -NAME USED AVAIL REFER MOUNTPOINT -mypool@replica1 5.72M - 43.6M - -mypool@replica2 0 - 44.1M - -# zpool list -NAME SIZE ALLOC FREE CKPOINT EXPANDSZ FRAG CAP DEDUP HEALTH ALTROOT -backup 960M 61.7M 898M - - 0% 6% 1.00x ONLINE - -mypool 960M 50.2M 910M - - 0% 5% 1.00x ONLINE - - - 會建立一個名為 replica2 的第二個快照,這個快照只中只會含有目前與前次快照 replica1 之間檔案系統所做的變更。使用 zfs send -i 並指定要用來產生漸進備份串流的快照,串流中只會含有做過更改的資料。這個動作只在接收端已經有初始快照時才可用。 - - # zfs send -v -i mypool@replica1 mypool@replica2 | zfs receive /backup/mypool -send from @replica1 to mypool@replica2 estimated size is 5.02M -total estimated size is 5.02M -TIME SENT SNAPSHOT - -# zpool list -NAME SIZE ALLOC FREE CKPOINT EXPANDSZ FRAG CAP DEDUP HEALTH ALTROOT -backup 960M 80.8M 879M - - 0% 8% 1.00x ONLINE - -mypool 960M 50.2M 910M - - 0% 5% 1.00x ONLINE - - -# zfs list -NAME USED AVAIL REFER MOUNTPOINT -backup 55.4M 240G 152K /backup -backup/mypool 55.3M 240G 55.2M /backup/mypool -mypool 55.6M 11.6G 55.0M /mypool - -# zfs list -t snapshot -NAME USED AVAIL REFER MOUNTPOINT -backup/mypool@replica1 104K - 50.2M - -backup/mypool@replica2 0 - 55.2M - -mypool@replica1 29.9K - 50.0M - -mypool@replica2 0 - 55.0M - - - 如此一來,便成功傳輸漸進式的串流,只有做過更改的資料會被備份,不會傳送完整的 replica1。由於不會備份完整的儲存池,只傳送差異的部份,所以可以減少傳輸的時間並節省磁碟空間,特別是在網路緩慢或需要考量每位元傳輸成本時非常有用。 - - 從儲存池 mypool 複製所有檔案與資料的新檔案系統 backup/mypool 便可以使用。若指定 ,會一併複製資料集的屬性,這包含壓縮 (Compression) 設定,配額 (Quota) 及掛載點 (Mount point)。若指定 ,會複製所有指定資料集的子資料集,及這些子資料集的所有屬性。可將傳送與接收自動化來定期使用第二個儲存池做備份。 - - - - 透過 <application>SSH</application> 傳送加密的備份 - - 透過網路來傳送串流是一個做遠端備份不錯的方式,但是也有一些缺點,透過網路連線傳送的資料沒有加密,這會讓任何人都可以在未告知傳送方的情況下攔截並轉換串流回資料,這是我們所不想見到的情況,特別是在使用網際網路傳送串流到遠端的主機時。SSH 可用來加密要透過網路連線傳送的資料,在 ZFS 只需要將串流重新導向到標準輸出,如此一來便可簡單的轉接到 SSH。若要讓檔案系統內容在傳送或在遠端系統中也維持在加密的狀態可考慮使用 PEFS。 - - 有一些設定以及安全性注意事項必須先完成,只有對 zfs send 操作必要的步驟才會在此說明,要取得更多有關 SSH 的資訊請參考 - - 必要的環境設定: - - - - 使用 SSH 金鑰設定傳送端與接收端間無密碼的 SSH 存取 - - - - 正常會需要 root 的權限來傳送與接收串流,這需要可以 root 登入到接收端系統。但是,預設因安全性考慮會關閉以 root 登入。ZFS 委託 (ZFS Delegation) 系統可以用來允許一個非 root 使用者在每個系統上執行各自的發送與接收操作。 - - - - 在傳送端系統上: - - # zfs allow -u someuser send,snapshot mypool - - - - 要掛載儲存池,無權限的使用者必須擁有該目錄且必須允許一般的使用者掛載檔案系統。在接收端系統上: - - # sysctl vfs.usermount=1 -vfs.usermount: 0 -> 1 -# sysrc -f /etc/sysctl.conf vfs.usermount=1 -# zfs create recvpool/backup -# zfs allow -u someuser create,mount,receive recvpool/backup -# chown someuser /recvpool/backup - - - - 無權限的使用者現在有能力可以接收並掛載資料集,且 home 資料集可以被複製到遠端系統: - - % zfs snapshot -r mypool/home@monday -% zfs send -R mypool/home@monday | ssh someuser@backuphost zfs recv -dvu recvpool/backup - - 替儲存在儲存池 mypool 上的檔案系統資料集 home 製作一個遞迴快照 monday,然後使用 zfs send -R 來傳送包含該資料集及其所有子資料集、快照、複製與設定的串流。輸出會被導向到 SSH 連線的遠端主機 backuphost 上等候輸入的 zfs receive,在此建議使用完整網域名稱或 IP 位置。接收端的機器會寫入資料到 recvpool 儲存池上的 backup 資料集,在 zfs recv 加上 可覆寫在接收端使用相同名稱的快照,加上 可讓檔案系統在接收端不會被掛載,當使用 ,會顯示更多有關傳輸的詳細資訊,包含已花費的時間及已傳輸的資料量。 - - - - - 資料集、使用者以及群組配額 - - 資料集配額 (Dataset quota) 可用來限制特定資料集可以使用的的空間量。參考配額 (Reference Quota) 的功能也非常相似,差在參考配額只會計算資料集自己使用的空間,不含快照與子資料集。類似的,使用者 (User) 與群組 (Group) 配額可以用來避免使用者或群組用掉儲存池或資料集的所有空間。 - - 要設定 storage/home/bob 的資料集配額為 10 GB: - - # zfs set quota=10G storage/home/bob - - 要設定 storage/home/bob 的參考配額為 10 GB: - - # zfs set refquota=10G storage/home/bob - - 要移除 storage/home/bob 的 10 GB 配額: - - # zfs set quota=none storage/home/bob - - 設定使用者配額的一般格式為 userquota@user=size 使用者的名稱必須使用以下格式: - - - - POSIX 相容的名稱,如 joe - - - - POSIX 數字 ID,如 789 - - - - SID 名稱,如 joe.bloggs@example.com - - - - SID 數字 ID,如 S-1-123-456-789 - - - - 例如,要設定使用者名為 joe 的使用者配額為 50 GB: - - # zfs set userquota@joe=50G - - 要移除所有配額: - - # zfs set userquota@joe=none - - - 使用者配額的屬性不會顯示在 zfs get all。非 root 的使用者只可以看到自己的配額,除非它們有被授予 userquota 權限,擁有這個權限的使用者可以檢視與設定任何人的配額。 - - - 要設定群組配額的一般格式為:groupquota@group=size - - 要設定群組 firstgroup 的配額為 50 GB 可使用: - - # zfs set groupquota@firstgroup=50G - - 要移除群組 firstgroup 的配額,或確保該群組未設定配額可使用: - - # zfs set groupquota@firstgroup=none - - 如同使用者配額屬性,非 root 使用者只可以查看自己所屬群組的配額。而 root 或擁有 groupquota 權限的使用者,可以檢視並設定所有群組的任何配額。 - - 要顯示在檔案系統或快照上每位使用者所使用的空間量及配額可使用 zfs userspace,要取得群組的資訊則可使用 zfs groupspace,要取得有關支援的選項資訊或如何只顯示特定選項的資訊請參考 zfs1 - - 有足夠權限的使用者及 root 可以使用以下指令列出 storage/home/bob 的配額: - - # zfs get quota storage/home/bob - - - - 保留空間 - - 保留空間 (Reservation) 可以確保資料集最少可用的空間量,其他任何資料集無法使用保留的空間,這個功能在要確保有足夠的可用空間來存放重要的資料集或日誌檔時特別有用。 - - reservation 屬性的一般格式為 reservation=size,所以要在 storage/home/bob 設定保留 10 GB 的空間可以用: - - # zfs set reservation=10G storage/home/bob - - 要清除任何保留空間: - - # zfs set reservation=none storage/home/bob - - 同樣的原則可以應用在 refreservation 屬性來設定參考保留空間 (Reference Reservation),參考保留空間的一般格式為 refreservation=size - - 這個指令會顯示任何已設定於 storage/home/bob 的 reservation 或 refreservation: - - # zfs get reservation storage/home/bob -# zfs get refreservation storage/home/bob - - - - 壓縮 (Compression) - - ZFS 提供直接的壓縮功能,在資料區塊層級壓縮資料不僅可以節省空間,也可以增加磁碟的效能。若資料壓縮了 25%,但壓縮的資料會使用了與未壓縮版本相同的速率寫入到磁碟,所以實際的寫入速度會是原來的 125%。壓縮功能也可來替代去重複 (Deduplication) 功能,因為壓縮並不需要使用額外的記憶體。 - - ZFS 提了多種不同的壓縮演算法,每一種都有不同的優缺點,隨著 ZFS v5000 引進了 LZ4 壓縮技術,可對整個儲存池開啟壓縮,而不像其他演算法需要消耗大量的效能來達成,最大的優點是 LZ4 擁有 提早放棄 的功能,若 LZ4 無法在資料一開始的部份達成至少 12.5% 的壓縮率,便會以不壓縮的方式來寫入資料區塊來避免 CPU 在那些已經壓縮過或無法壓縮的資料上浪費運算能力。要取得更多有關 ZFS 中可用的壓縮演算法詳細資訊,可參考術語章節中的壓縮 (Compression) 項目。 - - 管理者可以使用資料集的屬性來監視壓縮的效果。 - - # zfs get used,compressratio,compression,logicalused mypool/compressed_dataset -NAME PROPERTY VALUE SOURCE -mypool/compressed_dataset used 449G - -mypool/compressed_dataset compressratio 1.11x - -mypool/compressed_dataset compression lz4 local -mypool/compressed_dataset logicalused 496G - - - 資料集目前使用了 449 GB 的空間 (在 used 屬性)。在尚未壓縮前,該資料集應該會使用 496 GB 的空間 (於 logicalused 屬性),這個結果顯示目前的壓縮比為 1.11:1。 - - 壓縮功能在與使用者配額 (User Quota) 一併使用時可能會產生無法預期的副作用。使用者配額會限制一個使用者在一個資料集上可以使用多少空間,但衡量的依據是以 壓縮後 所使用的空間,因此,若一個使用者有 10 GB 的配額,寫入了 10 GB 可壓縮的資料,使用者將還會有空間儲存額外的資料。若使用者在之後更新了一個檔案,例如一個資料庫,可能有更多或較少的可壓縮資料,那麼剩餘可用的空間量也會因此而改變,這可能會造成奇怪的現象便是,一個使用者雖然沒有增加實際的資料量 (於 logicalused 屬性),但因為更改影響了壓縮率,導致使用者達到配額的上限。 - - 壓縮功能在與備份功能一起使用時也可能會有類似的問題,通常會使用配額功能來限制能夠儲存的資料量來確保有足夠的備份空間可用。但是由於配額功能並不會考量壓縮狀況,可能會有比未壓縮版本備份更多的資料量會被寫入到資料集。 - - - - 去重複 (Deduplication) - - 當開啟,去重複 (Deduplication) 功能會使用每個資料區塊的校驗碼 (Checksum) 來偵測重複的資料區塊,當新的資料區塊與現有的資料區塊重複,ZFS 便會寫入連接到現有資料的參考來替代寫入重複的資料區塊,這在資料中有大量重複的檔案或資訊時可以節省大量的空間,要注意的是:去重複功能需要使用大量的記憶體且大部份可節省的空間可改開啟壓縮功能來達成,而壓縮功能不需要使用額外的記憶體。 - - 要開啟去重複功能,需在目標儲存池設定 dedup 屬性: - - # zfs set dedup=on pool - - 只有要被寫入到儲存池的新資料才會做去重複的動作,先前已被寫入到儲存池的資料不會因此啟動了這個選項而做去重複。查看已開啟去重複屬性的儲存池會如下: - - # zpool list -NAME SIZE ALLOC FREE CKPOINT EXPANDSZ FRAG CAP DEDUP HEALTH ALTROOT -pool 2.84G 2.19M 2.83G - - 0% 0% 1.00x ONLINE - - - DEDUP 欄位會顯示儲存池的實際去重複率,數值為 1.00x 代表資料尚未被去重複。在下一個例子會在前面所建立的去重複儲存池中複製三份 Port 樹到不同的目錄中。 - - # for d in dir1 dir2 dir3; do -> mkdir $d && cp -R /usr/ports $d & -> done - - 已經偵測到重複的資料並做去重複: - - # zpool list -NAME SIZE ALLOC FREE CKPOINT EXPANDSZ FRAG CAP DEDUP HEALTH ALTROOT -pool 2.84G 20.9M 2.82G - - 0% 0% 3.00x ONLINE - - - DEDUP 欄位顯示有 3.00x 的去重複率,這代表已偵測到多份複製的 Port 樹資料並做了去重複的動作,且只會使用第三份資料所佔的空間。去重複能節省空間的潛力可以非常巨大,但會需要消耗大量的記憶體來持續追蹤去重複的資料區塊。 - - 去重複並非總是有效益的,特別是當儲存池中的資料本身並沒有重複時。ZFS 可以透過在現有儲存池上模擬開啟去重複功能來顯示可能節省的空間: - - # zdb -S pool -Simulated DDT histogram: - -bucket allocated referenced -______ ______________________________ ______________________________ -refcnt blocks LSIZE PSIZE DSIZE blocks LSIZE PSIZE DSIZE ------- ------ ----- ----- ----- ------ ----- ----- ----- - 1 2.58M 289G 264G 264G 2.58M 289G 264G 264G - 2 206K 12.6G 10.4G 10.4G 430K 26.4G 21.6G 21.6G - 4 37.6K 692M 276M 276M 170K 3.04G 1.26G 1.26G - 8 2.18K 45.2M 19.4M 19.4M 20.0K 425M 176M 176M - 16 174 2.83M 1.20M 1.20M 3.33K 48.4M 20.4M 20.4M - 32 40 2.17M 222K 222K 1.70K 97.2M 9.91M 9.91M - 64 9 56K 10.5K 10.5K 865 4.96M 948K 948K - 128 2 9.50K 2K 2K 419 2.11M 438K 438K - 256 5 61.5K 12K 12K 1.90K 23.0M 4.47M 4.47M - 1K 2 1K 1K 1K 2.98K 1.49M 1.49M 1.49M - Total 2.82M 303G 275G 275G 3.20M 319G 287G 287G - -dedup = 1.05, compress = 1.11, copies = 1.00, dedup * compress / copies = 1.16 - - zdb -S 分析完儲存池後會顯示在啟動去重複後可達到的空間減少比例。在本例中,1.16 是非常差的空間節省比例,因為這個比例使用壓縮功能便能達成。若在此儲存池上啟動去重複並不能明顯的節省空間使用量,那麼就不值得耗費大量的記憶體來開啟去重複功能。透過公式 ratio = dedup * compress / copies,系統管理者可以規劃儲存空間的配置,來判斷要處理的資料是否有足夠的重複資料區塊來平衡所需的記憶體。若資料是可壓縮的,那麼空間節少的效果可能會非常好,建議先開啟壓縮功能,且壓縮功能也可以大大提高效能。去重複功能只有在可以節省可觀的空間且有足夠的記憶體做 DDT 時才開啟。 - - - - <acronym>ZFS</acronym> 與 Jail - - zfs jail 以及相關的 jailed 屬性可以用來將一個 ZFS 資料集委託給一個 Jail 管理。zfs jail jailid 可以將一個資料集連結到一個指定的 Jail,而 zfs unjail 則可解除連結。資料集要可以在 Jail 中控制需設定 jailed 屬性,一旦資料集被隔離便無法再掛載到主機,因為有掛載點可能會破壞主機的安全性。 - - - - - 委託管理 - - 一個全面性的權限委託系統可能無權限的使用者執行 ZFS 的管理功能。例如,若每個使用者的家目錄均為一個資料集,便可以給予使用者權限建立與摧毀它們家目錄中的快照。可以給予備份使用者使用備份功能的權限。一個使用量統計的 Script 可以允許其在執行時能存取所有使用者的空間利用率資料。甚至可以將委託權限委託給其他人,每個子指令與大多數屬性都可使用權限委託。 - - - 委託資料集建立 - - zfs allow someuser create mydataset 可以給予指定的使用者在指定的父資料集下建立子資料集的權限。這裡需要注意:建立新資料集會牽涉到掛載,因此需要設定 FreeBSD 的 vfs.usermount sysctl81 來允許非 root 的使用者掛載一個檔案系統。這裡還有另一項限制可以避免濫用:非 root 使用者必須擁有掛載點在檔案系統中所在位置的權限才可掛載。 - - - - 委託權限委託 - - zfs allow someuser allow mydataset 可以給予指定的使用者有權限指派它們在目標資料集或其子資料集上擁有的任何權限給其他人。若該使用者擁有 snapshot 權限及 allow 權限,則該使用者可以授權 snapshot 權限給其他使用者。 - - - - - 進階主題 - - - 調校 - - 這裡有數個可調校的項目可以調整,來讓 ZFS 在面對各種工作都能以最佳狀況運作。 - - - - vfs.zfs.arc_max - - Maximum size of the ARC. - The default is all RAM but 1 GB, - or 5/8 of all RAM, whichever is more. - However, a lower value should be used if the system will - be running any other daemons or processes that may require - memory. This value can be adjusted at runtime with - sysctl8 and can be set in - /boot/loader.conf or - /etc/sysctl.conf. - - - - vfs.zfs.arc_meta_limit - - Limit the portion of the - ARC - that can be used to store metadata. The default is one - fourth of vfs.zfs.arc_max. Increasing - this value will improve performance if the workload - involves operations on a large number of files and - directories, or frequent metadata operations, at the cost - of less file data fitting in the ARC. - This value can be adjusted at runtime with sysctl8 - and can be set in - /boot/loader.conf or - /etc/sysctl.conf. - - - - vfs.zfs.arc_min - - Minimum size of the ARC. - The default is one half of - vfs.zfs.arc_meta_limit. Adjust this - value to prevent other applications from pressuring out - the entire ARC. - This value can be adjusted at runtime with sysctl8 - and can be set in - /boot/loader.conf or - /etc/sysctl.conf. - - - - vfs.zfs.vdev.cache.size - - A preallocated amount of memory reserved as a cache for - each device in the pool. The total amount of memory used - will be this value multiplied by the number of devices. - This value can only be adjusted at boot time, and is set - in /boot/loader.conf. - - - - vfs.zfs.min_auto_ashift - - Minimum ashift (sector size) that - will be used automatically at pool creation time. The - value is a power of two. The default value of - 9 represents - 2^9 = 512, a sector size of 512 bytes. - To avoid write amplification and get - the best performance, set this value to the largest sector - size used by a device in the pool. - - Many drives have 4 KB sectors. Using the default - ashift of 9 with - these drives results in write amplification on these - devices. Data that could be contained in a single - 4 KB write must instead be written in eight 512-byte - writes. ZFS tries to read the native - sector size from all devices when creating a pool, but - many drives with 4 KB sectors report that their - sectors are 512 bytes for compatibility. Setting - vfs.zfs.min_auto_ashift to - 12 (2^12 = 4096) - before creating a pool forces ZFS to - use 4 KB blocks for best performance on these - drives. - - Forcing 4 KB blocks is also useful on pools where - disk upgrades are planned. Future disks are likely to use - 4 KB sectors, and ashift values - cannot be changed after a pool is created. - - In some specific cases, the smaller 512-byte block - size might be preferable. When used with 512-byte disks - for databases, or as storage for virtual machines, less - data is transferred during small random reads. This can - provide better performance, especially when using a - smaller ZFS record size. - - - - vfs.zfs.prefetch_disable - - Disable prefetch. A value of 0 is - enabled and 1 is disabled. The default - is 0, unless the system has less than - 4 GB of RAM. Prefetch works by - reading larger blocks than were requested into the - ARC - in hopes that the data will be needed soon. If the - workload has a large number of random reads, disabling - prefetch may actually improve performance by reducing - unnecessary reads. This value can be adjusted at any time - with sysctl8. - - - - vfs.zfs.vdev.trim_on_init - - Control whether new devices added to the pool have the - TRIM command run on them. This ensures - the best performance and longevity for - SSDs, but takes extra time. If the - device has already been secure erased, disabling this - setting will make the addition of the new device faster. - This value can be adjusted at any time with - sysctl8. - - - - vfs.zfs.vdev.max_pending - - Limit the number of pending I/O requests per device. - A higher value will keep the device command queue full - and may give higher throughput. A lower value will reduce - latency. This value can be adjusted at any time with - sysctl8. - - - - vfs.zfs.top_maxinflight - - Maxmimum number of outstanding I/Os per top-level - vdev. Limits the - depth of the command queue to prevent high latency. The - limit is per top-level vdev, meaning the limit applies to - each mirror, - RAID-Z, or - other vdev independently. This value can be adjusted at - any time with sysctl8. - - - - vfs.zfs.l2arc_write_max - - Limit the amount of data written to the L2ARC - per second. This tunable is designed to extend the - longevity of SSDs by limiting the - amount of data written to the device. This value can be - adjusted at any time with sysctl8. - - - - vfs.zfs.l2arc_write_boost - - The value of this tunable is added to vfs.zfs.l2arc_write_max - and increases the write speed to the - SSD until the first block is evicted - from the L2ARC. - This Turbo Warmup Phase is designed to - reduce the performance loss from an empty L2ARC - after a reboot. This value can be adjusted at any time - with sysctl8. - - - - vfs.zfs.scrub_delay - - Number of ticks to delay between each I/O during a - scrub. - To ensure that a scrub does not - interfere with the normal operation of the pool, if any - other I/O is happening the - scrub will delay between each command. - This value controls the limit on the total - IOPS (I/Os Per Second) generated by the - scrub. The granularity of the setting - is determined by the value of kern.hz - which defaults to 1000 ticks per second. This setting may - be changed, resulting in a different effective - IOPS limit. The default value is - 4, resulting in a limit of: - 1000 ticks/sec / 4 = - 250 IOPS. Using a value of - 20 would give a limit of: - 1000 ticks/sec / 20 = - 50 IOPS. The speed of - scrub is only limited when there has - been recent activity on the pool, as determined by vfs.zfs.scan_idle. - This value can be adjusted at any time with - sysctl8. - - - - vfs.zfs.resilver_delay - - Number of milliseconds of delay inserted between - each I/O during a - resilver. To - ensure that a resilver does not interfere with the normal - operation of the pool, if any other I/O is happening the - resilver will delay between each command. This value - controls the limit of total IOPS (I/Os - Per Second) generated by the resilver. The granularity of - the setting is determined by the value of - kern.hz which defaults to 1000 ticks - per second. This setting may be changed, resulting in a - different effective IOPS limit. The - default value is 2, resulting in a limit of: - 1000 ticks/sec / 2 = - 500 IOPS. Returning the pool to - an Online state may - be more important if another device failing could - Fault the pool, - causing data loss. A value of 0 will give the resilver - operation the same priority as other operations, speeding - the healing process. The speed of resilver is only - limited when there has been other recent activity on the - pool, as determined by vfs.zfs.scan_idle. - This value can be adjusted at any time with - sysctl8. - - - - vfs.zfs.scan_idle - - Number of milliseconds since the last operation before - the pool is considered idle. When the pool is idle the - rate limiting for scrub - and - resilver are - disabled. This value can be adjusted at any time with - sysctl8. - - - - vfs.zfs.txg.timeout - - Maximum number of seconds between - transaction groups. - The current transaction group will be written to the pool - and a fresh transaction group started if this amount of - time has elapsed since the previous transaction group. A - transaction group my be triggered earlier if enough data - is written. The default value is 5 seconds. A larger - value may improve read performance by delaying - asynchronous writes, but this may cause uneven performance - when the transaction group is written. This value can be - adjusted at any time with sysctl8. - - - - - - - - i386 上的 <acronym>ZFS</acronym> - - ZFS 所提供的部份功能需要使用大量記憶體,且可能需要對有限 RAM 的系統調校來取得最佳的效率。 - - - 記憶體 - - 最低需求,總系統記憶體應至少有 1 GB,建議的 RAM 量需視儲存池的大小以及使用的 ZFS 功能而定。一般的經驗法則是每 1 TB 的儲存空間需要 1 GB 的 RAM,若有開啟去重複的功能,一般的經驗法則是每 1 TB 的要做去重複的儲存空間需要 5 GB 的 RAM。雖然有部份使用者成功使用較少的 RAM 來運作 ZFS,但系統在負載較重時有可能會因為記憶用耗而導致當機,對於要使用低於建議 RAM 需求量來運作的系統可能會需要更進一步的調校。 - - - - 核心設定 - - 由於在 i386 平台上位址空間的限制,在 i386 架構上的 ZFS 使用者必須加入這個選項到自訂核心設定檔,重新編譯核心並重新開啟: - - options KVA_PAGES=512 - - 這個選項會增加核心位址空間,允許調整 vm.kvm_size 超出目前的 1 GB 限制或在 PAE 的 2 GB 限制。要找到這個選項最合適的數值,可以將想要的位址空間換算成 MB 然後除以 4,在本例中,以 2 GB 計算後即為 512 - - - - 載入程式可調參數 - - 在所有的 FreeBSD 架構上均可增加 kmem 位址空間,經測試在一個 1 GB 實體記憶體的測試系統上,加入以下選項到 /boot/loader.conf,重新開啟系統,可成功設定: - - vm.kmem_size="330M" -vm.kmem_size_max="330M" -vfs.zfs.arc_max="40M" -vfs.zfs.vdev.cache.size="5M" - - 要取得更多詳細的 ZFS 相關調校的建議清單,請參考 - - - - - - 其他資源 - - - - FreeBSD - Wiki - ZFS - - - - FreeBSD - Wiki - ZFS Tuning - - - - Illumos - Wiki - ZFS - - - - Oracle - Solaris ZFS Administration - Guide - - - - Calomel - Blog - ZFS Raidz Performance, Capacity - and Integrity - - - - - - <acronym>ZFS</acronym> 特色與術語 - - ZFS 是一個從本質上與眾不同的檔案系統,由於它並非只是一個檔案系統,ZFS 結合了檔案系統及磁碟區管理程式,讓額外的儲存裝置可以即時的加入到系統並可讓既有的檔案系統立即使用這些在儲存池中空間。透過結合傳統區分為二的兩個角色,ZFS 能夠克服以往 RAID 磁碟群組無法擴充的限制。每個在儲存池頂層的裝置稱作 vdev,其可以是一個簡單的磁碟或是一個 RAID 如鏡像或 RAID-Z 陣列。ZFS 的檔案系統 (稱作 資料集 (Dataset)) 每一個資料集均可存取整個存池所共通的可用空間,隨著使用儲存池來配置空間區塊,儲存池能給每個檔案系統使用的可用空間就會減少,這個方法可以避免擴大分割區會使的可用空間分散分割區之間的常見問題。 - - - - - - 儲存池 (Pool) - - 儲存池 (Pool) 是建構 ZFS 最基礎的單位。一個儲存池可由一個或多個 vdev 所組成,是用來儲存資料的底層裝置。儲存池會被拿來建立一個或多個檔案系統 (資料集 Dataset) 或區塊裝置 (磁碟區 Volume),這些資料集與磁碟區會共用儲存池的剩餘可用空間。每一個儲存池可由名稱與 GUID 來辨識。可用的功能會依儲存池上的 ZFS 版本而有不同。 - - - - vdev 型態 (vdev Types) - - 儲存池是由一個或多個 vdev 所組成,vdev 可以是一個磁碟或是 RAID Transform 的磁碟群組。當使用多個 vdev,ZFS 可以分散資料到各個 vdev 來增加效能與最大的可用空間。 - - 磁碟 (Disk) - 最基本的 vdev 型態便是一個標準的資料區塊裝置,這可以是一整個磁碟 (例如 /dev/ada0/dev/da0) 或一個分割區 (/dev/ada0p3)。在 FreeBSD 上,使用分割區來替代整個磁碟不會影響效能,這可能與 Solaris 說明文件所建議的有所不同。 - - - - 檔案 (File) - 除了磁碟外,ZFS 儲存池可以使用一般檔案為基礎,這在測試與實驗時特別有用。在 zpool create 時使用檔案的完整路徑作為裝置路徑。所有 vdev 必須至少有 128 MB 的大小。 - - - - 鏡像 (Mirror) - 要建立鏡像,需使用 mirror 關鍵字,後面接著要做為該鏡像成員裝置的清單。一個鏡像需要由兩個或多個裝置來組成,所有的資料都會被寫入到所有的成員裝置。鏡像 vdev 可以對抗所有成員故障只剩其中一個而不損失任何資料。 - - - 正常單一磁碟的 vdev 可以使用 zpool attach 隨時升級成為鏡像 vdev。 - - - - - RAID-Z - ZFS 實作了 RAID-Z,以標準的 RAID-5 修改而來,可提供奇偶校驗 (Parity) 更佳的分散性並去除了 RAID-5 write hole 導致在預期之外的重啟後資料與奇偶校驗資訊不一致的問題。ZFS 支援三個層級的 RAID-Z,可提供不同程度的備援來換取減少不同程度的可用空間,類型的名稱以陣列中奇偶校驗裝置的數量與儲存池可以容許磁碟故障的數量來命名,從 RAID-Z1RAID-Z3 - - RAID-Z1 配置 4 個磁碟,每個磁碟 1 TB,可用的儲存空間則為 3 TB,且若其中一個磁碟故障仍可以降級 (Degraded) 的模式運作,若在故障磁碟尚未更換並修復 (Resilver) 之前又有磁碟故障,所有在儲存池中的資料便會遺失。 - - RAID-Z3 配置 8 個 1 TB 的磁碟,磁碟區將會可以提供 5 TB 的可用空間且在 3 個磁碟故障的情況下仍可運作。Sun 建議單一個 vdev 不要使用超過 9 個磁碟。若配置需要使用更多磁碟,建議分成兩個 vdev,這樣儲存池的資料便會分散到這兩個 vdev。 - - 使用兩個 RAID-Z2 各由 8 個磁碟組成的 vdev 的配置可以建立一個類似 RAID-60 的陣列。RAID-Z 群組的儲存空量會接近其中最小的磁碟乘上非奇偶校驗磁碟的數量。4 個 1 TB 磁碟在 RAID-Z1 會有接近 3 TB 的實際大小,且一個由 8 個 1 TB 磁碟組成的 RAID-Z3 陣列會有 5 TB 的可用空間。 - - - - 備援 (Spare) - ZFS 有特殊的虛擬 vdev 型態可用來持續追蹤可用的熱備援裝置 (Hot spare)。注意,安裝的熱備援裝置並不會自動佈署,熱備援裝置需要手動使用 zfs replace 設定替換故障的裝置。 - - - - 日誌 (Log) - ZFS 記錄裝置,也被稱作 ZFS 意圖日誌 (ZFS Intent Log, ZIL) 會從正常的儲存池裝置移動意圖日誌到獨立的裝置上,通常是一個 SSD。有了獨立的日誌裝置,可以明顯的增進有大量同步寫入應用程式的效能,特別是資料庫。日誌裝置可以做成鏡像,但不支援 RAID-Z,若使用多個日誌裝置,寫入動作會被負載平衡分散到這些裝置。 - - - - 快取 (Cache) - 加入快取 vdev 到儲存池可以增加儲存空間的 L2ARC 快取。快取裝置無法做鏡像,因快取裝置只會儲存額外的現有資料的複本,並沒有資料遺失的風險。 - - - - - - 交易群組 (Transaction Group, TXG) - - 交易群組是一種將更動的資料區塊包裝成一組的方式,最後再一次寫入到儲存池。交易群組是 ZFS 用來檢驗一致性的基本單位。每個交易群組會被分配一個獨一無二的 64-bit 連續代號。最多一次可以有三個活動中的交易群組,這三個交易群組的每一個都有這三種狀態: - - 開放 (Open) - 新的交易群組建立之後便處於開放的狀態,可以接受新的寫入動作。永遠會有開放狀態的交易群組,即始交易群組可能會因到達上限而拒絕新的寫入動作。一但開放的交易群組到達上限或到達 vfs.zfs.txg.timeout,交易群組便會繼續進入下一個狀態。 - - - - 靜置中 (Quiescing) - 一個短暫的狀態,會等候任何未完成的操作完成,不會阻擋新開放的交易群組建立。一旦所有在群組中的交易完成,交易群組便會進入到最終狀態。 - - - - 同步中 (Syncing) - 所有在交易群組中的資料會被寫任到穩定的儲存空間,這個程序會依序修改其他也需同樣寫入到穩定儲存空間的資料,如 Metadata 與空間對應表。同步的程多會牽涉多個循環,首先是同步所有更改的資料區塊,也是最大的部份,接著是 Metadata,這可能會需要多個循環來完成。由於要配置空間供資料區塊使用會產生新的 Metadata,同步中狀態在到達循環完成而不再需要分配任何額外空間的狀態前無法結束。同步中狀態也是完成 synctask 的地方,Synctask 是指管理操作,如:建立或摧毀快照與資料集,會修改 uberblock,也會在此時完成。同步狀態完成後,其他處於狀態中狀態的交易群組便會進入同步中狀態。 - - 所有管理功能如快照 (Snapshot) 會作為交易群組的一部份寫入。當 synctask 建立之後,便會加入到目前開放的交易群組中,然後該群組會盡快的進入同步中狀態來減少管理指令的延遲。 - - - - Adaptive Replacement - Cache (ARC) - - ZFS 使用了自適應替換快取 (Adaptive Replacement Cache, ARC),而不是傳統的最近最少使用 (Least Recently Used, LRU) 快取,LRU 快取在快取中是一個簡單的項目清單,會依每個物件最近使用的時間來排序,新項會加入到清單的最上方,當快取額滿了便會去除清單最下方的項目來空出空間給較常使用的物件。ARC 結合了四種快取清單,最近最常使用 (Most Recently Used, MRU) 及最常使用 (Most Frequently Used, MFU) 物件加上兩個清單各自的幽靈清單 (Ghost list),這些幽靈清單會追蹤最近被去除的物件來避免又被加回到快取,避免過去只有偶爾被使用的物件加入清單可以增加快取的命中率。同時使用 MRUMFU 的另外一個優點是掃描一個完整檔案系統可以去除在 MRULRU 快取中的所有資料,有利於這些才剛存取的內容。使用 ZFS 也有 MFU 可只追蹤最常使用的物件並保留最常被存取的資料區塊快取。 - - - - L2ARC - - L2ARCZFS 快取系統的第二層,主要的 ARC 會儲存在 RAM 當中,但因為 RAM 可用的空間量通常有限,因此 ZFS 也可以使用 快取 vdev (Cache vdev)。固態磁碟 (Solid State Disk, SSD) 常被拿來此處作為快取裝置,因為比起傳統旋轉碟片的磁碟,固態磁碟有較快的速度與較低的延遲。L2ARC 是選用的,但使用可以明顯增進那些已使用 SSD 快取的檔案讀取速度,無須從一般磁碟讀取。L2ARC 也同樣可以加速去重複 (Deduplication),因為 DDT 並不適合放在 RAM,但適合放在 L2ARC,比起要從磁碟讀取,可以加快不少速度。為了避免 SSD 因寫入次速過多而過早耗損,加入到快取裝置的資料速率會被限制,直到快取用盡 (去除第一個資料區塊來騰出空間) 之前,寫入到 L2ARC 的資料速率會限制在寫入限制 (Write limit) 與加速限制 (Boost limit) 的總合,之後則會限制為寫入限制,可以控制這兩個速度限制的 sysctl8 數值分別為 vfs.zfs.l2arc_write_max 控制每秒有多少數位元組可寫入到快取,而 vfs.zfs.l2arc_write_boost 可在 渦輪預熱階段 (即寫入加速) 時增加寫入限制。 - - - - ZIL - - ZIL 會使用比主要儲存池還更快的儲存裝置來加速同步寫入動作 (Synchronous transaction),如 SSD。當應用程式請求做一個同步的寫入時 (保証資料會安全的儲存到磁碟,而不是先快取稍後再寫入),資料會先寫入到速度較快的 ZIL 儲存空間,之後再一併寫入到一般的磁碟。這可大量的減少延遲並增進效能。ZIL 只會有利於使用像資料庫這類的同步工作,一般非同步的寫入像複製檔案,則完全不會用到 ZIL - - - - 寫入時複製 (Copy-On-Write) - - 不像傳統的檔案系統,在 ZFS,當資料要被覆寫時,不會直接覆寫舊資料所在的位置,而是將新資料會寫入到另一個資料區塊,只在資料寫入完成後才會更新 Metadata 指向新的位置。因此,在發生寫入中斷 (在寫入檔案的過程中系統當機或電源中斷) 時,原來檔案的完整內容並不會遺失,只會放棄未寫入完成的新資料,這也意謂著 ZFS 在發生預期之外的關機後不需要做 fsck8 - - - - 資料集 (Dataset) - - 資料集 (Dataset)ZFS 檔案系統、磁碟區、快照或複本的通用術語。每個資料集都有獨一無二的名稱使用 poolname/path@snapshot 格式。儲存池的根部技術上來說也算一個資料集,子資料集會採用像目錄一樣的層級來命名,例如 mypool/home,home 資料集是 mypool 的子資料集並且會繼承其屬性。這可以在往後繼續擴展成 mypool/home/user,這個孫資料集會繼承其父及祖父的屬性。在子資料集的屬性可以覆蓋預設繼承自父及祖父的屬性。資料集及其子資料級的管理權限可以委託 (Delegate) 給他人。 - - - - 檔案系統 (File system) - - ZFS 資料集最常被當做檔案系統使用。如同大多數其他的檔案系統,ZFS 檔案系統會被掛載在系統目錄層級的某一處且內含各自擁有權限、旗標及 Metadata 的檔案與目錄。 - - - - 磁碟區 (Volume) - - 除了一般的檔案系統資料集之外,ZFS 也可以建立磁碟區 (Volume),磁碟區是資料區塊裝置。磁碟區有許多與資料集相似的功能,包含複製時寫入、快照、複本以及資料校驗。要在 ZFS 的頂層執行其他檔案系統格式時使用磁碟區非常有用,例如 UFS 虛擬化或匯出 iSCSI 延伸磁區 (Extent)。 - - - - 快照 (Snapshot) - - ZFS 的寫入時複製 (Copy-On-Write, COW) 設計可以使用任意的名稱做到幾乎即時、一致的快照。在製做資料集的快照或父資料集遞迴快照 (會包含其所有子資料集) 之後,新的資料會寫入到資的資料區塊,但不會回收舊的資料區塊為可用空間,快照中會使用原版本的檔案系統,而快照之後所做的變更則會儲存在目前的檔案系統,因此不會重複使用額外的空間。當新的資料寫入到目前的檔案系統,便會配置新的資料區塊來儲存這些資料。快照表面大小 (Apparent size) 會隨著在目前檔案系統停止使用的資料區塊而成長,但僅限於快照。可以用唯讀的方式掛載這些快照來復原先前版本的檔案,也可以還原 (Rollback) 目前的檔案系統到指定的快照,來還原任何在快照之後所做的變更。每個在儲存池中的資料區塊都會有一個參考記數器,可以用來持續追蹤有多少快照、複本、資料集或是磁碟區使用這個資料區塊,當刪除檔案與快照參照的計數變會滅少,直到沒有任何東西參考這個資料區塊才會被回收為可用空間。快照也可使用 hold 來標記,檔標記為 hold 時,任何嘗試要刪除該快照的動作便會回傳 EBUSY 的錯誤,每個快照可以標記多個不同唯一名稱的 hold,而 release 指令則可以移除 hold,這樣才可刪除快照。在磁碟區上快可以製作快照,但只能用來複製或還原,無法獨立掛載。 - - - - 複本 (Clone) - - 快照也可以做複本,複本是可寫入版本的快照,讓檔案系統可分支成為新的資料集。如同快照,複本一開始不會消耗任何額外空間,隨著新資料寫入到複本會配置新的資料區塊,複本的表面大小 (Apparent size) 才會成長,當在複本檔案系統或磁碟區的資料區塊被覆寫時,在先前資料區塊的參考計數則會減少。建立複本所使用的快照無法被刪除,因為複本會相依該快照,快照為父,複本為子。複本可以被提升 (promoted)、反轉相依關係,來讓複本成為父,之前的父變為子,這個操作不需要額外的空間。由於反轉了父與子使用的空間量,所以可能會影響既有的配額 (Quota) 與保留空間 (Reservation)。 - - - - 校驗碼 (Checksum) - - 配置每個資料區塊快的同時也會做資料校驗,資料校驗用的演算法是依資料集屬性而有所不同的,請參考 set。每個資料區塊會在讀取的過成便完成校驗,讓 ZFS 可以偵測到隱藏的損壞,若資料不符合預期的校驗碼,ZFS 會嘗試從任何可用的備援來還原資料,例如鏡像 (Mirror) 或 RAID-Z。要檢驗所有資料的校驗碼可以使用清潔 (Scrub),資料校驗的演算法有: - - fletcher2 - - - - fletcher4 - - - - sha256 - - fletcher 演算法最快,而 sha256 雖較消耗效能,但其有強大的密碼雜湊與較低的衝突率。也可關閉資料校驗,但並不建議。 - - - - 壓縮 (Compression) - - 每個資料集都有壓縮 (Compression) 屬性,預設是關閉的,這個屬性可以設定使用以下幾個壓縮演算法的其中一個來壓縮寫入到資料集的新資料。壓縮除了減少空間使用量外,常也會增加讀取與寫入的吞吐量,因為會減少讀取與寫入的資料區塊。 - - LZ4 - ZFS 儲存池版本 5000 (功能旗標) 後所增加,LZ4 現在是建議的壓縮演算法,在處理可壓縮的資料時 LZ4 壓縮比 LZJB 快將近 50%,在處理不可壓縮的資料時快將近三倍,LZ4 解壓縮也比 LZJB 將近 80%。在現代的 CPU 上,LZ4 經常平均可用 500 MB/s 的速度壓縮,而解壓縮可到達 1.5 GB/s (每個 CPU 核心)。 - - - - LZJB - 預設的壓縮演算法。由 Jeff Bonwick 所開發 (ZFS 的創始人之一)。LZJBGZIP 相比,可以較低的 CPU 提供較佳的壓縮功能。在未來預設的壓縮演算法將會更換為 LZ4 - - - - GZIP - 在 ZFS 可用的熱門串流壓縮演算法。使用 GZIP 主要的優點之一便是可設定壓縮層級。當設定 compress 屬性,管理者可以選擇壓縮層級範圍從最低的壓縮層級 gzip1 到最高的壓縮層級 gzip9。這讓管理者可以控制要使用多少 CPU 來節省磁碟空間。 - - - - ZLE - 零長度編號是一個特殊的壓縮演算法,它只會壓縮連續的零。這種壓縮演算法只在資料集中含有大量為零的資料區塊時有用。 - - - - - - 備份數 (Copies) - - 當設定大於 1 的數值時,copies 屬性會指示 ZFS 備份每個在檔案系統 (File System) 或磁碟區 (Volume) 的資料區塊數份。在重要的資料集上設定這個屬性可以做額外的備援以在資料校驗碼不相符時可做復原。在沒有做備援的儲存池上,備份功能提供只是一種資料的備援方式,備份功能可以復原單一壞軌或其他情況的次要損壞,但無法復原儲存池中整個磁碟損壞所損失的資料。 - - - - 去重複 (Deduplication) - - 校驗碼讓在寫入時可以偵測重複資料區塊,使用去重複,可以增加既有、完全相同的資料區塊參考數來節省儲存空間。要偵測重複的資料區塊需要在記憶體中儲存去重複資料表 (Deduplication table, DDT),這個資料表中會有唯一的校驗碼清單、這些資料區塊的所在位置以及參考數。當寫入新資料時,便會計算校驗碼然後比對清單中是否有符合的既有資料區塊已在清單。去重複使用了 SHA256 校驗碼演算法來提供一個安全的加密雜湊,去重複功能是可以調校的,若 dedup 設為 on 只要符合校驗碼便會認為資料完全相同,若 dedup 設為 verify 則會一個一個位元檢查兩個資料區塊的資料來確保資料真的完全相同,若資料不同便會註記與雜湊衝突並會分別儲存兩個資料區塊。由於 DDT 須要儲存每個唯一資料區塊的雜湊,所以會消耗大量的記憶體,一般的經驗法則是每 1 TB 的去重複資料需要使用 5-6 GB 的記憶體。由於要有足夠的 RAM 來儲存整個 DDT 在實務上並不實際,導致在每個新資料區塊寫入前需要從磁碟來讀取 DDT 會對效能有很大的影響,去重複功能可以使用 L2ARC 儲存 DDT 以在快速的系統記憶體及較慢的磁碟之間取得一個平衡點。也可以考慮使用壓縮功能來取代此功能,因為壓縮也能節省相近的空間使用量而不需要大量額外的記憶體。 - - - - 清潔 (Scrub) - - ZFSscrub 來替代 fsck8 來做一致性的檢查。scrub 會讀取所有儲存在儲存池中的資料區塊並且根據儲存在 Metadata 中已知良好的校驗碼來檢驗這些資料區塊的校驗碼,定期檢查儲存池中儲存的所有資料可以確保實際使用這些資料前已將所有損壞的資料區塊復原。在不正常的關閉之後並不需要做清潔動作,但建議每三個月至少執行一次。在正常使用讀取時便會檢查每個資料區塊的校驗碼,但清潔動作可以確保那些不常用的資料也會被檢查以避免隱藏的損壞,如此便能增進資料的安全性,特別是對用來保存資料的儲存裝置。scrub 可以使用 vfs.zfs.scrub_delay 調整相對優先權來避免清潔動作降低儲存池上其他工作的效率。 - - - - 資料集配額 (Dataset Quota) - - 除了配額及空間保留外,ZFS 提供非常快速且準確的資料集、使用者及群組空間的計算功能,這可讓管理者調整空間配置的方式且可為重要的檔案系統保留空間。 ZFS supports different types of - quotas: the dataset quota, the reference - quota (refquota), the - user - quota, and the - group - quota. 配額會限制資料集及後裔包含資料集的快照、子資料集及子資料集的快照能使用的空間量。 - 磁碟區上無法設定配額,因為 volsize 屬性已經被用來做內定的配額。 - - - - - 參考配額 (Reference Quota) - - 參考配額可以設定一個硬性限制 (Hard limit) 來限制資料集能使用的空間量,而這個硬性限制只包含了資料集參考的空間,並不含其後裔所使用的空間,如:檔案系統或快照。 - - - - 使用者配額 (User Quota) - - 使用者配額在用來限制特定使用者能使用的空間量時非常有用。 - - - - 群組配額 (Group Quota) - - 群組配額可以限制特定群組能使用的空間量。 - - - - 資料集保留空間 (Dataset Reservation) - - reservation 屬性可以確保對特定資料集及其後裔最小可用的空間量,若在 storage/home/bob 設定 10 GB 的保留空間且其他資料集嘗試使用所有剩餘的空間時,會保留至少 10 GB 的空間供這個資料集使用。若要製作 storage/home/bob 的快照,該快照所使用的空間也會被列入保留空間計算。 refreservation 屬性也以類似的方式運作,但是他 不包含 後裔,例如:快照。 不管那一種保留空間在許多情境皆很有用,例如:要規劃與測試磁碟空間配置在新系統上的適應性,或是確保有足夠的空間供稽查日誌或系統還原程序及檔案使用。 - - - - 參考保留空間 (Reference Reservation) - - refreservation 屬性可以確保對特定資料集 不包含 其後裔最小可用的空間,這代表若在 storage/home/bob 設定 10 GB 的保留空間且其他資料集嘗試使用所有剩餘的空間時,會保留至少 10 GB 的空間供這個資料集使用。於正常 reservation 不同的是,由快照及後裔資料集所使用的空間並不會列入保留空間計算。例如,若要製作一個 storage/home/bob 的快照,在 refreservation 空間之外必須要有足夠的空間才能成功完成這項操作,主資料集的後裔並不會列入 refreservation 空間額計算,所以也不會佔用保留空間。 - - - - 修復 (Resilver) - - 當有磁碟故障且被更換後,新的磁碟必須回存先前所遺失的資料,會使用分散在其他磁碟上的奇偶校驗資訊來計算並寫入遺失的資料到新的磁碟機的這個程序稱作 修復 (Resilvering) - - - - 上線 (Online) - - 一個儲存池或 vdev 處於線上 (Online) 狀態時代表所有該裝置的成員均已連結且正常運作。個別裝置處於線上 (Online) 狀態時代表功能正常。 - - - - 離線 (Offline) - - 若有足夠的備援可避免儲存池或 vdev 進入故障 (Faulted) 狀態,個別裝置若可由管理者設為離線 (Offline) 狀態,管理者可以選擇要設定那一個磁碟為離線來準備更換或是讓其更容易辨識。 - - - - 降級 (Degraded) - - 一個儲存池或 vdev 處於降級 (Degraded) 狀態代表其有一個或多個磁碟已斷線或故障,此時儲存池仍可以使用,但只要再有其他的裝置故障,儲存池會無法復原。重新連線缺少的裝置或更換故障的磁碟,並在新裝置完成修復 (Resilver) 程序可讓儲存池返回線上 (Online) 狀態。 - - - - 故障 (Faulted) - - 一個儲存池或 vdev 處於故障 (Faulted) 狀態代表無法運作,會無法存取在該裝置上的資料。當在 vdev 中缺少或故障的裝置數超過備援的層級,儲存池或 vdev 會進入故障 (Faulted) 狀態。若缺少的裝置可以重新連結上,儲存池便會返回線上 (Online) 狀態。若沒有足夠的備援可補償故障的磁碟數量便會遺失儲存池中的內容且只能從備份還原。 - - - - - - - - - - - - 其他檔案系統 - - - TomRhodesWritten - by - - - - - 概述 - - File Systems - - File Systems Support - File Systems - - - File systems are an integral part of any operating system. - They allow users to upload and store files, provide access to - data, and make hard drives useful. Different operating systems - differ in their native file system. Traditionally, the native - FreeBSD file system has been the Unix File System - UFS which has been modernized as - UFS2. Since FreeBSD 7.0, the Z File System - (ZFS) is also available as a native file - system. See for more information. - - In addition to its native file systems, FreeBSD supports a - multitude of other file systems so that data from other - operating systems can be accessed locally, such as data stored - on locally attached USB storage devices, - flash drives, and hard disks. This includes support for the - Linux Extended File System (EXT). - - There are different levels of FreeBSD support for the various - file systems. Some require a kernel module to be loaded and - others may require a toolset to be installed. Some non-native - file system support is full read-write while others are - read-only. - - 讀完這章,您將了解: - - - - The difference between native and supported file - systems. - - - - Which file systems are supported by FreeBSD. - - - - How to enable, configure, access, and make use of - non-native file systems. - - - - 在開始閱讀這章之前,您需要: - - - - Understand UNIX and - FreeBSD basics. - - - - Be familiar with the basics of kernel configuration and - compilation. - - - - Feel comfortable installing - software in FreeBSD. - - - - Have some familiarity with disks, storage, and device names in - FreeBSD. - - - - - - <trademark class="registered">Linux</trademark> 檔案系統 - - FreeBSD provides built-in support for several Linux file - systems. This section demonstrates how to load support for and - how to mount the supported Linux file systems. - - - <acronym>ext2</acronym> - - Kernel support for ext2 file systems has - been available since FreeBSD 2.2. In FreeBSD 8.x and - earlier, the code is licensed under the - GPL. Since FreeBSD 9.0, the code has - been rewritten and is now BSD - licensed. - - The ext2fs5 driver allows the FreeBSD kernel to both - read and write to ext2 file systems. - - - This driver can also be used to access ext3 and ext4 - file systems. The ext2fs5 filesystem has full read - and write support for ext4 as of FreeBSD 12.0-RELEASE. - Additionally, extended attributes and ACLs are also - supported, while journalling and encryption are not. - Starting with FreeBSD 12.1-RELEASE, a DTrace provider will - be available as well. Prior versions of FreeBSD can access - ext4 in read and write mode using - sysutils/fusefs-ext2. - - - To access an ext file system, first - load the kernel loadable module: - - # kldload ext2fs - - Then, mount the ext volume by specifying its FreeBSD - partition name and an existing mount point. This example - mounts /dev/ad1s1 on - /mnt: - - # mount -t ext2fs /dev/ad1s1 /mnt - - - - - - - - - - - - - 虛擬化 - - - - - Murray - Stokely - - Contributed by - - - - - - - Allan - Jude - - bhyve section by - - - - - - - Benedict - Reuschling - - Xen section by - - - - - - 概述 - - 虛擬化軟體可以讓同一台機器得以同時執行多種作業系統。在 PC 上的這類軟體系統通常涉及的角色有執行虛擬化軟體的主端 (Host) 作業系統以及數個安裝在其中的客端 (Guest) 作業系統。 - - 讀完這章,您將了解: - - - - 主端作業系統及客端作業系統的差別。 - - - - 如何在 Intel-based Apple Mac 電腦安裝 FreeBSD 。 - - - - 如何在 Microsoft Windows 使用 Virtual PC 安裝 FreeBSD。 - - - - 如何以 FreeBSD 作為客端安裝在 bhyve - - - - 如何調校 FreeBSD 系統來取得虛擬化的最佳效能。 - - - - - 在開始閱讀這章之前,您需要: - - - - 了解 UNIX 與 FreeBSD 的基礎。 - - - - 知道如何安裝 FreeBSD。 - - - - 知道如何設定網路連線。 - - - - 知道如何安裝其他第三方軟體。 - - - - - - 在 <trademark class="registered">Mac OS</trademark> X 的 <application>Parallels</application> 安裝 FreeBSD 為客端 - - MacParallels Desktop 是一套商業軟體可在 Intel 為基礎的 Apple MacMac OS 10.4.6 或更新版本上執行。 該軟體完全支援使用 FreeBSD 作為客端作業系統。 在 Mac OS X 裝好 Parallels 後,使用者必先完成虛擬機器的設定後才可安裝想使用的客端作業系統。 - - - 在 Parallels/<trademark class="registered">Mac OS</trademark> X 安裝 FreeBSD - - Parallels 上安裝 FreeBSD 的第一步是建立供安裝 FreeBSD 使用的新虛擬機器。提示出現後請選擇 Guest OS TypeFreeBSD - - - - - - - - 根據您對此虛擬 FreeBSD 作業系統的規畫選擇合理的磁碟及記憶體空間,對大多數在 Parallels 下的 FreeBSD 使用來講 4GB 的磁碟空間與 512MB 的 RAM 便足夠: - - - - - - - - - - - - - - - - - - - - - - - - - - 選擇網路類型以及網路介面: - - - - - - - - - - - - - - 儲存並完成設定: - - - - - - - - - - - - - - 在 FreeBSD 虛擬機器新增後,就可以繼續以其安裝 FreeBSD。 安裝方面,比較好的作法是使用官方的 FreeBSD CD/DVD 或者是自官方 FTP 站下載的 ISO 映像檔。 複製適合的 ISO 映像檔到 Mac 檔案系統本地端或放入 CD/DVDMacCD-ROM 磁碟機。在 FreeBSD Parallels 視窗的右下角點選磁碟圖示後會出現一個視窗,可用來建立虛擬機器內的 CD-ROM 磁碟機與磁碟上 ISO 檔案或實際 CD-ROM 磁碟機的關聯。 - - - - - - - - 建立與 CD-ROM 來源的關聯後,點選重新開機圖示重新開啟 FreeBSD 虛擬機器。Parallels 會重新開機進入一個特殊的 BIOS 畫面並檢查是否有 CD-ROM - - - - - - - - 在此處會找到 FreeBSD 安裝媒體並開始正常的 FreeBSD 安裝程序。完成安裝,但不要在此時嘗試設定 Xorg - - - - - - - - 當安裝完成後,重新開機將會進入新安裝的 FreeBSD 虛擬機器。 - - - - - - - - - - 在 <application>Parallels</application> 設定 FreeBSD - - 在成功將 FreeBSD 安裝到 Mac OS X 的 Parallels 後,有數個設定步驟要完成來最佳化系統在虛擬機器上的運作。 - - - - 設定 Boot Loader 變數 - - 最重要的一個步驟是減少 參數來減少 FreeBSD 在 Parallels 環境下對 CPU 的使用率。加入以下行到 /boot/loader.conf 來完成這個動作: - - kern.hz=100 - - 若沒有完成此設定,閒置的 FreeBSD Parallels 客端將會消耗掉單一處理器的 iMac 將近 15% 的 CPU。完成此更改後使用率會減至接近 5%。 - - - - 建立新核心設定檔 - - 所有的 SCSI, FireWire 及 USB 裝置可以從自訂的核心設定檔中移除。Parallels 提供的虛擬網路卡使用 ed4 驅動程式,所以除了 ed4 以及 miibus4 外的所有網路裝置可以自核心中移除。 - - - - 設定網路 - - 最基本的網路設定是使用 DHCP 來讓虛擬機器連線到與主端 Mac 相同的區域網路,這可以透過加入 ifconfig_ed0="DHCP"/etc/rc.conf 來完成。更進階的網路設定在 中描述。 - - - - - - - 在 <trademark class="registered">Windows</trademark> 的 <application>Virtual PC</application> 安裝 FreeBSD 為客端 - - Windows 使用的 Virtual PC 是一套可免費下載的 Microsoft 軟體產品,請參考此網站取得系統需求。Virtual PCMicrosoft Windows 上安裝完成之後,使用者可以設定一台虛擬機器然後安裝想要的客端作業系統。 - - - 在 <application>Virtual PC</application> 安裝 FreeBSD - - 安裝 FreeBSD 到 Virtual PC 的第一個步驟是建立新的虛擬機器來安裝 FreeBSD。當提示畫面出現時,請選擇 Create a virtual machine - - - - - - - - - - - - - - 當提示畫面出現時,選擇 Operating systemOther - - - - - - - - 然後,根據您對此虛擬 FreeBSD 作業系統的規畫選擇合理的磁碟及記憶體空間,對大多數在 Virtual PC 下的 FreeBSD 使用來講 4GB 的磁碟空間與 512MB 的 RAM 便足夠: - - - - - - - - - - - - - - 儲存並完成設定: - - - - - - - - 選擇 FreeBSD 虛擬機器然後點選 Settings,接著設定網路類型及網路介面卡: - - - - - - - - - - - - - - FreeBSD 虛擬機器建立完成之後,便可安裝 FreeBSD 到該虛擬機器。安裝最好使用官方 FreeBSD CD/DVD 或使用自官方 FTP 站下載的 ISO 映像檔。複製適當的 ISO 映像檔到本地 Windows 檔案系統或插入 CD/DVDCD 磁碟機,然後雙擊點選 FreeBSD 虛擬機器來開機。接著,點選 CD 並在 Virtual PC 視窗選擇 Capture ISO Image...,這將會顯示一個視窗可以建立虛擬機器中的 CD-ROMISO 檔或磁碟或實體 CD-ROM 磁碟機之間的關聯。 - - - - - - - - - - - - - - 建立與 CD-ROM 來源的關聯後,點選 ActionReset 重新開機 FreeBSD 虛擬機器。Virtual PC 會重新開始並進入特殊的 BIOS 來做 CD-ROM 的第一次檢查。 - - - - - - - - 在這個情況下會找到 FreeBSD 安裝媒體然後開始正常的 FreeBSD 安裝。接著繼續安裝,但此時請不要嘗試設定 Xorg - - - - - - - - 當安裝完成之後,記得退出 CD/DVD 或釋放 ISO 映像檔。最後,重新開機進入新安裝的 FreeBSD 虛擬機器。 - - - - - - - - - - 在 <application>Virtual PC</application> 設定 FreeBSD - - 在成功將 FreeBSD 安裝到 Microsoft WindowsVirtual PC 後,有數個設定步驟要完成來最佳化系統在虛擬機器上的運作。 - - - - 設定 Boot Loader 變數 - - 最重要的一個步驟是減少 ,來減少 FreeBSD 在 Virtual PC 環境下 CPU 的使用量。這可以透過加入下列幾行到 /boot/loader.conf 來完成: - - kern.hz=100 - - 若沒有完成此設定,閒置的 FreeBSD Virtual PC 客端 OS 會消耗掉單一處理器的電腦 40% 的 CPU。完成此更改後使用率會減至接近 3%。 - - - - 建立新核心設定檔 - - 所有的 SCSI, FireWire 及 USB 裝置可以從自訂的核心設定檔中移除。Virtual PC 提供的虛擬網路卡使用 de4 驅動程式,所以除了 de4 以及 miibus4 外的所有網路裝置可以自核心中移除。 - - - - 設定網路 - - 最基本的網路設定是使用 DHCP 來讓虛擬機器連線到與主端 Microsoft Windows 相同的區域網路,這可以透過加入 ifconfig_de0="DHCP"/etc/rc.conf 來完成。更進階的網路設定在 中描述。 - - - - - - - 在 <trademark class="registered">Mac OS</trademark> 的 <application>VMware Fusion</application> 安裝 FreeBSD 為客端 - - VMware Fusion 是一套商業軟體可在 Intel 為基礎的 Apple MacMac OS 10.4.9 或更新版本上執行。 該軟體完全支援使用 FreeBSD 作為客端作業系統。 在 Mac OS X 裝好 VMware Fusion 後,使用者必先完成虛擬機器的設定後才可安裝想使用的客端作業系統。 - - - 在 <application>VMware Fusion</application> 安裝 FreeBSD - - 第一個步驟是啟動 VMware Fusion 載入 Virtual Machine Library,點選 New 建立虛擬機器: - - - - - - - - 這個動做會載入 New Virtual Machine Assistant,點選 Continue 繼續: - - - - - - - - 選擇 Operating SystemOther 以及在 Version 提示出現時選擇 FreeBSDFreeBSD 64-bit - - - - - - - - 選擇虛擬機器要使用的名稱以及要儲存目錄位置: - - - - - - - - 選擇虛擬機器的 Virtual Hard Disk 大小: - - - - - - - - 選擇安裝虛擬機器的方式,可從 ISO 映像檔或從 CD/DVD - - - - - - - - 點選 Finish 接著虛擬機器會開機: - - - - - - - - 照往常方式安裝 FreeBSD: - - - - - - - - 安裝完成後,可以修改虛擬機器的設定,例如記憶體使用量: - - - 虛擬機器的 System Hardware 設定無法在虛擬機器執行時修改。 - - - - - - - - - 虛擬機器要使用的 CPU 數量: - - - - - - - - CD-ROM 裝置的狀態,正常情況 CD/DVD/ISO 在不需要時會中斷與虛擬機器的連線。 - - - - - - - - 最後一件事是更改虛擬機器連線到網路的方式,要允許除了主端以外的機器連線到虛擬機器,請選擇 Connect directly to the physical network (Bridged)。否則會偏好使用 Share the host's internet connection (NAT) 來讓虛擬機器可以存取網際網路,但外部網路無法連線到虛擬機器。 - - - - - - - - 在修改設定之後,開機進入新安裝的 FreeBSD 虛擬機器。 - - - - 在 <application>VMware Fusion</application> 設定 FreeBSD - - 在成功將 FreeBSD 安裝到 Mac OS X 的 VMware Fusion 後,有數個設定步驟要完成來最佳化系統在虛擬機器上的運作。 - - - - 設定 Boot Loader 變數 - - 最重要的一個步驟是減少 ,來減少 FreeBSD 在 VMware Fusion 環境下 CPU 的使用量。這可以透過加入下列幾行到 /boot/loader.conf 來完成: - - kern.hz=100 - - 若沒有完成此設定,閒置的 FreeBSD VMware Fusion 客端將會消耗掉單一處理器的 iMac 將近 15% 的 CPU。完成此更改後使用率會減至接近 5%。 - - - - 建立新核心設定檔 - - 所有的 SCSI, FireWire 及 USB 裝置可以從自訂的核心設定檔中移除。VMware Fusion 提供的虛擬網路卡使用 em4 驅動程式,所以除了 em4 外的所有網路裝置可以自核心中移除。 - - - - 設定網路 - - 最基本的網路設定是使用 DHCP 來讓虛擬機器連線到與主端 Mac 相同的區域網路,這可以透過加入 ifconfig_em0="DHCP"/etc/rc.conf 來完成。更進階的網路設定在 中描述。 - - - - - - - 在 <trademark>VirtualBox</trademark> 安裝 FreeBSD 作為客端 - - VirtualBox 中使用 FreeBSD 做為客端系統也可運作的很好,虛擬化軟體可支援最常見的幾個作業系統,這當然也包含 FreeBSD。 - - VirtualBox guest additions 支援以下功能: - - - - 剪貼簿共享。 - - - - 滑鼠指標整合。 - - - - 主機時間同步。 - - - - 視窗縮放。 - - - - 無痕模式。 - - - - - 以下指令均是在 FreeBSD 客端中執行。 - - - 首先,在 FreeBSD 客端安裝 emulators/virtualbox-ose-additions 套件或 Port,以下指令會安裝 Port: - - # cd /usr/ports/emulators/virtualbox-ose-additions && make install clean - - 加入下行到 /etc/rc.conf - - vboxguest_enable="YES" -vboxservice_enable="YES" - - 若有使用 ntpd8ntpdate8,便可關閉主機時間同步功能: - - vboxservice_flags="--disable-timesync" - - Xorg 會自動辨識 vboxvideo 驅動程式,也可手動在 /etc/X11/xorg.conf 中輸入: - - Section "Device" - Identifier "Card0" - Driver "vboxvideo" - VendorName "InnoTek Systemberatung GmbH" - BoardName "VirtualBox Graphics Adapter" -EndSection - - 要使用 vboxmouse 驅動程式,可調整在 /etc/X11/xorg.conf 中與滑鼠相關的一節: - - Section "InputDevice" - Identifier "Mouse0" - Driver "vboxmouse" -EndSection - - HAL 的使用者應建立以下 /usr/local/etc/hal/fdi/policy/90-vboxguest.fdi 或複製自 /usr/local/share/hal/fdi/policy/10osvendor/90-vboxguest.fdi - - <?xml version="1.0" encoding="utf-8"?> -<!-- -# Sun VirtualBox -# Hal driver description for the vboxmouse driver -# $Id: chapter.xml,v 1.33 2012-03-17 04:53:52 eadler Exp $ - - Copyright (C) 2008-2009 Sun Microsystems, Inc. - - This file is part of VirtualBox Open Source Edition (OSE, as - available from http://www.virtualbox.org. This file is free software; - you can redistribute it and/or modify it under the terms of the GNU - General Public License (GPL) as published by the Free Software - Foundation, in version 2 as it comes in the "COPYING" file of the - VirtualBox OSE distribution. VirtualBox OSE is distributed in the - hope that it will be useful, but WITHOUT ANY WARRANTY of any kind. - - Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa - Clara, CA 95054 USA or visit http://www.sun.com if you need - additional information or have any questions. ---> -<deviceinfo version="0.2"> - <device> - <match key="info.subsystem" string="pci"> - <match key="info.product" string="VirtualBox guest Service"> - <append key="info.capabilities" type="strlist">input</append> - <append key="info.capabilities" type="strlist">input.mouse</append> - <merge key="input.x11_driver" type="string">vboxmouse</merge> - <merge key="input.device" type="string">/dev/vboxguest</merge> - </match> - </match> - </device> -</deviceinfo> - - Shared folders for file transfers between host and VM are - accessible by mounting them using - mount_vboxvfs. A shared folder can be created - on the host using the VirtualBox GUI or via - vboxmanage. For example, to create a shared - folder called myshare under - /mnt/bsdboxshare - for the VM named BSDBox, run: - - # vboxmanage sharedfolder add 'BSDBox' --name myshare --hostpath /mnt/bsdboxshare - - Note that the shared folder name must not contain spaces. - Mount the shared folder from within the guest system like - this: - - # mount_vboxvfs -w myshare /mnt - - - - 以 FreeBSD 作為主端使用 <trademark>VirtualBox</trademark> - - VirtualBox 是一套積極開發、完整的虛擬化套件,適用大多數作業系統,包含 Windows, Mac OS, Linux 與 FreeBSD,它同樣能夠執行類 WindowsUNIX 的客端系統。它是以開源軟體的方式發佈,但閉源元件可獨立在擴充包中使用,這些元件包含對 USB 2.0 裝置的支援。更多資訊可在 VirtualBox wiki 的 Downloads 頁面。目前,這些擴充套件並不支援 FreeBSD。 - - - 安裝 <trademark>VirtualBox</trademark> - - VirtualBox 可於 emulators/virtualbox-ose 以 FreeBSD 套件或 Port 的方式取得。要安裝 Port 可使用以下指令: - - # cd /usr/ports/emulators/virtualbox-ose -# make install clean - - 在 Port 的設定選單中 GuestAdditions 相關程式是最有用的選項之一,這些程式可在客端作業系統提供數個有用的功能,如滑鼠指標整合 (允許滑鼠在主端與客端之間移動,不需要按特殊快速鍵來切換) 與較快的影像繪圖速度,特別是在 Windows 的客端系統。Guest additions 可在客端系統安裝完之後的 Devices 選單找到。 - - 還有一些設定需要在 VirtualBox 第一次啟動端做修改,Port 會安裝一個核心模組在 /boot/modules,該模組必須在核心中載入: - - # kldload vboxdrv - - 要確保該模組在重新開機後會載入,可加入下行到 /boot/loader.conf - - vboxdrv_load="YES" - - 要使用可支援橋接或僅限主端 (Host-only) 的網路,可加入下行到 /etc/rc.conf,然後重新啟動電腦: - - vboxnet_enable="YES" - - 在安裝 VirtualBox 的過程中會建立 vboxusers 群組,所有需要存取 VirtualBox 的使用者均需要加入成為此群組的成員,pw 可用來加入新的成員: - - # pw groupmod vboxusers -m yourusername - - /dev/vboxnetctl 的預設權限是受限的,需要更改後才可使用橋接網路: - - # chown root:vboxusers /dev/vboxnetctl -# chmod 0660 /dev/vboxnetctl - - 要永久變更權限,可加入下列幾行到 /etc/devfs.conf - - own vboxnetctl root:vboxusers -perm vboxnetctl 0660 - - 要執行 VirtualBox,可在 Xorg 工作階段輸入: - - % VirtualBox - - 要取得更多有關設定與使用 VirtualBox 的資訊,請參考 官方網站。供 FreeBSD 特定的資訊與疑難排解操作指示,可參考 FreeBSD wiki 中相關的頁面。 - - - - <trademark>VirtualBox</trademark> USB 支援 - - VirtualBox can be configured - to pass USB devices through to the guest - operating system. The host controller of the OSE version is - limited to emulating USB 1.1 devices until - the extension pack supporting USB 2.0 and - 3.0 devices becomes available on FreeBSD. - - For VirtualBox to be aware of - USB devices attached to the machine, the - user needs to be a member of the operator group. - - # pw groupmod operator -m yourusername - - Then, add the following to - /etc/devfs.rules, or create this file if - it does not exist yet: - - [system=10] -add path 'usb/*' mode 0660 group operator - - 若服務未執行,請加入下行到 /etc/rc.conf - - devfs_system_ruleset="system" - - 然後重新啟動 devfs: - - # service devfs restart - - 重新啟動登作階段與 VirtualBox 來讓這些變更生效,且建立必要的 USB 的過濾器。 - - - - <trademark>VirtualBox</trademark> Host <acronym>DVD</acronym>/<acronym>CD</acronym> 存取 - - 透過共享實體磁碟機可讓客端系統能夠存取主端系統的 DVD/CD 磁碟機。在 VirtualBox 中,這個功能可在虛擬機器設定中的儲存 (Storage) 視窗中設定。若需要,可先建立一個空的 IDE CD/DVD 裝置,然後在跳出的選單中選擇要做為虛擬 CD/DVD 磁碟機的主端磁碟機,此時會出現一個標籤為 Passthrough 的核選方塊,勾選這個核選方塊可讓虛擬機器直接使用該硬體,例如,音樂 CD 或燒錄機只會在有勾選此選項時能夠運作。 - - VirtualBox DVD/CD 功能要能運作需要執行 HAL,因此需在 /etc/rc.conf 中開啟,若該服務尚未啟動,則啟動它: - - hald_enable="YES" - - # service hald start - - 為了讓使用者能夠使用 VirtualBox DVD/CD 功能,這些使用者需要存取 /dev/xpt0, /dev/cdN 以及 /dev/passN,這通常可讓這些使用者成為 operator 的成員來達成。對這些裝置的權限必須加入下行到 /etc/devfs.conf 來修正: - - perm cd* 0660 -perm xpt0 0660 -perm pass* 0660 - - # service devfs restart - - - - - 以 FreeBSD 作為主端安裝 <application>bhyve</application> - - The bhyve - BSD-licensed hypervisor became part of the - base system with FreeBSD 10.0-RELEASE. This hypervisor supports a - number of guests, including FreeBSD, OpenBSD, and many Linux - distributions. By default, bhyve - provides access to serial console and does not emulate a - graphical console. Virtualization offload features of newer - CPUs are used to avoid the legacy methods of - translating instructions and manually managing memory - mappings. - - The bhyve design requires a - processor that supports Intel Extended Page Tables - (EPT) or AMD Rapid Virtualization Indexing - (RVI) or Nested Page Tables - (NPT). Hosting Linux guests or FreeBSD guests - with more than one vCPU requires - VMX unrestricted mode support - (UG). Most newer processors, specifically - the Intel Core i3/i5/i7 and Intel Xeon - E3/E5/E7, support these features. UG support - was introduced with Intel's Westmere micro-architecture. For a - complete list of Intel processors that support - EPT, refer to . - RVI is found on the third generation and - later of the AMD Opteron (Barcelona) processors. The easiest - way to tell if a processor supports - bhyve is to run - dmesg or look in - /var/run/dmesg.boot for the - POPCNT processor feature flag on the - Features2 line for AMD processors or - EPT and UG on the - VT-x line for Intel processors. - - - 準備主端 - - The first step to creating a virtual machine in - bhyve is configuring the host - system. First, load the bhyve - kernel module: - - # kldload vmm - - Then, create a tap interface for the - network device in the virtual machine to attach to. In order - for the network device to participate in the network, also - create a bridge interface containing the - tap interface and the physical interface - as members. In this example, the physical interface is - igb0: - - # ifconfig tap0 create -# sysctl net.link.tap.up_on_open=1 -net.link.tap.up_on_open: 0 -> 1 -# ifconfig bridge0 create -# ifconfig bridge0 addm igb0 addm tap0 -# ifconfig bridge0 up - - - - 建立 FreeBSD 客端 - - Create a file to use as the virtual disk for the guest - machine. Specify the size and name of the virtual - disk: - - # truncate -s 16G guest.img - - Download an installation image of FreeBSD to install: - - # fetch ftp://ftp.freebsd.org/pub/FreeBSD/releases/ISO-IMAGES/10.3/FreeBSD-10.3-RELEASE-amd64-bootonly.iso -FreeBSD-10.3-RELEASE-amd64-bootonly.iso 100% of 230 MB 570 kBps 06m17s - - FreeBSD comes with an example script for running a virtual - machine in bhyve. The script will - start the virtual machine and run it in a loop, so it will - automatically restart if it crashes. The script takes a - number of options to control the configuration of the machine: - controls the number of virtual CPUs, - limits the amount of memory available to - the guest, defines which - tap device to use, - indicates which disk image to use, tells - bhyve to boot from the - CD image instead of the disk, and - defines which CD image - to use. The last parameter is the name of the virtual - machine, used to track the running machines. This example - starts the virtual machine in installation mode: - - # sh /usr/share/examples/bhyve/vmrun.sh -c 1 -m 1024M -t tap0 -d guest.img -i -I FreeBSD-10.3-RELEASE-amd64-bootonly.iso guestname - - The virtual machine will boot and start the installer. - After installing a system in the virtual machine, when the - system asks about dropping in to a shell at the end of the - installation, choose Yes. - - Reboot the virtual machine. While rebooting the virtual - machine causes bhyve to exit, the - vmrun.sh script runs - bhyve in a loop and will automatically - restart it. When this happens, choose the reboot option from - the boot loader menu in order to escape the loop. Now the - guest can be started from the virtual disk: - - # sh /usr/share/examples/bhyve/vmrun.sh -c 4 -m 1024M -t tap0 -d guest.img guestname - - - - 建立 <trademark class="registered">Linux</trademark> 客端 - - In order to boot operating systems other than FreeBSD, the - sysutils/grub2-bhyve port must be first - installed. - - Next, create a file to use as the virtual disk for the - guest machine: - - # truncate -s 16G linux.img - - Starting a virtual machine with - bhyve is a two step process. First - a kernel must be loaded, then the guest can be started. The - Linux kernel is loaded with - sysutils/grub2-bhyve. Create a - device.map that - grub will use to map the virtual - devices to the files on the host system: - - (hd0) ./linux.img -(cd0) ./somelinux.iso - - Use sysutils/grub2-bhyve to load the - Linux kernel from the ISO image: - - # grub-bhyve -m device.map -r cd0 -M 1024M linuxguest - - This will start grub. If the installation - CD contains a - grub.cfg, a menu will be displayed. - If not, the vmlinuz and - initrd files must be located and loaded - manually: - - grub> ls -(hd0) (cd0) (cd0,msdos1) (host) -grub> ls (cd0)/isolinux -boot.cat boot.msg grub.conf initrd.img isolinux.bin isolinux.cfg memtest -splash.jpg TRANS.TBL vesamenu.c32 vmlinuz -grub> linux (cd0)/isolinux/vmlinuz -grub> initrd (cd0)/isolinux/initrd.img -grub> boot - - Now that the Linux kernel is loaded, the guest can be - started: - - # bhyve -A -H -P -s 0:0,hostbridge -s 1:0,lpc -s 2:0,virtio-net,tap0 -s 3:0,virtio-blk,./linux.img \ - -s 4:0,ahci-cd,./somelinux.iso -l com1,stdio -c 4 -m 1024M linuxguest - - The system will boot and start the installer. After - installing a system in the virtual machine, reboot the virtual - machine. This will cause bhyve to - exit. The instance of the virtual machine needs to be - destroyed before it can be started again: - - # bhyvectl --destroy --vm=linuxguest - - Now the guest can be started directly from the virtual - disk. Load the kernel: - - # grub-bhyve -m device.map -r hd0,msdos1 -M 1024M linuxguest -grub> ls -(hd0) (hd0,msdos2) (hd0,msdos1) (cd0) (cd0,msdos1) (host) -(lvm/VolGroup-lv_swap) (lvm/VolGroup-lv_root) -grub> ls (hd0,msdos1)/ -lost+found/ grub/ efi/ System.map-2.6.32-431.el6.x86_64 config-2.6.32-431.el6.x -86_64 symvers-2.6.32-431.el6.x86_64.gz vmlinuz-2.6.32-431.el6.x86_64 -initramfs-2.6.32-431.el6.x86_64.img -grub> linux (hd0,msdos1)/vmlinuz-2.6.32-431.el6.x86_64 root=/dev/mapper/VolGroup-lv_root -grub> initrd (hd0,msdos1)/initramfs-2.6.32-431.el6.x86_64.img -grub> boot - - Boot the virtual machine: - - # bhyve -A -H -P -s 0:0,hostbridge -s 1:0,lpc -s 2:0,virtio-net,tap0 \ - -s 3:0,virtio-blk,./linux.img -l com1,stdio -c 4 -m 1024M linuxguest - - Linux will now boot in the virtual machine and - eventually present you with the login prompt. Login and use - the virtual machine. When you are finished, reboot the - virtual machine to exit bhyve. - Destroy the virtual machine instance: - - # bhyvectl --destroy --vm=linuxguest - - - - 使用 <acronym>UEFI</acronym> 韌體開機 <application>bhyve</application> 虛擬機器 - - In addition to bhyveload and - grub-bhyve, the - bhyve hypervisor can also boot - virtual machines using the UEFI userspace - firmware. This option may support guest operating systems - that are not supported by the other loaders. - - In order to make use of the UEFI - support in bhyve, first obtain the - UEFI firmware images. This can be done by - installing sysutils/bhyve-firmware port or - package. - - With the firmware in place, add the flags - to your bhyve command line. The - actual bhyve command may look like - this: - - # bhyve -AHP -s 0:0,hostbridge -s 1:0,lpc \ --s 2:0,virtio-net,tap1 -s 3:0,virtio-blk,./disk.img \ --s 4:0,ahci-cd,./install.iso -c 4 -m 1024M \ --l bootrom,/usr/local/share/uefi-firmware/BHYVE_UEFI.fd \ -guest - - sysutils/bhyve-firmware also contains a - CSM-enabled firmware, to boot guests with - no UEFI support in legacy - BIOS mode: - - # bhyve -AHP -s 0:0,hostbridge -s 1:0,lpc \ --s 2:0,virtio-net,tap1 -s 3:0,virtio-blk,./disk.img \ --s 4:0,ahci-cd,./install.iso -c 4 -m 1024M \ --l bootrom,/usr/local/share/uefi-firmware/BHYVE_UEFI_CSM.fd \ -guest - - - - 供 <application>bhyve</application> 客端用的圖型化 <acronym>UEFI</acronym> Framebuffer - - The UEFI firmware support is - particularly useful with predominantly graphical guest - operating systems such as Microsoft Windows. - - Support for the UEFI-GOP framebuffer may also be enabled - with the - flags. The framebuffer resolution may be configured with - and - , and - bhyve can be instructed to wait for - a VNC connection before booting the guest - by adding . The framebuffer may be - accessed from the host or over the network via the - VNC protocol. - - bhyve 指令的結果會如下: - - # bhyve -AHP -s 0:0,hostbridge -s 31:0,lpc \ --s 2:0,virtio-net,tap1 -s 3:0,virtio-blk,./disk.img \ --s 4:0,ahci-cd,./install.iso -c 4 -m 1024M \ --s 29,fbuf,tcp=0.0.0.0:5900,w=800,h=600,wait \ --l bootrom,/usr/local/share/uefi-firmware/BHYVE_UEFI.fd \ -guest - - Note, in BIOS emulation mode, the framebuffer will cease - receiving updates once control is passed from firmware to - guest operating system. - - - - 在 <application>bhyve</application> 客端使用 <acronym>ZFS</acronym> - - If ZFS is available on the host - machine, using ZFS volumes - instead of disk image files can provide significant - performance benefits for the guest VMs. A - ZFS volume can be created by: - - # zfs create -V16G -o volmode=dev zroot/linuxdisk0 - - When starting the VM, specify the - ZFS volume as the disk drive: - - # bhyve -A -H -P -s 0:0,hostbridge -s 1:0,lpc -s 2:0,virtio-net,tap0 -s3:0,virtio-blk,/dev/zvol/zroot/linuxdisk0 \ - -l com1,stdio -c 4 -m 1024M linuxguest - - - - 虛擬機器 Console - - It is advantageous to wrap the - bhyve console in a session - management tool such as sysutils/tmux or - sysutils/screen in order to detach and - reattach to the console. It is also possible to have the - console of bhyve be a null modem - device that can be accessed with cu. To do - this, load the nmdm kernel module and - replace with - . The - /dev/nmdm devices are created - automatically as needed, where each is a pair, corresponding - to the two ends of the null modem cable - (/dev/nmdm0A and - /dev/nmdm0B). See nmdm4 for more - information. - - # kldload nmdm -# bhyve -A -H -P -s 0:0,hostbridge -s 1:0,lpc -s 2:0,virtio-net,tap0 -s 3:0,virtio-blk,./linux.img \ - -l com1,/dev/nmdm0A -c 4 -m 1024M linuxguest -# cu -l /dev/nmdm0B -Connected - -Ubuntu 13.10 handbook ttyS0 - -handbook login: - - - - 管理虛擬機器 - - A device node is created in /dev/vmm for each virtual - machine. This allows the administrator to easily see a list - of the running virtual machines: - - # ls -al /dev/vmm -total 1 -dr-xr-xr-x 2 root wheel 512 Mar 17 12:19 ./ -dr-xr-xr-x 14 root wheel 512 Mar 17 06:38 ../ -crw------- 1 root wheel 0x1a2 Mar 17 12:20 guestname -crw------- 1 root wheel 0x19f Mar 17 12:19 linuxguest -crw------- 1 root wheel 0x1a1 Mar 17 12:19 otherguest - - A specified virtual machine can be destroyed using - bhyvectl: - - # bhyvectl --destroy --vm=guestname - - - - Persistent 設定 - - In order to configure the system to start - bhyve guests at boot time, the - following configurations must be made in the specified - files: - - - - <filename>/etc/sysctl.conf</filename> - - net.link.tap.up_on_open=1 - - - - <filename>/etc/rc.conf</filename> - - cloned_interfaces="bridge0 tap0" -ifconfig_bridge0="addm igb0 addm tap0" -kld_list="nmdm vmm" - - - - - - - 以 FreeBSD 作為主端安裝 <trademark>Xen</trademark> - - Xen is a GPLv2-licensed type - 1 hypervisor for Intel and ARM architectures. FreeBSD - has included i386 and AMD 64-Bit DomU - and Amazon - EC2 unprivileged domain (virtual machine) support since - FreeBSD 8.0 and includes Dom0 control domain (host) support in - FreeBSD 11.0. Support for para-virtualized (PV) domains has - been removed from FreeBSD 11 in favor of hardware virtualized - (HVM) domains, which provides better performance. - - Xen is a bare-metal hypervisor, which means that it is the - first program loaded after the BIOS. A special privileged guest - called the Domain-0 (Dom0 for short) is then - started. The Dom0 uses its special privileges to directly - access the underlying physical hardware, making it a - high-performance solution. It is able to access the disk - controllers and network adapters directly. The Xen management - tools to manage and control the Xen hypervisor are also used - by the Dom0 to create, list, and destroy VMs. Dom0 provides - virtual disks and networking for unprivileged domains, often - called DomU. Xen Dom0 can be compared to - the service console of other hypervisor solutions, while the - DomU is where individual guest VMs are run. - - - Xen can migrate VMs between different Xen servers. When - the two xen hosts share the same underlying storage, the - migration can be done without having to shut the VM down first. - Instead, the migration is performed live while the DomU is - running and there is no need to restart it or plan a downtime. - This is useful in maintenance scenarios or upgrade windows to - ensure that the services provided by the DomU are still - provided. Many more features of Xen are listed on the Xen - Wiki Overview page. Note that not all features are - supported on FreeBSD yet. - - - <trademark>Xen</trademark> Dom0 的硬體需求 - - To run the Xen hypervisor on a host, certain hardware - functionality is required. Hardware virtualized domains - require Extended Page Table (EPT) - and Input/Output Memory Management Unit (IOMMU) - support in the host processor. - - - In order to run a FreeBSD Xen Dom0 the box must be - booted using legacy boot (BIOS). - - - - - - <trademark>Xen</trademark> Dom0 控制領域安裝 - - Users of FreeBSD 11 should install the - emulators/xen-kernel47 and - sysutils/xen-tools47 packages that are - based on Xen version 4.7. Systems running on FreeBSD-12.0 or - newer can use Xen 4.11 provided by - emulators/xen-kernel411 and - sysutils/xen-tools411, respectively. - - Configuration files must be edited to prepare the host - for the Dom0 integration after the Xen packages are installed. - An entry to /etc/sysctl.conf disables the - limit on how many pages of memory are allowed to be wired. - Otherwise, DomU VMs with higher memory requirements will not - run. - - # echo 'vm.max_wired=-1' >> /etc/sysctl.conf - - Another memory-related setting involves changing - /etc/login.conf, setting the - memorylocked option to - unlimited. Otherwise, creating DomU - domains may fail with Cannot allocate - memory errors. After making the change to - /etc/login.conf, run - cap_mkdb to update the capability database. - See for - details. - - # sed -i '' -e 's/memorylocked=64K/memorylocked=unlimited/' /etc/login.conf -# cap_mkdb /etc/login.conf - - Add an entry for the Xen console to - /etc/ttys: - - # echo 'xc0 "/usr/libexec/getty Pc" xterm onifconsole secure' >> /etc/ttys - - Selecting a Xen kernel in - /boot/loader.conf activates the Dom0. - Xen also requires resources like CPU and memory from the - host machine for itself and other DomU domains. How much CPU - and memory depends on the individual requirements and hardware - capabilities. In this example, 8 GB of memory and 4 - virtual CPUs are made available for the Dom0. The serial - console is also activated and logging options are - defined. - - The following command is used for Xen 4.7 packages: - - # sysrc -f /boot/loader.conf hw.pci.mcfg=0 -# sysrc -f /boot/loader.conf if_tap_load="YES" -# sysrc -f /boot/loader.conf xen_kernel="/boot/xen" -# sysrc -f /boot/loader.conf xen_cmdline="dom0_mem=8192M dom0_max_vcpus=4 dom0pvh=1 console=com1,vga com1=115200,8n1 guest_loglvl=all loglvl=all" - - For Xen versions 4.11 and higher, the following command - should be used instead: - - # sysrc -f /boot/loader.conf if_tap_load="YES" -# sysrc -f /boot/loader.conf xen_kernel="/boot/xen" -# sysrc -f /boot/loader.conf xen_cmdline="dom0_mem=8192M dom0_max_vcpus=4 dom0=pvh console=com1,vga com1=115200,8n1 guest_loglvl=all loglvl=all" - - - Log files that Xen creates for the DomU VMs - are stored in /var/log/xen. Please - be sure to check the contents of that directory if - experiencing issues. - - - Activate the xencommons service during system - startup: - - # sysrc xencommons_enable=yes - - These settings are enough to start a Dom0-enabled - system. However, it lacks network functionality for the - DomU machines. To fix that, define a bridged interface with - the main NIC of the system which the DomU VMs can use to - connect to the network. Replace - em0 with the host network - interface name. - - # sysrc cloned_interfaces="bridge0" -# sysrc ifconfig_bridge0="addm em0 SYNCDHCP" -# sysrc ifconfig_em0="up" - - Restart the host to load the Xen kernel and start the - Dom0. - - # reboot - - After successfully booting the Xen kernel and logging - into the system again, the Xen management tool - xl is used to show information about the - domains. - - # xl list -Name ID Mem VCPUs State Time(s) -Domain-0 0 8192 4 r----- 962.0 - - The output confirms that the Dom0 (called - Domain-0) has the ID 0 - and is running. It also has the memory and virtual CPUs - that were defined in /boot/loader.conf - earlier. More information can be found in the Xen - Documentation. DomU guest VMs can now be - created. - - - - <trademark>Xen</trademark> DomU 客端 VM 設置 - - Unprivileged domains consist of a configuration file and - virtual or physical hard disks. Virtual disk storage for - the DomU can be files created by truncate1 or ZFS - volumes as described in . - In this example, a 20 GB volume is used. A VM is - created with the ZFS volume, a FreeBSD ISO image, 1 GB of - RAM and two virtual CPUs. The ISO installation file is - retrieved with fetch1 and saved locally in a file - called freebsd.iso. - - # fetch ftp://ftp.freebsd.org/pub/FreeBSD/releases/ISO-IMAGES/12.0/FreeBSD-12.0-RELEASE-amd64-bootonly.iso -o freebsd.iso - - A ZFS volume of 20 GB called - xendisk0 is created to serve as the disk - space for the VM. - - # zfs create -V20G -o volmode=dev zroot/xendisk0 - - The new DomU guest VM is defined in a file. Some specific - definitions like name, keymap, and VNC connection details are - also defined. The following freebsd.cfg - contains a minimum DomU configuration for this example: - - # cat freebsd.cfg -builder = "hvm" -name = "freebsd" -memory = 1024 -vcpus = 2 -vif = [ 'mac=00:16:3E:74:34:32,bridge=bridge0' ] -disk = [ -'/dev/zvol/tank/xendisk0,raw,hda,rw', -'/root/freebsd.iso,raw,hdc:cdrom,r' - ] -vnc = 1 -vnclisten = "0.0.0.0" -serial = "pty" -usbdevice = "tablet" - - These lines are explained in more detail: - - - - This defines what kind of virtualization to use. - hvm refers to hardware-assisted - virtualization or hardware virtual machine. Guest - operating systems can run unmodified on CPUs with - virtualization extensions, providing nearly the same - performance as running on physical hardware. - generic is the default value and - creates a PV domain. - - - - Name of this virtual machine to distinguish it from - others running on the same Dom0. Required. - - - - Quantity of RAM in megabytes to make available to the - VM. This amount is subtracted from the hypervisor's total - available memory, not the memory of the Dom0. - - - - Number of virtual CPUs available to the guest VM. For - best performance, do not create guests with more virtual - CPUs than the number of physical CPUs on the host. - - - - Virtual network adapter. This is the bridge connected - to the network interface of the host. The - mac parameter is the MAC address set on - the virtual network interface. This parameter is - optional, if no MAC is provided Xen will generate a - random one. - - - - Full path to the disk, file, or ZFS volume of the disk - storage for this VM. Options and multiple disk - definitions are separated by commas. - - - - Defines the Boot medium from which the initial - operating system is installed. In this example, it is the - ISO imaged downloaded earlier. Consult the Xen - documentation for other kinds of devices and options to - set. - - - - Options controlling VNC connectivity to the serial - console of the DomU. In order, these are: active VNC - support, define IP address on which to listen, device node - for the serial console, and the input method for precise - positioning of the mouse and other input methods. - keymap defines which keymap to use, and - is english by default. - - - - After the file has been created with all the necessary - options, the DomU is created by passing it to xl - create as a parameter. - - # xl create freebsd.cfg - - - Each time the Dom0 is restarted, the configuration file - must be passed to xl create again to - re-create the DomU. By default, only the Dom0 is created - after a reboot, not the individual VMs. The VMs can - continue where they left off as they stored the operating - system on the virtual disk. The virtual machine - configuration can change over time (for example, when adding - more memory). The virtual machine configuration files must - be properly backed up and kept available to be able to - re-create the guest VM when needed. - - - The output of xl list confirms that the - DomU has been created. - - # xl list -Name ID Mem VCPUs State Time(s) -Domain-0 0 8192 4 r----- 1653.4 -freebsd 1 1024 1 -b---- 663.9 - - To begin the installation of the base operating system, - start the VNC client, directing it to the main network address - of the host or to the IP address defined on the - vnclisten line of - freebsd.cfg. After the operating system - has been installed, shut down the DomU and disconnect the VNC - viewer. Edit freebsd.cfg, removing the - line with the cdrom definition or - commenting it out by inserting a # - character at the beginning of the line. To load this new - configuration, it is necessary to remove the old DomU with - xl destroy, passing either the name or the - id as the parameter. Afterwards, recreate it using the - modified freebsd.cfg. - - # xl destroy freebsd -# xl create freebsd.cfg - - The machine can then be accessed again using the VNC - viewer. This time, it will boot from the virtual disk where - the operating system has been installed and can be used as a - virtual machine. - - - - 疑難排解 - - This section contains basic information in order to help - troubleshoot issues found when using FreeBSD as a Xen host or - guest. - - - 主端開機疑難排解 - - Please note that the following troubleshooting tips - are intended for Xen 4.11 or newer. If you are still - using Xen 4.7 and having issues consider migrating to - a newer version of Xen. - - In order to troubleshoot host boot issues you will - likely need a serial cable, or a debug USB cable. Verbose - Xen boot output can be obtained by adding options to the - xen_cmdline option found in - loader.conf. A couple of relevant - debug options are: - - - - iommu=debug: can be used to print - additional diagnostic information about the - iommu. - - - dom0=verbose: can be used to - print additional diagnostic information about the - dom0 build process. - - - sync_console: flag to force - synchronous console output. Useful for debugging to - avoid losing messages due to rate limiting. - Never use this option in production environments since - it can allow malicious guests to perform DoS attacks - against Xen using the console. - - - - FreeBSD should also be booted in verbose mode in order - to identify any issues. To activate verbose booting, run - this command: - - # sysrc -f /boot/loader.conf boot_verbose="YES" - - If none of these options help solving the problem, - please send the serial boot log to - freebsd-xen@FreeBSD.org and - xen-devel@lists.xenproject.org - for further analysis. - - - - 客端建立疑難排解 - - Issues can also arise when creating guests, the - following attempts to provide some help for those trying - to diagnose guest creation issues. - - The most common cause of guest creation failures is the - xl command spitting some error and - exiting with a return code different than 0. If the error - provided is not enough to help identify the issue, more - verbose output can also be obtained from - xl by using the v - option repeatedly. - - # xl -vvv create freebsd.cfg -Parsing config from freebsd.cfg -libxl: debug: libxl_create.c:1693:do_domain_create: Domain 0:ao 0x800d750a0: create: how=0x0 callback=0x0 poller=0x800d6f0f0 -libxl: debug: libxl_device.c:397:libxl__device_disk_set_backend: Disk vdev=xvda spec.backend=unknown -libxl: debug: libxl_device.c:432:libxl__device_disk_set_backend: Disk vdev=xvda, using backend phy -libxl: debug: libxl_create.c:1018:initiate_domain_create: Domain 1:running bootloader -libxl: debug: libxl_bootloader.c:328:libxl__bootloader_run: Domain 1:not a PV/PVH domain, skipping bootloader -libxl: debug: libxl_event.c:689:libxl__ev_xswatch_deregister: watch w=0x800d96b98: deregister unregistered -domainbuilder: detail: xc_dom_allocate: cmdline="", features="" -domainbuilder: detail: xc_dom_kernel_file: filename="/usr/local/lib/xen/boot/hvmloader" -domainbuilder: detail: xc_dom_malloc_filemap : 326 kB -libxl: debug: libxl_dom.c:988:libxl__load_hvm_firmware_module: Loading BIOS: /usr/local/share/seabios/bios.bin -... - - If the verbose output does not help diagnose the issue - there are also QEMU and Xen toolstack logs in - /var/log/xen. Note that the name of - the domain is appended to the log name, so if the domain - is named freebsd you should find a - /var/log/xen/xl-freebsd.log and likely - a /var/log/xen/qemu-dm-freebsd.log. - Both log files can contain useful information for debugging. - If none of this helps solve the issue, please send the - description of the issue you are facing and as much - information as possible to - freebsd-xen@FreeBSD.org and - xen-devel@lists.xenproject.org in order to - get help. - - - - - - - - - - 在地化 - <acronym>i18n</acronym>/<acronym>L10n</acronym> 使用與安裝 - - - AndreyChernovContributed - by - - - Michael - C.WuRewritten - by - - - - - - 概述 - - FreeBSD 計劃的使用者及貢獻者分佈在世界各地,也因此 FreeBSD 支援多語系,讓使用者可以使用非英文語言來檢視、輸入或處理資料。使用者可以選擇大多數主要語言,包含但不限於以下語言:中文、德文、日文、韓文、法文、俄文及越南文。 - - - internationalization - localization - - 在地化 - - 國際化 (Internationalization) 一詞可以縮寫為 i18n,即 第一個字母到最後一個字母間的字母數量。L10n 也使用同樣的命名規則,但源自 在地化 (Localization)。 i18n/L10n 的方法、協定及應用程式讓使用者可以自己選擇使用的語言。 - - 本章會討論 FreeBSD 的國際化及在地化功能。在閱讀本章之後,您會了解: - - - - 語系名稱如何組成。 - - - - 如何設定登入 Shell 的語系。 - - - - 如何設定 Console 給非英文語言的使用者。 - - - - 如果設定 Xorg 使用不同語言。 - - - - 如何找到支援 i18n 的應用程式。 - - - - 那裡可以找到更多設定特定語言的資訊。 - - - - 在開始閱讀這章之前,您需要: - - - 了解如何 安裝其他第三方應用程式。 - - - - - 使用語系 - - locale - - 語系設定值由三個元件所組成:語言代號、城市代號及編碼。語系名稱組成的方式如下: - - LanguageCode_CountryCode.Encoding - - language codes - country codes - - LanguageCodeCountryCode 用來表示城市及特定語言。 提供了幾個 LanguageCode_CountryCode 的範例: - - - 常用語言及城市代碼 - - - - - 語言代號_城市代號 - 說明 - - - - - - en_US - 英文,美國 - - - - ru_RU - 俄文,俄國 - - - - zh_TW - 繁體中文,台灣 - - - -
- - 完整可用的語系清單可用以下指令查詢: - - % locale -a | more - - 查詢目前使用的語系設定: - - % locale - - encodings - ASCII - - 語言特定的字元集如 ISO8859-1, ISO8859-15, KOI8-R 及 CP437 在 multibyte3 有詳細說明。可用的字元集可在 IANA Registry 查詢。 - - 某些語言,如中文或日文,無法使用 ASCII 字元表示,會需要使用寬 (Wide) 字元或多位元組 (Multibyte) 字元來擴充的語言編碼。EUC 與 Big5 即是使用寬子元或多位元組字元的例子。舊的應用程式會誤判這些字元為控制字元,新的應用程式則通常可以辨識這些字元,依實作的需要,使用者可能需要開啟寬字元或多位元組字元支援或者使用正確的字元設定來編譯應用程式。 - - - FreeBSD 使用 Xorg 相容的語系編碼。 - - - 本節剩餘的部份將說明各種在 FreeBSD 系統上設定語系的方法。下一節將會探討如何尋找以及編譯使用 i18n 支援的應用程式。 - - - 設定登入 Shell 的語系 - - 語系設定可在使用者的 ~/.login_conf 或使用者的 Shell 的啟動檔設定:~/.profile, ~/.bashrc~/.cshrc - - 有兩個環境變數需要設定: - - - - LANG 用來設定語系 - POSIX - - - - MIME - - MM_CHARSET 用來設定應用程式所使用的 MIME 字元集 - - - - 除了使用者的 Shell 設定外,這些變數也應針對特定應用程式設定以及 Xorg 設定。 - - locale - login class - - 兩種可以完成所需變數設定的方法有:登入類別 (Login class) 法 (較建議) 及 啟動檔 (Startup file) 法。以下兩節將示範如何使用這兩個方法。 - - - 登入類別 (Login Class) 法 - - 第一種方式,同時也是建議使用的方法,它可以對任何可能的 Shell 設定需要的語系及 MIME 字元集變數。此設定也可由每位使用者自行設定或者由超級管理者為所有使用者設定。 - - 以下精簡範例示範在一個使用者的家目錄中的 .login_conf 設定 Latin-1 編碼使用的兩個環境變數: - - me:\ - :charset=ISO-8859-1:\ - :lang=de_DE.ISO8859-1: - - Traditional Chinese - BIG-5 encoding - - 以下使用者的 ~/.login_conf 範例設定了繁體中文於 BIG-5 編碼使用到的環境變數。有一部份應用程式無法正確處理中文、日文及韓文的語系變數,因此需要額外多做一些設定: - - #Users who do not wish to use monetary units or time formats -#of Taiwan can manually change each variable -me:\ - :lang=zh_TW.Big5:\ - :setenv=LC_ALL=zh_TW.Big5,LC_COLLATE=zh_TW.Big5,LC_CTYPE=zh_TW.Big5,LC_MESSAGES=zh_TW.Big5,LC_MONETARY=zh_TW.Big5,LC_NUMERIC=zh_TW.Big5,LC_TIME=zh_TW.Big5:\ - :charset=big5:\ - :xmodifiers="@im=gcin": #Set gcin as the XIM Input Server - - 或者,超級使用者可以設定所有系統使用者的語系。以下在 /etc/login.conf 中的變數可用來設定語系及 MIME 字元集: - - language_name|Account Type Description:\ - :charset=MIME_charset:\ - :lang=locale_name:\ - :tc=default: - - 若套用之前的 Latin-1 編碼範例如下: - - german|German Users Accounts:\ - :charset=ISO-8859-1:\ - :lang=de_DE.ISO8859-1:\ - :tc=default: - - 請參考 login.conf5 以取得更多有關這些變數的詳細資訊。請注意,它已經含有預先定義的 russian class。 - - 每次編輯 /etc/login.conf 之後,請記得要執行以下指令來更新登入類別的能力資料庫(Capability database): - - # cap_mkdb /etc/login.conf - - - 變更登入類別的工具 - - - vipw - - - 除了手動編輯 /etc/login.conf 之外,尚有需多工具可用來為新建立的使用者設定語系。 - - 當使用 vipw 來新增使用者時,可指定 language 來設定語系: - - user:password:1111:11:language:0:0:User Name:/home/user:/bin/sh - - - adduser - - login class - - 當使用 adduser 來新增使用者時,可對所有使用者或指定的使用者事先設定預設的語言。 - - 若所有新的使用者都使用同樣的語言,可在 /etc/adduser.conf 設定 defaultclass=language - - 要在建立使用者時覆蓋預設的設定,可在出現此提示時輸入需要的語系: - - Enter login class: default []: - - 或執行 adduser 時指定語系: - - # adduser -class language - - - pw - - - 若使用 pw 來新增使用者,則可指定語系如下: - - # pw useradd user_name -L language - - To change the login class of an existing user, - chpass can be used. Invoke it as - superuser and provide the username to edit as the - argument. - - # chpass user_name - - - - - Shell 啟動檔 (Startup File) 法 - - 第二種方法,較不建議使用,因每一種使用到的 Shell 都需要手動設定,而每一種 Shell 都有不同的設定檔以及語法。例如將一位使用者的 sh shell 設定為德語,需要將下列行加到 ~/.profile,若要設定給使用該 Shell 的所有使用者則必須將下列行加到 /etc/profile/usr/share/skel/dot.profile - - LANG=de_DE.ISO8859-1; export LANG -MM_CHARSET=ISO-8859-1; export MM_CHARSET - - 然而,在 csh shell 所使用的設定檔名稱及語法不同。同樣的設定需加入下列行至 ~/.csh.login, /etc/csh.login/usr/share/skel/dot.login - - setenv LANG de_DE.ISO8859-1 -setenv MM_CHARSET ISO-8859-1 - - 更複雜一點的情況,Xorg~/.xinitrc 語系設定會依使用的 Shell 而有所不同。第一個例子是針對 sh shell 而第二個則是針對 csh shell: - - LANG=de_DE.ISO8859-1; export LANG - - setenv LANG de_DE.ISO8859-1 - - - - - Console 設定 - - 已有許多語系的字型可在 Console 使用,要查看可用的字型清單,可輸入 ls /usr/share/syscons/fonts。要設定 Console 的字型,可在 /etc/rc.conf 指定去掉 .fnt 字尾的字型名稱 font_name - - font8x16=font_name -font8x14=font_name -font8x8=font_name - - keymap - screenmap - 鍵盤對應表 (Keymap) 及螢幕對應表 (Screenmap) 用可加入下行到 /etc/rc.conf 來設定: - - scrnmap=screenmap_name -keymap=keymap_name -keychange="fkey_number sequence" - - 要查看可用的螢幕對應表,可輸入 ls /usr/share/syscons/scrnmaps。在設定螢幕對應表 screenmap_name 時請去掉 .scm 字尾。在 VGA Adapter 的字型字元矩陣擴充位元 8 到位元 9 時會需要使用螢幕對應表與相關的字型對應來解決,因此若螢幕字型使用位元 8 的欄位,字母會移出虛擬繪圖區 (Pseudographics area)。 - - 要查看可用的鍵盤對應表,可輸入 ls /usr/share/syscons/keymaps。在設定鍵盤對應表 keymap_name 時請去掉 .kbd 字尾。若要不重開機測試鍵盤對應用可使用 kbdmap1 - - keychange 項目用在當功能鍵序列無法定義在鍵盤對應表時,可設定對應選擇終對機類型的功能鍵。 - - 接下來,在 /etc/ttys 為所有虛擬終端機項目設定正確的 Console 終端機類型。 摘要了可用的終端機類型: - - - 已定義供特定字元集使用的終端機類型 - - - - - 字元集 - 終端機類型 - - - - - - ISO8859-1 or ISO8859-15 - cons25l1 - - - - ISO8859-2 - cons25l2 - - - - ISO8859-7 - cons25l7 - - - - KOI8-R - cons25r - - - - KOI8-U - cons25u - - - - CP437 (VGA 預設值) - cons25 - - - - US-ASCII - cons25w - - - -
- - - moused - - - 對於使用寬字元或多位元組字元的語言,需從 Port 套件集安裝支援該語言的 Console。 可用的 Port 摘要在 。安裝完成之後,請參考 Port 的 pkg-message 或操作手冊來取得設定及使用說明。 - - - Port 套件集中可用的 Console - - - - - 語言 - Port 位置 - - - - - - 繁體中文 (BIG-5) - chinese/big5con - - - - 中文/日文/韓文 - chinese/cce - - - - 中文/日文/韓文 - chinese/zhcon - - - - 日文 - chinese/kon2 - - - - 日文 - japanese/kon2-14dot - - - - 日文 - japanese/kon2-16dot - - - -
- - 若在 /etc/rc.conf 有開啟 moused,可能會需要額外的設定。預設 syscons4 驅動程式的滑鼠游標會佔用字元集 0xd0-0xd3 的範圍,若語言有使用到此範圍,可加入以下行到 /etc/rc.conf 來移動游標的範圍: - - mousechar_start=3 -
- - - Xorg 設定 - - 會說明如何安裝並設定 Xorg。當要設定 Xorg 在地化時,可從 FreeBSD Port 套件集中取得其他可用的字型及輸入法。應用程式特定的 i18n 設定像是字型與選單,可以在 ~/.Xresources 中調校且可允許使用者在圖型化應用程式選單檢視其所選擇的語言。 - - X Input Method (XIM) - - X 輸入法 (X Input Method, XIM) 協定是 Xorg 針對輸入非英語字元的標準。 摘要了在 FreeBSD 套件集中可用的輸入法應用程式。也可使用其他如 Fcitx 及 Uim 應用程式。 - - - 可用的輸入法 - - - - - 語言 - 輸入法 - - - - - - - 中文 - chinese/gcin - - - - 中文 - chinese/ibus-chewing - - - - 中文 - chinese/ibus-pinyin - - - - 中文 - chinese/oxim - - - - 中文 - chinese/scim-fcitx - - - - 中文 - chinese/scim-pinyin - - - - 中文 - chinese/scim-tables - - - - 日文 - japanese/ibus-anthy - - - - 日文 - japanese/ibus-mozc - - - - 日文 - japanese/ibus-skk - - - - 日文 - japanese/im-ja - - - - 日文 - japanese/kinput2 - - - - 日文 - japanese/scim-anthy - - - - 日文 - japanese/scim-canna - - - - 日文 - japanese/scim-honoka - - - - 日文 - japanese/scim-honoka-plugin-romkan - - - - 日文 - japanese/scim-honoka-plugin-wnn - - - - 日文 - japanese/scim-prime - - - - 日文 - japanese/scim-skk - - - - 日文 - japanese/scim-tables - - - - 日文 - japanese/scim-tomoe - - - - 日文 - japanese/scim-uim - - - - 日文 - japanese/skkinput - - - - 日文 - japanese/skkinput3 - - - - 日文 - japanese/uim-anthy - - - - 韓文 - korean/ibus-hangul - - - - 韓文 - korean/imhangul - - - - 韓文 - korean/nabi - - - - 韓文 - korean/scim-hangul - - - - 韓文 - korean/scim-tables - - - - 越南文 - vietnamese/xvnkb - - - - 越南文 - vietnamese/x-unikey - - - -
-
- -
- - - 尋找 <acronym>i18n</acronym> 應用程式 - - i18n 應用程式會使用 i18n 工具包做為程式庫開發。這讓開發人員可以寫一個簡單的檔案並翻譯顯示的選單及文字至各種語言。 - - FreeBSD Port 套件集中含有許多內建支援寬字元或多位元組字元的應用程式可支援各種語言。該類型的應用程式在名稱上會註明 i18n 以易於辨識。雖然如此,但不一定支援您所需要的語言。 - - 有一部份應用程式可以使用指定的字元集來編譯。通常會在 Port 的 Makefile 中設定,或者傳送參數給 configure。請參考各 FreeBSD Port 原始碼中的 i18n 說明文件以取得更多有關需要的設定值資訊或 Port 的 Makefile 來了解在編譯時有那些可以使用的編譯選項。 - - - - 特定語言的語系設定 - - This section provides configuration examples for localizing - a FreeBSD system for the Russian language. It then provides some - additional resources for localizing other languages. - - - - 俄語 (KOI8-R 編碼) - - - AndreyChernovOriginally - contributed by - - - - - localization - Russian - - - This section shows the specific settings needed to - localize a FreeBSD system for the Russian language. Refer to - Using Localization - for a more complete description of each type of - setting. - - To set this locale for the login shell, add the following - lines to each user's - ~/.login_conf: - - me:My Account:\ - :charset=KOI8-R:\ - :lang=ru_RU.KOI8-R: - - To configure the console, add the following lines to - /etc/rc.conf: - - keymap="ru.koi8-r" -scrnmap="koi8-r2cp866" -font8x16="cp866b-8x16" -font8x14="cp866-8x14" -font8x8="cp866-8x8" -mousechar_start=3 - - For each ttyv entry in - /etc/ttys, use - cons25r as the terminal type. - - printers - To configure printing, a special output filter is needed - to convert from KOI8-R to CP866 since most printers with - Russian characters come with hardware code page CP866. FreeBSD - includes a default filter for this purpose, - /usr/libexec/lpr/ru/koi2alt. To use this - filter, add this entry to - /etc/printcap: - - lp|Russian local line printer:\ - :sh:of=/usr/libexec/lpr/ru/koi2alt:\ - :lp=/dev/lpt0:sd=/var/spool/output/lpd:lf=/var/log/lpd-errs: - - Refer to printcap5 for a more detailed - explanation. - - To configure support for Russian filenames in mounted - MS-DOS file systems, include and the - locale name when adding an entry to - /etc/fstab: - - /dev/ad0s2 /dos/c msdos rw,-Lru_RU.KOI8-R 0 0 - - Refer to mount_msdosfs8 for more details. - - To configure Russian fonts for - Xorg, install the - x11-fonts/xorg-fonts-cyrillic package. - Then, check the "Files" section in - /etc/X11/xorg.conf. The following line - must be added before any other - FontPath entries: - - FontPath "/usr/local/lib/X11/fonts/cyrillic" - - Additional Cyrillic fonts are available in the Ports - Collection. - - To activate a Russian keyboard, add the following to the - "Keyboard" section of - /etc/xorg.conf: - - Option "XkbLayout" "us,ru" -Option "XkbOptions" "grp:toggle" - - Make sure that XkbDisable is - commented out in that file. - - For grp:toggle use - Right Alt, for - grp:ctrl_shift_toggle use CtrlShift. - For grp:caps_toggle use - CapsLock. The old - CapsLock function is still available in LAT - mode only using ShiftCapsLock. - grp:caps_toggle does not work in - Xorg for some unknown - reason. - - If the keyboard has Windows keys, and - some non-alphabetical keys are mapped incorrectly, add the - following line to /etc/xorg.conf: - - Option "XkbVariant" ",winkeys" - - - The Russian XKB keyboard may not work with - non-localized applications. Minimally localized - applications should call a XtSetLanguageProc - (NULL, NULL, NULL); function early in the - program. - - - See http://koi8.pp.ru/xwin.html - for more instructions on localizing - Xorg applications. For more - general information about KOI8-R encoding, refer to http://koi8.pp.ru/. - - - - 其他特定語言資源 - - This section lists some additional resources for - configuring other locales. - - - localization - Traditional Chinese - - - localization - German - - - localization - Greek - - - localization - Japanese - - - localization - Korean - - - - - Traditional Chinese for Taiwan - - - The FreeBSD-Taiwan Project has a Chinese HOWTO for FreeBSD - at http://netlab.cse.yzu.edu.tw/~statue/freebsd/zh-tut/. - - - - - Greek Language Localization - - - A complete article on Greek support in FreeBSD - is available here, - in Greek only, as part of the official FreeBSD Greek - documentation. - - - - - Japanese and Korean Language Localization - - - For Japanese, refer to http://www.jp.FreeBSD.org/, - and for Korean, refer to http://www.kr.FreeBSD.org/. - - - - - Non-English FreeBSD Documentation - - - Some FreeBSD contributors have translated parts of the - FreeBSD documentation to other languages. They are - available through links on the FreeBSD web - site or in - /usr/share/doc. - - - - - -
- - - - - - - 更新與升級 FreeBSD - - - - - Jim - Mock - - Restructured, reorganized, and parts updated - by - - - - - - - - Jordan - Hubbard - - Original work by - - - - - Poul-Henning - Kamp - - - - - - John - Polstra - - - - - - Nik - Clayton - - - - - - - 概述 - - FreeBSD 在每次的發佈之間持續在開發。有些人偏好正式發佈的版本,也有另一群人喜歡使用最新的開發版本。然而,即使是正式發佈的版本也時常會有安全性與其他緊急修復的更新,因此,無論使用哪種版本,FreeBSD 都提供所有必要的工具來讓系統能維持最新的版本,且讓各種版本都能簡單的升級。本章將說明如何追蹤開發版本的系統及讓 FreeBSD 系統維持最新版本的基本工具。 - - 讀完這章,您將了解: - - - - 如何使用 freebsd-update, Subversion 來維持 FreeBSD 系統為最新版。 - - - - 如何比對已安裝系統與已知原始複本間的狀態。 - - - - 如何使用 Subversion 或說明文件 Port 來維持已安裝的文件為新版。 - - - - 兩種開發分支間的差異:FreeBSD-STABLE 與 FreeBSD-CURRENT。 - - - - 如何重新編譯及重新安裝整個基礎系統 (Base system)。 - - - - 在開始閱讀這章之前,您需要: - - - - 正確的設定網路連線 ()。 - - - - 了解如何安裝其他第三方軟體 ()。 - - - - - 本章會經常使用 svnlite 來取得與更新 FreeBSD 原始碼。您也可以使用 devel/subversion Port 或套件。 - - - - - - FreeBSD 更新 - - - - - Tom - Rhodes - - Written by - - - - - - - Colin - Percival - - Based on notes provided by - - - - - - Updating and Upgrading - - - freebsd-update - updating-upgrading - - - 隨時套用安全性更新以及升級到新發佈的作業系統版本對管理一個持續運作的系統是非常重要的任務,FreeBSD 內含可以執行這兩項任務的工具程式,叫做 freebsd-update - - 這個工具程式支援使用 Binary 對 FreeBSD 做安全性與和錯誤更新,不需要手動編譯和安裝修補 (Patch) 或新核心。目前由安全性團隊提供支援的 Binary 更新可用於所有的架構和發行版。支援的發行版清單及各自的支援期限列於 https://www.FreeBSD.org/security/ - - 這個工具程式也支援升級作業系統到次要的發佈版以及升級到另一個發佈版分支。在升級到新的發佈版本前,需先查看該版本的發佈公告,因為發行公告中包含了該發行版本的相關重要資訊。發行公告可自 https://www.FreeBSD.org/releases/ 取得。 - - - 如果有使用 crontab 來執行 freebsd-update8,則必須在升級作業系統前先關閉。 - - - 本節將說明 freebsd-update 使用的設定檔, 示範如何套用安全性修補及如何升級到主要或次要的作業系統發行版,並討論升級作業系統的需要考量的事項。 - - - 設定檔 - - freebsd-update 預設的設定檔不需變更即可運作。 部份使用者可能會想要調校位於 /etc/freebsd-update.conf 的預設設定檔來對程序有更好的控制。該設定檔中的註解均有說明可用的選項,但以下幾個項目可能需要進一步的說明: - - # Components of the base system which should be kept updated. -Components world kernel - - 這個參數控制 FreeBSD 要保持最新版本的部份。 預設是更新整個基礎系統 (Base system) 和核心。 可指定個別元件,例如:src/basesrc/sys。 雖然如此,最好的選項是維持預設值,因為更改指定特定項目時需列出每一個需要的項目。時間一久可能會因為原始碼和 Binary 檔案沒有更新而造成慘重的後果。 - - # Paths which start with anything matching an entry in an IgnorePaths -# statement will be ignored. -IgnorePaths /boot/kernel/linker.hints - - 要保持特定的目錄在更新過程不被更動,例如 /bin/sbin,可以將他們的路徑加到此敘述中。 這個選項可以防止 freebsd-update 覆蓋本地的修改。 - - # Paths which start with anything matching an entry in an UpdateIfUnmodified -# statement will only be updated if the contents of the file have not been -# modified by the user (unless changes are merged; see below). -UpdateIfUnmodified /etc/ /var/ /root/ /.cshrc /.profile - - 這個選項只會更新特定目錄中未修改的設定檔。任何使用者修改的檔案都不會自動更新。 有另一個選項 KeepModifiedMetadata 可讓 freebsd-update 在合併時儲存使用者做的變更。 - - # When upgrading to a new FreeBSD release, files which match MergeChanges -# will have any local changes merged into the version from the new release. -MergeChanges /etc/ /var/named/etc/ /boot/device.hints - - 列出 freebsd-update 應嘗試合併的設定檔目錄。 檔案合併程序是指一系列類似 mergemaster8 做的 diff1 修補動作, 但是選項比較少。 合併的動作包含接受、開啟編輯器,或讓 freebsd-update 中止。 如果有疑慮,請先備份 /etc,然後再接受合併。 更多關於 mergemaster 的資訊, 參見 mergemaster8 - - # Directory in which to store downloaded updates and temporary -# files used by FreeBSD Update. -# WorkDir /var/db/freebsd-update - - 這個目錄是所有修補檔和暫存檔的存放處。當使用者進行版本升級時,這個位置應該要有至少 1GB 的可用磁碟空間。 - - # When upgrading between releases, should the list of Components be -# read strictly (StrictComponents yes) or merely as a list of components -# which *might* be installed of which FreeBSD Update should figure out -# which actually are installed and upgrade those (StrictComponents no)? -# StrictComponents no - - 當這個選項設定為 yes 時,freebsd-update 將會假設 Components 清單已完成,將不會對清單之外的項目做變更。 實際上 freebsd-update 會將嘗試更新每一個屬於 Components 清單中的檔案。 - - - - 套用安全性修補 - - 套用 FreeBSD 安全性修補的過程已經被簡化,讓系統管理員可使用 freebsd-update 來保持系統更新。更多有關 FreeBSD 安全性報告的資訊可以參考 - - FreeBSD 安全性修補可以使用以下指令下載並安裝。 第一個指令會偵測是否有可用的修補,如果有,將列出若執行修補後會變更的檔案清單。第二個指令將會套用修補。 - - # freebsd-update fetch -# freebsd-update install - - 如果更新套用了任何核心修補,系統將會需要重新開機以使用修補過的核心。如果修補套用在任何執行中的 Binary,受影響的應用程式應重新啟動來使用修補過的 Binary 版本。 - - 加入以下項目至 /etc/crontab 可設定系統每天自動檢查更新一次: - - @daily root freebsd-update cron - - 如果有新的修補,該程式會會自動下載,但不會執行。root 使用者會收到電子郵件通知複查該修補並手動執行 freebsd-update install 安裝。 - - 如果有發生任何錯誤,freebsd-update 可以使用以下指令還原最後所做的變更: - - # freebsd-update rollback -Uninstalling updates... done. - - 再次強調,若核心或任何核心模組有做過修改應重新啟動系統,以及任何受影響的 Binary 應重新執行。 - - 只有 GENERIC 核心可使用 freebsd-update 自動更新。 如果有安裝自訂的核心,在 freebsd-update 完成安裝更新後,需要重新編譯和重新安裝。 預設的核心名稱為 GENERIC,可使用 uname1 指令來檢查安裝的核心。 - - - 隨時在 /boot/GENERIC 保留一份 GENERIC 核心的複本將有助於診斷各種問題及執行版本升級。請參考 來了解有關如何取得 GENERIC 核心的複本說明。 - - - 除非在 /etc/freebsd-update.conf 的預設設定檔被修改,否則 freebsd-update 將會安裝更新後的核心原始碼和其餘的更新,可依平常的方式執行重新編譯與重新安裝核心。 - - freebsd-update 發行的更新並非總是會更新核心。若核心的原始碼沒有被 freebsd-update install 修改則不需要重新編譯自訂的核心。雖然如此 freebsd-update 總是會更新 /usr/src/sys/conf/newvers.sh,目前修補的版本如 uname -r 執行結果中的 -p 數字,便是由該檔取得。即使沒有做任何其他變更,重新編譯自訂核心可讓 uname 準確的回報系統目前的修補版本。當維護多個系統時這會特別有用,因其可讓你快速評估每個系統安裝的更新。 - - - - 執行主要及次要版號升級 - - 從 FreeBSD 的次要版本升級到另一個版本,例如從 FreeBSD 9.0 到 FreeBSD 9.1, 叫作 次要版本 (Minor version) 更新。 主要版本 (Major version) 更新發生在當 FreeBSD 從一個主要版本升級到主要版本升級到另一個主要版本時,例如從 FreeBSD 9.X 到 FreeBSD 10.X。 兩種更新都可以透過提供 freebsd-update 目標的發佈版本來執行。 - - - 如果系統正在執行自訂的核心,請在開始升級前,確定有保留一份 GENERIC 核心的複本在 /boot/GENERIC。 請參考 關於如何取得 GENERIC 核心複本的說明。 - - - 在 FreeBSD 9.0 系統執行以下指令,將會把系統升級至 FreeBSD 9.1: - - # freebsd-update -r 9.1-RELEASE upgrade - - 收到這個指令後,freebsd-update 會開始評估設定檔和目前的系統來收集升級所需的資訊。 螢幕會顯示偵測到或沒偵測到的元件清單。例如: - - Looking up update.FreeBSD.org mirrors... 1 mirrors found. -Fetching metadata signature for 9.0-RELEASE from update1.FreeBSD.org... done. -Fetching metadata index... done. -Inspecting system... done. - -The following components of FreeBSD seem to be installed: -kernel/smp src/base src/bin src/contrib src/crypto src/etc src/games -src/gnu src/include src/krb5 src/lib src/libexec src/release src/rescue -src/sbin src/secure src/share src/sys src/tools src/ubin src/usbin -world/base world/info world/lib32 world/manpages - -The following components of FreeBSD do not seem to be installed: -kernel/generic world/catpages world/dict world/doc world/games -world/proflibs - -Does this look reasonable (y/n)? y - - 此時,freebsd-update 將會嘗試下載所有升級需要的檔案。 在某些情況,會詢問使用者一些關於要安裝什麼或要如何繼續。 - - 當使用自訂核心,上述的步驟將會產生如下的警告: - - WARNING: This system is running a "MYKERNEL" kernel, which is not a -kernel configuration distributed as part of FreeBSD 9.0-RELEASE. -This kernel will not be updated: you MUST update the kernel manually -before running "/usr/sbin/freebsd-update install" - - 這時的警告可以安全地忽略,升級過程將會使用更新過的 GENERIC 核心來進行。 - - 所有的修補都下載到本地系統之後, 將會開始套用更新。這個過程可能會花點時間,取決於機器的速度和工作量。設定檔將會被合併。 合併的過程中當檔案被合併或是手動合併畫面上出現編輯器時需要使用者操作。 每一個成功合併的結果將會顯示給使用者並繼續程序,失敗或忽略合併將會使程序中斷。使用者可能想要備份 /etc 並稍後手動合併重要的檔案,例如:master.passwdgroup - - - 所有的修補與合併動作會在另一個目錄進行,並不會直接修改。當成功套用所有修補,所有設定檔已合併且過程順利,使用者可使用以下指令將變更安裝到磁碟: - - # freebsd-update install - - - 核心與核心模組會先修補,若系統正在執行自訂的核心,使用 nextboot8 來設定下次開機使用更新過的 /boot/GENERIC - - # nextboot -k GENERIC - - - 若機器在遠端進行更新,請在使用 GENERIC 核心重新開機前,請確定該核心含有所有系統所需的驅動程式以正常開機並連線至網路。特別是在執行的自訂核心有使用到由核心模組提供內建功能,請確定將這些模組已暫時使用 /boot/loader.conf 設定檔載入到 GENERIC 核心。建議關閉非必須的服務和磁碟與網路掛載直到升級程序完成。 - - - 機器現在應使用更新過的核心重新開機: - - # shutdown -r now - - 一旦系統重新上線,使用以下指令繼續 freebsd-update。 由於程序的狀態已被儲存,freebsd-update 不會重頭開始,但會進行下一個階段並移除所有舊的共用程式庫和目標檔。 - - # freebsd-update install - - - 取決於是否有任何程式庫版本編號衝突,也可能只有兩個而不是三個安裝階段。 - - - 升級程序現在完成了。如果所做的是主要的版本升級,則需依 的說明重新安裝所有的 Port 和套件。 - - - 在 FreeBSD 9.X 及之後版本自訂核心 - - 在使用 freebsd-update 前,請確定已有 GENERIC 核心的複本於 /boot/GENERIC。若只編譯過一次自訂核心,那麼 /boot/kernel.old 就是 GENERIC 核心,只需要將該目錄重新命名為 /boot/kernel - - 若有編譯自訂核心過超過一次,或已經不曉得編譯自訂核心的次數,則需取得與目前作業系統版本相符的 GENERIC 核心複本。若可直接操作實體系統,則可以從安裝媒體取得 GENERIC 核心複本: - - # mount /cdrom -# cd /cdrom/usr/freebsd-dist -# tar -C/ -xvf kernel.txz boot/kernel/kernel - - 或者,可以從原始碼重新編譯 GENERIC 核心: - - # cd /usr/src -# make kernel __MAKE_CONF=/dev/null SRCCONF=/dev/null - - 這個核心要被 freebsd-update 認做 GENERIC 核心,GENERIC 設定檔必須不能做任何修改,也建議在編譯核心時不要使用其他特殊選項。 - - freebsd-update 僅需要 /boot/GENERIC 存在便可,因此不須重新開機進入 GENERIC - - - - 主要版號升級後的套件升級 - - 一般來說,已安裝的應用程式在次要版本升級仍可沒問題的正常執行。但主要版本升級會採用不同的應用程式 Binary 介面 (Application Binary Interfaces, ABIs),會導致大部份第三方應用程式無法正常執行。 因此在主要版本升級後,需要升及所有已安裝的套件和 Port,套件可以使用 pkg upgrade 來升級,而 Port 則需使用 ports-mgmt/portmaster 工具。 - - 強制升級所有已安裝的套件會使用檔案庫中新版本的套件來取得目前套件,即使該版號沒有增加。由於在升級 FreeBSD 主要版本時會變更 ABI 版本,因此這是必要動作。強制升級可以執行以下指令來完成: - - # pkg-static upgrade -f - - 重新編譯所有已安裝的應用程式可以執行以下指令來完成: - - # portmaster -af - - 這個指令會在安裝每個應用程式有可設定選項時顯示設定畫面,並會等待使用者操作該畫面,要避免這種情況並使用預設的設定選項,可在上述指令加上 參數。 - - 完成軟體升級後,最後需執行 freebsd-update 來完成最後的升級動作: - - # freebsd-update install - - 若有使用臨時 GENERIC 核心,便應在此時依據 的說明編譯並安裝新的自訂核心。 - - 重新開機使用新的 FreeBSD 版本後,升級程序便正式完成。 - - - - - 比對系統狀態 - - 已安裝的 FreeBSD 版本狀態可以使用 freebsd-update IDS 與另一個已知良好的複本來做比對測試。 這個指令會評估目前版本的系統工具,程式庫和設定檔,可做為內建的入侵偵測系統來使用 (Intrusion Detection System, IDS)。 - - - 這個指令並非用來取代真正的 IDS,如 security/snort。由於 freebsd-update 儲存在磁碟上,被竄改的可能性是顯而易見的,雖然這個可能性會因使用 kern.securelevel 以及將 freebsd-update 在不使用時以唯讀儲存而降低,最好的解決方案是能夠與安全的磁碟,如 DVD 或儲存在外部的 USB 磁碟裝置比對系統。替代的方式是使用內建工具的 IDS 功能,在 有詳細說明 - - - 要開始比對,需指定輸出的檔案來儲存結果: - - # freebsd-update IDS >> outfile.ids - - 系統將會開始檢查並且會產生相當長的檔案清單,內容包含發佈版本已知的與目前安裝版本的 SHA256 雜湊值會儲存到指定的輸出檔。 - - 清單中的項目會相當的多,但輸出的格式可以很簡單的用來分析。例如,要取得與發佈版本不同的檔案清單,可使用以下指令: - - # cat outfile.ids | awk '{ print $1 }' | more -/etc/master.passwd -/etc/motd -/etc/passwd -/etc/pf.conf - - 實際的檔案會更多,此範例的輸出已精簡。部份檔案可能本來就會被修改。例如 /etc/passwd 在新增使用者到系統時會被修改,核心模組也有可能因使用 freebsd-update 更新而有所不同。要排除特定的檔案或目錄可將這些檔案或目錄加入到 /etc/freebsd-update.conf 中的 IDSIgnorePaths 選項。 - - - - - 更新文件集 - - Updating and Upgrading - - - Documentation - Updating and Upgrading - - - 說明文件是 FreeBSD 作業系統不可或缺的一部份。最新版本的 FreeBSD 文件除了可在 FreeBSD 網站 (https://www.freebsd.org/doc/) 取得,也可很簡單的取得本地的 FreeBSD 網站、使用手冊、FAQ 及文章副本。 - - 本節將說明如何使用原始碼與 FreeBSD Port 套件集來取得最新版本 FreeBSD 文件本地複本。 - - 有關編輯與提出修正說明文件的資訊,請參考 FreeBSD 文件計畫入門書 (https://www.freebsd.org/doc/en_US.ISO8859-1/books/fdp-primer/)。 - - - 自原始碼更新說明文件 - - 從原始碼重新編譯 FreeBSD 文件需要一些不屬於 FreeBSD 基礎系統的工具。需要的工具可安裝由 FreeBSD 文件計劃所開發的 textproc/docproj 套件或 Port。 - - 安裝完成之後,可使用 svnlite 來取得乾淨的文件原始碼複本: - - # svnlite checkout https://svn.FreeBSD.org/doc/head /usr/doc - - 第一次下載文件原始碼需要一些時間,請耐心等候執行完畢。 - - 往後更新文件原始碼可執行: - - # svnlite update /usr/doc - - 下載最新的文件原始碼到 /usr/doc 之後,便完成要更新已安裝文件的準備動作。 - - 完整更新所有可用的語言可以執行: - - # cd /usr/doc -# make install clean - - 若只想要更新特定語言,可對 /usr/doc 中特定語言的子目錄執行 make - - # cd /usr/doc/en_US.ISO8859-1 -# make install clean - - 另一個更新文件的方式是在 /usr/doc 或特定的語言子目錄下執行此指令: - - # make update - - 要指定安裝的輸出格式可使用 FORMATS 來設定: - - # cd /usr/doc -# make FORMATS='html html-split' install clean - - 有數個選項可更新部份文件或只編譯特定翻譯來簡化更新程序。這些選項可在 /etc/make.conf 設為系統全域的預設選項,或是透過指令傳送給 make - - 選項有: - - - - DOC_LANG - - - 要編譯與安裝的語言及編碼清單,例如 en_US.ISO8859-1 代表英語文件。 - - - - - FORMATS - - - 要編譯的輸出格式清單,目前支援 html, html-split, txt, ps 以及 pdf - - - - - DOCDIR - - - 要安裝文件的位置,預設為 /usr/share/doc - - - - - 要取得更多可做為 FreeBSD 系統全域選項的 make 變數,請參考 make.conf5 - - - - - 自 Port 更新說明文件 - - - - - Marc - Fonvieille - - Based on the work of - - - - - - Updating and Upgrading - - - - documentation package - Updating and Upgrading - - - 前一節介紹了由原始碼更新 FreeBSD 文件的方法,本節將說明使用 Port 套件集的替代方法,可由以下方式達成: - - - - 安裝事先編譯好的文件套件,無須在本地編譯任何東西或安裝文件工具集。 - - - - 使用 Port 框架來編譯文件原始碼,可讓取得與編譯文件的步驟更簡單。 - - - - 這個更新 FreeBSD 文件的方法,會使用到一系列由文件工程團隊 doceng@FreeBSD.org 每月更新的文件 Port 與套件。這些套件列於 FreeBSD Port 套件集的 docs 分類下 (http://www.freshports.org/docs/)。 - - 文件 Port 的組織方式如下: - - - - misc/freebsd-doc-en 套件或 Port 會安裝所有英語的文件。 - - - - misc/freebsd-doc-all 套件或 Port 會安裝所有可用語言的文件。 - - - - 每個翻譯語言都有套件與 Port,如 misc/freebsd-doc-hu 為匈牙利語文件。 - - - - 當使用 Binary 套件時,會安裝指定語言 FreeBSD 文件的所有可用格式。例如以下指令會安裝最新的匈牙利語文件套件: - - # pkg install hu-freebsd-doc - - - 套件使用的名稱格式與 Port 的名稱不同:lang-freebsd-doc,其中 lang 是語言代碼的縮寫,例如 hu 代表匈牙利語,zh_cn 代表簡體中文。 - - - 要指定文件的格式,需以編譯 Port 來代替安裝套件。例如要編譯並安裝英語文件: - - # cd /usr/ports/misc/freebsd-doc-en -# make install clean - - Port 提供設定選單來指定要編譯與安裝的格式,預設會選擇分頁的 HTML (類似 http://www.FreeBSD.org 使用的格式) 以及 PDF - - 此外,編譯文件 Port 時也可指定數個 make 選項,包括: - - - - WITH_HTML - - - 編譯一份文件使用一個 HTML 檔的 HTML 格式。格式化後的文件會儲存至名稱為 article.htmlbook.html 的檔案。 - - - - - WITH_PDF - - - 格式化的文件會儲存至名稱為 article.pdfbook.pdf 的檔案。 - - - - - DOCBASE - - - 指定要安裝文件的位置,預設為 /usr/local/share/doc/freebsd - - - - - 以下範例使用變數來安裝 PDF 的匈牙利語文件到特定目錄: - - # cd /usr/ports/misc/freebsd-doc-hu -# make -DWITH_PDF DOCBASE=share/doc/freebsd/hu install clean - - 文件套件或 Port 可以依 的說明更新。例如以下指令會使用 ports-mgmt/portmaster 更新已安裝的匈牙利語文件: - - # portmaster -PP hu-freebsd-doc - - - - - 追蹤開發分支 - - -CURRENT - -STABLE - - FreeBSD 有兩個開發分支:FreeBSD-CURRENT 及 FreeBSD-STABLE。 - - 本節將說明每個分支及其的特定使用者,也會說明如何在各別分支維持系統為最新版。 - - - 使用 FreeBSD-CURRENT - - FreeBSD-CURRENT 是 FreeBSD 開發的 最前線,FreeBSD-CURRENT 的使用者需具備較強的技術能力。技術能力較弱的使用者應改追蹤 FreeBSD-STABLE 開發分支。 - - FreeBSD-CURRENT 是 FreeBSD 最新的原始碼,其中包括正在進行的開發工作、實驗性的變更以及不一定會在下一個官方發行版出現的過渡機制。 雖然 FreeBSD 開發者每天編譯 FreeBSD-CURRENT 原始碼,但仍可能有短暫時間原始碼是無法編譯的。雖然這些問題會儘快被解決,但是無論 FreeBSD-CURRENT 帶來災難或是新功能,同步原始碼時都要考量這個問題。 - - FreeBSD-CURRENT 主要給下以三種族群: - - - - 致力於開發某一部份原始碼樹的 FreeBSD 社群成員。 - - - - FreeBSD 社群成員中活耀的測試人員。 他們願意花時間解決問題,對 FreeBSD 的變更及大方向提出專業建議並送交修補。 - - - - 隨時關注的使用者,使用目前原始碼做為參考用途,或是偶爾提供意見或貢獻原始碼。 - - - - 不應將 FreeBSD-CURRENT 當做下一個發行版前取得新功能的快速途徑,因為尚未發行的功能並未被完整測試,很可能有問題。這也不是一個快速取得問題修正的方式,因為任何已知的問題修正有可能產生新的問題。 使用 FreeBSD-CURRENT 不在 官方支援 的範圍內。 - - -CURRENT 使用 - - 若要追蹤 FreeBSD-CURRENT: - - - - 加入 freebsd-current 和 svn-src-head 郵遞論壇。這是 重要 的,是為了要了解目前人們對於系統目前狀態的評論並接收有關 FreeBSD-CURRENT 目前狀態的重要公告。 - - svn-src-head 郵遞論壇會記錄每一次修改的提交項目,以及可能產生的副作用的相關資訊。 - - 要加入這兩個郵遞論壇,請前往 http://lists.FreeBSD.org/mailman/listinfo 點選要訂閱的郵遞論壇,並依照網頁指示的步驟操作。要追蹤整個原始碼樹,不單只有 FreeBSD-CURRENT 的變更,可訂閱 svn-src-all 郵遞論壇。 - - - - 同步 FreeBSD-CURRENT 原始碼。 通常會使用 svnlite 自列於 中的其中一個 Subversion 鏡像站的 head 分支中取出 -CURRENT 的程式碼。 - - - - 考量到檔案庫的大小,部份使用者選擇只同步他們有興趣或貢獻修補的部份原始碼。然而, 計劃要從原始碼編譯整個作業系統的使用者須下載 全部 的 FreeBSD-CURRENT,不可只有選擇的部份。 - - 編譯 FreeBSD-CURRENT - -CURRENT - compiling - 前,請仔細地閱讀 /usr/src/Makefile 並依照 的指示操作。 閱讀 FreeBSD-CURRENT 郵遞論壇 以及 /usr/src/UPDATING 來了解升級的相關資訊,有時會含有升級下一個發行版的必要資訊。 - - - - 要活躍!我們非常鼓勵 FreeBSD-CURRENT 的使用者發表他們對加強哪些功能或是修復哪些錯誤的建議。 如果您在建議時能附上相關程式碼的話,是最好的。 - - - - - - 使用 FreeBSD-STABLE - - FreeBSD-STABLE 是一個開發分支,會在主要的版本更新後產生,進入這個分支的步伐會比較緩慢,而且通常會假定已經在 FreeBSD-CURRENT 中做過測試,所以問題會比較少,但這仍然是一個開發分支,在任何時間點,FreeBSD-STABLE 中的原始碼不能保証能供一般使用,它只是另一個開發支線,並不是供最終使用者使用的資源,若沒有任何資源可以做測試的使用者應改使用最新版本的 FreeBSD 發佈版。 - - 對於那些有興趣追蹤或為 FreeBSD 開發流程提供一些貢獻的人,特別是針對下一個主要發佈版的 FreeBSD,應該考慮追蹤 FreeBSD-STABLE。 - - 雖然 FreeBSD-STABLE 分支應該已經做過編譯並執行過,但這仍然無法保証不會出任何問題。由於使用 FreeBSD-STABLE 的人比 FreeBSD-CURRENT 更多,因此不可避免的,有時仍會在 FreeBSD-STABLE 中發現未在 FreeBSD-CURRENT 中出現的問題與特殊狀況。基於這個原因,任何人都不應盲目的追蹤 FreeBSD-STABLE,特別重要的是 要將任何產線上的伺服器更新成未經開發或測試環境中測試過的 FreeBSD-STABLE。 - - 若要追蹤 FreeBSD-STABLE: - - -STABLE 使用 - - - 加入 freebsd-stable 郵遞論壇來隨時了解 FreeBSD-STABLE 可能需要的編譯相依項目或任何需要特別注意的問題,當有一些有爭議的修復或更新時,開發人員也會在郵遞論壇中公告,如果有使用者對所提出的更改有任何的疑慮,可讓使用者有機會能反應問題。 - - 加入要追蹤的分支所相關的 svn 郵遞論壇,例如,在追蹤 9-STABLE 分支的使用者會加入 svn-src-stable-9 郵遞論壇,該郵遞論壇會記錄每次變更的提交記錄,以及有關可能出現的副作用的任何相關訊息。 - - 要加入這些郵遞論壇,請前往 http://lists.FreeBSD.org/mailman/listinfo 點選要訂閱的郵遞論壇,並依照網頁指示的步驟操作。要追蹤整個原始碼樹的變更,可訂閱 svn-src-all 郵遞論壇。 - - - - 要安裝新的 FreeBSD-STABLE 系統,可安裝在 FreeBSD 鏡像站 中最近的 FreeBSD-STABLE 發佈版或使用每月使用 FreeBSD-STABLE 所編譯的快照 (Snapshot),請參考 www.freebsd.org/snapshots 取得更多有關快照的資訊。 - - 要編譯或升級已有的 FreeBSD 系統到 FreeBSD-STABLE 可使用 svn - Subversion - 來取出欲升級的分支程式碼,可用分支的名稱如:stable/9 會列在 www.freebsd.org/releng。 - - - - 編譯 FreeBSD-STABLE - -STABLE - compiling - 前,請仔細地閱讀 /usr/src/Makefile 並依照 的指示操作。 閱讀 FreeBSD-STABLE 郵遞論壇 以及 /usr/src/UPDATING 來了解升級的相關資訊,有時會含有升級下一個發行版的必要資訊。 - - - - - - - 從原始碼更新 FreeBSD - - 從編譯原始碼來更新 FreeBSD 比起用 Binary 更新有幾項優點,在編譯程式碼時可以自訂選項來充分運用特定硬體,部份基礎系統可以使用非預設的設定值編譯,或是在不需要或不想要的時候跳過編譯。使用編譯的程序來更新系統比起安裝 Binary 來更新會耗時許多,但能夠完整自訂一個量身定做版本的 FreeBSD。 - - - 快速開始 - - 這是從原始碼編譯來更新 FreeBSD 的標準步驟快速的參考,稍後的章節會更詳細的說明這個程序。 - - - - 更新並編譯 - - # svnlite update /usr/src -check /usr/src/UPDATING -# cd /usr/src -# make -j4 buildworld -# make -j4 kernel -# shutdown -r now -# cd /usr/src -# make installworld -# mergemaster -Ui -# shutdown -r now - - - - 取得最新版本的原始碼,請參考 來了解更多取得與更新原始碼的資訊。 - - - - 檢查 /usr/src/UPDATING 看是否有任後在原始碼編譯之前或之後需要手動操作的步驟。 - - - - 前往原始碼目錄。 - - - - 編譯世界 (World),即除了核心 (Kernel) 外的所有東西。 - - - - 編譯並安裝核心,此動作等同於 make buildkernel installkernel - - - - 重新啟動系統以使用新的核心。 - - - - 前往原始碼目錄。 - - - - 安裝世界。 - - - - 更新與合併在 /etc/ 中的設定檔案。 - - - - 重新啟動系統以使用新編譯好的世界與核心。 - - - - - - - - 準備原始碼更新 - - 閱讀 /usr/src/UPDATING,從原始碼編譯之前與之後任何需要手動操作步驟會在此檔案中說明。 - - - - 更新原始碼 - - FreeBSD 的原始碼位於 /usr/src/,較建議透過 Subversion 版本控制系統來更新這份原始碼,要確認原始碼已在版本控制系統的管控下可: - - # svnlite info /usr/src -Path: /usr/src -Working Copy Root Path: /usr/src -... - - 此結果代表 /usr/src/ 已在版本控制系統的管控下並且可以使用 svnlite1 來更新: - - # svnlite update /usr/src - - 若該目錄最近沒有更新過,可能會需要一些時間來完成更新動作。在更新完成之後,原始碼便為最新版本,並可開始依下一章節的說明來編譯程序。 - - - 取得原始碼 - - 若輸出結果顯示 '/usr/src' is not a working copy 代表有缺少檔案或原始碼是採用其他方式安裝,若是如此,便需重新取出 (checkout) 原始碼。 - - - FreeBSD 版本與檔案庫路徑 - - - - - uname -r 的輸出結果 - 檔案庫路徑 - 說明 - - - - - - X.Y-RELEASE - base/releng/X.Y - 發佈版本加上關鍵的安全性與錯誤修正,較建議大多數使用者使用這個分支。 - - - - X.Y-STABLE - base/stable/X - - 發佈版本加上所有在該分支上其他開發中的程式,STABLE 代表不會更改應用程式 Binary 介面 (Applications Binary Interface, ABI),所以在先前版本所編譯的軟體仍可以正常運作,舉例來說,被編譯在 FreeBSD 10.1 可執行的軟體在編譯完 FreeBSD 10-STABLE 之後仍可以執行。 - - STABLE 分支偶爾也會有錯誤或無法相容的問題會影響使用者,雖然這些問題通常會很快的被修正。 - - - - - X-CURRENT - base/head/ - 最新未發佈的 FreeBSD 開發版本,CURRENT 分支可能會有重大錯誤或不相容的問題,只建議進階的使用者使用。 - - - -
- - 查看 FreeBSD 目前使用的版本可使用 uname1 - - # uname -r -10.3-RELEASE - - 根據 ,要更新 10.3-RELEASE 需使用的原始碼檔案庫路徑為 base/releng/10.3,在取出 (checkout) 原始碼時便要使用這個路徑: - - # mv /usr/src /usr/src.bak -# svnlite checkout https://svn.freebsd.org/base/releng/10.3 /usr/src - - - - 將舊的目錄移到其他地方,若沒有在這個目錄做過任何本地修改,可直接刪除這個目錄。 - - - - 將從 查到的路徑加到檔案庫 URL 之後。第三個參數用來存放本地系統原始碼的目標目錄。 - - -
-
- - - 從原始碼編譯 - - 編譯世界 (world) 即編譯整個作業系統除了核心 (Kernel),要先做這個動作以便提供最新的工具來編譯核心,接著便可編譯核心: - - # cd /usr/src -# make buildworld -# make buildkernel - - 編譯完的程式會寫入至 /usr/obj - - 以上這些均為基本的步驟,用來控制編譯的其他選項在以下章節會說明。 - - - 執行清除編譯 - - 部份 FreeBSD 編譯系統版本會保留先前編譯的程式於暫存的物件目錄 /usr/obj,避免重新編譯那些尚未更動過的程式碼可加速後續的編譯動作,若要強制重新編譯所有東西可在開始編譯前使用 cleanworld - - # make cleanworld - - - - 設定工作數量 - - 在多核處理器上增加編譯工作的數量可增加編譯速度,可使用 sysctl hw.ncpu 來查看有多少核心,不同處理器使用不同版本的 FreeBSD 編譯系統,所以唯一能了解不同工作數量對編譯速度影響的方式便是測試。在一開始可考慮選擇一個介於 1/2 到 2 倍核心數之間的數值,工作的數量可使用 來指定。 - - - 增加編譯工作數 - - 使用四個工作來編譯世界與核心: - - # make -j4 buildworld buildkernel - - - - - 只編譯核心 - - 若原始碼有更動,便須執行 buildworld,完成之後,便可隨時執行 buildkernel 來編譯核心,若要只編譯核心可: - - # cd /usr/src -# make buildkernel - - - - 編譯自訂核心 - - 標準的 FreeBSD 核心是以一個名為 GENERIC核心設定檔 (Kernel config file)為基礎,GENERIC 核心中內含了所有最常用的裝置驅動程式與選項,有時這個檔案對編譯自訂核心也非常有用,可根據其來加入或移除裝置驅動程式或選項來滿足特定需求。 - - 例如,要開發一個 RAM 受到嚴重限制的小型嵌入式電腦,便可移除不需要的裝置驅動程式或選項來縮小核心。 - - 核心設定檔位於 /usr/src/sys/arch/conf/,其中使用的 arch 即為 uname -m 輸出的結果,大部份的電腦為 amd64,那其設定檔目錄則為 /usr/src/sys/amd64/conf/ - - - /usr/src 可以被刪除或重建,所以較建議將自訂核心設定檔放在另一個目錄,如 /root,並將核心設定檔以連結放至 conf 目錄,若該目錄被刪除或覆寫,便可重新建立一個新的核心設定的連結。 - - - 自訂設定檔可由複製 GENERIC 設定檔來建立,在此範例,新的自訂核心要用在儲存伺服器,所以將其命名為 STORAGESERVER - - # cp /usr/src/sys/amd64/conf/GENERIC /root/STORAGESERVER -# cd /usr/src/sys/amd64/conf -# ln -s /root/STORAGESERVER . - - 接著編譯 /root/STORAGESERVER,要加入或移除裝置或選項可見 config5 - - 自訂核心要在指令列設定 KERNCONF 為核心設定檔來編譯: - - # make buildkernel KERNCONF=STORAGESERVER - - - - - 安裝編譯好的程式 - - 在完成 buildworldbuildkernel 兩個步驟之後,便可安裝新的核心與世界: - - # cd /usr/src -# make installkernel -# shutdown -r now -# cd /usr/src -# make installworld -# shutdown -r now - - 若使用自訂核心,則同樣須設定 KERNCONF 來使用新的自訂核心: - - # cd /usr/src -# make installkernel KERNCONF=STORAGESERVER -# shutdown -r now -# cd /usr/src -# make installworld -# shutdown -r now - - - - 完成更新 - - 還有最後一些的工作要做來完成更新,任何修改過的設定檔要與新版本的設定檔合併、移除找到的過時程式庫,然後重新啟動系統。 - - - 使用 <citerefentry><refentrytitle>mergemaster</refentrytitle><manvolnum>8</manvolnum></citerefentry> 合併設定檔案 - - mergemaster8 可簡單的將修改過的系統設定檔與新版設定檔合併。 - - 使用 mergemaster8 會自動更新那些未被使用者修改過的設定檔並安裝尚不存在的檔案: - - # mergemaster -Ui - - 若檔案需要手動合併,會有互動式介面可讓使用者選擇要保留那一邊的檔案,請參考 mergemaster8 取得更多資訊。 - - - - 檢查過時的檔案與程式庫 - - 部份廢棄的檔案或目錄可以在更新之後保留,可使用以下指令找出這些檔案: - - # make check-old - - 並用以下指令刪除: - - # make delete-old - - 部份廢棄的程式庫也可以保留下來,可使用以下指令來偵測這些程式庫: - - # make check-old-libs - - 並使用以下指令刪除 - - # make delete-old-libs - - 那些仍使用舊程式庫的程式將在刪除程式庫之後無法正常運作,而這些程式須要在刪除舊程式庫之後重新編譯或更換。 - - - 當確認所有舊檔案或目錄可安全的刪除時,要避免刪除每一個檔案時均需按下 yEnter 鍵可在指令設定 BATCH_DELETE_OLD_FILES,例如: - - # make BATCH_DELETE_OLD_FILES=yes delete-old-libs - - - - - 更新後重新啟動 - - 更新之後的最後一個步驟便是重新啟動電腦,來讓所有的變更生效: - - # shutdown -r now - - -
- - - - 多部機器追蹤 - - - - - Mike - Meyer - - Contributed by - - - - - - NFS - installing multiple machines - - - 當有多部主機需要追蹤相同的原始碼樹,要在每一部主機的系統下載原始碼與重新編譯所有的東西會耗費不少磁碟空間、網路頻寬與 CPU 運算,要解決這個問題的方法是先在一部主機上做完大部份的工作,而其餘的主機透過 NFS 掛載使用編譯完的成果。本節會介紹如何做這件事。要取得更多有關使用 NFS 的資訊請參考 - - 首先,要先確認要執行同一組 Binary 的一群主機,這群主機又稱作 建置集 (Build set),其中每部主機可以有自己的自訂核心,但會執行相同的 Userland binary。建置集中需挑選一部做為建置主機 (Build machine),這部主機將會拿來編譯 World 與核心 (Kernel),理想情況下,要挑選一部速度較快、有足夠的 CPU 能夠執行 make buildworldmake buildkernel 的主機。 - - 再挑選一部主機做為測試主機 (Test machine),這部主機,要在將系統更新上正式運作的環境前做測試,這必須一部能夠承受服務停止一段時間的主機,它也可是同時是建置主機,但不是一定要。 - - 所有在此建置集中的主機需要透過 NFS 掛載在建置主機上的 /usr/obj/usr/src。在有多個建置集時,/usr/src 也應放在其中一部建置主機,然後由其他主機使用 NFS 掛載。 - - 確保在建置集中的所有主機的 /etc/make.conf/etc/src.conf 與建置主機一致,這是由於建置主機必須編譯整個基礎系統 (Base system) 給所有建置集中的主機安裝。此外,每一部建置主機應在 /etc/make.conf 使用 KERNCONF 設定其核心名稱,且建置主機應列出所有要編譯的核心名稱在 KERNCONF,並且把自己要用的核心放在第一個。建置主機也必須有每部主機的核心設定檔在其 /usr/src/sys/arch/conf - - 在建置主機上,編譯核心與 World 如 所述,但不要在建置主機上安裝所有編譯好的東西,而是要將編譯好的核心安裝到測試主機,在測試主機透過 NFS 掛載 /usr/src/usr/obj。然後執行 shutdown now 進入單使用者模式來安裝新的核心與 World 並如同往常執行 mergemaster。完成之後,重新開機回到正常的多使用者模式運作。 - - 在測試主機上檢驗完所有東西皆運作正常之後,使用相同的程序將編譯好的結果安裝到在建置集中的其他主機。 - - 同樣的方法也可用在 Port 樹,第一個步驟是透過 NFS 共享 /usr/ports 給所有在建置集中的主機。要設定 /etc/make.conf 使用共享的 distfiles,可設定 DISTDIR 為由 NFS 掛載對應到的使用者 root 可寫入的通用共享目錄。每一台主機應設定 WRKDIRPREFIX 到一個本地的編譯目錄,若 Port 要在本地編譯。或者,若建置系統要編譯並散佈套件到建置集中的主機可在建置系統上設定 PACKAGES 到一個類似 DISTDIR 的目錄。 - -
- - - - - - - - DTrace - - - TomRhodesWritten - by - - - - - 概述 - - DTrace - - DTrace support - DTrace - - - DTrace, also known as Dynamic Tracing, was developed by - Sun as a tool for locating performance bottlenecks in - production and pre-production systems. In addition to - diagnosing performance problems, DTrace can be used to help - investigate and debug unexpected behavior in both the FreeBSD - kernel and in userland programs. - - DTrace is a remarkable profiling tool, with an impressive - array of features for diagnosing system issues. It may also be - used to run pre-written scripts to take advantage of its - capabilities. Users can author their own utilities using the - DTrace D Language, allowing them to customize their profiling - based on specific needs. - - The FreeBSD implementation provides full support for kernel - DTrace and experimental support for userland DTrace. - Userland DTrace allows users to perform function boundary - tracing for userland programs using the pid - provider, and to insert static probes into userland programs for - later tracing. Some ports, such as - databases/postgres-server and - lang/php56 have a DTrace option to enable - static probes. FreeBSD 10.0-RELEASE has reasonably good userland - DTrace support, but it is not considered production ready. In - particular, it is possible to crash traced programs. - - The official guide to DTrace is maintained by the Illumos - project at DTrace - Guide. - - 讀完這章,您將了解: - - - - What DTrace is and what features it provides. - - - - Differences between the Solaris DTrace - implementation and the one provided by FreeBSD. - - - - How to enable and use DTrace on FreeBSD. - - - - 在開始閱讀這章之前,您需要: - - - - 了解 UNIX 及 FreeBSD 基礎 ()。 - - - - Have some familiarity with security and how it pertains - to FreeBSD (). - - - - - - 實作差異 - - While the DTrace in FreeBSD is similar to that found in - Solaris, differences do exist. The primary difference is that - in FreeBSD, DTrace is implemented as a set of kernel modules and - DTrace can not be used until the modules are loaded. To load - all of the necessary modules: - - # kldload dtraceall - - Beginning with FreeBSD 10.0-RELEASE, the modules are - automatically loaded when dtrace is - run. - - FreeBSD uses the DDB_CTF kernel option to - enable support for loading CTF data from - kernel modules and the kernel itself. CTF is - the Solaris Compact C Type Format which encapsulates a reduced - form of debugging information similar to - DWARF and the venerable stabs. - CTF data is added to binaries by the - ctfconvert and ctfmerge - build tools. The ctfconvert utility parses - DWARF ELF debug sections - created by the compiler and ctfmerge merges - CTF ELF sections from - objects into either executables or shared libraries. - - Some different providers exist for FreeBSD than for Solaris. - Most notable is the dtmalloc provider, which - allows tracing malloc() by type in the FreeBSD - kernel. Some of the providers found in Solaris, such as - cpc and mib, are not - present in FreeBSD. These may appear in future versions of FreeBSD. - Moreover, some of the providers available in both operating - systems are not compatible, in the sense that their probes have - different argument types. Thus, D scripts - written on Solaris may or may not work unmodified on FreeBSD, and - vice versa. - - Due to security differences, only root may use DTrace on FreeBSD. - Solaris has a few low level security checks which do not yet - exist in FreeBSD. As such, the - /dev/dtrace/dtrace is strictly limited to - root. - - DTrace falls under the Common Development and Distribution - License (CDDL) license. To view this license - on FreeBSD, see - /usr/src/cddl/contrib/opensolaris/OPENSOLARIS.LICENSE - or view it online at http://opensource.org/licenses/CDDL-1.0. - While a FreeBSD kernel with DTrace support is - BSD licensed, the CDDL is - used when the modules are distributed in binary form or the - binaries are loaded. - - - - 開啟 DTrace 支援 - - In FreeBSD 9.2 and 10.0, DTrace support is built into the - GENERIC kernel. Users of earlier versions - of FreeBSD or who prefer to statically compile in DTrace support - should add the following lines to a custom kernel configuration - file and recompile the kernel using the instructions in : - - options KDTRACE_HOOKS -options DDB_CTF -makeoptions DEBUG=-g -makeoptions WITH_CTF=1 - - Users of the AMD64 architecture should also add this - line: - - options KDTRACE_FRAME - - This option provides support for FBT. - While DTrace will work without this option, there will be - limited support for function boundary tracing. - - Once the FreeBSD system has rebooted into the new kernel, or - the DTrace kernel modules have been loaded using - kldload dtraceall, the system will need - support for the Korn shell as the DTrace - Toolkit has several utilities written in ksh. - Make sure that the shells/ksh93 package or - port is installed. It is also possible to run these tools under - shells/pdksh or - shells/mksh. - - Finally, install the current DTrace Toolkit, - a collection of ready-made scripts - for collecting system information. There are scripts to check - open files, memory, CPU usage, and a lot - more. FreeBSD 10 - installs a few of these scripts into - /usr/share/dtrace. On other FreeBSD versions, - or to install the full - DTrace Toolkit, use the - sysutils/DTraceToolkit package or - port. - - - The scripts found in - /usr/share/dtrace have been specifically - ported to FreeBSD. Not all of the scripts found in the DTrace - Toolkit will work as-is on FreeBSD and some scripts may require - some effort in order for them to work on FreeBSD. - - - The DTrace Toolkit includes many scripts in the special - language of DTrace. This language is called the D language - and it is very similar to C++. An in depth discussion of the - language is beyond the scope of this document. It is - covered extensively in the Illumos Dynamic - Tracing Guide. - - - 使用 DTrace - - DTrace scripts consist of a list of one or more - probes, or instrumentation points, where - each probe is associated with an action. Whenever the condition - for a probe is met, the associated action is executed. For - example, an action may occur when a file is opened, a process is - started, or a line of code is executed. The action might be to - log some information or to modify context variables. The - reading and writing of context variables allows probes to share - information and to cooperatively analyze the correlation of - different events. - - To view all probes, the administrator can execute the - following command: - - # dtrace -l | more - - Each probe has an ID, a - PROVIDER (dtrace or fbt), a - MODULE, and a - FUNCTION NAME. Refer to dtrace1 for - more information about this command. - - The examples in this section provide an overview of how to - use two of the fully supported scripts from the - DTrace Toolkit: the - hotkernel and - procsystime scripts. - - The hotkernel script is designed to - identify which function is using the most kernel time. It will - produce output similar to the following: - - # cd /usr/share/dtrace/toolkit -# ./hotkernel -Sampling... Hit Ctrl-C to end. - - As instructed, use the - CtrlC - key combination to stop the process. Upon - termination, the script will display a list of kernel functions - and timing information, sorting the output in increasing order - of time: - - kernel`_thread_lock_flags 2 0.0% -0xc1097063 2 0.0% -kernel`sched_userret 2 0.0% -kernel`kern_select 2 0.0% -kernel`generic_copyin 3 0.0% -kernel`_mtx_assert 3 0.0% -kernel`vm_fault 3 0.0% -kernel`sopoll_generic 3 0.0% -kernel`fixup_filename 4 0.0% -kernel`_isitmyx 4 0.0% -kernel`find_instance 4 0.0% -kernel`_mtx_unlock_flags 5 0.0% -kernel`syscall 5 0.0% -kernel`DELAY 5 0.0% -0xc108a253 6 0.0% -kernel`witness_lock 7 0.0% -kernel`read_aux_data_no_wait 7 0.0% -kernel`Xint0x80_syscall 7 0.0% -kernel`witness_checkorder 7 0.0% -kernel`sse2_pagezero 8 0.0% -kernel`strncmp 9 0.0% -kernel`spinlock_exit 10 0.0% -kernel`_mtx_lock_flags 11 0.0% -kernel`witness_unlock 15 0.0% -kernel`sched_idletd 137 0.3% -0xc10981a5 42139 99.3% - - - - This script will also work with kernel modules. To use this - feature, run the script with : - - # ./hotkernel -m -Sampling... Hit Ctrl-C to end. -^C -MODULE COUNT PCNT -0xc107882e 1 0.0% -0xc10e6aa4 1 0.0% -0xc1076983 1 0.0% -0xc109708a 1 0.0% -0xc1075a5d 1 0.0% -0xc1077325 1 0.0% -0xc108a245 1 0.0% -0xc107730d 1 0.0% -0xc1097063 2 0.0% -0xc108a253 73 0.0% -kernel 874 0.4% -0xc10981a5 213781 99.6% - - - - The procsystime script captures and - prints the system call time usage for a given process - ID (PID) or process name. - In the following example, a new instance of - /bin/csh was spawned. Then, - procsystime was executed and remained - waiting while a few commands were typed on the other incarnation - of csh. These are the results of this - test: - - # ./procsystime -n csh -Tracing... Hit Ctrl-C to end... -^C - -Elapsed Times for processes csh, - - SYSCALL TIME (ns) - getpid 6131 - sigreturn 8121 - close 19127 - fcntl 19959 - dup 26955 - setpgid 28070 - stat 31899 - setitimer 40938 - wait4 62717 - sigaction 67372 - sigprocmask 119091 - gettimeofday 183710 - write 263242 - execve 492547 - ioctl 770073 - vfork 3258923 - sigsuspend 6985124 - read 3988049784 - - As shown, the read() system call used - the most time in nanoseconds while the - getpid() system call used the least amount - of time. - - - - - - - - - USB Device Mode / USB OTG - - - 概述 - - - - - - Edward Tomasz - Napierala - - -
- trasz@FreeBSD.org -
-
- Written by -
-
-
- - This chapter covers the use of USB Device Mode and USB On - The Go (USB OTG) in FreeBSD. This includes - virtual serial consoles, virtual network interfaces, and - virtual USB drives. - - When running on hardware that supports USB device mode - or USB OTG, like that built into - many embedded boards, the FreeBSD USB stack - can run in device mode. Device mode - makes it possible for the computer to present itself as - different kinds of USB device classes, - including serial ports, network adapters, and mass storage, - or a combination thereof. A USB host like - a laptop or desktop computer is able to access them just like - physical USB devices. Device mode is - sometimes called the USB gadget mode. - - There are two basic ways the hardware can provide the - device mode functionality: with a separate "client port", which - only supports the device mode, and with a USB OTG port, which - can provide both device and host mode. For - USB OTG ports, the USB - stack switches between host-side and device-side automatically, - depending on what is connected to the port. Connecting a - USB device like a memory stick to the - port causes FreeBSD to switch to host mode. Connecting a - USB host like a computer causes FreeBSD to - switch to device mode. Single purpose "client ports" always - work in device mode. - - What FreeBSD presents to the USB host - depends on the hw.usb.template sysctl. Some - templates provide a single device, such as a serial terminal; - others provide multiple ones, which can all be used at the same - time. An example is the template 10, which provides a mass - storage device, a serial console, and a network interface. - See usb_template4 for the list of available - values. - - Note that in some cases, depending on the hardware and the - hosts operating system, for the host to notice the configuration - change, it must be either physically disconnected and - reconnected, or forced to rescan the USB - bus in a system-specific way. When FreeBSD is running on the host, - usbconfig8 reset can be used. - This also must be done after loading - usb_template.ko if the - USB host was already connected to the - USB OTG socket. - - 讀完這章,您將了解: - - - - How to set up USB Device Mode functionality on - FreeBSD. - - - - How to configure the virtual serial port on - FreeBSD. - - - - How to connect to the virtual serial port - from various operating systems. - - - - How to configure FreeBSD to provide a virtual - USB network interface. - - - - How to configure FreeBSD to provide a virtual - USB storage device. - - -
- - - <acronym>USB</acronym> 虛擬序列埠 - - - 設定 USB 裝置模式序列埠 - - Virtual serial port support is provided by templates - number 3, 8, and 10. Note that template 3 works with - Microsoft Windows 10 without the need for special drivers - and INF files. Other host operating systems work with all - three templates. Both usb_template4 and umodem4 - kernel modules must be loaded. - - To enable USB device mode serial ports, add those lines - to /etc/ttys: - - ttyU0 "/usr/libexec/getty 3wire" vt100 onifconsole secure -ttyU1 "/usr/libexec/getty 3wire" vt100 onifconsole secure - - 然後加入這些行到 /etc/devd.conf - - notify 100 { - match "system" "DEVFS"; - match "subsystem" "CDEV"; - match "type" "CREATE"; - match "cdev" "ttyU[0-9]+"; - action "/sbin/init q"; -}; - - Reload the configuration if - devd8 is already running: - - # service devd restart - - Make sure the necessary modules are loaded and the - correct template is set at boot by adding - those lines to /boot/loader.conf, - creating it if it does not already exist: - - umodem_load="YES" -hw.usb.template=3 - - To load the module and set the template without rebooting - use: - - # kldload umodem -# sysctl hw.usb.template=3 - - - - - 自 FreeBSD 連線到 USB 裝置模式序列埠 - - To connect to a board configured to provide USB device - mode serial ports, connect the USB host, such as a laptop, to - the boards USB OTG or USB client port. Use - pstat -t on the host to list the terminal - lines. Near the end of the list you should see a USB serial - port, eg "ttyU0". To open the connection, use: - - # cu -l /dev/ttyU0 - - After pressing the Enter key a few times you will see - a login prompt. - - - - 自 macOS 連線到 USB 裝置模式序列埠 - - To connect to a board configured to provide USB device - mode serial ports, connect the USB host, such as a laptop, - to the boards USB OTG or USB client port. To open the - connection, use: - - # cu -l /dev/cu.usbmodemFreeBSD1 - - - - 自 Linux 連線到 USB 裝置模式序列埠 - - To connect to a board configured to provide USB device - mode serial ports, connect the USB host, such as a laptop, - to the boards USB OTG or USB client port. To open the - connection, use: - - # minicom -D /dev/ttyACM0 - - - - 自 Microsoft Windows 10 連線到 USB 裝置模式序列埠 - - To connect to a board configured to provide USB device - mode serial ports, connect the USB host, such as a laptop, - to the boards USB OTG or USB client port. To open a - connection you will need a serial terminal program, such as - PuTTY. To check the COM port name - used by Windows, run Device Manager, expand "Ports (COM & - LPT)". You will see a name similar to "USB Serial Device - (COM4)". Run serial terminal program of your choice, for - example PuTTY. In the - PuTTY dialog set "Connection type" - to "Serial", type the COMx obtained from Device Manager in the - "Serial line" dialog box and click Open. - - - - - - <acronym>USB</acronym> 裝置模式網路介面 - - Virtual network interfaces support is provided by templates - number 1, 8, and 10. Note that none of them works with - Microsoft Windows. Other host operating systems work with all - three templates. Both usb_template4 and if_cdce4 - kernel modules must be loaded. - - Make sure the necessary modules are loaded and the correct - template is set at boot by adding - those lines to /boot/loader.conf, creating - it if it does not already exist: - - if_cdce_load="YES" -hw.usb.template=1 - - To load the module and set the template without rebooting - use: - - # kldload if_cdce -# sysctl hw.usb.template=1 - - - - <acronym>USB</acronym> 虛擬儲存裝置 - - - cfumass4 驅動程式是一個在 FreeBSD 12.0 之後才可用的 USB 裝置模式驅動程式。 - - - Mass Storage target is provided by templates 0 and 10. - Both usb_template4 and cfumass4 kernel modules - must be loaded. cfumass4 interfaces to the CTL - subsystem, the same one that is used for - iSCSI or Fibre Channel targets. - On the host side, USB Mass Storage - initiators can only access a single LUN, - LUN 0. - - - 使用 cfumass 啟動 Script 設定 USB 大容量儲存目標 - - The simplest way to set up a read-only USB storage target - is to use the cfumass rc script. To - configure it this way, copy the files to be presented to the - USB host machine into the /var/cfumass - directory, and add this line to - /etc/rc.conf: - - cfumass_enable="YES" - - To configure the target without restarting, - run this command: - - # service cfumass start - - Differently from serial and network functionality, the - template should not be set to 0 or 10 in - /boot/loader.conf. This is because the - LUN must be set up before setting the template. The cfumass - startup script sets the correct template number automatically - when started. - - - 使用其他方式設定 USB 大容量存儲目標 - - The rest of this chapter provides detailed description of - setting the target without using the cfumass rc file. This is - necessary if eg one wants to provide a writeable LUN. - - USB Mass Storage does not require the - ctld8 daemon to be running, although it can be used if - desired. This is different from iSCSI. - Thus, there are two ways to configure the target: - ctladm8, or ctld8. Both require the - cfumass.ko kernel module to be loaded. - The module can be loaded manually: - - # kldload cfumass - - If cfumass.ko has not been built into - the kernel, /boot/loader.conf can be set - to load the module at boot: - - cfumass_load="YES" - - A LUN can be created without the - ctld8 daemon: - - # ctladm create -b block -o file=/data/target0 - - This presents the contents of the image file - /data/target0 as a LUN - to the USB host. The file must exist - before executing the command. To configure the - LUN at system startup, add the command to - /etc/rc.local. - - ctld8 can also be used to manage - LUNs. Create - /etc/ctl.conf, add a line to - /etc/rc.conf to make sure ctld8 is - automatically started at boot, and then start the - daemon. - - This is an example of a simple - /etc/ctl.conf configuration file. Refer - to ctl.conf5 for a more complete description of the - options. - - target naa.50015178f369f092 { - lun 0 { - path /data/target0 - size 4G - } -} - - The example creates a single target with a single - LUN. The - naa.50015178f369f092 is a device identifier - composed of 32 random hexadecimal digits. The - path line defines the full path to a file - or zvol backing the LUN. That file must - exist before starting ctld8. The second line is - optional and specifies the size of the - LUN. - - To make sure the ctld8 daemon is started at - boot, add this line to - /etc/rc.conf: - - ctld_enable="YES" - - To start ctld8 now, run this command: - - # service ctld start - - ctld8 Daemon 啟動後,它會讀取 /etc/ctl.conf,若這個檔案在 Daemon 啟動之後才做修改,要重新載入變更的內容才能立即生效: - - # service ctld reload - - -
- -
- - - 網路通訊 - - - FreeBSD 是一種廣泛的被使用在高效能的網路伺服器中的作業系統,這些章節包含了: - - - - 序列通訊 - - - - PPP 和在乙太網路使用 PPP - - - - 電子郵件 - - - - 執行網路伺服器 - - - - 防火牆 - - - - 其他的進階網路主題 - - - - 這些章節是讓您在需要查資料的時候翻閱用的。 您不需要依照特定的順序來讀,也不需要將這些章節全部讀過之後才將 FreeBSD 用在網路環境下。 - - - - - - 序列通訊 - - - 概述 - - serial communications - - UNIX 從最早的第一台 UNIX 仰賴序列線路來讓使用者輸入與輸出以來一直都支援序列通訊,雖與每秒 10 個字元的序列印表機及鍵盤組成的終端機時代比起已改變很多。本章將說明幾種可在 FreeBSD 使用的序列通訊方式。 - - 讀完這章,您將了解: - - - - 如何連線終端機到 FreeBSD 系統。 - - - 如何使用數據機撥號給遠端主機。 - - - 如何允許遠端使用者透過數據機來登入 FreeBSD 系統。 - - - 如何從序列 Console 啟動 FreeBSD 系統。 - - - - 在開始閱讀這章之前,您需要: - - - - 了解如何 設定並安裝自訂核心。 - - - 了解 FreeBSD 的權限與程序。 - - - 能夠取得要在 FreeBSD 使用的序列硬體的技術手冊。 - - - - - - 序列術語與硬體 - - The following terms are often used in serial - communications: - - - bps - - Bits per - Secondbits-per-second - (bps) is the rate at which data is - transmitted. - - - - - DTE - - Data Terminal - EquipmentDTE - (DTE) is one of two endpoints in a - serial communication. An example would be a - computer. - - - - - DCE - - Data Communications - EquipmentDCE - (DTE) is the other endpoint in a - serial communication. Typically, it is a modem or serial - terminal. - - - - - RS-232 - - The original standard which defined hardware serial - communications. It has since been renamed to - TIA-232. - - - - - When referring to communication data rates, this section - does not use the term baud. Baud refers - to the number of electrical state transitions made in a period - of time, while bps is the correct term to - use. - - To connect a serial terminal to a FreeBSD system, a serial port - on the computer and the proper cable to connect to the serial - device are needed. Users who are already familiar with serial - hardware and cabling can safely skip this section. - - - 序列線與埠 - - There are several different kinds of serial cables. The - two most common types are null-modem cables and standard - RS-232 cables. The documentation for the - hardware should describe the type of cable required. - - These two types of cables differ in how the wires are - connected to the connector. Each wire represents a signal, - with the defined signals summarized in . A standard serial - cable passes all of the RS-232C signals - straight through. For example, the Transmitted - Data pin on one end of the cable goes to the - Transmitted Data pin on the other end. This is - the type of cable used to connect a modem to the FreeBSD system, - and is also appropriate for some terminals. - - A null-modem cable switches the Transmitted - Data pin of the connector on one end with the - Received Data pin on the other end. The - connector can be either a DB-25 or a - DB-9. - - A null-modem cable can be constructed using the pin - connections summarized in , - , and . While the standard calls for - a straight-through pin 1 to pin 1 Protective - Ground line, it is often omitted. Some terminals - work using only pins 2, 3, and 7, while others require - different configurations. When in doubt, refer to the - documentation for the hardware. - - - null-modem cable - - - - <acronym>RS-232C</acronym> 信號名稱 - - - - - 縮寫 - Names - - - - - - RD - Received Data - - - - TD - Transmitted Data - - - - DTR - Data Terminal Ready - - - - DSR - Data Set Ready - - - - DCD - Data Carrier Detect - - - - SG - Signal Ground - - - - RTS - Request to Send - - - - CTS - Clear to Send - - - -
- - - DB-25 對 DB-25 Null-Modem 線 - - - - - 信號 - 針腳 # - - 針腳 # - 信號 - - - - - - SG - 7 - connects to - 7 - SG - - - - TD - 2 - connects to - 3 - RD - - - - RD - 3 - connects to - 2 - TD - - - - RTS - 4 - connects to - 5 - CTS - - - - CTS - 5 - connects to - 4 - RTS - - - - DTR - 20 - connects to - 6 - DSR - - - - DTR - 20 - connects to - 8 - DCD - - - - DSR - 6 - connects to - 20 - DTR - - - - DCD - 8 - connects to - 20 - DTR - - - -
- - - DB-9 對 DB-9 Null-Modem 線 - - - - - 信號 - 針腳 # - - 針腳 # - 信號 - - - - - - RD - 2 - connects to - 3 - TD - - - - TD - 3 - connects to - 2 - RD - - - - DTR - 4 - connects to - 6 - DSR - - - - DTR - 4 - connects to - 1 - DCD - - - - SG - 5 - connects to - 5 - SG - - - - DSR - 6 - connects to - 4 - DTR - - - - DCD - 1 - connects to - 4 - DTR - - - - RTS - 7 - connects to - 8 - CTS - - - - CTS - 8 - connects to - 7 - RTS - - - -
- - - DB-9 對 DB-25 Null-Modem 線 - - - - - 信號 - 針腳 # - - 針腳 # - 信號 - - - - - - RD - 2 - connects to - 2 - TD - - - - TD - 3 - connects to - 3 - RD - - - - DTR - 4 - connects to - 6 - DSR - - - - DTR - 4 - connects to - 8 - DCD - - - - SG - 5 - connects to - 7 - SG - - - - DSR - 6 - connects to - 20 - DTR - - - - DCD - 1 - connects to - 20 - DTR - - - - RTS - 7 - connects to - 5 - CTS - - - - CTS - 8 - connects to - 4 - RTS - - - -
- - - When one pin at one end connects to a pair of pins at - the other end, it is usually implemented with one short wire - between the pair of pins in their connector and a long wire - to the other single pin. - - - Serial ports are the devices through which data is - transferred between the FreeBSD host computer and the terminal. - Several kinds of serial ports exist. Before purchasing or - constructing a cable, make sure it will fit the ports on the - terminal and on the FreeBSD system. - - Most terminals have DB-25 ports. - Personal computers may have DB-25 or - DB-9 ports. A multiport serial card may - have RJ-12 or RJ-45/ - ports. See the documentation that accompanied the hardware - for specifications on the kind of port or visually verify the - type of port. - - In FreeBSD, each serial port is accessed through an entry in - /dev. There are two different kinds of - entries: - - - - Call-in ports are named - /dev/ttyuN - where N is the port number, - starting from zero. If a terminal is connected to the - first serial port (COM1), use - /dev/ttyu0 to refer to the terminal. - If the terminal is on the second serial port - (COM2), use - /dev/ttyu1, and so forth. Generally, - the call-in port is used for terminals. Call-in ports - require that the serial line assert the Data - Carrier Detect signal to work correctly. - - - - Call-out ports are named - /dev/cuauN - on FreeBSD versions 8.X and higher and - /dev/cuadN - on FreeBSD versions 7.X and lower. Call-out ports are - usually not used for terminals, but are used for modems. - The call-out port can be used if the serial cable or the - terminal does not support the Data Carrier - Detect signal. - - - - FreeBSD also provides initialization devices - (/dev/ttyuN.init - and - /dev/cuauN.init - or - /dev/cuadN.init) - and locking devices - (/dev/ttyuN.lock - and - /dev/cuauN.lock - or - /dev/cuadN.lock). - The initialization devices are used to initialize - communications port parameters each time a port is opened, - such as crtscts for modems which use - RTS/CTS signaling for flow control. The - locking devices are used to lock flags on ports to prevent - users or programs changing certain parameters. Refer to - termios4, sio4, and stty1 for information - on terminal settings, locking and initializing devices, and - setting terminal options, respectively. -
- - - 序列埠設定 - - By default, FreeBSD supports four serial ports which are - commonly known as COM1, - COM2, COM3, and - COM4. FreeBSD also supports dumb multi-port - serial interface cards, such as the BocaBoard 1008 and 2016, - as well as more intelligent multi-port cards such as those - made by Digiboard. However, the default kernel only looks for - the standard COM ports. - - To see if the system recognizes the serial ports, look for - system boot messages that start with - uart: - - # grep uart /var/run/dmesg.boot - - If the system does not recognize all of the needed serial - ports, additional entries can be added to - /boot/device.hints. This file already - contains hint.uart.0.* entries for - COM1 and hint.uart.1.* - entries for COM2. When adding a port - entry for COM3 use - 0x3E8, and for COM4 - use 0x2E8. Common IRQ - addresses are 5 for - COM3 and 9 for - COM4. - - ttyu - cuau - - To determine the default set of terminal - I/O settings used by the port, specify its - device name. This example determines the settings for the - call-in port on COM2: - - # stty -a -f /dev/ttyu1 - - System-wide initialization of serial devices is controlled - by /etc/rc.d/serial. This file affects - the default settings of serial devices. To change the - settings for a device, use stty. By - default, the changed settings are in effect until the device - is closed and when the device is reopened, it goes back to the - default set. To permanently change the default set, open and - adjust the settings of the initialization device. For - example, to turn on mode, 8 bit - communication, and flow control for - ttyu5, type: - - # stty -f /dev/ttyu5.init clocal cs8 ixon ixoff - - - rc files - rc.serial - - - To prevent certain settings from being changed by an - application, make adjustments to the locking device. For - example, to lock the speed of ttyu5 to - 57600 bps, type: - - # stty -f /dev/ttyu5.lock 57600 - - Now, any application that opens ttyu5 - and tries to change the speed of the port will be stuck with - 57600 bps. - -
- - - - 終端機 - - - - - Sean - Kelly - - Contributed by - - - - - terminals - - Terminals provide a convenient and low-cost way to access - a FreeBSD system when not at the computer's console or on a - connected network. This section describes how to use terminals - with FreeBSD. - - The original UNIX systems did not have consoles. Instead, - users logged in and ran programs through terminals that were - connected to the computer's serial ports. - - The ability to establish a login session on a serial port - still exists in nearly every UNIX-like operating system - today, including FreeBSD. By using a terminal attached to an - unused serial port, a user can log in and run any text program - that can normally be run on the console or in an - xterm window. - - Many terminals can be attached to a FreeBSD system. An older - spare computer can be used as a terminal wired into a more - powerful computer running FreeBSD. This can turn what might - otherwise be a single-user computer into a powerful - multiple-user system. - - FreeBSD supports three types of terminals: - - - - Dumb terminals - - Dumb terminals are specialized hardware that connect - to computers over serial lines. They are called - dumb because they have only enough - computational power to display, send, and receive text. - No programs can be run on these devices. Instead, dumb - terminals connect to a computer that runs the needed - programs. - - There are hundreds of kinds of dumb terminals made by - many manufacturers, and just about any kind will work with - FreeBSD. Some high-end terminals can even display graphics, - but only certain software packages can take advantage of - these advanced features. - - Dumb terminals are popular in work environments where - workers do not need access to graphical - applications. - - - - - Computers Acting as Terminals - - Since a dumb terminal has just enough ability to - display, send, and receive text, any spare computer can - be a dumb terminal. All that is needed is the proper - cable and some terminal emulation - software to run on the computer. - - This configuration can be useful. For example, if one - user is busy working at the FreeBSD system's console, another - user can do some text-only work at the same time from a - less powerful personal computer hooked up as a terminal to - the FreeBSD system. - - There are at least two utilities in the base-system of - FreeBSD that can be used to work through a serial connection: - cu1 and tip1. - - For example, to connect from a client system that runs - FreeBSD to the serial connection of another system: - - # cu -l /dev/cuauN - - Ports are numbered starting from zero. This means that - COM1 is - /dev/cuau0. - - Additional programs are available through the Ports - Collection, such as - comms/minicom. - - - - - X Terminals - - X terminals are the most sophisticated kind of - terminal available. Instead of connecting to a serial - port, they usually connect to a network like Ethernet. - Instead of being relegated to text-only applications, they - can display any Xorg - application. - - This chapter does not cover the setup, configuration, - or use of X terminals. - - - - - - 終端機設定 - - This section describes how to configure a FreeBSD system to - enable a login session on a serial terminal. It assumes that - the system recognizes the serial port to which the terminal is - connected and that the terminal is connected with the correct - cable. - - In FreeBSD, init reads - /etc/ttys and starts a - getty process on the available terminals. - The getty process is responsible for - reading a login name and starting the login - program. The ports on the FreeBSD system which allow logins are - listed in /etc/ttys. For example, the - first virtual console, ttyv0, has an - entry in this file, allowing logins on the console. This file - also contains entries for the other virtual consoles, serial - ports, and pseudo-ttys. For a hardwired terminal, the serial - port's /dev entry is listed without the - /dev part. For example, - /dev/ttyv0 is listed as - ttyv0. - - The default /etc/ttys configures - support for the first four serial ports, - ttyu0 through - ttyu3: - - ttyu0 "/usr/libexec/getty std.9600" dialup off secure -ttyu1 "/usr/libexec/getty std.9600" dialup off secure -ttyu2 "/usr/libexec/getty std.9600" dialup off secure -ttyu3 "/usr/libexec/getty std.9600" dialup off secure - - When attaching a terminal to one of those ports, modify - the default entry to set the required speed and terminal type, - to turn the device on and, if needed, to - change the port's secure setting. If the - terminal is connected to another port, add an entry for the - port. - - configures two terminals in - /etc/ttys. The first entry configures a - Wyse-50 connected to COM2. The second - entry configures an old computer running - Procomm terminal software emulating - a VT-100 terminal. The computer is connected to the sixth - serial port on a multi-port serial card. - - - 設定終端機項目 - - ttyu1 "/usr/libexec/getty std.38400" wy50 on insecure -ttyu5 "/usr/libexec/getty std.19200" vt100 on insecure - - - - The first field specifies the device name of the - serial terminal. - - - - The second field tells getty to - initialize and open the line, set the line speed, prompt - for a user name, and then execute the - login program. The optional - getty type configures - characteristics on the terminal line, like - bps rate and parity. The available - getty types are listed in - /etc/gettytab. In almost all - cases, the getty types that start with - std will work for hardwired terminals - as these entries ignore parity. There is a - std entry for each - bps rate from 110 to 115200. Refer - to gettytab5 for more information. - - When setting the getty type, make sure to match the - communications settings used by the terminal. For this - example, the Wyse-50 uses no parity and connects at - 38400 bps. The computer uses no parity and - connects at 19200 bps. - - - - The third field is the type of terminal. For - dial-up ports, unknown or - dialup is typically used since users - may dial up with practically any type of terminal or - software. Since the terminal type does not change for - hardwired terminals, a real terminal type from - /etc/termcap can be specified. For - this example, the Wyse-50 uses the real terminal type - while the computer running - Procomm is set to emulate a - VT-100. - - - - The fourth field specifies if the port should be - enabled. To enable logins on this port, this field must - be set to on. - - - - The final field is used to specify whether the port - is secure. Marking a port as secure - means that it is trusted enough to allow root to login from that - port. Insecure ports do not allow root logins. On an - insecure port, users must login from unprivileged - accounts and then use su or a similar - mechanism to gain superuser privileges, as described in - . For security - reasons, it is recommended to change this setting to - insecure. - - - - - After making any changes to - /etc/ttys, send a SIGHUP (hangup) signal - to the init process to force it to re-read - its configuration file: - - # kill -HUP 1 - - Since init is always the first process - run on a system, it always has a process ID - of 1. - - If everything is set up correctly, all cables are in - place, and the terminals are powered up, a - getty process should now be running on each - terminal and login prompts should be available on each - terminal. - - - - 連線疑難排解 - - Even with the most meticulous attention to detail, - something could still go wrong while setting up a terminal. - Here is a list of common symptoms and some suggested - fixes. - - If no login prompt appears, make sure the terminal is - plugged in and powered up. If it is a personal computer - acting as a terminal, make sure it is running terminal - emulation software on the correct serial port. - - Make sure the cable is connected firmly to both the - terminal and the FreeBSD computer. Make sure it is the right - kind of cable. - - Make sure the terminal and FreeBSD agree on the - bps rate and parity settings. For a video - display terminal, make sure the contrast and brightness - controls are turned up. If it is a printing terminal, make - sure paper and ink are in good supply. - - Use ps to make sure that a - getty process is running and serving the - terminal. For example, the following listing shows that a - getty is running on the second serial port, - ttyu1, and is using the - std.38400 entry in - /etc/gettytab: - - # ps -axww|grep ttyu -22189 d1 Is+ 0:00.03 /usr/libexec/getty std.38400 ttyu1 - - If no getty process is running, make - sure the port is enabled in /etc/ttys. - Remember to run kill -HUP 1 after modifying - /etc/ttys. - - If the getty process is running but the - terminal still does not display a login prompt, or if it - displays a prompt but will not accept typed input, the - terminal or cable may not support hardware handshaking. Try - changing the entry in /etc/ttys from - std.38400 to - 3wire.38400, then run kill -HUP - 1 after modifying /etc/ttys. - The 3wire entry is similar to - std, but ignores hardware handshaking. The - baud rate may need to be reduced or software flow control - enabled when using 3wire to prevent buffer - overflows. - - If garbage appears instead of a login prompt, make sure - the terminal and FreeBSD agree on the bps rate - and parity settings. Check the getty - processes to make sure the correct - getty type is in use. If not, edit - /etc/ttys and run kill - -HUP 1. - - If characters appear doubled and the password appears when - typed, switch the terminal, or the terminal emulation - software, from half duplex or local - echo to full duplex. - - - - - - 撥入服務 - - - - - Guy - Helmer - - Contributed by - - - - - - - Sean - Kelly - - Additions by - - - - - dial-in service - - Configuring a FreeBSD system for dial-in service is similar to - configuring terminals, except that modems are used instead of - terminal devices. FreeBSD supports both external and internal - modems. - - External modems are more convenient because they often can - be configured via parameters stored in non-volatile - RAM and they usually provide lighted - indicators that display the state of important - RS-232 signals, indicating whether the modem - is operating properly. - - Internal modems usually lack non-volatile - RAM, so their configuration may be limited to - setting DIP switches. If the internal modem - has any signal indicator lights, they are difficult to view when - the system's cover is in place. - - modem - - When using an external modem, a proper cable is needed. A - standard RS-232C serial cable should - suffice. - - FreeBSD needs the RTS and - CTS signals for flow control at speeds above - 2400 bps, the CD signal to detect when a - call has been answered or the line has been hung up, and the - DTR signal to reset the modem after a session - is complete. Some cables are wired without all of the needed - signals, so if a login session does not go away when the line - hangs up, there may be a problem with the cable. Refer to for more information about these - signals. - - Like other UNIX-like operating systems, FreeBSD uses the - hardware signals to find out when a call has been answered or a - line has been hung up and to hangup and reset the modem after a - call. FreeBSD avoids sending commands to the modem or watching for - status reports from the modem. - - FreeBSD supports the NS8250, - NS16450, NS16550, and - NS16550A-based RS-232C - (CCITT V.24) communications interfaces. The - 8250 and 16450 devices have single-character buffers. The 16550 - device provides a 16-character buffer, which allows for better - system performance. Bugs in plain 16550 devices prevent the use - of the 16-character buffer, so use 16550A devices if possible. - Because single-character-buffer devices require more work by the - operating system than the 16-character-buffer devices, - 16550A-based serial interface cards are preferred. If the - system has many active serial ports or will have a heavy load, - 16550A-based cards are better for low-error-rate - communications. - - The rest of this section demonstrates how to configure a - modem to receive incoming connections, how to communicate with - the modem, and offers some troubleshooting tips. - - - 數據機設定 - - getty - As with terminals, init spawns a - getty process for each configured serial - port used for dial-in connections. When a user dials the - modem's line and the modems connect, the Carrier - Detect signal is reported by the modem. The kernel - notices that the carrier has been detected and instructs - getty to open the port and display a - login: prompt at the specified initial line - speed. In a typical configuration, if garbage characters are - received, usually due to the modem's connection speed being - different than the configured speed, getty - tries adjusting the line speeds until it receives reasonable - characters. After the user enters their login name, - getty executes login, - which completes the login process by asking for the user's - password and then starting the user's shell. - - - /usr/bin/login - - - There are two schools of thought regarding dial-up modems. - One configuration method is to set the modems and systems so - that no matter at what speed a remote user dials in, the - dial-in RS-232 interface runs at a locked - speed. The benefit of this configuration is that the remote - user always sees a system login prompt immediately. The - downside is that the system does not know what a user's true - data rate is, so full-screen programs like - Emacs will not adjust their - screen-painting methods to make their response better for - slower connections. - - The second method is to configure the - RS-232 interface to vary its speed based on - the remote user's connection speed. Because - getty does not understand any particular - modem's connection speed reporting, it gives a - login: message at an initial speed and - watches the characters that come back in response. If the - user sees junk, they should press Enter until - they see a recognizable prompt. If the data rates do not - match, getty sees anything the user types - as junk, tries the next speed, and gives the - login: prompt again. This procedure normally - only takes a keystroke or two before the user sees a good - prompt. This login sequence does not look as clean as the - locked-speed method, but a user on a low-speed connection - should receive better interactive response from full-screen - programs. - - When locking a modem's data communications rate at a - particular speed, no changes to - /etc/gettytab should be needed. However, - for a matching-speed configuration, additional entries may be - required in order to define the speeds to use for the modem. - This example configures a 14.4 Kbps modem with a top - interface speed of 19.2 Kbps using 8-bit, no parity - connections. It configures getty to start - the communications rate for a V.32bis connection at - 19.2 Kbps, then cycles through 9600 bps, - 2400 bps, 1200 bps, 300 bps, and back to - 19.2 Kbps. Communications rate cycling is implemented - with the nx= (next table) capability. Each - line uses a tc= (table continuation) entry - to pick up the rest of the settings for a particular data - rate. - - # -# Additions for a V.32bis Modem -# -um|V300|High Speed Modem at 300,8-bit:\ - :nx=V19200:tc=std.300: -un|V1200|High Speed Modem at 1200,8-bit:\ - :nx=V300:tc=std.1200: -uo|V2400|High Speed Modem at 2400,8-bit:\ - :nx=V1200:tc=std.2400: -up|V9600|High Speed Modem at 9600,8-bit:\ - :nx=V2400:tc=std.9600: -uq|V19200|High Speed Modem at 19200,8-bit:\ - :nx=V9600:tc=std.19200: - - For a 28.8 Kbps modem, or to take advantage of - compression on a 14.4 Kbps modem, use a higher - communications rate, as seen in this example: - - # -# Additions for a V.32bis or V.34 Modem -# Starting at 57.6 Kbps -# -vm|VH300|Very High Speed Modem at 300,8-bit:\ - :nx=VH57600:tc=std.300: -vn|VH1200|Very High Speed Modem at 1200,8-bit:\ - :nx=VH300:tc=std.1200: -vo|VH2400|Very High Speed Modem at 2400,8-bit:\ - :nx=VH1200:tc=std.2400: -vp|VH9600|Very High Speed Modem at 9600,8-bit:\ - :nx=VH2400:tc=std.9600: -vq|VH57600|Very High Speed Modem at 57600,8-bit:\ - :nx=VH9600:tc=std.57600: - - For a slow CPU or a heavily loaded - system without 16550A-based serial ports, this configuration - may produce sio - silo errors at 57.6 Kbps. - - - /etc/ttys - - - The configuration of /etc/ttys is - similar to , but a different - argument is passed to getty and - dialup is used for the terminal type. - Replace xxx with the process - init will run on the device: - - ttyu0 "/usr/libexec/getty xxx" dialup on - - The dialup terminal type can be - changed. For example, setting vt102 as the - default terminal type allows users to use - VT102 emulation on their remote - systems. - - For a locked-speed configuration, specify the speed with - a valid type listed in /etc/gettytab. - This example is for a modem whose port speed is locked at - 19.2 Kbps: - - ttyu0 "/usr/libexec/getty std.19200" dialup on - - In a matching-speed configuration, the entry needs to - reference the appropriate beginning auto-baud - entry in /etc/gettytab. To continue the - example for a matching-speed modem that starts at - 19.2 Kbps, use this entry: - - ttyu0 "/usr/libexec/getty V19200" dialup on - - After editing /etc/ttys, wait until - the modem is properly configured and connected before - signaling init: - - # kill -HUP 1 - - - rc files - rc.serial - - - High-speed modems, like V.32, - V.32bis, and V.34 - modems, use hardware (RTS/CTS) flow - control. Use stty to set the hardware flow - control flag for the modem port. This example sets the - crtscts flag on COM2's - dial-in and dial-out initialization devices: - - # stty -f /dev/ttyu1.init crtscts -# stty -f /dev/cuau1.init crtscts - - - - - - 疑難排解 - - This section provides a few tips for troubleshooting a - dial-up modem that will not connect to a FreeBSD system. - - Hook up the modem to the FreeBSD system and boot the system. - If the modem has status indication lights, watch to see - whether the modem's DTR indicator lights - when the login: prompt appears on the - system's console. If it lights up, that should mean that FreeBSD - has started a getty process on the - appropriate communications port and is waiting for the modem - to accept a call. - - If the DTR indicator does not light, - login to the FreeBSD system through the console and type - ps ax to see if FreeBSD is running a - getty process on the correct port: - - 114 ?? I 0:00.10 /usr/libexec/getty V19200 ttyu0 - - If the second column contains a d0 - instead of a ?? and the modem has not - accepted a call yet, this means that getty - has completed its open on the communications port. This could - indicate a problem with the cabling or a misconfigured modem - because getty should not be able to open - the communications port until the carrier detect signal has - been asserted by the modem. - - If no getty processes are waiting to - open the port, double-check that the entry for the port is - correct in /etc/ttys. Also, check - /var/log/messages to see if there are - any log messages from init or - getty. - - Next, try dialing into the system. Be sure to use 8 bits, - no parity, and 1 stop bit on the remote system. If a prompt - does not appear right away, or the prompt shows garbage, try - pressing Enter about once per second. If - there is still no login: prompt, - try sending a BREAK. When using a - high-speed modem, try dialing again after locking the - dialing modem's interface speed. - - If there is still no login: prompt, check - /etc/gettytab again and double-check - that: - - - - The initial capability name specified in the entry in - /etc/ttys matches the name of a - capability in /etc/gettytab. - - - - Each nx= entry matches another - gettytab capability name. - - - - Each tc= entry matches another - gettytab capability name. - - - - If the modem on the FreeBSD system will not answer, make - sure that the modem is configured to answer the phone when - DTR is asserted. If the modem seems to be - configured correctly, verify that the - DTR line is asserted by checking the - modem's indicator lights. - - If it still does not work, try sending an email - to the FreeBSD general questions mailing list describing the modem and the - problem. - - - - - 撥出服務 - - dial-out service - - The following are tips for getting the host to connect over - the modem to another computer. This is appropriate for - establishing a terminal session with a remote host. - - This kind of connection can be helpful to get a file on the - Internet if there are problems using PPP. If PPP is not - working, use the terminal session to FTP the needed file. Then - use zmodem to transfer it to the machine. - - - 使用 Stock Hayes 數據機 - - A generic Hayes dialer is built into - tip. Use at=hayes in - /etc/remote. - - The Hayes driver is not smart enough to recognize some of - the advanced features of newer modems messages like - BUSY, NO DIALTONE, or - CONNECT 115200. Turn those messages off - when using tip with - ATX0&W. - - The dial timeout for tip is 60 - seconds. The modem should use something less, or else - tip will think there is a communication - problem. Try ATS7=45&W. - - - - 使用 <literal>AT</literal> 指令 - - - /etc/remote - - Create a direct entry in - /etc/remote. For example, if the modem - is hooked up to the first serial port, - /dev/cuau0, use the following - line: - - cuau0:dv=/dev/cuau0:br#19200:pa=none - - Use the highest bps rate the modem - supports in the br capability. Then, type - tip cuau0 to connect to the modem. - - Or, use cu as root with the following - command: - - # cu -lline -sspeed - - line is the serial port, such - as /dev/cuau0, and - speed is the speed, such as - 57600. When finished entering the AT - commands, type ~. to exit. - - - - <literal>@</literal> 符號無法運作 - - The @ sign in the phone number - capability tells tip to look in - /etc/phones for a phone number. But, the - @ sign is also a special character in - capability files like /etc/remote, so it - needs to be escaped with a backslash: - - pn=\@ - - - - 從指令列撥號 - - Put a generic entry in - /etc/remote. For example: - - tip115200|Dial any phone number at 115200 bps:\ - :dv=/dev/cuau0:br#115200:at=hayes:pa=none:du: -tip57600|Dial any phone number at 57600 bps:\ - :dv=/dev/cuau0:br#57600:at=hayes:pa=none:du: - - This should now work: - - # tip -115200 5551234 - - Users who prefer cu over - tip, can use a generic - cu entry: - - cu115200|Use cu to dial any number at 115200bps:\ - :dv=/dev/cuau1:br#57600:at=hayes:pa=none:du: - - and type: - - # cu 5551234 -s 115200 - - - - 設定 <acronym>bps</acronym> 率 - - Put in an entry for tip1200 or - cu1200, but go ahead and use whatever - bps rate is appropriate with the - br capability. - tip thinks a good default is 1200 bps - which is why it looks for a tip1200 entry. - 1200 bps does not have to be used, though. - - - - 透過終端伺服器存取多個主機 - - Rather than waiting until connected and typing - CONNECT host - each time, use tip's cm - capability. For example, these entries in - /etc/remote will let you type - tip pain or tip muffin - to connect to the hosts pain or - muffin, and tip - deep13 to connect to the terminal server. - - pain|pain.deep13.com|Forrester's machine:\ - :cm=CONNECT pain\n:tc=deep13: -muffin|muffin.deep13.com|Frank's machine:\ - :cm=CONNECT muffin\n:tc=deep13: -deep13:Gizmonics Institute terminal server:\ - :dv=/dev/cuau2:br#38400:at=hayes:du:pa=none:pn=5551234: - - - - - 在 <command>tip</command> 使用超過一行 - - This is often a problem where a university has several - modem lines and several thousand students trying to use - them. - - Make an entry in /etc/remote and use - @ for the pn - capability: - - big-university:\ - :pn=\@:tc=dialout -dialout:\ - :dv=/dev/cuau3:br#9600:at=courier:du:pa=none: - - Then, list the phone numbers in - /etc/phones: - - big-university 5551111 -big-university 5551112 -big-university 5551113 -big-university 5551114 - - tip will try each number in the listed - order, then give up. To keep retrying, run - tip in a while - loop. - - - - 使用強制字元 - - - Ctrl - P - is the default force character, - used to tell tip that the next character is - literal data. The force character can be set to any other - character with the ~s escape, which means - set a variable. - - Type - ~sforce=single-char - followed by a newline. single-char - is any single character. If - single-char is left out, then the - force character is the null character, which is accessed by - typing - - Ctrl2 - - or - CtrlSpace - . A pretty good value for - single-char is - - Shift - Ctrl - 6 - , which is only used on some terminal - servers. - - To change the force character, specify the following in - ~/.tiprc: - - force=single-char - - - - 大寫字元 - - This happens when - - Ctrl - A - is pressed, which is tip's - raise character, specially designed for people - with broken caps-lock keys. Use ~s to set - raisechar to something reasonable. It can - be set to be the same as the force character, if neither - feature is used. - - Here is a sample ~/.tiprc for - Emacs users who need to type - - Ctrl - 2 - and - Ctrl - A - : - - force=^^ -raisechar=^^ - - The ^^ is - - ShiftCtrl6 - . - - - - - 使用 <command>tip</command> 傳輸檔案 - - When talking to another UNIX-like operating system, - files can be sent and received using ~p - (put) and ~t (take). These commands run - cat and echo on the - remote system to accept and send files. The syntax is: - - - ~p - local-file - remote-file - - - - ~t - remote-file - local-file - - - There is no error checking, so another protocol, like - zmodem, should probably be used. - - - - 在 <application>zmodem</application> 使用 <command>tip</command>? - - To receive files, start the sending program on the remote - end. Then, type ~C rz to begin receiving - them locally. - - To send files, start the receiving program on the remote - end. Then, type ~C sz - files to send them to the - remote system. - - - - - - 設定序列 Console - - - - - Kazutaka - YOKOTA - - Contributed by - - - - - - - Bill - Paul - - Based on a document by - - - - - serial console - - FreeBSD has the ability to boot a system with a dumb - terminal on a serial port as a console. This configuration is - useful for system administrators who wish to install FreeBSD on - machines that have no keyboard or monitor attached, and - developers who want to debug the kernel or device - drivers. - - As described in , FreeBSD employs a three - stage bootstrap. The first two stages are in the boot block - code which is stored at the beginning of the FreeBSD slice on the - boot disk. The boot block then loads and runs the boot loader - as the third stage code. - - In order to set up booting from a serial console, the boot - block code, the boot loader code, and the kernel need to be - configured. - - - 快速序列 Console 設定 - - This section provides a fast overview of setting up the - serial console. This procedure can be used when the dumb - terminal is connected to COM1. - - - Configuring a Serial Console on - <filename>COM1</filename> - - - Connect the serial cable to - COM1 and the controlling - terminal. - - - - To configure boot messages to display on the serial - console, issue the following command as the - superuser: - - # sysrc -f /boot/loader.conf console=comconsole - - - - Edit /etc/ttys and change - off to on and - dialup to vt100 for - the ttyu0 entry. Otherwise, a - password will not be required to connect via the serial - console, resulting in a potential security hole. - - - - Reboot the system to see if the changes took - effect. - - - - - If a different configuration is required, see the next - section for a more in-depth configuration explanation. - - - - 深入序列 Console 設定 - - This section provides a more detailed explanation of the - steps needed to setup a serial console in FreeBSD. - - - Configuring a Serial Console - - - Prepare a serial cable. - - null-modem cable - - Use either a null-modem cable or a standard serial - cable and a null-modem adapter. See for a discussion on serial - cables. - - - - Unplug the keyboard. - - Many systems probe for the keyboard during the - Power-On Self-Test (POST) and will - generate an error if the keyboard is not detected. Some - machines will refuse to boot until the keyboard is plugged - in. - - If the computer complains about the error, but boots - anyway, no further configuration is needed. - - If the computer refuses to boot without a keyboard - attached, configure the BIOS so that it - ignores this error. Consult the motherboard's manual for - details on how to do this. - - - Try setting the keyboard to Not - installed in the BIOS. - This setting tells the BIOS not to - probe for a keyboard at power-on so it should not - complain if the keyboard is absent. If that option is - not present in the BIOS, look for an - Halt on Error option instead. Setting - this to All but Keyboard or to No - Errors will have the same effect. - - - If the system has a PS/2 mouse, unplug it as well. - PS/2 mice share some hardware with the keyboard and - leaving the mouse plugged in can fool the keyboard probe - into thinking the keyboard is still there. - - - While most systems will boot without a keyboard, - quite a few will not boot without a graphics adapter. - Some systems can be configured to boot with no graphics - adapter by changing the graphics adapter - setting in the BIOS configuration to - Not installed. Other systems do not - support this option and will refuse to boot if there is - no display hardware in the system. With these machines, - leave some kind of graphics card plugged in, even if it - is just a junky mono board. A monitor does not need to - be attached. - - - - - Plug a dumb terminal, an old computer with a modem - program, or the serial port on another UNIX box into the - serial port. - - - - Add the appropriate hint.sio.* - entries to /boot/device.hints for the - serial port. Some multi-port cards also require kernel - configuration options. Refer to sio4 for the - required options and device hints for each supported - serial port. - - - - Create boot.config in the root - directory of the a partition on the - boot drive. - - This file instructs the boot block code how to boot - the system. In order to activate the serial console, one - or more of the following options are needed. When using - multiple options, include them all on the same - line: - - - - - - - Toggles between the internal and serial - consoles. Use this to switch console devices. For - instance, to boot from the internal (video) console, - use to direct the boot loader - and the kernel to use the serial port as its console - device. Alternatively, to boot from the serial - port, use to tell the boot - loader and the kernel to use the video display as - the console instead. - - - - - - - - Toggles between the single and dual console - configurations. In the single configuration, the - console will be either the internal console (video - display) or the serial port, depending on the state - of . In the dual console - configuration, both the video display and the - serial port will become the console at the same - time, regardless of the state of - . However, the dual console - configuration takes effect only while the boot - block is running. Once the boot loader gets - control, the console specified by - becomes the only - console. - - - - - - - - Makes the boot block probe the keyboard. If no - keyboard is found, the and - options are automatically - set. - - - Due to space constraints in the current - version of the boot blocks, is - capable of detecting extended keyboards only. - Keyboards with less than 101 keys and without F11 - and F12 keys may not be detected. Keyboards on - some laptops may not be properly found because of - this limitation. If this is the case, do not use - . - - - - - - Use either to select the console - automatically or to activate the - serial console. Refer to boot8 and - boot.config5 for more details. - - The options, except for , are - passed to the boot loader. The boot loader will - determine whether the internal video or the serial port - should become the console by examining the state of - . This means that if - is specified but - is not specified in /boot.config, the - serial port can be used as the console only during the - boot block as the boot loader will use the internal video - display as the console. - - - - Boot the machine. - - When FreeBSD starts, the boot blocks echo the contents of - /boot.config to the console. For - example: - - /boot.config: -P -Keyboard: no - - The second line appears only if is - in /boot.config and indicates the - presence or absence of the keyboard. These messages go - to either the serial or internal console, or both, - depending on the option in - /boot.config: - - - - - - Options - Message goes to - - - - - - none - internal console - - - - - serial console - - - - - serial and internal consoles - - - - - serial and internal consoles - - - - , keyboard present - internal console - - - - , keyboard absent - serial console - - - - - - After the message, there will be a small pause before - the boot blocks continue loading the boot loader and - before any further messages are printed to the console. - Under normal circumstances, there is no need to interrupt - the boot blocks, but one can do so in order to make sure - things are set up correctly. - - Press any key, other than Enter, at - the console to interrupt the boot process. The boot - blocks will then prompt for further action: - - >> FreeBSD/i386 BOOT -Default: 0:ad(0,a)/boot/loader -boot: - - Verify that the above message appears on either the - serial or internal console, or both, according to the - options in /boot.config. If the - message appears in the correct console, press - Enter to continue the boot - process. - - If there is no prompt on the serial terminal, - something is wrong with the settings. Enter - then Enter or - Return to tell the boot block (and then - the boot loader and the kernel) to choose the serial port - for the console. Once the system is up, go back and check - what went wrong. - - - - During the third stage of the boot process, one can still - switch between the internal console and the serial console by - setting appropriate environment variables in the boot loader. - See loader8 for more - information. - - - This line in /boot/loader.conf or - /boot/loader.conf.local configures the - boot loader and the kernel to send their boot messages to - the serial console, regardless of the options in - /boot.config: - - console="comconsole" - - That line should be the first line of - /boot/loader.conf so that boot messages - are displayed on the serial console as early as - possible. - - If that line does not exist, or if it is set to - console="vidconsole", the boot loader and - the kernel will use whichever console is indicated by - in the boot block. See - loader.conf5 for more information. - - At the moment, the boot loader has no option - equivalent to in the boot block, and - there is no provision to automatically select the internal - console and the serial console based on the presence of the - keyboard. - - - - While it is not required, it is possible to provide a - login prompt over the serial line. To - configure this, edit the entry for the serial port in - /etc/ttys using the instructions in - . If the speed of the serial - port has been changed, change std.9600 to - match the new setting. - - - - - 設定使用更快的序列埠速度 - - By default, the serial port settings are 9600 baud, 8 - bits, no parity, and 1 stop bit. To change the default - console speed, use one of the following options: - - - - Edit /etc/make.conf and set - BOOT_COMCONSOLE_SPEED to the new - console speed. Then, recompile and install the boot - blocks and the boot loader: - - # cd /sys/boot -# make clean -# make -# make install - - If the serial console is configured in some other way - than by booting with , or if the serial - console used by the kernel is different from the one used - by the boot blocks, add the following option, with the - desired speed, to a custom kernel configuration file and - compile a new kernel: - - options CONSPEED=19200 - - - - Add the - boot - option to /boot.config, replacing - 19200 with the speed to - use. - - - - Add the following options to - /boot/loader.conf. Replace - 115200 with the speed to - use. - - boot_multicons="YES" -boot_serial="YES" -comconsole_speed="115200" -console="comconsole,vidconsole" - - - - - - 從序列線路 (Serial Line) 進入 DDB 除錯程式 - - To configure the ability to drop into the kernel debugger - from the serial console, add the following options to a custom - kernel configuration file and compile the kernel using the - instructions in . Note that - while this is useful for remote diagnostics, it is also - dangerous if a spurious BREAK is generated on the serial port. - Refer to ddb4 and ddb8 for more information - about the kernel debugger. - - options BREAK_TO_DEBUGGER -options DDB - - -
- - - - - - - <acronym>PPP</acronym> - - - 概述 - - - PPP - - - FreeBSD 支援點對點 (Point-to-Point, PPP) 通訊協定,可透過撥號數據機用來建立網路或網際網路連線。本章將說明如何設定在 FreeBSD 中以數據機為基礎的通訊服務。 - - 讀完這章,您將了解: - - - - 如何設定、使用 PPP 連線及排除問題。 - - - 如何設定在乙太網路 (Ethernet) 上的 PPP (PPPoE)。 - - - 如何設定在 ATM 上的 PPP (PPPoA)。 - - - - - PPP - - - PPP - over Ethernet - - - 在開始閱讀這章之前,您需要: - - - - 熟悉基本網路術語。 - - - 了解撥號連線及 PPP 的基礎及目的。 - - - - - - - - 設定 <acronym>PPP</acronym> - - FreeBSD provides built-in support for managing dial-up - PPP connections using ppp8. The - default FreeBSD kernel provides support for - tun which is used to interact with a - modem hardware. Configuration is performed by editing at least - one configuration file, and configuration files containing - examples are provided. Finally, ppp is - used to start and manage connections. - - In order to use a PPP connection, the - following items are needed: - - - - A dial-up account with an Internet Service Provider - (ISP). - - - - A dial-up modem. - - - - The dial-up number for the - ISP. - - - - The login name and password assigned by the - ISP. - - - - The IP address of one or more - DNS servers. Normally, the - ISP provides these addresses. If it did - not, FreeBSD can be configured to use - DNS negotiation. - - - - If any of the required information is missing, contact - the ISP. - - The following information may be supplied by the - ISP, but is not necessary: - - - - The IP address of the default - gateway. If this information is unknown, the - ISP will automatically provide the - correct value during connection setup. When configuring - PPP on FreeBSD, this address is referred to - as HISADDR. - - - - The subnet mask. If the ISP has not - provided one, 255.255.255.255 will be used - in the ppp8 configuration file. - - - - - static IP address - - - If the ISP has assigned a static - IP address and hostname, it should be - input into the configuration file. Otherwise, this - information will be automatically provided during - connection setup. - - - - The rest of this section demonstrates how to configure FreeBSD - for common PPP connection scenarios. The - required configuration file is - /etc/ppp/ppp.conf and additional files and - examples are available in - /usr/share/examples/ppp/. - - - Throughout this section, many of the file examples - display line numbers. These line numbers have been added to - make it easier to follow the discussion and are not meant to - be placed in the actual file. - - When editing a configuration file, proper indentation is - important. Lines that end in a : start in - the first column (beginning of the line) while all other lines - should be indented as shown using spaces or tabs. - - - - 基礎設定 - - - PPP - with static IP - addresses - - - In order to configure a PPP connection, - first edit /etc/ppp/ppp.conf with the - dial-in information for the ISP. This file - is described as follows: - - 1 default: -2 set log Phase Chat LCP IPCP CCP tun command -3 ident user-ppp VERSION -4 set device /dev/cuau0 -5 set speed 115200 -6 set dial "ABORT BUSY ABORT NO\\sCARRIER TIMEOUT 5 \ -7 \"\" AT OK-AT-OK ATE1Q0 OK \\dATDT\\T TIMEOUT 40 CONNECT" -8 set timeout 180 -9 enable dns -10 -11 provider: -12 set phone "(123) 456 7890" -13 set authname foo -14 set authkey bar -15 set timeout 300 -16 set ifaddr x.x.x.x/0 y.y.y.y/0 255.255.255.255 0.0.0.0 -17 add default HISADDR - - - - Line 1: - - - Identifies the default entry. - Commands in this entry (lines 2 through 9) are - executed automatically when ppp - is run. - - - - - Line 2: - - - Enables verbose logging parameters for testing - the connection. Once the configuration is working - satisfactorily, this line should be reduced - to: - - set log phase tun - - - - - - Line 3: - - - Displays the version of ppp8 to the - PPP software running on the other - side of the connection. - - - - - Line 4: - - - Identifies the device to which the modem is - connected, where COM1 is - /dev/cuau0 and - COM2 is - /dev/cuau1. - - - - - Line 5: - - - Sets the connection speed. If - 115200 does not work on an older - modem, try 38400 instead. - - - - - Lines 6 & 7: - - - The dial string written as an expect-send - syntax. Refer to chat8 for more - information. - - Note that this command continues onto the next - line for readability. Any command in - ppp.conf may do this if the - last character on the line is - \. - - - - - Line 8: - - - Sets the idle timeout for the link in - seconds. - - - - - Line 9: - - - Instructs the peer to confirm the - DNS settings. If the local - network is running its own DNS - server, this line should be commented out, by adding - a # at the beginning of the line, - or removed. - - - - - Line 10: - - - A blank line for readability. Blank lines are - ignored by ppp8. - - - - - Line 11: - - - Identifies an entry called - provider. This could be changed - to the name of the ISP so that - can be - used to start the connection. - - - - - Line 12: - - - Use the phone number for the - ISP. Multiple phone numbers may - be specified using the colon (:) - or pipe character (|) as a - separator. To rotate through the numbers, use a - colon. To always attempt to dial the first number - first and only use the other numbers if the first - number fails, use the pipe character. Always - enclose the entire set of phone numbers between - quotation marks (") to prevent - dialing failures. - - - - - Lines 13 & 14: - - - Use the user name and password for the - ISP. - - - - - Line 15: - - - Sets the default idle timeout in seconds for the - connection. In this example, the connection will be - closed automatically after 300 seconds of - inactivity. To prevent a timeout, set this value to - zero. - - - - - Line 16: - - Sets the interface addresses. The values used - depend upon whether a static IP - address has been obtained from the - ISP or if it instead negotiates - a dynamic IP address during - connection. - - If the ISP has allocated a - static IP address and default - gateway, replace x.x.x.x - with the static IP address and - replace y.y.y.y with the - IP address of the default - gateway. If the ISP has only - provided a static IP address - without a gateway address, replace - y.y.y.y with 10.0.0.2/0. - - If the IP address changes - whenever a connection is made, change this line to - the following value. This tells ppp8 to use - the IP Configuration Protocol - (IPCP) to negotiate a dynamic - IP address: - - set ifaddr 10.0.0.1/0 10.0.0.2/0 255.255.255.255 0.0.0.0 - - - - - - Line 17: - - - Keep this line as-is as it adds a default route - to the gateway. The HISADDR will - automatically be replaced with the gateway address - specified on line 16. It is important that this - line appears after line 16. - - - - - Depending upon whether ppp8 is started - manually or automatically, a - /etc/ppp/ppp.linkup may also need to - be created which contains the following lines. This file - is required when running ppp in - mode. This file is used after the - connection has been established. At this point, the - IP address will have been assigned and - it is now be possible to add the routing table entries. - When creating this file, make sure that - provider matches the value - demonstrated in line 11 of - ppp.conf. - - provider: - add default HISADDR - - This file is also needed when the default gateway - address is guessed in a static - IP address configuration. In this case, - remove line 17 from ppp.conf and - create /etc/ppp/ppp.linkup with the - above two lines. More examples for this file can be found - in /usr/share/examples/ppp/. - - By default, ppp must be - run as root. - To change this default, add the account of the user - who should run ppp to the network group in - /etc/group. - - Then, give the user access to one or more entries in - /etc/ppp/ppp.conf with - allow. For example, to give - fred and - mary - permission to only the provider: entry, - add this line to the provider: - section: - - allow users fred mary - - To give the specified users access to all entries, put - that line in the default section - instead. - - - - Receiving Incoming Calls - - - PPP - receiving incoming calls - - - When configuring &man.ppp.8; to receive incoming calls - on a machine connected to a Local Area Network - (LAN), decide if packets should be - forwarded to the LAN. If so, allocate - the connecting system an IP address - from the LAN's subnet, and add the - enable proxy line to - /etc/ppp/ppp.conf. - Also, confirm that /etc/rc.conf - contains the following line: - - gateway_enable="YES" - - Refer to &man.ppp.8; and - /usr/share/examples/ppp/ppp.conf.sample - for more details. The following steps will also be - required: - - - - Create an entry in - /etc/passwd (using the - &man.vipw.8; program). - - - - Create a profile in this users home directory that - runs ppp -direct direct-server or - similar. - - - - Create an entry in - /etc/ppp/ppp.conf. The - direct-server example should - suffice. - - - - Create an entry in - /etc/ppp/ppp.linkup. - - - - - <acronym>PPP</acronym> Shells for Dynamic - <acronym>IP</acronym> Users - - - PPP shells - - - Create a file called - /etc/ppp/ppp-shell containing the - following: - - #!/bin/sh -IDENT=`echo $0 | sed -e 's/^.*-\(.*\)$/\1/'` -CALLEDAS="$IDENT" -TTY=`tty` - -if [ x$IDENT = xdialup ]; then - IDENT=`basename $TTY` -fi - -echo "PPP for $CALLEDAS on $TTY" -echo "Starting PPP for $IDENT" - -exec /usr/sbin/ppp -direct $IDENT - - This script should be executable. Now make a - symbolic link called ppp-dialup to - this script using the following commands: - - &prompt.root; ln -s ppp-shell /etc/ppp/ppp-dialup - - Use this script as the - shell for all of dial-up users. This - is an example from /etc/passwd for a - dial-up PPP: - - pchilds:*:1011:300:Peter Childs PPP:/home/ppp:/etc/ppp/ppp-dialup - - Create a /home/ppp directory that - is world readable containing the following 0 byte - files: - - -r--r--r-- 1 root wheel 0 May 27 02:23 .hushlogin --r--r--r-- 1 root wheel 0 May 27 02:22 .rhosts - - which prevents /etc/motd from - being displayed. - - - <acronym>PPP</acronym> Shells for Static - <acronym>IP</acronym> Users - - - PPP shells - - - Create ppp-shell as - above, and for each account with statically assigned - IPs create a symbolic link to - ppp-shell. - - For example, to route /24 CIDR networks for the - dial-up customers fred, - sam, and - mary, type: - - &prompt.root; ln -s /etc/ppp/ppp-shell /etc/ppp/ppp-fred -&prompt.root; ln -s /etc/ppp/ppp-shell /etc/ppp/ppp-sam -&prompt.root; ln -s /etc/ppp/ppp-shell /etc/ppp/ppp-mary - - Each of these users dial-up accounts should have - their shell set to the symbolic link created above (for - example, mary's shell should be - /etc/ppp/ppp-mary). - - - - Setting Up <filename>ppp.conf</filename> for - Dynamic <acronym>IP</acronym> Users - - Ensure that /etc/ppp/ppp.conf - contains something along the lines of: - - default: - set debug phase lcp chat - set timeout 0 - -ttyu0: - set ifaddr 203.14.100.1 203.14.100.20 255.255.255.255 - enable proxy - -ttyu1: - set ifaddr 203.14.100.1 203.14.100.21 255.255.255.255 - enable proxy - - - The indenting is important. - - - The default: section is loaded - for each session. For each dial-up line enabled in - /etc/ttys create an entry similar - to the one for ttyu0: above. Each - line should get a unique IP address - from the pool of IP addresses for - dynamic users. - - - - Setting Up <filename>ppp.conf</filename> for - Static <acronym>IP</acronym> Users - - Along with the contents of the sample - /usr/share/examples/ppp/ppp.conf - above, add a section for each of the statically assigned - dial-up users:. - - fred: - set ifaddr 203.14.100.1 203.14.101.1 255.255.255.255 - -sam: - set ifaddr 203.14.100.1 203.14.102.1 255.255.255.255 - -mary: - set ifaddr 203.14.100.1 203.14.103.1 255.255.255.255 - - The file /etc/ppp/ppp.linkup - should also contain routing information for each static - IP user if required. The line below - would add a route for the 203.14.101.0/24 network via the - client's ppp link. - - fred: - add 203.14.101.0 netmask 255.255.255.0 HISADDR - -sam: - add 203.14.102.0 netmask 255.255.255.0 HISADDR - -mary: - add 203.14.103.0 netmask 255.255.255.0 HISADDR - - ?> - - - 進階設定 - - - DNS - - - - NetBIOS - - - - PPP - Microsoft extensions - - - It is possible to configure PPP to supply DNS and - NetBIOS nameserver addresses on demand. - - To enable these extensions with - PPP version 1.x, the following lines - might be added to the relevant section of - /etc/ppp/ppp.conf. - - enable msext -set ns 203.14.100.1 203.14.100.2 -set nbns 203.14.100.5 - - And for PPP version 2 and - above: - - accept dns -set dns 203.14.100.1 203.14.100.2 -set nbns 203.14.100.5 - - This will tell the clients the primary and secondary - name server addresses, and a NetBIOS nameserver - host. - - In version 2 and above, if the set - dns line is omitted, - PPP will use the values found in - /etc/resolv.conf. - - - PAP 與 CHAP 認證 - - PAP - CHAP - Some ISPs set their system up so - that the authentication part of the connection is done - using either of the PAP or CHAP authentication mechanisms. - If this is the case, the ISP will not - give a login: prompt at connection, but - will start talking PPP - immediately. - - PAP is less secure than CHAP, but security is not - normally an issue here as passwords, although being sent - as plain text with PAP, are being transmitted down a - serial line only. There is not much room for crackers - to eavesdrop. - - The following - alterations must be made: - - 13 set authname MyUserName -14 set authkey MyPassword -15 set login - - - - Line 13: - - - This line specifies the PAP/CHAP user name. - Insert the correct value for - MyUserName. - - - - - Line 14: - - This line specifies the PAP/CHAP - passwordpassword. - Insert the correct value for - MyPassword. You may - want to add an additional line, such as: - - 16 accept PAP - - - - 16 accept CHAP - - to make it obvious that this is the intention, - but PAP and CHAP are both accepted by - default. - - - - - Line 15: - - - The ISP will not normally - require a login to the server when using PAP or - CHAP. Therefore, disable the set - login string. - - - - - - - 使用 <acronym>PPP</acronym> 網路位址轉譯功能 - - - PPPNAT - - - PPP has ability to use internal NAT without kernel - diverting capabilities. This functionality may be enabled - by the following line in - /etc/ppp/ppp.conf: - - nat enable yes - - Alternatively, NAT may be enabled by command-line - option -nat. There is also - /etc/rc.conf knob named - ppp_nat, which is enabled by - default. - - When using this feature, it may be useful to include - the following /etc/ppp/ppp.conf options - to enable incoming connections forwarding: - - nat port tcp 10.0.0.2:ftp ftp -nat port tcp 10.0.0.2:http http - - or do not trust the outside at all - - nat deny_incoming yes - - - - - 最終系統設定 - - - PPPconfiguration - - - While ppp is now configured, - some edits still need to be made to - /etc/rc.conf. - - Working from the top down in this file, make sure the - hostname= line is set: - - hostname="foo.example.com" - - If the ISP has supplied a static - IP address and name, use this name as the - host name. - - Look for the network_interfaces - variable. To configure the system to dial the - ISP on demand, make sure the - tun0 device is added to the list, - otherwise remove it. - - network_interfaces="lo0 tun0" -ifconfig_tun0= - - - The ifconfig_tun0 variable should - be empty, and a file called - /etc/start_if.tun0 should be created. - This file should contain the line: - - ppp -auto mysystem - - This script is executed at network configuration time, - starting the ppp daemon in automatic mode. If this - machine acts as a gateway, consider including - . Refer to the manual page for - further details. - - - Make sure that the router program is set to - NO with the following line in - /etc/rc.conf: - - router_enable="NO" - - - routed - - - It is important that the routed - daemon is not started, as routed tends - to delete the default routing table entries created by - ppp. - - It is probably a good idea to ensure that the - sendmail_flags line does not include the - option, otherwise - sendmail will attempt to do a network - lookup every now and then, possibly causing your machine - to dial out. You may try: - - sendmail_flags="-bd" - - - sendmail - - The downside is that sendmail is - forced to re-examine the mail queue whenever the ppp link. - To automate this, include !bg in - ppp.linkup: - - 1 provider: -2 delete ALL -3 add 0 0 HISADDR -4 !bg sendmail -bd -q30m - - - SMTP - - - An alternative is to set up a - dfilter to block SMTP traffic. Refer to the - sample files for further details. - - - - 使用 <command>ppp</command> - - All that is left is to reboot the machine. After - rebooting, either type: - - # ppp - - and then dial provider to start the - PPP session, or, to configure - ppp to establish sessions automatically - when there is outbound traffic and - start_if.tun0 does not exist, - type: - - # ppp -auto provider - - It is possible to talk to the ppp - program while it is running in the background, but only - if a suitable diagnostic port has been set up. To do - this, add the following line to the configuration: - - set server /var/run/ppp-tun%d DiagnosticPassword 0177 - - This will tell PPP to listen to the specified - UNIX domain socket, asking clients for the specified - password before allowing access. The - %d in the name is replaced with the - tun device number that is in - use. - - Once a socket has been set up, the pppctl8 - program may be used in scripts that wish to manipulate - the running program. - - - - 設定撥入服務 - - - mgetty - - - - AutoPPP - - - - LCP - - provides a good description - on enabling dial-up services using getty8. - - An alternative to getty is - comms/mgetty+sendfax - port), a smarter version of getty - designed with dial-up lines in mind. - - The advantages of using mgetty is - that it actively talks to modems, - meaning if port is turned off in - /etc/ttys then the modem will not - answer the phone. - - Later versions of mgetty (from - 0.99beta onwards) also support the automatic detection of - PPP streams, allowing clients - scriptless access to the server. - - Refer to http://mgetty.greenie.net/doc/mgetty_toc.html - for more information on mgetty. - - By default the comms/mgetty+sendfax - port comes with the AUTO_PPP option - enabled allowing mgetty to detect the - LCP phase of PPP connections and - automatically spawn off a ppp shell. However, since the - default login/password sequence does not occur it is - necessary to authenticate users using either PAP or - CHAP. - - This section assumes the user has successfully - compiled, and installed the - comms/mgetty+sendfax port on his - system. - - Ensure that - /usr/local/etc/mgetty+sendfax/login.config - has the following: - - /AutoPPP/ - - /etc/ppp/ppp-pap-dialup - - This tells mgetty to run - ppp-pap-dialup for detected - PPP connections. - - Create an executable file called - /etc/ppp/ppp-pap-dialup containing - the following: - - #!/bin/sh -exec /usr/sbin/ppp -direct pap$IDENT - - For each dial-up line enabled in - /etc/ttys, create a corresponding - entry in /etc/ppp/ppp.conf. This - will happily co-exist with the definitions we created - above. - - pap: - enable pap - set ifaddr 203.14.100.1 203.14.100.20-203.14.100.40 - enable proxy - - Each user logging in with this method will need to - have a username/password in - /etc/ppp/ppp.secret, or - alternatively add the following option to authenticate - users via PAP from - /etc/passwd. - - enable passwdauth - - To assign some users a static IP - number, specify the number as the third argument in - /etc/ppp/ppp.secret. See - /usr/share/examples/ppp/ppp.secret.sample - for examples. - - - - - - <acronym>PPP</acronym> 連線疑難排解 - - - PPP - troubleshooting - - - This section covers a few issues which may arise when - using PPP over a modem connection. Some - ISPs present the - ssword prompt while others present - password. If the ppp - script is not written accordingly, the login attempt will - fail. The most common way to debug ppp - connections is by connecting manually as described in this - section. - - - 檢查裝置節點 - - When using a custom kernel, make sure to include the - following line in the kernel configuration file: - - device uart - - The uart device is already - included in the GENERIC kernel, so no - additional steps are necessary in this case. Just - check the dmesg output for the modem - device with: - - # dmesg | grep uart - - This should display some pertinent output about the - uart devices. These are the COM - ports we need. If the modem acts like a standard serial port, - it should be listed on uart1, or - COM2. If so, a kernel rebuild is not - required. When matching up, if the modem is on - uart1, the modem device would be - /dev/cuau1. - - - - 手動連線 - - Connecting to the Internet by manually controlling - ppp is quick, easy, and a great way to - debug a connection or just get information on how the - ISP treats ppp client - connections. Lets start PPP from - the command line. Note that in all of our examples we will - use example as the hostname of the - machine running PPP. To start - ppp: - - # ppp - - ppp ON example> set device /dev/cuau1 - - This second command sets the modem device to - cuau1. - - ppp ON example> set speed 115200 - - This sets the connection speed to - 115,200 kbps. - - ppp ON example> enable dns - - This tells ppp to configure the - resolver and add the nameserver lines to - /etc/resolv.conf. If - ppp cannot determine the hostname, it can - manually be set later. - - ppp ON example> term - - This switches to terminal mode in order to - manually control the modem. - - deflink: Entering terminal mode on /dev/cuau1 -type '~h' for help - - at -OK -atdt123456789 - - Use at to initialize the modem, then - use atdt and the number for the - ISP to begin the dial in process. - - CONNECT - - Confirmation of the connection, if we are going to have - any connection problems, unrelated to hardware, here is where - we will attempt to resolve them. - - ISP Login:myusername - - At this prompt, return the prompt with the username that - was provided by the ISP. - - ISP Pass:mypassword - - At this prompt, reply with the password that was provided - by the ISP. Just like logging into FreeBSD, - the password will not echo. - - Shell or PPP:ppp - - Depending on the ISP, this prompt - might not appear. If it does, it is asking whether to use a - shell on the provider or to start - ppp. In this example, - ppp was selected in order to establish an - Internet connection. - - Ppp ON example> - - Notice that in this example the first - has been capitalized. This shows that we have successfully - connected to the ISP. - - PPp ON example> - - We have successfully authenticated with our - ISP and are waiting for the assigned - IP address. - - PPP ON example> - - We have made an agreement on an IP - address and successfully completed our connection. - - PPP ON example>add default HISADDR - - Here we add our default route, we need to do this before - we can talk to the outside world as currently the only - established connection is with the peer. If this fails due to - existing routes, put a bang character - ! in front of the . - Alternatively, set this before making the actual - connection and it will negotiate a new route - accordingly. - - If everything went good we should now have an active - connection to the Internet, which could be thrown into the - background using CTRL - z If PPP - returns to ppp then the connection has bee - lost. This is good to know because it shows the connection - status. Capital P's represent a connection to the - ISP and lowercase p's show that the - connection has been lost. - - - - 除錯 - - If a connection cannot be established, turn hardware - flow CTS/RTS to off using . This is mainly the case when - connected to some PPP-capable - terminal servers, where PPP hangs - when it tries to write data to the communication link, and - waits for a Clear To Send (CTS) signal - which may never come. When using this option, include - as it may be required to defeat - hardware dependent on passing certain characters from end to - end, most of the time XON/XOFF. Refer to ppp8 for - more information on this option and how it is used. - - An older modem may need . Parity is set at none be default, but is - used for error checking with a large increase in traffic, - on older modems. - - PPP may not return to the - command mode, which is usually a negotiation error where the - ISP is waiting for negotiating to begin. - At this point, using ~p will force ppp - to start sending the configuration information. - - If a login prompt never appears, PAP - or CHAP authentication is most likely - required. To use PAP or - CHAP, add the following options to - PPP before going into terminal - mode: - - ppp ON example> set authname myusername - - Where myusername should be - replaced with the username that was assigned by the - ISP. - - ppp ON example> set authkey mypassword - - Where mypassword should be - replaced with the password that was assigned by the - ISP. - - If a connection is established, but cannot seem to find - any domain name, try to ping8 an - IP address. If there is 100 percent - (100%) packet loss, it is likely that a default route was - not assigned. Double check that was set during the connection. If a - connection can be made to a remote IP - address, it is possible that a resolver address has not been - added to /etc/resolv.conf. This file - should look like: - - domain example.com -nameserver x.x.x.x -nameserver y.y.y.y - - Where x.x.x.x and - y.y.y.y should be replaced with - the IP address of the - ISP's DNS servers. - - To configure syslog3 to provide logging for the - PPP connection, make sure this - line exists in /etc/syslog.conf: - - !ppp -*.* /var/log/ppp.log - - - - - - - 在乙太網路使用 <acronym>PPP</acronym> (PPPoE) - - - PPP - over Ethernet - - - 本節介紹如何設定在 乙太網路使用 PPP (PPPoE)。 - - 以下有一個可用的的 ppp.conf 範例: - - default: - set log Phase tun command # you can add more detailed logging if you wish - set ifaddr 10.0.0.1/0 10.0.0.2/0 - -name_of_service_provider: - set device PPPoE:xl1 # replace xl1 with your Ethernet device - set authname YOURLOGINNAME - set authkey YOURPASSWORD - set dial - set login - add default HISADDR - - root 身份執行: - - # ppp -ddial name_of_service_provider - - 將以下參數加到 /etc/rc.conf - - ppp_enable="YES" -ppp_mode="ddial" -ppp_nat="YES" # if you want to enable nat for your local network, otherwise NO -ppp_profile="name_of_service_provider" - - - 使用 PPPoE 服務標籤 - - 有時需要使用服務標籤 (Service Tag) 才能建立連線,服務標籤用來區別不同網路要各自連線的 PPPoE 伺服器。 - - 所需的服務標籤資訊應該會在 ISP 所提供的文件中說明。 - - 最後的手段是嘗試安裝 net/rr-pppoe 套件或 Port。但是請注意,這可能會解除安裝數據機中的程式並使其無法運作,所以請三思而為。只需要安裝數據機所提供的程式,然後由該程式進入 System 選單,基本資料 (Profile name) 的名稱應該會列出來,通常是 ISP 的名稱。 - - 基本資料名稱 (Profile Name) 即服務標籤,會被用在 ppp.conf 中的 PPPoE 設定項目,set device 的提供商 (Provider) 部份。請參考 ppp8 以取得詳細說明,結果應如下: - - set device PPPoE:xl1:ISP - - 別忘記更改 xl1 為乙太網路卡的裝置名稱。 - - 別忘記更改 ISP 為基本資料名稱。 - - 要取得更進一步資訊,請參考 Renaud Waldura 所著的 Cheaper Broadband with FreeBSD on DSL。 - - - - - 在 <trademark class="registered">3Com</trademark> <trademark class="registered">HomeConnect</trademark> ADSL Modem Dual Link 使用 PPPoE - - 這台數據機並不採用 RFC 2516 所定義的規格。 - - 為了要讓 FreeBSD 能夠與這台裝置通訊,必須設定 sysctl,這可以透過更新 /etc/sysctl.conf 來讓開機時自動設定。 - - net.graph.nonstandard_pppoe=1 - - 或可以執行以下指令立即更改: - - # sysctl net.graph.nonstandard_pppoe=1 - - 不幸的是,由於這是一個全系統的設定,這可能導致一般 PPPoE 客戶端或伺服器無法與 3Com HomeConnect ADSL 數據機同時使用。 - - - - - 在 ATM 使用 <application>PPP</application> (PPPoA) - - - PPP - over ATM - - - - PPPoA - - - The following describes how to set up PPP over - ATM (PPPoA). PPPoA is a popular choice among - European DSL providers. - - - - 使用 mpd - - The mpd application can be used - to connect to a variety of services, in particular PPTP - services. It can be installed using the - net/mpd5 package or port. Many ADSL modems - require that a PPTP tunnel is created between the modem and - computer. - - Once installed, configure mpd - to suit the provider's settings. The port places a set of - sample configuration files which are well documented in - /usr/local/etc/mpd/. A complete guide to - configure mpd is available in HTML - format in /usr/ports/share/doc/mpd/. - Here is a sample configuration for connecting to an ADSL - service with mpd. The - configuration is spread over two files, first the - mpd.conf: - - - This example mpd.conf only works - with mpd 4.x. - - - default: - load adsl - -adsl: - new -i ng0 adsl adsl - set bundle authname username - set bundle password password - set bundle disable multilink - - set link no pap acfcomp protocomp - set link disable chap - set link accept chap - set link keep-alive 30 10 - - set ipcp no vjcomp - set ipcp ranges 0.0.0.0/0 0.0.0.0/0 - - set iface route default - set iface disable on-demand - set iface enable proxy-arp - set iface idle 0 - - open - - - - The username used to authenticate with your - ISP. - - - The password used to authenticate with your - ISP. - - - - Information about the link, or links, to establish is found - in mpd.links. An example - mpd.links to accompany the above example - is given beneath: - - adsl: - set link type pptp - set pptp mode active - set pptp enable originate outcall - set pptp self 10.0.0.1 - set pptp peer 10.0.0.138 - - - - The IP address of FreeBSD computer - running mpd. - - - The IP address of the ADSL modem. - The Alcatel SpeedTouch Home defaults to 10.0.0.138. - - - - It is possible to initialize the connection easily by - issuing the following command as - root: - - # mpd -b adsl - - To view the status of the connection: - - % ifconfig ng0 -ng0: flags=88d1<UP,POINTOPOINT,RUNNING,NOARP,SIMPLEX,MULTICAST> mtu 1500 - inet 216.136.204.117 --> 204.152.186.171 netmask 0xffffffff - - Using mpd is the recommended - way to connect to an ADSL service with FreeBSD. - - - - 使用 pptpclient - - It is also possible to use FreeBSD to connect to other - PPPoA services using net/pptpclient. - - To use net/pptpclient - to connect to a DSL service, install the port or package, then - edit /etc/ppp/ppp.conf. An example section - of ppp.conf is given below. For further - information on ppp.conf options consult - ppp8. - - adsl: - set log phase chat lcp ipcp ccp tun command - set timeout 0 - enable dns - set authname username - set authkey password - set ifaddr 0 0 - add default HISADDR - - - - The username for the DSL provider. - - - - The password for your account. - - - - - Since the account's password is added to - ppp.confin plain text form, make sure - nobody can read the contents of this file: - - # chown root:wheel /etc/ppp/ppp.conf -# chmod 600 /etc/ppp/ppp.conf - - - - This will open a tunnel for a PPP - session to the DSL router. Ethernet DSL modems have a - preconfigured LAN IP address to connect to. - In the case of the Alcatel SpeedTouch Home, this address is - 10.0.0.138. The - router's documentation should list the address the device - uses. To open the tunnel and start a PPP - session: - - # pptp address adsl - - - If an ampersand (&) is added - to the end of this command, - pptp will return the - prompt. - - - A tun virtual tunnel device - will be created for interaction between the - pptp and - ppp processes. Once the - prompt is returned, or the - pptp process has confirmed a - connection, examine the tunnel: - - % ifconfig tun0 -tun0: flags=8051<UP,POINTOPOINT,RUNNING,MULTICAST> mtu 1500 - inet 216.136.204.21 --> 204.152.186.171 netmask 0xffffff00 - Opened by PID 918 - - If the connection fails, check the configuration of - the router, which is usually accessible using - a web browser. Also, examine the output of - pptp and the contents of the - log file, - /var/log/ppp.log for clues. - - - - - - - - - 電子郵件 - - - BillLloydOriginal - work by - - - JimMockRewritten - by - - - - - 概述 - - email - - 電子郵件 或稱 email,是現今使用最廣泛的溝通方式之一。本章主要介紹如何在 FreeBSD 上執行郵件伺服器,以及如何使用 FreeBSD 收發信件,若欲瞭解細節請參閱 內的參考書籍。 - - 讀完這章,您將了解: - - - - 哪些軟體元件與收發電子郵件有關。 - - - - FreeBSD 內的 Sendmail 設定檔在哪。 - - - - 遠端信箱 (Mailbox) 與本機信箱的差異。 - - - - 如何阻擋垃圾郵件寄件者 (Spammer) 非法使用郵件伺服器作為中繼站。 - - - - 如何安裝與設定其他的郵件傳輸代理程式 (Mail Transfer Agent) 來取代 Sendmail - - - - 如何排除常見的郵件伺服器問題。 - - - - 如何設定系統只能寄送郵件。 - - - - 如何在撥號連線上使用郵件。 - - - - 如何設定 SMTP 認証來增加安全性。 - - - - 如何安裝並使用郵件使用者代理程式 (Mail User Agent) 如 mutt 來寄發與接收電子郵件。 - - - - 如何從遠端的 POPIMAP 伺服器下載郵件。 - - - - 如何自動套用過濾器及規則在收到的電子郵件上。 - - - - 在開始閱讀這章之前,您需要: - - - - 正確的設定網路連線 ()。 - - - - 正確的設定郵件主機的 DNS 資訊 ()。 - - - - 了解如何安裝其他第三方軟體 ()。 - - - - - - 郵件組成 - - POP - IMAP - DNS - - mail server daemons - Sendmail - - - mail server daemons - Postfix - - - mail server daemons - qmail - - - mail server daemons - Exim - - - email - receiving - - MX record - mail host - - There are five major parts involved in an email exchange: - the Mail User Agent (MUA), the Mail Transfer - Agent (MTA), a mail host, a remote or local - mailbox, and DNS. This section provides an - overview of these components. - - - - 郵件使用者代理程式 (Mail User Agent, MUA) - - The Mail User Agent (MUA) is an - application which is used to compose, send, and receive - emails. This application can be a command line program, - such as the built-in mail utility or a - third-party application from the Ports Collection, such as - mutt, - alpine, or - elm. Dozens of graphical - programs are also available in the Ports Collection, - including Claws Mail, - Evolution, and - Thunderbird. Some - organizations provide a web mail program which can be - accessed through a web browser. More information about - installing and using a MUA on FreeBSD can - be found in . - - - - - 郵件傳輸代理程式 (Mail Transfer Agent, MTA) - - The Mail Transfer Agent (MTA) is - responsible for receiving incoming mail and delivering - outgoing mail. FreeBSD ships with - Sendmail as the default - MTA, but it also supports numerous - other mail server daemons, including - Exim, - Postfix, and - qmail. - Sendmail configuration is - described in . If another - MTA is installed using the Ports - Collection, refer to its post-installation message for - FreeBSD-specific configuration details and the application's - website for more general configuration - instructions. - - - - - 郵件主機 (Mail Host) 與郵件信箱 (Mailbox) - - The mail host is a server that is responsible for - delivering and receiving mail for a host or a network. - The mail host collects all mail sent to the domain and - stores it either in the default mbox - or the alternative Maildir format, depending on the - configuration. Once mail has been stored, it may either - be read locally using a MUA or remotely - accessed and collected using protocols such as - POP or IMAP. If - mail is read locally, a POP or - IMAP server does not need to be - installed. - - To access mailboxes remotely, a POP - or IMAP server is required as these - protocols allow users to connect to their mailboxes from - remote locations. IMAP offers several - advantages over POP. These include the - ability to store a copy of messages on a remote server - after they are downloaded and concurrent updates. - IMAP can be useful over low-speed links - as it allows users to fetch the structure of messages - without downloading them. It can also perform tasks such - as searching on the server in order to minimize data - transfer between clients and servers. - - Several POP and - IMAP servers are available in the Ports - Collection. These include - mail/qpopper, - mail/imap-uw, - mail/courier-imap, and - mail/dovecot2. - - - It should be noted that both POP - and IMAP transmit information, - including username and password credentials, in - clear-text. To secure the transmission of information - across these protocols, consider tunneling sessions over - ssh1 () - or using SSL (). - - - - - - 網域名稱系統 (DNS) - - The Domain Name System (DNS) and - its daemon named play a large role in - the delivery of email. In order to deliver mail from one - site to another, the MTA will look up - the remote site in DNS to determine - which host will receive mail for the destination. This - process also occurs when mail is sent from a remote host - to the MTA. - - In addition to mapping hostnames to - IP addresses, DNS is - responsible for storing information specific to mail - delivery, known as Mail eXchanger - MX records. The MX - record specifies which hosts will receive mail for a - particular domain. - - To view the MX records for a - domain, specify the type of record. Refer to - host1, for more details about this command: - - % host -t mx FreeBSD.org -FreeBSD.org mail is handled by 10 mx1.FreeBSD.org - - Refer to for more - information about DNS and its - configuration. - - - - - - - - <application>Sendmail</application> 設定檔 - - - - - Christopher - Shumway - - Contributed by - - - - - - Sendmail - - - Sendmail is the default - MTA installed with FreeBSD. It accepts mail - from MUAs and delivers it to the appropriate - mail host, as defined by its configuration. - Sendmail can also accept network - connections and deliver mail to local mailboxes or to another - program. - - The configuration files for - Sendmail are located in - /etc/mail. This section describes these - files in more detail. - - - /etc/mail/access - - - /etc/mail/aliases - - - /etc/mail/local-host-names - - - /etc/mail/mailer.conf - - - /etc/mail/mailertable - - - /etc/mail/sendmail.cf - - - /etc/mail/virtusertable - - - - - /etc/mail/access - - This access database file defines which hosts or - IP addresses have access to the local - mail server and what kind of access they have. Hosts - listed as , which is the default - option, are allowed to send mail to this host as long as - the mail's final destination is the local machine. Hosts - listed as are rejected for all - mail connections. Hosts listed as - are allowed to send mail for any destination using this - mail server. Hosts listed as will - have their mail returned with the specified mail error. - If a host is listed as , - Sendmail will abort the current - search for this entry without accepting or rejecting the - mail. Hosts listed as will - have their messages held and will receive the specified - text as the reason for the hold. - - Examples of using these options for both - IPv4 and IPv6 - addresses can be found in the FreeBSD sample configuration, - /etc/mail/access.sample: - - # $FreeBSD$ -# -# Mail relay access control list. Default is to reject mail unless the -# destination is local, or listed in /etc/mail/local-host-names -# -## Examples (commented out for safety) -#From:cyberspammer.com ERROR:"550 We don't accept mail from spammers" -#From:okay.cyberspammer.com OK -#Connect:sendmail.org RELAY -#To:sendmail.org RELAY -#Connect:128.32 RELAY -#Connect:128.32.2 SKIP -#Connect:IPv6:1:2:3:4:5:6:7 RELAY -#Connect:suspicious.example.com QUARANTINE:Mail from suspicious host -#Connect:[127.0.0.3] OK -#Connect:[IPv6:1:2:3:4:5:6:7:8] OK - - To configure the access database, use the format shown - in the sample to make entries in - /etc/mail/access, but do not put a - comment symbol (#) in front of the - entries. Create an entry for each host or network whose - access should be configured. Mail senders that match the - left side of the table are affected by the action on the - right side of the table. - - Whenever this file is updated, update its database and - restart Sendmail: - - # makemap hash /etc/mail/access < /etc/mail/access -# service sendmail restart - - - - - /etc/mail/aliases - - This database file contains a list of virtual - mailboxes that are expanded to users, files, programs, or - other aliases. Here are a few entries to illustrate the - file format: - - root: localuser -ftp-bugs: joe,eric,paul -bit.bucket: /dev/null -procmail: "|/usr/local/bin/procmail" - - The mailbox name on the left side of the colon is - expanded to the target(s) on the right. The first entry - expands the root - mailbox to the localuser mailbox, which - is then looked up in the - /etc/mail/aliases database. If no - match is found, the message is delivered to localuser. The second - entry shows a mail list. Mail to ftp-bugs is expanded to - the three local mailboxes joe, eric, and paul. A remote mailbox - could be specified as - user@example.com. The third - entry shows how to write mail to a file, in this case - /dev/null. The last entry - demonstrates how to send mail to a program, - /usr/local/bin/procmail, through a - UNIX pipe. Refer to aliases5 for more - information about the format of this file. - - Whenever this file is updated, run - newaliases to update and initialize the - aliases database. - - - - - /etc/mail/sendmail.cf - - This is the master configuration file for - Sendmail. It controls the - overall behavior of Sendmail, - including everything from rewriting email addresses to - printing rejection messages to remote mail servers. - Accordingly, this configuration file is quite complex. - Fortunately, this file rarely needs to be changed for - standard mail servers. - - The master Sendmail - configuration file can be built from m41 macros - that define the features and behavior of - Sendmail. Refer to - /usr/src/contrib/sendmail/cf/README - for some of the details. - - Whenever changes to this file are made, - Sendmail needs to be restarted - for the changes to take effect. - - - - - /etc/mail/virtusertable - - This database file maps mail addresses for virtual - domains and users to real mailboxes. These mailboxes can - be local, remote, aliases defined in - /etc/mail/aliases, or files. This - allows multiple virtual domains to be hosted on one - machine. - - FreeBSD provides a sample configuration file in - /etc/mail/virtusertable.sample to - further demonstrate its format. The following example - demonstrates how to create custom entries using that - format: - - root@example.com root -postmaster@example.com postmaster@noc.example.net -@example.com joe - - This file is processed in a first match order. When - an email address matches the address on the left, it is - mapped to the local mailbox listed on the right. The - format of the first entry in this example maps a specific - email address to a local mailbox, whereas the format of - the second entry maps a specific email address to a remote - mailbox. Finally, any email address from - example.com which has not matched any - of the previous entries will match the last mapping and be - sent to the local mailbox joe. When - creating custom entries, use this format and add them to - /etc/mail/virtusertable. Whenever - this file is edited, update its database and restart - Sendmail: - - # makemap hash /etc/mail/virtusertable < /etc/mail/virtusertable -# service sendmail restart - - - - - /etc/mail/relay-domains - - In a default FreeBSD installation, - Sendmail is configured to only - send mail from the host it is running on. For example, if - a POP server is available, users will - be able to check mail from remote locations but they will - not be able to send outgoing emails from outside - locations. Typically, a few moments after the attempt, an - email will be sent from MAILER-DAEMON - with a 5.7 Relaying Denied - message. - - The most straightforward solution is to add the - ISP's FQDN to - /etc/mail/relay-domains. If multiple - addresses are needed, add them one per - line: - - your.isp.example.com -other.isp.example.net -users-isp.example.org -www.example.org - - After creating or editing this file, restart - Sendmail with - service sendmail restart. - - Now any mail sent through the system by any host in - this list, provided the user has an account on the system, - will succeed. This allows users to send mail from the - system remotely without opening the system up to relaying - SPAM from the Internet. - - - - - - - - 更改郵件傳輸代理程式 - - - - - Andrew - Boothman - - Written by - - - - - - - Gregory - Neil Shapiro - - Information taken from emails written by - - - - - - email - change mta - - - FreeBSD comes with Sendmail already - installed as the MTA which is in charge of - outgoing and incoming mail. However, the system administrator - can change the system's MTA. A wide choice - of alternative MTAs is available from the - mail category of the FreeBSD Ports - Collection. - - Once a new MTA is installed, configure - and test the new software before replacing - Sendmail. Refer to the documentation - of the new MTA for information on how to - configure the software. - - Once the new MTA is working, use the - instructions in this section to disable - Sendmail and configure FreeBSD to use - the replacement MTA. - - - 關閉 <application>Sendmail</application> - - - If Sendmail's outgoing mail - service is disabled, it is important that it is replaced - with an alternative mail delivery system. Otherwise, system - functions such as periodic8 will be unable to deliver - their results by email. Many parts of the system expect a - functional MTA. If applications continue - to use Sendmail's binaries to try - to send email after they are disabled, mail could go into an - inactive Sendmail queue and - never be delivered. - - - In order to completely disable - Sendmail, add or edit the following - lines in /etc/rc.conf: - - sendmail_enable="NO" -sendmail_submit_enable="NO" -sendmail_outbound_enable="NO" -sendmail_msp_queue_enable="NO" - - To only disable Sendmail's - incoming mail service, use only this entry in - /etc/rc.conf: - - sendmail_enable="NO" - - More information on Sendmail's - startup options is available in rc.sendmail8. - - - - 替換預設的 <acronym>MTA</acronym> - - When a new MTA is installed using the - Ports Collection, its startup script is also installed and - startup instructions are mentioned in its package message. - Before starting the new MTA, stop the - running Sendmail processes. This - example stops all of these services, then starts the - Postfix service: - - # service sendmail stop -# service postfix start - - To start the replacement MTA at system - boot, add its configuration line to - /etc/rc.conf. This entry enables the - Postfix MTA: - - postfix_enable="YES" - - Some extra configuration is needed as - Sendmail is so ubiquitous that some - software assumes it is already installed and configured. - Check /etc/periodic.conf and make sure - that these values are set to NO. If this - file does not exist, create it with these entries: - - daily_clean_hoststat_enable="NO" -daily_status_mail_rejects_enable="NO" -daily_status_include_submit_mailq="NO" -daily_submit_queuerun="NO" - - Some alternative MTAs provide their own - compatible implementations of the - Sendmail command-line interface in - order to facilitate using them as drop-in replacements for - Sendmail. However, some - MUAs may try to execute standard - Sendmail binaries instead of the - new MTA's binaries. FreeBSD uses - /etc/mail/mailer.conf to map the expected - Sendmail binaries to the location - of the new binaries. More information about this mapping can - be found in mailwrapper8. - - The default /etc/mail/mailer.conf - looks like this: - - # $FreeBSD$ -# -# Execute the "real" sendmail program, named /usr/libexec/sendmail/sendmail -# -sendmail /usr/libexec/sendmail/sendmail -send-mail /usr/libexec/sendmail/sendmail -mailq /usr/libexec/sendmail/sendmail -newaliases /usr/libexec/sendmail/sendmail -hoststat /usr/libexec/sendmail/sendmail -purgestat /usr/libexec/sendmail/sendmail - - When any of the commands listed on the left are run, the - system actually executes the associated command shown on the - right. This system makes it easy to change what binaries are - executed when these default binaries are invoked. - - Some MTAs, when installed using the - Ports Collection, will prompt to update this file for the new - binaries. For example, Postfix - will update the file like this: - - # -# Execute the Postfix sendmail program, named /usr/local/sbin/sendmail -# -sendmail /usr/local/sbin/sendmail -send-mail /usr/local/sbin/sendmail -mailq /usr/local/sbin/sendmail -newaliases /usr/local/sbin/sendmail - - If the installation of the MTA does - not automatically update - /etc/mail/mailer.conf, edit this file in - a text editor so that it points to the new binaries. This - example points to the binaries installed by - mail/ssmtp: - - sendmail /usr/local/sbin/ssmtp -send-mail /usr/local/sbin/ssmtp -mailq /usr/local/sbin/ssmtp -newaliases /usr/local/sbin/ssmtp -hoststat /usr/bin/true -purgestat /usr/bin/true - - Once everything is configured, it is recommended to reboot - the system. Rebooting provides the opportunity to ensure that - the system is correctly configured to start the new - MTA automatically on boot. - - - - - 疑難排解 - - - email - troubleshooting - - - - - - Why do I have to use the FQDN for hosts on my - site? - - - - The host may actually be in a different domain. For - example, in order for a host in foo.bar.edu to reach a - host called mumble in the - bar.edu - domain, refer to it by the Fully-Qualified Domain Name - FQDN, mumble.bar.edu, - instead of just mumble. - - This is because the version of - BIND - BIND which ships with FreeBSD - no longer provides default abbreviations for non-FQDNs - other than the local domain. An unqualified host such as - mumble must either be found as - mumble.foo.bar.edu, or - it will be searched for in the root domain. - - In older versions of BIND, - the search continued across mumble.bar.edu, and - mumble.edu. - RFC 1535 details why this is considered bad practice or - even a security hole. - - As a good workaround, place the line: - - search foo.bar.edu bar.edu - - instead of the previous: - - domain foo.bar.edu - - into /etc/resolv.conf. However, - make sure that the search order does not go beyond the - boundary between local and public - administration, as RFC 1535 calls it. - - - - - - How can I run a mail server on a dial-up PPP - host? - - - - Connect to a FreeBSD mail gateway on the LAN. The PPP - connection is non-dedicated. - - One way to do this is to get a full-time Internet - server to provide secondary - MX - MX record - services for the domain. In this example, the domain is - example.com - and the ISP has configured - example.net - to provide secondary MX services to the - domain: - - example.com. MX 10 example.com. - MX 20 example.net. - - Only one host should be specified as the final - recipient. For Sendmail, add - Cw example.com in - /etc/mail/sendmail.cf on example.com. - - When the sending MTA attempts - to deliver mail, it will try to connect to the system, - example.com, - over the PPP link. This will time out if the destination - is offline. The MTA will automatically - deliver it to the secondary MX site at - the Internet Service Provider (ISP), - example.net. - The secondary MX site will periodically - try to connect to the primary MX host, - example.com. - - Use something like this as a login script: - - #!/bin/sh -# Put me in /usr/local/bin/pppmyisp -( sleep 60 ; /usr/sbin/sendmail -q ) & -/usr/sbin/ppp -direct pppmyisp - - When creating a separate login script for users, - instead use sendmail -qRexample.com in - the script above. This will force all mail in the queue - for - example.com - to be processed immediately. - - A further refinement of the situation can be seen from - this example from the FreeBSD Internet service provider's mailing list: - - > we provide the secondary MX for a customer. The customer connects to -> our services several times a day automatically to get the mails to -> his primary MX (We do not call his site when a mail for his domains -> arrived). Our sendmail sends the mailqueue every 30 minutes. At the -> moment he has to stay 30 minutes online to be sure that all mail is -> gone to the primary MX. -> -> Is there a command that would initiate sendmail to send all the mails -> now? The user has not root-privileges on our machine of course. - -In the privacy flags section of sendmail.cf, there is a -definition Opgoaway,restrictqrun - -Remove restrictqrun to allow non-root users to start the queue processing. -You might also like to rearrange the MXs. We are the 1st MX for our -customers like this, and we have defined: - -# If we are the best MX for a host, try directly instead of generating -# local config error. -OwTrue - -That way a remote site will deliver straight to you, without trying -the customer connection. You then send to your customer. Only works for -hosts, so you need to get your customer to name their mail -machine customer.com as well as -hostname.customer.com in the DNS. Just put an A record in -the DNS for customer.com. - - - - - - - 進階主題 - - This section covers more involved topics such as mail - configuration and setting up mail for an entire domain. - - - 基礎設定 - - - email - configuration - - - Out of the box, one can send email to external hosts as - long as /etc/resolv.conf is configured or - the network has access to a configured DNS - server. To have email delivered to the MTA - on the FreeBSD host, do one of the following: - - - - Run a DNS server for the - domain. - - - - Get mail delivered directly to the - FQDN for the machine. - - - - SMTP - In order to have mail delivered directly to a host, it - must have a permanent static IP address, not a dynamic IP - address. If the system is behind a firewall, it must be - configured to allow SMTP traffic. To receive mail directly at - a host, one of these two must be configured: - - - - Make sure that the lowest-numbered - MXMX - record record in - DNS points to the host's static IP - address. - - - - Make sure there is no MX entry in - the DNS for the host. - - - - Either of the above will allow mail to be received - directly at the host. - - Try this: - - # hostname -example.FreeBSD.org -# host example.FreeBSD.org -example.FreeBSD.org has address 204.216.27.XX - - In this example, mail sent directly to - yourlogin@example.FreeBSD.org - should work without problems, assuming - Sendmail is running correctly on - example.FreeBSD.org. - - For this example: - - # host example.FreeBSD.org -example.FreeBSD.org has address 204.216.27.XX -example.FreeBSD.org mail is handled (pri=10) by nevdull.FreeBSD.org - - All mail sent to example.FreeBSD.org will - be collected on hub under the same - username instead of being sent directly to your host. - - The above information is handled by the - DNS server. The DNS - record that carries mail routing information is the - MX entry. If no MX - record exists, mail will be delivered directly to the host by - way of its IP address. - - The MX entry for freefall.FreeBSD.org at - one time looked like this: - - freefall MX 30 mail.crl.net -freefall MX 40 agora.rdrop.com -freefall MX 10 freefall.FreeBSD.org -freefall MX 20 who.cdrom.com - - freefall had many - MX entries. The lowest - MX number is the host that receives mail - directly, if available. If it is not accessible for some - reason, the next lower-numbered host will accept messages - temporarily, and pass it along when a lower-numbered host - becomes available. - - Alternate MX sites should have separate - Internet connections in order to be most useful. Your - ISP can provide this service. - - - - 網域中的郵件 - - When configuring a MTA for a network, - any mail sent to hosts in its domain should be diverted to the - MTA so that users can receive their mail on - the master mail server. - - DNS - To make life easiest, a user account with the same - username should exist on both the - MTA and the system with the - MUA. Use adduser8 to create the - user accounts. - - The MTA must be the designated mail - exchanger for each workstation on the network. This is done - in theDNS configuration with an - MX record: - - example.FreeBSD.org A 204.216.27.XX ; Workstation - MX 10 nevdull.FreeBSD.org ; Mailhost - - This will redirect mail for the workstation to the - MTA no matter where the A record points. - The mail is sent to the MX host. - - This must be configured on a DNS - server. If the network does not run its own - DNS server, talk to the - ISP or DNS - provider. - - The following is an example of virtual email hosting. - Consider a customer with the domain customer1.org, where all - the mail for customer1.org should be - sent to mail.myhost.com. The - DNS entry should look like this: - - customer1.org MX 10 mail.myhost.com - - An A> record is - not needed for customer1.org in order to - only handle email for that domain. However, running - ping against customer1.org will not - work unless an A record exists for - it. - - Tell the MTA which domains and/or - hostnames it should accept mail for. Either of the following - will work for Sendmail: - - - - Add the hosts to - /etc/mail/local-host-names when - using the FEATURE(use_cw_file). - - - - Add a Cwyour.host.com line to - /etc/sendmail.cf. - - - - - - - - 寄件設定 - - - - - Bill - Moran - - Contributed by - - - - - There are many instances where one may only want to send - mail through a relay. Some examples are: - - - - The computer is a desktop machine that needs to use - programs such as mail1, using the - ISP's mail relay. - - - - The computer is a server that does not handle mail - locally, but needs to pass off all mail to a relay for - processing. - - - - While any MTA is capable of filling - this particular niche, it can be difficult to properly configure - a full-featured MTA just to handle offloading - mail. Programs such as Sendmail and - Postfix are overkill for this - use. - - Additionally, a typical Internet access service agreement - may forbid one from running a mail server. - - The easiest way to fulfill those needs is to install the - mail/ssmtp port: - - # cd /usr/ports/mail/ssmtp -# make install replace clean - - Once installed, mail/ssmtp can be - configured with - /usr/local/etc/ssmtp/ssmtp.conf: - - root=yourrealemail@example.com -mailhub=mail.example.com -rewriteDomain=example.com -hostname=_HOSTNAME_ - - Use the real email address for root. Enter the - ISP's outgoing mail relay in place of - mail.example.com. - Some ISPs call this the outgoing mail - server or SMTP server. - - Make sure to disable Sendmail, - including the outgoing mail service. See for details. - - mail/ssmtp has some other options - available. Refer to the examples in - /usr/local/etc/ssmtp or the manual page - of ssmtp for more information. - - Setting up ssmtp in this manner - allows any software on the computer that needs to send mail to - function properly, while not violating the - ISP's usage policy or allowing the computer - to be hijacked for spamming. - - - - 在撥號連線使用郵件 - - When using a static IP address, one should not need to - adjust the default configuration. Set the hostname to the - assigned Internet name and Sendmail - will do the rest. - - When using a dynamically assigned IP address and a dialup - PPP connection to the Internet, one usually has a mailbox on the - ISP's mail server. In this example, the - ISP's domain is example.net, the user name - is user, the hostname - is bsd.home, and - the ISP has allowed relay.example.net as a mail - relay. - - In order to retrieve mail from the ISP's - mailbox, install a retrieval agent from the Ports Collection. - mail/fetchmail is a good choice as it - supports many different protocols. Usually, the - ISP will provide POP. - When using user PPP, email can be - automatically fetched when an Internet connection is established - with the following entry in - /etc/ppp/ppp.linkup: - - MYADDR: -!bg su user -c fetchmail - - When using Sendmail to deliver - mail to non-local accounts, configure - Sendmail to process the mail queue as - soon as the Internet connection is established. To do this, add - this line after the above fetchmail entry in - /etc/ppp/ppp.linkup: - - !bg su user -c "sendmail -q" - - In this example, there is an account for - user on bsd.home. In the home - directory of user on - bsd.home, create a - .fetchmailrc which contains this - line: - - poll example.net protocol pop3 fetchall pass MySecret - - This file should not be readable by anyone except - user as it contains - the password MySecret. - - In order to send mail with the correct - from: header, configure - Sendmail to use - user@example.net rather than user@bsd.home and to send all mail via - relay.example.net, - allowing quicker mail transmission. - - The following .mc should - suffice: - - VERSIONID(`bsd.home.mc version 1.0') -OSTYPE(bsd4.4)dnl -FEATURE(nouucp)dnl -MAILER(local)dnl -MAILER(smtp)dnl -Cwlocalhost -Cwbsd.home -MASQUERADE_AS(`example.net')dnl -FEATURE(allmasquerade)dnl -FEATURE(masquerade_envelope)dnl -FEATURE(nocanonify)dnl -FEATURE(nodns)dnl -define(`SMART_HOST', `relay.example.net') -Dmbsd.home -define(`confDOMAIN_NAME',`bsd.home')dnl -define(`confDELIVERY_MODE',`deferred')dnl - - Refer to the previous section for details of how to convert - this file into the sendmail.cf format. Do - not forget to restart Sendmail after - updating sendmail.cf. - - - - - SMTP 認證 - - - - - James - Gorham - - Written by - - - - - Configuring SMTP authentication on the - MTA provides a number of benefits. - SMTP authentication adds a layer - of security to Sendmail, and provides - mobile users who switch hosts the ability to use the same - MTA without the need to reconfigure their - mail client's settings each time. - - - - Install security/cyrus-sasl2 - from the Ports Collection. This port supports a number of - compile-time options. For the SMTP authentication method - demonstrated in this example, make sure that - is not disabled. - - - - - After installing - security/cyrus-sasl2, edit - /usr/local/lib/sasl2/Sendmail.conf, - or create it if it does not exist, and add the following - line: - - pwcheck_method: saslauthd - - - - Next, install - security/cyrus-sasl2-saslauthd and add - the following line to - /etc/rc.conf: - - saslauthd_enable="YES" - - Finally, start the saslauthd daemon: - - # service saslauthd start - - This daemon serves as a broker for - Sendmail to authenticate against - the FreeBSD passwd5 database. This saves the trouble of - creating a new set of usernames and passwords for each user - that needs to use SMTP authentication, - and keeps the login and mail password the same. - - - - Next, edit /etc/make.conf and add - the following lines: - - SENDMAIL_CFLAGS=-I/usr/local/include/sasl -DSASL -SENDMAIL_LDFLAGS=-L/usr/local/lib -SENDMAIL_LDADD=-lsasl2 - - These lines provide Sendmail - the proper configuration options for linking to - cyrus-sasl2 at compile time. Make sure - that cyrus-sasl2 has been installed - before recompiling - Sendmail. - - - - Recompile Sendmail by - executing the following commands: - - # cd /usr/src/lib/libsmutil -# make cleandir && make obj && make -# cd /usr/src/lib/libsm -# make cleandir && make obj && make -# cd /usr/src/usr.sbin/sendmail -# make cleandir && make obj && make && make install - - This compile should not have any problems if - /usr/src has not changed extensively - and the shared libraries it needs are available. - - - - After Sendmail has been - compiled and reinstalled, edit - /etc/mail/freebsd.mc or the local - .mc. Many administrators choose - to use the output from hostname1 as the name of - .mc for uniqueness. Add these - lines: - - dnl set SASL options -TRUST_AUTH_MECH(`GSSAPI DIGEST-MD5 CRAM-MD5 LOGIN')dnl -define(`confAUTH_MECHANISMS', `GSSAPI DIGEST-MD5 CRAM-MD5 LOGIN')dnl - - These options configure the different methods available - to Sendmail for authenticating - users. To use a method other than - pwcheck, refer to the - Sendmail documentation. - - - - Finally, run make1 while in - /etc/mail. That will run the new - .mc and create a - .cf named either - freebsd.cf or the name used for the - local .mc. Then, run make - install restart, which will copy the file to - sendmail.cf, and properly restart - Sendmail. For more information - about this process, refer to - /etc/mail/Makefile. - - - - To test the configuration, use a MUA to - send a test message. For further investigation, set the - of Sendmail - to 13 and watch - /var/log/maillog for any errors. - - For more information, refer to - SMTP authentication. - - - - - 郵件使用者代理程式 - - - - - Marc - Silver - - Contributed by - - - - - - Mail User Agents - - - A MUA is an application that is used to - send and receive email. As email evolves and - becomes more complex, MUAs are becoming - increasingly powerful and provide users increased functionality - and flexibility. The mail category of the - FreeBSD Ports Collection contains numerous MUAs. - These include graphical email clients such as - Evolution or - Balsa and console based clients such - as mutt or - alpine. - - - <command>mail</command> - - mail1 is the default - MUA installed with FreeBSD. It is a console - based MUA that offers the basic - functionality required to send and receive text-based email. - It provides limited attachment support and can only access - local mailboxes. - - Although mail does not natively support - interaction with POP or - IMAP servers, these mailboxes may be - downloaded to a local mbox using an - application such as - fetchmail. - - In order to send and receive email, run - mail: - - % mail - - The contents of the user's mailbox in - /var/mail are automatically read by - mail. Should the mailbox be empty, the - utility exits with a message indicating that no mail could - be found. If mail exists, the application interface starts, - and a list of messages will be displayed. Messages are - automatically numbered, as can be seen in the following - example: - - Mail version 8.1 6/6/93. Type ? for help. -"/var/mail/marcs": 3 messages 3 new ->N 1 root@localhost Mon Mar 8 14:05 14/510 "test" - N 2 root@localhost Mon Mar 8 14:05 14/509 "user account" - N 3 root@localhost Mon Mar 8 14:05 14/509 "sample" - - Messages can now be read by typing t - followed by the message number. This example reads the first - email: - - & t 1 -Message 1: -From root@localhost Mon Mar 8 14:05:52 2004 -X-Original-To: marcs@localhost -Delivered-To: marcs@localhost -To: marcs@localhost -Subject: test -Date: Mon, 8 Mar 2004 14:05:52 +0200 (SAST) -From: root@localhost (Charlie Root) - -This is a test message, please reply if you receive it. - - As seen in this example, the message will be displayed - with full headers. To display the list of messages again, - press h. - - If the email requires a reply, press either - R or r - mail keys. R instructs - mail to reply only to the sender of the - email, while r replies to all other - recipients of the message. These commands can be suffixed - with the mail number of the message to reply to. After typing - the response, the end of the message should be marked by a - single . on its own line. An example can be - seen below: - - & R 1 -To: root@localhost -Subject: Re: test - -Thank you, I did get your email. -. -EOT - - In order to send a new email, press m, - followed by the recipient email address. Multiple recipients - may be specified by separating each address with the - , delimiter. The subject of the message may - then be entered, followed by the message contents. The end of - the message should be specified by putting a single - . on its own line. - - & mail root@localhost -Subject: I mastered mail - -Now I can send and receive email using mail ... :) -. -EOT - - While using mail, press - ? to display help at any time. Refer to - mail1 for more help on how to use - mail. - - - mail1 was not designed to handle attachments and - thus deals with them poorly. Newer MUAs - handle attachments in a more intelligent way. Users who - prefer to use mail may find the - converters/mpack port to be of - considerable use. - - - - - <application>mutt</application> - - mutt is a powerful - MUA, with many features, including: - - - - The ability to thread messages. - - - - PGP support for digital signing and encryption of - email. - - - - MIME support. - - - - Maildir support. - - - - Highly customizable. - - - - Refer to http://www.mutt.org - for more information on - mutt. - - mutt may be installed using the - mail/mutt port. After the port has been - installed, mutt can be started by - issuing the following command: - - % mutt - - mutt will automatically read - and display the contents of the user mailbox in - /var/mail. If no mails are found, - mutt will wait for commands from - the user. The example below shows - mutt displaying a list of - messages: - - - - - - - - To read an email, select it using the cursor keys and - press Enter. An example of - mutt displaying email can be seen - below: - - - - - - - - Similar to mail1, mutt - can be used to reply only to the sender of the message as well - as to all recipients. To reply only to the sender of the - email, press r. To send a group reply - to the original sender as well as all the message recipients, - press g. - - - By default, mutt uses the - vi1 editor for creating and replying to emails. Each - user can customize this by creating or editing the - .muttrc in their home directory and - setting the editor variable or by setting - the EDITOR environment variable. Refer to - http://www.mutt.org/ - for more information about configuring - mutt. - - - To compose a new mail message, press - m. After a valid subject has been given, - mutt will start vi1 so the - email can be written. Once the contents of the email are - complete, save and quit from vi. - mutt will resume, displaying a - summary screen of the mail that is to be delivered. In - order to send the mail, press y. An example - of the summary screen can be seen below: - - - - - - - - mutt contains extensive help - which can be accessed from most of the menus by pressing - ?. The top line also displays the keyboard - shortcuts where appropriate. - - - - - <application>alpine</application> - - alpine is aimed at a beginner - user, but also includes some advanced features. - - - alpine has had several remote - vulnerabilities discovered in the past, which allowed remote - attackers to execute arbitrary code as users on the local - system, by the action of sending a specially-prepared email. - While known problems have been fixed, - alpine code is written in an - insecure style and the FreeBSD Security Officer believes there - are likely to be other undiscovered vulnerabilities. Users - install alpine at their own - risk. - - - The current version of alpine - may be installed using the mail/alpine - port. Once the port has installed, - alpine can be started by issuing - the following command: - - % alpine - - The first time alpine - runs, it displays a greeting page with a brief introduction, - as well as a request from the - alpine development team to send - an anonymous email message allowing them to judge how many - users are using their client. To send this anonymous message, - press Enter. Alternatively, press - E to exit the greeting without sending an - anonymous message. An example of the greeting page is - shown below: - - - - - - - - The main menu is then presented, which can be navigated - using the cursor keys. This main menu provides shortcuts for - the composing new mails, browsing mail directories, and - administering address book entries. Below the main menu, - relevant keyboard shortcuts to perform functions specific to - the task at hand are shown. - - The default directory opened by - alpine is - inbox. To view the message index, press - I, or select the - MESSAGE INDEX option shown - below: - - - - - - - - The message index shows messages in the current directory - and can be navigated by using the cursor keys. Highlighted - messages can be read by pressing - Enter. - - - - - - - - In the screenshot below, a sample message is displayed by - alpine. Contextual keyboard - shortcuts are displayed at the bottom of the screen. An - example of one of a shortcut is r, which - tells the MUA to reply to the current - message being displayed. - - - - - - - - Replying to an email in alpine - is done using the pico editor, - which is installed by default with - alpine. - pico makes it easy to navigate the - message and is easier for novice users to use than vi1 - or mail1. Once the reply is complete, the message can - be sent by pressing CtrlX - . alpine will ask for - confirmation before sending the message. - - - - - - - - alpine can be customized using - the SETUP option from the main - menu. Consult http://www.washington.edu/alpine/ - for more information. - - - - - - - 使用 <application>fetchmail</application> - - - - - Marc - Silver - - Contributed by - - - - - - fetchmail - - - fetchmail is a full-featured - IMAP and POP client. It - allows users to automatically download mail from remote - IMAP and POP servers and - save it into local mailboxes where it can be accessed more - easily. fetchmail can be installed - using the mail/fetchmail port, and offers - various features, including: - - - - Support for the POP3, - APOP, KPOP, - IMAP, ETRN and - ODMR protocols. - - - - Ability to forward mail using SMTP, - which allows filtering, forwarding, and aliasing to function - normally. - - - - May be run in daemon mode to check periodically for new - messages. - - - - Can retrieve multiple mailboxes and forward them, based - on configuration, to different local users. - - - - This section explains some of the basic features of - fetchmail. This utility requires a - .fetchmailrc configuration in the user's - home directory in order to run correctly. This file includes - server information as well as login credentials. Due to the - sensitive nature of the contents of this file, it is advisable - to make it readable only by the user, with the following - command: - - % chmod 600 .fetchmailrc - - The following .fetchmailrc serves as an - example for downloading a single user mailbox using - POP. It tells - fetchmail to connect to - example.com using - a username of joesoap - and a password of XXX. This example assumes - that the user joesoap - exists on the local system. - - poll example.com protocol pop3 username "joesoap" password "XXX" - - The next example connects to multiple POP - and IMAP servers and redirects to different - local usernames where applicable: - - poll example.com proto pop3: -user "joesoap", with password "XXX", is "jsoap" here; -user "andrea", with password "XXXX"; -poll example2.net proto imap: -user "john", with password "XXXXX", is "myth" here; - - fetchmail can be run in daemon - mode by running it with , followed by the - interval (in seconds) that fetchmail - should poll servers listed in .fetchmailrc. - The following example configures - fetchmail to poll every 600 - seconds: - - % fetchmail -d 600 - - More information on fetchmail can - be found at http://www.fetchmail.info/. - - - - - 使用 <application>procmail</application> - - - - - Marc - Silver - - Contributed by - - - - - - procmail - - - procmail is a powerful - application used to filter incoming mail. It allows users to - define rules which can be matched to incoming - mails to perform specific functions or to reroute mail to - alternative mailboxes or email addresses. - procmail can be installed using the - mail/procmail port. Once installed, it can - be directly integrated into most MTAs. - Consult the MTA documentation for more - information. Alternatively, procmail - can be integrated by adding the following line to a - .forward in the home directory of the - user: - - "|exec /usr/local/bin/procmail || exit 75" - - The following section displays some basic - procmail rules, as well as brief - descriptions of what they do. Rules must be inserted into a - .procmailrc, which must reside in the - user's home directory. - - The majority of these rules can be found in - procmailex5. - - To forward all mail from user@example.com to - an external address of goodmail@example2.com: - - :0 -* ^From.*user@example.com -! goodmail@example2.com - - To forward all mails shorter than 1000 bytes to an external - address of goodmail@example2.com: - - :0 -* < 1000 -! goodmail@example2.com - - To send all mail sent to - alternate@example.com to a mailbox called - alternate: - - :0 -* ^TOalternate@example.com -alternate - - To send all mail with a subject of Spam to - /dev/null: - - :0 -^Subject:.*Spam -/dev/null - - A useful recipe that parses incoming FreeBSD.org mailing lists and - places each list in its own mailbox: - - :0 -* ^Sender:.owner-freebsd-\/[^@]+@FreeBSD.ORG -{ - LISTNAME=${MATCH} - :0 - * LISTNAME??^\/[^@]+ - FreeBSD-${MATCH} -} - - - - - - - - - 網路伺服器 - - - 概述 - - 本章節涵蓋一些在 UNIX 系統常用的網路服務,包含安裝、設定、測試及維護各種不同類型的網路服務。本章會提供範例設定檔以供參考。 - - 讀完本章,您將了解: - - - - 如何管理 inetd Daemon。 - - - - 如何設定網路檔案系統 (Network File System, NFS)。 - - - - 如何設定網路資訊伺服器 (Network Information Server, NIS) 來集中管理及共用使用者帳號。 - - - - 如何設定 FreeBSD 成為 LDAP 伺服器或客戶端 - - - - 如何設定使用 DHCP 自動網路設定。 - - - - 如何設定網域名稱伺服器 (Domain Name Server, DNS)。 - - - - 如何設定 Apache HTTP 伺服器。 - - - - 如何設定檔案傳輸協定 (File Transfer Protocol, FTP) 伺服器。 - - - - 如何設定 Samba 檔案與列印伺服器供 Windows 客戶端使用。 - - - - 如何同步時間與日期,並使用網路時間協定 (Network Time Protocol, NTP) 設定時間伺服器。 - - - - 如何設定 iSCSI - - - - 本章假設您有以下基礎知識: - - - - /etc/rc Script。 - - - - 網路術語。 - - - - 安裝其他第三方軟體 ()。 - - - - - - <application>inetd</application> 超級伺服器 - - - - The inetd8 daemon is sometimes referred to as a - Super-Server because it manages connections for many services. - Instead of starting multiple applications, only the - inetd service needs to be started. - When a connection is received for a service that is managed by - inetd, it determines which program - the connection is destined for, spawns a process for that - program, and delegates the program a socket. Using - inetd for services that are not - heavily used can reduce system load, when compared to running - each daemon individually in stand-alone mode. - - Primarily, inetd is used to - spawn other daemons, but several trivial protocols are handled - internally, such as chargen, - auth, - time, - echo, - discard, and - daytime. - - This section covers the basics of configuring - inetd. - - - 設定檔 - - Configuration of inetd is - done by editing /etc/inetd.conf. Each - line of this configuration file represents an application - which can be started by inetd. By - default, every line starts with a comment - (#), meaning that - inetd is not listening for any - applications. To configure inetd - to listen for an application's connections, remove the - # at the beginning of the line for that - application. - - After saving your edits, configure - inetd to start at system boot by - editing /etc/rc.conf: - - inetd_enable="YES" - - To start inetd now, so that it - listens for the service you configured, type: - - # service inetd start - - Once inetd is started, it needs - to be notified whenever a modification is made to - /etc/inetd.conf: - - - 重新庫入 <application>inetd</application> 設定檔 - - # service inetd reload - - - Typically, the default entry for an application does not - need to be edited beyond removing the #. - In some situations, it may be appropriate to edit the default - entry. - - As an example, this is the default entry for ftpd8 - over IPv4: - - ftp stream tcp nowait root /usr/libexec/ftpd ftpd -l - - The seven columns in an entry are as follows: - - service-name -socket-type -protocol -{wait|nowait}[/max-child[/max-connections-per-ip-per-minute[/max-child-per-ip]]] -user[:group][/login-class] -server-program -server-program-arguments - - where: - - - - service-name - - - The service name of the daemon to start. It must - correspond to a service listed in - /etc/services. This determines - which port inetd listens on - for incoming connections to that service. When using a - custom service, it must first be added to - /etc/services. - - - - - socket-type - - - Either stream, - dgram, raw, or - seqpacket. Use - stream for TCP connections and - dgram for - UDP services. - - - - - protocol - - - Use one of the following protocol names: - - - - - - Protocol Name - Explanation - - - - - - tcp or tcp4 - TCP IPv4 - - - - udp or udp4 - UDP IPv4 - - - - tcp6 - TCP IPv6 - - - - udp6 - UDP IPv6 - - - - tcp46 - Both TCP IPv4 and IPv6 - - - - udp46 - Both UDP IPv4 and - IPv6 - - - - - - - - - {wait|nowait}[/max-child[/max-connections-per-ip-per-minute[/max-child-per-ip]]] - - - In this field, or - must be specified. - , - and - are optional. - - indicates whether or - not the service is able to handle its own socket. - socket types must use - while - daemons, which are usually - multi-threaded, should use . - usually hands off multiple sockets - to a single daemon, while spawns - a child daemon for each new socket. - - The maximum number of child daemons - inetd may spawn is set by - . For example, to limit ten - instances of the daemon, place a /10 - after . Specifying - /0 allows an unlimited number of - children. - - - limits the number of connections from any particular - IP address per minute. Once the - limit is reached, further connections from this IP - address will be dropped until the end of the minute. - For example, a value of /10 would - limit any particular IP address to - ten connection attempts per minute. - limits the number of - child processes that can be started on behalf on any - single IP address at any moment. - These options can limit excessive resource consumption - and help to prevent Denial of Service attacks. - - An example can be seen in the default settings for - fingerd8: - - finger stream tcp nowait/3/10 nobody /usr/libexec/fingerd fingerd -k -s - - - - - user - - - The username the daemon - will run as. Daemons typically run as - root, - daemon, or - nobody. - - - - - server-program - - - The full path to the daemon. If the daemon is a - service provided by inetd - internally, use . - - - - - server-program-arguments - - - Used to specify any command arguments to be passed - to the daemon on invocation. If the daemon is an - internal service, use - . - - - - - - - 指令列選項 - - Like most server daemons, inetd - has a number of options that can be used to modify its - behavior. By default, inetd is - started with -wW -C 60. These options - enable TCP wrappers for all services, including internal - services, and prevent any IP address from - requesting any service more than 60 times per minute. - - To change the default options which are passed to - inetd, add an entry for - inetd_flags in - /etc/rc.conf. If - inetd is already running, restart - it with service inetd restart. - - The available rate limiting options are: - - - - -c maximum - - - Specify the default maximum number of simultaneous - invocations of each service, where the default is - unlimited. May be overridden on a per-service basis by - using in - /etc/inetd.conf. - - - - - -C rate - - - Specify the default maximum number of times a - service can be invoked from a single - IP address per minute. May be - overridden on a per-service basis by using - in - /etc/inetd.conf. - - - - - -R rate - - - Specify the maximum number of times a service can be - invoked in one minute, where the default is - 256. A rate of 0 - allows an unlimited number. - - - - - -s maximum - - - Specify the maximum number of times a service can be - invoked from a single IP address at - any one time, where the default is unlimited. May be - overridden on a per-service basis by using - in - /etc/inetd.conf. - - - - - Additional options are available. Refer to inetd8 - for the full list of options. - - - - 安全注意事項 - - Many of the daemons which can be managed by - inetd are not security-conscious. - Some daemons, such as fingerd, can - provide information that may be useful to an attacker. Only - enable the services which are needed and monitor the system - for excessive connection attempts. - max-connections-per-ip-per-minute, - max-child and - max-child-per-ip can be used to limit such - attacks. - - By default, TCP wrappers is enabled. Consult - hosts_access5 for more information on placing TCP - restrictions on various - inetd invoked daemons. - - - - - - 網路檔案系統 (NFS) - - - - - Tom - Rhodes - - Reorganized and enhanced by - - - - - - - Bill - Swingle - - Written by - - - - - NFS - FreeBSD supports the Network File System - (NFS), which allows a server to share - directories and files with clients over a network. With - NFS, users and programs can access files on - remote systems as if they were stored locally. - - NFS has many practical uses. Some of - the more common uses include: - - - - Data that would otherwise be duplicated on each client - can be kept in a single location and accessed by clients - on the network. - - - - Several clients may need access to the - /usr/ports/distfiles directory. - Sharing that directory allows for quick access to the - source files without having to download them to each - client. - - - - On large networks, it is often more convenient to - configure a central NFS server on which - all user home directories are stored. Users can log into - a client anywhere on the network and have access to their - home directories. - - - - Administration of NFS exports is - simplified. For example, there is only one file system - where security or backup policies must be set. - - - - Removable media storage devices can be used by other - machines on the network. This reduces the number of devices - throughout the network and provides a centralized location - to manage their security. It is often more convenient to - install software on multiple machines from a centralized - installation media. - - - - NFS consists of a server and one or more - clients. The client remotely accesses the data that is stored - on the server machine. In order for this to function properly, - a few processes have to be configured and running. - - These daemons must be running on the server: - - NFS - server - - - file server - UNIX clients - - - - rpcbind - - - mountd - - - nfsd - - - - - - - - - - Daemon - 說明 - - - - - - nfsd - The NFS daemon which services - requests from NFS clients. - - - - mountd - The NFS mount daemon which - carries out requests received from - nfsd. - - - - rpcbind - This daemon allows NFS - clients to discover which port the - NFS server is using. - - - - - - Running nfsiod8 on the client can improve - performance, but is not required. - - - 設定伺服器 - - - NFS - configuration - - - The file systems which the NFS server - will share are specified in /etc/exports. - Each line in this file specifies a file system to be exported, - which clients have access to that file system, and any access - options. When adding entries to this file, each exported file - system, its properties, and allowed hosts must occur on a - single line. If no clients are listed in the entry, then any - client on the network can mount that file system. - - - NFS - export examples - - - The following /etc/exports entries - demonstrate how to export file systems. The examples can be - modified to match the file systems and client names on the - reader's network. There are many options that can be used in - this file, but only a few will be mentioned here. See - exports5 for the full list of options. - - This example shows how to export - /cdrom to three hosts named - alpha, - bravo, and - charlie: - - /cdrom -ro alpha bravo charlie - - The -ro flag makes the file system - read-only, preventing clients from making any changes to the - exported file system. This example assumes that the host - names are either in DNS or in - /etc/hosts. Refer to hosts5 if - the network does not have a DNS - server. - - The next example exports /home to - three clients by IP address. This can be - useful for networks without DNS or - /etc/hosts entries. The - -alldirs flag allows subdirectories to be - mount points. In other words, it will not automatically mount - the subdirectories, but will permit the client to mount the - directories that are required as needed. - - /usr/home -alldirs 10.0.0.2 10.0.0.3 10.0.0.4 - - This next example exports /a so that - two clients from different domains may access that file - system. The allows root on the remote system to - write data on the exported file system as root. If - -maproot=root is not specified, the - client's root user - will be mapped to the server's nobody account and will be - subject to the access limitations defined for nobody. - - /a -maproot=root host.example.com box.example.org - - A client can only be specified once per file system. For - example, if /usr is a single file system, - these entries would be invalid as both entries specify the - same host: - - # Invalid when /usr is one file system -/usr/src client -/usr/ports client - - The correct format for this situation is to use one - entry: - - /usr/src /usr/ports client - - The following is an example of a valid export list, where - /usr and /exports - are local file systems: - - # Export src and ports to client01 and client02, but only -# client01 has root privileges on it -/usr/src /usr/ports -maproot=root client01 -/usr/src /usr/ports client02 -# The client machines have root and can mount anywhere -# on /exports. Anyone in the world can mount /exports/obj read-only -/exports -alldirs -maproot=root client01 client02 -/exports/obj -ro - - To enable the processes required by the - NFS server at boot time, add these options - to /etc/rc.conf: - - rpcbind_enable="YES" -nfs_server_enable="YES" -mountd_flags="-r" - - The server can be started now by running this - command: - - # service nfsd start - - Whenever the NFS server is started, - mountd also starts automatically. - However, mountd only reads - /etc/exports when it is started. To make - subsequent /etc/exports edits take effect - immediately, force mountd to reread - it: - - # service mountd reload - - - - 設定客戶端 - - To enable NFS clients, set this option - in each client's /etc/rc.conf: - - nfs_client_enable="YES" - - Then, run this command on each NFS - client: - - # service nfsclient start - - The client now has everything it needs to mount a remote - file system. In these examples, the server's name is - server and the client's name is - client. To mount - /home on - server to the - /mnt mount point on - client: - - - NFS - mounting - - # mount server:/home /mnt - - The files and directories in - /home will now be available on - client, in the - /mnt directory. - - To mount a remote file system each time the client boots, - add it to /etc/fstab: - - server:/home /mnt nfs rw 0 0 - - Refer to fstab5 for a description of all available - options. - - - - 鎖定 - - Some applications require file locking to operate - correctly. To enable locking, add these lines to - /etc/rc.conf on both the client and - server: - - rpc_lockd_enable="YES" -rpc_statd_enable="YES" - - Then start the applications: - - # service lockd start -# service statd start - - If locking is not required on the server, the - NFS client can be configured to lock - locally by including when running - mount. Refer to mount_nfs8 - for further details. - - - - - 使用 <citerefentry><refentrytitle>amd</refentrytitle><manvolnum>8</manvolnum></citerefentry> 自動掛載 - - - - - Wylie - Stilwell - - Contributed by - - - - - - - Chern - Lee - - Rewritten by - - - - - amd - - automatic mounter daemon - - - The automatic mounter daemon, - amd, automatically mounts a remote - file system whenever a file or directory within that file - system is accessed. File systems that are inactive for a - period of time will be automatically unmounted by - amd. - - This daemon provides an alternative to modifying - /etc/fstab to list every client. It - operates by attaching itself as an NFS - server to the /host and - /net directories. When a file is - accessed within one of these directories, - amd looks up the corresponding - remote mount and automatically mounts it. - /net is used to mount an exported file - system from an IP address while - /host is used to mount an export from a - remote hostname. For instance, an attempt to access a file - within /host/foobar/usr would tell - amd to mount the - /usr export on the host - foobar. - - - 使用 <application>amd</application> 掛載 Export - - In this example, showmount -e shows - the exported file systems that can be mounted from the - NFS server, - foobar: - - % showmount -e foobar -Exports list on foobar: -/usr 10.10.10.0 -/a 10.10.10.0 -% cd /host/foobar/usr - - - The output from showmount shows - /usr as an export. When changing - directories to /host/foobar/usr, - amd intercepts the request and - attempts to resolve the hostname - foobar. If successful, - amd automatically mounts the - desired export. - - To enable amd at boot time, add - this line to /etc/rc.conf: - - amd_enable="YES" - - To start amd now: - - # service amd start - - Custom flags can be passed to - amd from the - amd_flags environment variable. By - default, amd_flags is set to: - - amd_flags="-a /.amd_mnt -l syslog /host /etc/amd.map /net /etc/amd.map" - - The default options with which exports are mounted are - defined in /etc/amd.map. Some of the - more advanced features of amd are - defined in /etc/amd.conf. - - Consult amd8 and amd.conf5 for more - information. - - - - 使用 <citerefentry><refentrytitle>autofs</refentrytitle><manvolnum>5</manvolnum></citerefentry> 自動掛載 - - - The autofs5 automount facility is supported - starting with FreeBSD 10.1-RELEASE. To use the - automounter functionality in older versions of FreeBSD, use - amd8 instead. This chapter only describes the - autofs5 automounter. - - - - autofs - - automounter subsystem - - - The autofs5 facility is a common name for several - components that, together, allow for automatic mounting of - remote and local filesystems whenever a file or directory - within that file system is accessed. It consists of the - kernel component, autofs5, and several userspace - applications: automount8, automountd8 and - autounmountd8. It serves as an alternative for - amd8 from previous FreeBSD releases. Amd is still - provided for backward compatibility purposes, as the two use - different map format; the one used by autofs is the same as - with other SVR4 automounters, such as the ones in Solaris, - MacOS X, and Linux. - - The autofs5 virtual filesystem is mounted on - specified mountpoints by automount8, usually invoked - during boot. - - Whenever a process attempts to access file within the - autofs5 mountpoint, the kernel will notify - automountd8 daemon and pause the triggering process. - The automountd8 daemon will handle kernel requests by - finding the proper map and mounting the filesystem according - to it, then signal the kernel to release blocked process. The - autounmountd8 daemon automatically unmounts automounted - filesystems after some time, unless they are still being - used. - - The primary autofs configuration file is - /etc/auto_master. It assigns individual - maps to top-level mounts. For an explanation of - auto_master and the map syntax, refer to - auto_master5. - - There is a special automounter map mounted on - /net. When a file is accessed within - this directory, autofs5 looks up the corresponding - remote mount and automatically mounts it. For instance, an - attempt to access a file within - /net/foobar/usr would tell - automountd8 to mount the /usr export from the host - foobar. - - - 使用 <citerefentry><refentrytitle>autofs</refentrytitle><manvolnum>5</manvolnum></citerefentry> 掛載 Export - - In this example, showmount -e shows - the exported file systems that can be mounted from the - NFS server, - foobar: - - % showmount -e foobar -Exports list on foobar: -/usr 10.10.10.0 -/a 10.10.10.0 -% cd /net/foobar/usr - - - The output from showmount shows - /usr as an export. - When changing directories to /host/foobar/usr, - automountd8 intercepts the request and attempts to - resolve the hostname foobar. If successful, - automountd8 automatically mounts the source - export. - - To enable autofs5 at boot time, add this line to - /etc/rc.conf: - - autofs_enable="YES" - - Then autofs5 can be started by running: - - # service automount start -# service automountd start -# service autounmountd start - - The autofs5 map format is the same as in other - operating systems. Information about this format from other - sources can be useful, like the Mac - OS X document. - - Consult the automount8, automountd8, - autounmountd8, and auto_master5 manual pages for - more information. - - - - - - 網路資訊系統 (<acronym>NIS</acronym>) - - NIS - Solaris - HP-UX - AIX - Linux - NetBSD - OpenBSD - - yellow pages - NIS - - - Network Information System (NIS) is - designed to centralize administration of UNIX-like systems - such as Solaris, HP-UX, AIX, Linux, NetBSD, OpenBSD, and - FreeBSD. NIS was originally known as Yellow - Pages but the name was changed due to trademark issues. This - is the reason why NIS commands begin with - yp. - - - NIS - domains - - - NIS is a Remote Procedure Call - (RPC)-based client/server system that allows - a group of machines within an NIS domain to - share a common set of configuration files. This permits a - system administrator to set up NIS client - systems with only minimal configuration data and to add, remove, - or modify configuration data from a single location. - - FreeBSD uses version 2 of the NIS - protocol. - - - <acronym>NIS</acronym> 術語與程序 - - Table 28.1 summarizes the terms and important processes - used by NIS: - - - rpcbind - - - portmap - - - - <acronym>NIS</acronym> 術語 - - - - - - - - 術語 - 說明 - - - - - - NIS domain name - - NIS servers and clients share - an NIS domain name. Typically, - this name does not have anything to do with - DNS. - - - - rpcbind8 - - This service enables RPC and - must be running in order to run an - NIS server or act as an - NIS client. - - - - ypbind8 - This service binds an NIS - client to its NIS server. It will - take the NIS domain name and use - RPC to connect to the server. It - is the core of client/server communication in an - NIS environment. If this service - is not running on a client machine, it will not be - able to access the NIS - server. - - - - ypserv8 - This is the process for the - NIS server. If this service stops - running, the server will no longer be able to respond - to NIS requests so hopefully, there - is a slave server to take over. Some non-FreeBSD clients - will not try to reconnect using a slave server and the - ypbind process may need to - be restarted on these - clients. - - - - rpc.yppasswdd8 - This process only runs on - NIS master servers. This daemon - allows NIS clients to change their - NIS passwords. If this daemon is - not running, users will have to login to the - NIS master server and change their - passwords there. - - - -
- -
- - - 主機類型 - - NIS - master server - - NIS - slave server - - NIS - client - - - There are three types of hosts in an - NIS environment: - - - - NIS master server - - This server acts as a central repository for host - configuration information and maintains the - authoritative copy of the files used by all of the - NIS clients. The - passwd, group, - and other various files used by NIS - clients are stored on the master server. While it is - possible for one machine to be an NIS - master server for more than one NIS - domain, this type of configuration will not be covered in - this chapter as it assumes a relatively small-scale - NIS environment. - - - - NIS slave servers - - NIS slave servers maintain copies - of the NIS master's data files in - order to provide redundancy. Slave servers also help to - balance the load of the master server as - NIS clients always attach to the - NIS server which responds - first. - - - - NIS clients - - NIS clients authenticate - against the NIS server during log - on. - - - - Information in many files can be shared using - NIS. The - master.passwd, - group, and hosts - files are commonly shared via NIS. - Whenever a process on a client needs information that would - normally be found in these files locally, it makes a query to - the NIS server that it is bound to - instead. - - - - 規劃注意事項 - - This section describes a sample NIS - environment which consists of 15 FreeBSD machines with no - centralized point of administration. Each machine has its own - /etc/passwd and - /etc/master.passwd. These files are kept - in sync with each other only through manual intervention. - Currently, when a user is added to the lab, the process must - be repeated on all 15 machines. - - The configuration of the lab will be as follows: - - - - - - Machine name - IP 位址 - Machine role - - - - - - ellington - 10.0.0.2 - NIS master - - - - coltrane - 10.0.0.3 - NIS slave - - - - basie - 10.0.0.4 - Faculty workstation - - - - bird - 10.0.0.5 - Client machine - - - - cli[1-11] - - 10.0.0.[6-17] - Other client machines - - - - - - If this is the first time an NIS - scheme is being developed, it should be thoroughly planned - ahead of time. Regardless of network size, several decisions - need to be made as part of the planning process. - - - 選擇 <acronym>NIS</acronym> 網域名稱 - - - NIS - domain name - - When a client broadcasts its requests for info, it - includes the name of the NIS domain that - it is part of. This is how multiple servers on one network - can tell which server should answer which request. Think of - the NIS domain name as the name for a - group of hosts. - - Some organizations choose to use their Internet domain - name for their NIS domain name. This is - not recommended as it can cause confusion when trying to - debug network problems. The NIS domain - name should be unique within the network and it is helpful - if it describes the group of machines it represents. For - example, the Art department at Acme Inc. might be in the - acme-art NIS domain. This - example will use the domain name - test-domain. - - However, some non-FreeBSD operating systems require the - NIS domain name to be the same as the - Internet domain name. If one or more machines on the - network have this restriction, the Internet domain name - must be used as the - NIS domain name. - - - - 實體伺服器需求 - - There are several things to keep in mind when choosing a - machine to use as a NIS server. Since - NIS clients depend upon the availability - of the server, choose a machine that is not rebooted - frequently. The NIS server should - ideally be a stand alone machine whose sole purpose is to be - an NIS server. If the network is not - heavily used, it is acceptable to put the - NIS server on a machine running other - services. However, if the NIS server - becomes unavailable, it will adversely affect all - NIS clients. - - - - - 設定 <acronym>NIS</acronym> Master 伺服器 - - The canonical copies of all NIS files - are stored on the master server. The databases used to store - the information are called NIS maps. In - FreeBSD, these maps are stored in - /var/yp/[domainname] where - [domainname] is the name of the - NIS domain. Since multiple domains are - supported, it is possible to have several directories, one for - each domain. Each domain will have its own independent set of - maps. - - NIS master and slave servers handle all - NIS requests through ypserv8. This - daemon is responsible for receiving incoming requests from - NIS clients, translating the requested - domain and map name to a path to the corresponding database - file, and transmitting data from the database back to the - client. - - NIS - server configuration - - Setting up a master NIS server can be - relatively straight forward, depending on environmental needs. - Since FreeBSD provides built-in NIS support, - it only needs to be enabled by adding the following lines to - /etc/rc.conf: - - nisdomainname="test-domain" -nis_server_enable="YES" -nis_yppasswdd_enable="YES" - - - - This line sets the NIS domain name - to test-domain. - - - - This automates the start up of the - NIS server processes when the system - boots. - - - - This enables the rpc.yppasswdd8 daemon so that - users can change their NIS password - from a client machine. - - - - Care must be taken in a multi-server domain where the - server machines are also NIS clients. It - is generally a good idea to force the servers to bind to - themselves rather than allowing them to broadcast bind - requests and possibly become bound to each other. Strange - failure modes can result if one server goes down and others - are dependent upon it. Eventually, all the clients will time - out and attempt to bind to other servers, but the delay - involved can be considerable and the failure mode is still - present since the servers might bind to each other all over - again. - - A server that is also a client can be forced to bind to a - particular server by adding these additional lines to - /etc/rc.conf: - - nis_client_enable="YES" # run client stuff as well -nis_client_flags="-S NIS domain,server" - - After saving the edits, type - /etc/netstart to restart the network and - apply the values defined in /etc/rc.conf. - Before initializing the NIS maps, start - ypserv8: - - # service ypserv start - - - 初始化 <acronym>NIS</acronym> 對應表 - - - NIS - maps - - NIS maps are generated from the - configuration files in /etc on the - NIS master, with one exception: - /etc/master.passwd. This is to prevent - the propagation of passwords to all the servers in the - NIS domain. Therefore, before the - NIS maps are initialized, configure the - primary password files: - - # cp /etc/master.passwd /var/yp/master.passwd -# cd /var/yp -# vi master.passwd - - It is advisable to remove all entries for system - accounts as well as any user accounts that do not need to be - propagated to the NIS clients, such as - the root and any - other administrative accounts. - - - Ensure that the - /var/yp/master.passwd is neither - group or world readable by setting its permissions to - 600. - - - After completing this task, initialize the - NIS maps. FreeBSD includes the - ypinit8 script to do this. When generating maps - for the master server, include and - specify the NIS domain name: - - ellington# ypinit -m test-domain -Server Type: MASTER Domain: test-domain -Creating an YP server will require that you answer a few questions. -Questions will all be asked at the beginning of the procedure. -Do you want this procedure to quit on non-fatal errors? [y/n: n] n -Ok, please remember to go back and redo manually whatever fails. -If not, something might not work. -At this point, we have to construct a list of this domains YP servers. -rod.darktech.org is already known as master server. -Please continue to add any slave servers, one per line. When you are -done with the list, type a <control D>. -master server : ellington -next host to add: coltrane -next host to add: ^D -The current list of NIS servers looks like this: -ellington -coltrane -Is this correct? [y/n: y] y - -[..output from map generation..] - -NIS Map update completed. -ellington has been setup as an YP master server without any errors. - - This will create /var/yp/Makefile - from /var/yp/Makefile.dist. By - default, this file assumes that the environment has a - single NIS server with only FreeBSD clients. - Since test-domain has a slave server, - edit this line in /var/yp/Makefile so - that it begins with a comment - (#): - - NOPUSH = "True" - - - - 新增使用者 - - Every time a new user is created, the user account must - be added to the master NIS server and the - NIS maps rebuilt. Until this occurs, the - new user will not be able to login anywhere except on the - NIS master. For example, to add the new - user jsmith to the - test-domain domain, run these commands on - the master server: - - # pw useradd jsmith -# cd /var/yp -# make test-domain - - The user could also be added using adduser - jsmith instead of pw useradd - smith. - - - - - 設定 <acronym>NIS</acronym> Slave 伺服器 - - - NIS - slave server - - To set up an NIS slave server, log on - to the slave server and edit /etc/rc.conf - as for the master server. Do not generate any - NIS maps, as these already exist on the - master server. When running ypinit on the - slave server, use (for slave) instead of - (for master). This option requires the - name of the NIS master in addition to the - domain name, as seen in this example: - - coltrane# ypinit -s ellington test-domain - -Server Type: SLAVE Domain: test-domain Master: ellington - -Creating an YP server will require that you answer a few questions. -Questions will all be asked at the beginning of the procedure. - -Do you want this procedure to quit on non-fatal errors? [y/n: n] n - -Ok, please remember to go back and redo manually whatever fails. -If not, something might not work. -There will be no further questions. The remainder of the procedure -should take a few minutes, to copy the databases from ellington. -Transferring netgroup... -ypxfr: Exiting: Map successfully transferred -Transferring netgroup.byuser... -ypxfr: Exiting: Map successfully transferred -Transferring netgroup.byhost... -ypxfr: Exiting: Map successfully transferred -Transferring master.passwd.byuid... -ypxfr: Exiting: Map successfully transferred -Transferring passwd.byuid... -ypxfr: Exiting: Map successfully transferred -Transferring passwd.byname... -ypxfr: Exiting: Map successfully transferred -Transferring group.bygid... -ypxfr: Exiting: Map successfully transferred -Transferring group.byname... -ypxfr: Exiting: Map successfully transferred -Transferring services.byname... -ypxfr: Exiting: Map successfully transferred -Transferring rpc.bynumber... -ypxfr: Exiting: Map successfully transferred -Transferring rpc.byname... -ypxfr: Exiting: Map successfully transferred -Transferring protocols.byname... -ypxfr: Exiting: Map successfully transferred -Transferring master.passwd.byname... -ypxfr: Exiting: Map successfully transferred -Transferring networks.byname... -ypxfr: Exiting: Map successfully transferred -Transferring networks.byaddr... -ypxfr: Exiting: Map successfully transferred -Transferring netid.byname... -ypxfr: Exiting: Map successfully transferred -Transferring hosts.byaddr... -ypxfr: Exiting: Map successfully transferred -Transferring protocols.bynumber... -ypxfr: Exiting: Map successfully transferred -Transferring ypservers... -ypxfr: Exiting: Map successfully transferred -Transferring hosts.byname... -ypxfr: Exiting: Map successfully transferred - -coltrane has been setup as an YP slave server without any errors. -Remember to update map ypservers on ellington. - - This will generate a directory on the slave server called - /var/yp/test-domain which contains copies - of the NIS master server's maps. Adding - these /etc/crontab entries on each slave - server will force the slaves to sync their maps with the maps - on the master server: - - 20 * * * * root /usr/libexec/ypxfr passwd.byname -21 * * * * root /usr/libexec/ypxfr passwd.byuid - - These entries are not mandatory because the master server - automatically attempts to push any map changes to its slaves. - However, since clients may depend upon the slave server to - provide correct password information, it is recommended to - force frequent password map updates. This is especially - important on busy networks where map updates might not always - complete. - - To finish the configuration, run - /etc/netstart on the slave server in order - to start the NIS services. - - - - 設定 <acronym>NIS</acronym> 客戶端 - - An NIS client binds to an - NIS server using ypbind8. This - daemon broadcasts RPC requests on the local network. These - requests specify the domain name configured on the client. If - an NIS server in the same domain receives - one of the broadcasts, it will respond to - ypbind, which will record the - server's address. If there are several servers available, - the client will use the address of the first server to respond - and will direct all of its NIS requests to - that server. The client will automatically - ping the server on a regular basis - to make sure it is still available. If it fails to receive a - reply within a reasonable amount of time, - ypbind will mark the domain as - unbound and begin broadcasting again in the hopes of locating - another server. - - NIS - client configuration - - - To configure a FreeBSD machine to be an - NIS client: - - - - Edit /etc/rc.conf and add the - following lines in order to set the - NIS domain name and start - ypbind8 during network startup: - - nisdomainname="test-domain" -nis_client_enable="YES" - - - - To import all possible password entries from the - NIS server, use - vipw to remove all user accounts - except one from /etc/master.passwd. - When removing the accounts, keep in mind that at least one - local account should remain and this account should be a - member of wheel. If there is a - problem with NIS, this local account - can be used to log in remotely, become the superuser, and - fix the problem. Before saving the edits, add the - following line to the end of the file: - - +::::::::: - - This line configures the client to provide anyone with - a valid account in the NIS server's - password maps an account on the client. There are many - ways to configure the NIS client by - modifying this line. One method is described in . For more detailed - reading, refer to the book - Managing NFS and NIS, published by - O'Reilly Media. - - - - To import all possible group entries from the - NIS server, add this line to - /etc/group: - - +:*:: - - - - To start the NIS client immediately, - execute the following commands as the superuser: - - # /etc/netstart -# service ypbind start - - After completing these steps, running - ypcat passwd on the client should show - the server's passwd map. - - - - <acronym>NIS</acronym> 安全性 - - Since RPC is a broadcast-based service, - any system running ypbind within - the same domain can retrieve the contents of the - NIS maps. To prevent unauthorized - transactions, ypserv8 supports a feature called - securenets which can be used to restrict access - to a given set of hosts. By default, this information is - stored in /var/yp/securenets, unless - ypserv8 is started with and an - alternate path. This file contains entries that consist of a - network specification and a network mask separated by white - space. Lines starting with # are - considered to be comments. A sample - securenets might look like this: - - # allow connections from local host -- mandatory -127.0.0.1 255.255.255.255 -# allow connections from any host -# on the 192.168.128.0 network -192.168.128.0 255.255.255.0 -# allow connections from any host -# between 10.0.0.0 to 10.0.15.255 -# this includes the machines in the testlab -10.0.0.0 255.255.240.0 - - If ypserv8 receives a request from an address that - matches one of these rules, it will process the request - normally. If the address fails to match a rule, the request - will be ignored and a warning message will be logged. If the - securenets does not exist, - ypserv will allow connections from any - host. - - is an alternate mechanism - for providing access control instead of - securenets. While either access control - mechanism adds some security, they are both vulnerable to - IP spoofing attacks. All - NIS-related traffic should be blocked at - the firewall. - - Servers using securenets - may fail to serve legitimate NIS clients - with archaic TCP/IP implementations. Some of these - implementations set all host bits to zero when doing - broadcasts or fail to observe the subnet mask when - calculating the broadcast address. While some of these - problems can be fixed by changing the client configuration, - other problems may force the retirement of these client - systems or the abandonment of - securenets. - - TCP Wrapper - The use of TCP Wrapper - increases the latency of the NIS server. - The additional delay may be long enough to cause timeouts in - client programs, especially in busy networks with slow - NIS servers. If one or more clients suffer - from latency, convert those clients into - NIS slave servers and force them to bind to - themselves. - - - 阻擋部份使用者 - - In this example, the basie - system is a faculty workstation within the - NIS domain. The - passwd map on the master - NIS server contains accounts for both - faculty and students. This section demonstrates how to - allow faculty logins on this system while refusing student - logins. - - To prevent specified users from logging on to a system, - even if they are present in the NIS - database, use vipw to add - -username with - the correct number of colons towards the end of - /etc/master.passwd on the client, - where username is the username of - a user to bar from logging in. The line with the blocked - user must be before the + line that - allows NIS users. In this example, - bill is barred - from logging on to basie: - - basie# cat /etc/master.passwd -root:[password]:0:0::0:0:The super-user:/root:/bin/csh -toor:[password]:0:0::0:0:The other super-user:/root:/bin/sh -daemon:*:1:1::0:0:Owner of many system processes:/root:/usr/sbin/nologin -operator:*:2:5::0:0:System &:/:/usr/sbin/nologin -bin:*:3:7::0:0:Binaries Commands and Source,,,:/:/usr/sbin/nologin -tty:*:4:65533::0:0:Tty Sandbox:/:/usr/sbin/nologin -kmem:*:5:65533::0:0:KMem Sandbox:/:/usr/sbin/nologin -games:*:7:13::0:0:Games pseudo-user:/usr/games:/usr/sbin/nologin -news:*:8:8::0:0:News Subsystem:/:/usr/sbin/nologin -man:*:9:9::0:0:Mister Man Pages:/usr/share/man:/usr/sbin/nologin -bind:*:53:53::0:0:Bind Sandbox:/:/usr/sbin/nologin -uucp:*:66:66::0:0:UUCP pseudo-user:/var/spool/uucppublic:/usr/libexec/uucp/uucico -xten:*:67:67::0:0:X-10 daemon:/usr/local/xten:/usr/sbin/nologin -pop:*:68:6::0:0:Post Office Owner:/nonexistent:/usr/sbin/nologin -nobody:*:65534:65534::0:0:Unprivileged user:/nonexistent:/usr/sbin/nologin --bill::::::::: -+::::::::: - -basie# - - - - - - - 使用 Netgroups - - netgroups - - Barring specified users from logging on to individual - systems becomes unscaleable on larger networks and quickly - loses the main benefit of NIS: - centralized administration. - - Netgroups were developed to handle large, complex networks - with hundreds of users and machines. Their use is comparable - to UNIX groups, where the main difference is the lack of a - numeric ID and the ability to define a netgroup by including - both user accounts and other netgroups. - - To expand on the example used in this chapter, the - NIS domain will be extended to add the - users and systems shown in Tables 28.2 and 28.3: - - - 其他使用者 - - - - - 使用者名稱 - 說明 - - - - - - alpha, - beta - IT department employees - - - - charlie, delta - IT department apprentices - - - - echo, - foxtrott, - golf, - ... - employees - - - - able, - baker, - ... - interns - - - -
- - - 其他系統 - - - - - 機器名稱 - 說明 - - - - - - - war, - death, - famine, - pollution - Only IT employees are allowed to log onto these - servers. - - - - - pride, - greed, - envy, - wrath, - lust, - sloth - All members of the IT department are allowed to - login onto these servers. - - - - one, - two, - three, - four, - ... - Ordinary workstations used by - employees. - - - - trashcan - A very old machine without any critical data. - Even interns are allowed to use this system. - - - -
- - When using netgroups to configure this scenario, each user - is assigned to one or more netgroups and logins are then - allowed or forbidden for all members of the netgroup. When - adding a new machine, login restrictions must be defined for - all netgroups. When a new user is added, the account must be - added to one or more netgroups. If the - NIS setup is planned carefully, only one - central configuration file needs modification to grant or deny - access to machines. - - The first step is the initialization of the - NIS netgroup map. In - FreeBSD, this map is not created by default. On the - NIS master server, use an editor to create - a map named /var/yp/netgroup. - - This example creates four netgroups to represent IT - employees, IT apprentices, employees, and interns: - - IT_EMP (,alpha,test-domain) (,beta,test-domain) -IT_APP (,charlie,test-domain) (,delta,test-domain) -USERS (,echo,test-domain) (,foxtrott,test-domain) \ - (,golf,test-domain) -INTERNS (,able,test-domain) (,baker,test-domain) - - Each entry configures a netgroup. The first column in an - entry is the name of the netgroup. Each set of brackets - represents either a group of one or more users or the name of - another netgroup. When specifying a user, the three - comma-delimited fields inside each group represent: - - - - The name of the host(s) where the other fields - representing the user are valid. If a hostname is not - specified, the entry is valid on all hosts. - - - - The name of the account that belongs to this - netgroup. - - - - The NIS domain for the account. - Accounts may be imported from other NIS - domains into a netgroup. - - - - If a group contains multiple users, separate each user - with whitespace. Additionally, each field may contain - wildcards. See netgroup5 for details. - - netgroups - Netgroup names longer than 8 characters should not be - used. The names are case sensitive and using capital letters - for netgroup names is an easy way to distinguish between user, - machine and netgroup names. - - Some non-FreeBSD NIS clients cannot - handle netgroups containing more than 15 entries. This - limit may be circumvented by creating several sub-netgroups - with 15 users or fewer and a real netgroup consisting of the - sub-netgroups, as seen in this example: - - BIGGRP1 (,joe1,domain) (,joe2,domain) (,joe3,domain) [...] -BIGGRP2 (,joe16,domain) (,joe17,domain) [...] -BIGGRP3 (,joe31,domain) (,joe32,domain) -BIGGROUP BIGGRP1 BIGGRP2 BIGGRP3 - - Repeat this process if more than 225 (15 times 15) users - exist within a single netgroup. - - To activate and distribute the new - NIS map: - - ellington# cd /var/yp -ellington# make - - This will generate the three NIS maps - netgroup, - netgroup.byhost and - netgroup.byuser. Use the map key option - of ypcat1 to check if the new NIS - maps are available: - - ellington% ypcat -k netgroup -ellington% ypcat -k netgroup.byhost -ellington% ypcat -k netgroup.byuser - - The output of the first command should resemble the - contents of /var/yp/netgroup. The second - command only produces output if host-specific netgroups were - created. The third command is used to get the list of - netgroups for a user. - - To configure a client, use vipw8 to specify the - name of the netgroup. For example, on the server named - war, replace this line: - - +::::::::: - - with - - +@IT_EMP::::::::: - - This specifies that only the users defined in the netgroup - IT_EMP will be imported into this system's - password database and only those users are allowed to login to - this system. - - This configuration also applies to the - ~ function of the shell and all routines - which convert between user names and numerical user IDs. In - other words, - cd ~user will - not work, ls -l will show the numerical ID - instead of the username, and find . -user joe - -print will fail with the message - No such user. To fix this, import all - user entries without allowing them to login into the servers. - This can be achieved by adding an extra line: - - +:::::::::/usr/sbin/nologin - - This line configures the client to import all entries but - to replace the shell in those entries with - /usr/sbin/nologin. - - - Make sure that extra line is placed - after - +@IT_EMP:::::::::. Otherwise, all user - accounts imported from NIS will have - /usr/sbin/nologin as their login - shell and no one will be able to login to the system. - - To configure the less important servers, replace the old - +::::::::: on the servers with these - lines: - - +@IT_EMP::::::::: -+@IT_APP::::::::: -+:::::::::/usr/sbin/nologin - - The corresponding lines for the workstations - would be: - - +@IT_EMP::::::::: -+@USERS::::::::: -+:::::::::/usr/sbin/nologin - - NIS supports the creation of netgroups from other - netgroups which can be useful if the policy regarding user - access changes. One possibility is the creation of role-based - netgroups. For example, one might create a netgroup called - BIGSRV to define the login restrictions for - the important servers, another netgroup called - SMALLSRV for the less important servers, - and a third netgroup called USERBOX for the - workstations. Each of these netgroups contains the netgroups - that are allowed to login onto these machines. The new - entries for the NIS - netgroup map would look like this: - - BIGSRV IT_EMP IT_APP -SMALLSRV IT_EMP IT_APP ITINTERN -USERBOX IT_EMP ITINTERN USERS - - This method of defining login restrictions works - reasonably well when it is possible to define groups of - machines with identical restrictions. Unfortunately, this is - the exception and not the rule. Most of the time, the ability - to define login restrictions on a per-machine basis is - required. - - Machine-specific netgroup definitions are another - possibility to deal with the policy changes. In this - scenario, the /etc/master.passwd of each - system contains two lines starting with +. - The first line adds a netgroup with the accounts allowed to - login onto this machine and the second line adds all other - accounts with /usr/sbin/nologin as shell. - It is recommended to use the ALL-CAPS version - of the hostname as the name of the netgroup: - - +@BOXNAME::::::::: -+:::::::::/usr/sbin/nologin - - Once this task is completed on all the machines, there is - no longer a need to modify the local versions of - /etc/master.passwd ever again. All - further changes can be handled by modifying the - NIS map. Here is an example of a possible - netgroup map for this scenario: - - # Define groups of users first -IT_EMP (,alpha,test-domain) (,beta,test-domain) -IT_APP (,charlie,test-domain) (,delta,test-domain) -DEPT1 (,echo,test-domain) (,foxtrott,test-domain) -DEPT2 (,golf,test-domain) (,hotel,test-domain) -DEPT3 (,india,test-domain) (,juliet,test-domain) -ITINTERN (,kilo,test-domain) (,lima,test-domain) -D_INTERNS (,able,test-domain) (,baker,test-domain) -# -# Now, define some groups based on roles -USERS DEPT1 DEPT2 DEPT3 -BIGSRV IT_EMP IT_APP -SMALLSRV IT_EMP IT_APP ITINTERN -USERBOX IT_EMP ITINTERN USERS -# -# And a groups for a special tasks -# Allow echo and golf to access our anti-virus-machine -SECURITY IT_EMP (,echo,test-domain) (,golf,test-domain) -# -# machine-based netgroups -# Our main servers -WAR BIGSRV -FAMINE BIGSRV -# User india needs access to this server -POLLUTION BIGSRV (,india,test-domain) -# -# This one is really important and needs more access restrictions -DEATH IT_EMP -# -# The anti-virus-machine mentioned above -ONE SECURITY -# -# Restrict a machine to a single user -TWO (,hotel,test-domain) -# [...more groups to follow] - - It may not always be advisable - to use machine-based netgroups. When deploying a couple of - dozen or hundreds of systems, - role-based netgroups instead of machine-based netgroups may be - used to keep the size of the NIS map within - reasonable limits. -
- - - 密碼格式 - - - NIS - password formats - - NIS requires that all hosts within an - NIS domain use the same format for - encrypting passwords. If users have trouble authenticating on - an NIS client, it may be due to a differing - password format. In a heterogeneous network, the format must - be supported by all operating systems, where - DES is the lowest common standard. - - To check which format a server or client is using, look - at this section of - /etc/login.conf: - - default:\ - :passwd_format=des:\ - :copyright=/etc/COPYRIGHT:\ - [Further entries elided] - - In this example, the system is using the - DES format. Other possible values are - blf for Blowfish and md5 - for MD5 encrypted passwords. - - If the format on a host needs to be edited to match the - one being used in the NIS domain, the - login capability database must be rebuilt after saving the - change: - - # cap_mkdb /etc/login.conf - - - The format of passwords for existing user accounts will - not be updated until each user changes their password - after the login capability database is - rebuilt. - - -
- - - - 輕量級目錄存取協定 (<acronym>LDAP</acronym>) - - - - - Tom - Rhodes - - Originally contributed by - - - - - - Rocky - Hotas - - Updates by - - - - - LDAP - - 輕量級目錄存取協定 (Lightweight Directory Access Protocol, LDAP) 是一個利用分散式目錄資訊服務來做到存取、修改與認証物件的應用層通訊協定,可以想像成是一本可以儲存數個階層、同質資訊的電話簿或記錄簿。它用在 Active Directory 及 OpenLDAP 網路,允許使用者利用一個帳號來存取數個階層的內部資訊,例如:電子郵件認証、取得員工聯絡資訊及內部網站的認証皆可使用 LDAP 伺服器資料庫中的單一使用者帳號來存取。 - - 本章節將介紹在 FreeBSD 系統上如何快速的設定一個 LDAP 伺服器。本章節假設管理者已做好規劃,這包含:要儲存何種類型的資訊、這些資訊要來做什麼、那些使用者擁有存取這些資訊的權限以及如何確保這些資訊不會被未經授權存取。 - - - <acronym>LDAP</acronym> 術語與結構 - - LDAP 使用了數個術語在開始設置之前必須先了解。所有的目錄項目由一群屬性 (attributes) 所組成,每個屬性集皆有一個獨特的辨識碼稱為辨識名稱 (Distinguished Name, DN),這個辨識碼會由數個其他的屬性,如:常用或相對辨識名稱 (Relative Distinguished Name, RDN) 所組成,這就像目錄有絕對路徑與相對路徑,可以把 DN 當做絕對路徑,RDN 當做相對路徑。 - - LDAP 項目的例子如下。這個例子會搜尋指定使用者帳號 (uid)、組織單位 (ou) 及組織的項目 (o): - - % ldapsearch -xb "uid=trhodes,ou=users,o=example.com" -# extended LDIF -# -# LDAPv3 -# base <uid=trhodes,ou=users,o=example.com> with scope subtree -# filter: (objectclass=*) -# requesting: ALL -# - -# trhodes, users, example.com -dn: uid=trhodes,ou=users,o=example.com -mail: trhodes@example.com -cn: Tom Rhodes -uid: trhodes -telephoneNumber: (123) 456-7890 - -# search result -search: 2 -result: 0 Success - -# numResponses: 2 -# numEntries: 1 - - 這個範例項目會顯示 dn, mail, cn, uid 以及 telephoneNumber 屬性的數值。而 cn 屬性則是 RDN - - 更多有關 LDAP 以及其術語的資訊可在 http://www.openldap.org/doc/admin24/intro.html 找到。 - - - - 設定 <acronym>LDAP</acronym> 伺服器 - - LDAP Server - - FreeBSD 並未提供內建的 LDAP 伺服器,要開始設定前請先安裝 net/openldap-server 套件或 Port: - - # pkg install openldap-server - - 套件中已開啟了許多的預設選項,可以透過執行 pkg info openldap-server 來查看已開啟的選項,若有不足的地方 (例如需要開啟 SQL 的支援),請考慮使用適當的方式重新編譯該 Port。 - - 安裝程序會建立目錄 /var/db/openldap-data 來儲存資料,同時需要建立儲存憑證的目錄: - - # mkdir /usr/local/etc/openldap/private - - 接下來是設定憑証機構 (Certificate authority)。以下指令必須在 /usr/local/etc/openldap/private 下執行,這很重要是由於檔案權限須要被限制且其他使用者不應有這些檔案的存取權限,更多有關憑証的詳細資訊以及相關的參數可在 中找到。要建立憑証授權,需先輸人這個指令並依提示操作: - - # openssl req -days 365 -nodes -new -x509 -keyout ca.key -out ../ca.crt - - 提示輸入的項目除了通用名稱 (Common Name) 外其他是可以一樣的,這個項目必須使用跟系統主機名稱 不同 的名稱。若這是一個自行簽署的憑証 (Self signed certificate),則在憑証機構 CA 的前面加上主機名稱。 - - 接下來的工作是建立一個伺服器的憑証簽署請求與一個私鑰。請輸入以下指令然後依提示操作: - - # openssl req -days 365 -nodes -new -keyout server.key -out server.csr - - 在憑証產生程序的過程中請確認 Common Name 屬性設定正確。憑証簽署請求 (Certificate Signing Request) 必須經過憑証機構簽署後才會成為有效的憑証: - - # openssl x509 -req -days 365 -in server.csr -out ../server.crt -CA ../ca.crt -CAkey ca.key -CAcreateserial - - 在憑証產生程序的最後一步是產生並簽署客戶端憑証: - - # openssl req -days 365 -nodes -new -keyout client.key -out client.csr -# openssl x509 -req -days 3650 -in client.csr -out ../client.crt -CA ../ca.crt -CAkey ca.key - - 記得當提示時要使用同樣的 Common Name 屬性。完成之後,請確認執行的指令產生了 8 個新檔案。 - - OpenLDAP 伺服器所執行的 Daemon 為 slapd,OpenLDAP 是透過 slapd.ldif 來做設定, OpenLDAP 官方已停止採用舊的 slapd.conf 格式。 - - 這裡有些 slapd.ldif設定檔範例 可以使用,同時您也可以在 /usr/local/etc/openldap/slapd.ldif.sample 找到範例資訊。相關可用的選項在 slapd-config(5) 文件會有說明。slapd.ldif 的每個段落,如同其他 LDAP 屬性設定一樣會透過獨一無二 DN 來辨識,並請確保 dn: 描述與其相關屬性之間沒有空行。以下的範例中會實作一個使用 TLS 的安全通道,首先是全域的設定: - - # -# See slapd-config(5) for details on configuration options. -# This file should NOT be world readable. -# -dn: cn=config -objectClass: olcGlobal -cn: config -# -# -# Define global ACLs to disable default read access. -# -olcArgsFile: /var/run/openldap/slapd.args -olcPidFile: /var/run/openldap/slapd.pid -olcTLSCertificateFile: /usr/local/etc/openldap/server.crt -olcTLSCertificateKeyFile: /usr/local/etc/openldap/private/server.key -olcTLSCACertificateFile: /usr/local/etc/openldap/ca.crt -#olcTLSCipherSuite: HIGH -olcTLSProtocolMin: 3.1 -olcTLSVerifyClient: never - - 這個檔案中必須指定憑証機構 (Certificate Authority)、伺服器憑証 (Server Certificate) 與伺服器私鑰 (Server Private Key),建議可讓客戶端決定使用的安全密碼 (Security Cipher),略過 olcTLSCipherSuite 選項 (此選項不相容 openssl 以外的 TLS 客戶端)。選項 olcTLSProtocolMin 讓伺服器可要求一個安全等級的最低限度,建議使用。伺服器有進行驗証的必要,但客戶端並不需要,因此可設定 olcTLSVerifyClient: never - - 第二個部份是設定後端要採用的模組有那些,可使用以下方式設定: - - # -# Load dynamic backend modules: -# -dn: cn=module,cn=config -objectClass: olcModuleList -cn: module -olcModulepath: /usr/local/libexec/openldap -olcModuleload: back_mdb.la -#olcModuleload: back_bdb.la -#olcModuleload: back_hdb.la -#olcModuleload: back_ldap.la -#olcModuleload: back_passwd.la -#olcModuleload: back_shell.la - - 第三個部份要載入資料庫所需的 ldif 綱要 (Schema),這個動作是必要的。 - - dn: cn=schema,cn=config -objectClass: olcSchemaConfig -cn: schema - -include: file:///usr/local/etc/openldap/schema/core.ldif -include: file:///usr/local/etc/openldap/schema/cosine.ldif -include: file:///usr/local/etc/openldap/schema/inetorgperson.ldif -include: file:///usr/local/etc/openldap/schema/nis.ldif - - 接下來是前端設定的部份: - - # Frontend settings -# -dn: olcDatabase={-1}frontend,cn=config -objectClass: olcDatabaseConfig -objectClass: olcFrontendConfig -olcDatabase: {-1}frontend -olcAccess: to * by * read -# -# Sample global access control policy: -# Root DSE: allow anyone to read it -# Subschema (sub)entry DSE: allow anyone to read it -# Other DSEs: -# Allow self write access -# Allow authenticated users read access -# Allow anonymous users to authenticate -# -#olcAccess: to dn.base="" by * read -#olcAccess: to dn.base="cn=Subschema" by * read -#olcAccess: to * -# by self write -# by users read -# by anonymous auth -# -# if no access controls are present, the default policy -# allows anyone and everyone to read anything but restricts -# updates to rootdn. (e.g., "access to * by * read") -# -# rootdn can always read and write EVERYTHING! -# -olcPasswordHash: {SSHA} -# {SSHA} is already the default for olcPasswordHash - - 再來是設定後端的部份,之後唯一能夠存取 OpenLDAP 伺服器設定的方式是使用全域超級使用者。 - - dn: olcDatabase={0}config,cn=config -objectClass: olcDatabaseConfig -olcDatabase: {0}config -olcAccess: to * by * none -olcRootPW: {SSHA}iae+lrQZILpiUdf16Z9KmDmSwT77Dj4U - - 預設的管理者使用者名稱是 cn=config,可在 Shell 中輸入 slappasswd,決定要使用的密碼並將其產生的編碼放到 olcRootPW 欄位中。若這個選項在這時沒有設定好,在匯入 slapd.ldif 之後將沒有任何人有辦法修改全域的設定 - - 最後一個部份是有關資料庫後端的設定: - - ####################################################################### -# LMDB database definitions -####################################################################### -# -dn: olcDatabase=mdb,cn=config -objectClass: olcDatabaseConfig -objectClass: olcMdbConfig -olcDatabase: mdb -olcDbMaxSize: 1073741824 -olcSuffix: dc=domain,dc=example -olcRootDN: cn=mdbadmin,dc=domain,dc=example -# Cleartext passwords, especially for the rootdn, should -# be avoided. See slappasswd(8) and slapd-config(5) for details. -# Use of strong authentication encouraged. -olcRootPW: {SSHA}X2wHvIWDk6G76CQyCMS1vDCvtICWgn0+ -# The database directory MUST exist prior to running slapd AND -# should only be accessible by the slapd and slap tools. -# Mode 700 recommended. -olcDbDirectory: /var/db/openldap-data -# Indices to maintain -olcDbIndex: objectClass eq - - 這裡指定的資料庫即實際用來保存 LDAP 目錄的資料,也可以使用 mdb 以外的項目,資料庫的超級使用者可在這裡設定 (與全域的超級使用者是不同的東西):olcRootDN 需填寫使用者名稱 (可自訂),olcRootPW 需填寫該使用者編碼後的密碼,將密碼編碼可使用 slappasswd 如同前面所述。 - - 這裡有個檔案庫內有四個 slapd.ldif 的範例,要將現有的 slapd.conf 轉換成 slapd.ldif 格式,可參考此頁 (注意,這裡面的說明也會介紹一些不常用的選項)。 - - 當設定完成之後,需將 slapd.ldif 放在一個空的目錄當中,建議如以下方式建立: - - # mkdir /usr/local/etc/openldap/slapd.d/ - - 匯入設定資料庫: - - # /usr/local/sbin/slapadd -n0 -F /usr/local/etc/openldap/slapd.d/ -l /usr/local/etc/openldap/slapd.ldif - - 啟動 slapd Daemon: - - # /usr/local/libexec/slapd -F /usr/local/etc/openldap/slapd.d/ - - 選項 -d 可以用來除錯使用,如同 slapd(8) 中所說明的,若要檢驗伺服器是否正常執行與運作可以: - - # ldapsearch -x -b '' -s base '(objectclass=*)' namingContexts -# extended LDIF -# -# LDAPv3 -# base <> with scope baseObject -# filter: (objectclass=*) -# requesting: namingContexts -# - -# -dn: -namingContexts: dc=domain,dc=example - -# search result -search: 2 -result: 0 Success - -# numResponses: 2 -# numEntries: 1 - - 伺服器端仍必須受到信任,若在此之前未做過這個動作,請依照以下指示操作。安裝 OpenSSL 套件或 Port: - - # pkg install openssl - - 進入 ca.crt 所在的目錄 (以這邊使用的例子來說則是 /usr/local/etc/openldap),執行: - - # c_rehash . - - 現在 CA 與伺服器憑証可以依其用途被辨識,可進入 server.crt 所在的目錄執行以下指令來檢查: - - # openssl verify -verbose -CApath . server.crt - - slapd 已正在執行,就重新啟動它。如同 /usr/local/etc/rc.d/slapd 所述,要讓 slapd 開機時可正常執行,須要加入以下行到 /etc/rc.conf - - lapd_enable="YES" -slapd_flags='-h "ldapi://%2fvar%2frun%2fopenldap%2fldapi/ -ldap://0.0.0.0/"' -slapd_sockets="/var/run/openldap/ldapi" -slapd_cn_config="YES" - - 開機啟動 slapd 並不會提供除錯的功能,您可以檢查 /var/log/debug.log, dmesg -a/var/log/messages 檢確認是否有正常運作。 - - 以下範例會新增群組 team 及使用者 johndomain.example LDAP 資料庫,而該資料庫目前是空的。首先要先建立 domain.ldif 檔: - - # cat domain.ldif -dn: dc=domain,dc=example -objectClass: dcObject -objectClass: organization -o: domain.example -dc: domain - -dn: ou=groups,dc=domain,dc=example -objectClass: top -objectClass: organizationalunit -ou: groups - -dn: ou=users,dc=domain,dc=example -objectClass: top -objectClass: organizationalunit -ou: users - -dn: cn=team,ou=groups,dc=domain,dc=example -objectClass: top -objectClass: posixGroup -cn: team -gidNumber: 10001 - -dn: uid=john,ou=users,dc=domain,dc=example -objectClass: top -objectClass: account -objectClass: posixAccount -objectClass: shadowAccount -cn: John McUser -uid: john -uidNumber: 10001 -gidNumber: 10001 -homeDirectory: /home/john/ -loginShell: /usr/bin/bash -userPassword: secret - - 請查看 OpenLDAP 說明文件取得更詳細的資訊,使用 slappasswd 來將純文字的密碼 secret 更改為已編碼的型式來填寫 userPassword 欄位。在 loginShell 所指定的路徑,必須在所有可讓 john 登入的系統中存在。最後是使用 mdb 管理者修改資料庫: - - # ldapadd -W -D "cn=mdbadmin,dc=domain,dc=example" -f domain.ldif - - 要修改全域設定只能使用全域的超及使用者。例如,假設一開始採用了 olcTLSCipherSuite: HIGH:MEDIUM:SSLv3 選項,但最後想要把它移除,可以建立一個有以下內容的檔案: - - # cat global_mod -dn: cn=config -changetype: modify -delete: olcTLSCipherSuite - - 然後套用修改內容: - - # ldapmodify -f global_mod -x -D "cn=config" -W - - 當提示輸入密碼時,提供當時在設定後端一節所設定的密碼,在這裡無須填寫使用者名稱,cn=config 代表要修改資料庫資料的位置。也可以使用 ldapmodify 刪除其中一行屬性,或是 ldapdelete 刪除整筆資料。 - - 若有問題無法正常執行,或是全域的超級使用者無法存取後端的設定,可以刪除並重建整個後端設定: - - # rm -rf /usr/local/etc/openldap/slapd.d/ - - 可以修改 slapd.ldif 後再重新匯入一次。請注意,這個步驟只在沒有其他方式可用時才使用。 - - 本章節的設定說明只針對伺服器端的部份,在同一台主機中也可以同時有安裝 LDAP 客戶端但需要額外做設定。 - - - - - - 動態主機設置協定 (<acronym>DHCP</acronym>) - - - Dynamic Host Configuration Protocol - DHCP - - - Internet Systems Consortium (ISC) - - - 動態主機設置協定 (Dynamic Host Configuration Protocol, DHCP) 可分配必要的位置資訊給一個連線到網路的系統以在該網路通訊。FreeBSD 內含 OpenBSD 版本的 dhclient,可用來做為客戶端來取得位置資訊。FreeBSD 預設並不會安裝 DHCP 伺服器,但在 FreeBSD Port 套件集中有許多可用的伺服器。有關 DHCP 通訊協定的完整說明位於 RFC 2131,相關資源也可至 isc.org/downloads/dhcp/ 取得。 - - 本節將介紹如何使用內建的 DHCP 客戶端,接著會介紹如何安裝並設定一個 DHCP 伺服器。 - - - 在 FreeBSD 中,bpf4 裝置同時會被 DHCP 伺服器與 DHCP 客戶端所使用。這個裝置會在 GENERIC 核心中被引用並隨著 FreeBSD 安裝。想要建立自訂核心的使用者若要使用 DHCP 則須保留這個裝置。 - - 另外要注意 bpf 也會讓有權限的使用者在該系統上可執行網路封包監聽程式。 - - - - 設定 <acronym>DHCP</acronym> 客戶端 - - DHCP 客戶端內含在 FreeBSD 安裝程式當中,這讓在新安裝的系統上設定自動從 DHCP 伺服器接收網路位置資訊變的更簡單。請參考 取得網路設置的範例。 - - UDP - dhclient 在客戶端機器上執行時,它便會開始廣播請求取得設置資訊。預設這些請求會使用 UDP 埠號 68。而伺服器則會在 UDP 埠號 67 來回覆,將 IP 位址與其他相關的網路資訊,如:子網路遮罩、預設閘道及 DNS 伺服器位址告訴客戶端,詳細的清單可在 dhcp-options5 找到。 - - 預設當 FreeBSD 系統開機時,其 DHCP 客戶端會在背景執行或稱非同步 (Asynchronously) 執行,在完成 DHCP 程序的同時其他啟動 Script 會繼續執行,來加速系統啟動。 - - 背景 DHCPDHCP 伺服器可以快速的回應客戶端請求時可運作的很好。然而 DHCP 在某些系統可能需要較長的時間才能完成,若網路服務嘗試在 DHCP 尚未分配網路位置資訊前執行則會失敗。使用同步 (Synchronous) 模式執行 DHCP 可避免這個問題,因為同步模式會暫停啟動直到 DHCP 已設置完成。 - - /etc/rc.conf 中的這行用來設定採用背景 (非同步模式): - - ifconfig_fxp0="DHCP" - - 若系統已經在安裝時設定使用 DHCP,這行可能會已存在。替換在例子中的 fxp0 為實際要動態設置的網路介面名稱,如 中的說明。 - - 要改設定系統採用同步模式,在啟動時暫停等候 DHCP 完成,使用 SYNCDHCP - - ifconfig_fxp0="SYNCDHCP" - - 尚有其他可用的客戶端選項,請在 rc.conf5 搜尋 dhclient 來取得詳細資訊。 - - - DHCP - configuration files - - - DHCP 客戶端會使用到以下檔案: - - - - /etc/dhclient.conf - - dhclient 用到的設定檔。通常這個檔案只會有註解,因為預設便適用大多數客戶端。這個設定檔在 dhclient.conf5 中有說明。 - - - - /sbin/dhclient - - 有關指令本身的更多資訊可於 dhclient8 找到。 - - - - /sbin/dhclient-script - - FreeBSD 特定的 DHCP 客戶端設定 Script。在 dhclient-script8 中有說明,但應不須做任何修改便可正常運作。 - - - - /var/db/dhclient.leases.interface - - DHCP 客戶端會在這個檔案中儲存有效租約的資料,寫入的格式類似日誌,在 dhclient.leases5 有說明。 - - - - - - 安裝並設定 <acronym>DHCP</acronym> 伺服器 - - 本節將示範如何設定 FreeBSD 系統成為 DHCP 伺服器,使用 Internet Systems Consortium (ISC) 所實作的 DHCP 伺服器,這個伺服器及其文件可使用 net/isc-dhcp43-server 套件或 Port 安裝。 - - - DHCP - server - - - - DHCP - installation - - - net/isc-dhcp43-server 的安裝程式會安裝一份範例設定檔,複製 /usr/local/etc/dhcpd.conf.example/usr/local/etc/dhcpd.conf 並在這個新檔案做編輯。 - - - DHCP - dhcpd.conf - - 這個設定檔內容包括了子網路及主機的宣告,用來定義要提供給 DHCP 客戶端的資訊。如以下行設定: - - option domain-name "example.org"; -option domain-name-servers ns1.example.org; -option subnet-mask 255.255.255.0; - -default-lease-time 600; -max-lease-time 72400; -ddns-update-style none; - -subnet 10.254.239.0 netmask 255.255.255.224 { - range 10.254.239.10 10.254.239.20; - option routers rtr-239-0-1.example.org, rtr-239-0-2.example.org; -} - -host fantasia { - hardware ethernet 08:00:07:26:c0:a5; - fixed-address fantasia.fugue.com; -} - - - - 這個選項指定了要提供給客戶端的預設搜尋網域。請參考 resolv.conf5 取得更多資訊。 - - - - 這個選項指定了客戶端應使用的 DNS 伺服器清單 (以逗號分隔)。如範例中所示,可使用伺服器的完整網域名稱 (Fully Qualified Domain Names, FQDN) 或伺服器的 IP 位址。 - - - - 要提供給客戶端的子網路遮罩。 - - - - 預設租約到期時間 (秒)。客戶端可以自行設定覆蓋這個數值。 - - - - 一個租約最多允許的時間長度 (秒)。若客戶端請求更長的租約,仍會發出租約,但最多只會在 max-lease-time 內有效。 - - - - 預設的 會關閉動態 DNS 更新。更改此值為 可讓 DHCP 伺服器每當發出一個租約便通知 DNS 伺服器更新,如此一來 DNS 伺服器便知道網路中該電腦的 IP 位址。不要更改此預設值,除非 DNS 伺服器已設定為支援動態 DNS - - - - 此行會建立一個可用 IP 位址的儲存池來保留這些要分配給 DHCP 客戶端的位址。位址範圍必須在前一行所指定的網路或子網路中有效。 - - - - 宣告在開始的 { 括號之前所指定的網路或子網路中有效的預設通訊閘。 - - - - 指定客戶端的硬體 MAC 位址,好讓 DHCP 伺服器在客戶端發出請求時可以辨識客戶端。 - - - - 指定這個主機應分配相同的 IP 位址。在此處用主機名稱是正確的,由於 DHCP 伺服器會在回傳租約資訊前先解析主機名稱。 - - - - 此設定檔還支援其他選項,請參考隨伺服器一併安裝的 dhcpd.conf(5) 來取得詳細資訊與範例。 - - 完成 dhcpd.conf 的設定之後,在 /etc/rc.conf 啟動 DHCP 伺服器: - - dhcpd_enable="YES" -dhcpd_ifaces="dc0" - - 替換 dc0DHCP 伺服器要傾聽 DHCP 客戶端請求的網路介面 (多個介面可以空白分隔)。 - - 執行以下指令來啟動伺服器: - - # service isc-dhcpd start - - 往後任何對伺服器設定的變更會需要使用 service8 中止 dhcpd 服務然後啟動。 - - DHCP 伺服器會使用到以下檔案。注意,操作手冊會與伺服器軟體一同安裝。 - - - DHCP - configuration files - - - - /usr/local/sbin/dhcpd - - 更多有關 dhcpd 伺服器的資訊可在 dhcpd(8) 找到。 - - - - /usr/local/etc/dhcpd.conf - - 伺服器設定檔需要含有所有要提供給客戶端的資訊以及有關伺服器運作的資訊。在 dhcpd.conf(5) 有此設定檔的說明。 - - - - /var/db/dhcpd.leases - - DHCP 伺服器會儲存一份已發出租約的資料於這個檔案,寫入的格式類似日誌。參考 dhcpd.leases(5) 會有更完整的說明。 - - - - /usr/local/sbin/dhcrelay - - 這個 Daemon 會用在更進階的環境中,在一個 DHCP 伺服器要轉發來自客戶端的請求到另一個網路的另一個 DHCP 伺服器的環境。若需要使用此功能,請安裝 net/isc-dhcp43-relay 套件或 Port,安裝會包含 dhcrelay(8),裡面有提供更詳細的資訊。 - - - - - - - - 網域名稱系統 (<acronym>DNS</acronym>) - - DNS - - 網域名稱系統 (Domain Name System, DNS) 是一種協定用來轉換網域名稱為 IP 位址,反之亦然。DNS 會協調網際網路上有權的根節點 (Authoritative root)、最上層網域 (Top Level Domain, TLD) 及其他小規模名稱伺服器來取得結果,而這些伺服器可管理與快取個自的網域資訊。要在系統上做 DNS 查詢並不需要架設一個名稱伺服器。 - - resolver - reverse - DNS - root zone - - 以下表格會說明一些與 DNS 有關的術語: - - - <acronym>DNS</acronym> 術語 - - - - - - - - 術語 - 定義 - - - - - - 正向 DNS (Forward DNS) - 將主機名稱對應 IP 位址的動作。 - - - - 源頭 (Origin) - 代表某個轄區檔案中所涵蓋的網域。 - - - - 解析器 (Resolver) - 主機向名稱伺服器查詢轄區資訊的系統程序。 - - - - 反向 DNS (Reverse DNS) - IP 對應主機名稱的動作。 - - - - 根轄區 (Root zone) - - 網際網路轄區階層的最開始,所有的轄區會在根轄區之下,類似在檔案系統中所有的檔案會在根目錄底下。 - - - - 轄區 (Zone) - 獨立的網域、子網域或或由相同授權 (Authority) 管理的部分 DNS - - - -
- - - zones - examples - - - 轄區範例: - - - - . 是一般在文件中表達根轄區的方式。 - - - - org. 是一個在根轄區底下的最上層網域 (Top Level Domain , TLD)。 - - - - example.org. 是一個在 org. TLD 底下的轄區。 - - - - 1.168.192.in-addr.arpa 是一個轄區用來代表所有在 192.168.1.* IP 位址空間底下的 IP 位址。 - - - - 如您所見,更詳細的主機名稱會加在左方,例如 example.org.org. 更具體,如同 org. 比根轄區更具體,主機名稱每一部份的架構很像檔案系統:/dev 目錄在根目錄底下,以此類推。 - - - 要架設名稱伺服器的原因 - - 名稱伺服器通常有兩種形式:有權的 (Authoritative) 名稱伺服器與快取 (或稱解析) 名稱伺服器。 - - 以下情況會需要一台有權的名稱伺服器: - - - - 想要提供 DNS 資訊給全世界,做為官方回覆查詢。 - - - - 已經註冊了一個網域,例如 example.org,且要將 IP 位址分配到主機名稱下。 - - - - 一段 IP 位址範圍需要反向 DNS 項目 (IP 轉主機名稱)。 - - - - 要有一台備援或次要名稱伺服器用來回覆查詢。 - - - - 以下情況會需要一台快取名稱伺服器: - - - - 比起查詢外部的名稱伺服器本地 DNS 伺服器可以快取並更快的回應。 - - - - 當查詢 www.FreeBSD.org 時,解析程式通常會查詢上游 ISP 的名稱伺服器然後接收其回覆,使用本地、快取 DNS 伺服器,只需要由快取 DNS 伺服器對外部做一次查詢,其他的查詢則不需要再向區域網路之外查詢,因為這些資訊已經在本地被快取了。 - - - - <acronym>DNS</acronym> 伺服器設定 - - Unbound 由 FreeBSD 基礎系統提供,預設只會提供本機的 DNS 解析,雖然基礎系統的套件可被設定提供本機以外的解析服務,但要解決這樣的需求仍建議安裝 FreeBSD Port 套件集中的 Unbound - - 要開啟 Unbound 可加入下行到 /etc/rc.conf - - local_unbound_enable="YES" - - 任何已存在於 /etc/resolv.conf 中的名稱伺服器會在新的 Unbound 設定中被設為追隨者 (Forwarder)。 - - - 若任一個列在清單中的名稱伺服器不支援 DNSSEC,則本地的 DNS 解析便會失敗,請確認有測試每一台名稱伺服器並移除所有測試失敗的項目。以下指令會顯示出信認樹或在 192.168.1.1 上執行失敗的名稱伺服器: - - - % drill -S FreeBSD.org @192.168.1.1 - - 確認完每一台名稱伺服器都支援 DNSSEC 後啟動 Unbound - - # service local_unbound onestart - - 這將會更新 /etc/resolv.conf 來讓查詢已用 DNSSEC 確保安全的網域現在可以運作,例如,執行以下指令來檢驗 FreeBSD.org DNSSEC 信任樹: - - % drill -S FreeBSD.org -;; Number of trusted keys: 1 -;; Chasing: freebsd.org. A - -DNSSEC Trust tree: -freebsd.org. (A) -|---freebsd.org. (DNSKEY keytag: 36786 alg: 8 flags: 256) - |---freebsd.org. (DNSKEY keytag: 32659 alg: 8 flags: 257) - |---freebsd.org. (DS keytag: 32659 digest type: 2) - |---org. (DNSKEY keytag: 49587 alg: 7 flags: 256) - |---org. (DNSKEY keytag: 9795 alg: 7 flags: 257) - |---org. (DNSKEY keytag: 21366 alg: 7 flags: 257) - |---org. (DS keytag: 21366 digest type: 1) - | |---. (DNSKEY keytag: 40926 alg: 8 flags: 256) - | |---. (DNSKEY keytag: 19036 alg: 8 flags: 257) - |---org. (DS keytag: 21366 digest type: 2) - |---. (DNSKEY keytag: 40926 alg: 8 flags: 256) - |---. (DNSKEY keytag: 19036 alg: 8 flags: 257) -;; Chase successful - -
- - - - Apache HTTP 伺服器 - - - - - Murray - Stokely - - Contributed by - - - - - web servers - setting up - Apache - - 開放源碼的 Apache HTTP Server 是目前最廣泛被使用的網頁伺服器,FreeBSD 預設並不會安裝這個網頁伺服器,但可從 www/apache24 套件或 Port 安裝。 - - 本節將會摘要如何設定並啟動在 FreeBSD 上 2.x 版的 Apache HTTP Server,要取得有關 Apache 更詳細的資訊及其設定項目請參考 httpd.apache.org。 - - - 設定並啟動 Apache - - Apache - configuration file - - 在 FreeBSD 中,主 Apache HTTP Server 設定檔會安裝於 /usr/local/etc/apache2x/httpd.conf,其中 x 代表版號,這份 ASCII 文字檔中以 # 做為行首的是註解,而最常需修改的項目有: - - - - ServerRoot "/usr/local" - - - 指定該 Apache 的預設安裝路徑,Binary 檔會儲存在伺服器根目錄 (Server root) 下的 binsbin 子目錄,而設定檔會儲存在 etc/apache2x 子目錄。 - - - - - ServerAdmin you@example.com - - - 更改此項目為您要接收問題回報的電子郵件位址,這個位址也會顯示在一些伺服器產生的頁面上,如:錯誤頁面。 - - - - - ServerName - www.example.com:80 - - - 讓管理者可以設定伺服器要回傳給客戶端的主機名稱 (Hostname),例如,www 可以更改為實際的主機名稱,若系統並未有註冊的 DNS 名稱,則可改輸入其 IP 位址,若伺服器需要傾聽其他埠號,可更改 80 為其他埠號。 - - - - - DocumentRoot - "/usr/local/www/apache2x/data" - - - 提供文件的目錄,預設所有的請求均會到此目錄,但可以使用符號連結與別名來指向其他地方。 - - - - - 在對 Apache 設定檔做變更之前,建議先做備份,在 Apache 設定完成之後,儲存讓檔案並使用 apachectl 檢驗設定,執行 apachectl configtest 的結果應回傳 Syntax OK - - Apache - starting or stopping - - 要在系統啟動時執行 Apache,可加入下行到 /etc/rc.conf - - apache24_enable="YES" - - Apache 要使用非預設的選項啟動,可加入下行到 /etc/rc.conf 來指定所需的旗標參數: - - apache24_flags="" - - apachectl 未回報設定錯,則可啟動 httpd - - # service apache24 start - - httpd 服務可以透過在網頁瀏覽器中輸入 http://localhost 來測試,將 localhost 更改為執行 httpd 那台主機的完整網域名稱 (Fully-qualified domain name)。預設會顯示的網頁為 /usr/local/www/apache24/data/index.html - - 後續若有在 httpd 執行中時修改 Apache 設定檔可使用以下指令來測試是否有誤: - - # service apache24 configtest - - - 注意,configtest 並非採用 rc8 標準,不應預期其可在所有的啟動 Script 中正常運作。 - - - - - 虛擬主機 - - 虛擬主機允許在一個 Apache 伺服器執行多個網站,虛擬主機可以是以 IP 為主 (IP-based) 或以名稱為主 (name-based)。以 IP 為主的虛擬主機中的每一個網站要使用不同的 IP 位址。以名稱為主的虛擬主機會使用客戶端的 HTTP/1.1 標頭來判斷主機名稱,這可讓不同的網站共用相同的 IP 位址。 - - 要設定 Apache 使用以名稱為主的虛擬主機可在每一個網站加入 VirtualHost 區塊,例如,有一個名稱為 www.domain.tld 的主機擁有一個 www.someotherdomain.tld 的虛擬網域,可加入以下項目到 httpd.conf - - <VirtualHost *> - ServerName www.domain.tld - DocumentRoot /www/domain.tld -</VirtualHost> - -<VirtualHost *> - ServerName www.someotherdomain.tld - DocumentRoot /www/someotherdomain.tld -</VirtualHost> - - 每一個虛擬主機均需更改其 ServerNameDocumentRoot 的值為實際要使用的值。 - - 更多有關設定虛擬主機的資訊,可參考 Apache 官方說明文件於:http://httpd.apache.org/docs/vhosts/ - - - - Apache 模組 - - Apache - modules - - Apache 使用模組 (Module) 來擴充伺服器所提供的功能。請參考 http://httpd.apache.org/docs/current/mod/ 來取得可用模組的完整清單與設定詳細資訊。 - - 在 FreeBSD 中有些模組可以隨著 www/apache24 Port 編譯,只要在 /usr/ports/www/apache24 輸入 make config 便可查看有那一些模組是預設開啟的,若模組未與 Port 一併編譯,FreeBSD Port 套件集也提供了一個簡單的方式可安裝各種模組,本節將介紹最常使用的三個模組。 - - - <filename>mod_ssl</filename> - - - web servers - secure - - SSL - cryptography - - mod_ssl 模組利用了 OpenSSL 透過 Secure Sockets Layer (SSLv3) 與 Transport Layer Security (TLSv1) 通訊協定來提供強大的加密,這個模組提供了向受信認的憑証簽署機構申請簽章憑証所需的任何東西,讓 FreeBSD 上能夠執行安全的網頁伺服器。 - - 在 FreeBSD 中 mod_ssl 模組預設在套件與 Port 均是開啟的,可用的設定項目在 http://httpd.apache.org/docs/current/mod/mod_ssl.html 會說明。 - - - - <filename>mod_perl</filename> - - - mod_perl - Perl - - - mod_perl 模組讓您可以使用 Perl 撰寫 Apache 模組,除此之外,嵌入到伺服器的直譯器可避免啟動外部直譯器的額外開銷與 Perl 耗費的啟動時間。 - - mod_perl 可以使用 www/mod_perl2 套件或 Port 安裝,有關使用此模組的說明文件可在 http://perl.apache.org/docs/2.0/index.html 中找到。 - - - - - <filename>mod_php</filename> - - - - - Tom - Rhodes - - Written by - - - - - - mod_php - PHP - - - PHP: Hypertext Preprocessor (PHP) 是一般用途的腳本 (Script) 語言,特別適用於網站開發,能夠嵌入在 HTML 當中,它的語法參考自 C, JavaPerl,目的在讓網頁開發人員能快速的寫出動態網頁。 - - 要在 Apache 網頁伺服器上加入對 PHP5 的支援,可安裝 www/mod_php56 套件或 Port,這會安裝並設定支援動態 PHP 應用程式所需的模組。安裝過程會自動加入下行到 /usr/local/etc/apache24/httpd.conf - - LoadModule php5_module libexec/apache24/libphp5.so - - - - 接著,執行 graceful 重新啟動來載入 PHP 模組: - - # apachectl graceful - - www/mod_php56 所提供的 PHP 支援是有限的,若需要額外的支援可以使用 lang/php56-extensions Port 來安裝,該 Port 提供了選單介面來選擇可用的 PHP 擴充套件。 - - 或者,可以找到適當的 Port 來安裝各別的擴充套件,例如,要增加 PHPMySQL 資料庫伺服器的支援可安裝 databases/php56-mysql - - 在安裝完擴充套件之後,必須重新載入 Apache 伺服器來使用新的設定值: - - # apachectl graceful - - - - - 動態網站 - - - web servers - dynamic - - - 除了 mod_perlmod_php 外,也有其他語言可用來建立動態網頁內容,這包含了 DjangoRuby on Rails - - - Django - - Python - Django - - Django 是以 BSD 授權的框架 (Framework),指在讓開發人員能快速的寫出高效、優雅的網頁應用程式。它提供了物件關聯對應器 (Object-relational mapper),所以各種資料型態可當做 Python 的物件來開發,且提供了豐富的動態資料庫存取 API 給這些物件,讓開發人員不再需要寫 SQL。它也同時提供了可擴充的樣板系統,來讓應用程式的邏輯與 HTML 呈現能夠被拆開。 - - Django 需要 mod_python,以及一個 SQL 資料庫引擎才能運作。在 FreeBSD 中的 www/py-django Port 會自動安裝 mod_python 以及對 PostgreSQL, MySQLSQLite 資料庫的支援,預設為 SQLite,要更改資料庫引擎可在 /usr/ports/www/py-django 輸入 make config 然後再安裝該 Port。 - - Django 安裝完成之後,應用程式會需要一個專案目錄並搭配 Apache 設定才能使用內嵌的 Python 直譯器,此直譯器會用來呼叫網站上指定 URL 的應用程式。 - - 要設定 Apache 傳遞某個 URL 請求到網站應用程式,可加入下行到 httpd.conf 來指定專案目錄的完整路徑: - - <Location "/"> - SetHandler python-program - PythonPath "['/dir/to/the/django/packages/'] + sys.path" - PythonHandler django.core.handlers.modpython - SetEnv DJANGO_SETTINGS_MODULE mysite.settings - PythonAutoReload On - PythonDebug On -</Location> - - 請參考 https://docs.djangoproject.com 來取得如何使用 Django 的更多資訊。 - - - - Ruby on Rails - - Ruby on Rails - - Ruby on Rails 是另外一套開放源碼的網站框架 (Framework),提供了完整的開發堆疊,這使得網頁開發人員可以更有生產力且能夠快速的寫出強大的應用程式,在 FreeBSD 它可以使用 www/rubygem-rails 套件或 Port 安裝。 - - 請參考 http://guides.rubyonrails.org 來取得更多有關如何使用 Ruby on Rails 的資訊。 - - - - - - - 檔案傳輸協定 (<acronym>FTP</acronym>) - - FTP - servers - - 檔案傳輸協定 (File Transfer Protocol, FTP) 提供了使用一個簡單的方式能夠將檔案傳輸到與接收自 FTP 伺服器,FreeBSD 內建了 FTP 伺服器軟體 ftpd 在基礎系統 (Base system) 中。 - - FreeBSD 提供了多個設定檔來控制對 FTP 伺服器的存取,本節將摘要這些檔案的設定方式,請參考 ftpd8 來取得更多有關內建 FTP 伺服器的詳細資訊。 - - - 設定 - - 最重要的一個設定步驟便是決定那些帳號能夠存取 FTP 伺服器,FreeBSD 系統有數個系統帳號,這些帳號不應該能夠擁有 FTP 存取權,不允許存取 FTP 的使用者清單可在 /etc/ftpusers 找到,預設該檔案內會有所有的系統帳號,其他不應允許存取 FTP 的使用者也可在此加入。 - - 在某些情況可能會布望限制某些使用者的存取,而不是完全避免這些使用者使用 FTP,這可以透過建立 /etc/ftpchroot 來完成,詳如 ftpchroot5 所述,這個檔案會列出受到 FTP 存取限制的使用者與群組。 - - - FTP - anonymous - - - 要在伺服器上開啟匿名 FTP 存取權,可在 FreeBSD 系統上建立一個名稱為 ftp 使用者,使用者將能夠使用 ftpanonymous 使用者名稱來登入 FTP 伺服器,當提示輸入密碼時,輸入任何值都會被接受,但是慣例上應使用電子郵件位址來當做密碼。當匿名使用者登入時 FTP 伺服器會呼叫 chroot2 來限制使用者只能存取 ftp 使用者的家目錄。 - - 要設定顯示給 FTP 客戶端的歡迎訊息有兩個文字檔可以建立,/etc/ftpwelcome 的內容會在收到登入提示前顯示給使用者看,登入成功能後,則會顯示 /etc/ftpmotd 的內容。注意,這個檔案的路徑是相對於登入環境的,所以 ~ftp/etc/ftpmotd 的內容只會對匿名使用者顯示。 - - 設定完 FTP 伺服器之後,在 /etc/rc.conf 設定適當的變數來在開機時啟動該服務: - - ftpd_enable="YES" - - 要立即啟動服務可: - - # service ftpd start - - 要測試到 FTP 伺服器的連線可輸入: - - % ftp localhost - - syslog - log files - FTP - - ftpd daemon 會使用 syslog3 來記錄訊息,預設,系統記錄 Daemon 會寫入有關 FTP 的訊息到 /var/log/xferlogFTP 記錄的位置可以透過更改 /etc/syslog.conf 中下行來做修改: - - ftp.info /var/log/xferlog - - - FTP - anonymous - - - - 要注意啟動匿名 FTP 伺服器可能的潛藏問題,尤其是要讓匿名使用者上傳檔案時要再次確認,因為這可能讓該 FTP 站變成用來交換未授權商業軟體的交流平台或者更糟的狀況。若真的需要匿名 FTP 上傳,那麼請檢查權限設定,讓這些檔案在尚未被管理者審查前不能夠被其他匿名使用者讀取。 - - - - - - - <trademark class="registered">Microsoft</trademark> <trademark class="registered">Windows</trademark> 用戶端檔案與列印服務 (Samba) - - Samba server - Microsoft Windows - - file server - Windows clients - - - print server - Windows clients - - - Samba 是熱門的開放源碼軟體套件,使用 SMB/CIFS 通訊協定提供檔案與列印服務,此通訊協定內建於 Microsoft Windows 系統,在非 Microsoft Windows 的系統可透過安裝 Samba 客戶端程式庫來支援此協定。此通訊協定讓客戶端可以存取共享的資料與印表機,這些共享的資源可掛載到一個本機的磁碟機,而共享的印表機則可以當做本機的印表機使用。 - - 在 FreeBSD 上,可以使用 net/samba48 Port 或套件來安裝 Samba 客戶端程式庫,這個客戶端提供了讓 FreeBSD 系統能存取 SMB/CIFSMicrosoft Windows 網路中共享的資源。 - - FreeBSD 系統也可以透過安裝 net/samba48 Port 或套件來設定成 Samba 伺服器,這讓管理者可以在 FreeBSD 系統上建立 SMB/CIFS 的共享資源,讓執行 Microsoft WindowsSamba 客戶端程式庫的客戶端能夠存取。 - - - 伺服器設定 - - Samba 的設定位於 /usr/local/etc/smb4.conf,必須先設定這個檔案才可使用 Samba - - 要共享目錄與印表機給在工作群組中的 Windows 客戶端的簡易 smb4.conf 範例如下。對於涉及 LDAP 或 Active Directory 的複雜安裝,可使用 samba-tool8 來建立初始的 smb4.conf - - [global] -workgroup = WORKGROUP -server string = Samba Server Version %v -netbios name = ExampleMachine -wins support = Yes -security = user -passdb backend = tdbsam - -# Example: share /usr/src accessible only to 'developer' user -[src] -path = /usr/src -valid users = developer -writable = yes -browsable = yes -read only = no -guest ok = no -public = no -create mask = 0666 -directory mask = 0755 - - - 全域設定 - - /usr/local/etc/smb4.conf 中加入用來描述網路環境的設定有: - - - - workgroup - - - 要提供的工作群組名稱。 - - - - - netbios name - - - Samba 伺服器已知的 NetBIOS 名稱,預設為主機的 DNS 名稱第一節。 - - - - - server string - - - 會顯示於 net view 輸出結果以及其他會尋找伺服器描述文字並顯示的網路工具的文字。 - - - - - wins support - - - 不論 Samba 是否要作為 WINS 伺服器,請不要在網路上開啟超過一台伺服器的 WINS 功能。 - - - - - - - 安全性設定 - - /usr/local/etc/smb4.conf 中最重要的設定便是安全性模式以及後端密碼格式,以下項目管控的選項有: - - - - security - - - 最常見的設定為 security = share 以及 security = user,若客戶端使用的使用者名稱與在 FreeBSD 主機上使用的使用者名稱相同,則應該使用使用者 (user) 層級的安全性,這是預設的安全性原則且它會要求客戶端在存取共享資源前先登入。 - - 安全性為共享 (share) 層級時,客戶端存取共享資源不需要先使用有效的使用者名稱與密碼登入伺服器,在是在舊版 Samba 所採用的預設安全性模式。 - - - - - passdb backend - - - NIS+ - LDAP - SQL database - - Samba 支援數種不同的後端認証模式,客戶端可以使用 LDAP, NIS+, SQL 資料庫或修改過的密碼檔來認証,建議的認証方式是 tdbsam,適用於簡易的網路環境且在此處說明,對於較大或更複雜的網路則較建議使用 ldapsam,而 smbpasswd 是舊版的預設值,現在已廢棄不使用。 - - - - - - - - <application>Samba</application> 使用者 - - FreeBSD 使用者帳號必須對應 SambaSAMAccount 資料庫, 才能讓 Windows 客戶端存取共享資源,要對應既有的 FreeBSD 使用者帳號可使用 pdbedit8 - - # pdbedit -a username - - 本節只會提到一些最常用的設定,請參考 官方 Samba HOWTO 來取得有關可用設定選項的額外資訊。 - - - - - 啟動 <application>Samba</application> - - 要在開機時啟動 Samba,可加入下行到 /etc/rc.conf - - samba_server_enable="YES" - - 要立即啟動 Samba - - # service samba_server start -Performing sanity check on Samba configuration: OK -Starting nmbd. -Starting smbd. - - Samba 由三個獨立的 Daemon 所組成,nmbdsmbd daemon 可透過 samba_enable 來啟動,若同時也需要 winbind 名稱解析服務則需額外設定: - - winbindd_enable="YES" - - Samba 可以隨時停止,要停止可輸入: - - # service samba_server stop - - Samba 是一套擁有能整合 Microsoft Windows 網路功能的複雜軟體套件,除了在此處說明的基礎設定,要取得更多的功能資訊,請參考 http://www.samba.org - - - - - - NTP 時間校對 - - NTP - ntpd - - - 隨著使用時間,電腦的時鐘會逐漸偏移,這對需要網路上電腦有相同準確度時間的許多網路服務來說是一個大問題。準確的時間同樣能確保檔案時間戳記的一致性。網路時間協定 (Network Time Protocol, NTP) 是一種在網路上可以確保時間準確的方式。 - - FreeBSD 內含 ntpd8 可設定來查詢其他 NTP 伺服器來同步電腦的時間或提供時間服務給其他在網路上的電腦。 - - 本節將會介紹如何設定 FreeBSD 上的 ntpd,更進一步的說明文件可於 /usr/share/doc/ntp/ 找到 HTML 格式的版本。 - - - <acronym>NTP</acronym> 設定 - - NTP - - 在 FreeBSD,內建的 ntpd 可用來同步系統的時間,Ntpd 要使用 rc.conf5 中的變數以及下一節會詳細說明的 /etc/ntp.conf 來設定。 - - Ntpd 與網路中各節點的通訊採用 UDP 封包,在伺服器與 NTP 各節點間的防火牆必須設定成可允許進/出埠 123 的 UDP 封包。 - - - <filename>/etc/ntp.conf</filename> 檔 - - NTP - ntp.conf - - - Ntpd 會讀取 /etc/ntp.conf 來得知要從那些 NTP 伺服器查詢時間,建議可設定多個 NTP 伺服器,來避免萬一其中一個伺服器無法連線或是時間不可靠的問題,當 ntpd 收到回應,它會偏好先採用較可信賴的伺服器。查詢的伺服器可以是來自本地網路的 ISP 所提供,也可從線上可公開存取的NTP 伺服器清單中挑選,您可以選擇一個離您地理位置較近的伺服器並閱讀它的使用規則。也有 可公開存取的 NTP 池線上清單可用,由一個地理區域所組織,除此之外 FreeBSD 提供了計劃贊助的伺服器池,0.freebsd.pool.ntp.org - - - <filename>/etc/ntp.conf</filename> 範例 - 這份簡單的 ntp.conf 範例檔可以放心的使用,其中包含了建議的 restrict 選項可避免伺服器被公開存取。 - -# Disallow ntpq control/query access. Allow peers to be added only -# based on pool and server statements in this file. -restrict default limited kod nomodify notrap noquery nopeer -restrict source limited kod nomodify notrap noquery - -# Allow unrestricted access from localhost for queries and control. -restrict 127.0.0.1 -restrict ::1 - -# Add a specific server. -server ntplocal.example.com iburst - -# Add FreeBSD pool servers until 3-6 good servers are available. -tos minclock 3 maxclock 6 -pool 0.freebsd.pool.ntp.org iburst - -# Use a local leap-seconds file. -leapfile "/var/db/ntpd.leap-seconds.list" - - 這個檔案的格式在 ntp.conf5 有詳細說明,以下的說明僅快速的帶過以上範例檔有用到的一些關鍵字。 - - 預設 NTP 伺服器是可以被任何網路主機所存取,restrict 關鍵字可以控制有那些系統可以存取伺服器。restrict 支援設定多項,每一項可再更進一步調整前面所做的設定。範例中的設定授權本地系統有完整的查詢及控制權限,而遠端系統只有查詢時間的權限。要了解更詳細的資訊請參考 ntp.conf5 中的 Access Control Support 一節。 - - server 關鍵字可指定要查詢的伺服器,設定檔中可以使用多個 server 關鍵字,一個伺服器列一行。pool 關鍵字可指定伺服器池,Ntpd 會加入該伺服器池中的一或多台伺服器,直到數量滿足 tos minclock 的設定。iburst 關鍵字會指示 ntpd 在建立連線時執行 8 連發快速封包交換,可以更快的同步系統時間。 - - leapfile 關鍵字用來指定含有閏秒 (Leap second) 資訊的檔案位置,該檔案是由 periodic8 自動更新。這個關鍵字指定的檔案位置必須與 /etc/rc.conf 中設定的 ntp_db_leapfile 相同。 - - - - 在 <filename>/etc/rc.conf</filename> 中的 NTP 設定項目 - - NTP rc.conf - - 設定 ntpd_enable="YES" 可讓開機時會啟動 ntpd。將 ntpd_enable=YES 加到 /etc/rc.conf 之後,可輸入以下指令讓 ntpd 不需重新開機立即啟動: - - # service ntpd start - - 要使用 ntpd 必須設定 ntpd_enable,以下所列的 rc.conf 變數可視所需請況設定。 - - 設定 ntpd_sync_on_start=YES 可讓 ntpd 可以在系統啟動時一次同步任何差距的時間,正常情況若時鐘的差距超過 1000 秒便會記錄錯誤並且中止。這個設定項目在沒有電池備援的時鐘上特別有用。 - - 設定 ntpd_oomprotect=YES 可保護 ntpd daemon 被系統中止並嘗試從記憶體不足 (Out Of Memory, OOM) 的情況恢復運作。 - - 設定 ntpd_config= 可更改 ntp.conf 檔案的位置。 - - 設定 ntpd_flags= 可設定使用任何其他所需 ntpd 參數,但要避免使用由 /etc/rc.d/ntpd 內部控管的參數如下: - -p (pid 檔案位置) - -c (改用ntpd_config= 設定) - - - - - 使用無特權的 <literal>ntpd</literal> 使用者執行 <application>Ntpd</application> - - 在 FreeBSD 上的 Ntpd 現在可以使用無特權的使用者啟動並執行,要達到這個功能需要 mac_ntpd4 規則模組。/etc/rc.d/ntpd 啟動 Script 會先檢查 NTP 的設定,若可以的話它會載入 mac_ntpd 模組,然後以無特權的使用者 ntpd (user id 123) 來啟動 ntpd。為了避免檔案與目錄存取權限的問題,當設定中有任何檔案相關的選項時,啟動 Script 不會自動以 ntpd 身份啟動 ntpd - - ntpd_flags 若出現以下任何參數則需要以最下面的方式手動設定才能以 ntpd 使用者的身份執行: - -f 或 --driftfile - -i 或 --jaildir - -k 或 --keyfile - -l 或 --logfile - -s 或 --statsdir - - - ntp.conf 若出現以下任何關鍵字則需要以最下面的方式手動設定才能以 ntpd 使用者的身份執行: - crypto - driftfile - key - logdir - statsdir - - - 要手動設定以使用者 ntpd 身份執行 ntpd 你必須: - 確保 ntpd 使用者有權限存取所有在設定檔中指定的檔案與目錄。 - mac_ntpd 模組載入或編譯至核心,請參考 mac_ntpd4 取得詳細資訊。 - /etc/rc.conf 中設定 ntpd_user="ntpd" - - - - - - 在 <acronym>PPP</acronym> 連線使用 <acronym>NTP</acronym> - - ntpd 並不需要永久的網際網路連線才能正常運作,若有一個 PPP 連線是設定成需要時撥號,那麼便需要避免 NTP 的流量觸發撥號或是保持連線不中斷,這可在 /etc/ppp/ppp.conf 使用 filter 項目設定,例如: - - set filter dial 0 deny udp src eq 123 -# Prevent NTP traffic from initiating dial out -set filter dial 1 permit 0 0 -set filter alive 0 deny udp src eq 123 -# Prevent incoming NTP traffic from keeping the connection open -set filter alive 1 deny udp dst eq 123 -# Prevent outgoing NTP traffic from keeping the connection open -set filter alive 2 permit 0/0 0/0 - - 要取得更詳細的資訊,請參考於 ppp8PACKET FILTERING 小節以及在 /usr/share/examples/ppp/ 中的範例。 - - - 部份網際網路存取提供商會封鎖較小編號的埠,這會讓 NTP 無法運作,因為回應永遠無到傳送到該主機。 - - - - - - - - <acronym>iSCSI</acronym> Initiator 與 Target 設定 - - iSCSI is a way to share storage over a - network. Unlike NFS, which works at the file - system level, iSCSI works at the block device - level. - - In iSCSI terminology, the system that - shares the storage is known as the target. - The storage can be a physical disk, or an area representing - multiple disks or a portion of a physical disk. For example, if - the disk(s) are formatted with ZFS, a zvol - can be created to use as the iSCSI - storage. - - The clients which access the iSCSI - storage are called initiators. To - initiators, the storage available through - iSCSI appears as a raw, unformatted disk - known as a LUN. Device nodes for the disk - appear in /dev/ and the device must be - separately formatted and mounted. - - FreeBSD provides a native, - kernel-based iSCSI target and initiator. - This section describes how to configure a FreeBSD system as a - target or an initiator. - - - 設定 <acronym>iSCSI</acronym> Target - - To configure an iSCSI target, create - the /etc/ctl.conf configuration file, add - a line to /etc/rc.conf to make sure the - ctld8 daemon is automatically started at boot, and then - start the daemon. - - The following is an example of a simple - /etc/ctl.conf configuration file. Refer - to ctl.conf5 for a more complete description of this - file's available options. - - portal-group pg0 { - discovery-auth-group no-authentication - listen 0.0.0.0 - listen [::] -} - -target iqn.2012-06.com.example:target0 { - auth-group no-authentication - portal-group pg0 - - lun 0 { - path /data/target0-0 - size 4G - } -} - - The first entry defines the pg0 portal - group. Portal groups define which network addresses the - ctld8 daemon will listen on. The - discovery-auth-group no-authentication - entry indicates that any initiator is allowed to perform - iSCSI target discovery without - authentication. Lines three and four configure ctld8 - to listen on all IPv4 - (listen 0.0.0.0) and - IPv6 (listen [::]) - addresses on the default port of 3260. - - It is not necessary to define a portal group as there is a - built-in portal group called default. In - this case, the difference between default - and pg0 is that with - default, target discovery is always denied, - while with pg0, it is always - allowed. - - The second entry defines a single target. Target has two - possible meanings: a machine serving iSCSI - or a named group of LUNs. This example - uses the latter meaning, where - iqn.2012-06.com.example:target0 is the - target name. This target name is suitable for testing - purposes. For actual use, change - com.example to the real domain name, - reversed. The 2012-06 represents the year - and month of acquiring control of that domain name, and - target0 can be any value. Any number of - targets can be defined in this configuration file. - - The auth-group no-authentication line - allows all initiators to connect to the specified target and - portal-group pg0 makes the target reachable - through the pg0 portal group. - - The next section defines the LUN. To - the initiator, each LUN will be visible as - a separate disk device. Multiple LUNs can - be defined for each target. Each LUN is - identified by a number, where LUN 0 is - mandatory. The path /data/target0-0 line - defines the full path to a file or zvol backing the - LUN. That path must exist before starting - ctld8. The second line is optional and specifies the - size of the LUN. - - Next, to make sure the ctld8 daemon is started at - boot, add this line to - /etc/rc.conf: - - ctld_enable="YES" - - To start ctld8 now, run this command: - - # service ctld start - - As the ctld8 daemon is started, it reads - /etc/ctl.conf. If this file is edited - after the daemon starts, use this command so that the changes - take effect immediately: - - # service ctld reload - - - 認證 - - The previous example is inherently insecure as it uses - no authentication, granting anyone full access to all - targets. To require a username and password to access - targets, modify the configuration as follows: - - auth-group ag0 { - chap username1 secretsecret - chap username2 anothersecret -} - -portal-group pg0 { - discovery-auth-group no-authentication - listen 0.0.0.0 - listen [::] -} - -target iqn.2012-06.com.example:target0 { - auth-group ag0 - portal-group pg0 - lun 0 { - path /data/target0-0 - size 4G - } -} - - The auth-group section defines - username and password pairs. An initiator trying to connect - to iqn.2012-06.com.example:target0 must - first specify a defined username and secret. However, - target discovery is still permitted without authentication. - To require target discovery authentication, set - discovery-auth-group to a defined - auth-group name instead of - no-authentication. - - It is common to define a single exported target for - every initiator. As a shorthand for the syntax above, the - username and password can be specified directly in the - target entry: - - target iqn.2012-06.com.example:target0 { - portal-group pg0 - chap username1 secretsecret - - lun 0 { - path /data/target0-0 - size 4G - } -} - - - - - 設定 <acronym>iSCSI</acronym> Initiator - - - The iSCSI initiator described in this - section is supported starting with FreeBSD 10.0-RELEASE. To - use the iSCSI initiator available in - older versions, refer to iscontrol8. - - - The iSCSI initiator requires that the - iscsid8 daemon is running. This daemon does not use a - configuration file. To start it automatically at boot, add - this line to /etc/rc.conf: - - iscsid_enable="YES" - - To start iscsid8 now, run this command: - - # service iscsid start - - Connecting to a target can be done with or without an - /etc/iscsi.conf configuration file. This - section demonstrates both types of connections. - - - 不使用設定檔連線到 Target - - To connect an initiator to a single target, specify the - IP address of the portal and the name of - the target: - - # iscsictl -A -p 10.10.10.10 -t iqn.2012-06.com.example:target0 - - To verify if the connection succeeded, run - iscsictl without any arguments. The - output should look similar to this: - - Target name Target portal State -iqn.2012-06.com.example:target0 10.10.10.10 Connected: da0 - - In this example, the iSCSI session - was successfully established, with - /dev/da0 representing the attached - LUN. If the - iqn.2012-06.com.example:target0 target - exports more than one LUN, multiple - device nodes will be shown in that section of the - output: - - Connected: da0 da1 da2. - - Any errors will be reported in the output, as well as - the system logs. For example, this message usually means - that the iscsid8 daemon is not running: - - Target name Target portal State -iqn.2012-06.com.example:target0 10.10.10.10 Waiting for iscsid(8) - - The following message suggests a networking problem, - such as a wrong IP address or - port: - - Target name Target portal State -iqn.2012-06.com.example:target0 10.10.10.11 Connection refused - - This message means that the specified target name is - wrong: - - Target name Target portal State -iqn.2012-06.com.example:target0 10.10.10.10 Not found - - This message means that the target requires - authentication: - - Target name Target portal State -iqn.2012-06.com.example:target0 10.10.10.10 Authentication failed - - To specify a CHAP username and - secret, use this syntax: - - # iscsictl -A -p 10.10.10.10 -t iqn.2012-06.com.example:target0 -u user -s secretsecret - - - - 使用設定檔連線到 Target - - To connect using a configuration file, create - /etc/iscsi.conf with contents like - this: - - t0 { - TargetAddress = 10.10.10.10 - TargetName = iqn.2012-06.com.example:target0 - AuthMethod = CHAP - chapIName = user - chapSecret = secretsecret -} - - The t0 specifies a nickname for the - configuration file section. It will be used by the - initiator to specify which configuration to use. The other - lines specify the parameters to use during connection. The - TargetAddress and - TargetName are mandatory, whereas the - other options are optional. In this example, the - CHAP username and secret are - shown. - - To connect to the defined target, specify the - nickname: - - # iscsictl -An t0 - - Alternately, to connect to all targets defined in the - configuration file, use: - - # iscsictl -Aa - - To make the initiator automatically connect to all - targets in /etc/iscsi.conf, add the - following to /etc/rc.conf: - - iscsictl_enable="YES" -iscsictl_flags="-Aa" - - - - - -
- - - - - - - 防火牆 - - - - - Joseph J. - Barbish - - Contributed by - - - - - - - Brad - Davis - - Converted to SGML and updated by - - - - - 防火牆 - - - security - - firewalls - - - - 概述 - - 防火牆能夠過濾透過系統內送 (Incoming) 與外發 (Outgoing) 的流量,防火牆可使用一組或多組 規則 (Rules) 來檢查網路連線中進出的網路封包(Network packets),並且能允許或阻擋其通過。 而防火牆規則可以檢查封包中一個或數個特徵,例如通訊協定類型、來源或目的主機位址,以及來源及目地的連接埠 (Port)。 - - 防火牆可以加強主機或網路的安全性,它可以用來完成下列事情: - - - - 保護並隔離內部網路的應用程式、服務與主機,避免來自網際網路不必要的存取。 - - - - 限制或者禁止內部網路的主機存取網際網路服務。 - - - - 支援網路位址轉譯 (Network address translation, NAT),可允許內部網路使用私有 IP 位址並共用一個連線使用一個 IP 位址連到網際網路或者自動分配一個共用池當中的公開位址。 - - - - FreeBSD 有三種內建於基礎系統的防火牆:PF, IPFWIPFILTERIPF。FreeBSD 也提供了兩種流量限制程式 (Traffic shaper) 來控制頻寬的用量:altq4dummynet4ALTQ 一般配合 PF 使用,而 dummynet 會配合 IPFW。每一種防火牆都會使用規則來管制來自與送往 FreeBSD 的封包,儘管它們用不同的方式運作且有不同的規則語法。 - - FreeBSD 提供多個防火牆是為了滿足不同的需求與各種使用者的偏好,每位使用者應評估那一種防火牆最能滿足其需求。 - - 讀完這章,您將了解: - - - - 如何定義封包過濾規則。 - - - - FreeBSD 內建防火牆之間的差異。 - - - - 如何使用與設定 PF 防火牆。 - - - - 如何使用與設定 IPFW 防火牆。 - - - - 如何使用與設定 IPFILTER 防火牆。 - - - - 在開始閱讀這章之前,您需要: - - - - 了解 FreeBSD 基礎及網路概念。 - - - - - 由於所有防火牆均是以監控所選封包的控制欄位值為基礎運作,所以防火牆規則集的建立者必須很明白 TCP/IP 是如何運作的,在封包的控制欄位中會有那些數值,這些數值會被如何用在一般的連線階段,要了解更多相關資訊,可參考 Daryl's TCP/IP Primer。 - - - - - 防火牆概念 - - - firewall - - rulesets - - - 一個規則集 (Ruleset) 中會有一群根據封包內的資料來判斷通過或封鎖的規則,主機間雙向的封包交換構成一個連線階段的對話,防火牆規則集會同時處理接收自網際網路的封包以及由系統所產生的回應封包,每一個 TCP/IP 服務都會預先定義其通訊協定以及要傾聽的埠,要送往指定服務的封包會誕生在來源位址,使用一個不需特殊權限的埠並傳送給目標位址上特定服務的埠,所有上述過程中的參數均可用來當做建立規則的篩選條件,來允許或封鎖服務。 - - 要查詢一個不清楚的埠號,可參考 /etc/services,或者至 http://en.wikipedia.org/wiki/List_of_TCP_and_UDP_port_numbers 查詢埠號來找出特定埠號的用途。 - - 查看這個連結來了解有 那些埠號會被木馬程式使用 - - FTP 有兩個模式:主動 (Active) 模式與被動 (Passive) 模式,兩者的差異在於取得資料通道的方式,被動模式會較安全,由於資料通道會取自 FTP 連線請求者。想要取得 FTP 與兩種模式更進一步的說明,詳見 http://www.slacksite.com/other/ftp.html - - 防火牆規則集可以為排除式 (exclusive) 或者內含式 (inclusive),一個排除式的防火牆會允許所有的連線通過除了符合規則集的連線,內含式的防火牆則會反過來只允許符合規則集的連線並封鎖其他任何的連線。 - - 內含式的防火牆對於外發的流量有較好的控制,使其成為提供網際網路服務的系統的最佳選擇,它同時可以控制可存取私有網路的網際網路連線,所有不符合該規則的連線會被封鎖並記錄。一般來說,內含式的防火牆會比排除式的防火牆安全,因為內含式的防火牆可以明顯的減少不必要連線所造成風險。 - - - 除非另有說明,否則所有在此章節的範例規則集均為內含式防火牆規則集。 - - - 使用具狀態防火牆 (Stateful firewall) 可以更進一步加強安全性,這種類型的防火牆可持續追蹤連線,只允許與現有連線相符的封包或符合允許條件的新連線通過。 - - 狀態過濾技術 (Stateful filtering) 將所有的流量當做是一個由雙向封包交換所組成的連線階段,當在符合的規則上指定狀態 (State) 時,防火牆會自動產生內部規則來處理該連線階段中每個預期會通過的封包,這種防火牆有足夠的比對能力可以辨別是否為同一個連線階段的封包,任何不符合連線階段樣板的封包都會被自動拒絕。 - - 當連線階段結束時,該規則將會動態狀態表 (Dynamic state table) 中移除。 - - Stateful filtering 讓管理者可以專注於封鎖/傳遞新的連線階段,若新的連線階段通過,那麼該連線階段後續的封包將會自動允許通過,且任何假冒的封包會自動被拒絕。若新的連線階最被封鎖,將不允許其任何後續的封包。Stateful filtering 提供了進階的比對能力,能夠抵禦不同種類由攻擊者發動的 flood 攻擊。 - - NAT 代表 Network Address Translation 即網路位址轉譯,NAT 功能讓在防火牆之後的私有 LAN 可以共用一個 ISP 分配的 IP 位址 (甚至是動態分配的),NAT 每一台在該 LAN 中的電腦均可連線網際網路,而不需要支付 ISP 多個網路帳號或 IP 位址的額外費用。 - - NAT 在當封包要外送到防火牆之外的網際網路時,會自動轉譯每一台電腦在私有 LAN 的 IP 位址成為一個公有 IP 位址,它也同樣會對回傳的封包做反向轉譯。 - - 根據 RFC1918,會保留以下範圍的 IP 位址做為私有網路使用,永遠不會被傳送到網際網路,因此可供 NAT 使用: - - - - 10.0.0.0/8. - - - - 172.16.0.0/12. - - - - 192.168.0.0/16. - - - - - 在使用防火牆規則時要非常小心,有一些設定會將管理者鎖在伺服器之外,保險起見的方式是在本機的 Console 做初次的防火牆設定,不要直接由遠端透過 ssh 來設定防火牆。 - - - - - - PF - - - - - John - Ferrell - - Revised and updated by - - - - - - firewall - - PF - - - 自 FreeBSD 5.3 開始,基礎系統便有內建 OpenBSD's PF 防火牆的移植版本,PF 是一套完整、多功能的防火牆,並可選擇開啟 ALTQ (Alternate Queuing) 的支援來提供 Quality of Service (QoS) 機制。 - - OpenBSD 計劃有維護一份官方參考文件於 PF FAQ ,Peter Hansteen 有維一份詳盡的 PF 教學於 http://home.nuug.no/~peter/pf/。 - - - When reading the PF FAQ, - keep in mind that FreeBSD's version of - PF has diverged substantially from - the upstream OpenBSD version over the years. Not all features - work the same way on FreeBSD as they do in OpenBSD and vice - versa. - - - 要詢問有關設定與執行 PF 防火牆的問題可至 FreeBSD packet filter 郵遞論壇,在詢問問題之前請先查看該郵遞論壇的封存資料,因您的問題可能已有解答。 - - This section of the Handbook focuses on - PF as it pertains to FreeBSD. It - demonstrates how to enable PF and - ALTQ. It also provides several - examples for creating rulesets on a FreeBSD system. - - - 開啟 <application>PF</application> - - To use PF, its kernel - module must be first loaded. This section describes the - entries that can be added to /etc/rc.conf - to enable PF. - - Start by adding pf_enable=yes to - /etc/rc.conf: - - # sysrc pf_enable=yes - - Additional options, described in pfctl8, can be - passed to PF when it is started. - Add or change this entry in /etc/rc.conf - and specify any required flags between the two quotes - (""): - - pf_flags="" # additional flags for pfctl startup - - PF will not start if it cannot - find its ruleset configuration file. By default, FreeBSD does - not ship with a ruleset and there is no - /etc/pf.conf. Example rulesets can be - found in /usr/share/examples/pf/. If a - custom ruleset has been saved somewhere else, add a line to - /etc/rc.conf which specifies the full - path to the file: - - pf_rules="/path/to/pf.conf" - - Logging support for PF is - provided by pflog4. To enable logging support, add - pflog_enable=yes to - /etc/rc.conf: - - # sysrc pflog_enable=yes - - The following lines can also be added to change the - default location of the log file or to specify any additional - flags to pass to pflog4 when it is started: - - pflog_logfile="/var/log/pflog" # where pflogd should store the logfile -pflog_flags="" # additional flags for pflogd startup - - Finally, if there is a LAN behind the - firewall and packets need to be forwarded for the computers on - the LAN, or NAT is - required, enable the following option: - - gateway_enable="YES" # Enable as LAN gateway - - After saving the needed edits, - PF can be started with logging - support by typing: - - # service pf start -# service pflog start - - - - By default, PF reads its - configuration rules from /etc/pf.conf and - modifies, drops, or passes packets according to the rules or - definitions specified in this file. The FreeBSD installation - includes several sample files located in - /usr/share/examples/pf/. Refer to the - PF - FAQ for complete coverage - of PF rulesets. - - To control PF, use - pfctl. summarizes - some useful options to this command. Refer to pfctl8 - for a description of all available options: - - - 有用的 <command>pfctl</command> 選項 - - - - - 指令 - 用途 - - - - - - pfctl - -e - Enable PF. - - - - pfctl - -d - Disable PF. - - - - pfctl -F all - -f /etc/pf.conf - Flush all NAT, filter, state, - and table rules and reload - /etc/pf.conf. - - - - pfctl -s [ rules | nat | - states ] - Report on the filter rules, - NAT rules, or state - table. - - - - pfctl -vnf - /etc/pf.conf - Check /etc/pf.conf for - errors, but do not load ruleset. - - - -
- - - security/sudo is useful for running - commands like pfctl that require elevated - privileges. It can be installed from the Ports - Collection. - - - To keep an eye on the traffic that passes through the - PF firewall, consider installing - the sysutils/pftop package or port. Once - installed, pftop can be run to - view a running snapshot of traffic in a format which is - similar to top1. -
- - - - <application>PF</application> 規則集 - - - - - Peter - Hansteen - N. M. - - Contributed by - - - - - This section demonstrates how to create a customized - ruleset. It starts with the simplest of rulesets and builds - upon its concepts using several examples to demonstrate - real-world usage of PF's many - features. - - The simplest possible ruleset is for a single machine - that does not run any services and which needs access to one - network, which may be the Internet. To create this minimal - ruleset, edit /etc/pf.conf so it looks - like this: - - block in all -pass out all keep state - - The first rule denies all incoming traffic by default. - The second rule allows connections created by this system to - pass out, while retaining state information on those - connections. This state information allows return traffic for - those connections to pass back and should only be used on - machines that can be trusted. The ruleset can be loaded - with: - - # pfctl -e ; pfctl -f /etc/pf.conf - - In addition to keeping state, - PF provides - lists and - macros which can be defined for use - when creating rules. Macros can include lists and need to be - defined before use. As an example, insert these lines at the - very top of the ruleset: - - tcp_services = "{ ssh, smtp, domain, www, pop3, auth, pop3s }" -udp_services = "{ domain }" - - PF understands port names as - well as port numbers, as long as the names are listed in - /etc/services. This example creates two - macros. The first is a list of seven - TCP port names and the second is one - UDP port name. Once defined, macros can be - used in rules. In this example, all traffic is blocked except - for the connections initiated by this system for the seven - specified TCP services and the one - specified UDP service: - - tcp_services = "{ ssh, smtp, domain, www, pop3, auth, pop3s }" -udp_services = "{ domain }" -block all -pass out proto tcp to any port $tcp_services keep state -pass proto udp to any port $udp_services keep state - - Even though UDP is considered to be a - stateless protocol, PF is able to - track some state information. For example, when a - UDP request is passed which asks a name - server about a domain name, PF will - watch for the response to pass it back. - - Whenever an edit is made to a ruleset, the new rules must - be loaded so they can be used: - - # pfctl -f /etc/pf.conf - - If there are no syntax errors, pfctl - will not output any messages during the rule load. Rules can - also be tested before attempting to load them: - - # pfctl -nf /etc/pf.conf - - Including causes the rules to be - interpreted only, but not loaded. This provides an - opportunity to correct any errors. At all times, the last - valid ruleset loaded will be enforced until either - PF is disabled or a new ruleset is - loaded. - - - Adding to a pfctl - ruleset verify or load will display the fully parsed rules - exactly the way they will be loaded. This is extremely - useful when debugging rules. - - - - 使用 NAT 的簡單通訊閘 - - This section demonstrates how to configure a FreeBSD system - running PF to act as a gateway - for at least one other machine. The gateway needs at least - two network interfaces, each connected to a separate - network. In this example, xl1 is - connected to the Internet and xl0 is - connected to the internal network. - - First, enable the gateway to let the machine - forward the network traffic it receives on one interface to - another interface. This sysctl - setting will forward IPv4 packets: - - # sysctl net.inet.ip.forwarding=1 - - To forward IPv6 traffic, use: - - # sysctl net.inet6.ip6.forwarding=1 - - To enable these settings at system boot, use - sysrc8 to add them to - /etc/rc.conf: - - # sysrc gateway_enable=yes -# sysrc ipv6_gateway_enable=yes - - Verify with ifconfig that both of the - interfaces are up and running. - - Next, create the PF rules to - allow the gateway to pass traffic. While the following rule - allows stateful traffic to pass from the Internet to hosts - on the network, the to keyword does not - guarantee passage all the way from source to - destination: - - pass in on xl1 from xl1:network to xl0:network port $ports keep state - - That rule only lets the traffic pass in to the gateway - on the internal interface. To let the packets go further, a - matching rule is needed: - - pass out on xl0 from xl1:network to xl0:network port $ports keep state - - While these two rules will work, rules this specific are - rarely needed. For a busy network admin, a readable ruleset - is a safer ruleset. The remainder of this section - demonstrates how to keep the rules as simple as possible for - readability. For example, those two rules could be - replaced with one rule: - - pass from xl1:network to any port $ports keep state - - The interface:network notation can be - replaced with a macro to make the ruleset even more - readable. For example, a $localnet macro - could be defined as the network directly attached to the - internal interface ($xl1:network). - Alternatively, the definition of - $localnet could be changed to an - IP address/netmask notation to denote - a network, such as 192.168.100.1/24 for a - subnet of private addresses. - - If required, $localnet could even be - defined as a list of networks. Whatever the specific needs, - a sensible $localnet definition could be - used in a typical pass rule as follows: - - pass from $localnet to any port $ports keep state - - The following sample ruleset allows all traffic - initiated by machines on the internal network. It first - defines two macros to represent the external and internal - 3COM interfaces of the gateway. - - - For dialup users, the external interface will use - tun0. For an - ADSL connection, specifically those - using PPP over Ethernet - (PPPoE), the correct external - interface is tun0, not the physical - Ethernet interface. - - - ext_if = "xl0" # macro for external interface - use tun0 for PPPoE -int_if = "xl1" # macro for internal interface -localnet = $int_if:network -# ext_if IP address could be dynamic, hence ($ext_if) -nat on $ext_if from $localnet to any -> ($ext_if) -block all -pass from { lo0, $localnet } to any keep state - - This ruleset introduces the nat rule - which is used to handle the network address translation from - the non-routable addresses inside the internal network to - the IP address assigned to the external - interface. The parentheses surrounding the last part of the - nat rule ($ext_if) is included when the - IP address of the external interface is - dynamically assigned. It ensures that network traffic runs - without serious interruptions even if the external - IP address changes. - - Note that this ruleset probably allows more traffic to - pass out of the network than is needed. One reasonable - setup could create this macro: - - client_out = "{ ftp-data, ftp, ssh, domain, pop3, auth, nntp, http, \ - https, cvspserver, 2628, 5999, 8000, 8080 }" - - to use in the main pass rule: - - pass inet proto tcp from $localnet to any port $client_out \ - flags S/SA keep state - - A few other pass rules may be needed. This one enables - SSH on the external interface: - - pass in inet proto tcp to $ext_if port ssh - - This macro definition and rule allows - DNS and NTP for - internal clients: - - udp_services = "{ domain, ntp }" -pass quick inet proto { tcp, udp } to any port $udp_services keep state - - Note the quick keyword in this rule. - Since the ruleset consists of several rules, it is important - to understand the relationships between the rules in a - ruleset. Rules are evaluated from top to bottom, in the - sequence they are written. For each packet or connection - evaluated by PF, - the last matching rule in the ruleset - is the one which is applied. However, when a packet matches - a rule which contains the quick keyword, - the rule processing stops and the packet is treated - according to that rule. This is very useful when an - exception to the general rules is needed. - - - - 建立 <acronym>FTP</acronym> Proxy - - Configuring working FTP rules can be - problematic due to the nature of the FTP - protocol. FTP pre-dates firewalls by - several decades and is insecure in its design. The most - common points against using FTP - include: - - - - Passwords are transferred in the clear. - - - - The protocol demands the use of at least two - TCP connections (control and data) on - separate ports. - - - - When a session is established, data is communicated - using randomly selected ports. - - - - All of these points present security challenges, even - before considering any potential security weaknesses in - client or server software. More secure alternatives for - file transfer exist, such as sftp1 or scp1, - which both feature authentication and data transfer over - encrypted connections.. - - For those situations when FTP is - required, PF provides - redirection of FTP traffic to a small - proxy program called ftp-proxy8, which is included in - the base system of FreeBSD. The role of the proxy is to - dynamically insert and delete rules in the ruleset, using a - set of anchors, to correctly handle - FTP traffic. - - To enable the FTP proxy, add this - line to /etc/rc.conf: - - ftpproxy_enable="YES" - - Then start the proxy by running service - ftp-proxy start. - - For a basic configuration, three elements need to be - added to /etc/pf.conf. First, the - anchors which the proxy will use to insert the rules it - generates for the FTP sessions: - - nat-anchor "ftp-proxy/*" -rdr-anchor "ftp-proxy/*" - - Second, a pass rule is needed to allow - FTP traffic in to the proxy. - - Third, redirection and NAT rules need - to be defined before the filtering rules. Insert this - rdr rule immediately after the - nat rule: - - rdr pass on $int_if proto tcp from any to any port ftp -> 127.0.0.1 port 8021 - - Finally, allow the redirected traffic to pass: - - pass out proto tcp from $proxy to any port ftp - - where $proxy expands to the address - the proxy daemon is bound to. - - Save /etc/pf.conf, load the new - rules, and verify from a client that FTP - connections are working: - - # pfctl -f /etc/pf.conf - - This example covers a basic setup where the clients in - the local network need to contact FTP - servers elsewhere. This basic configuration should - work well with most combinations of FTP - clients and servers. As shown in ftp-proxy8, the - proxy's behavior can be changed in various ways by adding - options to the ftpproxy_flags= line. - Some clients or servers may have specific quirks that must - be compensated for in the configuration, or there may be a - need to integrate the proxy in specific ways such as - assigning FTP traffic to a specific - queue. - - For ways to run an FTP server - protected by PF and - ftp-proxy8, configure a separate - ftp-proxy in reverse mode, using - , on a separate port with its own - redirecting pass rule. - - - - 管理 <acronym>ICMP</acronym> - - Many of the tools used for debugging or troubleshooting - a TCP/IP network rely on the Internet - Control Message Protocol (ICMP), which - was designed specifically with debugging in mind. - - The ICMP protocol sends and receives - control messages between hosts and - gateways, mainly to provide feedback to a sender about any - unusual or difficult conditions enroute to the target host. - Routers use ICMP to negotiate packet - sizes and other transmission parameters in a process often - referred to as path MTU - discovery. - - From a firewall perspective, some - ICMP control messages are vulnerable to - known attack vectors. Also, letting all diagnostic traffic - pass unconditionally makes debugging easier, but it also - makes it easier for others to extract information about the - network. For these reasons, the following rule may not be - optimal: - - pass inet proto icmp from any to any - - One solution is to let all ICMP - traffic from the local network through while stopping all - probes from outside the network: - - pass inet proto icmp from $localnet to any keep state -pass inet proto icmp from any to $ext_if keep state - - Additional options are available which demonstrate some - of PF's flexibility. For - example, rather than allowing all ICMP - messages, one can specify the messages used by ping8 - and traceroute8. Start by defining a macro for that - type of message: - - icmp_types = "echoreq" - - and a rule which uses the macro: - - pass inet proto icmp all icmp-type $icmp_types keep state - - If other types of ICMP packets are - needed, expand icmp_types to a list of - those packet types. Type more - /usr/src/sbin/pfctl/pfctl_parser.c to see - the list of ICMP message types supported - by PF. Refer to http://www.iana.org/assignments/icmp-parameters/icmp-parameters.xhtml - for an explanation of each message type. - - Since Unix traceroute uses - UDP by default, another rule is needed to - allow Unix traceroute: - - # allow out the default range for traceroute(8): -pass out on $ext_if inet proto udp from any to any port 33433 >< 33626 keep state - - Since TRACERT.EXE on Microsoft - Windows systems uses ICMP echo request - messages, only the first rule is needed to allow network - traces from those systems. Unix - traceroute can be instructed to use other - protocols as well, and will use ICMP echo - request messages if is used. Check the - traceroute8 man page for details. - - - Path <acronym>MTU</acronym> Discovery - - Internet protocols are designed to be device - independent, and one consequence of device independence is - that the optimal packet size for a given connection cannot - always be predicted reliably. The main constraint on - packet size is the Maximum Transmission - Unit (MTU) which sets the - upper limit on the packet size for an interface. Type - ifconfig to view the - MTUs for a system's network - interfaces. - - TCP/IP uses a process known as path - MTU discovery to determine the right - packet size for a connection. This process sends packets - of varying sizes with the Do not fragment - flag set, expecting an ICMP return - packet of type 3, code 4 when the upper - limit has been reached. Type 3 means destination - unreachable, and code 4 is short for - fragmentation needed, but the do-not-fragment flag - is set. To allow path MTU discovery in order - to support connections to other MTUs, - add the destination unreachable type to - the icmp_types macro: - - icmp_types = "{ echoreq, unreach }" - - Since the pass rule already uses that macro, it does - not need to be modified to support the new - ICMP type: - - pass inet proto icmp all icmp-type $icmp_types keep state - - PF allows filtering on all - variations of ICMP types and codes. - The list of possible types and codes are documented in - icmp4 and icmp64. - - - - - 使用 Tables - - Some types of data are relevant to filtering and - redirection at a given time, but their definition is too - long to be included in the ruleset file. - PF supports the use of tables, - which are defined lists that can be manipulated without - needing to reload the entire ruleset, and which can provide - fast lookups. Table names are always enclosed within - < >, like this: - - table <clients> { 192.168.2.0/24, !192.168.2.5 } - - In this example, the 192.168.2.0/24 - network is part of the table, except for the address - 192.168.2.5, which is excluded using the - ! operator. It is also possible to load - tables from files where each item is on a separate line, as - seen in this example - /etc/clients: - - 192.168.2.0/24 -!192.168.2.5 - - To refer to the file, define the table like this: - - table <clients> persist file "/etc/clients" - - Once the table is defined, it can be referenced by a - rule: - - pass inet proto tcp from <clients> to any port $client_out flags S/SA keep state - - A table's contents can be manipulated live, using - pfctl. This example adds another network - to the table: - - # pfctl -t clients -T add 192.168.1.0/16 - - Note that any changes made this way will take affect - now, making them ideal for testing, but will not survive a - power failure or reboot. To make the changes permanent, - modify the definition of the table in the ruleset or edit - the file that the table refers to. One can maintain the - on-disk copy of the table using a cron8 job which - dumps the table's contents to disk at regular intervals, - using a command such as pfctl -t clients -T show - >/etc/clients. Alternatively, - /etc/clients can be updated with the - in-memory table contents: - - # pfctl -t clients -T replace -f /etc/clients - - - - 使用 Overload Tables 保護 <acronym>SSH</acronym> - - Those who run SSH on an external - interface have probably seen something like this in the - authentication logs: - - Sep 26 03:12:34 skapet sshd[25771]: Failed password for root from 200.72.41.31 port 40992 ssh2 -Sep 26 03:12:34 skapet sshd[5279]: Failed password for root from 200.72.41.31 port 40992 ssh2 -Sep 26 03:12:35 skapet sshd[5279]: Received disconnect from 200.72.41.31: 11: Bye Bye -Sep 26 03:12:44 skapet sshd[29635]: Invalid user admin from 200.72.41.31 -Sep 26 03:12:44 skapet sshd[24703]: input_userauth_request: invalid user admin -Sep 26 03:12:44 skapet sshd[24703]: Failed password for invalid user admin from 200.72.41.31 port 41484 ssh2 - - This is indicative of a brute force attack where - somebody or some program is trying to discover the user name - and password which will let them into the system. - - If external SSH access is needed for - legitimate users, changing the default port used by - SSH can offer some protection. However, - PF provides a more elegant - solution. Pass rules can contain limits on what connecting - hosts can do and violators can be banished to a table of - addresses which are denied some or all access. It is even - possible to drop all existing connections from machines - which overreach the limits. - - To configure this, create this table in the tables - section of the ruleset: - - table <bruteforce> persist - - Then, somewhere early in the ruleset, add rules to block - brute access while allowing legitimate access: - - block quick from <bruteforce> -pass inet proto tcp from any to $localnet port $tcp_services \ - flags S/SA keep state \ - (max-src-conn 100, max-src-conn-rate 15/5, \ - overload <bruteforce> flush global) - - The part in parentheses defines the limits and the - numbers should be changed to meet local requirements. It - can be read as follows: - - max-src-conn is the number of - simultaneous connections allowed from one host. - - max-src-conn-rate is the rate of new - connections allowed from any single host - (15) per number of seconds - (5). - - overload <bruteforce> means - that any host which exceeds these limits gets its address - added to the bruteforce table. The - ruleset blocks all traffic from addresses in the - bruteforce table. - - Finally, flush global says that when - a host reaches the limit, that all - (global) of that host's connections will - be terminated (flush). - - - These rules will not block slow - bruteforcers, as described in http://home.nuug.no/~peter/hailmary2013/. - - - This example ruleset is intended mainly as an - illustration. For example, if a generous number of - connections in general are wanted, but the desire is to be - more restrictive when it comes to - ssh, supplement the rule above - with something like the one below, early on in the rule - set: - - pass quick proto { tcp, udp } from any to any port ssh \ - flags S/SA keep state \ - (max-src-conn 15, max-src-conn-rate 5/3, \ - overload <bruteforce> flush global) - - - It May Not be Necessary to Block All - Overloaders - - It is worth noting that the overload mechanism is a - general technique which does not apply exclusively to - SSH, and it is not always optimal to - entirely block all traffic from offenders. - - For example, an overload rule could be used to - protect a mail service or a web service, and the overload - table could be used in a rule to assign offenders to a - queue with a minimal bandwidth allocation or to redirect - to a specific web page. - - - Over time, tables will be filled by overload rules and - their size will grow incrementally, taking up more memory. - Sometimes an IP address that is blocked - is a dynamically assigned one, which has since been assigned - to a host who has a legitimate reason to communicate with - hosts in the local network. - - For situations like these, - pfctl provides the ability to - expire table entries. For example, this command will remove - <bruteforce> table entries which - have not been referenced for 86400 - seconds: - - # pfctl -t bruteforce -T expire 86400 - - Similar functionality is provided by - security/expiretable, which removes table - entries which have not been accessed for a specified period - of time. - - Once installed, expiretable - can be run to remove <bruteforce> - table entries older than a specified age. This example - removes all entries older than 24 hours: - - /usr/local/sbin/expiretable -v -d -t 24h bruteforce - - - - <acronym>SPAM</acronym> 防護 - - Not to be confused with the - spamd daemon which comes bundled - with spamassassin, - mail/spamd can be configured with - PF to provide an outer defense - against SPAM. This - spamd hooks into the - PF configuration using a set of - redirections. - - Spammers tend to send a large number of messages, and - SPAM is mainly sent from a few spammer - friendly networks and a large number of hijacked machines, - both of which are reported to - blacklists fairly quickly. - - When an SMTP connection from an - address in a blacklist is received, - spamd presents its banner and - immediately switches to a mode where it answers - SMTP traffic one byte at a time. This - technique, which is intended to waste as much time as - possible on the spammer's end, is called - tarpitting. The specific - implementation which uses one byte SMTP - replies is often referred to as - stuttering. - - This example demonstrates the basic procedure for - setting up spamd with - automatically updated blacklists. Refer to the man pages - which are installed with mail/spamd for - more information. - - - Configuring <application>spamd</application> - - - Install the mail/spamd package - or port. To use spamd's - greylisting features, fdescfs5 must be mounted at - /dev/fd. Add the following line to - /etc/fstab: - - fdescfs /dev/fd fdescfs rw 0 0 - - Then, mount the filesystem: - - # mount fdescfs - - - - Next, edit the PF ruleset - to include: - - table <spamd> persist -table <spamd-white> persist -rdr pass on $ext_if inet proto tcp from <spamd> to \ - { $ext_if, $localnet } port smtp -> 127.0.0.1 port 8025 -rdr pass on $ext_if inet proto tcp from !<spamd-white> to \ - { $ext_if, $localnet } port smtp -> 127.0.0.1 port 8025 - - The two tables <spamd> and - <spamd-white> are essential. - SMTP traffic from an address listed - in <spamd> but not in - <spamd-white> is redirected to - the spamd daemon listening at - port 8025. - - - - The next step is to configure - spamd in - /usr/local/etc/spamd.conf and to - add some rc.conf parameters. - - The installation of mail/spamd - includes a sample configuration file - (/usr/local/etc/spamd.conf.sample) - and a man page for spamd.conf. - Refer to these for additional configuration options - beyond those shown in this example. - - One of the first lines in the configuration file - that does not begin with a # comment - sign contains the block which defines the - all list, which specifies the lists - to use: - - all:\ - :traplist:whitelist: - - This entry adds the desired blacklists, separated by - colons (:). To use a whitelist to - subtract addresses from a blacklist, add the name of the - whitelist immediately after the - name of that blacklist. For example: - :blacklist:whitelist:. - - This is followed by the specified blacklist's - definition: - - traplist:\ - :black:\ - :msg="SPAM. Your address %A has sent spam within the last 24 hours":\ - :method=http:\ - :file=www.openbsd.org/spamd/traplist.gz - - where the first line is the name of the blacklist - and the second line specifies the list type. The - msg field contains the message to - display to blacklisted senders during the - SMTP dialogue. The - method field specifies how - spamd-setup fetches the list - data; supported methods are http, - ftp, from a - file in a mounted file system, and - via exec of an external program. - Finally, the file field specifies - the name of the file spamd - expects to receive. - - The definition of the specified whitelist is - similar, but omits the msg field - since a message is not needed: - - whitelist:\ - :white:\ - :method=file:\ - :file=/var/mail/whitelist.txt - - - Choose Data Sources with Care - - Using all the blacklists in the sample - spamd.conf will blacklist large - blocks of the Internet. Administrators need to edit - the file to create an optimal configuration which uses - applicable data sources and, when necessary, uses - custom lists. - - - Next, add this entry to - /etc/rc.conf. Additional flags are - described in the man page specified by the - comment: - - spamd_flags="-v" # use "" and see spamd-setup(8) for flags - - When finished, reload the ruleset, start - spamd by typing - service obspamd start, and complete - the configuration using spamd-setup. - Finally, create a cron8 job which calls - spamd-setup to update the tables at - reasonable intervals. - - - - On a typical gateway in front of a mail server, hosts - will soon start getting trapped within a few seconds to - several minutes. - - PF also supports - greylisting, which temporarily - rejects messages from unknown hosts with - 45n codes. Messages from - greylisted hosts which try again within a reasonable time - are let through. Traffic from senders which are set up to - behave within the limits set by RFC 1123 and RFC 2821 are - immediately let through. - - More information about greylisting as a technique can be - found at the greylisting.org - web site. The most amazing thing about greylisting, apart - from its simplicity, is that it still works. Spammers and - malware writers have been very slow to adapt to bypass this - technique. - - The basic procedure for configuring greylisting is as - follows: - - - Configuring Greylisting - - - Make sure that fdescfs5 is mounted as - described in Step 1 of the previous Procedure. - - - - To run spamd in - greylisting mode, add this line to - /etc/rc.conf: - - spamd_grey="YES" # use spamd greylisting if YES - - Refer to the spamd man - page for descriptions of additional related - parameters. - - - - To complete the greylisting setup: - - # service obspamd restart -# service obspamlogd start - - - - Behind the scenes, the spamdb - database tool and the spamlogd - whitelist updater perform essential functions for the - greylisting feature. spamdb is - the administrator's main interface to managing the black, - grey, and white lists via the contents of the - /var/db/spamdb database. - - - - 網路保健 - - This section describes how - block-policy, scrub, - and antispoof can be used to make the - ruleset behave sanely. - - The block-policy is an option which - can be set in the options part of the - ruleset, which precedes the redirection and filtering rules. - This option determines which feedback, if any, - PF sends to hosts that are - blocked by a rule. The option has two possible values: - drop drops blocked packets with no - feedback, and return returns a status - code such as - Connection refused. - - If not set, the default policy is - drop. To change the - block-policy, specify the desired - value: - - set block-policy return - - In PF, - scrub is a keyword which enables network - packet normalization. This process reassembles fragmented - packets and drops TCP packets that have invalid flag - combinations. Enabling scrub provides a - measure of protection against certain kinds of attacks - based on incorrect handling of packet fragments. A number - of options are available, but the simplest form is suitable - for most configurations: - - scrub in all - - Some services, such as NFS, require - specific fragment handling options. Refer to https://home.nuug.no/~peter/pf/en/scrub.html - for more information. - - This example reassembles fragments, clears the - do not fragment bit, and sets the maximum - segment size to 1440 bytes: - - scrub in all fragment reassemble no-df max-mss 1440 - - The antispoof mechanism protects - against activity from spoofed or forged - IP addresses, mainly by blocking packets - appearing on interfaces and in directions which are - logically not possible. - - These rules weed out spoofed traffic coming in from the - rest of the world as well as any spoofed packets which - originate in the local network: - - antispoof for $ext_if -antispoof for $int_if - - - - 處理不可路由 (Non-Routable) 的位址 - - Even with a properly configured gateway to handle - network address translation, one may have to compensate for - other people's misconfigurations. A common misconfiguration - is to let traffic with non-routable addresses out to the - Internet. Since traffic from non-routeable addresses can - play a part in several DoS attack - techniques, consider explicitly blocking traffic from - non-routeable addresses from entering the network through - the external interface. - - In this example, a macro containing non-routable - addresses is defined, then used in blocking rules. Traffic - to and from these addresses is quietly dropped on the - gateway's external - interface. - - martians = "{ 127.0.0.0/8, 192.168.0.0/16, 172.16.0.0/12, \ - 10.0.0.0/8, 169.254.0.0/16, 192.0.2.0/24, \ - 0.0.0.0/8, 240.0.0.0/4 }" - -block drop in quick on $ext_if from $martians to any -block drop out quick on $ext_if from any to $martians - - - - - 開啟 <application>ALTQ</application> - - On FreeBSD, ALTQ can be used with - PF to provide Quality of Service - (QOS). Once - ALTQ is enabled, queues can be - defined in the ruleset which determine the processing priority - of outbound packets. - - Before enabling ALTQ, refer to - altq4 to determine if the drivers for the network cards - installed on the system support it. - - ALTQ is not available as a - loadable kernel module. If the system's interfaces support - ALTQ, create a custom kernel using - the instructions in . The - following kernel options are available. The first is needed - to enable ALTQ. At least one of - the other options is necessary to specify the queueing - scheduler algorithm: - - options ALTQ -options ALTQ_CBQ # Class Based Queuing (CBQ) -options ALTQ_RED # Random Early Detection (RED) -options ALTQ_RIO # RED In/Out -options ALTQ_HFSC # Hierarchical Packet Scheduler (HFSC) -options ALTQ_PRIQ # Priority Queuing (PRIQ) - - The following scheduler algorithms are available: - - - - CBQ - - Class Based Queuing (CBQ) is - used to divide a connection's bandwidth into different - classes or queues to prioritize traffic based on filter - rules. - - - - - RED - - Random Early Detection (RED) is - used to avoid network congestion by measuring the length - of the queue and comparing it to the minimum and maximum - thresholds for the queue. When the queue is over the - maximum, all new packets are randomly dropped. - - - - - RIO - - In Random Early Detection In and Out - (RIO) mode, RED - maintains multiple average queue lengths and multiple - threshold values, one for each - QOS level. - - - - - HFSC - - Hierarchical Fair Service Curve Packet Scheduler - (HFSC) is described in http://www-2.cs.cmu.edu/~hzhang/HFSC/main.html. - - - - - PRIQ - - Priority Queuing (PRIQ) always - passes traffic that is in a higher queue first. - - - - - More information about the scheduling - algorithms and example rulesets are available at the OpenBSD's web archive. - -
- - - <application>IPFW</application> - - - firewall - - IPFW - - - IPFW 是一套專為 FreeBSD 所寫的具狀態防火牆 (Stateful firewall),它同時支援 IPv4IPv6,它由數個元件組成:核心防火牆過濾規則處理器與其整合的封包計帳設施、記錄設施、NATdummynet4 流量限制程式、轉送設施、橋接設施以及 ipstealth 設施。 - - FreeBSD 提供一個範本規則集於 /etc/rc.firewall,其定義了幾個常見情境會使用的防火牆類型來協助初學的使用者撰寫合適的規則集。IPFW 提供了強大的語法讓進階的使用者可以用來自訂符合環境安全性要求的規則集。 - - 本節將介紹如何開啟 IPFW、規則語法的概要以及示範幾種常見情境所使用的規則集。 - - - 開啟 <application>IPFW</application> - - - IPFW - - enabling - - - IPFW is included in the basic - FreeBSD install as a kernel loadable module, meaning that a - custom kernel is not needed in order to enable - IPFW. - - For those users who wish to statically compile - IPFW support into a custom kernel, - see . - - To configure the system to enable - IPFW at boot time, add - firewall_enable="YES" to - /etc/rc.conf: - - # sysrc firewall_enable="YES" - - To use one of the default firewall types provided by FreeBSD, - add another line which specifies the type: - - # sysrc firewall_type="open" - - The available types are: - - - - open: passes all traffic. - - - client: protects only this - machine. - - - simple: protects the whole - network. - - - closed: entirely disables IP - traffic except for the loopback interface. - - - workstation: protects only this - machine using stateful rules. - - - UNKNOWN: disables the loading of - firewall rules. - - - filename: - full path of the file containing the firewall - ruleset. - - - - If firewall_type is set to either - client or simple, - modify the default rules found in - /etc/rc.firewall to fit the - configuration of the system. - - Note that the filename type is used to - load a custom ruleset. - - An alternate way to load a custom ruleset is to set the - firewall_script variable to the absolute - path of an executable script that - includes IPFW commands. The - examples used in this section assume that the - firewall_script is set to - /etc/ipfw.rules: - - # sysrc firewall_script="/etc/ipfw.rules" - - To enable logging through syslogd8, include this - line: - - # sysrc firewall_logging="YES" - - - Only firewall rules with the option will - be logged. The default rules do not include this option and it - must be manually added. Therefore it is advisable that the default - ruleset is edited for logging. In addition, log rotation may be - desired if the logs are stored in a separate file. - - - There is no /etc/rc.conf variable to - set logging limits. To limit the number of times a rule is - logged per connection attempt, specify the number using this - line in /etc/sysctl.conf: - - # echo "net.inet.ip.fw.verbose_limit=5" >> /etc/sysctl.conf - - To enable logging through a dedicated interface named - ipfw0, add this line to - /etc/rc.conf instead: - - # sysrc firewall_logif="YES" - - Then use tcpdump to see what is - being logged: - - # tcpdump -t -n -i ipfw0 - - - There is no overhead due to logging unless - tcpdump is attached. - - - After saving the needed edits, start the firewall. To - enable logging limits now, also set the - sysctl value specified above: - - # service ipfw start -# sysctl net.inet.ip.fw.verbose_limit=5 - - - - <application>IPFW</application> 規則語法 - - - IPFW - - rule processing order - - - When a packet enters the IPFW - firewall, it is compared against the first rule in the ruleset - and progresses one rule at a time, moving from top to bottom - in sequence. When the packet matches the selection parameters - of a rule, the rule's action is executed and the search of the - ruleset terminates for that packet. This is referred to as - first match wins. If the packet does not match - any of the rules, it gets caught by the mandatory - IPFW default rule number 65535, - which denies all packets and silently discards them. However, - if the packet matches a rule that contains the - count, skipto, or - tee keywords, the search continues. Refer - to ipfw8 for details on how these keywords affect rule - processing. - - - IPFW - - rule syntax - - - When creating an - IPFW rule, keywords must be - written in the following order. Some keywords are mandatory - while other keywords are optional. The words shown in - uppercase represent a variable and the words shown in - lowercase must precede the variable that follows it. The - # symbol is used to mark the start of a - comment and may appear at the end of a rule or on its own - line. Blank lines are ignored. - - CMD RULE_NUMBER set SET_NUMBER ACTION log - LOG_AMOUNT PROTO from SRC SRC_PORT to DST DST_PORT - OPTIONS - - This section provides an overview of these keywords and - their options. It is not an exhaustive list of every possible - option. Refer to ipfw8 for a complete description of - the rule syntax that can be used when creating - IPFW rules. - - - - CMD - - Every rule must start with - ipfw add. - - - - - RULE_NUMBER - - Each rule is associated with a number from - 1 to - 65534. The number is used to - indicate the order of rule processing. Multiple rules - can have the same number, in which case they are applied - according to the order in which they have been - added. - - - - - SET_NUMBER - - Each rule is associated with a set number from - 0 to 31. - Sets can be individually disabled or enabled, making it - possible to quickly add or delete a set of rules. If a - SET_NUMBER is not specified, the rule will be added to - set 0. - - - - - ACTION - - A rule can be associated with one of the following - actions. The specified action will be executed when the - packet matches the selection criterion of the - rule. - - allow | accept | pass | - permit: these keywords are equivalent and - allow packets that match the rule. - - check-state: checks the - packet against the dynamic state table. If a match is - found, execute the action associated with the rule which - generated this dynamic rule, otherwise move to the next - rule. A check-state rule does not - have selection criterion. If no - check-state rule is present in the - ruleset, the dynamic rules table is checked at the first - keep-state or - limit rule. - - count: updates counters for - all packets that match the rule. The search continues - with the next rule. - - deny | drop: either word - silently discards packets that match this rule. - - Additional actions are available. Refer to - ipfw8 for details. - - - - - LOG_AMOUNT - - When a packet matches a rule with the - log keyword, a message will be logged - to syslogd8 with a facility name of - SECURITY. Logging only occurs if the - number of packets logged for that particular rule does - not exceed a specified LOG_AMOUNT. If no - LOG_AMOUNT is specified, the limit is taken from the - value of - net.inet.ip.fw.verbose_limit. A - value of zero removes the logging limit. Once the limit - is reached, logging can be re-enabled by clearing the - logging counter or the packet counter for that rule, - using ipfw resetlog. - - - Logging is done after all other packet matching - conditions have been met, and before performing the - final action on the packet. The administrator decides - which rules to enable logging on. - - - - - - PROTO - - This optional value can be used to specify any - protocol name or number found in - /etc/protocols. - - - - - SRC - - The from keyword must be followed - by the source address or a keyword that represents the - source address. An address can be represented by - any, me (any - address configured on an interface on this system), - me6, (any IPv6 - address configured on an interface on this system), or - table followed by the number of a - lookup table which contains a list of addresses. When - specifying an IP address, it can be - optionally followed by its CIDR mask - or subnet mask. For example, - 1.2.3.4/25 or - 1.2.3.4:255.255.255.128. - - - - - SRC_PORT - - An optional source port can be specified using the - port number or name from - /etc/services. - - - - - DST - - The to keyword must be followed - by the destination address or a keyword that represents - the destination address. The same keywords and - addresses described in the SRC section can be used to - describe the destination. - - - - - DST_PORT - - An optional destination port can be specified using - the port number or name from - /etc/services. - - - - - OPTIONS - - Several keywords can follow the source and - destination. As the name suggests, OPTIONS are - optional. Commonly used options include - in or out, which - specify the direction of packet flow, - icmptypes followed by the type of - ICMP message, and - keep-state. - - When a keep-state rule is - matched, the firewall will create a dynamic rule which - matches bidirectional traffic between the source and - destination addresses and ports using the same - protocol. - - The dynamic rules facility is vulnerable to resource - depletion from a SYN-flood attack which would open a - huge number of dynamic rules. To counter this type of - attack with IPFW, use - limit. This option limits the number - of simultaneous sessions by checking the open dynamic - rules, counting the number of times this rule and - IP address combination occurred. If - this count is greater than the value specified by - limit, the packet is - discarded. - - Dozens of OPTIONS are available. Refer to - ipfw8 for a description of each available - option. - - - - - - - 範例規則集 - - This section demonstrates how to create an example - stateful firewall ruleset script named - /etc/ipfw.rules. In this example, all - connection rules use in or - out to clarify the direction. They also - use via - interface-name to specify - the interface the packet is traveling over. - - - When first creating or testing a firewall ruleset, - consider temporarily setting this tunable: - - net.inet.ip.fw.default_to_accept="1" - - This sets the default policy of ipfw8 to be more - permissive than the default deny ip from any to - any, making it slightly more difficult to get - locked out of the system right after a reboot. - - - The firewall script begins by indicating that it is a - Bourne shell script and flushes any existing rules. It then - creates the cmd variable so that - ipfw add does not have to be typed at the - beginning of every rule. It also defines the - pif variable which represents the name of - the interface that is attached to the Internet. - - #!/bin/sh -# Flush out the list before we begin. -ipfw -q -f flush - -# Set rules command prefix -cmd="ipfw -q add" -pif="dc0" # interface name of NIC attached to Internet - - The first two rules allow all traffic on the trusted - internal interface and on the loopback interface: - - # Change xl0 to LAN NIC interface name -$cmd 00005 allow all from any to any via xl0 - -# No restrictions on Loopback Interface -$cmd 00010 allow all from any to any via lo0 - - The next rule allows the packet through if it matches an - existing entry in the dynamic rules table: - - $cmd 00101 check-state - - The next set of rules defines which stateful connections - internal systems can create to hosts on the Internet: - - # Allow access to public DNS -# Replace x.x.x.x with the IP address of a public DNS server -# and repeat for each DNS server in /etc/resolv.conf -$cmd 00110 allow tcp from any to x.x.x.x 53 out via $pif setup keep-state -$cmd 00111 allow udp from any to x.x.x.x 53 out via $pif keep-state - -# Allow access to ISP's DHCP server for cable/DSL configurations. -# Use the first rule and check log for IP address. -# Then, uncomment the second rule, input the IP address, and delete the first rule -$cmd 00120 allow log udp from any to any 67 out via $pif keep-state -#$cmd 00120 allow udp from any to x.x.x.x 67 out via $pif keep-state - -# Allow outbound HTTP and HTTPS connections -$cmd 00200 allow tcp from any to any 80 out via $pif setup keep-state -$cmd 00220 allow tcp from any to any 443 out via $pif setup keep-state - -# Allow outbound email connections -$cmd 00230 allow tcp from any to any 25 out via $pif setup keep-state -$cmd 00231 allow tcp from any to any 110 out via $pif setup keep-state - -# Allow outbound ping -$cmd 00250 allow icmp from any to any out via $pif keep-state - -# Allow outbound NTP -$cmd 00260 allow udp from any to any 123 out via $pif keep-state - -# Allow outbound SSH -$cmd 00280 allow tcp from any to any 22 out via $pif setup keep-state - -# deny and log all other outbound connections -$cmd 00299 deny log all from any to any out via $pif - - The next set of rules controls connections from Internet - hosts to the internal network. It starts by denying packets - typically associated with attacks and then explicitly allows - specific types of connections. All the authorized services - that originate from the Internet use limit - to prevent flooding. - - # Deny all inbound traffic from non-routable reserved address spaces -$cmd 00300 deny all from 192.168.0.0/16 to any in via $pif #RFC 1918 private IP -$cmd 00301 deny all from 172.16.0.0/12 to any in via $pif #RFC 1918 private IP -$cmd 00302 deny all from 10.0.0.0/8 to any in via $pif #RFC 1918 private IP -$cmd 00303 deny all from 127.0.0.0/8 to any in via $pif #loopback -$cmd 00304 deny all from 0.0.0.0/8 to any in via $pif #loopback -$cmd 00305 deny all from 169.254.0.0/16 to any in via $pif #DHCP auto-config -$cmd 00306 deny all from 192.0.2.0/24 to any in via $pif #reserved for docs -$cmd 00307 deny all from 204.152.64.0/23 to any in via $pif #Sun cluster interconnect -$cmd 00308 deny all from 224.0.0.0/3 to any in via $pif #Class D & E multicast - -# Deny public pings -$cmd 00310 deny icmp from any to any in via $pif - -# Deny ident -$cmd 00315 deny tcp from any to any 113 in via $pif - -# Deny all Netbios services. -$cmd 00320 deny tcp from any to any 137 in via $pif -$cmd 00321 deny tcp from any to any 138 in via $pif -$cmd 00322 deny tcp from any to any 139 in via $pif -$cmd 00323 deny tcp from any to any 81 in via $pif - -# Deny fragments -$cmd 00330 deny all from any to any frag in via $pif - -# Deny ACK packets that did not match the dynamic rule table -$cmd 00332 deny tcp from any to any established in via $pif - -# Allow traffic from ISP's DHCP server. -# Replace x.x.x.x with the same IP address used in rule 00120. -#$cmd 00360 allow udp from any to x.x.x.x 67 in via $pif keep-state - -# Allow HTTP connections to internal web server -$cmd 00400 allow tcp from any to me 80 in via $pif setup limit src-addr 2 - -# Allow inbound SSH connections -$cmd 00410 allow tcp from any to me 22 in via $pif setup limit src-addr 2 - -# Reject and log all other incoming connections -$cmd 00499 deny log all from any to any in via $pif - - The last rule logs all packets that do not match any of - the rules in the ruleset: - - # Everything else is denied and logged -$cmd 00999 deny log all from any to any - - - - - 核心內 <acronym>NAT</acronym> - - - - - Chern - Lee - - Contributed by - - - - - - - Dries - Michiels - - Rewritten and updated by - - - - - - NAT - - and IPFW - - - FreeBSD's IPFW firewall has two - implementations of NAT: one being the - userland natd8 daemon, and the more recent - IPFW's built-in - NAT facility also known as in-kernel - NAT. Both work in conjunction with - IPFW to provide network address - translation. This can be used to provide an Internet - Connection Sharing solution so that several internal computers - can connect to the Internet using a single public - IP address. - - To do this, the FreeBSD machine connected to the Internet - must act as a gateway. This system must have two - NICs, where one is connected to the - Internet and the other is connected to the internal - LAN. Each machine connected to the - LAN should be assigned an - IP address in the private network space, as - defined by RFC - 1918. - - Some additional configuration is needed in order to enable - the in-kernel NAT function of - IPFW. To enable in-kernel - NAT support at boot time, the following - must be set in /etc/rc.conf: - - gateway_enable="YES" -firewall_enable="YES" -firewall_nat_enable="YES" - - - When firewall_enable is not set, - but firewall_nat_enable is, it will have - no effect and do nothing, because the in-kernel - NAT implementation is only compatible - with IPFW. - - When the ruleset contains stateful rules, the positioning - of the NAT rule is critical and the - skipto action is used. The - skipto action requires a rule number so - that it knows which rule to jump to. Furthermore, because - of the architecture of libalias3, a library implemented - as a kernel module used for the in-kernel - NAT facility of - IPFW, it is necessary to disable - TCP segmentation offloading, or in short - TSO. TSO can be - disabled on a per network interface basis by using - ifconfig8 or on a system wide basis using - sysctl8. To disable TSO system - wide, the following must be set in - /etc/sysctl.conf: - - net.inet.tcp.tso="0" - - The example below builds upon the firewall ruleset - shown in the previous section. It adds some additional - entries and modifies some existing rules in order to configure - the firewall for in-kernel NAT. It starts - by adding some additional variables which represent the rule - number to skip to, the keep-state option, - and a list of TCP ports which will be used - to reduce the number of rules. - - #!/bin/sh -ipfw -q -f flush -cmd="ipfw -q add" -skip="skipto 1000" -pif=dc0 -ks="keep-state" -good_tcpo="22,25,37,53,80,443,110" - - A NAT instance will also be - configured. With in-kernel NAT it is - possible to have multiple NAT instances - each with their own configuration. Although, for this example - only one NAT instance is needed; - NAT instance number 1. The configuration - takes a few arguments and flags such as: - which indicates the public interface, - which takes care that alliased - ports and local port numbers are mapped the same, - will result in only unregistered - (private) address spaces to be processed by the - NAT instance, and - which will help to keep a functioning NAT - instance even when the public IP address of - the IPFW machine changes. For all - possible options that can be passed to a single - NAT instance configuration consult - ipfw8. Furthermore, because of the nature of a - stateful NATing firewall, it is neseccary - to allow translated packets to be reinjected in the firewall - for further processing, this can be achieved by disabling - behavior at the start of the - firewall script. - - ipfw disable one_pass -ipfw -q nat 1 config if $pif same_ports unreg_only reset - - The inbound NAT rule is inserted - after the two rules which allow all - traffic on the trusted and loopback interfaces and after the - reassamble rule but before the - check-state rule. It is important that the - rule number selected for this NAT rule, in - this example 100, is higher than the first - three rules and lower than the check-state - rule. Furthermore, because of the behavior of in-kernel - NAT it is advised to place a reassamble - rule just before the first NAT rule and - after the rules that allow traffic on trusted interface. - Normally, IP fragmentation should not - happen, but when dealing with IPSEC/ESP/GRE - tunneling traffic it might and the reassmabling of fragments - is necessary before handing the complete packet over to the - in-kernel NAT engine. - - - The reassemble rule was not needed with userland - natd8 because the internal workings of the - IPFW divert - action already takes care of this automatically as also - stated in ipfw8. - - The current NAT instance number and - NAT rule number does not match with the - default NAT instance number and rule - number created by rc.firewall which is - a script to set up the baked-in default firewall rulesets - present in FreeBSD. - - $cmd 005 allow all from any to any via xl0 # exclude LAN traffic -$cmd 010 allow all from any to any via lo0 # exclude loopback traffic -$cmd 099 reass all from any to any in # reassamble inbound packets -$cmd 100 nat 1 ip from any to any in via $pif # NAT any inbound packets -# Allow the packet through if it has an existing entry in the dynamic rules table -$cmd 101 check-state - - The outbound rules are modified to replace the - allow action with the - $skip variable, indicating that rule - processing will continue at rule 1000. The - seven tcp rules have been replaced by rule - 125 as the - $good_tcpo variable contains the - seven allowed outbound ports. - - - Remember that IPFW's - firewall performance is largely determined by the number of - rules present in the ruleset. - - # Authorized outbound packets -$cmd 120 $skip udp from any to x.x.x.x 53 out via $pif $ks -$cmd 121 $skip udp from any to x.x.x.x 67 out via $pif $ks -$cmd 125 $skip tcp from any to any $good_tcpo out via $pif setup $ks -$cmd 130 $skip icmp from any to any out via $pif $ks - - The inbound rules remain the same, except for the very - last rule which removes the via $pif in - order to catch both inbound and outbound rules. The - NAT rule must follow this last outbound - rule, must have a higher number than that last rule, and the - rule number must be referenced by the - skipto action. In this ruleset, rule - number 1000 handles passing all packets to - our configured instance for NAT processing. - The next rule allows any packet which has undergone - NAT processing to pass. - - $cmd 999 deny log all from any to any -$cmd 1000 nat 1 ip from any to any out via $pif # skipto location for outbound stateful rules -$cmd 1001 allow ip from any to any - - In this example, rules 100, - 101, 125, - 1000, and 1001 control - the address translation of the outbound and inbound packets so - that the entries in the dynamic state table always register - the private LAN IP - address. - - Consider an internal web browser which initializes a new - outbound HTTP session over port 80. When - the first outbound packet enters the firewall, it does not - match rule 100 because it is headed out - rather than in. It passes rule 101 because - this is the first packet and it has not been posted to the - dynamic state table yet. The packet finally matches rule - 125 as it is outbound on an allowed port - and has a source IP address from the - internal LAN. On matching this rule, two - actions take place. First, the keep-state - action adds an entry to the dynamic state table and the - specified action, skipto rule 1000, is - executed. Next, the packet undergoes NAT - and is sent out to the Internet. This packet makes its way to - the destination web server, where a response packet is - generated and sent back. This new packet enters the top of - the ruleset. It matches rule 100 and has - its destination IP address mapped back to - the original internal address. It then is processed by the - check-state rule, is found in the table as - an existing session, and is released to the - LAN. - - On the inbound side, the ruleset has to deny bad packets - and allow only authorized services. A packet which matches an - inbound rule is posted to the dynamic state table and the - packet is released to the LAN. The packet - generated as a response is recognized by the - check-state rule as belonging to an - existing session. It is then sent to rule - 1000 to undergo - NAT before being released to the outbound - interface. - - - Transition from userland natd8 to in-kernel - NAT might seem seamless at first but - there is small catch. When using the GENERIC kernel, - IPFW will load the - libalias.ko - kernel module, when firewall_nat_enable - is enabled in rc.conf. Although, the - loaded module only provides basic NAT - functionality, whereas the userland implementation - natd8 has all functionality available without any - extra configuration from its userland library. All - functionality refers to the following kernel modules that - can additionally be loaded when needed besides the standard - libalias.ko kernel module: - alias_cuseeme.ko, - alias_ftp.ko, - alias_bbt.ko, - skinny.ko, irc.ko, - alias_pptp.ko and - alias_smedia.ko using the - kld_list directive in - rc.conf to mimic the full functionality - of the userland implementation. If a custom kernel is used, - the full functionality of the userland library can be - compiled in, in the kernel, using the . - - - Port 重新導向 - - The drawback with NAT in general is - that the LAN clients are not accessible - from the Internet. Clients on the LAN - can make outgoing connections to the world but cannot - receive incoming ones. This presents a problem if trying to - run Internet services on one of the LAN - client machines. A simple way around this is to redirect - selected Internet ports on the NAT - providing machine to a LAN client. - - For example, an IRC server runs on - client A and a web server runs on - client B. For this to work - properly, connections received on ports 6667 - (IRC) and 80 (HTTP) - must be redirected to the respective machines. - - With in-kernel NAT all configuration - is done in the NAT instance - configuration. For a full list of options that an in-kernel - NAT instance can use, consult - ipfw8. The IPFW syntax - follows the syntax of natd. The - syntax for is as - follows: - - redirect_port proto targetIP:targetPORT[-targetPORT] - [aliasIP:]aliasPORT[-aliasPORT] - [remoteIP[:remotePORT[-remotePORT]]] - - To configure the above example setup, the arguments - should be: - - redirect_port tcp 192.168.0.2:6667 6667 -redirect_port tcp 192.168.0.3:80 80 - - After adding these arguments to the configuration of - NAT instance 1 in the above ruleset, the - TCP ports will be port forwarded to the - LAN client machines running the - IRC and HTTP - services. - - ipfw -q nat 1 config if $pif same_ports unreg_only reset \ - redirect_port tcp 192.168.0.2:6667 6667 \ - redirect_port tcp 192.1683.0.3:80 80 - - Port ranges over individual ports can be indicated with - . For example, - tcp 192.168.0.2:2000-3000 - 2000-3000 would redirect all connections - received on ports 2000 to 3000 to ports 2000 to 3000 on - client A. - - - - 位址重新導向 - - Address redirection is useful if more than one - IP address is available. Each - LAN client can be assigned its own - external IP address by ipfw8, - which will then rewrite outgoing packets from the - LAN clients with the proper external - IP address and redirects all traffic - incoming on that particular IP address - back to the specific LAN client. This is - also known as static NAT. For example, - if IP addresses 128.1.1.1, 128.1.1.2, and 128.1.1.3 are available, - 128.1.1.1 can be - used as the ipfw8 machine's external - IP address, while 128.1.1.2 and 128.1.1.3 are forwarded - back to LAN clients - A and - B. - - The syntax is as - below, where localIP is the internal - IP address of the LAN - client, and publicIP the external - IP address corresponding to the - LAN client. - - redirect_address localIP publicIP - - In the example, the arguments would read: - - redirect_address 192.168.0.2 128.1.1.2 -redirect_address 192.168.0.3 128.1.1.3 - - Like , these arguments - are placed in a NAT instance - configuration. With address redirection, there is no - need for port redirection, as all data received on a - particular IP address is - redirected. - - The external IP addresses on the - ipfw8 machine must be active and aliased to the - external interface. Refer to rc.conf5 for - details. - - - - Userspace <acronym>NAT</acronym> - - Let us start with a statement: the userspace - NAT implementation: natd8, has - more overhead than in-kernel NAT. For - natd8 to translate packets, the packets have to be - copied from the kernel to userspace and back which brings in - extra overhead that is not present with in-kernel - NAT. - - 要在開機時啟動 Userspace 的 NAT daemon natd8 需在 /etc/rc.conf 中做以下最小設定,其中 要設成連接到網際網路的 NIC 名稱,rc8 script of natd8 會自動檢查是否有使用動態 IP 位址,並且自行設定並處理。 - - gateway_enable="YES" -natd_enable="YES" -natd_interface="rl0" - - In general, the above ruleset as explained for in-kernel - NAT can also be used together with - natd8. The only exceptions are the configuration of - the in-kernel NAT instance (ipfw - -q nat 1 config ...) not being applicable any - more, rule number 100 and 1000 will have to change sligthly - as below, and reassemble rule 99 is not needed anymore - as the action is used which covers - fragmentation. - - $cmd 100 divert natd ip from any to any in via $pif -$cmd 1000 divert natd ip from any to any out via $pif - - To configure port or address redirection, a similar - syntax as with in-kernel NAT is used. - Although, now, instead of specifying the configuration in - our ruleset script like with in-kernel - NAT, configuration of natd8 is - best done in a configuration file. To do this, an extra - flag must be passed via /etc/rc.conf - which specifies the path of the configuration file. - - natd_flags="-f /etc/natd.conf" - - - The specified file must contain a list of - configuration options, one per line. For more information - about the configuration file and possible variables, - consult natd8. Below are two example - entries, one per line: - - redirect_port tcp 192.168.0.2:6667 6667 -redirect_address 192.168.0.3 128.1.1.3 - - - - - <application>IPFW</application> 指令 - - ipfw - - ipfw can be used to make manual, - single rule additions or deletions to the active firewall - while it is running. The problem with using this method is - that all the changes are lost when the system reboots. It is - recommended to instead write all the rules in a file and to - use that file to load the rules at boot time and to replace - the currently running firewall rules whenever that file - changes. - - ipfw is a useful way to display the - running firewall rules to the console screen. The - IPFW accounting facility - dynamically creates a counter for each rule that counts each - packet that matches the rule. During the process of testing a - rule, listing the rule with its counter is one way to - determine if the rule is functioning as expected. - - To list all the running rules in sequence: - - # ipfw list - - To list all the running rules with a time stamp of when - the last time the rule was matched: - - # ipfw -t list - - The next example lists accounting information and the - packet count for matched rules along with the rules - themselves. The first column is the rule number, followed by - the number of matched packets and bytes, followed by the rule - itself. - - # ipfw -a list - - To list dynamic rules in addition to static rules: - - # ipfw -d list - - To also show the expired dynamic rules: - - # ipfw -d -e list - - To zero the counters: - - # ipfw zero - - To zero the counters for just the rule with number - NUM: - - # ipfw zero NUM - - - 記錄防火牆訊息 - - - IPFW - - logging - - - Even with the logging facility enabled, - IPFW will not generate any rule - logging on its own. The firewall administrator decides - which rules in the ruleset will be logged, and adds the - log keyword to those rules. Normally - only deny rules are logged. It is customary to duplicate - the ipfw default deny everything rule with - the log keyword included as the last rule - in the ruleset. This way, it is possible to see all the - packets that did not match any of the rules in the - ruleset. - - Logging is a two edged sword. If one is not careful, - an over abundance of log data or a DoS attack can fill the - disk with log files. Log messages are not only written to - syslogd, but also are displayed - on the root console screen and soon become annoying. - - The IPFIREWALL_VERBOSE_LIMIT=5 - kernel option limits the number of consecutive messages - sent to syslogd8, concerning the packet matching of a - given rule. When this option is enabled in the kernel, the - number of consecutive messages concerning a particular rule - is capped at the number specified. There is nothing to be - gained from 200 identical log messages. With this option - set to five, - five consecutive messages concerning a particular rule - would be logged to syslogd and - the remainder identical consecutive messages would be - counted and posted to syslogd - with a phrase like the following: - - last message repeated 45 times - - All logged packets messages are written by default to - /var/log/security, which is - defined in /etc/syslog.conf. - - - - 建立規則 Script - - Most experienced IPFW users - create a file containing the rules and code them in a manner - compatible with running them as a script. The major benefit - of doing this is the firewall rules can be refreshed in mass - without the need of rebooting the system to activate them. - This method is convenient in testing new rules as the - procedure can be executed as many times as needed. Being a - script, symbolic substitution can be used for frequently - used values to be substituted into multiple rules. - - This example script is compatible with the syntax used - by the sh1, csh1, and tcsh1 shells. - Symbolic substitution fields are prefixed with a dollar sign - ($). Symbolic fields do not have the $ - prefix. The value to populate the symbolic field must be - enclosed in double quotes (""). - - Start the rules file like this: - - ############### start of example ipfw rules script ############# -# -ipfw -q -f flush # Delete all rules -# Set defaults -oif="tun0" # out interface -odns="192.0.2.11" # ISP's DNS server IP address -cmd="ipfw -q add " # build rule prefix -ks="keep-state" # just too lazy to key this each time -$cmd 00500 check-state -$cmd 00502 deny all from any to any frag -$cmd 00501 deny tcp from any to any established -$cmd 00600 allow tcp from any to any 80 out via $oif setup $ks -$cmd 00610 allow tcp from any to $odns 53 out via $oif setup $ks -$cmd 00611 allow udp from any to $odns 53 out via $oif $ks -################### End of example ipfw rules script ############ - - The rules are not important as the focus of this example - is how the symbolic substitution fields are - populated. - - If the above example was in - /etc/ipfw.rules, the rules could be - reloaded by the following command: - - # sh /etc/ipfw.rules - - /etc/ipfw.rules can be located - anywhere and the file can have any name. - - The same thing could be accomplished by running these - commands by hand: - - # ipfw -q -f flush -# ipfw -q add check-state -# ipfw -q add deny all from any to any frag -# ipfw -q add deny tcp from any to any established -# ipfw -q add allow tcp from any to any 80 out via tun0 setup keep-state -# ipfw -q add allow tcp from any to 192.0.2.11 53 out via tun0 setup keep-state -# ipfw -q add 00611 allow udp from any to 192.0.2.11 53 out via tun0 keep-state - - - - - <application>IPFW</application> 核心選項 - - 核心選項 IPFIREWALL - - 核心選項 IPFIREWALL_VERBOSE - - 核心選項 IPFIREWALL_VERBOSE_LIMIT - - - IPFW - - kernel options - - In order to statically compile - IPFW support into a custom kernel, - refer to the instructions in . - The following options are available for the - custom kernel configuration file: - - options IPFIREWALL # enables IPFW -options IPFIREWALL_VERBOSE # enables logging for rules with log keyword to syslogd(8) -options IPFIREWALL_VERBOSE_LIMIT=5 # limits number of logged packets per-entry -options IPFIREWALL_DEFAULT_TO_ACCEPT # sets default policy to pass what is not explicitly denied -options IPFIREWALL_NAT # enables in-kernel NAT support -options IPFIREWALL_NAT64 # enables in-kernel NAT64 support -options IPFIREWALL_NPTV6 # enables in-kernel IPv6 NPT support -options IPFIREWALL_PMOD # enables protocols modification module support -options IPDIVERT # enables NAT through natd(8) - - - IPFW can be loaded as - a kernel module: options above are built by default - as modules or can be set at runtime using tunables. - - - - - - IPFILTER (IPF) - - - firewall - - IPFILTER - - - IPFILTER 即為 IPF,是一套跨平台、開放源碼的防火牆,已被移植到各種作業系統,包含 FreeBSD, NetBSD, OpenBSD 與 Solaris - - IPFILTER 是核心端 (Kernel-side) 的防火牆且 NAT 機制可由 Userland 的程式控制與監控,防火牆規則可以使用 ipf 設定或刪除,NAT 規則可以使用 ipnat 設定或刪除,可使用 ipfstat 來列出 IPFILTER 在核心部份的執行期統計資訊,可使用 ipmon 來記錄 IPFILTER 動作到系統記錄檔。 - - IPF 原來是以 最後一個符合的條件優先 的規則處理邏輯所撰寫並只能使用無狀態 (Stateless) 的規則,之後 IPF 才被加強支援快速 (quick) 與保留狀態 (keep state) 的選項。 - - IPF FAQ 位於 http://www.phildev.net/ipf/index.html,可搜尋的 IPFilter 郵遞論壇封存資料可至 http://marc.info/?l=ipfilter 取得。 - - 由於 FreeBSD 也支援 IPF 因此操作手冊特別在此章節對此介紹,本節提供幾個有使用快速 (quick) 與保留狀態 (keep state) 選項的規則範例。 - - - 開啟 <application>IPF</application> - - - IPFILTER - - enabling - - - IPF is included in the basic - FreeBSD install as a kernel loadable module, meaning that a - custom kernel is not needed in order to enable - IPF. - - 核心選項 IPFILTER - - 核心選項 IPFILTER_LOG - - 核心選項 IPFILTER_DEFAULT_BLOCK - - - IPFILTER - - kernel options - - - For users who prefer to statically compile - IPF support into a custom kernel, - refer to the instructions in . - The following kernel options are available: - - options IPFILTER -options IPFILTER_LOG -options IPFILTER_LOOKUP -options IPFILTER_DEFAULT_BLOCK - - where options IPFILTER enables support - for IPFILTER, - options IPFILTER_LOG enables - IPF logging using the - ipl packet logging pseudo-device for - every rule that has the log keyword, - IPFILTER_LOOKUP enables - IP pools in order to speed up - IP lookups, and options - IPFILTER_DEFAULT_BLOCK changes the default - behavior so that any packet not matching a firewall - pass rule gets blocked. - - To configure the system to enable - IPF at boot time, add the following - entries to /etc/rc.conf. These entries - will also enable logging and default pass - all. To change the default policy to - block all without compiling a custom - kernel, remember to add a block all rule at - the end of the ruleset. - - ipfilter_enable="YES" # Start ipf firewall -ipfilter_rules="/etc/ipf.rules" # loads rules definition text file -ipmon_enable="YES" # Start IP monitor log -ipmon_flags="-Ds" # D = start as daemon - # s = log to syslog - # v = log tcp window, ack, seq - # n = map IP & port to names - - If NAT functionality is needed, also - add these lines: - - gateway_enable="YES" # Enable as LAN gateway -ipnat_enable="YES" # Start ipnat function -ipnat_rules="/etc/ipnat.rules" # rules definition file for ipnat - - Then, to start IPF now: - - # service ipfilter start - - To load the firewall rules, specify the name of the - ruleset file using ipf. The following - command can be used to replace the currently running firewall - rules: - - # ipf -Fa -f /etc/ipf.rules - - where flushes all the internal rules - tables and specifies the file containing - the rules to load. - - This provides the ability to make changes to a custom - ruleset and update the running firewall with a fresh copy of - the rules without having to reboot the system. This method is - convenient for testing new rules as the procedure can be - executed as many times as needed. - - Refer to ipf8 for details on the other flags - available with this command. - - - - <application>IPF</application> 規則語法 - - - IPFILTER - - rule syntax - - - This section describes the IPF - rule syntax used to create stateful rules. When creating - rules, keep in mind that unless the quick - keyword appears in a rule, every rule is read in order, with - the last matching rule being the one - that is applied. This means that even if the first rule to - match a packet is a pass, if there is a - later matching rule that is a block, the - packet will be dropped. Sample rulesets can be found in - /usr/share/examples/ipfilter. - - When creating rules, a # character is - used to mark the start of a comment and may appear at the end - of a rule, to explain that rule's function, or on its own - line. Any blank lines are ignored. - - The keywords which are used in rules must be written in a - specific order, from left to right. Some keywords are - mandatory while others are optional. Some keywords have - sub-options which may be keywords themselves and also include - more sub-options. The keyword order is as follows, where the - words shown in uppercase represent a variable and the words - shown in lowercase must precede the variable that follows - it: - - ACTION DIRECTION OPTIONS proto PROTO_TYPE - from SRC_ADDR SRC_PORT to DST_ADDR DST_PORT - TCP_FLAG|ICMP_TYPE keep state STATE - - This section describes each of these keywords and their - options. It is not an exhaustive list of every possible - option. Refer to ipf5 for a complete description of - the rule syntax that can be used when creating - IPF rules and examples for using - each keyword. - - - - ACTION - - The action keyword indicates what to do with the - packet if it matches that rule. Every rule - must have an action. The - following actions are recognized: - - block: drops the packet. - - pass: allows the packet. - - log: generates a log - record. - - count: counts the number of - packets and bytes which can provide an indication of - how often a rule is used. - - auth: queues the packet for - further processing by another program. - - call: provides access to - functions built into IPF that - allow more complex actions. - - decapsulate: removes any headers - in order to process the contents of the packet. - - - - - DIRECTION - - Next, each rule must explicitly state the direction - of traffic using one of these keywords: - - in: the rule is applied against - an inbound packet. - - out: the rule is applied against - an outbound packet. - - all: the rule applies to either - direction. - - If the system has multiple interfaces, the interface - can be specified along with the direction. An example - would be in on fxp0. - - - - - OPTIONS - - Options are optional. However, if multiple options - are specified, they must be used in the order shown - here. - - log: when performing the - specified ACTION, the contents of the packet's headers - will be written to the ipl4 packet log - pseudo-device. - - quick: if a packet matches this - rule, the ACTION specified by the rule occurs and no - further processing of any following rules will occur for - this packet. - - on: must be followed by the - interface name as displayed by ifconfig8. The - rule will only match if the packet is going through the - specified interface in the specified direction. - - When using the - log keyword, the following qualifiers - may be used in this order: - - body: indicates that the first - 128 bytes of the packet contents will be logged after - the headers. - - first: if the - log keyword is being used in - conjunction with a keep state option, - this option is recommended so that only the triggering - packet is logged and not every packet which matches the - stateful connection. - - Additional options are available to specify error - return messages. Refer to ipf5 for more - details. - - - - - - PROTO_TYPE - - The protocol type is optional. However, it is - mandatory if the rule needs to specify a SRC_PORT or - a DST_PORT as it defines the type of protocol. When - specifying the type of protocol, use the - proto keyword followed by either a - protocol number or name from - /etc/protocols. - Example protocol names include tcp, - udp, or icmp. If - PROTO_TYPE is specified but no SRC_PORT or DST_PORT is - specified, all port numbers for that protocol will match - that rule. - - - - - SRC_ADDR - - The from keyword is mandatory and - is followed by a keyword which represents the source of - the packet. The source can be a hostname, an - IP address followed by the - CIDR mask, an address pool, or the - keyword all. Refer to ipf5 - for examples. - - There is no way to match ranges of - IP addresses which do not express - themselves easily using the dotted numeric form / - mask-length notation. The - net-mgmt/ipcalc package or port may - be used to ease the calculation of the - CIDR mask. Additional information is - available at the utility's web page: http://jodies.de/ipcalc. - - - - - SRC_PORT - - The port number of the source is optional. However, - if it is used, it requires PROTO_TYPE to be first - defined in the rule. The port number must also be - preceded by the proto keyword. - - A number of different comparison operators are - supported: = (equal to), - != (not equal to), - < (less than), - > (greater than), - <= (less than or equal to), and - >= (greater than or equal - to). - - To specify port ranges, place the two port numbers - between <> (less than and - greater than ), >< (greater - than and less than ), or : (greater - than or equal to and less than or equal to). - - - - - DST_ADDR - - The to keyword is mandatory and - is followed by a keyword which represents the - destination of the packet. Similar to SRC_ADDR, it can - be a hostname, an IP address - followed by the CIDR mask, an address - pool, or the keyword all. - - - - - DST_PORT - - Similar to SRC_PORT, the port number of the - destination is optional. However, if it is used, it - requires PROTO_TYPE to be first defined in the rule. - The port number must also be preceded by the - proto keyword. - - - - - TCP_FLAG|ICMP_TYPE - - If tcp is specified as the - PROTO_TYPE, flags can be specified as letters, where - each letter represents one of the possible - TCP flags used to determine the state - of a connection. Possible values are: - S (SYN), - A (ACK), - P (PSH), - F (FIN), - U (URG), - R (RST), - C (CWN), and - E (ECN). - - If icmp is specified as the - PROTO_TYPE, the ICMP type to match - can be specified. Refer to ipf5 for the - allowable types. - - - - - STATE - - If a pass rule contains - keep state, - IPF will add an entry to its - dynamic state table and allow subsequent packets that - match the connection. - IPF can track state for - TCP, UDP, and - ICMP sessions. Any packet that - IPF can be certain is part of - an active session, even if it is a different protocol, - will be allowed. - - In IPF, packets destined - to go out through the interface connected to the public - Internet are first checked against the dynamic state - table. If the packet matches the next expected packet - comprising an active session conversation, it exits the - firewall and the state of the session conversation flow - is updated in the dynamic state table. Packets that do - not belong to an already active session are checked - against the outbound ruleset. Packets coming in from - the interface connected to the public Internet are first - checked against the dynamic state table. If the packet - matches the next expected packet comprising an active - session, it exits the firewall and the state of the - session conversation flow is updated in the dynamic - state table. Packets that do not belong to an already - active session are checked against the inbound - ruleset. - - Several keywords can be added after - keep state. If used, these keywords - set various options that control stateful filtering, - such as setting connection limits or connection age. - Refer to ipf5 for the list of available options - and their descriptions. - - - - - - - 範例規則集 - - This section demonstrates how to create an example ruleset - which only allows services matching - pass rules and blocks all others. - - FreeBSD uses the loopback interface - (lo0) and the IP - address 127.0.0.1 - for internal communication. The firewall ruleset must contain - rules to allow free movement of these internally used - packets: - - # no restrictions on loopback interface -pass in quick on lo0 all -pass out quick on lo0 all - - The public interface connected to the Internet is used to - authorize and control access of all outbound and inbound - connections. If one or more interfaces are cabled to private - networks, those internal interfaces may require rules to allow - packets originating from the LAN to flow - between the internal networks or to the interface attached to - the Internet. The ruleset should be organized into three - major sections: any trusted internal interfaces, outbound - connections through the public interface, and inbound - connections through the public interface. - - These two rules allow all traffic to pass through a - trusted LAN interface named - xl0: - - # no restrictions on inside LAN interface for private network -pass out quick on xl0 all -pass in quick on xl0 all - - The rules for the public interface's outbound and inbound - sections should have the most frequently matched rules placed - before less commonly matched rules, with the last rule in the - section blocking and logging all packets for that interface - and direction. - - This set of rules defines the outbound section of the - public interface named dc0. These rules - keep state and identify the specific services that internal - systems are authorized for public Internet access. All the - rules use quick and specify the - appropriate port numbers and, where applicable, destination - addresses. - - # interface facing Internet (outbound) -# Matches session start requests originating from or behind the -# firewall, destined for the Internet. - -# Allow outbound access to public DNS servers. -# Replace x.x.x. with address listed in /etc/resolv.conf. -# Repeat for each DNS server. -pass out quick on dc0 proto tcp from any to x.x.x. port = 53 flags S keep state -pass out quick on dc0 proto udp from any to xxx port = 53 keep state - -# Allow access to ISP's specified DHCP server for cable or DSL networks. -# Use the first rule, then check log for the IP address of DHCP server. -# Then, uncomment the second rule, replace z.z.z.z with the IP address, -# and comment out the first rule -pass out log quick on dc0 proto udp from any to any port = 67 keep state -#pass out quick on dc0 proto udp from any to z.z.z.z port = 67 keep state - -# Allow HTTP and HTTPS -pass out quick on dc0 proto tcp from any to any port = 80 flags S keep state -pass out quick on dc0 proto tcp from any to any port = 443 flags S keep state - -# Allow email -pass out quick on dc0 proto tcp from any to any port = 110 flags S keep state -pass out quick on dc0 proto tcp from any to any port = 25 flags S keep state - -# Allow NTP -pass out quick on dc0 proto tcp from any to any port = 37 flags S keep state - -# Allow FTP -pass out quick on dc0 proto tcp from any to any port = 21 flags S keep state - -# Allow SSH -pass out quick on dc0 proto tcp from any to any port = 22 flags S keep state - -# Allow ping -pass out quick on dc0 proto icmp from any to any icmp-type 8 keep state - -# Block and log everything else -block out log first quick on dc0 all - - This example of the rules in the inbound section of the - public interface blocks all undesirable packets first. This - reduces the number of packets that are logged by the last - rule. - - # interface facing Internet (inbound) -# Block all inbound traffic from non-routable or reserved address spaces -block in quick on dc0 from 192.168.0.0/16 to any #RFC 1918 private IP -block in quick on dc0 from 172.16.0.0/12 to any #RFC 1918 private IP -block in quick on dc0 from 10.0.0.0/8 to any #RFC 1918 private IP -block in quick on dc0 from 127.0.0.0/8 to any #loopback -block in quick on dc0 from 0.0.0.0/8 to any #loopback -block in quick on dc0 from 169.254.0.0/16 to any #DHCP auto-config -block in quick on dc0 from 192.0.2.0/24 to any #reserved for docs -block in quick on dc0 from 204.152.64.0/23 to any #Sun cluster interconnect -block in quick on dc0 from 224.0.0.0/3 to any #Class D & E multicast - -# Block fragments and too short tcp packets -block in quick on dc0 all with frags -block in quick on dc0 proto tcp all with short - -# block source routed packets -block in quick on dc0 all with opt lsrr -block in quick on dc0 all with opt ssrr - -# Block OS fingerprint attempts and log first occurrence -block in log first quick on dc0 proto tcp from any to any flags FUP - -# Block anything with special options -block in quick on dc0 all with ipopts - -# Block public pings and ident -block in quick on dc0 proto icmp all icmp-type 8 -block in quick on dc0 proto tcp from any to any port = 113 - -# Block incoming Netbios services -block in log first quick on dc0 proto tcp/udp from any to any port = 137 -block in log first quick on dc0 proto tcp/udp from any to any port = 138 -block in log first quick on dc0 proto tcp/udp from any to any port = 139 -block in log first quick on dc0 proto tcp/udp from any to any port = 81 - - Any time there are logged messages on a rule with - the log first option, run - ipfstat -hio to evaluate how many times the - rule has been matched. A large number of matches may indicate - that the system is under attack. - - The rest of the rules in the inbound section define which - connections are allowed to be initiated from the Internet. - The last rule denies all connections which were not explicitly - allowed by previous rules in this section. - - # Allow traffic in from ISP's DHCP server. Replace z.z.z.z with -# the same IP address used in the outbound section. -pass in quick on dc0 proto udp from z.z.z.z to any port = 68 keep state - -# Allow public connections to specified internal web server -pass in quick on dc0 proto tcp from any to x.x.x.x port = 80 flags S keep state - -# Block and log only first occurrence of all remaining traffic. -block in log first quick on dc0 all - - - - 設定 <acronym>NAT</acronym> - - NAT - - - IP masquerading - - NAT - - - - network address translation - - NAT - - - ipnat - - To enable NAT, add these statements - to /etc/rc.conf and specify the name of - the file containing the NAT rules: - - gateway_enable="YES" -ipnat_enable="YES" -ipnat_rules="/etc/ipnat.rules" - - NAT rules are flexible and can - accomplish many different things to fit the needs of both - commercial and home users. The rule syntax presented here has - been simplified to demonstrate common usage. For a complete - rule syntax description, refer to ipnat5. - - The basic syntax for a NAT rule is as - follows, where map starts the rule and - IF should be replaced with the - name of the external interface: - - map IF LAN_IP_RANGE -> PUBLIC_ADDRESS - - The LAN_IP_RANGE is the range - of IP addresses used by internal clients. - Usually, it is a private address range such as 192.168.1.0/24. The - PUBLIC_ADDRESS can either be the - static external IP address or the keyword - 0/32 which represents the - IP address assigned to - IF. - - In IPF, when a packet arrives - at the firewall from the LAN with a public - destination, it first passes through the outbound rules of the - firewall ruleset. Then, the packet is passed to the - NAT ruleset which is read from the top - down, where the first matching rule wins. - IPF tests each - NAT rule against the packet's interface - name and source IP address. When a - packet's interface name matches a NAT rule, - the packet's source IP address in the - private LAN is checked to see if it falls - within the IP address range specified in - LAN_IP_RANGE. On a match, the - packet has its source IP address rewritten - with the public IP address specified by - PUBLIC_ADDRESS. - IPF posts an entry in its internal - NAT table so that when the packet returns - from the Internet, it can be mapped back to its original - private IP address before being passed to - the firewall rules for further processing. - - For networks that have large numbers of internal systems - or multiple subnets, the process of funneling every private - IP address into a single public - IP address becomes a resource problem. - Two methods are available to relieve this issue. - - The first method is to assign a range of ports to use as - source ports. By adding the portmap - keyword, NAT can be directed to only use - source ports in the specified range: - - map dc0 192.168.1.0/24 -> 0/32 portmap tcp/udp 20000:60000 - - Alternately, use the auto keyword - which tells NAT to determine the ports - that are available for use: - - map dc0 192.168.1.0/24 -> 0/32 portmap tcp/udp auto - - The second method is to use a pool of public addresses. - This is useful when there are too many - LAN addresses to fit into a single public - address and a block of public IP addresses - is available. These public addresses can be used as a pool - from which NAT selects an - IP address as a packet's address is - mapped on its way out. - - The range of public IP addresses can - be specified using a netmask or CIDR - notation. These two rules are equivalent: - - map dc0 192.168.1.0/24 -> 204.134.75.0/255.255.255.0 -map dc0 192.168.1.0/24 -> 204.134.75.0/24 - - A common practice is to have a publically accessible web - server or mail server segregated to an internal network - segment. The traffic from these servers still has to undergo - NAT, but port redirection is needed to - direct inbound traffic to the correct server. For example, to - map a web server using the internal address 10.0.10.25 to its public - IP address of 20.20.20.5, use this - rule: - - rdr dc0 20.20.20.5/32 port 80 -> 10.0.10.25 port 80 - - If it is the only web server, this rule would also work as - it redirects all external HTTP requests to - 10.0.10.25: - - rdr dc0 0.0.0.0/0 port 80 -> 10.0.10.25 port 80 - - IPF has a built in - FTP proxy which can be used with - NAT. It monitors all outbound traffic for - active or passive FTP connection requests - and dynamically creates temporary filter rules containing the - port number used by the FTP data channel. - This eliminates the need to open large ranges of high order - ports for FTP connections. - - In this example, the first rule calls the proxy for - outbound FTP traffic from the internal - LAN. The second rule passes the - FTP traffic from the firewall to the - Internet, and the third rule handles all - non-FTP traffic from the internal - LAN: - - map dc0 10.0.10.0/29 -> 0/32 proxy port 21 ftp/tcp -map dc0 0.0.0.0/0 -> 0/32 proxy port 21 ftp/tcp -map dc0 10.0.10.0/29 -> 0/32 - - The FTP map rules go - before the NAT rule so that when a packet - matches an FTP rule, the - FTP proxy creates temporary filter rules to - let the FTP session packets pass and - undergo NAT. All LAN packets that are not - FTP will not match the - FTP rules but will undergo - NAT if they match the third rule. - - Without the FTP proxy, the following - firewall rules would instead be needed. Note that without the - proxy, all ports above 1024 need to be - allowed: - - # Allow out LAN PC client FTP to public Internet -# Active and passive modes -pass out quick on rl0 proto tcp from any to any port = 21 flags S keep state - -# Allow out passive mode data channel high order port numbers -pass out quick on rl0 proto tcp from any to any port > 1024 flags S keep state - -# Active mode let data channel in from FTP server -pass in quick on rl0 proto tcp from any to any port = 20 flags S keep state - - Whenever the file containing the NAT - rules is edited, run ipnat with - to delete the current - NAT rules and flush the contents of the - dynamic translation table. Include and - specify the name of the NAT ruleset to - load: - - # ipnat -CF -f /etc/ipnat.rules - - To display the NAT statistics: - - # ipnat -s - - To list the NAT table's current - mappings: - - # ipnat -l - - To turn verbose mode on and display information relating - to rule processing and active rules and table entries: - - # ipnat -v - - - - 檢視 <application>IPF</application> 統計資訊 - - ipfstat - - - IPFILTER - - statistics - - - IPF includes ipfstat8 - which can be used to retrieve - and display statistics which are gathered - as packets match rules as they go through the - firewall. Statistics are accumulated since the firewall was - last started or since the last time they - were reset to zero using ipf - -Z. - - The default ipfstat output looks - like this: - - input packets: blocked 99286 passed 1255609 nomatch 14686 counted 0 - output packets: blocked 4200 passed 1284345 nomatch 14687 counted 0 - input packets logged: blocked 99286 passed 0 - output packets logged: blocked 0 passed 0 - packets logged: input 0 output 0 - log failures: input 3898 output 0 - fragment state(in): kept 0 lost 0 - fragment state(out): kept 0 lost 0 - packet state(in): kept 169364 lost 0 - packet state(out): kept 431395 lost 0 - ICMP replies: 0 TCP RSTs sent: 0 - Result cache hits(in): 1215208 (out): 1098963 - IN Pullups succeeded: 2 failed: 0 - OUT Pullups succeeded: 0 failed: 0 - Fastroute successes: 0 failures: 0 - TCP cksum fails(in): 0 (out): 0 - Packet log flags set: (0) - - Several options are available. When supplied with either - for inbound or for - outbound, the command will retrieve and display the - appropriate list of filter rules currently installed and in - use by the kernel. To also see the rule numbers, include - . For example, ipfstat - -on displays the outbound rules table with rule - numbers: - - @1 pass out on xl0 from any to any -@2 block out on dc0 from any to any -@3 pass out quick on dc0 proto tcp/udp from any to any keep state - - Include to prefix each rule with a - count of how many times the rule was matched. For example, - ipfstat -oh displays the outbound internal - rules table, prefixing each rule with its usage count: - - 2451423 pass out on xl0 from any to any -354727 block out on dc0 from any to any -430918 pass out quick on dc0 proto tcp/udp from any to any keep state - - To display the state table in a format similar to - top1, use ipfstat -t. When the - firewall is under attack, this option provides the ability to - identify and see the attacking packets. The optional - sub-flags give the ability to select the destination or source - IP, port, or protocol to be monitored in - real time. Refer to ipfstat8 for details. - - - - <application>IPF</application> 日誌 - - ipmon - - - IPFILTER - - logging - - - IPF provides - ipmon, which can be used to write the - firewall's logging information in a human readable format. It - requires that options IPFILTER_LOG be first - added to a custom kernel using the instructions in . - - This command is typically run in daemon mode in order to - provide a continuous system log file so that logging of past - events may be reviewed. Since FreeBSD has a built in - syslogd8 facility to automatically rotate system logs, - the default rc.conf - ipmon_flags statement uses - : - - ipmon_flags="-Ds" # D = start as daemon - # s = log to syslog - # v = log tcp window, ack, seq - # n = map IP & port to names - - Logging provides the ability to review, after the fact, - information such as which packets were dropped, what addresses - they came from, and where they were going. This information - is useful in tracking down attackers. - - Once the logging facility is enabled in - rc.conf and started with service - ipmon start, IPF will - only log the rules which contain the log - keyword. The firewall administrator decides which rules in - the ruleset should be logged and normally only deny rules are - logged. It is customary to include the - log keyword in the last rule in the - ruleset. This makes it possible to see all the packets that - did not match any of the rules in the ruleset. - - By default, ipmon -Ds mode uses - local0 as the logging facility. The - following logging levels can be used to further segregate the - logged data: - - LOG_INFO - packets logged using the "log" keyword as the action rather than pass or block. -LOG_NOTICE - packets logged which are also passed -LOG_WARNING - packets logged which are also blocked -LOG_ERR - packets which have been logged and which can be considered short due to an incomplete header - - In order to setup IPF to - log all data to /var/log/ipfilter.log, - first create the empty file: - - # touch /var/log/ipfilter.log - - Then, to write all logged messages to the specified file, - add the following statement to - /etc/syslog.conf: - - local0.* /var/log/ipfilter.log - - To activate the changes and instruct syslogd8 - to read the modified /etc/syslog.conf, - run service syslogd reload. - - Do not forget to edit - /etc/newsyslog.conf to rotate the new - log file. - - Messages generated by ipmon consist - of data fields separated by white space. Fields common to - all messages are: - - - - The date of packet receipt. - - - - The time of packet receipt. This is in the form - HH:MM:SS.F, for hours, minutes, seconds, and fractions - of a second. - - - - The name of the interface that processed the - packet. - - - - The group and rule number of the rule in the format - @0:17. - - - - The action: p for passed, - b for blocked, S for - a short packet, n did not match any - rules, and L for a log rule. - - - - The addresses written as three fields: the source - address and port separated by a comma, the -> symbol, - and the destination address and port. For example: - 209.53.17.22,80 -> - 198.73.220.17,1722. - - - - PR followed by the protocol name - or number: for example, PR tcp. - - - - len followed by the header length - and total length of the packet: for example, - len 20 40. - - - - If the packet is a TCP packet, there - will be an additional field starting with a hyphen followed by - letters corresponding to any flags that were set. Refer to - ipf5 for a list of letters and their flags. - - If the packet is an ICMP packet, there - will be two fields at the end: the first always being - icmp and the next being the - ICMP message and sub-message type, - separated by a slash. For example: - icmp 3/3 for a port unreachable - message. - - - - - Blacklistd - - Blacklistd is a daemon listening to sockets to receive - notifications from other daemons about connection attempts - that failed or were successful. It is most widely used in - blocking too many connection attempts on open ports. A - prime example is SSH running on - the internet getting a lot of requests from bots or scripts - trying to guess passwords and gain access. Using - blacklistd, the daemon can notify - the firewall to create a filter rule to block excessive - connection attempts from a single source after a number of - tries. Blacklistd was first developed on - NetBSD and appeared there in version 7. FreeBSD 11 - imported blacklistd from NetBSD. - - This chapter describes how to set up blacklistd, - configure it, and provides examples on how to use it. - Readers should be familiar with basic firewall concepts like - rules. For details, refer to the firewall chapter. PF is - used in the examples, but other firewalls available on - FreeBSD should be able to work with blacklistd, too. - - - 開啟 Blacklistd - - The main configuration for blacklistd is stored in - blacklistd.conf5. Various command line options are - also available to change blacklistd's run-time behavior. - Persistent configuration across reboots should be stored - in /etc/blacklistd.conf. To enable - the daemon during system boot, add a - blacklistd_enable line to - /etc/rc.conf like this: - - # sysrc blacklistd_enable=yes - - To start the service manually, run this command: - - # service blacklistd start - - - - 建立 Blacklistd 規則集 - - Rules for blacklistd are configured in - blacklistd.conf5 with one entry per line. Each - rule contains a tuple separated by spaces or tabs. Rules - either belong to a local or a - remote, which applies to the machine - where blacklistd is running or an outside source, - respectively. - - - 本地規則 - - An example blacklistd.conf entry for a local rule - looks like this: - - [local] -ssh stream * * * 3 24h - - All rules that follow the [local] - section are treated as local rules (which is the - default), applying to the local machine. When a - [remote] section is encountered, all - rules that follow it are handled as remote machine - rules. - - Seven fields define a rule separated by either tabs - or spaces. The first four fields identify the traffic - that should be blacklisted. The three fields that - follow define backlistd's behavior. Wildcards are - denoted as asterisks (*), matching - anything in this field. The first field defines the - location. In local rules, these are the network ports. - The syntax for the location field is as follows: - - [address|interface][/mask][:port] - - Adressses can be specified as IPv4 in numeric format - or IPv6 in square brackets. An interface name like - em0 can also - be used. - - The socket type is defined by the second field. TCP - sockets are of type stream, whereas UDP - is denoted as dgram. The example above - uses TCP, since SSH is using that protocol. - - A protocol can be used in the third field of a - blacklistd rule. The following protocols can be used: - tcp, udp, - tcp6, udp6, or - numeric. A wildcard, like in the example, is typically - used to match all protocols unless there is a reason to - distinguish traffic by a certain protocol. - - In the fourth field, the effective user or owner of - the daemon process that is reporting the event is defined. - The username or UID can be used here, - as well as a wildcard (see example rule above). - - The packet filter rule name is declared by the fifth - field, which starts the behavior part of the rule. By - default, blacklistd puts all blocks under a pf anchor - called blacklistd in - pf.conf like this: - - anchor "blacklistd/*" in on $ext_if -block in -pass out - - For separate blacklists, an anchor name can be used in - this field. In other cases, the wildcard will suffice. - When a name starts with a hyphen (-) it - means that an anchor with the default rule name prepended - should be used. A modified example from the above using - the hyphen would look like this: - - ssh stream * * -ssh 3 24h - - With such a rule, any new blacklist rules are added to - an anchor called blacklistd-ssh. - - To block whole subnets for a single rule violation, a - / in the rule name can be used. This - causes the remaining portion of the name to be interpreted - as the mask to be applied to the address specified in - the rule. For example, this rule would block every - address adjoining /24. - - 22 stream tcp * */24 3 24h - - - It is important to specify the proper - protocol here. IPv4 and IPv6 treat /24 differently, - that is the reason why * cannot be - used in the third field for this rule. - - - This rule defines that if any one host in that network - is misbehaving, everything else on that network will be - blocked, too. - - The sixth field, called nfail, sets - the number of login failures required to blacklist the - remote IP in question. When a wildcard is used at this - position, it means that blocks will never happen. In the - example rule above, a limit of three is defined meaning - that after three attempts to log into - SSH on one connection, the IP - is blocked. - - The last field in a blacklistd rule definition - specifies how long a host is blacklisted. The default - unit is seconds, but suffixes like m, - h, and d can also be - specified for minutes, hours, and days, - respectively. - - The example rule in its entirety means that after - three times authenticating to - SSH will result in a new PF - block rule for that host. Rule matches are performed by - first checking local rules one after another, from most - specific to least specific. When a match occurs, the - remote rules are applied and the name, - nfail, and disable fields are changed - by the remote rule that matched. - - - - 遠端規則 - - Remote rules are used to specify how blacklistd - changes its behavior depending on the remote host - currently being evaluated. Each field in a remote rule - is the same as in a local rule. The only difference is - in the way blacklistd is using them. To explain it, - this example rule is used: - - [remote] -203.0.113.128/25 * * * =/25 = 48h - - The address field can be an IP address (either v4 or - v6), a port or both. This allows setting special rules - for a specific remote address range like in this example. - The fields for type, protocol and owner are identically - interpreted as in the local rule. - - The name fields is different though: the equal sign - (=) in a remote rule tells blacklistd - to use the value from the matching local rule. It means - that the firewall rule entry is taken and the - /25 prefix (a - netmask of 255.255.255.128) is added. - When a connection from that address range is blacklisted, - the entire subnet is affected. A PF anchor name can also - be used here, in which case blacklistd will add rules for - this address block to the anchor of that name. The - default table is used when a wildcard is specified. - - A custom number of failures in the - nfail column can be defined for an - address. This is useful for exceptions to a specific - rule, to maybe allow someone a less strict application - of rules or a bit more leniency in login tries. - Blocking is disabled when an asterisk is used in this - sixth field. - - Remote rules allow a stricter enforcement of limits - on attempts to log in compared to attempts coming from a - local network like an office. - - - - - Blacklistd 客戶端設定 - - There are a few software packages in FreeBSD that can - utilize blacklistd's functionality. The two most - prominent ones are ftpd8 and sshd8 to block - excessive connection attempts. To activate blacklistd in - the SSH daemon, add the following line to - /etc/ssh/sshd_config: - - UseBlacklist yes - - 接著重新啟動 sshd 來使變更生效。 - - Blacklisting for ftpd8 is enabled using - -B, either in - /etc/inetd.conf or as a - flag in /etc/rc.conf like - this: - - ftpd_flags="-B" - - That is all that is needed to make these programs - talk to blacklistd. - - - - Blacklistd 管理 - - Blacklistd provides the user with a management utility - called blacklistctl8. It displays blocked - addresses and networks that are blacklisted by the rules - defined in blacklistd.conf5. To see the - list of currently blocked hosts, use - dump combined with - like this. - - # blacklistctl dump -b - address/ma:port id nfail last access -213.0.123.128/25:22 OK 6/3 2019/06/08 14:30:19 - - This example shows that there were 6 out of three - permitted attempts on port 22 coming from the address - range 213.0.123.128/25. There - are more attempts listed than are allowed because SSH - allows a client to try multiple logins on a single TCP - connection. A connection that is currently going on is - not stopped by blacklistd. The last connection attempt is - listed in the last access column of the - output. - - To see the remaining time that this host will be on - the blacklist, add to the previous - command. - - # blacklistctl dump -br - address/ma:port id nfail remaining time -213.0.123.128/25:22 OK 6/3 36s - - In this example, there are 36s seconds left until this - host will not be blocked any more. - - - - 從封鎖清單移除主機 - - Sometimes it is necessary to remove a host from the - block list before the remaining time expires. - Unfortunately, there is no functionality in blacklistd to - do that. However, it is possible to remove the address - from the PF table using pfctl. For each blocked port, - there is a child anchor inside the blacklistd anchor - defined in /etc/pf.conf. For - example, if there is a child anchor for blocking port 22 - it is called blacklistd/22. There is a - table inside that child anchor that contains the blocked - addresses. This table is called port followed by the port - number. In this example, it would be called - port22. With that information at hand, - it is now possible to use pfctl8 to display all - addresses listed like this: - - # pfctl -a blacklistd/22 -t port22 -T show -... -213.0.123.128/25 -... - - After identifying the address to be unblocked from the - list, the following command removes it from the list: - - # pfctl -a blacklistd/22 -T delete 213.0.123.128/25 - - The address is now removed from PF, but will still - show up in the blacklistctl list, since it does not know - about any changes made in PF. The entry in blacklistd's - database will eventually expire and be removed from its - output eventually. The entry will be added again if the - host is matching one of the block rules in blacklistd - again. - - -
- - - - - 進階網路設定 - - - 概述 - - This chapter covers a number of advanced networking - topics. - - 讀完這章,您將了解: - - - - The basics of gateways and routes. - - - - How to set up USB tethering. - - - - How to set up IEEE 802.11 and Bluetooth - devices. - - - - How to make FreeBSD act as a bridge. - - - - How to set up network PXE - booting. - - - - How to set up IPv6 on a FreeBSD - machine. - - - - How to enable and utilize the features of the Common - Address Redundancy Protocol (CARP) in - FreeBSD. - - - - 如何在 FreeBSD 上設定多個 VLAN - - - - Configure bluetooth headset. - - - - 在開始閱讀這章之前,您需要: - - - - Understand the basics of the - /etc/rc scripts. - - - - 熟悉基本網路術語。 - - - - Know how to configure and install a new FreeBSD kernel - (). - - - - 了解如何安裝其他第三方軟體 ()。 - - - - - - - - 通訊閘與路由 - - - - - Coranth - Gryphon - - Contributed by - - - - - - routing - - - gateway - - - subnet - - - Routing is the mechanism that allows - a system to find the network path to another system. A - route is a defined pair of addresses - which represent the destination and a - gateway. The route indicates that when trying - to get to the specified destination, send the packets through - the specified gateway. There are three types of destinations: - individual hosts, subnets, and default. The - default route is used if no other routes apply. - There are also three types of gateways: individual hosts, - interfaces, also called links, and Ethernet hardware - (MAC) addresses. Known routes are stored in - a routing table. - - This section provides an overview of routing basics. It - then demonstrates how to configure a FreeBSD system as a router and - offers some troubleshooting tips. - - - 路由基礎概念 - - To view the routing table of a FreeBSD system, use - netstat1: - - % netstat -r -Routing tables - -Internet: -Destination Gateway Flags Refs Use Netif Expire -default outside-gw UGS 37 418 em0 -localhost localhost UH 0 181 lo0 -test0 0:e0:b5:36:cf:4f UHLW 5 63288 re0 77 -10.20.30.255 link#1 UHLW 1 2421 -example.com link#1 UC 0 0 -host1 0:e0:a8:37:8:1e UHLW 3 4601 lo0 -host2 0:e0:a8:37:8:1e UHLW 0 5 lo0 => -host2.example.com link#1 UC 0 0 -224 link#1 UC 0 0 - - The entries in this example are as follows: - - - - default - - The first route in this table specifies the - default route. When the local system - needs to make a connection to a remote host, it checks - the routing table to determine if a known path exists. - If the remote host matches an entry in the table, the - system checks to see if it can connect using the - interface specified in that entry. - - If the destination does not match an entry, or if - all known paths fail, the system uses the entry for the - default route. For hosts on a local area network, the - Gateway field in the default route is - set to the system which has a direct connection to the - Internet. When reading this entry, verify that the - Flags column indicates that the - gateway is usable (UG). - - The default route for a machine which itself is - functioning as the gateway to the outside world will be - the gateway machine at the Internet Service Provider - (ISP). - - - - - localhost - - The second route is the localhost - route. The interface specified in the - Netif column for - localhost is - lo0, also known as the loopback - device. This indicates that all traffic for this - destination should be internal, rather than sending it - out over the network. - - - - - MAC address - - The addresses beginning with 0:e0: are - MAC addresses. FreeBSD will - automatically identify any hosts, - test0 in the example, on the - local Ethernet and add a route for that host over the - Ethernet interface, re0. This type - of route has a timeout, seen in the - Expire column, which is used if the - host does not respond in a specific amount of time. - When this happens, the route to this host will be - automatically deleted. These hosts are identified using - the Routing Information Protocol - (RIP), which calculates routes to - local hosts based upon a shortest path - determination. - - - - - subnet - - FreeBSD will automatically add subnet routes for the - local subnet. In this example, 10.20.30.255 is the - broadcast address for the subnet 10.20.30 and - example.com is the - domain name associated with that subnet. The - designation link#1 refers to the - first Ethernet card in the machine. - - Local network hosts and local subnets have their - routes automatically configured by a daemon called - routed8. If it is not running, only routes which - are statically defined by the administrator will - exist. - - - - - host - - The host1 line refers to the host - by its Ethernet address. Since it is the sending host, - FreeBSD knows to use the loopback interface - (lo0) rather than the Ethernet - interface. - - The two host2 lines represent - aliases which were created using ifconfig8. The - => symbol after the - lo0 interface says that an alias - has been set in addition to the loopback address. Such - routes only show up on the host that supports the alias - and all other hosts on the local network will have a - link#1 line for such routes. - - - - - 224 - - The final line (destination subnet 224) deals with - multicasting. - - - - - Various attributes of each route can be seen in the - Flags column. - summarizes some of these flags and their meanings: - - - 常見路由表標記 - - - - - 指令 - 用途 - - - - - - U - The route is active (up). - - - - H - The route destination is a single host. - - - - G - Send anything for this destination on to this - gateway, which will figure out from there where to - send it. - - - - S - This route was statically configured. - - - - C - Clones a new route based upon this route for - machines to connect to. This type of route is - normally used for local networks. - - - - W - The route was auto-configured based upon a local - area network (clone) route. - - - - L - Route involves references to Ethernet (link) - hardware. - - - -
- - On a FreeBSD system, the default route can defined in - /etc/rc.conf by specifying the - IP address of the default gateway: - - defaultrouter="10.20.30.1" - - It is also possible to manually add the route using - route: - - # route add default 10.20.30.1 - - Note that manually added routes will not survive a reboot. - For more information on manual manipulation of network - routing tables, refer to route8. -
- - - - 設定路由器使用靜態路由 - - - - - Al - Hoang - - Contributed by - - - - - - - dual homed hosts - - - A FreeBSD system can be configured as the default gateway, or - router, for a network if it is a dual-homed system. A - dual-homed system is a host which resides on at least two - different networks. Typically, each network is connected to a - separate network interface, though IP - aliasing can be used to bind multiple addresses, each on a - different subnet, to one physical interface. - - 路由器 - - In order for the system to forward packets between - interfaces, FreeBSD must be configured as a router. Internet - standards and good engineering practice prevent the FreeBSD - Project from enabling this feature by default, but it can be - configured to start at boot by adding this line to - /etc/rc.conf: - - gateway_enable="YES" # Set to YES if this host will be a gateway - - To enable routing now, set the sysctl8 variable - net.inet.ip.forwarding to - 1. To stop routing, reset this variable to - 0. - - - BGP - - - RIP - - - OSPF - - - The routing table of a router needs additional routes so - it knows how to reach other networks. Routes can be either - added manually using static routes or routes can be - automatically learned using a routing protocol. Static routes - are appropriate for small networks and this section describes - how to add a static routing entry for a small network. - - - For large networks, static routes quickly become - unscalable. FreeBSD comes with the standard - BSD routing daemon routed8, which - provides the routing protocols RIP, - versions 1 and 2, and IRDP. Support for - the BGP and OSPF - routing protocols can be installed using the - net/zebra package or port. - - - Consider the following network: - - - - - - - - - INTERNET - | (10.0.0.1/24) Default Router to Internet - | - |Interface xl0 - |10.0.0.10/24 - +------+ - | | RouterA - | | (FreeBSD gateway) - +------+ - | Interface xl1 - | 192.168.1.1/24 - | - +--------------------------------+ - Internal Net 1 | 192.168.1.2/24 - | - +------+ - | | RouterB - | | - +------+ - | 192.168.2.1/24 - | - Internal Net 2 - - - - In this scenario, RouterA is a - FreeBSD machine that is acting as a router to the rest of the - Internet. It has a default route set to 10.0.0.1 which allows it to - connect with the outside world. - RouterB is already configured to use - 192.168.1.1 as its - default gateway. - - Before adding any static routes, the routing table on - RouterA looks like this: - - % netstat -nr -Routing tables - -Internet: -Destination Gateway Flags Refs Use Netif Expire -default 10.0.0.1 UGS 0 49378 xl0 -127.0.0.1 127.0.0.1 UH 0 6 lo0 -10.0.0.0/24 link#1 UC 0 0 xl0 -192.168.1.0/24 link#2 UC 0 0 xl1 - - With the current routing table, - RouterA does not have a route to the - 192.168.2.0/24 - network. The following command adds the Internal Net - 2 network to RouterA's - routing table using 192.168.1.2 as the next - hop: - - # route add -net 192.168.2.0/24 192.168.1.2 - - Now, RouterA can reach any host - on the 192.168.2.0/24 network. - However, the routing information will not persist if the FreeBSD - system reboots. If a static route needs to be persistent, add - it to /etc/rc.conf: - - # Add Internal Net 2 as a persistent static route -static_routes="internalnet2" -route_internalnet2="-net 192.168.2.0/24 192.168.1.2" - - The static_routes configuration - variable is a list of strings separated by a space, where each - string references a route name. The variable - route_internalnet2 - contains the static route for that route name. - - Using more than one string in - static_routes creates multiple static - routes. The following shows an example of adding static - routes for the 192.168.0.0/24 and - 192.168.1.0/24 - networks: - - static_routes="net1 net2" -route_net1="-net 192.168.0.0/24 192.168.0.1" -route_net2="-net 192.168.1.0/24 192.168.1.1" - - - - 疑難排解 - - When an address space is assigned to a network, the - service provider configures their routing tables so that all - traffic for the network will be sent to the link for the site. - But how do external sites know to send their packets to the - network's ISP? - - There is a system that keeps track of all assigned - address spaces and defines their point of connection to the - Internet backbone, or the main trunk lines that carry Internet - traffic across the country and around the world. Each - backbone machine has a copy of a master set of tables, which - direct traffic for a particular network to a specific - backbone carrier, and from there down the chain of service - providers until it reaches a particular network. - - It is the task of the service provider to advertise to - the backbone sites that they are the point of connection, and - thus the path inward, for a site. This is known as route - propagation. - - - traceroute8 - - - Sometimes, there is a problem with route propagation and - some sites are unable to connect. Perhaps the most useful - command for trying to figure out where routing is breaking - down is traceroute. It is useful when - ping fails. - - When using traceroute, include the - address of the remote host to connect to. The output will - show the gateway hosts along the path of the attempt, - eventually either reaching the target host, or terminating - because of a lack of connection. For more information, refer - to traceroute8. - - - - 群播 (Multicast) 注意事項 - - - multicast routing - - 核心選項 MROUTING - - FreeBSD natively supports both multicast applications and - multicast routing. Multicast applications do not require any - special configuration in order to run on FreeBSD. Support for - multicast routing requires that the following option be - compiled into a custom kernel: - - options MROUTING - - The multicast routing daemon, - mrouted can be installed using the - net/mrouted package or port. This daemon - implements the DVMRP multicast routing - protocol and is configured by editing - /usr/local/etc/mrouted.conf in order to - set up the tunnels and DVMRP. The - installation of mrouted also - installs map-mbone and - mrinfo, as well as their associated - man pages. Refer to these for configuration examples. - - - DVMRP has largely been replaced by - the PIM protocol in many multicast - installations. Refer to pim4 for more - information. - - -
- - - - 無線網路 - - - - - Loader - - - - - Marc - Fonvieille - - - - - Murray - Stokely - - - - - - 無線網路 - 802.11 無線網路 - - - 無線網路基礎 - - Most wireless networks are based on the IEEE 802.11 - standards. A basic wireless network consists of multiple - stations communicating with radios that broadcast in either - the 2.4GHz or 5GHz band, though this varies according to the - locale and is also changing to enable communication in the - 2.3GHz and 4.9GHz ranges. - - 802.11 networks are organized in two ways. In - infrastructure mode, one station acts as - a - master with all the other stations associating to it, the - network is known as a BSS, and the master - station is termed an access point (AP). - In a BSS, all communication passes through - the AP; even when one station wants to - communicate with another wireless station, messages must go - through the AP. In the second form of - network, there is no master and stations communicate directly. - This form of network is termed an IBSS - and is commonly known as an ad-hoc - network. - - 802.11 networks were first deployed in the 2.4GHz band - using protocols defined by the IEEE 802.11 and 802.11b - standard. These specifications include the operating - frequencies and the MAC layer - characteristics, including framing and transmission rates, - as communication can occur at various rates. Later, the - 802.11a standard defined operation in the 5GHz band, including - different signaling mechanisms and higher transmission rates. - Still later, the 802.11g standard defined the use of 802.11a - signaling and transmission mechanisms in the 2.4GHz band in - such a way as to be backwards compatible with 802.11b - networks. - - Separate from the underlying transmission techniques, - 802.11 networks have a variety of security mechanisms. The - original 802.11 specifications defined a simple security - protocol called WEP. This protocol uses a - fixed pre-shared key and the RC4 cryptographic cipher to - encode data transmitted on a network. Stations must all - agree on the fixed key in order to communicate. This scheme - was shown to be easily broken and is now rarely used except - to discourage transient users from joining networks. Current - security practice is given by the IEEE 802.11i specification - that defines new cryptographic ciphers and an additional - protocol to authenticate stations to an access point and - exchange keys for data communication. Cryptographic keys - are periodically refreshed and there are mechanisms for - detecting and countering intrusion attempts. Another - security protocol specification commonly used in wireless - networks is termed WPA, which was a - precursor to 802.11i. WPA specifies a - subset of the requirements found in 802.11i and is designed - for implementation on legacy hardware. Specifically, - WPA requires only the - TKIP cipher that is derived from the - original WEP cipher. 802.11i permits use - of TKIP but also requires support for a - stronger cipher, AES-CCM, for encrypting data. The - AES cipher was not required in - WPA because it was deemed too - computationally costly to be implemented on legacy - hardware. - - The other standard to be aware of is 802.11e. It defines - protocols for deploying multimedia applications, such as - streaming video and voice over IP (VoIP), - in an 802.11 network. Like 802.11i, 802.11e also has a - precursor specification termed WME (later - renamed WMM) that has been defined by an - industry group as a subset of 802.11e that can be deployed now - to enable multimedia applications while waiting for the final - ratification of 802.11e. The most important thing to know - about 802.11e and - WME/WMM is that it - enables prioritized traffic over a wireless network through - Quality of Service (QoS) protocols and - enhanced media access protocols. Proper implementation of - these protocols enables high speed bursting of data and - prioritized traffic flow. - - FreeBSD supports networks that operate using 802.11a, - 802.11b, and 802.11g. The WPA and 802.11i - security protocols are likewise supported (in conjunction with - any of 11a, 11b, and 11g) and QoS and - traffic prioritization required by the - WME/WMM protocols are - supported for a limited set of wireless devices. - - - - 快速開始 - - Connecting a computer to an existing wireless network is - a very common situation. This procedure shows the steps - required. - - - - Obtain the SSID (Service Set - Identifier) and PSK (Pre-Shared Key) - for the wireless network from the network - administrator. - - - - Identify the wireless adapter. The FreeBSD - GENERIC kernel includes drivers for - many common wireless adapters. If the wireless adapter is - one of those models, it will be shown in the output from - ifconfig8: - - % ifconfig | grep -B3 -i wireless - - On FreeBSD 11 or higher, use this command - instead: - - % sysctl net.wlan.devices - - If a wireless adapter is not listed, an additional - kernel module might be required, or it might be a model - not supported by FreeBSD. - - - This example shows the Atheros ath0 - wireless adapter. - - - - Add an entry for this network to - /etc/wpa_supplicant.conf. If the - file does not exist, create it. Replace - myssid and - mypsk with the - SSID and PSK - provided by the network administrator. - - network={ - ssid="myssid" - psk="mypsk" -} - - - - Add entries to /etc/rc.conf to - configure the network on startup: - - wlans_ath0="wlan0" -ifconfig_wlan0="WPA SYNCDHCP" - - - - Restart the computer, or restart the network service - to connect to the network: - - # service netif restart - - - - - - 基礎設定 - - - 核心設定 - - To use wireless networking, a wireless networking card - is needed and the kernel needs to be configured with the - appropriate wireless networking support. The kernel is - separated into multiple modules so that only the required - support needs to be configured. - - The most - commonly used wireless devices are those that use parts made - by Atheros. These devices are supported by ath4 - and require the following line to be added to - /boot/loader.conf: - - if_ath_load="YES" - - The Atheros driver is split up into three separate - pieces: the driver (ath4), the hardware support - layer that handles chip-specific functions - (ath_hal4), and an algorithm for selecting the - rate for transmitting frames. When this support is loaded - as kernel modules, any dependencies are automatically - handled. To load support for a different type of wireless - device, specify the module for that device. This example - is for devices based on the Intersil Prism parts - (wi4) driver: - - if_wi_load="YES" - - - The examples in this section use an ath4 - device and the device name in the examples must be - changed according to the configuration. A list of - available wireless drivers and supported adapters can be - found in the FreeBSD Hardware Notes, available on - the Release - Information page of the FreeBSD website. If a - native FreeBSD driver for the wireless device does not - exist, it may be possible to use the Windows driver - with the help of the NDIS driver - wrapper. - - - In addition, the modules that implement cryptographic - support for the security protocols to use must be loaded. - These are intended to be dynamically loaded on demand by - the wlan4 module, but for now they must be manually - configured. The following modules are available: - wlan_wep4, wlan_ccmp4, and wlan_tkip4. - The wlan_ccmp4 and wlan_tkip4 drivers are - only needed when using the WPA or - 802.11i security protocols. If the network does not use - encryption, wlan_wep4 support is not needed. To - load these modules at boot time, add the following lines to - /boot/loader.conf: - - wlan_wep_load="YES" -wlan_ccmp_load="YES" -wlan_tkip_load="YES" - - Once this information has been added to - /boot/loader.conf, reboot the FreeBSD - box. Alternately, load the modules by hand using - kldload8. - - - For users who do not want to use modules, it is - possible to compile these drivers into the kernel by - adding the following lines to a custom kernel - configuration file: - - device wlan # 802.11 support -device wlan_wep # 802.11 WEP support -device wlan_ccmp # 802.11 CCMP support -device wlan_tkip # 802.11 TKIP support -device wlan_amrr # AMRR transmit rate control algorithm -device ath # Atheros pci/cardbus NIC's -device ath_hal # pci/cardbus chip support -options AH_SUPPORT_AR5416 # enable AR5416 tx/rx descriptors -device ath_rate_sample # SampleRate tx rate control for ath - - With this information in the kernel configuration - file, recompile the kernel and reboot the FreeBSD - machine. - - - Information about the wireless device should appear - in the boot messages, like this: - - ath0: <Atheros 5212> mem 0x88000000-0x8800ffff irq 11 at device 0.0 on cardbus1 -ath0: [ITHREAD] -ath0: AR2413 mac 7.9 RF2413 phy 4.5 - - - - 設定正確的區域 - - Since the regulatory situation is different - in various parts of the world, it is necessary to - correctly set the domains that apply to your location to - have the correct information about what channels can be - used. - - The available region definitions can be found in - /etc/regdomain.xml. To set the data at - runtime, use ifconfig: - - # ifconfig wlan0 regdomain ETSI country AT - - To persist the settings, add it to - /etc/rc.conf: - - # sysrc create_args_wlan0="country AT regdomain ETSI" - - - - - 主從式 (Infrastructure) - - Infrastructure (BSS) mode is the - mode that is typically used. In this mode, a number of - wireless access points are connected to a wired network. - Each wireless network has its own name, called the - SSID. Wireless clients connect to the - wireless access points. - - - FreeBSD 客戶端 - - - 如何尋找存取點 - - To scan for available networks, use ifconfig8. - This request may take a few moments to complete as it - requires the system to switch to each available wireless - frequency and probe for available access points. Only - the superuser can initiate a scan: - - # ifconfig wlan0 create wlandev ath0 -# ifconfig wlan0 up scan -SSID/MESH ID BSSID CHAN RATE S:N INT CAPS -dlinkap 00:13:46:49:41:76 11 54M -90:96 100 EPS WPA WME -freebsdap 00:11:95:c3:0d:ac 1 54M -83:96 100 EPS WPA - - - The interface must be before - it can scan. Subsequent scan requests do not require - the interface to be marked as up again. - - - The output of a scan request lists each - BSS/IBSS network - found. Besides listing the name of the network, the - SSID, the output also shows the - BSSID, which is the - MAC address of the access point. The - CAPS field identifies the type of - each network and the capabilities of the stations - operating there: - - - 站台功能代號 - - - - - 功能代號 - 意義 - - - - - - E - Extended Service Set - (ESS). Indicates that - the station is part of an infrastructure network - rather than an IBSS/ad-hoc - network. - - - - I - IBSS/ad-hoc network. - Indicates that the station is part of an ad-hoc - network rather than an ESS - network. - - - - P - Privacy. Encryption is required for all - data frames exchanged within the - BSS using cryptographic means - such as WEP, - TKIP or - AES-CCMP. - - - - S - Short Preamble. Indicates that the network - is using short preambles, defined in 802.11b High - Rate/DSSS PHY, and utilizes a 56 bit sync field - rather than the 128 bit field used in long - preamble mode. - - - - s - Short slot time. Indicates that the 802.11g - network is using a short slot time because there - are no legacy (802.11b) stations present. - - - -
- - One can also display the current list of known - networks with: - - # ifconfig wlan0 list scan - - This information may be updated automatically by the - adapter or manually with a request. - Old data is automatically removed from the cache, so over - time this list may shrink unless more scans are - done. -
- - - 基礎設定 - - This section provides a simple example of how to make - the wireless network adapter work in FreeBSD without - encryption. Once familiar with these concepts, it is - strongly recommend to use WPA to set up - the wireless network. - - There are three basic steps to configure a wireless - network: select an access point, authenticate the - station, and configure an IP address. - The following sections discuss each step. - - - 選擇存取點 - - Most of the time, it is sufficient to let the system - choose an access point using the builtin heuristics. - This is the default behavior when an interface is - marked as up or it is listed in - /etc/rc.conf: - - wlans_ath0="wlan0" -ifconfig_wlan0="DHCP" - - If there are multiple access points, a specific - one can be selected by its - SSID: - - wlans_ath0="wlan0" -ifconfig_wlan0="ssid your_ssid_here DHCP" - - In an environment where there are multiple access - points with the same SSID, which - is often done to simplify roaming, it may be necessary - to associate to one specific device. In this case, the - BSSID of the access point can be - specified, with or without the - SSID: - - wlans_ath0="wlan0" -ifconfig_wlan0="ssid your_ssid_here bssid xx:xx:xx:xx:xx:xx DHCP" - - There are other ways to constrain the choice of an - access point, such as limiting the set of frequencies - the system will scan on. This may be useful for a - multi-band wireless card as scanning all the possible - channels can be time-consuming. To limit operation to a - specific band, use the - parameter: - - wlans_ath0="wlan0" -ifconfig_wlan0="mode 11g ssid your_ssid_here DHCP" - - This example will force the card to operate in - 802.11g, which is defined only for 2.4GHz frequencies - so any 5GHz channels will not be considered. This can - also be achieved with the - parameter, which locks - operation to one specific frequency, and the - parameter, to specify a list - of channels for scanning. More information about these - parameters can be found in ifconfig8. - - - - 認證 - - Once an access point is selected, the station - needs to authenticate before it can pass data. - Authentication can happen in several ways. The most - common scheme, open authentication, allows any station - to join the network and communicate. This is the - authentication to use for test purposes the first time - a wireless network is setup. Other schemes require - cryptographic handshakes to be completed before data - traffic can flow, either using pre-shared keys or - secrets, or more complex schemes that involve backend - services such as RADIUS. Open - authentication is the default setting. The next most - common setup is WPA-PSK, also - known as WPA Personal, which is - described in . - - - If using an Apple AirPort Extreme base - station for an access point, shared-key authentication - together with a WEP key needs to - be configured. This can be configured in - /etc/rc.conf or by using - wpa_supplicant8. For a single AirPort base - station, access can be configured with: - - wlans_ath0="wlan0" -ifconfig_wlan0="authmode shared wepmode on weptxkey 1 wepkey 01234567 DHCP" - - In general, shared key authentication should be - avoided because it uses the WEP key - material in a highly-constrained manner, making it - even easier to crack the key. If - WEP must be used for compatibility - with legacy devices, it is better to use - WEP with open - authentication. More information regarding - WEP can be found in . - - - - - 使用 <acronym>DHCP</acronym> 取得 <acronym>IP</acronym> 位址 - - Once an access point is selected and the - authentication parameters are set, an - IP address must be obtained in - order to communicate. Most of the time, the - IP address is obtained via - DHCP. To achieve that, edit - /etc/rc.conf and add - DHCP to the configuration for the - device: - - wlans_ath0="wlan0" -ifconfig_wlan0="DHCP" - - The - wireless interface is now ready to bring up: - - # service netif start - - Once the interface is running, use ifconfig8 - to see the status of the interface - ath0: - - # ifconfig wlan0 -wlan0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> mtu 1500 - ether 00:11:95:d5:43:62 - inet 192.168.1.100 netmask 0xffffff00 broadcast 192.168.1.255 - media: IEEE 802.11 Wireless Ethernet OFDM/54Mbps mode 11g - status: associated - ssid dlinkap channel 11 (2462 Mhz 11g) bssid 00:13:46:49:41:76 - country US ecm authmode OPEN privacy OFF txpower 21.5 bmiss 7 - scanvalid 60 bgscan bgscanintvl 300 bgscanidle 250 roam:rssi 7 - roam:rate 5 protmode CTS wme burst - - The status: associated line means - that it is connected to the wireless network. The - bssid 00:13:46:49:41:76 is the - MAC address of the access point and - authmode OPEN indicates that the - communication is not encrypted. - - - - 靜態 <acronym>IP</acronym> 位址 - - If an IP address cannot be - obtained from a DHCP server, set a - fixed IP address. Replace the - DHCP keyword shown above with the - address information. Be sure to retain any other - parameters for selecting the access point: - - wlans_ath0="wlan0" -ifconfig_wlan0="inet 192.168.1.100 netmask 255.255.255.0 ssid your_ssid_here" - - - - - <acronym>WPA</acronym> - - Wi-Fi Protected Access (WPA) is a - security protocol used together with 802.11 networks to - address the lack of proper authentication and the weakness - of WEP. WPA leverages the 802.1X - authentication protocol and uses one of several ciphers - instead of WEP for data integrity. - The only cipher required by WPA is the - Temporary Key Integrity Protocol - (TKIP). TKIP is a - cipher that extends the basic RC4 cipher used by - WEP by adding integrity checking, - tamper detection, and measures for responding to detected - intrusions. TKIP is designed to work - on legacy hardware with only software modification. It - represents a compromise that improves security but is - still not entirely immune to attack. - WPA also specifies the - AES-CCMP cipher as an alternative to - TKIP, and that is preferred when - possible. For this specification, the term - WPA2 or RSN is - commonly used. - - WPA defines authentication and - encryption protocols. Authentication is most commonly - done using one of two techniques: by 802.1X and a backend - authentication service such as RADIUS, - or by a minimal handshake between the station and the - access point using a pre-shared secret. The former is - commonly termed WPA Enterprise and the - latter is known as WPA Personal. Since - most people will not set up a RADIUS - backend server for their wireless network, - WPA-PSK is by far the most commonly - encountered configuration for - WPA. - - The control of the wireless connection and the key - negotiation or authentication with a server is done using - wpa_supplicant8. This program requires a - configuration file, - /etc/wpa_supplicant.conf, to run. - More information regarding this file can be found in - wpa_supplicant.conf5. - - - <acronym>WPA-PSK</acronym> - - WPA-PSK, also known as - WPA Personal, is based on a - pre-shared key (PSK) which is - generated from a given password and used as the master - key in the wireless network. This means every wireless - user will share the same key. - WPA-PSK is intended for small - networks where the use of an authentication server is - not possible or desired. - - - Always use strong passwords that are sufficiently - long and made from a rich alphabet so that they will - not be easily guessed or attacked. - - - The first step is the configuration of - /etc/wpa_supplicant.conf with - the SSID and the pre-shared key of - the network: - - network={ - ssid="freebsdap" - psk="freebsdmall" -} - - Then, in /etc/rc.conf, - indicate that the wireless device configuration will be - done with WPA and the - IP address will be obtained with - DHCP: - - wlans_ath0="wlan0" -ifconfig_wlan0="WPA DHCP" - - Then, bring up the interface: - - # service netif start -Starting wpa_supplicant. -DHCPDISCOVER on wlan0 to 255.255.255.255 port 67 interval 5 -DHCPDISCOVER on wlan0 to 255.255.255.255 port 67 interval 6 -DHCPOFFER from 192.168.0.1 -DHCPREQUEST on wlan0 to 255.255.255.255 port 67 -DHCPACK from 192.168.0.1 -bound to 192.168.0.254 -- renewal in 300 seconds. -wlan0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> mtu 1500 - ether 00:11:95:d5:43:62 - inet 192.168.0.254 netmask 0xffffff00 broadcast 192.168.0.255 - media: IEEE 802.11 Wireless Ethernet OFDM/36Mbps mode 11g - status: associated - ssid freebsdap channel 1 (2412 Mhz 11g) bssid 00:11:95:c3:0d:ac - country US ecm authmode WPA2/802.11i privacy ON deftxkey UNDEF - AES-CCM 3:128-bit txpower 21.5 bmiss 7 scanvalid 450 bgscan - bgscanintvl 300 bgscanidle 250 roam:rssi 7 roam:rate 5 protmode CTS - wme burst roaming MANUAL - - Or, try to configure the interface manually using - the information in - /etc/wpa_supplicant.conf: - - # wpa_supplicant -i wlan0 -c /etc/wpa_supplicant.conf -Trying to associate with 00:11:95:c3:0d:ac (SSID='freebsdap' freq=2412 MHz) -Associated with 00:11:95:c3:0d:ac -WPA: Key negotiation completed with 00:11:95:c3:0d:ac [PTK=CCMP GTK=CCMP] -CTRL-EVENT-CONNECTED - Connection to 00:11:95:c3:0d:ac completed (auth) [id=0 id_str=] - - The next operation is to launch dhclient8 - to get the IP address from the - DHCP server: - - # dhclient wlan0 -DHCPREQUEST on wlan0 to 255.255.255.255 port 67 -DHCPACK from 192.168.0.1 -bound to 192.168.0.254 -- renewal in 300 seconds. -# ifconfig wlan0 -wlan0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> mtu 1500 - ether 00:11:95:d5:43:62 - inet 192.168.0.254 netmask 0xffffff00 broadcast 192.168.0.255 - media: IEEE 802.11 Wireless Ethernet OFDM/36Mbps mode 11g - status: associated - ssid freebsdap channel 1 (2412 Mhz 11g) bssid 00:11:95:c3:0d:ac - country US ecm authmode WPA2/802.11i privacy ON deftxkey UNDEF - AES-CCM 3:128-bit txpower 21.5 bmiss 7 scanvalid 450 bgscan - bgscanintvl 300 bgscanidle 250 roam:rssi 7 roam:rate 5 protmode CTS - wme burst roaming MANUAL - - - If /etc/rc.conf has an - ifconfig_wlan0="DHCP" entry, - dhclient8 will be launched automatically after - wpa_supplicant8 associates with the access - point. - - - If DHCP is not possible or - desired, set a static IP address - after wpa_supplicant8 has authenticated the - station: - - # ifconfig wlan0 inet 192.168.0.100 netmask 255.255.255.0 -# ifconfig wlan0 -wlan0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> mtu 1500 - ether 00:11:95:d5:43:62 - inet 192.168.0.100 netmask 0xffffff00 broadcast 192.168.0.255 - media: IEEE 802.11 Wireless Ethernet OFDM/36Mbps mode 11g - status: associated - ssid freebsdap channel 1 (2412 Mhz 11g) bssid 00:11:95:c3:0d:ac - country US ecm authmode WPA2/802.11i privacy ON deftxkey UNDEF - AES-CCM 3:128-bit txpower 21.5 bmiss 7 scanvalid 450 bgscan - bgscanintvl 300 bgscanidle 250 roam:rssi 7 roam:rate 5 protmode CTS - wme burst roaming MANUAL - - When DHCP is not used, the - default gateway and the nameserver also have to be - manually set: - - # route add default your_default_router -# echo "nameserver your_DNS_server" >> /etc/resolv.conf - - - - <acronym>WPA</acronym> 加上 <acronym>EAP-TLS</acronym> - - The second way to use WPA is with - an 802.1X backend authentication server. In this case, - WPA is called - WPA Enterprise to differentiate it - from the less secure WPA Personal. - Authentication in WPA Enterprise is - based on the Extensible Authentication Protocol - (EAP). - - EAP does not come with an - encryption method. Instead, EAP is - embedded inside an encrypted tunnel. There are many - EAP authentication methods, but - EAP-TLS, EAP-TTLS, - and EAP-PEAP are the most - common. - - EAP with Transport Layer Security - (EAP-TLS) is a well-supported - wireless authentication protocol since it was the - first EAP method to be certified - by the Wi-Fi - Alliance. EAP-TLS requires - three certificates to run: the certificate of the - Certificate Authority (CA) installed - on all machines, the server certificate for the - authentication server, and one client certificate for - each wireless client. In this EAP - method, both the authentication server and wireless - client authenticate each other by presenting their - respective certificates, and then verify that these - certificates were signed by the organization's - CA. - - As previously, the configuration is done via - /etc/wpa_supplicant.conf: - - network={ - ssid="freebsdap" - proto=RSN - key_mgmt=WPA-EAP - eap=TLS - identity="loader" - ca_cert="/etc/certs/cacert.pem" - client_cert="/etc/certs/clientcert.pem" - private_key="/etc/certs/clientkey.pem" - private_key_passwd="freebsdmallclient" -} - - - - This field indicates the network name - (SSID). - - - - This example uses the RSN - IEEE 802.11i protocol, also known as - WPA2. - - - - The key_mgmt line refers to - the key management protocol to use. In this - example, it is WPA using - EAP authentication. - - - - This field indicates the EAP - method for the connection. - - - - The identity field contains - the identity string for - EAP. - - - - The ca_cert field indicates - the pathname of the CA - certificate file. This file is needed to verify - the server certificate. - - - - The client_cert line gives - the pathname to the client certificate file. This - certificate is unique to each wireless client of the - network. - - - - The private_key field is the - pathname to the client certificate private key - file. - - - - The private_key_passwd field - contains the passphrase for the private key. - - - - Then, add the following lines to - /etc/rc.conf: - - wlans_ath0="wlan0" -ifconfig_wlan0="WPA DHCP" - - The next step is to bring up the interface: - - # service netif start -Starting wpa_supplicant. -DHCPREQUEST on wlan0 to 255.255.255.255 port 67 interval 7 -DHCPREQUEST on wlan0 to 255.255.255.255 port 67 interval 15 -DHCPACK from 192.168.0.20 -bound to 192.168.0.254 -- renewal in 300 seconds. -wlan0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> mtu 1500 - ether 00:11:95:d5:43:62 - inet 192.168.0.254 netmask 0xffffff00 broadcast 192.168.0.255 - media: IEEE 802.11 Wireless Ethernet DS/11Mbps mode 11g - status: associated - ssid freebsdap channel 1 (2412 Mhz 11g) bssid 00:11:95:c3:0d:ac - country US ecm authmode WPA2/802.11i privacy ON deftxkey UNDEF - AES-CCM 3:128-bit txpower 21.5 bmiss 7 scanvalid 450 bgscan - bgscanintvl 300 bgscanidle 250 roam:rssi 7 roam:rate 5 protmode CTS - wme burst roaming MANUAL - - It is also possible to bring up the interface - manually using wpa_supplicant8 and - ifconfig8. - - - - <acronym>WPA</acronym> 加上 <acronym>EAP-TTLS</acronym> - - With EAP-TLS, both the - authentication server and the client need a certificate. - With EAP-TTLS, a client certificate - is optional. This method is similar to a web server - which creates a secure SSL tunnel - even if visitors do not have client-side certificates. - EAP-TTLS uses an encrypted - TLS tunnel for safe transport of - the authentication data. - - The required configuration can be added to - /etc/wpa_supplicant.conf: - - network={ - ssid="freebsdap" - proto=RSN - key_mgmt=WPA-EAP - eap=TTLS - identity="test" - password="test" - ca_cert="/etc/certs/cacert.pem" - phase2="auth=MD5" -} - - - - This field specifies the EAP - method for the connection. - - - - The identity field contains - the identity string for EAP - authentication inside the encrypted - TLS tunnel. - - - - The password field contains - the passphrase for the EAP - authentication. - - - - The ca_cert field indicates - the pathname of the CA - certificate file. This file is needed to verify - the server certificate. - - - - This field specifies the authentication - method used in the encrypted TLS - tunnel. In this example, - EAP with MD5-Challenge is used. - The inner authentication phase is - often called phase2. - - - - Next, add the following lines to - /etc/rc.conf: - - wlans_ath0="wlan0" -ifconfig_wlan0="WPA DHCP" - - The next step is to bring up the interface: - - # service netif start -Starting wpa_supplicant. -DHCPREQUEST on wlan0 to 255.255.255.255 port 67 interval 7 -DHCPREQUEST on wlan0 to 255.255.255.255 port 67 interval 15 -DHCPREQUEST on wlan0 to 255.255.255.255 port 67 interval 21 -DHCPACK from 192.168.0.20 -bound to 192.168.0.254 -- renewal in 300 seconds. -wlan0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> mtu 1500 - ether 00:11:95:d5:43:62 - inet 192.168.0.254 netmask 0xffffff00 broadcast 192.168.0.255 - media: IEEE 802.11 Wireless Ethernet DS/11Mbps mode 11g - status: associated - ssid freebsdap channel 1 (2412 Mhz 11g) bssid 00:11:95:c3:0d:ac - country US ecm authmode WPA2/802.11i privacy ON deftxkey UNDEF - AES-CCM 3:128-bit txpower 21.5 bmiss 7 scanvalid 450 bgscan - bgscanintvl 300 bgscanidle 250 roam:rssi 7 roam:rate 5 protmode CTS - wme burst roaming MANUAL - - - - <acronym>WPA</acronym> 加上 <acronym>EAP-PEAP</acronym> - - - PEAPv0/EAP-MSCHAPv2 is the most - common PEAP method. In this - chapter, the term PEAP is used to - refer to that method. - - - Protected EAP (PEAP) is designed - as an alternative to EAP-TTLS and - is the most used EAP standard after - EAP-TLS. In a network with mixed - operating systems, PEAP should be - the most supported standard after - EAP-TLS. - - PEAP is similar to - EAP-TTLS as it uses a server-side - certificate to authenticate clients by creating an - encrypted TLS tunnel between the - client and the authentication server, which protects - the ensuing exchange of authentication information. - PEAP authentication differs from - EAP-TTLS as it broadcasts the - username in the clear and only the password is sent - in the encrypted TLS tunnel. - EAP-TTLS will use the - TLS tunnel for both the username - and password. - - Add the following lines to - /etc/wpa_supplicant.conf to - configure the EAP-PEAP related - settings: - - network={ - ssid="freebsdap" - proto=RSN - key_mgmt=WPA-EAP - eap=PEAP - identity="test" - password="test" - ca_cert="/etc/certs/cacert.pem" - phase1="peaplabel=0" - phase2="auth=MSCHAPV2" -} - - - - This field specifies the EAP - method for the connection. - - - - The identity field contains - the identity string for EAP - authentication inside the encrypted - TLS tunnel. - - - - The password field contains - the passphrase for the EAP - authentication. - - - - The ca_cert field indicates - the pathname of the CA - certificate file. This file is needed to verify - the server certificate. - - - - This field contains the parameters for the - first phase of authentication, the - TLS tunnel. According to the - authentication server used, specify a specific - label for authentication. Most of the time, the - label will be client EAP - encryption which is set by using - peaplabel=0. More information - can be found in wpa_supplicant.conf5. - - - - This field specifies the authentication - protocol used in the encrypted - TLS tunnel. In the - case of PEAP, it is - auth=MSCHAPV2. - - - - 將以下參數加到 /etc/rc.conf - - wlans_ath0="wlan0" -ifconfig_wlan0="WPA DHCP" - - Then, bring up the interface: - - # service netif start -Starting wpa_supplicant. -DHCPREQUEST on wlan0 to 255.255.255.255 port 67 interval 7 -DHCPREQUEST on wlan0 to 255.255.255.255 port 67 interval 15 -DHCPREQUEST on wlan0 to 255.255.255.255 port 67 interval 21 -DHCPACK from 192.168.0.20 -bound to 192.168.0.254 -- renewal in 300 seconds. -wlan0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> mtu 1500 - ether 00:11:95:d5:43:62 - inet 192.168.0.254 netmask 0xffffff00 broadcast 192.168.0.255 - media: IEEE 802.11 Wireless Ethernet DS/11Mbps mode 11g - status: associated - ssid freebsdap channel 1 (2412 Mhz 11g) bssid 00:11:95:c3:0d:ac - country US ecm authmode WPA2/802.11i privacy ON deftxkey UNDEF - AES-CCM 3:128-bit txpower 21.5 bmiss 7 scanvalid 450 bgscan - bgscanintvl 300 bgscanidle 250 roam:rssi 7 roam:rate 5 protmode CTS - wme burst roaming MANUAL - - - - - <acronym>WEP</acronym> - - Wired Equivalent Privacy (WEP) is - part of the original 802.11 standard. There is no - authentication mechanism, only a weak form of access - control which is easily cracked. - - WEP can be set up using - ifconfig8: - - # ifconfig wlan0 create wlandev ath0 -# ifconfig wlan0 inet 192.168.1.100 netmask 255.255.255.0 \ - ssid my_net wepmode on weptxkey 3 wepkey 3:0x3456789012 - - - - - The weptxkey specifies which - WEP key will be used in the - transmission. This example uses the third key. - This must match the setting on the access point. - When unsure which key is used by the access point, - try 1 (the first key) for this - value. - - - - The wepkey selects one of the - WEP keys. It should be in the - format index:key. Key - 1 is used by default; the index - only needs to be set when using a key other than the - first key. - - - Replace the 0x3456789012 - with the key configured for use on the access - point. - - - - - Refer to ifconfig8 for further - information. - - The wpa_supplicant8 facility can be used to - configure a wireless interface with - WEP. The example above can be set up - by adding the following lines to - /etc/wpa_supplicant.conf: - - network={ - ssid="my_net" - key_mgmt=NONE - wep_key3=3456789012 - wep_tx_keyidx=3 -} - - Then: - - # wpa_supplicant -i wlan0 -c /etc/wpa_supplicant.conf -Trying to associate with 00:13:46:49:41:76 (SSID='dlinkap' freq=2437 MHz) -Associated with 00:13:46:49:41:76 - -
-
- - - 對等式 (Ad-hoc) - - IBSS mode, also called ad-hoc mode, is - designed for point to point connections. For example, to - establish an ad-hoc network between the machines - A and B, - choose two IP addresses and a - SSID. - - On A: - - # ifconfig wlan0 create wlandev ath0 wlanmode adhoc -# ifconfig wlan0 inet 192.168.0.1 netmask 255.255.255.0 ssid freebsdap -# ifconfig wlan0 - wlan0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500 - ether 00:11:95:c3:0d:ac - inet 192.168.0.1 netmask 0xffffff00 broadcast 192.168.0.255 - media: IEEE 802.11 Wireless Ethernet autoselect mode 11g <adhoc> - status: running - ssid freebsdap channel 2 (2417 Mhz 11g) bssid 02:11:95:c3:0d:ac - country US ecm authmode OPEN privacy OFF txpower 21.5 scanvalid 60 - protmode CTS wme burst - - The adhoc parameter indicates that the - interface is running in IBSS mode. - - B should now be able to detect - A: - - # ifconfig wlan0 create wlandev ath0 wlanmode adhoc -# ifconfig wlan0 up scan - SSID/MESH ID BSSID CHAN RATE S:N INT CAPS - freebsdap 02:11:95:c3:0d:ac 2 54M -64:-96 100 IS WME - - The I in the output confirms that - A is in ad-hoc mode. Now, configure - B with a different - IP address: - - # ifconfig wlan0 inet 192.168.0.2 netmask 255.255.255.0 ssid freebsdap -# ifconfig wlan0 - wlan0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500 - ether 00:11:95:d5:43:62 - inet 192.168.0.2 netmask 0xffffff00 broadcast 192.168.0.255 - media: IEEE 802.11 Wireless Ethernet autoselect mode 11g <adhoc> - status: running - ssid freebsdap channel 2 (2417 Mhz 11g) bssid 02:11:95:c3:0d:ac - country US ecm authmode OPEN privacy OFF txpower 21.5 scanvalid 60 - protmode CTS wme burst - - Both A and - B are now ready to exchange - information. - - - - FreeBSD 主機存取點 - - FreeBSD can act as an Access Point (AP) - which eliminates the need to buy a hardware - AP or run an ad-hoc network. This can - be particularly useful when a FreeBSD machine is acting as a - gateway to another network such as the Internet. - - - 基礎設定 - - Before configuring a FreeBSD machine as an - AP, the kernel must be configured with - the appropriate networking support for the wireless card - as well as the security protocols being used. For more - details, see . - - - The NDIS driver wrapper for - Windows drivers does not currently support - AP operation. Only native FreeBSD - wireless drivers support AP - mode. - - - Once wireless networking support is loaded, check if - the wireless device supports the host-based access point - mode, also known as hostap mode: - - # ifconfig wlan0 create wlandev ath0 -# ifconfig wlan0 list caps -drivercaps=6f85edc1<STA,FF,TURBOP,IBSS,HOSTAP,AHDEMO,TXPMGT,SHSLOT,SHPREAMBLE,MONITOR,MBSS,WPA1,WPA2,BURST,WME,WDS,BGSCAN,TXFRAG> -cryptocaps=1f<WEP,TKIP,AES,AES_CCM,TKIPMIC> - - This output displays the card's capabilities. The - HOSTAP word confirms that this wireless - card can act as an AP. Various supported - ciphers are also listed: WEP, - TKIP, and AES. This - information indicates which security protocols can be used - on the AP. - - The wireless device can only be put into hostap mode - during the creation of the network pseudo-device, so a - previously created device must be destroyed first: - - # ifconfig wlan0 destroy - - then regenerated with the correct option before setting - the other parameters: - - # ifconfig wlan0 create wlandev ath0 wlanmode hostap -# ifconfig wlan0 inet 192.168.0.1 netmask 255.255.255.0 ssid freebsdap mode 11g channel 1 - - Use ifconfig8 again to see the status of the - wlan0 interface: - - # ifconfig wlan0 - wlan0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500 - ether 00:11:95:c3:0d:ac - inet 192.168.0.1 netmask 0xffffff00 broadcast 192.168.0.255 - media: IEEE 802.11 Wireless Ethernet autoselect mode 11g <hostap> - status: running - ssid freebsdap channel 1 (2412 Mhz 11g) bssid 00:11:95:c3:0d:ac - country US ecm authmode OPEN privacy OFF txpower 21.5 scanvalid 60 - protmode CTS wme burst dtimperiod 1 -dfs - - The hostap parameter indicates the - interface is running in the host-based access point - mode. - - The interface configuration can be done automatically at - boot time by adding the following lines to - /etc/rc.conf: - - wlans_ath0="wlan0" -create_args_wlan0="wlanmode hostap" -ifconfig_wlan0="inet 192.168.0.1 netmask 255.255.255.0 ssid freebsdap mode 11g channel 1" - - - - 無認證或加密的 Host-based 存取點 - - Although it is not recommended to run an - AP without any authentication or - encryption, this is a simple way to check if the - AP is working. This configuration is - also important for debugging client issues. - - Once the AP is configured, initiate - a scan from another wireless machine to find the - AP: - - # ifconfig wlan0 create wlandev ath0 -# ifconfig wlan0 up scan -SSID/MESH ID BSSID CHAN RATE S:N INT CAPS -freebsdap 00:11:95:c3:0d:ac 1 54M -66:-96 100 ES WME - - The client machine found the AP and - can be associated with it: - - # ifconfig wlan0 inet 192.168.0.2 netmask 255.255.255.0 ssid freebsdap -# ifconfig wlan0 - wlan0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500 - ether 00:11:95:d5:43:62 - inet 192.168.0.2 netmask 0xffffff00 broadcast 192.168.0.255 - media: IEEE 802.11 Wireless Ethernet OFDM/54Mbps mode 11g - status: associated - ssid freebsdap channel 1 (2412 Mhz 11g) bssid 00:11:95:c3:0d:ac - country US ecm authmode OPEN privacy OFF txpower 21.5 bmiss 7 - scanvalid 60 bgscan bgscanintvl 300 bgscanidle 250 roam:rssi 7 - roam:rate 5 protmode CTS wme burst - - - - <acronym>WPA2</acronym> Host-based 存取點 - - This section focuses on setting up a FreeBSD - access point using the WPA2 - security protocol. More details regarding - WPA and the configuration of - WPA-based wireless clients can be found - in . - - The hostapd8 daemon is used to deal with client - authentication and key management on the - WPA2-enabled - AP. - - The following configuration operations are performed - on the FreeBSD machine acting as the AP. - Once the AP is correctly working, - hostapd8 can be automatically started at boot - with this line in - /etc/rc.conf: - - hostapd_enable="YES" - - Before trying to configure hostapd8, first - configure the basic settings introduced in . - - - <acronym>WPA2-PSK</acronym> - - WPA2-PSK is intended for small - networks where the use of a backend authentication server - is not possible or desired. - - The configuration is done in - /etc/hostapd.conf: - - interface=wlan0 -debug=1 -ctrl_interface=/var/run/hostapd -ctrl_interface_group=wheel -ssid=freebsdap -wpa=2 -wpa_passphrase=freebsdmall -wpa_key_mgmt=WPA-PSK -wpa_pairwise=CCMP - - - - Wireless interface used - for the access point. - - - - Level of verbosity used during the - execution of hostapd8. A value of - 1 represents the minimal - level. - - - - Pathname of the directory used by hostapd8 - to store domain socket files for communication - with external programs such as hostapd_cli8. - The default value is used in this example. - - - - The group allowed to access the control - interface files. - - - - The wireless network name, or - SSID, that will appear in wireless - scans. - - - - Enable - WPA and specify which - WPA authentication protocol will - be required. A value of 2 - configures the AP for - WPA2 and is recommended. - Set to 1 only if the obsolete - WPA is required. - - - - ASCII passphrase for - WPA authentication. - - - Always use strong passwords that are at least - 8 characters long and made from a rich alphabet so - that they will not be easily guessed or - attacked. - - - - - The - key management protocol to use. This example - sets WPA-PSK. - - - - Encryption algorithms accepted by - the access point. In this example, only - the - CCMP (AES) - cipher is accepted. CCMP - is an alternative to TKIP - and is strongly preferred when possible. - TKIP should be allowed only when - there are stations incapable of using - CCMP. - - - - The next step is to start hostapd8: - - # service hostapd forcestart - - # ifconfig wlan0 -wlan0: flags=8943<UP,BROADCAST,RUNNING,PROMISC,SIMPLEX,MULTICAST> metric 0 mtu 1500 - ether 04:f0:21:16:8e:10 - inet6 fe80::6f0:21ff:fe16:8e10%wlan0 prefixlen 64 scopeid 0x9 - nd6 options=21<PERFORMNUD,AUTO_LINKLOCAL> - media: IEEE 802.11 Wireless Ethernet autoselect mode 11na <hostap> - status: running - ssid No5ignal channel 36 (5180 MHz 11a ht/40+) bssid 04:f0:21:16:8e:10 - country US ecm authmode WPA2/802.11i privacy MIXED deftxkey 2 - AES-CCM 2:128-bit AES-CCM 3:128-bit txpower 17 mcastrate 6 mgmtrate 6 - scanvalid 60 ampdulimit 64k ampdudensity 8 shortgi wme burst - dtimperiod 1 -dfs - groups: wlan - - Once the AP is running, the - clients can associate with it. See for more details. It - is possible to see the stations associated with the - AP using ifconfig - wlan0 list - sta. - - - - - <acronym>WEP</acronym> Host-based 存取點 - - It is not recommended to use WEP for - setting up an AP since there is no - authentication mechanism and the encryption is easily - cracked. Some legacy wireless cards only support - WEP and these cards will only support - an AP without authentication or - encryption. - - The wireless device can now be put into hostap mode and - configured with the correct SSID and - IP address: - - # ifconfig wlan0 create wlandev ath0 wlanmode hostap -# ifconfig wlan0 inet 192.168.0.1 netmask 255.255.255.0 \ - ssid freebsdap wepmode on weptxkey 3 wepkey 3:0x3456789012 mode 11g - - - - The weptxkey indicates which - WEP key will be used in the - transmission. This example uses the third key as key - numbering starts with 1. This - parameter must be specified in order to encrypt the - data. - - - - The wepkey sets the selected - WEP key. It should be in the format - index:key. If the index is - not given, key 1 is set. The index - needs to be set when using keys other than the first - key. - - - - Use ifconfig8 to see the status of the - wlan0 interface: - - # ifconfig wlan0 - wlan0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500 - ether 00:11:95:c3:0d:ac - inet 192.168.0.1 netmask 0xffffff00 broadcast 192.168.0.255 - media: IEEE 802.11 Wireless Ethernet autoselect mode 11g <hostap> - status: running - ssid freebsdap channel 4 (2427 Mhz 11g) bssid 00:11:95:c3:0d:ac - country US ecm authmode OPEN privacy ON deftxkey 3 wepkey 3:40-bit - txpower 21.5 scanvalid 60 protmode CTS wme burst dtimperiod 1 -dfs - - From another wireless machine, it is now possible to - initiate a scan to find the AP: - - # ifconfig wlan0 create wlandev ath0 -# ifconfig wlan0 up scan -SSID BSSID CHAN RATE S:N INT CAPS -freebsdap 00:11:95:c3:0d:ac 1 54M 22:1 100 EPS - - In this example, the client machine found the - AP and can associate with it using the - correct parameters. See for more details. - - - - - 同時使用有線及無線連線 - - A wired connection provides better performance and - reliability, while a wireless connection provides flexibility - and mobility. Laptop users typically want to roam seamlessly - between the two types of connections. - - On FreeBSD, it is possible to combine two or even more - network interfaces together in a failover - fashion. This type of configuration uses the most preferred - and available connection from a group of network interfaces, - and the operating system switches automatically when the link - state changes. - - Link aggregation and failover is covered in and an example for using - both wired and wireless connections is provided at . - - - - 疑難排解 - - This section describes - a number of steps to help troubleshoot common wireless - networking problems. - - - - If the access point is not listed when scanning, - check that the configuration has not limited the wireless - device to a limited set of channels. - - - - If the device cannot associate with an access point, - verify that the configuration matches the settings on the - access point. This includes the authentication scheme and - any security protocols. Simplify the configuration as - much as possible. If using a security protocol such as - WPA or WEP, - configure the access point for open authentication and - no security to see if traffic will pass. - - Debugging support is provided by - wpa_supplicant8. Try running this utility manually - with and look at the - system logs. - - - - Once the system can associate with the access point, - diagnose the network configuration using tools like - ping8. - - - - There are many lower-level debugging tools. - Debugging messages can be enabled in the 802.11 protocol - support layer using wlandebug8. - For example, to enable console messages related to - scanning for access points and the 802.11 protocol - handshakes required to arrange communication: - - # wlandebug -i wlan0 +scan+auth+debug+assoc - net.wlan.0.debug: 0 => 0xc80000<assoc,auth,scan> - - Many useful statistics are maintained by the 802.11 - layer and wlanstats, found in /usr/src/tools/tools/net80211, - will dump this information. These statistics should - display all errors identified by the 802.11 layer. - However, some errors are identified in the device drivers - that lie below the 802.11 layer so they may not show up. - To diagnose device-specific problems, refer to the - drivers' documentation. - - - - If the above information does not help to clarify the - problem, submit a problem report and include output from the - above tools. - -
- - - - USB 網路共享 - - - - tether - - - Many cellphones provide the option to share their data - connection over USB (often called "tethering"). This feature - uses either the RNDIS, CDC - or a custom Apple iPhone/iPad - protocol. - - - - Android devices generally use the urndis4 - driver. - - - - Apple devices use the ipheth4 driver. - - - - Older devices will often use the cdce4 - driver. - - - - Before attaching a device, load the appropriate driver - into the kernel: - - # kldload if_urndis -# kldload if_cdce -# kldload if_ipheth - - Once the device is attached - ue0 will be - available for use like a normal network device. Be sure that - the USB tethering option is enabled on the - device. - - - - - 藍牙 - - - - - Pav - Lucistnik - - Written by - pav@FreeBSD.org - - - - - 藍牙 - - Bluetooth is a wireless technology for creating personal - networks operating in the 2.4 GHz unlicensed band, with a - range of 10 meters. Networks are usually formed ad-hoc from - portable devices such as cellular phones, handhelds, and - laptops. Unlike Wi-Fi wireless technology, Bluetooth offers - higher level service profiles, such as - FTP-like file servers, file pushing, voice - transport, serial line emulation, and more. - - This section describes the use of a USB - Bluetooth dongle on a FreeBSD system. It then describes the - various Bluetooth protocols and utilities. - - - 載入藍牙支援 - - The Bluetooth stack in FreeBSD is implemented using the - netgraph4 framework. A broad variety of Bluetooth - USB dongles is supported by ng_ubt4. - Broadcom BCM2033 based Bluetooth devices are supported by the - ubtbcmfw4 and ng_ubt4 drivers. The 3Com - Bluetooth PC Card 3CRWB60-A is supported by the - ng_bt3c4 driver. Serial and UART based Bluetooth - devices are supported by sio4, ng_h44, and - hcseriald8. - - Before attaching a device, determine which of the above - drivers it uses, then load the driver. For example, if the - device uses the ng_ubt4 driver: - - # kldload ng_ubt - - If the Bluetooth device will be attached to the system - during system startup, the system can be configured to load - the module at boot time by adding the driver to - /boot/loader.conf: - - ng_ubt_load="YES" - - Once the driver is loaded, plug in the - USB dongle. If the driver load was - successful, output similar to the following should appear on - the console and in - /var/log/messages: - - ubt0: vendor 0x0a12 product 0x0001, rev 1.10/5.25, addr 2 -ubt0: Interface 0 endpoints: interrupt=0x81, bulk-in=0x82, bulk-out=0x2 -ubt0: Interface 1 (alt.config 5) endpoints: isoc-in=0x83, isoc-out=0x3, - wMaxPacketSize=49, nframes=6, buffer size=294 - - To start and stop the Bluetooth stack, use its startup - script. It is a good idea to stop the stack before unplugging - the device. Starting the bluetooth stack might require - hcsecd8 to be started. When starting the stack, the - output should be similar to the following: - - # service bluetooth start ubt0 -BD_ADDR: 00:02:72:00:d4:1a -Features: 0xff 0xff 0xf 00 00 00 00 00 -<3-Slot> <5-Slot> <Encryption> <Slot offset> -<Timing accuracy> <Switch> <Hold mode> <Sniff mode> -<Park mode> <RSSI> <Channel quality> <SCO link> -<HV2 packets> <HV3 packets> <u-law log> <A-law log> <CVSD> -<Paging scheme> <Power control> <Transparent SCO data> -Max. ACL packet size: 192 bytes -Number of ACL packets: 8 -Max. SCO packet size: 64 bytes -Number of SCO packets: 8 - - - - 尋找其他藍牙裝置 - - - HCI - - - The Host Controller Interface (HCI) - provides a uniform method for accessing Bluetooth baseband - capabilities. In FreeBSD, a netgraph HCI node - is created for each Bluetooth device. For more details, refer - to ng_hci4. - - One of the most common tasks is discovery of Bluetooth - devices within RF proximity. This - operation is called inquiry. Inquiry and - other HCI related operations are done using - hccontrol8. The example below shows how to find out - which Bluetooth devices are in range. The list of devices - should be displayed in a few seconds. Note that a remote - device will only answer the inquiry if it is set to - discoverable mode. - - % hccontrol -n ubt0hci inquiry -Inquiry result, num_responses=1 -Inquiry result #0 - BD_ADDR: 00:80:37:29:19:a4 - Page Scan Rep. Mode: 0x1 - Page Scan Period Mode: 00 - Page Scan Mode: 00 - Class: 52:02:04 - Clock offset: 0x78ef -Inquiry complete. Status: No error [00] - - The BD_ADDR is the unique address of a - Bluetooth device, similar to the MAC - address of a network card. This address is needed for further - communication with a device and it is possible to assign a - human readable name to a BD_ADDR. - Information regarding the known Bluetooth hosts is contained - in /etc/bluetooth/hosts. The following - example shows how to obtain the human readable name that was - assigned to the remote device: - - % hccontrol -n ubt0hci remote_name_request 00:80:37:29:19:a4 -BD_ADDR: 00:80:37:29:19:a4 -Name: Pav's T39 - - If an inquiry is performed on a remote Bluetooth device, - it will find the computer as - your.host.name (ubt0). The name assigned to - the local device can be changed at any time. - - Remote devices can be assigned aliases in - /etc/bluetooth/hosts. More information - about /etc/bluetooth/hosts file might be - found in bluetooth.hosts5. - - The Bluetooth system provides a point-to-point connection - between two Bluetooth units, or a point-to-multipoint - connection which is shared among several Bluetooth devices. - The following example shows how to create a connection to a - remote device: - - % hccontrol -n ubt0hci create_connection BT_ADDR - - create_connection accepts - BT_ADDR as well as host aliases in - /etc/bluetooth/hosts. - - The following example shows how to obtain the list of - active baseband connections for the local device: - - % hccontrol -n ubt0hci read_connection_list -Remote BD_ADDR Handle Type Mode Role Encrypt Pending Queue State -00:80:37:29:19:a4 41 ACL 0 MAST NONE 0 0 OPEN - - A connection handle is useful when - termination of the baseband connection is required, though - it is normally not required to do this by hand. The stack - will automatically terminate inactive baseband - connections. - - # hccontrol -n ubt0hci disconnect 41 -Connection handle: 41 -Reason: Connection terminated by local host [0x16] - - Type hccontrol help for a complete - listing of available HCI commands. Most - of the HCI commands do not require - superuser privileges. - - - - 裝置配對 - - By default, Bluetooth communication is not authenticated, - and any device can talk to any other device. A Bluetooth - device, such as a cellular phone, may choose to require - authentication to provide a particular service. Bluetooth - authentication is normally done with a - PIN code, an ASCII - string up to 16 characters in length. The user is required - to enter the same PIN code on both devices. - Once the user has entered the PIN code, - both devices will generate a link key. - After that, the link key can be stored either in the devices - or in a persistent storage. Next time, both devices will - use the previously generated link key. This procedure is - called pairing. Note that if the link - key is lost by either device, the pairing must be - repeated. - - The hcsecd8 daemon is responsible for handling - Bluetooth authentication requests. The default configuration - file is /etc/bluetooth/hcsecd.conf. An - example section for a cellular phone with the - PIN code set to 1234 is - shown below: - - device { - bdaddr 00:80:37:29:19:a4; - name "Pav's T39"; - key nokey; - pin "1234"; - } - - The only limitation on PIN codes is - length. Some devices, such as Bluetooth headsets, may have - a fixed PIN code built in. The - switch forces hcsecd8 to stay in - the foreground, so it is easy to see what is happening. Set - the remote device to receive pairing and initiate the - Bluetooth connection to the remote device. The remote device - should indicate that pairing was accepted and request the - PIN code. Enter the same - PIN code listed in - hcsecd.conf. Now the computer and the - remote device are paired. Alternatively, pairing can be - initiated on the remote device. - - The following line can be added to - /etc/rc.conf to configure hcsecd8 - to start automatically on system start: - - hcsecd_enable="YES" - - The following is a sample of the hcsecd8 daemon - output: - - hcsecd[16484]: Got Link_Key_Request event from 'ubt0hci', remote bdaddr 0:80:37:29:19:a4 -hcsecd[16484]: Found matching entry, remote bdaddr 0:80:37:29:19:a4, name 'Pav's T39', link key doesn't exist -hcsecd[16484]: Sending Link_Key_Negative_Reply to 'ubt0hci' for remote bdaddr 0:80:37:29:19:a4 -hcsecd[16484]: Got PIN_Code_Request event from 'ubt0hci', remote bdaddr 0:80:37:29:19:a4 -hcsecd[16484]: Found matching entry, remote bdaddr 0:80:37:29:19:a4, name 'Pav's T39', PIN code exists -hcsecd[16484]: Sending PIN_Code_Reply to 'ubt0hci' for remote bdaddr 0:80:37:29:19:a4 - - - - 使用 <acronym>PPP</acronym> Profile 存取網路 - - A Dial-Up Networking (DUN) profile can - be used to configure a cellular phone as a wireless modem for - connecting to a dial-up Internet access server. It can also - be used to configure a computer to receive data calls from a - cellular phone. - - Network access with a PPP profile can - be used to provide LAN access for a single - Bluetooth device or multiple Bluetooth devices. It can also - provide PC to PC - connection using PPP networking over serial - cable emulation. - - In FreeBSD, these profiles are implemented with ppp8 - and the rfcomm_pppd8 wrapper which converts a - Bluetooth connection into something - PPP can use. Before a profile can be used, - a new PPP label must be created in - /etc/ppp/ppp.conf. Consult - rfcomm_pppd8 for examples. - - In this example, rfcomm_pppd8 is used to open a - connection to a remote device with a - BD_ADDR of - 00:80:37:29:19:a4 on a - DUN RFCOMM - channel: - - # rfcomm_pppd -a 00:80:37:29:19:a4 -c -C dun -l rfcomm-dialup - - The actual channel number will be obtained from the remote - device using the SDP protocol. It is - possible to specify the RFCOMM channel by - hand, and in this case rfcomm_pppd8 will not perform - the SDP query. Use sdpcontrol8 to - find out the RFCOMM channel on the remote - device. - - In order to provide network access with the - PPP LAN service, - sdpd8 must be running and a new entry for - LAN clients must be created in - /etc/ppp/ppp.conf. Consult - rfcomm_pppd8 for examples. Finally, start the - RFCOMM PPP server on a - valid RFCOMM channel number. The - RFCOMM PPP server will - automatically register the Bluetooth LAN - service with the local SDP daemon. The - example below shows how to start the RFCOMM - PPP server. - - # rfcomm_pppd -s -C 7 -l rfcomm-server - - - - 藍牙通訊協定 - - This section provides an overview of the various Bluetooth - protocols, their function, and associated utilities. - - - Logical Link Control and Adaptation Protocol - (<acronym>L2CAP</acronym>) - - - L2CAP - - - The Logical Link Control and Adaptation Protocol - (L2CAP) provides connection-oriented and - connectionless data services to upper layer protocols. - L2CAP permits higher level protocols and - applications to transmit and receive - L2CAP data packets up to 64 kilobytes in - length. - - L2CAP is based around the concept of - channels. A channel is a logical - connection on top of a baseband connection, where each - channel is bound to a single protocol in a many-to-one - fashion. Multiple channels can be bound to the same - protocol, but a channel cannot be bound to multiple - protocols. Each L2CAP packet received on - a channel is directed to the appropriate higher level - protocol. Multiple channels can share the same baseband - connection. - - In FreeBSD, a netgraph L2CAP node is - created for each Bluetooth device. This node is normally - connected to the downstream Bluetooth HCI - node and upstream Bluetooth socket nodes. The default name - for the L2CAP node is - devicel2cap. For more details refer to - ng_l2cap4. - - A useful command is l2ping8, which can be used to - ping other devices. Some Bluetooth implementations might - not return all of the data sent to them, so 0 - bytes in the following example is normal. - - # l2ping -a 00:80:37:29:19:a4 -0 bytes from 0:80:37:29:19:a4 seq_no=0 time=48.633 ms result=0 -0 bytes from 0:80:37:29:19:a4 seq_no=1 time=37.551 ms result=0 -0 bytes from 0:80:37:29:19:a4 seq_no=2 time=28.324 ms result=0 -0 bytes from 0:80:37:29:19:a4 seq_no=3 time=46.150 ms result=0 - - The l2control8 utility is used to perform various - operations on L2CAP nodes. This example - shows how to obtain the list of logical connections - (channels) and the list of baseband connections for the - local device: - - % l2control -a 00:02:72:00:d4:1a read_channel_list -L2CAP channels: -Remote BD_ADDR SCID/ DCID PSM IMTU/ OMTU State -00:07:e0:00:0b:ca 66/ 64 3 132/ 672 OPEN -% l2control -a 00:02:72:00:d4:1a read_connection_list -L2CAP connections: -Remote BD_ADDR Handle Flags Pending State -00:07:e0:00:0b:ca 41 O 0 OPEN - - Another diagnostic tool is btsockstat1. It is - similar to netstat1, but for Bluetooth - network-related data structures. The example below shows - the same logical connection as l2control8 - above. - - % btsockstat -Active L2CAP sockets -PCB Recv-Q Send-Q Local address/PSM Foreign address CID State -c2afe900 0 0 00:02:72:00:d4:1a/3 00:07:e0:00:0b:ca 66 OPEN -Active RFCOMM sessions -L2PCB PCB Flag MTU Out-Q DLCs State -c2afe900 c2b53380 1 127 0 Yes OPEN -Active RFCOMM sockets -PCB Recv-Q Send-Q Local address Foreign address Chan DLCI State -c2e8bc80 0 250 00:02:72:00:d4:1a 00:07:e0:00:0b:ca 3 6 OPEN - - - - Radio Frequency Communication - (<acronym>RFCOMM</acronym>) - - The RFCOMM protocol provides - emulation of serial ports over the L2CAP - protocol. RFCOMM is a simple transport - protocol, with additional provisions for emulating the 9 - circuits of RS-232 (EIATIA-232-E) serial ports. It - supports up to 60 simultaneous connections - (RFCOMM channels) between two Bluetooth - devices. - - For the purposes of RFCOMM, a - complete communication path involves two applications - running on the communication endpoints with a communication - segment between them. RFCOMM is intended - to cover applications that make use of the serial ports of - the devices in which they reside. The communication segment - is a direct connect Bluetooth link from one device to - another. - - RFCOMM is only concerned with the - connection between the devices in the direct connect case, - or between the device and a modem in the network case. - RFCOMM can support other configurations, - such as modules that communicate via Bluetooth wireless - technology on one side and provide a wired interface on the - other side. - - In FreeBSD, RFCOMM is implemented at the - Bluetooth sockets layer. - - - - Service Discovery Protocol - (<acronym>SDP</acronym>) - - - SDP - - - The Service Discovery Protocol (SDP) - provides the means for client applications to discover the - existence of services provided by server applications as - well as the attributes of those services. The attributes of - a service include the type or class of service offered and - the mechanism or protocol information needed to utilize the - service. - - SDP involves communication between a - SDP server and a SDP - client. The server maintains a list of service records that - describe the characteristics of services associated with the - server. Each service record contains information about a - single service. A client may retrieve information from a - service record maintained by the SDP - server by issuing a SDP request. If the - client, or an application associated with the client, - decides to use a service, it must open a separate connection - to the service provider in order to utilize the service. - SDP provides a mechanism for discovering - services and their attributes, but it does not provide a - mechanism for utilizing those services. - - Normally, a SDP client searches for - services based on some desired characteristics of the - services. However, there are times when it is desirable to - discover which types of services are described by an - SDP server's service records without any - prior information about the services. This process of - looking for any offered services is called - browsing. - - The Bluetooth SDP server, - sdpd8, and command line client, sdpcontrol8, - are included in the standard FreeBSD installation. The - following example shows how to perform a - SDP browse query. - - % sdpcontrol -a 00:01:03:fc:6e:ec browse -Record Handle: 00000000 -Service Class ID List: - Service Discovery Server (0x1000) -Protocol Descriptor List: - L2CAP (0x0100) - Protocol specific parameter #1: u/int/uuid16 1 - Protocol specific parameter #2: u/int/uuid16 1 - -Record Handle: 0x00000001 -Service Class ID List: - Browse Group Descriptor (0x1001) - -Record Handle: 0x00000002 -Service Class ID List: - LAN Access Using PPP (0x1102) -Protocol Descriptor List: - L2CAP (0x0100) - RFCOMM (0x0003) - Protocol specific parameter #1: u/int8/bool 1 -Bluetooth Profile Descriptor List: - LAN Access Using PPP (0x1102) ver. 1.0 - - Note that each service has a list of attributes, such - as the RFCOMM channel. Depending on the - service, the user might need to make note of some of the - attributes. Some Bluetooth implementations do not support - service browsing and may return an empty list. In this - case, it is possible to search for the specific service. - The example below shows how to search for the - OBEX Object Push - (OPUSH) service: - - % sdpcontrol -a 00:01:03:fc:6e:ec search OPUSH - - Offering services on FreeBSD to Bluetooth clients is done - with the sdpd8 server. The following line can be - added to /etc/rc.conf: - - sdpd_enable="YES" - - Then the sdpd8 daemon can be started with: - - # service sdpd start - - The local server application that wants to provide a - Bluetooth service to remote clients will register the - service with the local SDP daemon. An - example of such an application is rfcomm_pppd8. Once - started, it will register the Bluetooth LAN service with the - local SDP daemon. - - The list of services registered with the local - SDP server can be obtained by issuing a - SDP browse query via the local control - channel: - - # sdpcontrol -l browse - - - - <acronym>OBEX</acronym> Object Push - (<acronym>OPUSH</acronym>) - - - OBEX - - - Object Exchange (OBEX) is a widely - used protocol for simple file transfers between mobile - devices. Its main use is in infrared communication, where - it is used for generic file transfers between notebooks or - PDAs, and for sending business cards or - calendar entries between cellular phones and other devices - with Personal Information Manager (PIM) - applications. - - The OBEX server and client are - implemented by obexapp, which can - be installed using the comms/obexapp - package or port. - - The OBEX client is used to push - and/or pull objects from the OBEX server. - An example object is a business card or an appointment. - The OBEX client can obtain the - RFCOMM channel number from the remote - device via SDP. This can be done by - specifying the service name instead of the - RFCOMM channel number. Supported service - names are: IrMC, FTRN, - and OPUSH. It is also possible to - specify the RFCOMM channel as a number. - Below is an example of an OBEX session - where the device information object is pulled from the - cellular phone, and a new object, the business card, is - pushed into the phone's directory. - - % obexapp -a 00:80:37:29:19:a4 -C IrMC -obex> get telecom/devinfo.txt devinfo-t39.txt -Success, response: OK, Success (0x20) -obex> put new.vcf -Success, response: OK, Success (0x20) -obex> di -Success, response: OK, Success (0x20) - - In order to provide the OPUSH - service, sdpd8 must be running and a root folder, - where all incoming objects will be stored, must be created. - The default path to the root folder is - /var/spool/obex. Finally, start the - OBEX server on a valid - RFCOMM channel number. The - OBEX server will automatically register - the OPUSH service with the local - SDP daemon. The example below shows how - to start the OBEX server. - - # obexapp -s -C 10 - - - - Serial Port Profile (<acronym>SPP</acronym>) - - The Serial Port Profile (SPP) allows - Bluetooth devices to perform serial cable emulation. This - profile allows legacy applications to use Bluetooth as a - cable replacement, through a virtual serial port - abstraction. - - In FreeBSD, rfcomm_sppd1 implements - SPP and a pseudo tty is used as a virtual - serial port abstraction. The example below shows how to - connect to a remote device's serial port service. A - RFCOMM channel does not have to be - specified as rfcomm_sppd1 can obtain it from the - remote device via SDP. To override this, - specify a RFCOMM channel on the command - line. - - # rfcomm_sppd -a 00:07:E0:00:0B:CA -t -rfcomm_sppd[94692]: Starting on /dev/pts/6... -/dev/pts/6 - - Once connected, the pseudo tty can be used as serial - port: - - # cu -l /dev/pts/6 - - The pseudo tty is printed on stdout and can be read by - wrapper scripts: - - PTS=`rfcomm_sppd -a 00:07:E0:00:0B:CA -t` -cu -l $PTS - - - - - 疑難排解 - - By default, when FreeBSD is accepting a new connection, it - tries to perform a role switch and become master. Some older - Bluetooth devices which do not support role switching will not - be able to connect. Since role switching is performed when a - new connection is being established, it is not possible to ask - the remote device if it supports role switching. However, - there is a HCI option to disable role - switching on the local side: - - # hccontrol -n ubt0hci write_node_role_switch 0 - - To display Bluetooth packets, use the third-party package - hcidump, which can be installed - using the comms/hcidump package or port. - This utility is similar to tcpdump1 and can be used to - display the contents of Bluetooth packets on the terminal and - to dump the Bluetooth packets to a file. - - - - - - 橋接 - - - - - Andrew - Thompson - - Written by - - - - - IP 子網段 - 橋接 - - It is sometimes useful to divide a network, such as an - Ethernet segment, into network segments without having to - create IP subnets and use a router to connect - the segments together. A device that connects two networks - together in this fashion is called a - bridge. - - A bridge works by learning the MAC - addresses of the devices on each of its network interfaces. It - forwards traffic between networks only when the source and - destination MAC addresses are on different - networks. In many respects, a bridge is like an Ethernet switch - with very few ports. A FreeBSD system with multiple network - interfaces can be configured to act as a bridge. - - Bridging can be useful in the following situations: - - - - Connecting Networks - - The basic operation of a bridge is to join two or more - network segments. There are many reasons to use a - host-based bridge instead of networking equipment, such as - cabling constraints or firewalling. A bridge can also - connect a wireless interface running in hostap mode to a - wired network and act as an access point. - - - - - Filtering/Traffic Shaping Firewall - - A bridge can be used when firewall functionality is - needed without routing or Network Address Translation - (NAT). - - An example is a small company that is connected via - DSL or ISDN to an - ISP. There are thirteen public - IP addresses from the - ISP and ten computers on the network. - In this situation, using a router-based firewall is - difficult because of subnetting issues. A bridge-based - firewall can be configured without any - IP addressing issues. - - - - - Network Tap - - A bridge can join two network segments in order to - inspect all Ethernet frames that pass between them using - bpf4 and tcpdump1 on the bridge interface or - by sending a copy of all frames out an additional - interface known as a span port. - - - - - Layer 2 VPN - - Two Ethernet networks can be joined across an - IP link by bridging the networks to an - EtherIP tunnel or a tap4 based solution such as - OpenVPN. - - - - - Layer 2 Redundancy - - A network can be connected together with multiple - links and use the Spanning Tree Protocol - (STP) to block redundant paths. - - - - - This section describes how to configure a FreeBSD system as a - bridge using if_bridge4. A netgraph bridging driver is - also available, and is described in ng_bridge4. - - - Packet filtering can be used with any firewall package - that hooks into the pfil9 framework. The bridge can be - used as a traffic shaper with altq4 or - dummynet4. - - - - 開啟橋接 - - In FreeBSD, if_bridge4 is a kernel module which is - automatically loaded by ifconfig8 when creating a - bridge interface. It is also possible to compile bridge - support into a custom kernel by adding - device if_bridge to the custom kernel - configuration file. - - The bridge is created using interface cloning. To create - the bridge interface: - - # ifconfig bridge create -bridge0 -# ifconfig bridge0 -bridge0: flags=8802<BROADCAST,SIMPLEX,MULTICAST> metric 0 mtu 1500 - ether 96:3d:4b:f1:79:7a - id 00:00:00:00:00:00 priority 32768 hellotime 2 fwddelay 15 - maxage 20 holdcnt 6 proto rstp maxaddr 100 timeout 1200 - root id 00:00:00:00:00:00 priority 0 ifcost 0 port 0 - - When a bridge interface is created, it is automatically - assigned a randomly generated Ethernet address. The - maxaddr and timeout - parameters control how many MAC addresses - the bridge will keep in its forwarding table and how many - seconds before each entry is removed after it is last seen. - The other parameters control how STP - operates. - - Next, specify which network interfaces to add as members - of the bridge. For the bridge to forward packets, all member - interfaces and the bridge need to be up: - - # ifconfig bridge0 addm fxp0 addm fxp1 up -# ifconfig fxp0 up -# ifconfig fxp1 up - - The bridge can now forward Ethernet frames between - fxp0 and fxp1. Add - the following lines to /etc/rc.conf so - the bridge is created at startup: - - cloned_interfaces="bridge0" -ifconfig_bridge0="addm fxp0 addm fxp1 up" -ifconfig_fxp0="up" -ifconfig_fxp1="up" - - If the bridge host needs an IP - address, set it on the bridge interface, not on the member - interfaces. The address can be set statically or via - DHCP. This example sets a static - IP address: - - # ifconfig bridge0 inet 192.168.0.1/24 - - It is also possible to assign an IPv6 - address to a bridge interface. To make the changes permanent, - add the addressing information to - /etc/rc.conf. - - - When packet filtering is enabled, bridged packets will - pass through the filter inbound on the originating interface - on the bridge interface, and outbound on the appropriate - interfaces. Either stage can be disabled. When direction - of the packet flow is important, it is best to firewall on - the member interfaces rather than the bridge itself. - - The bridge has several configurable settings for passing - non-IP and IP packets, - and layer2 firewalling with ipfw8. See - if_bridge4 for more information. - - - - - 開啟 Spanning Tree - - For an Ethernet network to function properly, only one - active path can exist between two devices. The - STP protocol detects loops and puts - redundant links into a blocked state. Should one of the - active links fail, STP calculates a - different tree and enables one of the blocked paths to restore - connectivity to all points in the network. - - The Rapid Spanning Tree Protocol (RSTP - or 802.1w) provides backwards compatibility with legacy - STP. RSTP provides - faster convergence and exchanges information with neighboring - switches to quickly transition to forwarding mode without - creating loops. FreeBSD supports RSTP and - STP as operating modes, with - RSTP being the default mode. - - STP can be enabled on member interfaces - using ifconfig8. For a bridge with - fxp0 and fxp1 as the - current interfaces, enable STP with: - - # ifconfig bridge0 stp fxp0 stp fxp1 -bridge0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500 - ether d6:cf:d5:a0:94:6d - id 00:01:02:4b:d4:50 priority 32768 hellotime 2 fwddelay 15 - maxage 20 holdcnt 6 proto rstp maxaddr 100 timeout 1200 - root id 00:01:02:4b:d4:50 priority 32768 ifcost 0 port 0 - member: fxp0 flags=1c7<LEARNING,DISCOVER,STP,AUTOEDGE,PTP,AUTOPTP> - port 3 priority 128 path cost 200000 proto rstp - role designated state forwarding - member: fxp1 flags=1c7<LEARNING,DISCOVER,STP,AUTOEDGE,PTP,AUTOPTP> - port 4 priority 128 path cost 200000 proto rstp - role designated state forwarding - - This bridge has a spanning tree ID of - 00:01:02:4b:d4:50 and a priority of - 32768. As the root id - is the same, it indicates that this is the root bridge for the - tree. - - Another bridge on the network also has - STP enabled: - - bridge0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500 - ether 96:3d:4b:f1:79:7a - id 00:13:d4:9a:06:7a priority 32768 hellotime 2 fwddelay 15 - maxage 20 holdcnt 6 proto rstp maxaddr 100 timeout 1200 - root id 00:01:02:4b:d4:50 priority 32768 ifcost 400000 port 4 - member: fxp0 flags=1c7<LEARNING,DISCOVER,STP,AUTOEDGE,PTP,AUTOPTP> - port 4 priority 128 path cost 200000 proto rstp - role root state forwarding - member: fxp1 flags=1c7<LEARNING,DISCOVER,STP,AUTOEDGE,PTP,AUTOPTP> - port 5 priority 128 path cost 200000 proto rstp - role designated state forwarding - - The line root id 00:01:02:4b:d4:50 priority 32768 - ifcost 400000 port 4 shows that the root bridge is - 00:01:02:4b:d4:50 and has a path cost of - 400000 from this bridge. The path to the - root bridge is via port 4 which is - fxp0. - - - - 橋接介面參數 - - Several ifconfig parameters are unique - to bridge interfaces. This section summarizes some common - uses for these parameters. The complete list of available - parameters is described in ifconfig8. - - - - private - - A private interface does not forward any traffic to - any other port that is also designated as a private - interface. The traffic is blocked unconditionally so no - Ethernet frames will be forwarded, including - ARP packets. If traffic needs to be - selectively blocked, a firewall should be used - instead. - - - - - span - - A span port transmits a copy of every Ethernet frame - received by the bridge. The number of span ports - configured on a bridge is unlimited, but if an - interface is designated as a span port, it cannot also - be used as a regular bridge port. This is most useful - for snooping a bridged network passively on another host - connected to one of the span ports of the bridge. For - example, to send a copy of all frames out the interface - named fxp4: - - # ifconfig bridge0 span fxp4 - - - - - sticky - - If a bridge member interface is marked as sticky, - dynamically learned address entries are treated as - static entries in the forwarding cache. Sticky entries - are never aged out of the cache or replaced, even if the - address is seen on a different interface. This gives - the benefit of static address entries without the need - to pre-populate the forwarding table. Clients learned - on a particular segment of the bridge cannot roam to - another segment. - - An example of using sticky addresses is to combine - the bridge with VLANs in order to - isolate customer networks without wasting - IP address space. Consider that - CustomerA - is on vlan100, CustomerB is on - vlan101, and the bridge has the - address 192.168.0.1: - - # ifconfig bridge0 addm vlan100 sticky vlan100 addm vlan101 sticky vlan101 -# ifconfig bridge0 inet 192.168.0.1/24 - - In this example, both clients see 192.168.0.1 as their - default gateway. Since the bridge cache is sticky, one - host cannot spoof the MAC address of - the other customer in order to intercept their - traffic. - - Any communication between the - VLANs can be blocked using a firewall - or, as seen in this example, private interfaces: - - # ifconfig bridge0 private vlan100 private vlan101 - - The customers are completely isolated from each - other and the full /24 address range can be - allocated without subnetting. - - The number of unique source MAC - addresses behind an interface can be limited. Once the - limit is reached, packets with unknown source addresses - are dropped until an existing host cache entry expires - or is removed. - - The following example sets the maximum number of - Ethernet devices for CustomerA on - vlan100 to 10: - - # ifconfig bridge0 ifmaxaddr vlan100 10 - - - - - Bridge interfaces also support monitor mode, where the - packets are discarded after bpf4 processing and are not - processed or forwarded further. This can be used to - multiplex the input of two or more interfaces into a single - bpf4 stream. This is useful for reconstructing the - traffic for network taps that transmit the RX/TX signals out - through two separate interfaces. For example, to read the - input from four network interfaces as one stream: - - # ifconfig bridge0 addm fxp0 addm fxp1 addm fxp2 addm fxp3 monitor up -# tcpdump -i bridge0 - - - - <acronym>SNMP</acronym> 監視 - - The bridge interface and STP - parameters can be monitored via bsnmpd1 which is - included in the FreeBSD base system. The exported bridge - MIBs conform to IETF - standards so any SNMP client or monitoring - package can be used to retrieve the data. - - To enable monitoring on the bridge, uncomment this line in - /etc/snmpd.config by removing the - beginning # symbol: - - begemotSnmpdModulePath."bridge" = "/usr/lib/snmp_bridge.so" - - Other configuration settings, such as community names and - access lists, may need to be modified in this file. See - bsnmpd1 and snmp_bridge3 for more information. - Once these edits are saved, add this line to - /etc/rc.conf: - - bsnmpd_enable="YES" - - Then, start bsnmpd1: - - # service bsnmpd start - - The following examples use the - Net-SNMP software - (net-mgmt/net-snmp) to query a bridge - from a client system. The - net-mgmt/bsnmptools port can also be used. - From the SNMP client which is running - Net-SNMP, add the following lines - to $HOME/.snmp/snmp.conf in order to - import the bridge MIB definitions: - - mibdirs +/usr/share/snmp/mibs -mibs +BRIDGE-MIB:RSTP-MIB:BEGEMOT-MIB:BEGEMOT-BRIDGE-MIB - - To monitor a single bridge using the IETF BRIDGE-MIB - (RFC4188): - - % snmpwalk -v 2c -c public bridge1.example.com mib-2.dot1dBridge -BRIDGE-MIB::dot1dBaseBridgeAddress.0 = STRING: 66:fb:9b:6e:5c:44 -BRIDGE-MIB::dot1dBaseNumPorts.0 = INTEGER: 1 ports -BRIDGE-MIB::dot1dStpTimeSinceTopologyChange.0 = Timeticks: (189959) 0:31:39.59 centi-seconds -BRIDGE-MIB::dot1dStpTopChanges.0 = Counter32: 2 -BRIDGE-MIB::dot1dStpDesignatedRoot.0 = Hex-STRING: 80 00 00 01 02 4B D4 50 -... -BRIDGE-MIB::dot1dStpPortState.3 = INTEGER: forwarding(5) -BRIDGE-MIB::dot1dStpPortEnable.3 = INTEGER: enabled(1) -BRIDGE-MIB::dot1dStpPortPathCost.3 = INTEGER: 200000 -BRIDGE-MIB::dot1dStpPortDesignatedRoot.3 = Hex-STRING: 80 00 00 01 02 4B D4 50 -BRIDGE-MIB::dot1dStpPortDesignatedCost.3 = INTEGER: 0 -BRIDGE-MIB::dot1dStpPortDesignatedBridge.3 = Hex-STRING: 80 00 00 01 02 4B D4 50 -BRIDGE-MIB::dot1dStpPortDesignatedPort.3 = Hex-STRING: 03 80 -BRIDGE-MIB::dot1dStpPortForwardTransitions.3 = Counter32: 1 -RSTP-MIB::dot1dStpVersion.0 = INTEGER: rstp(2) - - The dot1dStpTopChanges.0 value is two, - indicating that the STP bridge topology has - changed twice. A topology change means that one or more links - in the network have changed or failed and a new tree has been - calculated. The - dot1dStpTimeSinceTopologyChange.0 value - will show when this happened. - - To monitor multiple bridge interfaces, the private - BEGEMOT-BRIDGE-MIB can be used: - - % snmpwalk -v 2c -c public bridge1.example.com -enterprises.fokus.begemot.begemotBridge -BEGEMOT-BRIDGE-MIB::begemotBridgeBaseName."bridge0" = STRING: bridge0 -BEGEMOT-BRIDGE-MIB::begemotBridgeBaseName."bridge2" = STRING: bridge2 -BEGEMOT-BRIDGE-MIB::begemotBridgeBaseAddress."bridge0" = STRING: e:ce:3b:5a:9e:13 -BEGEMOT-BRIDGE-MIB::begemotBridgeBaseAddress."bridge2" = STRING: 12:5e:4d:74:d:fc -BEGEMOT-BRIDGE-MIB::begemotBridgeBaseNumPorts."bridge0" = INTEGER: 1 -BEGEMOT-BRIDGE-MIB::begemotBridgeBaseNumPorts."bridge2" = INTEGER: 1 -... -BEGEMOT-BRIDGE-MIB::begemotBridgeStpTimeSinceTopologyChange."bridge0" = Timeticks: (116927) 0:19:29.27 centi-seconds -BEGEMOT-BRIDGE-MIB::begemotBridgeStpTimeSinceTopologyChange."bridge2" = Timeticks: (82773) 0:13:47.73 centi-seconds -BEGEMOT-BRIDGE-MIB::begemotBridgeStpTopChanges."bridge0" = Counter32: 1 -BEGEMOT-BRIDGE-MIB::begemotBridgeStpTopChanges."bridge2" = Counter32: 1 -BEGEMOT-BRIDGE-MIB::begemotBridgeStpDesignatedRoot."bridge0" = Hex-STRING: 80 00 00 40 95 30 5E 31 -BEGEMOT-BRIDGE-MIB::begemotBridgeStpDesignatedRoot."bridge2" = Hex-STRING: 80 00 00 50 8B B8 C6 A9 - - To change the bridge interface being monitored via the - mib-2.dot1dBridge subtree: - - % snmpset -v 2c -c private bridge1.example.com -BEGEMOT-BRIDGE-MIB::begemotBridgeDefaultBridgeIf.0 s bridge2 - - - - - - Link Aggregation 與容錯移轉 - - - - - Andrew - Thompson - - Written by - - - - - - lagg - - 容錯移轉 - - FEC - - - LACP - - - loadbalance - - - roundrobin - - - FreeBSD provides the lagg4 interface which can be used - to aggregate multiple network interfaces into one virtual - interface in order to provide failover and link aggregation. - Failover allows traffic to continue to flow as long as at least - one aggregated network interface has an established link. Link - aggregation works best on switches which support - LACP, as this protocol distributes traffic - bi-directionally while responding to the failure of individual - links. - - The aggregation protocols supported by the lagg interface - determine which ports are used for outgoing traffic and whether - or not a specific port accepts incoming traffic. The following - protocols are supported by lagg4: - - - - failover - - This mode sends and receives traffic only through - the master port. If the master port becomes - unavailable, the next active port is used. The first - interface added to the virtual interface is the master - port and all subsequently added interfaces are used as - failover devices. If failover to a non-master port - occurs, the original port becomes master once it - becomes available again. - - - - - fec / loadbalance - - Cisco Fast EtherChannel (FEC) - is found on older Cisco switches. It provides a - static setup and does not negotiate aggregation with the - peer or exchange frames to monitor the link. If the - switch supports LACP, that should be - used instead. - - - - - lacp - - The IEEE 802.3ad Link Aggregation Control Protocol - (LACP) negotiates a set of - aggregable links with the peer into one or more Link - Aggregated Groups (LAGs). Each - LAG is composed of ports of the same - speed, set to full-duplex operation, and traffic is - balanced across the ports in the - LAG with the greatest total speed. - Typically, there is only one LAG - which contains all the ports. In the event of changes - in physical connectivity, - LACP will quickly converge to a new - configuration. - - LACP balances outgoing traffic - across the active ports based on hashed protocol header - information and accepts incoming traffic from any active - port. The hash includes the Ethernet source and - destination address and, if available, the - VLAN tag, and the - IPv4 or IPv6 - source and destination address. - - - - - roundrobin - - This mode distributes outgoing traffic using a - round-robin scheduler through all active ports and - accepts incoming traffic from any active port. Since - this mode violates Ethernet frame ordering, it should be - used with caution. - - - - - - 設定範例 - - This section demonstrates how to configure a Cisco - switch and a FreeBSD system for LACP load - balancing. It then shows how to configure two Ethernet - interfaces in failover mode as well as how to configure - failover mode between an Ethernet and a wireless - interface. - - - <trademark class="registered">Cisco</trademark> 交換器上設定 <acronym>LACP</acronym> Aggregation - - This example connects two fxp4 Ethernet - interfaces on a FreeBSD machine to the first two Ethernet ports - on a Cisco switch as a single load balanced and fault - tolerant link. More interfaces can be added to increase - throughput and fault tolerance. Replace the names of the - Cisco ports, Ethernet devices, channel group number, and - IP address shown in the example to match - the local configuration. - - Frame ordering is mandatory on Ethernet links and any - traffic between two stations always flows over the same - physical link, limiting the maximum speed to that of one - interface. The transmit algorithm attempts to use as much - information as it can to distinguish different traffic flows - and balance the flows across the available - interfaces. - - On the Cisco switch, add the - FastEthernet0/1 and - FastEthernet0/2 interfaces to - channel group 1: - - interface FastEthernet0/1 - channel-group 1 mode active - channel-protocol lacp -! -interface FastEthernet0/2 - channel-group 1 mode active - channel-protocol lacp - - On the FreeBSD system, create the lagg4 interface - using the physical interfaces - fxp0 and - fxp1 and bring the interfaces up - with an IP address of - 10.0.0.3/24: - - # ifconfig fxp0 up -# ifconfig fxp1 up -# ifconfig lagg0 create -# ifconfig lagg0 up laggproto lacp laggport fxp0 laggport fxp1 10.0.0.3/24 - - Next, verify the status of the virtual interface: - - # ifconfig lagg0 -lagg0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500 - options=8<VLAN_MTU> - ether 00:05:5d:71:8d:b8 - inet 10.0.0.3 netmask 0xffffff00 broadcast 10.0.0.255 - media: Ethernet autoselect - status: active - laggproto lacp - laggport: fxp1 flags=1c<ACTIVE,COLLECTING,DISTRIBUTING> - laggport: fxp0 flags=1c<ACTIVE,COLLECTING,DISTRIBUTING> - - Ports - marked as ACTIVE are part of the - LAG that has been negotiated with the - remote switch. Traffic will be transmitted and received - through these active ports. Add to the - above command to view the LAG - identifiers. - - To see the port status on the Cisco switch: - - switch# show lacp neighbor -Flags: S - Device is requesting Slow LACPDUs - F - Device is requesting Fast LACPDUs - A - Device is in Active mode P - Device is in Passive mode - -Channel group 1 neighbors - -Partner's information: - - LACP port Oper Port Port -Port Flags Priority Dev ID Age Key Number State -Fa0/1 SA 32768 0005.5d71.8db8 29s 0x146 0x3 0x3D -Fa0/2 SA 32768 0005.5d71.8db8 29s 0x146 0x4 0x3D - - For more detail, type show lacp neighbor - detail. - - To retain this configuration across reboots, add the - following entries to - /etc/rc.conf on the FreeBSD system: - - ifconfig_fxp0="up" -ifconfig_fxp1="up" -cloned_interfaces="lagg0" -ifconfig_lagg0="laggproto lacp laggport fxp0 laggport fxp1 10.0.0.3/24" - - - - 容錯移轉模式 - - Failover mode can be used to switch over to a secondary - interface if the link is lost on the master interface. To - configure failover, make sure that the underlying physical - interfaces are up, then create the lagg4 interface. - In this example, fxp0 is the - master interface, fxp1 is the - secondary interface, and the virtual interface is assigned - an IP address of - 10.0.0.15/24: - - # ifconfig fxp0 up -# ifconfig fxp1 up -# ifconfig lagg0 create -# ifconfig lagg0 up laggproto failover laggport fxp0 laggport fxp1 10.0.0.15/24 - - The virtual interface should look something like - this: - - # ifconfig lagg0 -lagg0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500 - options=8<VLAN_MTU> - ether 00:05:5d:71:8d:b8 - inet 10.0.0.15 netmask 0xffffff00 broadcast 10.0.0.255 - media: Ethernet autoselect - status: active - laggproto failover - laggport: fxp1 flags=0<> - laggport: fxp0 flags=5<MASTER,ACTIVE> - - Traffic will be transmitted and received on - fxp0. If the link is lost on - fxp0, - fxp1 will become the active link. - If the link is restored on the master interface, it will - once again become the active link. - - To retain this configuration across reboots, add the - following entries to - /etc/rc.conf: - - ifconfig_fxp0="up" -ifconfig_fxp1="up" -cloned_interfaces="lagg0" -ifconfig_lagg0="laggproto failover laggport fxp0 laggport fxp1 10.0.0.15/24" - - - - 乙太網路與無線介面間的容錯移轉模式 - - For laptop users, it is usually desirable to configure - the wireless device as a secondary which is only used when - the Ethernet connection is not available. With - lagg4, it is possible to configure a failover which - prefers the Ethernet connection for both performance and - security reasons, while maintaining the ability to transfer - data over the wireless connection. - - This is achieved by overriding the physical wireless - interface's MAC address with that of the - Ethernet interface. - - In this example, the Ethernet interface, - bge0, is the master and the - wireless interface, wlan0, is - the failover. The wlan0 device - was created from iwn0 wireless - interface, which will be configured with the - MAC address of the Ethernet interface. - First, determine the MAC address of the - Ethernet interface: - - # ifconfig bge0 -bge0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500 - options=19b<RXCSUM,TXCSUM,VLAN_MTU,VLAN_HWTAGGING,VLAN_HWCSUM,TSO4> - ether 00:21:70:da:ae:37 - inet6 fe80::221:70ff:feda:ae37%bge0 prefixlen 64 scopeid 0x2 - nd6 options=29<PERFORMNUD,IFDISABLED,AUTO_LINKLOCAL> - media: Ethernet autoselect (1000baseT <full-duplex>) - status: active - - Replace bge0 to match the - system's Ethernet interface name. The - ether line will contain the - MAC address of the specified interface. - Now, change the MAC address of the - underlying wireless interface: - - # ifconfig iwn0 ether 00:21:70:da:ae:37 - - Bring the wireless interface up, but do not set an - IP address: - - # ifconfig wlan0 create wlandev iwn0 ssid my_router up - - Make sure the bge0 interface - is up, then create the lagg4 interface with - bge0 as master with failover to - wlan0: - - # ifconfig bge0 up -# ifconfig lagg0 create -# ifconfig lagg0 up laggproto failover laggport bge0 laggport wlan0 - - The virtual interface should look something like - this: - - # ifconfig lagg0 -lagg0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500 - options=8<VLAN_MTU> - ether 00:21:70:da:ae:37 - media: Ethernet autoselect - status: active - laggproto failover - laggport: wlan0 flags=0<> - laggport: bge0 flags=5<MASTER,ACTIVE> - - Then, start the DHCP client to - obtain an IP address: - - # dhclient lagg0 - - To retain this configuration across reboots, add the - following entries to - /etc/rc.conf: - - ifconfig_bge0="up" -wlans_iwn0="wlan0" -ifconfig_wlan0="WPA" -create_args_wlan0="wlanaddr 00:21:70:da:ae:37" -cloned_interfaces="lagg0" -ifconfig_lagg0="up laggproto failover laggport bge0 laggport wlan0 DHCP" - - - - - - - <acronym>PXE</acronym> 無磁碟作業 - - - - - Jean-François - Dockès - - Updated by - - - - - - Alex - Dupre - - Reorganized and enhanced by - - - - - 無磁碟工作站 - 無磁碟作業 - - The Intel Preboot eXecution Environment - (PXE) allows an operating system to boot over - the network. For example, a FreeBSD system can boot over the - network and operate without a local disk, using file systems - mounted from an NFS server. - PXE support is usually available in the - BIOS. To use PXE when the - machine starts, select the Boot from network - option in the BIOS setup or type a function - key during system initialization. - - In order to provide the files needed for an operating system - to boot over the network, a PXE setup also - requires properly configured DHCP, - TFTP, and NFS servers, - where: - - - - Initial parameters, such as an IP - address, executable boot filename and location, server name, - and root path are obtained from the - DHCP server. - - - - The operating system loader file is booted using - TFTP. - - - - The file systems are loaded using - NFS. - - - - When a computer PXE boots, it receives - information over DHCP about where to obtain - the initial boot loader file. After the host computer receives - this information, it downloads the boot loader via - TFTP and then executes the boot loader. In - FreeBSD, the boot loader file is - /boot/pxeboot. After - /boot/pxeboot executes, the FreeBSD kernel is - loaded and the rest of the FreeBSD bootup sequence proceeds, as - described in . - - This section describes how to configure these services on a - FreeBSD system so that other systems can PXE - boot into FreeBSD. Refer to diskless8 for more - information. - - - As described, the system providing these services is - insecure. It should live in a protected area of a network and - be untrusted by other hosts. - - - - - 設定 <acronym>PXE</acronym> 環境 - - - - - Craig - Rodrigues - - -
rodrigc@FreeBSD.org
-
- Written by -
-
-
- - The steps shown in this section configure the built-in - NFS and TFTP servers. - The next section demonstrates how to install and configure the - DHCP server. In this example, the - directory which will contain the files used by - PXE users is - /b/tftpboot/FreeBSD/install. It is - important that this directory exists and that the same - directory name is set in both - /etc/inetd.conf and - /usr/local/etc/dhcpd.conf. - - - - Create the root directory which will contain a FreeBSD - installation to be NFS mounted: - - # export NFSROOTDIR=/b/tftpboot/FreeBSD/install -# mkdir -p ${NFSROOTDIR} - - - - Enable the NFS server by adding - this line to /etc/rc.conf: - - nfs_server_enable="YES" - - - - Export the diskless root directory via - NFS by adding the following to - /etc/exports: - - /b -ro -alldirs -maproot=root - - - - Start the NFS server: - - # service nfsd start - - - - Enable inetd8 by adding the following line to - /etc/rc.conf: - - inetd_enable="YES" - - - - Uncomment the following line in - /etc/inetd.conf by making sure it - does not start with a # symbol: - - tftp dgram udp wait root /usr/libexec/tftpd tftpd -l -s /b/tftpboot - - - Some PXE versions require the - TCP version of - TFTP. In this case, uncomment the - second tftp line which contains - stream tcp. - - - - - Start inetd8: - - # service inetd start - - - - Install the base system into - ${NFSROOTDIR}, either by - decompressing the official archives or by rebuilding - the FreeBSD kernel and userland (refer to - for more detailed - instructions, but do not forget to add - - when running the - make installkernel and - make installworld commands. - - - - Test that the TFTP server works and - can download the boot loader which will be obtained via - PXE: - - # tftp localhost -tftp> get FreeBSD/install/boot/pxeboot -Received 264951 bytes in 0.1 seconds - - - - Edit ${NFSROOTDIR}/etc/fstab and - create an entry to mount the root file system over - NFS: - - # Device Mountpoint FSType Options Dump Pass -myhost.example.com:/b/tftpboot/FreeBSD/install / nfs ro 0 0 - - Replace myhost.example.com - with the hostname or IP address of the - NFS server. In this example, the root - file system is mounted read-only in order to prevent - NFS clients from potentially deleting - the contents of the root file system. - - - - Set the root password in the PXE - environment for client machines which are - PXE booting : - - # chroot ${NFSROOTDIR} -# passwd - - - - If needed, enable ssh1 root logins for client - machines which are PXE booting by - editing - ${NFSROOTDIR}/etc/ssh/sshd_config and - enabling PermitRootLogin. This option - is documented in sshd_config5. - - - - Perform any other needed customizations of the - PXE environment in - ${NFSROOTDIR}. These customizations - could include things like installing packages or editing - the password file with vipw8. - - - - When booting from an NFS root volume, - /etc/rc detects the - NFS boot and runs - /etc/rc.initdiskless. In this case, - /etc and /var need - to be memory backed file systems so that these directories are - writable but the NFS root directory is - read-only: - - # chroot ${NFSROOTDIR} -# mkdir -p conf/base -# tar -c -v -f conf/base/etc.cpio.gz --format cpio --gzip etc -# tar -c -v -f conf/base/var.cpio.gz --format cpio --gzip var - - When the system boots, memory file systems for - /etc and /var will - be created and mounted and the contents of the - cpio.gz files will be copied into - them. By default, these file systems have a maximum capacity - of 5 megabytes. If your archives do not fit, which is - usually the case for /var when binary - packages have been installed, request a larger size by putting - the number of 512 byte sectors needed (e.g., 5 megabytes - is 10240 sectors) in - ${NFSROOTDIR}/conf/base/etc/md_size and - ${NFSROOTDIR}/conf/base/var/md_size - files for /etc and - /var file systems respectively. -
- - - 設定 <acronym>DHCP</acronym> 伺服器 - - - DHCP - diskless operation - - - The DHCP server does not need to be the - same machine as the TFTP and - NFS server, but it needs to be accessible - in the network. - - DHCP is not part of the FreeBSD base - system but can be installed using the - net/isc-dhcp43-server port or - package. - - Once installed, edit the configuration file, - /usr/local/etc/dhcpd.conf. Configure - the next-server, - filename, and - root-path settings as seen in this - example: - - subnet 192.168.0.0 netmask 255.255.255.0 { - range 192.168.0.2 192.168.0.3 ; - option subnet-mask 255.255.255.0 ; - option routers 192.168.0.1 ; - option broadcast-address 192.168.0.255 ; - option domain-name-servers 192.168.35.35, 192.168.35.36 ; - option domain-name "example.com"; - - # IP address of TFTP server - next-server 192.168.0.1 ; - - # path of boot loader obtained via tftp - filename "FreeBSD/install/boot/pxeboot" ; - - # pxeboot boot loader will try to NFS mount this directory for root FS - option root-path "192.168.0.1:/b/tftpboot/FreeBSD/install/" ; - -} - - - - The next-server directive is used to - specify the IP address of the - TFTP server. - - The filename directive defines the path - to /boot/pxeboot. A relative filename is - used, meaning that /b/tftpboot is not - included in the path. - - The root-path option defines the path - to the NFS root file system. - - Once the edits are saved, enable DHCP - at boot time by adding the following line to - /etc/rc.conf: - - dhcpd_enable="YES" - - Then start the DHCP service: - - # service isc-dhcpd start - - - - - <acronym>PXE</acronym> 問題除錯 - - Once all of the services are configured and started, - PXE clients should be able to - automatically load FreeBSD over the network. If a particular - client is unable to connect, when that client machine boots - up, enter the BIOS configuration menu and - confirm that it is set to boot from the network. - - This section describes some troubleshooting tips for - isolating the source of the configuration problem should no - clients be able to PXE boot. - - - - Use the net/wireshark package or - port to debug the network traffic involved during the - PXE booting process, which is - illustrated in the diagram below. - -
- 使用 <acronym>NFS</acronym> Root Mount 進行 <acronym>PXE</acronym> 開機程序 - - - - - - - - - - - - - - - - Client broadcasts a - DHCPDISCOVER message. - - - The DHCP server responds - with the IP address, - next-server, - filename, and - root-path values. - - - The client sends a TFTP - request to next-server, - asking to retrieve - filename. - - - The TFTP server responds - and sends filename to - client. - - - The client executes - filename, which is - pxeboot8, which then loads the kernel. - When the kernel executes, the root file system - specified by root-path is - mounted over NFS. - - - - -
-
- - - On the - TFTP server, read - /var/log/xferlog to ensure that - pxeboot is being retrieved from - the correct location. To test this example - configuration: - - # tftp 192.168.0.1 -tftp> get FreeBSD/install/boot/pxeboot -Received 264951 bytes in 0.1 seconds - - The BUGS sections in tftpd8 - and tftp1 document some limitations with - TFTP. - - - - Make sure that the root file system can be mounted - via NFS. To test this example - configuration: - - # mount -t nfs 192.168.0.1:/b/tftpboot/FreeBSD/install /mnt - -
-
-
- - - - <acronym>IPv6</acronym> - - - - - Aaron - Kaplan - - Originally Written by - - - - - - Tom - Rhodes - - Restructured and Added by - - - - - - Brad - Davis - - Extended by - - - - - IPv6 is the new version of the well known - IP protocol, also known as - IPv4. IPv6 provides - several advantages over IPv4 as well as many - new features: - - - - Its 128-bit address space allows for - 340,282,366,920,938,463,463,374,607,431,768,211,456 - addresses. This addresses the IPv4 - address shortage and eventual IPv4 - address exhaustion. - - - - Routers only store network aggregation addresses in - their routing tables, thus reducing the average space of a - routing table to 8192 entries. This addresses the - scalability issues associated with IPv4, - which required every allocated block of - IPv4 addresses to be exchanged between - Internet routers, causing their routing tables to become too - large to allow efficient routing. - - - - - - Address autoconfiguration (RFC2462). - - - - Mandatory multicast addresses. - - - - Built-in IPsec (IP - security). - - - - Simplified header structure. - - - - Support for mobile IP. - - - - IPv6-to-IPv4 - transition mechanisms. - - - - FreeBSD includes the http://www.kame.net/ - IPv6 reference implementation and comes - with everything needed to use IPv6. This - section focuses on getting IPv6 configured - and running. - - - <acronym>IPv6</acronym> 位址的背景知識 - - There are three different types of IPv6 - addresses: - - - - Unicast - - A packet sent to a unicast address arrives at the - interface belonging to the address. - - - - - Anycast - - These addresses are syntactically indistinguishable - from unicast addresses but they address a group of - interfaces. The packet destined for an anycast address - will arrive at the nearest router interface. Anycast - addresses are only used by routers. - - - - - Multicast - - These addresses identify a group of interfaces. A - packet destined for a multicast address will arrive at - all interfaces belonging to the multicast group. The - IPv4 broadcast address, usually - xxx.xxx.xxx.255, is - expressed by multicast addresses in - IPv6. - - - - - When reading an IPv6 address, the - canonical form is represented as - x:x:x:x:x:x:x:x, where each - x represents a 16 bit hex value. An - example is - FEBC:A574:382B:23C1:AA49:4592:4EFE:9982. - - Often, an address will have long substrings of all zeros. - A :: (double colon) can be used to replace - one substring per address. Also, up to three leading - 0s per hex value can be omitted. For - example, fe80::1 corresponds to the - canonical form - fe80:0000:0000:0000:0000:0000:0000:0001. - - A third form is to write the last 32 bits using the well - known IPv4 notation. For example, - 2002::10.0.0.1 corresponds to the - hexadecimal canonical representation - 2002:0000:0000:0000:0000:0000:0a00:0001, - which in turn is equivalent to - 2002::a00:1. - - To view a FreeBSD system's IPv6 address, - use ifconfig8: - - # ifconfig - - rl0: flags=8943<UP,BROADCAST,RUNNING,PROMISC,SIMPLEX,MULTICAST> mtu 1500 - inet 10.0.0.10 netmask 0xffffff00 broadcast 10.0.0.255 - inet6 fe80::200:21ff:fe03:8e1%rl0 prefixlen 64 scopeid 0x1 - ether 00:00:21:03:08:e1 - media: Ethernet autoselect (100baseTX ) - status: active - - In this example, the rl0 interface is - using fe80::200:21ff:fe03:8e1%rl0, an - auto-configured link-local address which was automatically - generated from the MAC address. - - Some IPv6 addresses are reserved. A - summary of these reserved addresses is seen in : - - - 已保留的 <acronym>IPv6</acronym> 位址 - - - - - IPv6 address - Prefixlength (Bits) - 說明 - 說明 - - - - - - :: - 128 bits - unspecified - Equivalent to 0.0.0.0 in - IPv4. - - - - ::1 - 128 bits - loopback address - Equivalent to 127.0.0.1 in - IPv4. - - - - ::00:xx:xx:xx:xx - 96 bits - embedded IPv4 - The lower 32 bits are the compatible - IPv4 address. - - - - ::ff:xx:xx:xx:xx - 96 bits - IPv4 mapped - IPv6 address - The lower 32 bits are the IPv4 - address for hosts which do not support - IPv6. - - - - fe80::/10 - 10 bits - link-local - Equivalent to 169.254.0.0/16 in - IPv4. - - - - fc00::/7 - 7 bits - unique-local - Unique local addresses are intended for local - communication and are only routable within a set of - cooperating sites. - - - - ff00:: - 8 bits - multicast -   - - - - 2000::-3fff:: - 3 bits - global unicast - All global unicast addresses are assigned from - this pool. The first 3 bits are - 001. - - - -
- - For further information on the structure of - IPv6 addresses, refer to RFC3513. -
- - - 設定 <acronym>IPv6</acronym> - - To configure a FreeBSD system as an IPv6 - client, add these two lines to - rc.conf: - - ifconfig_rl0_ipv6="inet6 accept_rtadv" -rtsold_enable="YES" - - The first line enables the specified interface to receive - router advertisement messages. The second line enables the - router solicitation daemon, rtsol8. - - If the interface needs a statically assigned - IPv6 address, add an entry to specify the - static address and associated prefix length: - - ifconfig_rl0_ipv6="inet6 2001:db8:4672:6565:2026:5043:2d42:5344 prefixlen 64" - - To assign a default router, specify its address: - - ipv6_defaultrouter="2001:db8:4672:6565::1" - - - - 連線到 Provider - - In order to connect to other IPv6 - networks, one must have a provider or a tunnel that supports - IPv6: - - - - Contact an Internet Service Provider to see if they - offer IPv6. - - - - Hurricane - Electric offers tunnels with end-points all - around the globe. - - - - - Install the net/freenet6 package or - port for a dial-up connection. - - - This section demonstrates how to take the directions from - a tunnel provider and convert them into - /etc/rc.conf settings that will persist - through reboots. - - The first /etc/rc.conf entry creates - the generic tunneling interface - gif0: - - cloned_interfaces="gif0" - - Next, configure that interface with the - IPv4 addresses of the local and remote - endpoints. Replace MY_IPv4_ADDR - and REMOTE_IPv4_ADDR with the - actual IPv4 addresses: - - create_args_gif0="tunnel MY_IPv4_ADDR REMOTE_IPv4_ADDR" - - To apply the IPv6 address that has been - assigned for use as the IPv6 tunnel - endpoint, add this line, replacing - MY_ASSIGNED_IPv6_TUNNEL_ENDPOINT_ADDR - with the assigned address: - - ifconfig_gif0_ipv6="inet6 MY_ASSIGNED_IPv6_TUNNEL_ENDPOINT_ADDR" - - Then, set the default route for the other side of the - IPv6 tunnel. Replace - MY_IPv6_REMOTE_TUNNEL_ENDPOINT_ADDR - with the default gateway address assigned by the - provider: - - ipv6_defaultrouter="MY_IPv6_REMOTE_TUNNEL_ENDPOINT_ADDR" - - If the FreeBSD system will route IPv6 - packets between the rest of the network and the world, enable - the gateway using this line: - - ipv6_gateway_enable="YES" - - - - Router Advertisement 與 Host Auto Configuration - - This section demonstrates how to setup rtadvd8 to - advertise the IPv6 default route. - - To enable rtadvd8, add the following to - /etc/rc.conf: - - rtadvd_enable="YES" - - It is important to specify the interface on which to - do IPv6 router advertisement. For example, - to tell rtadvd8 to use - rl0: - - rtadvd_interfaces="rl0" - - Next, create the configuration file, - /etc/rtadvd.conf as seen in this - example: - - rl0:\ - :addrs#1:addr="2001:db8:1f11:246::":prefixlen#64:tc=ether: - - Replace rl0 with the interface - to be used and 2001:db8:1f11:246:: - with the prefix of the allocation. - - For a dedicated /64 subnet, nothing else needs - to be changed. Otherwise, change the - prefixlen# to the correct value. - - - - <acronym>IPv6</acronym> 與 <acronym>IPv6</acronym> 位址對應表 - - When IPv6 is enabled on a server, there - may be a need to enable IPv4 mapped - IPv6 address communication. This - compatibility option allows for IPv4 - addresses to be represented as IPv6 - addresses. Permitting IPv6 applications - to communicate with IPv4 and vice versa - may be a security issue. - - This option may not be required in most cases and is - available only for compatibility. This option will allow - IPv6-only applications to work with - IPv4 in a dual stack environment. This - is most useful for third party applications which may not - support an IPv6-only environment. To - enable this feature, - add the following to /etc/rc.conf: - - ipv6_ipv4mapping="YES" - - Reviewing the information in RFC 3493, - section 3.6 and 3.7 as well as RFC 4038 - section 4.2 may be useful to some administrators. - -
- - - - 共用位址備援協定 (<acronym>CARP</acronym>) - - - - - Tom - Rhodes - - Contributed by - - - - - - Allan - Jude - - Updated by - - - - - - CARP - - - Common Address Redundancy Protocol - - - The Common Address Redundancy Protocol - (CARP) allows multiple hosts to share the - same IP address and Virtual Host ID - (VHID) in order to provide high - availability for one or more services. This means - that one or more hosts can fail, and the other hosts will - transparently take over so that users do not see a service - failure. - - In addition to the shared IP address, - each host has its own IP address for - management and configuration. All of the machines that share an - IP address have the same - VHID. The VHID for each - virtual IP address must be unique across the - broadcast domain of the network interface. - - High availability using CARP is built - into FreeBSD, though the steps to configure it vary slightly - depending upon the FreeBSD version. This section provides the same - example configuration for versions before and equal to or after - FreeBSD 10. - - This example configures failover support with three hosts, - all with unique IP addresses, but providing - the same web content. It has two different masters named - hosta.example.org and - hostb.example.org, with a shared backup - named hostc.example.org. - - These machines are load balanced with a Round Robin - DNS configuration. The master and backup - machines are configured identically except for their hostnames - and management IP addresses. These servers - must have the same configuration and run the same services. - When the failover occurs, requests to the service on the shared - IP address can only be answered correctly if - the backup server has access to the same content. The backup - machine has two additional CARP interfaces, - one for each of the master content server's - IP addresses. When a failure occurs, the - backup server will pick up the failed master machine's - IP address. - - - 使用 <acronym>CARP</acronym> 於 FreeBSD 10 及之後版本 - - Enable boot-time support for CARP by - adding an entry for the carp.ko kernel - module in /boot/loader.conf: - - carp_load="YES" - - To load the module now without rebooting: - - # kldload carp - - For users who prefer to use a custom kernel, include the - following line in the custom kernel configuration file and - compile the kernel as described in : - - device carp - - The hostname, management IP address and - subnet mask, shared IP address, and - VHID are all set by adding entries to - /etc/rc.conf. This example is for - hosta.example.org: - - hostname="hosta.example.org" -ifconfig_em0="inet 192.168.1.3 netmask 255.255.255.0" -ifconfig_em0_alias0="inet vhid 1 pass testpass alias 192.168.1.50/32" - - The next set of entries are for - hostb.example.org. Since it - represents a second master, it uses a different shared - IP address and VHID. - However, the passwords specified with - must be identical as CARP will only listen - to and accept advertisements from machines with the correct - password. - - hostname="hostb.example.org" -ifconfig_em0="inet 192.168.1.4 netmask 255.255.255.0" -ifconfig_em0_alias0="inet vhid 2 pass testpass alias 192.168.1.51/32" - - The third machine, - hostc.example.org, is configured to - handle failover from either master. This machine is - configured with two CARP - VHIDs, one to handle the virtual - IP address for each of the master hosts. - The CARP advertising skew, - , is set to ensure that the backup - host advertises later than the master, since - controls the order of precedence when - there are multiple backup servers. - - hostname="hostc.example.org" -ifconfig_em0="inet 192.168.1.5 netmask 255.255.255.0" -ifconfig_em0_alias0="inet vhid 1 advskew 100 pass testpass alias 192.168.1.50/32" -ifconfig_em0_alias1="inet vhid 2 advskew 100 pass testpass alias 192.168.1.51/32" - - Having two CARP - VHIDs configured means that - hostc.example.org will notice if - either of the master servers becomes unavailable. If a master - fails to advertise before the backup server, the backup server - will pick up the shared IP address until - the master becomes available again. - - - If the original master server becomes available again, - hostc.example.org will not release - the virtual IP address back to it - automatically. For this to happen, preemption has to be - enabled. The feature is disabled by default, - it is controlled via the sysctl8 variable - net.inet.carp.preempt. The administrator - can force the backup server to return the - IP address to the master: - - # ifconfig em0 vhid 1 state backup - - - Once the configuration is complete, either restart - networking or reboot each system. High availability is now - enabled. - - CARP functionality can be controlled - via several sysctl8 variables documented in the - carp4 manual pages. Other actions can be triggered - from CARP events by using - devd8. - - - - 使用 <acronym>CARP</acronym> 於 FreeBSD 9 及先前版本 - - The configuration for these versions of FreeBSD is similar to - the one described in the previous section, except that a - CARP device must first be created and - referred to in the configuration. - - Enable boot-time support for CARP by - loading the if_carp.ko kernel module in - /boot/loader.conf: - - if_carp_load="YES" - - To load the module now without rebooting: - - # kldload carp - - For users who prefer to use a custom kernel, include the - following line in the custom kernel configuration file and - compile the kernel as described in : - - device carp - - Next, on each host, create a CARP - device: - - # ifconfig carp0 create - - Set the hostname, management IP - address, the shared IP address, and - VHID by adding the required lines to - /etc/rc.conf. Since a virtual - CARP device is used instead of an alias, - the actual subnet mask of /24 is used - instead of /32. Here are the entries for - hosta.example.org: - - hostname="hosta.example.org" -ifconfig_fxp0="inet 192.168.1.3 netmask 255.255.255.0" -cloned_interfaces="carp0" -ifconfig_carp0="vhid 1 pass testpass 192.168.1.50/24" - - On hostb.example.org: - - hostname="hostb.example.org" -ifconfig_fxp0="inet 192.168.1.4 netmask 255.255.255.0" -cloned_interfaces="carp0" -ifconfig_carp0="vhid 2 pass testpass 192.168.1.51/24" - - The third machine, - hostc.example.org, is configured to - handle failover from either of the master hosts: - - hostname="hostc.example.org" -ifconfig_fxp0="inet 192.168.1.5 netmask 255.255.255.0" -cloned_interfaces="carp0 carp1" -ifconfig_carp0="vhid 1 advskew 100 pass testpass 192.168.1.50/24" -ifconfig_carp1="vhid 2 advskew 100 pass testpass 192.168.1.51/24" - - - Preemption is disabled in the - GENERIC FreeBSD kernel. If - preemption has been enabled with a custom kernel, - hostc.example.org may not release - the IP address back to the original - content server. The administrator can force the backup - server to return the IP address to the - master with the command: - - # ifconfig carp0 down && ifconfig carp0 up - - This should be done on the carp - interface which corresponds to the correct host. - - - Once the configuration is complete, either restart - networking or reboot each system. High availability is now - enabled. - - - - - VLANs - - - - VLANs - - 虛擬 LAN - - VLANs are a way of virtually dividing up - a network into many different subnetworks, also referred - to as segmenting. Each segment will have its - own broadcast domain and be isolated from other - VLANs. - - 在 FreeBSD 上,要使用 VLANs 必須有網路卡驅動程式的支援,要查看那些驅動程式支援 vlan,請參考 vlan4 操作手冊。 - - When configuring a VLAN, a couple pieces - of information must be known. First, which network interface? - Second, what is the VLAN tag? - - To configure VLANs at run time, with a - NIC of em0 and a - VLAN tag of 5 the - command would look like this: - - # ifconfig em0.5 create vlan 5 vlandev em0 inet 192.168.20.20/24 - - - See how the interface name includes the - NIC driver name and the - VLAN tag, separated by a period? This is a - best practice to make maintaining the VLAN - configuration easy when many VLANs are - present on a machine. - - - To configure VLANs at boot time, - /etc/rc.conf must be updated. To duplicate - the configuration above, the following will need to be - added: - - vlans_em0="5" -ifconfig_em0_5="inet 192.168.20.20/24" - - Additional VLANs may be added, by simply - adding the tag to the - vlans_em0 - field and adding an additional line configuring the network on - that VLAN tag's interface. - - It is useful to assign a symbolic name to an interface so - that when the associated hardware is changed, only a few - configuration variables need to be updated. For example, - security cameras need to be run over VLAN 1 on - em0. Later, if the em0 - card is replaced with a card that uses the ixgb4 driver, - all references to em0.1 will not have to - change to ixgb0.1. - - To configure VLAN - 5, on the - NIC em0, assign the - interface name cameras, and assign the - interface an IP address of 192.168.20.20 - with a 24-bit prefix, - use this command: - - # ifconfig em0.5 create vlan 5 vlandev em0 name cameras inet 192.168.20.20/24 - - For an interface named video, use the - following: - - # ifconfig video.5 create vlan 5 vlandev video name cameras inet 192.168.20.20/24 - - To apply the changes at boot time, add the following lines to - /etc/rc.conf: - - vlans_video="camera" -create_args_camera="vlan 5" -ifconfig_camera="inet 192.168.20.20/24" - - -
- -
- - - 附錄 - - - - - 取得 FreeBSD - - - <acronym>CD</acronym> 與 <acronym>DVD</acronym> 合集 - - FreeBSD CD 以及 DVD 組可從以下幾個線上零售商取得: - - - -
FreeBSD Mall, Inc. - 2420 Sand Creek Rd C-1 #347 - Brentwood, CA - 94513 - USA - Phone: +1 925 240-6652 - Fax: +1 925 674-0821 - Email: info@freebsdmall.com - WWW: https://www.freebsdmall.com -
-
- - -
Getlinux - 78 Rue de la Croix Rochopt - Épinay-sous-Sénart - 91860 - France - Email: contact@getlinux.fr - WWW: http://www.getlinux.fr/ -
-
- - -
Dr. Hinner EDV - Kochelseestr. 11 - D-81371 München - Germany - Phone: (0177) 428 419 0 - Email: infow@hinner.de - WWW: http://www.hinner.de/linux/freebsd.html -
-
- - -
Linux Center - Galernaya Street, 55 - Saint-Petersburg - 190000 - Russia - Phone: +7-812-309-06-86 - Email: info@linuxcenter.ru - WWW: http://linuxcenter.ru/shop/freebsd -
-
-
-
- - - <acronym>FTP</acronym> 站 - - FreeBSD 的官方原始碼可從全球任一鏡像站透過匿名 FTP 取得。其中 ftp://ftp.FreeBSD.org/pub/FreeBSD/ 站可使用 HTTPFTP,該站是由多台由計畫叢集管理員所維護的主機所組成,且在 GeoDNS 之後,可導向使用者到最近可用的鏡像站。 - - 除此之外,FreeBSD 也可透過匿名 FTP 從下列鏡像站取得。要透過匿名 FTP 取得 FreeBSD 時,請先嘗試使用臨近的站台。列在 主要鏡像站 中的鏡像站通常會有完整的 FreeBSD 封存檔 (每一個架構目前所有可用的版本),但若要考慮下載速度,可能要使用您所在國家或區域的站台。區域的站台會有熱門架構最近期的版本,但不會有完整的 FreeBSD 封存檔。所有站台皆提供匿名 FTP 存取只有部份站台會以其他方式提供存取。每個站台可用的存取方式會列在主機名稱後的括號當中。 - - -中央伺服器、主要鏡像站、亞美尼亞 (Armenia)、澳洲 (Australia)、奧地利 (Austria)、巴西 (Brazil)、捷克 (Czech Republic)、丹麥 (Denmark)、愛沙尼亞 (Estonia)、芬蘭 (Finland)、法國 (France)、德國 (Germany)、希臘 (Greece)、香港 (Hong Kong)、愛爾蘭 (Ireland)、日本 (Japan)、韓國 (Korea)、拉脫維亞 (Latvia)、立陶宛 (Lithuania)、荷蘭 (Netherlands)、紐西蘭 (New Zealand)、挪威 (Norway)、波蘭 (Poland)、俄羅斯 (Russia)、沙烏地阿拉伯 (Saudi Arabia)、斯洛維尼亞 (Slovenia)、南非 (South Africa)、西班牙 (Spain)、瑞典 (Sweden)、瑞士 (Switzerland)、台灣 (Taiwan)、烏克蘭 (Ukraine)、英國 (United Kingdom)、美國 (USA)。 - - - -(as of UTC) - - - - - - 中央伺服器 - - - - ftp://ftp.FreeBSD.org/pub/FreeBSD/ (ftp / ftpv6 / http://ftp.FreeBSD.org/pub/FreeBSD/ / http://ftp.FreeBSD.org/pub/FreeBSD/) - - - - - - 主要鏡像站 - - 若有任何問題,請聯絡此區域的主機管理者 mirror-admin@FreeBSD.org - - - ftp://ftp1.FreeBSD.org/pub/FreeBSD/ (ftp) - - - ftp://ftp2.FreeBSD.org/pub/FreeBSD/ (ftp) - - - ftp://ftp3.FreeBSD.org/pub/FreeBSD/ (ftp) - - - ftp://ftp4.FreeBSD.org/pub/FreeBSD/ (ftp / ftpv6 / http://ftp4.FreeBSD.org/pub/FreeBSD/ / http://ftp4.FreeBSD.org/pub/FreeBSD/) - - - ftp://ftp5.FreeBSD.org/pub/FreeBSD/ (ftp) - - - ftp://ftp6.FreeBSD.org/pub/FreeBSD/ (ftp) - - - ftp://ftp7.FreeBSD.org/pub/FreeBSD/ (ftp) - - - ftp://ftp10.FreeBSD.org/pub/FreeBSD/ (ftp / ftpv6 / http://ftp10.FreeBSD.org/pub/FreeBSD/ / http://ftp10.FreeBSD.org/pub/FreeBSD/) - - - ftp://ftp11.FreeBSD.org/pub/FreeBSD/ (ftp) - - - ftp://ftp13.FreeBSD.org/pub/FreeBSD/ (ftp) - - - ftp://ftp14.FreeBSD.org/pub/FreeBSD/ (ftp / http://ftp14.FreeBSD.org/pub/FreeBSD/) - - - - - - 亞美尼亞 (Armenia) - - 若有任何問題,請聯絡此區域的主機管理者 hostmaster@am.FreeBSD.org - - - ftp://ftp1.am.FreeBSD.org/pub/FreeBSD/ (ftp / http://ftp1.am.FreeBSD.org/pub/FreeBSD/ / rsync) - - - - - - 澳洲 (Australia) - - 若有任何問題,請聯絡此區域的主機管理者 hostmaster@au.FreeBSD.org - - - ftp://ftp.au.FreeBSD.org/pub/FreeBSD/ (ftp) - - - ftp://ftp2.au.FreeBSD.org/pub/FreeBSD/ (ftp) - - - ftp://ftp3.au.FreeBSD.org/pub/FreeBSD/ (ftp) - - - - - - 奧地利 (Austria) - - 若有任何問題,請聯絡此區域的主機管理者 hostmaster@at.FreeBSD.org - - - ftp://ftp.at.FreeBSD.org/pub/FreeBSD/ (ftp / ftpv6 / http://ftp.at.FreeBSD.org/pub/FreeBSD/ / http://ftp.at.FreeBSD.org/pub/FreeBSD/) - - - - - - 巴西 (Brazil) - - 若有任何問題,請聯絡此區域的主機管理者 hostmaster@br.FreeBSD.org - - - ftp://ftp2.br.FreeBSD.org/FreeBSD/ (ftp / http://ftp2.br.FreeBSD.org/) - - - ftp://ftp3.br.FreeBSD.org/pub/FreeBSD/ (ftp / rsync) - - - ftp://ftp4.br.FreeBSD.org/pub/FreeBSD/ (ftp) - - - - - - 捷克 (Czech Republic) - - 若有任何問題,請聯絡此區域的主機管理者 hostmaster@cz.FreeBSD.org - - - ftp://ftp.cz.FreeBSD.org/pub/FreeBSD/ (ftp / ftp://ftp.cz.FreeBSD.org/pub/FreeBSD/ / http://ftp.cz.FreeBSD.org/pub/FreeBSD/ / http://ftp.cz.FreeBSD.org/pub/FreeBSD/ / rsync / rsyncv6) - - - ftp://ftp2.cz.FreeBSD.org/pub/FreeBSD/ (ftp / http://ftp2.cz.FreeBSD.org/pub/FreeBSD/) - - - - - - 丹麥 (Denmark) - - 若有任何問題,請聯絡此區域的主機管理者 hostmaster@dk.FreeBSD.org - - - ftp://ftp.dk.FreeBSD.org/pub/FreeBSD/ (ftp / ftpv6 / http://ftp.dk.FreeBSD.org/pub/FreeBSD/ / http://ftp.dk.FreeBSD.org/pub/FreeBSD/) - - - - - - 愛沙尼亞 (Estonia) - - 若有任何問題,請聯絡此區域的主機管理者 hostmaster@ee.FreeBSD.org - - - ftp://ftp.ee.FreeBSD.org/pub/FreeBSD/ (ftp) - - - - - - 芬蘭 (Finland) - - 若有任何問題,請聯絡此區域的主機管理者 hostmaster@fi.FreeBSD.org - - - ftp://ftp.fi.FreeBSD.org/pub/FreeBSD/ (ftp) - - - - - - 法國 (France) - - 若有任何問題,請聯絡此區域的主機管理者 hostmaster@fr.FreeBSD.org - - - ftp://ftp.fr.FreeBSD.org/pub/FreeBSD/ (ftp) - - - ftp://ftp1.fr.FreeBSD.org/pub/FreeBSD/ (ftp / http://ftp1.fr.FreeBSD.org/pub/FreeBSD/ / rsync) - - - ftp://ftp3.fr.FreeBSD.org/pub/FreeBSD/ (ftp) - - - ftp://ftp5.fr.FreeBSD.org/pub/FreeBSD/ (ftp) - - - ftp://ftp6.fr.FreeBSD.org/pub/FreeBSD/ (ftp / rsync) - - - ftp://ftp7.fr.FreeBSD.org/pub/FreeBSD/ (ftp) - - - ftp://ftp8.fr.FreeBSD.org/pub/FreeBSD/ (ftp) - - - - - - 德國 (Germany) - - 若有任何問題,請聯絡此區域的主機管理者 hostmaster@de.FreeBSD.org - - - ftp://ftp.de.FreeBSD.org/pub/FreeBSD/ (ftp) - - - ftp://ftp1.de.FreeBSD.org/freebsd/ (ftp / http://www1.de.FreeBSD.org/freebsd/ / rsync://rsync3.de.FreeBSD.org/freebsd/) - - - ftp://ftp2.de.FreeBSD.org/pub/FreeBSD/ (ftp / http://ftp2.de.FreeBSD.org/pub/FreeBSD/ / rsync) - - - ftp://ftp4.de.FreeBSD.org/FreeBSD/ (ftp / http://ftp4.de.FreeBSD.org/pub/FreeBSD/) - - - ftp://ftp5.de.FreeBSD.org/pub/FreeBSD/ (ftp) - - - ftp://ftp7.de.FreeBSD.org/pub/FreeBSD/ (ftp / http://ftp7.de.FreeBSD.org/pub/FreeBSD/) - - - ftp://ftp8.de.FreeBSD.org/pub/FreeBSD/ (ftp) - - - - - - 希臘 (Greece) - - 若有任何問題,請聯絡此區域的主機管理者 hostmaster@gr.FreeBSD.org - - - ftp://ftp.gr.FreeBSD.org/pub/FreeBSD/ (ftp) - - - ftp://ftp2.gr.FreeBSD.org/pub/FreeBSD/ (ftp) - - - - - - 香港 (Hong Kong) - - - - ftp://ftp.hk.FreeBSD.org/pub/FreeBSD/ (ftp) - - - - - - 愛爾蘭 (Ireland) - - In case of problems, please contact the hostmaster - hostmaster@ie.FreeBSD.org for this domain. - - - ftp://ftp3.ie.FreeBSD.org/pub/FreeBSD/ (ftp / rsync) - - - - - - 日本 (Japan) - - 若有任何問題,請聯絡此區域的主機管理者 hostmaster@jp.FreeBSD.org - - - ftp://ftp.jp.FreeBSD.org/pub/FreeBSD/ (ftp) - - - ftp://ftp2.jp.FreeBSD.org/pub/FreeBSD/ (ftp) - - - ftp://ftp3.jp.FreeBSD.org/pub/FreeBSD/ (ftp) - - - ftp://ftp4.jp.FreeBSD.org/pub/FreeBSD/ (ftp) - - - ftp://ftp5.jp.FreeBSD.org/pub/FreeBSD/ (ftp) - - - ftp://ftp6.jp.FreeBSD.org/pub/FreeBSD/ (ftp) - - - ftp://ftp7.jp.FreeBSD.org/pub/FreeBSD/ (ftp) - - - ftp://ftp8.jp.FreeBSD.org/pub/FreeBSD/ (ftp) - - - ftp://ftp9.jp.FreeBSD.org/pub/FreeBSD/ (ftp) - - - - - - 韓國 (Korea) - - 若有任何問題,請聯絡此區域的主機管理者 hostmaster@kr.FreeBSD.org - - - ftp://ftp.kr.FreeBSD.org/pub/FreeBSD/ (ftp / rsync) - - - ftp://ftp2.kr.FreeBSD.org/pub/FreeBSD/ (ftp / http://ftp2.kr.FreeBSD.org/pub/FreeBSD/) - - - - - - 拉脫維亞 (Latvia) - - 若有任何問題,請聯絡此區域的主機管理者 hostmaster@lv.FreeBSD.org - - - ftp://ftp.lv.FreeBSD.org/pub/FreeBSD/ (ftp / http://ftp.lv.FreeBSD.org/pub/FreeBSD/) - - - - - - 立陶宛 (Lithuania) - - 若有任何問題,請聯絡此區域的主機管理者 hostmaster@lt.FreeBSD.org - - - ftp://ftp.lt.FreeBSD.org/pub/FreeBSD/ (ftp / http://ftp.lt.FreeBSD.org/pub/FreeBSD/) - - - - - - 荷蘭 (Netherlands) - - 若有任何問題,請聯絡此區域的主機管理者 hostmaster@nl.FreeBSD.org - - - ftp://ftp.nl.FreeBSD.org/pub/FreeBSD/ (ftp / http://ftp.nl.FreeBSD.org/os/FreeBSD/ / rsync) - - - ftp://ftp2.nl.FreeBSD.org/pub/FreeBSD/ (ftp) - - - - - - 紐西蘭 (New Zealand) - - - - ftp://ftp.nz.FreeBSD.org/pub/FreeBSD/ (ftp / http://ftp.nz.FreeBSD.org/pub/FreeBSD/) - - - - - - 挪威 (Norway) - - 若有任何問題,請聯絡此區域的主機管理者 hostmaster@no.FreeBSD.org - - - ftp://ftp.no.FreeBSD.org/pub/FreeBSD/ (ftp / rsync) - - - - - - 波蘭 (Poland) - - 若有任何問題,請聯絡此區域的主機管理者 hostmaster@pl.FreeBSD.org - - - ftp://ftp.pl.FreeBSD.org/pub/FreeBSD/ (ftp) - - - ftp2.pl.FreeBSD.org - - - - - - 俄羅斯 (Russia) - - 若有任何問題,請聯絡此區域的主機管理者 hostmaster@ru.FreeBSD.org - - - ftp://ftp.ru.FreeBSD.org/pub/FreeBSD/ (ftp / http://ftp.ru.FreeBSD.org/FreeBSD/ / rsync) - - - ftp://ftp2.ru.FreeBSD.org/pub/FreeBSD/ (ftp / http://ftp2.ru.FreeBSD.org/pub/FreeBSD/ / rsync) - - - ftp://ftp4.ru.FreeBSD.org/pub/FreeBSD/ (ftp) - - - ftp://ftp5.ru.FreeBSD.org/pub/FreeBSD/ (ftp / http://ftp5.ru.FreeBSD.org/pub/FreeBSD/ / rsync) - - - ftp://ftp6.ru.FreeBSD.org/pub/FreeBSD/ (ftp) - - - - - - 沙烏地阿拉伯 (Saudi Arabia) - - 若有任何問題,請聯絡此區域的主機管理者 ftpadmin@isu.net.sa - - - ftp://ftp.isu.net.sa/pub/ftp.freebsd.org/ (ftp) - - - - - - 斯洛維尼亞 (Slovenia) - - 若有任何問題,請聯絡此區域的主機管理者 hostmaster@si.FreeBSD.org - - - ftp://ftp.si.FreeBSD.org/pub/FreeBSD/ (ftp) - - - - - - 南非 (South Africa) - - 若有任何問題,請聯絡此區域的主機管理者 hostmaster@za.FreeBSD.org - - - ftp://ftp.za.FreeBSD.org/pub/FreeBSD/ (ftp) - - - ftp://ftp2.za.FreeBSD.org/pub/FreeBSD/ (ftp) - - - ftp://ftp4.za.FreeBSD.org/pub/FreeBSD/ (ftp) - - - - - - 西班牙 (Spain) - - 若有任何問題,請聯絡此區域的主機管理者 hostmaster@es.FreeBSD.org - - - ftp://ftp.es.FreeBSD.org/pub/FreeBSD/ (ftp / http://ftp.es.FreeBSD.org/pub/FreeBSD/) - - - ftp://ftp3.es.FreeBSD.org/pub/FreeBSD/ (ftp) - - - - - - 瑞典 (Sweden) - - 若有任何問題,請聯絡此區域的主機管理者 hostmaster@se.FreeBSD.org - - - ftp://ftp.se.FreeBSD.org/pub/FreeBSD/ (ftp) - - - ftp://ftp2.se.FreeBSD.org/pub/FreeBSD/ (ftp / rsync://ftp2.se.FreeBSD.org/) - - - ftp://ftp3.se.FreeBSD.org/pub/FreeBSD/ (ftp) - - - ftp://ftp4.se.FreeBSD.org/pub/FreeBSD/ (ftp / ftp://ftp4.se.FreeBSD.org/pub/FreeBSD/ / http://ftp4.se.FreeBSD.org/pub/FreeBSD/ / http://ftp4.se.FreeBSD.org/pub/FreeBSD/ / rsync://ftp4.se.FreeBSD.org/pub/FreeBSD/ / rsync://ftp4.se.FreeBSD.org/pub/FreeBSD/) - - - ftp://ftp6.se.FreeBSD.org/pub/FreeBSD/ (ftp / http://ftp6.se.FreeBSD.org/pub/FreeBSD/) - - - - - - 瑞士 (Switzerland) - - 若有任何問題,請聯絡此區域的主機管理者 hostmaster@ch.FreeBSD.org - - - ftp://ftp.ch.FreeBSD.org/pub/FreeBSD/ (ftp / http://ftp.ch.FreeBSD.org/pub/FreeBSD/) - - - - - - 台灣 (Taiwan) - - 若有任何問題,請聯絡此區域的主機管理者 hostmaster@tw.FreeBSD.org - - - ftp://ftp.tw.FreeBSD.org/pub/FreeBSD/ (ftp / ftp://ftp.tw.FreeBSD.org/pub/FreeBSD/ / rsync / rsyncv6) - - - ftp://ftp2.tw.FreeBSD.org/pub/FreeBSD/ (ftp / ftp://ftp2.tw.FreeBSD.org/pub/FreeBSD/ / http://ftp2.tw.FreeBSD.org/pub/FreeBSD/ / http://ftp2.tw.FreeBSD.org/pub/FreeBSD/ / rsync / rsyncv6) - - - ftp://ftp4.tw.FreeBSD.org/pub/FreeBSD/ (ftp) - - - ftp://ftp5.tw.FreeBSD.org/pub/FreeBSD/ (ftp) - - - ftp://ftp6.tw.FreeBSD.org/pub/FreeBSD/ (ftp / http://ftp6.tw.FreeBSD.org/ / rsync) - - - ftp://ftp7.tw.FreeBSD.org/pub/FreeBSD/ (ftp) - - - ftp://ftp8.tw.FreeBSD.org/pub/FreeBSD/ (ftp) - - - ftp://ftp11.tw.FreeBSD.org/pub/FreeBSD/ (ftp / http://ftp11.tw.FreeBSD.org/FreeBSD/) - - - ftp://ftp12.tw.FreeBSD.org/pub/FreeBSD/ (ftp) - - - ftp://ftp13.tw.FreeBSD.org/pub/FreeBSD/ (ftp) - - - ftp://ftp14.tw.FreeBSD.org/pub/FreeBSD/ (ftp) - - - ftp://ftp15.tw.FreeBSD.org/pub/FreeBSD/ (ftp) - - - - - - 烏克蘭 (Ukraine) - - - - ftp://ftp.ua.FreeBSD.org/pub/FreeBSD/ (ftp / http://ftp.ua.FreeBSD.org/pub/FreeBSD/) - - - ftp://ftp6.ua.FreeBSD.org/pub/FreeBSD/ (ftp / http://ftp6.ua.FreeBSD.org/pub/FreeBSD / rsync://ftp6.ua.FreeBSD.org/FreeBSD/) - - - ftp://ftp7.ua.FreeBSD.org/pub/FreeBSD/ (ftp) - - - - - - 英國 (United Kingdom) - - 若有任何問題,請聯絡此區域的主機管理者 hostmaster@uk.FreeBSD.org - - - ftp://ftp.uk.FreeBSD.org/pub/FreeBSD/ (ftp) - - - ftp://ftp2.uk.FreeBSD.org/pub/FreeBSD/ (ftp / rsync://ftp2.uk.FreeBSD.org/ftp.freebsd.org/pub/FreeBSD/) - - - ftp://ftp3.uk.FreeBSD.org/pub/FreeBSD/ (ftp) - - - ftp://ftp4.uk.FreeBSD.org/pub/FreeBSD/ (ftp) - - - ftp://ftp5.uk.FreeBSD.org/pub/FreeBSD/ (ftp) - - - - - - 美國 (USA) - - 若有任何問題,請聯絡此區域的主機管理者 hostmaster@us.FreeBSD.org - - - ftp://ftp1.us.FreeBSD.org/pub/FreeBSD/ (ftp) - - - ftp://ftp2.us.FreeBSD.org/pub/FreeBSD/ (ftp) - - - ftp://ftp3.us.FreeBSD.org/pub/FreeBSD/ (ftp) - - - ftp://ftp4.us.FreeBSD.org/pub/FreeBSD/ (ftp / ftpv6 / http://ftp4.us.FreeBSD.org/pub/FreeBSD/ / http://ftp4.us.FreeBSD.org/pub/FreeBSD/) - - - ftp://ftp5.us.FreeBSD.org/pub/FreeBSD/ (ftp) - - - ftp://ftp6.us.FreeBSD.org/pub/FreeBSD/ (ftp) - - - ftp://ftp8.us.FreeBSD.org/pub/FreeBSD/ (ftp) - - - ftp://ftp10.us.FreeBSD.org/pub/FreeBSD/ (ftp) - - - ftp://ftp11.us.FreeBSD.org/pub/FreeBSD/ (ftp) - - - ftp://ftp13.us.FreeBSD.org/pub/FreeBSD/ (ftp / http://ftp13.us.FreeBSD.org/pub/FreeBSD/ / rsync) - - - ftp://ftp14.us.FreeBSD.org/pub/FreeBSD/ (ftp / http://ftp14.us.FreeBSD.org/pub/FreeBSD/) - - - ftp://ftp15.us.FreeBSD.org/pub/FreeBSD/ (ftp) - - - - - - - - - - 使用 <application>Subversion</application> - - - Subversion - - - - 簡介 - - 自 2012 年 7 月起,FreeBSD 儲存所有 FreeBSD 的原始碼、文件與 Port 套件集均使用 Subversion 作為其唯一的版本控制系統。 - - - Subversion 只是一套開發人員工具。一般使用者可能會較喜歡使用 freebsd-update () 來更新 FreeBSD 基礎系統及 portsnap () 來更新 FreeBSD Port 套件集。 - - - 本節將示範如何在 FreeBSD 系統安裝 Subversion 以及使用它建立一個本地的 FreeBSD 檔案庫複本,也包含使用 Subversion 的其他資訊。 - - - - 根 <acronym>SSL</acronym> 憑證 - - 安裝 security/ca_root_nss 可讓 Subversion 能夠驗証 HTTPS 檔案庫伺服器的身份。root SSL 憑証可從 Port 安裝: - - # cd /usr/ports/security/ca_root_nss -# make install clean - - 或從套件: - - # pkg install ca_root_nss - - - - <application>Svnlite</application> - - 輕量化版的 Subversion svnlite 已會隨 FreeBSD 安裝。Port 或套件版的 Subversion 僅在要使用其 Python 或 Perl API 時需要,或是新想要使用最新版本 Subversion 時才需要。 - - 與正常 Subversion 唯一的差別只是指令名稱改為 svnlite - - - - 安裝 - - 若無法使用 svnlite 或需要完整版本的 Subversion 就必須安裝。 - - Subversion 可從 Port 套件集安裝: - - # cd /usr/ports/devel/subversion -# make install clean - - Subversion 也可以以套件安裝: - - # pkg install subversion - - - - 執行 <application>Subversion</application> - - 要下載原始碼乾淨的複本到本地目錄可使用 svn。在此目錄中的檔案稱作 本地工作複本 (Local working copy) - - - 在第一次使用 checkout 前請先移動或刪除目地現有的目錄。 - - 在現有非 svn 目錄存在的情況下做取出 (Checkout) 的動作會導致現有檔案與檔案庫中的檔案發生衝突。 - - - Subversion 使用 URL 來指定檔案庫,使用的格式為 protocol://hostname/path。路徑的第一個部份為要存取的 FreeBSD 檔案庫,目前有三個檔案庫,base 為 FreeBSD 基礎系統原始碼、ports 為 Port 套件集以及 doc 為說明文件。舉例來說,URL https://svn.FreeBSD.org/ports/head/ 代表 Port 檔案庫的主要分支,使用 https 通訊協定。 - - 使用指令從指定的檔案庫取出 (Checkout) 原始碼如下: - - # svn checkout https://svn.FreeBSD.org/repository/branch lwcdir - - where: - - - - repository 要是下列專案檔案庫其中之一:base, portsdoc - - - - branch 則依據使用的檔案庫來決定。portsdoc 大部份的更新皆在 head 分支,而 base 則會將 -CURRENT 的最新版本存放在 head 下,-STABLE 分支各自最新的版本則會放在 stable/9 (9.x) 與 stable/10 (10.x) 下。 - - - - lwcdir 則是要存放指定分支內容的目標目錄,通常 ports 會置於 /usr/portsbase 會置於 /usr/src 以及 doc 會置於 /usr/doc - - - - 以下範例會使用 HTTPS 協定從 FreeBSD 的檔案庫取出 Port 套件集,並將本地工作複本放置於 /usr/ports。若 /usr/ports 已存在,且不是由 svn 所建立的,記得要在取出之前重新命名或刪除。 - - # svn checkout https://svn.FreeBSD.org/ports/head /usr/ports - - 由於首次取出的動作必須下載遠端檔案庫中完整的分支,會需要花費一段時間,請耐心等候。 - - 首次取出之後,往後要更新本地工作複本可以執行: - - # svn update lwcdir - - 要更新上述範例所建立的 /usr/ports 可執行: - - # svn update /usr/ports - - 因為只會傳輸有更新過的檔案,更新的動作會比取出還要快速。 - - 另一種在取出之後更新本地工作複本的方式是透過 /usr/ports, /usr/src 以及 /usr/doc 目錄所提供的 Makefile。設定 SVN_UPDATE 並使用 update 目標。例如要更新 /usr/src - - # cd /usr/src -# make update SVN_UPDATE=yes - - - - <application>Subversion</application> 鏡像站 - - - Subversion Repository - Mirror Sites - - - FreeBSD Subversion 的檔案庫為: - - svn.FreeBSD.org - - 這是可公開存取的鏡像站,使用了 GeoDNS 會自動選擇適合的後端伺服器。若要由瀏覽器檢視 Subversion 檔案庫可以使用 https://svnweb.FreeBSD.org/。 - - HTTPS is the preferred protocol, but the - security/ca_root_nss - package will need to be installed in order to automatically - validate certificates. - - - - 取得更多資訊 - - 要取得其他有關使用 Subversion 的資訊請參考 Subversion Book,其書名為 Version Control with Subversion 或是 Subversion Documentation。 - - - - - 使用 <application>rsync</application> - - 這些站台讓 FreeBSD 可透過 rsync 通訊協定取得。rsync 工具只會傳輸兩個檔案集之間的差異,所以能夠大大的加快在網路上同步的速度,這對大多數 FreeBSD FTP 伺服器的鏡像站非常有用。rsync 在許多作業系統上也可以使用,在 FreeBSD 上請參考 net/rsync Port 或使用套件。 - - - - 捷克 (Czech Republic) - - - rsync://ftp.cz.FreeBSD.org/ - - 可用的檔案集: - - - ftp: FreeBSD FTP 伺服器的部份鏡像。 - - - - FreeBSD: FreeBSD FTP 伺服器的完整鏡像。 - - - - - - - 荷蘭 (Netherlands) - - - rsync://ftp.nl.FreeBSD.org/ - - 可用的檔案集: - - - FreeBSD: FreeBSD FTP 伺服器的完整鏡像。 - - - - - - - 俄羅斯 (Russia) - - - rsync://ftp.mtu.ru/ - - 可用的檔案集: - - - - FreeBSD: FreeBSD FTP 伺服器的完整鏡像。 - - - - FreeBSD-Archive: FreeBSD 封存 FTP 伺服器的鏡像。 - - - - - - - 瑞典 (Sweden) - - - rsync://ftp4.se.freebsd.org/ - - 可用的檔案集: - - - FreeBSD: FreeBSD FTP 伺服器的完整鏡像。 - - - - - - - 台灣 (Taiwan) - - - rsync://ftp.tw.FreeBSD.org/ - - rsync://ftp2.tw.FreeBSD.org/ - - rsync://ftp6.tw.FreeBSD.org/ - - 可用的檔案集: - - - FreeBSD: FreeBSD FTP 伺服器的完整鏡像。 - - - - - - - 英國 (United Kingdom) - - - rsync://rsync.mirrorservice.org/ - - 可用的檔案集: - - - ftp.freebsd.org: FreeBSD FTP 伺服器的完整鏡像。 - - - - - - - 美國 (USA) - - - rsync://ftp-master.FreeBSD.org/ - - 此伺服器僅供 FreeBSD 主要鏡像站使用。 - - 可用的檔案集: - - - - FreeBSD: FreeBSD FTP 伺服器的主要封存。 - - - - acl: FreeBSD 主要 ACL 清單。 - - - - rsync://ftp13.FreeBSD.org/ - - 可用的檔案集: - - - - FreeBSD: FreeBSD FTP 伺服器的完整鏡像。 - - - - - - -
- - - - - - 參考書目 - - 雖然操作手冊提供 FreeBSD 作業系統各個部分完整的說明,卻難免有「小學而大遺」之憾,像是如何讓整個作業系統運作順暢。因此,身邊有 UNIX 系統管理的好書以及好的使用手冊是不可或缺的。 - - - FreeBSD 相關書籍 - - 國際書籍: - - - - FreeBSD 入門與應用 (光碟豪華版) (繁體中文), 博碩文化出版, 1997. ISBN 9-578-39435-7。 - - - - - FreeBSD 技術內幕 (FreeBSD Unleashed 簡體中譯版), 機械工業出版社出版. ISBN 7-111-10201-0。 - - - - FreeBSD 使用大全第二版 (簡體中文), 機械工業出版社出版. ISBN 7-111-10286-X。 - - - - FreeBSD Handbook 第二版 (簡體中譯版), 人民郵電出版社出版. ISBN 7-115-10541-3。 - - - - FreeBSD & Windows 集成組網實務 (簡體中文), 中國鐵道出版社出版. ISBN 7-113-03845-X。 - - - - FreeBSD 網站架設實務 (簡體中文), 中國鐵道出版社出版. ISBN 7-113-03423-3。 - - - - FreeBSD (日文), CUTT 出版. ISBN 4-906391-22-2 C3055 P2400E。 - - - - Complete Introduction to FreeBSD (日文), Shoeisha Co., Ltd 出版. ISBN 4-88135-473-6 P3600E。 - - - - Personal UNIX Starter Kit FreeBSD (日文), ASCII 出版. ISBN 4-7561-1733-3 P3000E。 - - - - FreeBSD Handbook (日譯版), ASCII 出版. ISBN 4-7561-1580-2 P3800E。 - - - - FreeBSD mit Methode (德文), Computer und Literatur Verlag/Vertrieb Hanser 出版, 1998. ISBN 3-932311-31-0。 - - - - FreeBSD de Luxe (德文), Verlag Modere Industrie 出版, 2003. ISBN 3-8266-1343-0。 - - - - FreeBSD Install and Utilization Manual (日文), Mainichi Communications Inc. 出版, 1998. ISBN 4-8399-0112-0。 - - - - Onno W Purbo, Dodi Maryanto, Syahrial Hubbany, Widjil Widodo Building Internet Server with FreeBSD (印尼文), Elex Media Komputindo 出版。 - - - - FreeBSD 完全探索 (Absolute BSD: The Ultimate Guide to FreeBSD 繁體中譯版), GrandTech Press 出版, 2003. ISBN 986-7944-92-5。 - - - - FreeBSD 6.0 架設管理與應用 (繁體中文), 博碩出版, 2006. ISBN 9-575-27878-X。 - - - - 英文書籍: - - - - Absolute - FreeBSD, 2nd Edition: The Complete Guide to - FreeBSD, published by - No Starch - Press, 2007. ISBN: 978-1-59327-151-0 - - - - - The Complete FreeBSD, published by - O'Reilly, - 2003. ISBN: 0596005164 - - - - The - FreeBSD Corporate Networker's Guide, published by - Addison-Wesley, - 2000. ISBN: 0201704811 - - - - - FreeBSD: An Open-Source Operating System for Your Personal - Computer, published by The Bit Tree Press, 2001. - ISBN: 0971204500 - - - - Teach Yourself FreeBSD in 24 Hours, published by Sams, - 2002. ISBN: 0672324245 - - - - FreeBSD 6 Unleashed, published by Sams, - 2006. ISBN: 0672328755 - - - - FreeBSD: The Complete Reference, published by McGrawHill, - 2003. ISBN: 0072224096 - - - - - - 使用指南 - - - - Ohio State University has written a UNIX - Introductory Course which is available online in - HTML and PostScript format. - - An Italian translation - of this document is available as part of the FreeBSD Italian - Documentation Project. - - - - Edinburgh - University has written an Online - Guide for newcomers to the UNIX environment. - - - - - - 管理指南 - - - - Jpman - Project, Japan FreeBSD Users Group. FreeBSD - System Administrator's Manual (Japanese - translation). - Mainichi - Communications Inc., 1998. ISBN4-8399-0109-0 - P3300E. - - - - Dreyfus, Emmanuel. Cahiers - de l'Admin: BSD 2nd Ed. (in French), Eyrolles, - 2004. ISBN 2-212-11463-X - - - - - - 開發指南 - - - - Computer Systems Research Group, UC Berkeley. - 4.4BSD Programmer's Reference Manual. - O'Reilly & Associates, Inc., 1994. ISBN - 1-56592-078-3 - - - - Computer Systems Research Group, UC Berkeley. - 4.4BSD Programmer's Supplementary - Documents. O'Reilly & Associates, Inc., - 1994. ISBN 1-56592-079-1 - - - - Harbison, Samuel P. and Steele, Guy L. Jr. C: - A Reference Manual. 4th Ed. Prentice Hall, - 1995. ISBN 0-13-326224-3 - - - - Kernighan, Brian and Dennis M. Ritchie. The C - Programming Language. 2nd Ed. PTR Prentice - Hall, 1988. ISBN 0-13-110362-8 - - - - Lehey, Greg. Porting UNIX - Software. O'Reilly & Associates, Inc., - 1995. ISBN 1-56592-126-7 - - - - Plauger, P. J. The Standard C - Library. Prentice Hall, 1992. ISBN - 0-13-131509-9 - - - - Spinellis, Diomidis. Code - Reading: The Open Source Perspective. - Addison-Wesley, 2003. ISBN 0-201-79940-5 - - - - Spinellis, Diomidis. Code - Quality: The Open Source Perspective. - Addison-Wesley, 2006. ISBN 0-321-16607-8 - - - - Stevens, W. Richard and Stephen A. Rago. - Advanced Programming in the UNIX - Environment. 2nd Ed. Reading, Mass. : - Addison-Wesley, 2005. ISBN 0-201-43307-9 - - - - Stevens, W. Richard. UNIX Network - Programming. 2nd Ed, PTR Prentice Hall, 1998. - ISBN 0-13-490012-X - - - - - - 深入作業系統 - - - - Andleigh, Prabhat K. UNIX System - Architecture. Prentice-Hall, Inc., 1990. ISBN - 0-13-949843-5 - - - - Jolitz, William. Porting UNIX to the - 386. Dr. Dobb's Journal. - January 1991-July 1992. - - - - Leffler, Samuel J., Marshall Kirk McKusick, Michael J - Karels and John Quarterman The Design and - Implementation of the 4.3BSD UNIX Operating - System. Reading, Mass. : Addison-Wesley, 1989. - ISBN 0-201-06196-1 - - - - Leffler, Samuel J., Marshall Kirk McKusick, - The Design and Implementation of the 4.3BSD UNIX - Operating System: Answer Book. Reading, Mass. - : Addison-Wesley, 1991. ISBN 0-201-54629-9 - - - - McKusick, Marshall Kirk, Keith Bostic, Michael J Karels, - and John Quarterman. The Design and - Implementation of the 4.4BSD Operating System. - Reading, Mass. : Addison-Wesley, 1996. ISBN - 0-201-54979-4 - - (Chapter 2 of this book is available online - as part of the FreeBSD Documentation Project.) - - - - Marshall Kirk McKusick, George V. Neville-Neil - The Design and Implementation of the FreeBSD - Operating System. Boston, Mass. : - Addison-Wesley, 2004. ISBN 0-201-70245-2 - - - - Marshall Kirk McKusick, George V. Neville-Neil, - Robert N. M. Watson The Design and Implementation - of the FreeBSD Operating System, 2nd Ed.. - Westford, Mass. : Pearson Education, Inc., 2014. - ISBN 0-321-96897-2 - - - - Stevens, W. Richard. TCP/IP Illustrated, - Volume 1: The Protocols. Reading, Mass. : - Addison-Wesley, 1996. ISBN 0-201-63346-9 - - - - Schimmel, Curt. Unix Systems for Modern - Architectures. Reading, Mass. : - Addison-Wesley, 1994. ISBN 0-201-63338-8 - - - - Stevens, W. Richard. TCP/IP Illustrated, - Volume 3: TCP for Transactions, HTTP, NNTP and the UNIX - Domain Protocols. Reading, Mass. : - Addison-Wesley, 1996. ISBN 0-201-63495-3 - - - - Vahalia, Uresh. UNIX Internals -- The New - Frontiers. Prentice Hall, 1996. ISBN - 0-13-101908-2 - - - - Wright, Gary R. and W. Richard Stevens. - TCP/IP Illustrated, Volume 2: The - Implementation. Reading, Mass. : - Addison-Wesley, 1995. ISBN 0-201-63354-X - - - - - - 安全性參考文獻 - - - - Cheswick, William R. and Steven M. Bellovin. - Firewalls and Internet Security: Repelling the - Wily Hacker. Reading, Mass. : Addison-Wesley, - 1995. ISBN 0-201-63357-4 - - - - Garfinkel, Simson. PGP Pretty Good - Privacy O'Reilly & Associates, Inc., 1995. - ISBN 1-56592-098-8 - - - - - - 硬體參考文獻 - - - - Anderson, Don and Tom Shanley. Pentium - Processor System Architecture. 2nd Ed. - Reading, Mass. : Addison-Wesley, 1995. ISBN - 0-201-40992-5 - - - - Ferraro, Richard F. Programmer's Guide to the - EGA, VGA, and Super VGA Cards. 3rd ed. - Reading, Mass. : Addison-Wesley, 1995. ISBN - 0-201-62490-7 - - - - Intel Corporation publishes documentation on their CPUs, - chipsets and standards on their - developer web - site, usually as PDF files. - - - - Shanley, Tom. 80486 System - Architecture. 3rd Ed. Reading, Mass. : - Addison-Wesley, 1995. ISBN 0-201-40994-1 - - - - Shanley, Tom. ISA System - Architecture. 3rd Ed. Reading, Mass. : - Addison-Wesley, 1995. ISBN 0-201-40996-8 - - - - Shanley, Tom. PCI System - Architecture. 4th Ed. Reading, Mass. : - Addison-Wesley, 1999. ISBN 0-201-30974-2 - - - - Van Gilluwe, Frank. The Undocumented - PC, 2nd Ed. Reading, Mass: Addison-Wesley Pub. - Co., 1996. ISBN 0-201-47950-8 - - - - Messmer, Hans-Peter. The Indispensable PC - Hardware Book, 4th Ed. Reading, Mass : - Addison-Wesley Pub. Co., 2002. ISBN 0-201-59616-4 - - - - - - <trademark class="registered">UNIX</trademark> 歷史 - - - - Lion, John Lion's Commentary on UNIX, 6th Ed. - With Source Code. ITP Media Group, 1996. ISBN - 1573980137 - - - - Raymond, Eric S. The New Hacker's Dictionary, - 3rd edition. MIT Press, 1996. ISBN - 0-262-68092-0. Also known as the Jargon - File - - - - Salus, Peter H. A quarter century of - UNIX. Addison-Wesley Publishing Company, Inc., - 1994. ISBN 0-201-54777-5 - - - - Simon Garfinkel, Daniel Weise, Steven Strassmann. - The UNIX-HATERS Handbook. IDG Books - Worldwide, Inc., 1994. ISBN 1-56884-203-1. Out of print, - but available online. - - - - Don Libes, Sandy Ressler Life with - UNIX — special edition. Prentice-Hall, - Inc., 1989. ISBN 0-13-536657-7 - - - - The BSD family tree. - https://svnweb.freebsd.org/base/head/share/misc/bsd-family-tree?view=co - or /usr/share/misc/bsd-family-tree - on a FreeBSD machine. - - - - Networked Computer Science Technical Reports - Library. http://www.ncstrl.org/ - - - - Old BSD releases from the Computer Systems - Research group (CSRG). http://www.mckusick.com/csrg/: - The 4CD set covers all BSD versions from 1BSD to 4.4BSD and - 4.4BSD-Lite2 (but not 2.11BSD, unfortunately). The last - disk also holds the final sources plus the SCCS - files. - - - - - - 期刊與雜誌 - - - - Admin - Magazin (in German), published by - Medialinx AG. ISSN: 2190-1066 - - - - BSD - Magazine, published by Software Press Sp. z o.o. - SK. ISSN: 1898-9144 - - - - BSD Now - — Video Podcast, published by - Jupiter Broadcasting LLC - - - - BSD - Talk Podcast, by Will Backman - - - - FreeBSD - Journal, published by S&W - Publishing, sponsored by The FreeBSD Foundation. - ISBN: 978-0-615-88479-0 - - - - - - - - - - 網路資源 - - The rapid pace of FreeBSD progress makes print media - impractical as a means of following the latest developments. - Electronic resources are the best, if not often the only, way to - stay informed of the latest advances. Since FreeBSD is a volunteer - effort, the user community itself also generally serves as a - technical support department of sorts, with - electronic mail, web forums, and USENET news being the most - effective way of reaching that community. - - The most important points of contact with the FreeBSD user - community are outlined below. Please send other resources not - mentioned here to the FreeBSD documentation project mailing list so that they may also be - included. - - - 網站 - - - - The - FreeBSD Forums provide a web based discussion forum - for FreeBSD questions and technical - discussion. - - - - The BSDConferences - YouTube Channel provides a collection of high - quality videos from BSD conferences around the world. - This is a great way to watch key developers give - presentations about new work in FreeBSD. - - - - - - 郵遞論壇 (Mailing List) - - The mailing lists are the most direct way of addressing - questions or opening a technical discussion to a concentrated - FreeBSD audience. There are a wide variety of lists on a number of - different FreeBSD topics. Sending questions to the most - appropriate mailing list will invariably assure a faster and - more accurate response. - - The charters for the various lists are given at the bottom - of this document. Please read the charter before - joining or sending mail to any list. Most list - subscribers receive many hundreds of FreeBSD related messages every - day, and the charters and rules for use are meant to keep the - signal-to-noise ratio of the lists high. To do less would see - the mailing lists ultimately fail as an effective communications - medium for the Project. - - - To test the ability to send email to FreeBSD lists, - send a test message to freebsd-test. Please do - not send test messages to any other list. - - - When in doubt about what list to post a question to, see - How to get - best results from the FreeBSD-questions mailing - list. - - Before posting to any list, please learn about how to best - use the mailing lists, such as how to help avoid - frequently-repeated discussions, by reading the - Mailing List - Frequently Asked Questions (FAQ) document. - - Archives are kept for all of the mailing lists and can be - searched using the - FreeBSD World Wide - Web server. The keyword searchable archive offers an - excellent way of finding answers to frequently asked questions - and should be consulted before posting a question. Note that - this also means that messages sent to FreeBSD mailing lists are - archived in perpetuity. When protecting privacy is a concern, - consider using a disposable secondary email address and posting - only public information. - - - 論壇摘要 - - General lists: The following are - general lists which anyone is free (and encouraged) to - join: - - - - - - List - 用途 - - - - - - freebsd-advocacy - FreeBSD Evangelism - - - - freebsd-announce - Important events and Project milestones - (moderated) - - - - freebsd-arch - Architecture and design discussions - - - - freebsd-bugbusters - Discussions pertaining to the maintenance of - the FreeBSD problem report database and related - tools - - - - freebsd-bugs - Bug reports - - - - freebsd-chat - Non-technical items related to the FreeBSD - community - - - - freebsd-chromium - FreeBSD-specific Chromium issues - - - - freebsd-current - Discussion concerning the use of - FreeBSD-CURRENT - - - - freebsd-isp - Issues for Internet Service Providers using - FreeBSD - - - - freebsd-jobs - FreeBSD employment and consulting - opportunities - - - - freebsd-questions - User questions and technical support - - - - freebsd-security-notifications - Security notifications (moderated) - - - - freebsd-stable - Discussion concerning the use of - FreeBSD-STABLE - - - - freebsd-test - Where to send test messages instead of to - one of the actual lists - - - - freebsd-women - FreeBSD advocacy for women - - - - - - Technical lists: The following lists - are for technical discussion. Read the charter for each list - carefully before joining or sending mail to one as there are - firm guidelines for their use and content. - - - - - - List - 用途 - - - - - - freebsd-acpi - ACPI and power management development - - - - freebsd-afs - Porting AFS to FreeBSD - - - - freebsd-amd64 - Porting FreeBSD to AMD64 systems (moderated) - - - - freebsd-apache - Discussion about - Apache related - ports - - - - freebsd-arm - Porting FreeBSD to ARM processors - - - - freebsd-atm - Using ATM networking with FreeBSD - - - - freebsd-bluetooth - Using Bluetooth technology in FreeBSD - - - - freebsd-cloud - FreeBSD on cloud platforms (EC2, GCE, Azure, - etc.) - - - - freebsd-cluster - Using FreeBSD in a clustered environment - - - - freebsd-database - Discussing database use and development under - FreeBSD - - - - freebsd-desktop - Using and improving FreeBSD on the desktop - - - - dev-ci - Build and test reports from the Continuous - Integration servers - - - - dev-reviews - Notifications of the FreeBSD review - system - - - - freebsd-doc - Creating FreeBSD related documents - - - - freebsd-drivers - Writing device drivers for FreeBSD - - - - freebsd-dtrace - Using and working on DTrace in FreeBSD - - - - freebsd-eclipse - FreeBSD users of Eclipse IDE, tools, rich client - applications and ports. - - - - freebsd-elastic - FreeBSD-specific ElasticSearch discussions - - - - freebsd-embedded - Using FreeBSD in embedded applications - - - - freebsd-eol - Peer support of FreeBSD-related software that - is no longer supported by the FreeBSD Project. - - - - freebsd-emulation - Emulation of other systems such as - Linux/MS-DOS/Windows - - - - freebsd-enlightenment - Porting Enlightenment - and Enlightenment - applications - - - - freebsd-erlang - FreeBSD-specific Erlang discussions - - - - freebsd-firewire - FreeBSD FireWire (iLink, IEEE 1394) technical - discussion - - - - freebsd-fortran - Fortran on FreeBSD - - - - freebsd-fs - File systems - - - - freebsd-games - Support for Games on FreeBSD - - - - freebsd-gecko - Gecko Rendering - Engine issues - - - - freebsd-geom - GEOM-specific discussions and - implementations - - - - freebsd-git - Discussion of git use in the FreeBSD project - - - - freebsd-gnome - Porting GNOME and - GNOME applications - - - - freebsd-hackers - General technical discussion - - - - freebsd-haskell - FreeBSD-specific Haskell issues and - discussions - - - - freebsd-hardware - General discussion of hardware for running - FreeBSD - - - - freebsd-i18n - FreeBSD Internationalization - - - - freebsd-ia32 - FreeBSD on the IA-32 (Intel x86) - platform - - - - freebsd-ia64 - Porting FreeBSD to Intel's upcoming IA64 - systems - - - - freebsd-infiniband - Infiniband on FreeBSD - - - - freebsd-ipfw - Technical discussion concerning the redesign - of the IP firewall code - - - - freebsd-isdn - ISDN developers - - - - freebsd-jail - Discussion about the jail8 - facility - - - - freebsd-java - Java developers and people porting JDKs to - FreeBSD - - - - freebsd-kde - Porting KDE and - KDE applications - - - - freebsd-lfs - Porting LFS to FreeBSD - - - - freebsd-mips - Porting FreeBSD to MIPS - - - - freebsd-mobile - Discussions about mobile computing - - - - freebsd-mono - Mono and C# applications on FreeBSD - - - - freebsd-multimedia - Multimedia applications - - - - freebsd-new-bus - Technical discussions about bus - architecture - - - - freebsd-net - Networking discussion and TCP/IP source - code - - - - freebsd-numerics - Discussions of high quality implementation of - libm functions - - - - freebsd-ocaml - FreeBSD-specific OCaml discussions - - - - freebsd-office - Office applications on FreeBSD - - - - freebsd-performance - Performance tuning questions for high - performance/load installations - - - - freebsd-perl - Maintenance of a number of - Perl-related ports - - - - freebsd-pf - Discussion and questions about the packet filter - firewall system - - - - freebsd-pkg - Binary package management and package - tools discussion - - - - freebsd-pkg-fallout - Fallout logs from package building - - - - freebsd-pkgbase - Packaging the FreeBSD base system - - - - freebsd-platforms - Concerning ports to non Intel architecture - platforms - - - - freebsd-ports - Discussion of the Ports Collection - - - - freebsd-ports-announce - Important news and instructions about the Ports - Collection (moderated) - - - - freebsd-ports-bugs - Discussion of the ports bugs/PRs - - - - freebsd-ppc - Porting FreeBSD to the PowerPC - - - - freebsd-proliant - Technical discussion of FreeBSD on HP ProLiant - server platforms - - - - freebsd-python - FreeBSD-specific Python issues - - - - freebsd-rc - Discussion related to the - rc.d system and its - development - - - - freebsd-realtime - Development of realtime extensions to - FreeBSD - - - - freebsd-ruby - FreeBSD-specific Ruby discussions - - - - freebsd-scsi - The SCSI subsystem - - - - freebsd-security - Security issues affecting FreeBSD - - - - freebsd-small - Using FreeBSD in embedded applications - (obsolete; use freebsd-embedded instead) - - - - freebsd-snapshots - FreeBSD Development Snapshot Announcements - - - - freebsd-sparc64 - Porting FreeBSD to SPARC based systems - - - - freebsd-standards - FreeBSD's conformance to the C99 and the POSIX - standards - - - - freebsd-sysinstall - sysinstall8 development - - - - freebsd-tcltk - FreeBSD-specific Tcl/Tk discussions - - - - freebsd-testing - Testing on FreeBSD - - - - freebsd-tex - - Porting TeX and its - applications to FreeBSD - - - - freebsd-threads - Threading in FreeBSD - - - - freebsd-tilera - Porting FreeBSD to the Tilera family of - CPUs - - - - freebsd-tokenring - Support Token Ring in FreeBSD - - - - freebsd-toolchain - Maintenance of FreeBSD's integrated - toolchain - - - - freebsd-translators - Translating FreeBSD documents and programs - - - - freebsd-transport - Discussions of transport level network protocols - in FreeBSD - - - - freebsd-usb - Discussing FreeBSD support for USB - - - - freebsd-virtualization - Discussion of various virtualization techniques - supported by FreeBSD - - - - freebsd-vuxml - Discussion on VuXML infrastructure - - - - freebsd-x11 - Maintenance and support of X11 on FreeBSD - - - - freebsd-xen - Discussion of the FreeBSD port to Xen — - implementation and usage - - - - freebsd-xfce - XFCE for FreeBSD — - porting and maintaining - - - - freebsd-zope - Zope for FreeBSD — - porting and maintaining - - - - - - Limited lists: The following lists - are for more specialized (and demanding) audiences and are - probably not of interest to the general public. It is also a - good idea to establish a presence in the technical lists - before joining one of these limited lists in order to - understand the communications etiquette involved. - - - - - - List - 用途 - - - - - - freebsd-hubs - People running mirror sites (infrastructural - support) - - - - freebsd-user-groups - User group coordination - - - - freebsd-wip-status - FreeBSD Work-In-Progress Status - - - - freebsd-wireless - Discussions of 802.11 stack, tools, device driver - development - - - - - - Digest lists: All of the above lists - are available in a digest format. Once subscribed to a list, - the digest options can be changed in the account options - section. - - SVN lists: The following lists are - for people interested in seeing the log messages for changes - to various areas of the source tree. They are - Read-Only lists and should not have mail - sent to them. - - - - - - List - Source area - Area Description (source for) - - - - - - svn-doc-all - /usr/doc - All changes to the doc Subversion repository - (except for user, - projects and - translations) - - - - svn-doc-head - /usr/doc - All changes to the head branch of - the doc Subversion repository - - - - svn-doc-projects - /usr/doc/projects - All changes to the projects - area of the doc Subversion repository - - - - svn-doc-svnadmin - /usr/doc - All changes to the administrative scripts, hooks, - and other configuration data of the doc Subversion - repository - - - - svn-ports-all - /usr/ports - All changes to the ports Subversion - repository - - - - svn-ports-head - /usr/ports - All changes to the head branch - of the ports Subversion repository - - - - svn-ports-svnadmin - /usr/ports - All changes to the administrative scripts, hooks, - and other configuration data of the ports Subversion - repository - - - - svn-src-all - /usr/src - All changes to the src Subversion repository - (except for user - and projects) - - - - svn-src-head - /usr/src - All changes to the head branch - of the src Subversion repository (the FreeBSD-CURRENT - branch) - - - - svn-src-projects - /usr/projects - All changes to the projects - area of the src Subversion repository - - - - svn-src-release - /usr/src - All changes to the releases - area of the src Subversion repository - - - - svn-src-releng - /usr/src - All changes to the releng - branches of the src Subversion repository (the - security / release engineering branches) - - - - svn-src-stable - /usr/src - All changes to the all stable branches of the src - Subversion repository - - - - svn-src-stable-6 - /usr/src - All changes to the stable/6 - branch of the src Subversion repository - - - - svn-src-stable-7 - /usr/src - All changes to the stable/7 - branch of the src Subversion repository - - - - svn-src-stable-8 - /usr/src - All changes to the stable/8 - branch of the src Subversion repository - - - - svn-src-stable-9 - /usr/src - All changes to the stable/9 - branch of the src Subversion repository - - - - svn-src-stable-10 - /usr/src - All changes to the stable/10 - branch of the src Subversion repository - - - - svn-src-stable-11 - /usr/src - All changes to the stable/11 - branch of the src Subversion repository - - - - svn-src-stable-12 - /usr/src - All changes to the stable/12 - branch of the src Subversion repository - - - - svn-src-stable-other - /usr/src - All changes to the - older stable branches of the src - Subversion repository - - - - svn-src-svnadmin - /usr/src - All changes to the administrative scripts, hooks, - and other configuration data of the src Subversion - repository - - - - svn-src-user - /usr/src - All changes to the - experimental user area of the src - Subversion repository - - - - svn-src-vendor - /usr/src - All changes to the vendor work area of the src - Subversion repository - - - - - - - - 如何訂閱 - - To subscribe to a list, click the list name at - http://lists.FreeBSD.org/mailman/listinfo. The page that is displayed should - contain all of the necessary subscription instructions for - that list. - - To actually post to a given list, send mail to - listname@FreeBSD.org. - It will then be redistributed to mailing list members - world-wide. - - To unsubscribe from a list, click on the URL found at the - bottom of every email received from the list. It is also - possible to send an email to - listname-unsubscribe@FreeBSD.org - to unsubscribe. - - It is important to keep discussion in the technical - mailing lists on a technical track. To only receive important - announcements, instead join the FreeBSD announcements mailing list, which is - intended for infrequent traffic. - - - - 論壇章程 - - All FreeBSD mailing lists have certain - basic rules which must be adhered to by anyone using them. - Failure to comply with these guidelines will result in two (2) - written warnings from the FreeBSD Postmaster - postmaster@FreeBSD.org, after which, on a third - offense, the poster will removed from all FreeBSD mailing lists - and filtered from further posting to them. We regret that - such rules and measures are necessary at all, but today's - Internet is a pretty harsh environment, it would seem, and - many fail to appreciate just how fragile some of its - mechanisms are. - - Rules of the road: - - - - The topic of any posting should adhere to the basic - charter of the list it is posted to. If the list is about - technical issues, the posting should contain technical - discussion. Ongoing irrelevant chatter or flaming only - detracts from the value of the mailing list for everyone - on it and will not be tolerated. For free-form discussion - on no particular topic, the FreeBSD chat mailing list is freely available - and should be used instead. - - - - No posting should be made to more than 2 mailing - lists, and only to 2 when a clear and obvious need to post - to both lists exists. For most lists, there is already a - great deal of subscriber overlap and except for the most - esoteric mixes (say -stable & -scsi), - there really is no reason to post to more than one list at - a time. If a message is received with multiple mailing - lists on the Cc line, trim the - Cc line before replying. The - person who replies is still responsible for - cross-posting, no matter who the originator might have - been. - - - - Personal attacks and profanity (in the context of an - argument) are not allowed, and that includes users and - developers alike. Gross breaches of netiquette, like - excerpting or reposting private mail when permission to do - so was not and would not be forthcoming, are frowned upon - but not specifically enforced. - However, there are also very few - cases where such content would fit within the charter of a - list and it would therefore probably rate a warning (or - ban) on that basis alone. - - - - Advertising of non-FreeBSD related products or services - is strictly prohibited and will result in an immediate ban - if it is clear that the offender is advertising by - spam. - - - - Individual list charters: - - - - - freebsd-acpi - - - ACPI and power management - development - - - - - freebsd-afs - - - Andrew File System - - This list is for discussion on porting and using - AFS from CMU/Transarc - - - - - freebsd-announce - - - Important events / - milestones - - This is the mailing list for people interested only - in occasional announcements of significant FreeBSD events. - This includes announcements about snapshots and other - releases. It contains announcements of new FreeBSD - capabilities. It may contain calls for volunteers etc. - This is a low volume, strictly moderated mailing - list. - - - - - freebsd-arch - - - Architecture and design - discussions - - This list is for discussion of the FreeBSD - architecture. Messages will mostly be kept strictly - technical in nature. Examples of suitable topics - are: - - - - How to re-vamp the build system to have several - customized builds running at the same time. - - - - What needs to be fixed with VFS to make - Heidemann layers work. - - - - How do we change the device driver interface - to be able to use the same drivers cleanly on many - buses and architectures. - - - - How to write a network driver. - - - - - - - freebsd-bluetooth - - - Bluetooth in FreeBSD - - This is the forum where FreeBSD's Bluetooth users - congregate. Design issues, implementation details, - patches, bug reports, status reports, feature requests, - and all matters related to Bluetooth are fair - game. - - - - - freebsd-bugbusters - - - Coordination of the Problem Report - handling effort - - The purpose of this list is to serve as a - coordination and discussion forum for the Bugmeister, - his Bugbusters, and any other parties who have a genuine - interest in the PR database. This list is not for - discussions about specific bugs, patches or PRs. - - - - - freebsd-bugs - - - Bug reports - - This is the mailing list for reporting bugs in FreeBSD. - Whenever possible, bugs should be submitted using the - web - interface to it. - - - - - freebsd-chat - - - Non technical items related to the FreeBSD - community - - This list contains the overflow from the other lists - about non-technical, social information. It includes - discussion about whether Jordan looks like a toon ferret - or not, whether or not to type in capitals, who is - drinking too much coffee, where the best beer is brewed, - who is brewing beer in their basement, and so on. - Occasional announcements of important events (such as - upcoming parties, weddings, births, new jobs, etc) can - be made to the technical lists, but the follow ups - should be directed to this -chat list. - - - - - freebsd-chromium - - - FreeBSD-specific Chromium - issues - - This is a list for the discussion of Chromium - support for FreeBSD. This is a technical list to - discuss development and installation of Chromium. - - - - - freebsd-cloud - - - Running FreeBSD on various cloud - platforms - - This list discusses running FreeBSD on Amazon EC2, - Google Compute Engine, Microsoft Azure, and other cloud - computing platforms. - - - - - freebsd-core - - - FreeBSD core team - - This is an internal mailing list for use by the core - members. Messages can be sent to it when a serious - FreeBSD-related matter requires arbitration or - high-level scrutiny. - - - - - freebsd-current - - - Discussions about the use of - FreeBSD-CURRENT - - This is the mailing list for users of FreeBSD-CURRENT. - It includes warnings about new features coming out in - -CURRENT that will affect the users, and instructions - on steps that must be taken to remain -CURRENT. Anyone - running CURRENT must subscribe to this - list. This is a technical mailing list for which - strictly technical content is expected. - - - - - freebsd-desktop - - - Using and improving FreeBSD on the - desktop - - This is a forum for discussion of FreeBSD on the - desktop. It is primarily a place for desktop porters - and users to discuss issues and improve FreeBSD's desktop - support. - - - - - dev-ci - - Continuous Integration reports of build - and test results - - All Continuous Integration reports of build and test - results - - - - - dev-reviews - - Notifications of work in progress in - FreeBSD's review tool - - Automated notifications of work in progress for - review in FreeBSD's review tools, including - patches. - - - - - freebsd-doc - - - Documentation Project - - This mailing list is for the discussion of issues - and projects related to the creation of documentation - for FreeBSD. The members of this mailing list are - collectively referred to as The FreeBSD - Documentation Project. It is an open list; feel - free to join and contribute! - - - - - freebsd-drivers - - - Writing device drivers for - FreeBSD - - This is a forum for technical discussions related to - device drivers on FreeBSD. It is primarily a place for - device driver writers to ask questions about how to - write device drivers using the APIs in the FreeBSD - kernel. - - - - - freebsd-dtrace - - - Using and working on DTrace in - FreeBSD - - DTrace is an integrated component of FreeBSD that - provides a framework for understanding the kernel as - well as user space programs at run time. The mailing - list is an archived discussion for developers of the - code as well as those using it. - - - - - freebsd-eclipse - - - FreeBSD users of Eclipse IDE, tools, rich - client applications and ports. - - The intention of this list is to provide mutual - support for everything to do with choosing, installing, - using, developing and maintaining the Eclipse IDE, - tools, rich client applications on the FreeBSD platform and - assisting with the porting of Eclipse IDE and plugins to - the FreeBSD environment. - - The intention is also to facilitate exchange of - information between the Eclipse community and the FreeBSD - community to the mutual benefit of both. - - Although this list is focused primarily on the needs - of Eclipse users it will also provide a forum for those - who would like to develop FreeBSD specific applications - using the Eclipse framework. - - - - - freebsd-embedded - - - Using FreeBSD in embedded - applications - - This list discusses topics related to using FreeBSD in - embedded systems. This is a technical mailing list for - which strictly technical content is expected. For the - purpose of this list, embedded systems are those - computing devices which are not desktops and which - usually serve a single purpose as opposed to being - general computing environments. Examples include, but - are not limited to, all kinds of phone handsets, network - equipment such as routers, switches and PBXs, remote - measuring equipment, PDAs, Point Of Sale systems, and so - on. - - - - - freebsd-emulation - - - Emulation of other systems such as - Linux/MS-DOS/Windows - - This is a forum for technical discussions related - to running programs written for other operating systems - on FreeBSD. - - - - - freebsd-enlightenment - - - Enlightenment - - Discussions concerning the - Enlightenment Desktop - Environment for FreeBSD systems. This is a technical - mailing list for which strictly technical content is - expected. - - - - - freebsd-eol - - - Peer support of FreeBSD-related software - that is no longer supported by the FreeBSD - Project. - - This list is for those interested in providing or - making use of peer support of FreeBSD-related software for - which the FreeBSD Project no longer provides official - support in the form of security advisories and - patches. - - - - - freebsd-firewire - - - FireWire (iLink, IEEE - 1394) - - This is a mailing list for discussion of the design - and implementation of a FireWire (aka IEEE 1394 aka - iLink) subsystem for FreeBSD. Relevant topics specifically - include the standards, bus devices and their protocols, - adapter boards/cards/chips sets, and the architecture - and implementation of code for their proper - support. - - - - - freebsd-fortran - - - Fortran on FreeBSD - - This is the mailing list for discussion of Fortran - related ports on FreeBSD: compilers, libraries, scientific - and engineering applications from laptops to HPC - clusters. - - - - - freebsd-fs - - - File systems - - Discussions concerning FreeBSD filesystems. This is a - technical mailing list for which strictly technical - content is expected. - - - - - freebsd-games - - - Games on FreeBSD - - This is a technical list for discussions related to - bringing games to FreeBSD. It is for individuals actively - working on porting games to FreeBSD, to bring up problems - or discuss alternative solutions. Individuals - interested in following the technical discussion are - also welcome. - - - - - freebsd-gecko - - - Gecko Rendering Engine - - This is a forum about - Gecko applications using - FreeBSD. - - Discussion centers around Gecko Ports applications, - their installation, their development and their support - within FreeBSD. - - - - - freebsd-geom - - - GEOM - - Discussions specific to GEOM and related - implementations. This is a technical mailing list for - which strictly technical content is expected. - - - - - freebsd-git - - - Use of git in the FreeBSD - project - - Discussions of how to use git in FreeBSD - infrastructure including the github mirror and other - uses of git for project collaboration. Discussion area - for people using git against the FreeBSD github mirror. - People wanting to get started with the mirror or git - in general on FreeBSD can ask here. - - - - - freebsd-gnome - - - GNOME - - Discussions concerning The - GNOME Desktop Environment - for FreeBSD systems. This is a technical mailing list - for which strictly technical content is expected. - - - - - freebsd-infiniband - - - Infiniband on FreeBSD - - Technical mailing list discussing Infiniband, OFED, - and OpenSM on FreeBSD. - - - - - freebsd-ipfw - - - IP Firewall - - This is the forum for technical discussions - concerning the redesign of the IP firewall code in - FreeBSD. This is a technical mailing list for which - strictly technical content is expected. - - - - - freebsd-ia64 - - - Porting FreeBSD to IA64 - - This is a technical mailing list for individuals - actively working on porting FreeBSD to the IA-64 platform - from Intel, to bring up problems or discuss - alternative solutions. Individuals interested in - following the technical discussion are also - welcome. - - - - - freebsd-isdn - - - ISDN Communications - - This is the mailing list for people discussing the - development of ISDN support for FreeBSD. - - - - - freebsd-java - - - Java Development - - This is the mailing list for people discussing the - development of significant Java applications for FreeBSD - and the porting and maintenance of JDKs. - - - - - freebsd-jobs - - - Jobs offered and sought - - This is a forum for posting employment notices - specifically related to FreeBSD and resumes from those - seeking FreeBSD-related employment. This is - not a mailing list for general - employment issues since adequate forums for that already - exist elsewhere. - - Note that this list, like other FreeBSD.org - mailing lists, is distributed worldwide. Be clear about - the geographic location and the extent to which - telecommuting or assistance with relocation is - available. - - Email should use open formats only — - preferably plain text, but basic Portable Document - Format (PDF), HTML, and a few others - are acceptable to many readers. Closed formats such as - Microsoft Word (.doc) will be - rejected by the mailing list server. - - - - - freebsd-kde - - - KDE - - Discussions concerning - KDE on FreeBSD systems. - This is a technical mailing list for which strictly - technical content is expected. - - - - - freebsd-hackers - - - Technical discussions - - This is a forum for technical discussions related - to FreeBSD. This is the primary technical mailing list. - It is for individuals actively working on FreeBSD, to bring - up problems or discuss alternative solutions. - Individuals interested in following the technical - discussion are also welcome. This is a technical - mailing list for which strictly technical content is - expected. - - - - - freebsd-hardware - - - General discussion of FreeBSD - hardware - - General discussion about the types of hardware that - FreeBSD runs on, various problems and suggestions - concerning what to buy or avoid. - - - - - freebsd-hubs - - - Mirror sites - - Announcements and discussion for people who run FreeBSD - mirror sites. - - - - - freebsd-isp - - - Issues for Internet Service - Providers - - This mailing list is for discussing topics relevant - to Internet Service Providers (ISPs) using FreeBSD. This - is a technical mailing list for which strictly technical - content is expected. - - - - - freebsd-mono - - - Mono and C# applications on - FreeBSD - - This is a list for discussions related to the Mono - development framework on FreeBSD. This is a technical - mailing list. It is for individuals actively working on - porting Mono or C# applications to FreeBSD, to bring up - problems or discuss alternative solutions. Individuals - interested in following the technical discussion are - also welcome. - - - - - freebsd-ocaml - - - FreeBSD-specific OCaml - discussions - - This is a list for discussions related to the OCaml - support on FreeBSD. This is a technical mailing list. It - is for individuals working on OCaml ports, 3rd party - libraries and frameworks. Individuals interested in the - technical discussion are also welcome. - - - - - freebsd-office - - - Office applications on - FreeBSD - - Discussion centers around office applications, their - installation, their development and their support within - FreeBSD. - - - - - freebsd-ops-announce - - - Project Infrastructure - Announcements - - This is the mailing list for people interested in - changes and issues related to the FreeBSD.org Project - infrastructure. - - This moderated list is strictly for announcements: - no replies, requests, discussions, or opinions. - - - - - freebsd-performance - - - Discussions about tuning or speeding up - FreeBSD - - This mailing list exists to provide a place for - hackers, administrators, and/or concerned parties to - discuss performance related topics pertaining to FreeBSD. - Acceptable topics includes talking about FreeBSD - installations that are either under high load, are - experiencing performance problems, or are pushing the - limits of FreeBSD. Concerned parties that are willing to - work toward improving the performance of FreeBSD are highly - encouraged to subscribe to this list. This is a highly - technical list ideally suited for experienced FreeBSD - users, hackers, or administrators interested in keeping - FreeBSD fast, robust, and scalable. This list is not a - question-and-answer list that replaces reading through - documentation, but it is a place to make contributions - or inquire about unanswered performance related - topics. - - - - - freebsd-pf - - - Discussion and questions about the packet - filter firewall system - - Discussion concerning the packet filter (pf) - firewall system in terms of FreeBSD. Technical discussion - and user questions are both welcome. This list is also - a place to discuss the ALTQ QoS framework. - - - - - freebsd-pkg - - - Binary package management and package - tools discussion - - Discussion of all aspects of managing FreeBSD systems - by using binary packages to install software, including - binary package toolkits and formats, their development - and support within FreeBSD, package repository management, - and third party packages. - - Note that discussion of ports which fail to generate - packages correctly should generally be considered as - ports problems, and so inappropriate for this - list. - - - - - freebsd-pkg-fallout - - - Fallout logs from package - building - - All packages building failures logs from the package - building clusters - - - - - freebsd-pkgbase - - - Packaging the FreeBSD base - system. - - Discussions surrounding implementation and issues - regarding packaging the FreeBSD base system. - - - - - freebsd-platforms - - - Porting to Non Intel - platforms - - Cross-platform FreeBSD issues, general discussion and - proposals for non Intel FreeBSD ports. This is a - technical mailing list for which strictly technical - content is expected. - - - - - freebsd-ports - - - Discussion of - ports - - Discussions concerning FreeBSD's ports - collection (/usr/ports), - ports infrastructure, and general ports coordination - efforts. This is a technical mailing list for which - strictly technical content is expected. - - - - - freebsd-ports-announce - - - Important news and instructions about the - FreeBSD Ports - Collection - - Important news for developers, porters, and users of - the Ports Collection - (/usr/ports), including - architecture/infrastructure changes, new capabilities, - critical upgrade instructions, and release engineering - information. This is a low-volume mailing list, - intended for announcements. - - - - - freebsd-ports-bugs - - - Discussion of - ports bugs - - Discussions concerning problem reports for FreeBSD's - ports collection - (/usr/ports), proposed ports, or - modifications to ports. This is a technical mailing - list for which strictly technical content is - expected. - - - - - freebsd-proliant - - - Technical discussion of FreeBSD on HP - ProLiant server platforms - - This mailing list is to be used for the technical - discussion of the usage of FreeBSD on HP ProLiant servers, - including the discussion of ProLiant-specific drivers, - management software, configuration tools, and BIOS - updates. As such, this is the primary place to discuss - the hpasmd, hpasmcli, and hpacucli modules. - - - - - freebsd-python - - - Python on FreeBSD - - This is a list for discussions related to improving - Python-support on FreeBSD. This is a technical mailing - list. It is for individuals working on porting Python, - its third party modules and - Zope stuff to FreeBSD. - Individuals interested in following the technical - discussion are also welcome. - - - - - freebsd-questions - - - User questions - - This is the mailing list for questions about FreeBSD. - Do not send how to questions to the - technical lists unless the question is quite - technical. - - - - - freebsd-ruby - - - FreeBSD-specific Ruby - discussions - - This is a list for discussions related to the Ruby - support on FreeBSD. This is a technical mailing list. It - is for individuals working on Ruby ports, third party - libraries and frameworks. - - Individuals interested in the technical discussion - are also welcome. - - - - - freebsd-scsi - - - SCSI subsystem - - This is the mailing list for people working on the - SCSI subsystem for FreeBSD. This is a technical mailing - list for which strictly technical content is - expected. - - - - - freebsd-security - - - Security issues - - FreeBSD computer security issues (DES, Kerberos, known - security holes and fixes, etc). This is a technical - mailing list for which strictly technical discussion is - expected. Note that this is not a question-and-answer - list, but that contributions (BOTH question AND answer) - to the FAQ are welcome. - - - - - freebsd-security-notifications - - - Security Notifications - - Notifications of FreeBSD security problems and fixes. - This is not a discussion list. The discussion list is - FreeBSD-security. - - - - - freebsd-small - - - Using FreeBSD in embedded - applications - - This list discusses topics related to unusually - small and embedded FreeBSD installations. This is a - technical mailing list for which strictly technical - content is expected. - - - This list has been obsoleted by - freebsd-embedded. - - - - - - - freebsd-snapshots - - - FreeBSD Development Snapshot - Announcements - - This list provides notifications about the - availability of new FreeBSD development snapshots for the - head/ and stable/ branches. - - - - - freebsd-stable - - - Discussions about the use of - FreeBSD-STABLE - - This is the mailing list for users of FreeBSD-STABLE. - STABLE is the branch where development - continues after a RELEASE, including bug fixes and new - features. The ABI is kept stable for binary - compatibility. It includes warnings about new features - coming out in -STABLE that will affect the users, and - instructions on steps that must be taken to remain - -STABLE. Anyone running STABLE should - subscribe to this list. This is a technical mailing - list for which strictly technical content is - expected. - - - - - freebsd-standards - - - C99 & POSIX - Conformance - - This is a forum for technical discussions related to - FreeBSD Conformance to the C99 and the POSIX - standards. - - - - - freebsd-teaching - - - Teaching with FreeBSD - - Non technical mailing list discussing teaching - with FreeBSD. - - - - - freebsd-testing - - - Testing on FreeBSD - - Technical mailing list discussing testing on FreeBSD, - including ATF/Kyua, test build infrastructure, port - tests to FreeBSD from other operating systems (NetBSD, - ...), etc. - - - - - freebsd-tex - - - Porting TeX and - its applications to FreeBSD - - This is a technical mailing list for discussions - related to TeX and its applications on FreeBSD. It is for - individuals actively working on porting TeX to FreeBSD, - to bring up problems or discuss alternative solutions. - Individuals interested in following the technical - discussion are also welcome. - - - - - freebsd-toolchain - - - Maintenance of FreeBSD's integrated - toolchain - - This is the mailing list for discussions related to - the maintenance of the toolchain shipped with FreeBSD. - This could include the state of Clang and GCC, but also - pieces of software such as assemblers, linkers and - debuggers. - - - - - freebsd-transport - - - Discussions of transport level network - protocols in FreeBSD - - The transport mailing list exists for the discussion - of issues and designs around the transport level - protocols in the FreeBSD network stack, including TCP, - SCTP and UDP. Other networking topics, including - driver specific and network protocol issues should be - discussed on the FreeBSD networking mailing list. - - - - - freebsd-translators - - - Translating FreeBSD documents and - programs - - A discussion list where translators of FreeBSD - documents from English into other languages can talk - about translation methods and tools. New members are - asked to introduce themselves and mention the languages - they are interested in translating. - - - - - freebsd-usb - - - Discussing FreeBSD support for - USB - - This is a mailing list for technical discussions - related to FreeBSD support for USB. - - - - - freebsd-user-groups - - - User Group Coordination - List - - This is the mailing list for the coordinators from - each of the local area Users Groups to discuss matters - with each other and a designated individual from the - Core Team. This mail list should be limited to meeting - synopsis and coordination of projects that span User - Groups. - - - - - freebsd-virtualization - - - Discussion of various virtualization - techniques supported by FreeBSD - - A list to discuss the various virtualization - techniques supported by FreeBSD. On one hand the focus - will be on the implementation of the basic functionality - as well as adding new features. On the other hand users - will have a forum to ask for help in case of problems or - to discuss their use cases. - - - - - freebsd-wip-status - - - FreeBSD Work-In-Progress - Status - - This mailing list can be used by developers to - announce the creation and progress of FreeBSD related work. - Messages will be moderated. It is suggested to send the - message "To:" a more topical FreeBSD list and only "BCC:" - this list. This way the WIP can also be discussed on - the topical list, as no discussion is allowed on this - list. - - Look inside the archives for examples of suitable - messages. - - An editorial digest of the messages to this list - might be posted to the FreeBSD website every few months as - part of the Status Reports - https://www.freebsd.org/news/status/. - Past reports are archived. - - - - - freebsd-wireless - - - Discussions of 802.11 stack, tools device - driver development - - The FreeBSD-wireless list focuses on 802.11 stack - (sys/net80211), device driver and tools development. - This includes bugs, new features and maintenance. - - - - - freebsd-xen - - - Discussion of the FreeBSD port to Xen - — implementation and usage - - A list that focuses on the FreeBSD Xen port. The - anticipated traffic level is small enough that it is - intended as a forum for both technical discussions of - the implementation and design details as well as - administrative deployment issues. - - - - - freebsd-xfce - - - XFCE - - This is a forum for discussions related to bring the - XFCE environment to FreeBSD. - This is a technical mailing list. It is for individuals - actively working on porting - XFCE to FreeBSD, to bring up - problems or discuss alternative solutions. Individuals - interested in following the technical discussion are - also welcome. - - - - - freebsd-zope - - - Zope - - This is a forum for discussions related to bring the - Zope environment to FreeBSD. - This is a technical mailing list. It is for individuals - actively working on porting - Zope to FreeBSD, to bring up - problems or discuss alternative solutions. Individuals - interested in following the technical discussion are - also welcome. - - - - - - - 郵遞論壇過濾項目 - - The FreeBSD mailing lists are filtered in multiple ways to - avoid the distribution of spam, viruses, and other unwanted - emails. The filtering actions described in this section do - not include all those used to protect the mailing - lists. - - Only certain types of attachments are allowed on the - mailing lists. All attachments with a MIME content type not - found in the list below will be stripped before an email is - distributed on the mailing lists. - - - - application/octet-stream - - - - application/pdf - - - - application/pgp-signature - - - - application/x-pkcs7-signature - - - - message/rfc822 - - - - multipart/alternative - - - - multipart/related - - - - multipart/signed - - - - text/html - - - - text/plain - - - - text/x-diff - - - - text/x-patch - - - - - Some of the mailing lists might allow attachments of - other MIME content types, but the above list should be - applicable for most of the mailing lists. - - - If an email contains both an HTML and a plain text - version, the HTML version will be removed. If an email - contains only an HTML version, it will be converted to plain - text. - - - - - Usenet 新聞群組 - - In addition to two FreeBSD specific newsgroups, there are - many others in which FreeBSD is discussed or are otherwise - relevant to FreeBSD users. - - - BSD 專屬新聞群組 - - - - comp.unix.bsd.freebsd.announce - - - - comp.unix.bsd.freebsd.misc - - - - de.comp.os.unix.bsd - (German) - - - - fr.comp.os.bsd - (French) - - - - - - 其他相關的 <trademark class="registered">UNIX</trademark> 新聞群組 - - - - comp.unix - - - - comp.unix.questions - - - - comp.unix.admin - - - - comp.unix.programmer - - - - comp.unix.shell - - - - comp.unix.misc - - - - comp.unix.bsd - - - - - - X 視窗系統 - - - - comp.windows.x - - - - - - - 官方鏡像站 - - -中央伺服器、亞美尼亞 (Armenia)、澳洲 (Australia)、奧地利 (Austria)、捷克 (Czech Republic)、丹麥 (Denmark)、芬蘭 (Finland)、法國 (France)、德國 (Germany)、香港 (Hong Kong)、愛爾蘭 (Ireland)、日本 (Japan)、拉脫維亞 (Latvia)、立陶宛 (Lithuania)、荷蘭 (Netherlands)、挪威 (Norway)、俄羅斯 (Russia)、斯洛維尼亞 (Slovenia)、南非 (South Africa)、西班牙 (Spain)、瑞典 (Sweden)、瑞士 (Switzerland)、台灣 (Taiwan)、英國 (United Kingdom)、美國 (USA)。 - - - -(as of UTC) - - - - - - - 中央伺服器 - - - https://www.FreeBSD.org/ - - - - - - 亞美尼亞 (Armenia) - - - http://www1.am.FreeBSD.org/ (IPv6) - - - - - - 澳洲 (Australia) - - - - http://www.au.FreeBSD.org/ - - - - - http://www2.au.FreeBSD.org/ - - - - - - - 奧地利 (Austria) - - - http://www.at.FreeBSD.org/ (IPv6) - - - - - - 捷克 (Czech Republic) - - - http://www.cz.FreeBSD.org/ (IPv6) - - - - - - 丹麥 (Denmark) - - - http://www.dk.FreeBSD.org/ (IPv6) - - - - - - 芬蘭 (Finland) - - - - http://www.fi.FreeBSD.org/ - - - - - - - 法國 (France) - - - - http://www1.fr.FreeBSD.org/ - - - - - - - 德國 (Germany) - - - - http://www.de.FreeBSD.org/ - - - - - - - 香港 (Hong Kong) - - - - http://www.hk.FreeBSD.org/ - - - - - - - 愛爾蘭 (Ireland) - - - - http://www.ie.FreeBSD.org/ - - - - - - - 日本 (Japan) - - - http://www.jp.FreeBSD.org/www.FreeBSD.org/ (IPv6) - - - - - - 拉脫維亞 (Latvia) - - - - http://www.lv.FreeBSD.org/ - - - - - - - 立陶宛 (Lithuania) - - - - http://www.lt.FreeBSD.org/ - - - - - - - 荷蘭 (Netherlands) - - - - http://www.nl.FreeBSD.org/ - - - - - - - 挪威 (Norway) - - - - http://www.no.FreeBSD.org/ - - - - - - - 俄羅斯 (Russia) - - - http://www.ru.FreeBSD.org/ (IPv6) - - - - - - 斯洛維尼亞 (Slovenia) - - - - http://www.si.FreeBSD.org/ - - - - - - - 南非 (South Africa) - - - - http://www.za.FreeBSD.org/ - - - - - - - 西班牙 (Spain) - - - - http://www.es.FreeBSD.org/ - - - - - http://www2.es.FreeBSD.org/ - - - - - - - 瑞典 (Sweden) - - - - http://www.se.FreeBSD.org/ - - - - - - - 瑞士 (Switzerland) - - - http://www.ch.FreeBSD.org/ (IPv6) - - - http://www2.ch.FreeBSD.org/ (IPv6) - - - - - - 台灣 (Taiwan) - - - - http://www.tw.FreeBSD.org/ - - - - - http://www2.tw.FreeBSD.org/ - - - - - http://www4.tw.FreeBSD.org/ - - - - http://www5.tw.FreeBSD.org/ (IPv6) - - - - - - 英國 (United Kingdom) - - - - http://www1.uk.FreeBSD.org/ - - - - - http://www3.uk.FreeBSD.org/ - - - - - - - 美國 (USA) - - - http://www5.us.FreeBSD.org/ (IPv6) - - - - - - - - - - - - - Open<acronym>PGP</acronym> 金鑰 - - pgp keys - - The OpenPGP keys of the - FreeBSD.org officers - are shown here. These keys can be used to verify a signature or - send encrypted email to one of the officers. A full list of FreeBSD - OpenPGP keys is available in the - PGP - Keys article. The complete keyring can be downloaded - at https://www.FreeBSD.org/doc/pgpkeyring.txt. - - - 人員 - - - - - Security Officer Team <email>security-officer@FreeBSD.org</email> - - - -sub rsa4096/6DD0A349F26ADEFD 2017-08-16 [E] [expires: 2023-01-02] - -]]> - - - - - - Security Team Secretary <email>secteam-secretary@FreeBSD.org</email> - - - -sub 4096R/509B26612335EB65 2013-09-24 [expires: 2018-01-01] -]]> - - - - - - Core Team Secretary <email>core-secretary@FreeBSD.org</email> - - - -sub rsa2048/133C3338A5B95A60 2018-06-30 [E] [expires: 2020-06-29] - Key fingerprint = FA37 B8AA C667 C3AA D310 751D 133C 3338 A5B9 5A60 - -]]> - - - - - - Ports Management Team Secretary <email>portmgr-secretary@FreeBSD.org</email> - - - -sub rsa2048/5CC117965F65CFE7 2012-07-24 [E] - -]]> - - - - - - <email>doceng-secretary@FreeBSD.org</email> - - - -sub rsa2048/9EA8D713509472FC 2019-10-31 [E] [expires: 2022-10-30] - -]]> - - - - - - - -
- - - - FreeBSD 詞彙表 - This glossary contains terms and acronyms used within the FreeBSD - community and documentation. - - - A - - - ACL - - - - - ACPI - - - - - AMD - - - - - AML - - - - - API - - - - - APIC - - - - - APM - - - - - APOP - - - - - ASL - - - - - ATA - - - - - ATM - - - - - ACPI Machine Language - AML - - Pseudocode, interpreted by a virtual machine within an - ACPI-compliant operating system, providing a - layer between the underlying hardware and the documented - interface presented to the OS. - - - - - ACPI Source Language - ASL - - The programming language AML is written in. - - - - - Access Control List - ACL - - A list of permissions attached to an object, usually either a - file or a network device. - - - - - Advanced Configuration and Power Interface - ACPI - - A specification which provides an abstraction of the - interface the hardware presents to the operating system, so - that the operating system should need to know nothing about - the underlying hardware to make the most of it. ACPI - evolves and supersedes the functionality provided previously by - APM, PNPBIOS and other technologies, and - provides facilities for controlling power consumption, machine - suspension, device enabling and disabling, etc. - - - - - Application Programming Interface - API - - A set of procedures, protocols and tools that specify the - canonical interaction of one or more program parts; how, when - and why they do work together, and what data they share or - operate on. - - - - - Advanced Power Management - APM - - An API enabling the operating system to work - in conjunction with the BIOS in order to achieve - power management. APM has been superseded by - the much more generic and powerful ACPI - specification for most applications. - - - - - Advanced Programmable Interrupt Controller - APIC - - - - - - - Advanced Technology Attachment - ATA - - - - - - - Asynchronous Transfer Mode - ATM - - - - - - - Authenticated Post Office Protocol - APOP - - - - - - - Automatic Mount Daemon - AMD - - A daemon that automatically mounts a filesystem when a file - or directory within that filesystem is accessed. - - - - - - B - - - BAR - - - - - BIND - - - - - BIOS - - - - - BSD - - - - - Base Address Register - BAR - - The registers that determine which address range a PCI device - will respond to. - - - - - Basic Input/Output System - BIOS - - The definition of BIOS depends a bit on - the context. Some people refer to it as the ROM - chip with a basic set of routines to provide an interface between - software and hardware. Others refer to it as the set of routines - contained in the chip that help in bootstrapping the system. Some - might also refer to it as the screen used to configure the - bootstrapping process. The BIOS is PC-specific - but other systems have something similar. - - - - - Berkeley Internet Name Domain - BIND - - An implementation of the DNS protocols. - - - - - Berkeley Software Distribution - BSD - - This is the name that the Computer Systems Research Group - (CSRG) at The University - of California at Berkeley - gave to their improvements and modifications to - AT&T's 32V UNIX. - FreeBSD is a descendant of the CSRG work. - - - - - Bikeshed Building - - A phenomenon whereby many people will give an opinion on - an uncomplicated topic, whilst a complex topic receives little - or no discussion. See the - FAQ for - the origin of the term. - - - - - - C - - - CD - - - - - CHAP - - - - - CLIP - - - - - COFF - - - - - CPU - - - - - CTS - - - - - Carrier Detect - CD - - An RS232C signal indicating that a carrier - has been detected. - - - - - Central Processing Unit - CPU - - Also known as the processor. This is the brain of the - computer where all calculations take place. There are a number of - different architectures with different instruction sets. Among - the more well-known are the Intel-x86 and derivatives, Sun SPARC, - PowerPC, and Alpha. - - - - - Challenge Handshake Authentication Protocol - CHAP - - A method of authenticating a user, based on a secret shared - between client and server. - - - - - Classical IP over ATM - CLIP - - - - - - - Clear To Send - CTS - - An RS232C signal giving the remote system - permission to send data. - - - - - - Common Object File Format - COFF - - - - - - - - D - - - DAC - - - - - DDB - - - - - DES - - - - - DHCP - - - - - DNS - - - - - DSDT - - - - - DSR - - - - - DTR - - - - - DVMRP - - - - - Discretionary Access Control - DAC - - - - - - - Data Encryption Standard - DES - - A method of encrypting information, traditionally used as the - method of encryption for UNIX passwords and the crypt3 - function. - - - - - Data Set Ready - DSR - - An RS232C signal sent from the modem to the - computer or terminal indicating a readiness to send and receive - data. - - - - - - Data Terminal Ready - DTR - - An RS232C signal sent from the computer or - terminal to the modem indicating a readiness to send and receive - data. - - - - - Debugger - DDB - - An interactive in-kernel facility for examining the status of - a system, often used after a system has crashed to establish the - events surrounding the failure. - - - - - Differentiated System Description Table - DSDT - - An ACPI table, supplying basic configuration - information about the base system. - - - - - Distance-Vector Multicast Routing Protocol - DVMRP - - - - - - - Domain Name System - DNS - - The system that converts humanly readable hostnames (i.e., - mail.example.net) to Internet addresses and vice versa. - - - - - Dynamic Host Configuration Protocol - DHCP - - A protocol that dynamically assigns IP addresses to a computer - (host) when it requests one from the server. The address assignment - is called a lease. - - - - - - E - - - ECOFF - - - - - ELF - - - - - ESP - - - - - Encapsulated Security Payload - ESP - - - - - - - Executable and Linking Format - ELF - - - - - - - Extended COFF - ECOFF - - - - - - - - F - - - FADT - - - - - FAT - - - - - FAT16 - - - - - FTP - - - - - File Allocation Table - FAT - - - - - - - File Allocation Table (16-bit) - FAT16 - - - - - - - File Transfer Protocol - FTP - - A member of the family of high-level protocols implemented - on top of TCP which can be used to transfer - files over a TCP/IP network. - - - - - Fixed ACPI Description Table - FADT - - - - - - - - G - - - GUI - - - - - Giant - - The name of a mutual exclusion mechanism - (a sleep mutex) that protects a large - set of kernel resources. Although a simple locking mechanism - was adequate in the days where a machine might have only - a few dozen processes, one networking card, and certainly - only one processor, in current times it is an unacceptable - performance bottleneck. FreeBSD developers are actively working - to replace it with locks that protect individual resources, - which will allow a much greater degree of parallelism for - both single-processor and multi-processor machines. - - - - - Graphical User Interface - GUI - - A system where the user and computer interact with - graphics. - - - - - - H - - - HTML - - - - - HUP - - - - - HangUp - HUP - - - - - - - HyperText Markup Language - HTML - - The markup language used to create web pages. - - - - - - I - - - I/O - - - - - IASL - - - - - IMAP - - - - - IP - - - - - IPFW - - - - - IPP - - - - - IPv4 - - - - - IPv6 - - - - - ISP - - - - - IP Firewall - IPFW - - - - - - - IP Version 4 - IPv4 - - The IP protocol version 4, which uses 32 bits - for addressing. This version is still the most widely used, but it - is slowly being replaced with IPv6. - - - - - - IP Version 6 - IPv6 - - The new IP protocol. Invented because the - address space in IPv4 is running out. Uses 128 - bits for addressing. - - - - - Input/Output - I/O - - - - - - - Intel’s ASL compiler - IASL - - Intel’s compiler for converting ASL into - AML. - - - - - Internet Message Access Protocol - IMAP - - A protocol for accessing email messages on a mail server, - characterised by the messages usually being kept on the server as - opposed to being downloaded to the mail reader client. - - - - - - Internet Printing Protocol - IPP - - - - - - - Internet Protocol - IP - - The packet transmitting protocol that is the basic protocol on - the Internet. Originally developed at the U.S. Department of - Defense and an extremely important part of the TCP/IP - stack. Without the Internet Protocol, the Internet - would not have become what it is today. For more information, see - - RFC 791. - - - - - Internet Service Provider - ISP - - A company that provides access to the Internet. - - - - - - K - - - KAME - - Japanese for turtle, the term KAME is used - in computing circles to refer to the KAME Project, who work on - an implementation of IPv6. - - - - - KDC - - - - - KLD - - - - - KSE - - - - - KVA - - - - - Kbps - - - - - Kernel ld1 - KLD - - A method of dynamically loading functionality into a FreeBSD kernel - without rebooting the system. - - - - - Kernel Scheduler Entities - KSE - - A kernel-supported threading system. See the project home page - for further details. - - - - - Kernel Virtual Address - KVA - - - - - - - Key Distribution Center - KDC - - - - - - - Kilo Bits Per Second - Kbps - - Used to measure bandwidth (how much data can pass a given - point at a specified amount of time). Alternates to the Kilo - prefix include Mega, Giga, Tera, and so forth. - - - - - - L - - - LAN - - - - - LOR - - - - - LPD - - - - - Line Printer Daemon - LPD - - - - - - - Local Area Network - LAN - - A network used on a local area, e.g. office, home, or so forth. - - - - - - Lock Order Reversal - LOR - - The FreeBSD kernel uses a number of resource locks to - arbitrate contention for those resources. A run-time - lock diagnostic system found in FreeBSD-CURRENT kernels - (but removed for releases), called witness4, - detects the potential for deadlocks due to locking errors. - (witness4 is actually slightly conservative, so - it is possible to get false positives.) A true positive - report indicates that if you were unlucky, a deadlock would - have happened here. - - True positive LORs tend to get fixed quickly, so - check http://lists.FreeBSD.org/mailman/listinfo/freebsd-current and the - - LORs Seen page before posting to the mailing lists. - - - - - - M - - - MAC - - - - - MADT - - - - - MFC - - - - - MFH - - - - - MFS - - - - - MIT - - - - - MLS - - - - - MOTD - - - - - MTA - - - - - MUA - - - - - Mail Transfer Agent - MTA - - An application used to transfer email. An - MTA has traditionally been part of the BSD - base system. Today Sendmail is included in the base system, but - there are many other MTAs, such as postfix, - qmail and Exim. - - - - - Mail User Agent - MUA - - An application used by users to display and write email. - - - - - 強制存取控制 (MAC) - MAC - - - - - - - Massachusetts Institute of Technology - MIT - - - - - - - Merge From Current - MFC - - To merge functionality or a patch from the -CURRENT - branch to another, most often -STABLE. - - - - - Merge From Head - MFH - - To merge functionality or a patch from a repository HEAD - to an earlier branch. - - - - - Merge From Stable - MFS - - In the normal course of FreeBSD development, a change will - be committed to the -CURRENT branch for testing before being - merged to -STABLE. On rare occasions, a change will go into - -STABLE first and then be merged to -CURRENT. - - This term is also used when a patch is merged from -STABLE - to a security branch. - - - - - - Message Of The Day - MOTD - - A message, usually shown on login, often used to - distribute information to users of the system. - - - - - Multi-Level Security - MLS - - - - - - - Multiple APIC Description Table - MADT - - - - - - - - N - - - NAT - - - - - NDISulator - - - - - NFS - - - - - NTFS - - - - - NTP - - - - - Network Address Translation - NAT - - A technique where IP packets are rewritten - on the way through a gateway, enabling many machines behind the - gateway to effectively share a single IP address. - - - - - Network File System - NFS - - - - - - - New Technology File System - NTFS - - A filesystem developed by Microsoft and available in its - New Technology operating systems, such as - Windows 2000, Windows NT and Windows XP. - - - - - Network Time Protocol - NTP - - A means of synchronizing clocks over a network. - - - - - - O - - - OBE - - - - - ODMR - - - - - OS - - - - - On-Demand Mail Relay - ODMR - - - - - - - Operating System - OS - - A set of programs, libraries and tools that provide access to - the hardware resources of a computer. Operating systems range - today from simplistic designs that support only one program - running at a time, accessing only one device to fully - multi-user, multi-tasking and multi-process systems that can - serve thousands of users simultaneously, each of them running - dozens of different applications. - - - - - Overtaken By Events - OBE - - Indicates a suggested change (such as a Problem Report - or a feature request) which is no longer relevant or - applicable due to such things as later changes to FreeBSD, - changes in networking standards, the affected hardware - having since become obsolete, and so forth. - - - - - - P - - - PAE - - - - - PAM - - - - - PAP - - - - - PC - - - - - PCNSFD - - - - - PDF - - - - - PID - - - - - POLA - - - - - POP - - - - - POP3 - - - - - PPD - - - - - PPP - - - - - PPPoA - - - - - PPPoE - - - - - PPP over ATM - PPPoA - - - - - - - PPP over Ethernet - PPPoE - - - - - - - PR - - - - - PXE - - - - - Password Authentication Protocol - PAP - - - - - - - Personal Computer - PC - - - - - - - Personal Computer Network File System Daemon - PCNFSD - - - - - - - Physical Address Extensions - PAE - - A method of enabling access to up to 64 GB of RAM on - systems which only physically have a 32-bit wide address space - (and would therefore be limited to 4 GB without PAE). - - - - - Pluggable Authentication Modules - PAM - - - - - - - Point-to-Point Protocol - PPP - - - - - - - Pointy Hat - - A mythical piece of headgear, much like a - dunce cap, awarded to any FreeBSD - committer who breaks the build, makes revision numbers - go backwards, or creates any other kind of havoc in - the source base. Any committer worth his or her salt - will soon accumulate a large collection. The usage is - (almost always?) humorous. - - - - - Portable Document Format - PDF - - - - - - - Post Office Protocol - POP - - - - - - - - Post Office Protocol Version 3 - POP3 - - A protocol for accessing email messages on a mail server, - characterised by the messages usually being downloaded from the - server to the client, as opposed to remaining on the server. - - - - - - PostScript Printer Description - PPD - - - - - - - Preboot eXecution Environment - PXE - - - - - - - Principle Of Least Astonishment - POLA - - As FreeBSD evolves, changes visible to the user should be - kept as unsurprising as possible. For example, arbitrarily - rearranging system startup variables in - /etc/defaults/rc.conf violates - POLA. Developers consider - POLA when contemplating user-visible - system changes. - - - - - Problem Report - PR - - A description of some kind of problem that has been - found in either the FreeBSD source or documentation. See - - Writing FreeBSD Problem Reports. - - - - - Process ID - PID - - A number, unique to a particular process on a system, - which identifies it and allows actions to be taken against it. - - - - - Project Evil - - The working title for the NDISulator, - written by Bill Paul, who named it referring to how awful - it is (from a philosophical standpoint) to need to have - something like this in the first place. The - NDISulator is a special compatibility - module to allow Microsoft Windows™ NDIS miniport - network drivers to be used with FreeBSD/i386. This is usually - the only way to use cards where the driver is closed-source. - See src/sys/compat/ndis/subr_ndis.c. - - - - - - R - - - RA - - - - - RAID - - - - - RAM - - - - - RD - - - - - RFC - - - - - RISC - - - - - RPC - - - - - RS232C - - - - - RTS - - - - - Random Access Memory - RAM - - - - - - - Revision Control System - RCS - - The Revision Control System - (RCS) is one of the oldest software suites - that implement revision control for plain - files. It allows the storage, retrieval, archival, logging, - identification and merging of multiple revisions for each - file. RCS consists of many small tools that work together. - It lacks some of the features found in more modern revision - control systems, like Git, but it is very simple - to install, configure, and start using for a small set of - files. - - - - - - - Received Data - RD - - An RS232C pin or wire that data is - received on. - - - - - - Recommended Standard 232C - RS232C - - A standard for communications between serial devices. - - - - - Reduced Instruction Set Computer - RISC - - An approach to processor design where the operations the hardware - can perform are simplified but made as general purpose as possible. - This can lead to lower power consumption, fewer transistors and in - some cases, better performance and increased code density. Examples - of RISC processors include the Alpha, SPARC, ARM and - PowerPC. - - - - - Redundant Array of Inexpensive Disks - RAID - - - - - - - Remote Procedure Call - RPC - - - - - - - Request For Comments - RFC - - A set of documents defining Internet standards, protocols, and - so forth. See - www.rfc-editor.org. - - - Also used as a general term when someone has a suggested change - and wants feedback. - - - - - Request To Send - RTS - - An RS232C signal requesting that the remote - system commences transmission of data. - - - - - - Router Advertisement - RA - - - - - - - - S - - - SCI - - - - - SCSI - - - - - SG - - - - - SMB - - - - - SMP - - - - - SMTP - - - - - SMTP AUTH - - - - - SSH - - - - - STR - - - - - SVN - - - - - SMTP Authentication - SMTP AUTH - - - - - - - Server Message Block - SMB - - - - - - - Signal Ground - SG - - An RS232 pin or wire that is the ground - reference for the signal. - - - - - Simple Mail Transfer Protocol - SMTP - - - - - - - Secure Shell - SSH - - - - - - - Small Computer System Interface - SCSI - - - - - - - Subversion - SVN - - Subversion is a version control system - currently used by the FreeBSD project. - - - - - Suspend To RAM - STR - - - - - - - Symmetric MultiProcessor - SMP - - - - - - - System Control Interrupt - SCI - - - - - - - - T - - - TCP - - - - - TCP/IP - - - - - TD - - - - - TFTP - - - - - TGT - - - - - TSC - - - - - Ticket-Granting Ticket - TGT - - - - - - - Time Stamp Counter - TSC - - - A profiling counter internal to modern Pentium processors - that counts core frequency clock ticks. - - - - - Transmission Control Protocol - TCP - - A protocol that sits on top of (e.g.) the IP - protocol and guarantees that packets are delivered in a reliable, - ordered, fashion. - - - - - Transmission Control Protocol/Internet Protocol - TCP/IP - - The term for the combination of the TCP - protocol running over the IP protocol. Much of - the Internet runs over TCP/IP. - - - - - Transmitted Data - TD - - An RS232C pin or wire that data is transmitted - on. - - - - - - Trivial FTP - TFTP - - - - - - - - U - - - UDP - - - - - UFS1 - - - - - UFS2 - - - - - UID - - - - - URL - - - - - USB - - - - - Uniform Resource Locator - URL - - A method of locating a resource, such as a document on - the Internet and a means to identify that resource. - - - - - Unix File System Version 1 - UFS1 - - The original UNIX file system, sometimes called the - Berkeley Fast File System. - - - - - Unix File System Version 2 - UFS2 - - An extension to UFS1, introduced in - FreeBSD 5-CURRENT. UFS2 adds 64 bit block - pointers (breaking the 1T barrier), support for extended file - storage and other features. - - - - - Universal Serial Bus - USB - - A hardware standard used to connect a wide variety of - computer peripherals to a universal interface. - - - - - User ID - UID - - A unique number assigned to each user of a computer, - by which the resources and permissions assigned to that - user can be identified. - - - - - User Datagram Protocol - UDP - - A simple, unreliable datagram protocol which is used - for exchanging data on a TCP/IP network. UDP - does not provide error checking and correction like - TCP. - - - - - - V - - - VPN - - - - - Virtual Private Network - VPN - - A method of using a public telecommunication - such as the Internet, to provide remote access to a - localized network, such as a corporate - LAN. - - - - - - - - - - - 本手冊是由數以百計 FreeBSD 文件計劃 的志願工作者所合作而成。 這些文字是由依據 DocBook DTD 規範的 XML 所寫, 並由 XSLT 將 XML 轉換成其他不同格式。 要是沒有 Donald Knuth 的 TeX 排版語言, Leslie Lamport 的 LaTeX 或 Sebastian Rahtz 的 JadeTeX 巨集套件的重要貢獻,本文件的印刷版本將無以完成。 - - -
diff --git a/zh_TW.UTF-8/books/handbook/zh_TW.po b/zh_TW.UTF-8/books/handbook/zh_TW.po deleted file mode 100644 index 5e0dc3c8e6..0000000000 --- a/zh_TW.UTF-8/books/handbook/zh_TW.po +++ /dev/null @@ -1,106292 +0,0 @@ -# $FreeBSD$ -msgid "" -msgstr "" -"Project-Id-Version: \n" -"POT-Creation-Date: 2019-11-15 14:16+0800\n" -"PO-Revision-Date: 2019-11-27 22:49+0800\n" -"Last-Translator: Chien Wei Lin \n" -"Language-Team: \n" -"Language: zh_TW\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"X-Generator: Poedit 2.2.4\n" - -#. Put one translator per line, in the form NAME , YEAR1, YEAR2 -msgctxt "_" -msgid "translator-credits" -msgstr "Chien Wei Lin " - -#. (itstool) path: info/title -#: book.translate.xml:682 -msgid "FreeBSD Handbook" -msgstr "FreeBSD 使用手冊" - -#. (itstool) path: info/author -#: book.translate.xml:684 -msgid "The FreeBSD Documentation Project" -msgstr "FreeBSD 文件計劃" - -#. (itstool) path: info/copyright -#: book.translate.xml:692 -msgid "" -"1995 1996 1997 1998 " -"1999 2000 2001 2002 " -"2003 2004 2005 2006 " -"2007 2008 2009 2010 " -"2011 2012 2013 2014 " -"2015 2016 2017 2018 " -"2019 The FreeBSD Documentation Project" -msgstr "" - -#. (itstool) path: legalnotice/title -#: book.translate.xml:723 -msgid "Copyright" -msgstr "版權" - -#. (itstool) path: legalnotice/para -#: book.translate.xml:725 -msgid "" -"Redistribution and use in source (XML DocBook) and 'compiled' forms (XML, " -"HTML, PDF, PostScript, RTF and so forth) with or without modification, are " -"permitted provided that the following conditions are met:" -msgstr "" - -#. (itstool) path: listitem/para -#: book.translate.xml:732 -msgid "" -"Redistributions of source code (XML DocBook) must retain the above copyright " -"notice, this list of conditions and the following disclaimer as the first " -"lines of this file unmodified." -msgstr "" - -#. (itstool) path: listitem/para -#: book.translate.xml:738 -msgid "" -"Redistributions in compiled form (transformed to other DTDs, converted to " -"PDF, PostScript, RTF and other formats) must reproduce the above copyright " -"notice, this list of conditions and the following disclaimer in the " -"documentation and/or other materials provided with the distribution." -msgstr "" - -#. (itstool) path: important/para -#: book.translate.xml:747 -msgid "" -"THIS DOCUMENTATION IS PROVIDED BY THE FREEBSD DOCUMENTATION PROJECT \"AS IS" -"\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE " -"IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE " -"ARE DISCLAIMED. IN NO EVENT SHALL THE FREEBSD DOCUMENTATION PROJECT BE " -"LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR " -"CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF " -"SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS " -"INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN " -"CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) " -"ARISING IN ANY WAY OUT OF THE USE OF THIS DOCUMENTATION, EVEN IF ADVISED OF " -"THE POSSIBILITY OF SUCH DAMAGE." -msgstr "" - -#. (itstool) path: legalnotice/para -#: book.translate.xml:764 -msgid "FreeBSD is a registered trademark of the FreeBSD Foundation." -msgstr "FreeBSD 是 FreeBSD 基金會的註冊商標。" - -#. (itstool) path: legalnotice/para -#: book.translate.xml:766 -msgid "3Com and HomeConnect are registered trademarks of 3Com Corporation." -msgstr "3Com 和 HomeConnect 是 3Com Corporation 的註冊商標。" - -#. (itstool) path: legalnotice/para -#: book.translate.xml:768 -msgid "3ware is a registered trademark of 3ware Inc." -msgstr "3ware 是 3ware Inc 的註冊商標。" - -#. (itstool) path: legalnotice/para -#: book.translate.xml:770 -msgid "ARM is a registered trademark of ARM Limited." -msgstr "ARM 是 ARM Limited. 的註冊商標。" - -#. (itstool) path: legalnotice/para -#: book.translate.xml:772 -msgid "Adaptec is a registered trademark of Adaptec, Inc." -msgstr "Adaptec 是 Adaptec, Inc. 的註冊商標。" - -#. (itstool) path: legalnotice/para -#: book.translate.xml:774 -msgid "" -"Adobe, Acrobat, Acrobat Reader, Flash and PostScript are either registered " -"trademarks or trademarks of Adobe Systems Incorporated in the United States " -"and/or other countries." -msgstr "" -"Adobe, Acrobat, Acrobat Reader, Flash 以及 PostScript 是 Adobe Systems " -"Incorporated 在美國和/或其他國家的商標或註冊商標。" - -#. (itstool) path: legalnotice/para -#: book.translate.xml:778 -msgid "" -"Apple, AirPort, FireWire, iMac, iPhone, iPad, Mac, Macintosh, Mac OS, " -"Quicktime, and TrueType are trademarks of Apple Inc., registered in the U.S. " -"and other countries." -msgstr "" -"Apple, AirPort, FireWire, iMac, iPhone, iPad, Mac, Macintosh, Mac OS, " -"Quicktime 以及 TrueType 是 Apple Inc. 在美國以及其他國家的註冊商標。" - -#. (itstool) path: legalnotice/para -#: book.translate.xml:783 -msgid "Android is a trademark of Google Inc." -msgstr "Android 是 Google Inc 的商標。" - -#. (itstool) path: legalnotice/para -#: book.translate.xml:785 -msgid "" -"Heidelberg, Helvetica, Palatino, and Times Roman are either registered " -"trademarks or trademarks of Heidelberger Druckmaschinen AG in the U.S. and " -"other countries." -msgstr "" -"Heidelberg, Helvetica, Palatino 以及 Times Roman 是 Heidelberger " -"Druckmaschinen AG 在美國以及其他國家的商標或註冊商標。" - -#. (itstool) path: legalnotice/para -#: book.translate.xml:789 -msgid "" -"IBM, AIX, OS/2, PowerPC, PS/2, S/390, and ThinkPad are trademarks of " -"International Business Machines Corporation in the United States, other " -"countries, or both." -msgstr "" -"IBM, AIX, OS/2, PowerPC, PS/2, S/390 以及 ThinkPad 是 International Business " -"Machines Corporation 在美國和其他國家的商標。" - -#. (itstool) path: legalnotice/para -#: book.translate.xml:793 -msgid "" -"IEEE, POSIX, and 802 are registered trademarks of Institute of Electrical " -"and Electronics Engineers, Inc. in the United States." -msgstr "" -"IEEE, POSIX 以及 802 是 Institute of Electrical and Electronics Engineers, " -"Inc. 在美國的註冊商標。" - -#. (itstool) path: legalnotice/para -#: book.translate.xml:796 -msgid "" -"Intel, Celeron, Centrino, Core, EtherExpress, i386, i486, Itanium, Pentium, " -"and Xeon are trademarks or registered trademarks of Intel Corporation or its " -"subsidiaries in the United States and other countries." -msgstr "" -"Intel, Celeron, Centrino, Core, EtherExpress, i386, i486, Itanium, Pentium 以" -"及 Xeon 是 Intel Corporation 及其分支機構在美國和其他國家的商標或註冊商標。" - -#. (itstool) path: legalnotice/para -#: book.translate.xml:800 -msgid "" -"Intuit and Quicken are registered trademarks and/or registered service marks " -"of Intuit Inc., or one of its subsidiaries, in the United States and other " -"countries." -msgstr "" -"Intuit 和 Quicken 是 Intuit Inc., 或其子公司在美國和其他國家的商標或註冊商" -"標。" - -#. (itstool) path: legalnotice/para -#: book.translate.xml:803 -msgid "Linux is a registered trademark of Linus Torvalds." -msgstr "Linux 是 Linus Torvalds 的註冊商標。" - -#. (itstool) path: legalnotice/para -#: book.translate.xml:805 -msgid "" -"LSI Logic, AcceleRAID, eXtremeRAID, MegaRAID and Mylex are trademarks or " -"registered trademarks of LSI Logic Corp." -msgstr "" -"LSI Logic, AcceleRAID, eXtremeRAID, MegaRAID 以及 Mylex 是 LSI Logic Corp 的" -"商標或註冊商標。" - -#. (itstool) path: legalnotice/para -#: book.translate.xml:808 -msgid "" -"Microsoft, IntelliMouse, MS-DOS, Outlook, Windows, Windows Media and Windows " -"NT are either registered trademarks or trademarks of Microsoft Corporation " -"in the United States and/or other countries." -msgstr "" -"Microsoft, IntelliMouse, MS-DOS, Outlook, Windows, Windows Media 以及 " -"Windows NT 是 Microsoft Corporation 在美國和/或其他國家的商標或註冊商標。" - -#. (itstool) path: legalnotice/para -#: book.translate.xml:812 -msgid "" -"Motif, OSF/1, and UNIX are registered trademarks and IT DialTone and The " -"Open Group are trademarks of The Open Group in the United States and other " -"countries." -msgstr "" -"Motif, OSF/1 以及 UNIX 是 The Open Group 在美國和其他國家的註冊商標; IT " -"DialTone 和 The Open Group 是其商標。" - -#. (itstool) path: legalnotice/para -#: book.translate.xml:816 -msgid "Oracle is a registered trademark of Oracle Corporation." -msgstr "Oracle 是 Oracle Corporation 的註冊商標。" - -#. (itstool) path: legalnotice/para -#: book.translate.xml:818 -msgid "" -"RealNetworks, RealPlayer, and RealAudio are the registered trademarks of " -"RealNetworks, Inc." -msgstr "" -"RealNetworks, RealPlayer, 和 RealAudio 是 RealNetworks, Inc. 的註冊商標。" - -#. (itstool) path: legalnotice/para -#: book.translate.xml:821 -msgid "" -"Red Hat, RPM, are trademarks or registered trademarks of Red Hat, Inc. in " -"the United States and other countries." -msgstr "Red Hat, RPM, 是 Red Hat, Inc. 在美國和其他國家的註冊商標。" - -#. (itstool) path: legalnotice/para -#: book.translate.xml:824 -msgid "" -"Sun, Sun Microsystems, Java, Java Virtual Machine, JDK, JRE, JSP, JVM, " -"Netra, OpenJDK, Solaris, StarOffice, SunOS and VirtualBox are trademarks or " -"registered trademarks of Sun Microsystems, Inc. in the United States and " -"other countries." -msgstr "" -"Sun, Sun Microsystems, Java, Java Virtual Machine, JDK, JRE, JSP, JVM, " -"Netra, OpenJDK, Solaris, StarOffice, SunOS 以及 VirtualBox 是 Sun " -"Microsystems, Inc. 在美國和其他國家的商標或註冊商標。" - -#. (itstool) path: legalnotice/para -#: book.translate.xml:829 -msgid "MATLAB is a registered trademark of The MathWorks, Inc." -msgstr "MATLAB 是 The MathWorks, Inc. 的註冊商標。" - -#. (itstool) path: legalnotice/para -#: book.translate.xml:831 -msgid "SpeedTouch is a trademark of Thomson." -msgstr "SpeedTouch 是 Thomson 的商標。" - -#. (itstool) path: legalnotice/para -#: book.translate.xml:833 -msgid "VMware is a trademark of VMware, Inc." -msgstr "VMware 是 VMware, Inc. 的商標。" - -#. (itstool) path: legalnotice/para -#: book.translate.xml:835 -msgid "Mathematica is a registered trademark of Wolfram Research, Inc." -msgstr "Mathematica 是 Wolfram Research, Inc 的註冊商標。" - -#. (itstool) path: legalnotice/para -#: book.translate.xml:837 -msgid "XFree86 is a trademark of The XFree86 Project, Inc." -msgstr "XFree86 是 The XFree86 Project, Inc 的商標。" - -#. (itstool) path: legalnotice/para -#: book.translate.xml:839 -msgid "Ogg Vorbis and Xiph.Org are trademarks of Xiph.Org." -msgstr "Ogg Vorbis 以及 Xiph.Org 是 Xiph.Org 的商標。" - -#. (itstool) path: legalnotice/para -#: book.translate.xml:841 -msgid "" -"Many of the designations used by manufacturers and sellers to distinguish " -"their products are claimed as trademarks. Where those designations appear in " -"this document, and the FreeBSD Project was aware of the trademark claim, the " -"designations have been followed by the or the ® symbol." -msgstr "" -"許多製造商和經銷商使用一些稱為商標的圖案或文字設計來區別自己的產品。 本文件中" -"出現的眾多商標,以及 FreeBSD Project 本身廣所人知的商標,後面將以 ® 符號來標示。" - -#. (itstool) path: abstract/para -#: book.translate.xml:850 -msgid "" -"Welcome to FreeBSD! This handbook covers the installation and day to day use " -"of FreeBSD 12.0-RELEASE and FreeBSD 11.3-" -"RELEASE. This book is the result of ongoing work by many " -"individuals. Some sections might be outdated. Those interested in helping to " -"update and expand this document should send email to the FreeBSD " -"documentation project mailing list." -msgstr "" -"歡迎使用 FreeBSD! 本使用手冊涵蓋範圍包括了 FreeBSD 12.0-RELEASEFreeBSD 11.3-RELEASE 的安裝與平日操作的說" -"明。 這份使用手冊是很多人的集體創作,而且仍然『持續不斷』的進行中,因此部份章" -"節可能尚未仍未完成,如果您有興趣協助本計畫的話,請寄電子郵件至 FreeBSD 文件專" -"案郵遞論壇。" - -#. (itstool) path: abstract/para -#: book.translate.xml:859 -msgid "" -"The latest version of this book is available from the FreeBSD web site. Previous versions can " -"be obtained from https://" -"docs.FreeBSD.org/doc/. The book can be downloaded in a variety of " -"formats and compression options from the FreeBSD FTP server or one of the numerous " -"mirror sites. Printed copies can be " -"purchased at the FreeBSD " -"Mall. Searches can be performed on the handbook and other documents " -"on the search page." -msgstr "" -"在 FreeBSD 網站 可以找到" -"本手冊的最新版本,舊版文件可從 https://docs.FreeBSD.org/doc/ 取得。本文件也提供各種格式與不同壓" -"縮方式的版本可自 FreeBSD FTP 伺服器 或是其中一個 鏡像" -"網站 下載。 列印出來的實體書面資料可在 FreeBSD 商城 購買。 此外,您可在 搜尋頁面 中搜尋本文件或其他文" -"件的資料。" - -#. (itstool) path: preface/title -#: book.translate.xml:880 -msgid "Preface" -msgstr "序" - -#. (itstool) path: preface/bridgehead -#. (itstool) id: book.translate.xml#preface-audience -#: book.translate.xml:882 -msgid "Intended Audience" -msgstr "給讀者的話" - -#. (itstool) path: preface/para -#: book.translate.xml:885 -msgid "" -"The FreeBSD newcomer will find that the first section of this book guides " -"the user through the FreeBSD installation process and gently introduces the " -"concepts and conventions that underpin UNIX. Working through this section requires little more than the " -"desire to explore, and the ability to take on board new concepts as they are " -"introduced." -msgstr "" -"若您是第一次接觸 FreeBSD 的新手,可以在本書第一部分找到 FreeBSD 的安裝程序," -"同時會逐步介紹 UNIX 的基礎概念與" -"一些常用、共通的東西。而閱讀這部分並不難,只需要您有探索的精神和接受新概念。" - -#. (itstool) path: preface/para -#: book.translate.xml:892 -msgid "" -"Once you have traveled this far, the second, far larger, section of the " -"Handbook is a comprehensive reference to all manner of topics of interest to " -"FreeBSD system administrators. Some of these chapters may recommend that you " -"do some prior reading, and this is noted in the synopsis at the beginning of " -"each chapter." -msgstr "" -"讀完這些之後,手冊中的第二部分花很長篇幅介紹的各種廣泛主題,相當值得系統管理" -"者去注意。 在閱讀這些章節的內容時所需要的背景知識,都註釋在該章的大綱裡面,若" -"不熟的話,可在閱讀前先預習一番。" - -#. (itstool) path: preface/para -#: book.translate.xml:899 -msgid "" -"For a list of additional sources of information, please see ." -msgstr "延伸閱讀方面,可參閱 。" - -#. (itstool) path: preface/bridgehead -#. (itstool) id: book.translate.xml#preface-changes-from3 -#: book.translate.xml:902 -msgid "Changes from the Third Edition" -msgstr "自第三版後的主要修訂" - -#. (itstool) path: preface/para -#: book.translate.xml:905 -msgid "" -"The current online version of the Handbook represents the cumulative effort " -"of many hundreds of contributors over the past 10 years. The following are " -"some of the significant changes since the two volume third edition was " -"published in 2004:" -msgstr "" -"您目前看到的這本手冊代表著上百位貢獻者歷時 10 年所累積的心血之作。以下為自 " -"2014 年發佈的兩冊第三版後所做的主要修訂:" - -#. (itstool) path: listitem/para -#: book.translate.xml:912 -msgid "" -" has been added with information about the " -"powerful DTrace performance analysis tool." -msgstr "" -" 增加說明有關強大的 DTrace 效能分析工具的資訊。" - -#. (itstool) path: listitem/para -#: book.translate.xml:917 -msgid "" -" has been added with information about non-" -"native file systems in FreeBSD, such as ZFS from Sun." -msgstr "" -" 增加有關 FreeBSD 非原生檔案系統的資訊,如:來" -"自 Sun 的 ZSF。" - -#. (itstool) path: listitem/para -#: book.translate.xml:923 -msgid "" -" has been added to cover the new auditing " -"capabilities in FreeBSD and explain its use." -msgstr "" -" 增加的內容涵蓋 FreeBSD 的新稽查功能及其使用說明。" - -#. (itstool) path: listitem/para -#: book.translate.xml:928 -msgid "" -" has been added with information about " -"installing FreeBSD on virtualization software." -msgstr "" -" 增加有關在虛擬化軟體安裝 FreeBSD 的資訊。" - -#. (itstool) path: listitem/para -#: book.translate.xml:934 -msgid "" -" has been added to cover installation of " -"FreeBSD using the new installation utility, bsdinstall." -msgstr "" -" 增加的內容涵蓋使用新安裝工具 " -"bsdinstall 來安裝 FreeBSD。" - -#. (itstool) path: preface/bridgehead -#. (itstool) id: book.translate.xml#preface-changes-from2 -#: book.translate.xml:940 -msgid "Changes from the Second Edition (2004)" -msgstr "自第二版後的主要修訂 (2004)" - -#. (itstool) path: preface/para -#: book.translate.xml:943 -msgid "" -"The third edition was the culmination of over two years of work by the " -"dedicated members of the FreeBSD Documentation Project. The printed edition " -"grew to such a size that it was necessary to publish as two separate " -"volumes. The following are the major changes in this new edition:" -msgstr "" -"您目前看到的這本手冊第三版是 FreeBSD 文件計劃的成員歷時兩年完成的心血之作。因" -"文件內容成長到一定大小,印刷版需要分成兩冊發佈。新版的主要修訂部分如下:" - -#. (itstool) path: listitem/para -#: book.translate.xml:951 -msgid "" -" has been expanded with new information " -"about the ACPI power and resource management, the cron " -"system utility, and more kernel tuning options." -msgstr "" -" 已針對新內容作更新,如:ACPI 電源管理、" -"cron 以及其他更多的核心調校選項說明內容。" - -#. (itstool) path: listitem/para -#: book.translate.xml:958 -msgid "" -" has been expanded with new information about " -"virtual private networks (VPNs), file system access control lists (ACLs), " -"and security advisories." -msgstr "" -" 增加了虛擬私人網路 (VPN)、檔案系統的存取控制 " -"(ACL),以及安全報告。" - -#. (itstool) path: listitem/para -#: book.translate.xml:964 -msgid "" -" is a new chapter with this edition. It explains what " -"MAC is and how this mechanism can be used to secure a FreeBSD system." -msgstr "" -" 是此版本新增的章節。該章介紹:什麼是 MAC 機制?以及如" -"何運用它來使您的 FreeBSD 系統更安全。" - -#. (itstool) path: listitem/para -#: book.translate.xml:970 -msgid "" -" has been expanded with new information about USB " -"storage devices, file system snapshots, file system quotas, file and network " -"backed filesystems, and encrypted disk partitions." -msgstr "" -" 新增了像是:USB 隨身碟、檔案系統快照 (Snapshot)、檔" -"案系統配額 (Quota) 、檔案與網路為基礎的檔案系統、以及如何對硬碟分割區作加密等" -"詳解。" - -#. (itstool) path: listitem/para -#: book.translate.xml:977 -msgid "" -"A troubleshooting section has been added to ." -msgstr " 增加了疑難排解的章節。" - -#. (itstool) path: listitem/para -#: book.translate.xml:981 -msgid "" -" has been expanded with new information about using " -"alternative transport agents, SMTP authentication, UUCP, " -"fetchmail, procmail, " -"and other advanced topics." -msgstr "" -" 新增有關如何使用其它的傳輸代理程式、SMTP 認證、" -"UUCP、fetchmailprocmail 的運用以及其它進階主題。" - -#. (itstool) path: listitem/para -#: book.translate.xml:989 -msgid "" -" is all new with this edition. This " -"chapter includes information about setting up the Apache HTTP " -"Server, ftpd, and setting up a " -"server for Microsoft Windows clients with Samba. Some sections from " -"were moved here to improve the presentation." -msgstr "" -" 是該版中全新的一章。這一章介紹了如何架設 " -"Apache HTTP 伺服器ftpd 以及用於支援 Microsoft Windows 客戶端的 " -"Samba。其中有些段落來自原先的 。" - -#. (itstool) path: listitem/para -#: book.translate.xml:999 -msgid "" -" has been expanded with new " -"information about using Bluetooth devices with FreeBSD, setting up wireless networks, and " -"Asynchronous Transfer Mode (ATM) networking." -msgstr "" -" 新增有關在 FreeBSD 中使用藍牙裝置、設定無線網路以及使用非同步傳輸模" -"式 (Asynchronous Transfer Mode, ATM) 網路的介紹。" - -#. (itstool) path: listitem/para -#: book.translate.xml:1006 -msgid "" -"A glossary has been added to provide a central location for the definitions " -"of technical terms used throughout the book." -msgstr "增加詞彙表,用以說明全書中出現的術語。" - -#. (itstool) path: listitem/para -#: book.translate.xml:1012 -msgid "" -"A number of aesthetic improvements have been made to the tables and figures " -"throughout the book." -msgstr "重新美編書中所列的圖表。" - -#. (itstool) path: preface/bridgehead -#. (itstool) id: book.translate.xml#preface-changes -#: book.translate.xml:1017 -msgid "Changes from the First Edition (2001)" -msgstr "自第一版後的主要修訂 (2001)" - -#. (itstool) path: preface/para -#: book.translate.xml:1020 -msgid "" -"The second edition was the culmination of over two years of work by the " -"dedicated members of the FreeBSD Documentation Project. The following were " -"the major changes in this edition:" -msgstr "" -"本手冊的第二版是 FreeBSD 文件計劃的成員歷時兩年完成的心血之作。第二版包的主要" -"變動如下:" - -#. (itstool) path: listitem/para -#: book.translate.xml:1028 -msgid "A complete Index has been added." -msgstr "增加完整的目錄索引。" - -#. (itstool) path: listitem/para -#: book.translate.xml:1032 -msgid "All ASCII figures have been replaced by graphical diagrams." -msgstr "所有的 ASCII 圖表均改成圖檔格式的圖表。" - -#. (itstool) path: listitem/para -#: book.translate.xml:1037 -msgid "" -"A standard synopsis has been added to each chapter to give a quick summary " -"of what information the chapter contains, and what the reader is expected to " -"know." -msgstr "每個章節均加入概述,以便快速的瀏覽該章節內容摘要、讀者所欲了解的部分。" - -#. (itstool) path: listitem/para -#: book.translate.xml:1043 -msgid "" -"The content has been logically reorganized into three parts: Getting " -"Started, System Administration, and " -"Appendices." -msgstr "" -"內容架構重新組織成三大部分:入門系統管理 以" -"及 附錄。" - -#. (itstool) path: listitem/para -#: book.translate.xml:1050 -msgid "" -" has been expanded to contain additional " -"information about processes, daemons, and signals." -msgstr "" -" 新增了程序、Daemon 以及信號 (Signal) 的介紹。" - -#. (itstool) path: listitem/para -#: book.translate.xml:1056 -msgid "" -" has been expanded to contain additional " -"information about binary package management." -msgstr " 新增了介紹如何管理 Binary 套件的資訊。" - -#. (itstool) path: listitem/para -#: book.translate.xml:1062 -msgid "" -" has been completely rewritten with an emphasis on " -"using modern desktop technologies such as KDE and " -"GNOME on XFree86 4.X." -msgstr "" -" 經過全面改寫,著重於在 XFree86 4.X 上的現代桌面技術,如: KDE 和 " -"GNOME。" - -#. (itstool) path: listitem/para -#: book.translate.xml:1069 -msgid " has been expanded." -msgstr " 更新相關內容。" - -#. (itstool) path: listitem/para -#: book.translate.xml:1073 -msgid "" -" has been written from what used to be two separate " -"chapters on Disks and Backups. We feel that " -"the topics are easier to comprehend when presented as a single chapter. A " -"section on RAID (both hardware and software) has also been added." -msgstr "" -" 分別以兩個章節 磁碟備份 來撰寫。我們認為這樣子會比單一章節來得容易瞭解。還有關於 RAID (包含硬" -"體、軟體 RAID) 的段落也新增上去了。" - -#. (itstool) path: listitem/para -#: book.translate.xml:1082 -msgid "" -" has been completely reorganized and updated " -"for FreeBSD 4.X/5.X." -msgstr "" -" 架構重新改寫,並更新至 FreeBSD 4.X/5.X 的內" -"容。" - -#. (itstool) path: listitem/para -#: book.translate.xml:1087 -msgid " has been substantially updated." -msgstr " 有相當程度的更新。" - -#. (itstool) path: listitem/para -#: book.translate.xml:1092 -msgid "" -"Many new sections have been added to ." -msgstr " 加入許多新內容。" - -#. (itstool) path: listitem/para -#: book.translate.xml:1096 -msgid "" -" has been expanded to include more information about " -"configuring sendmail." -msgstr "" -" 大量新增了設定 sendmail " -"的介紹。" - -#. (itstool) path: listitem/para -#: book.translate.xml:1102 -msgid "" -" has been expanded to include information about " -"installing Oracle and SAP R/3." -msgstr "" -" 增加許多有關安裝 Oracle 以及 SAP R/3 的介紹。" - -#. (itstool) path: listitem/para -#: book.translate.xml:1109 -msgid "The following new topics are covered in this second edition:" -msgstr "此外,第二版還新加章節,以介紹下列新主題:" - -#. (itstool) path: listitem/para -#: book.translate.xml:1114 -msgid "." -msgstr "。" - -#. (itstool) path: listitem/para -#: book.translate.xml:1118 -msgid "." -msgstr "。" - -#. (itstool) path: preface/bridgehead -#. (itstool) id: book.translate.xml#preface-overview -#: book.translate.xml:1124 -msgid "Organization of This Book" -msgstr "本書架構" - -#. (itstool) path: preface/para -#: book.translate.xml:1126 -msgid "" -"This book is split into five logically distinct sections. The first section, " -"Getting Started, covers the installation and basic " -"usage of FreeBSD. It is expected that the reader will follow these chapters " -"in sequence, possibly skipping chapters covering familiar topics. The second " -"section, Common Tasks, covers some frequently used " -"features of FreeBSD. This section, and all subsequent sections, can be read " -"out of order. Each chapter begins with a succinct synopsis that describes " -"what the chapter covers and what the reader is expected to already know. " -"This is meant to allow the casual reader to skip around to find chapters of " -"interest. The third section, System Administration, " -"covers administration topics. The fourth section, Network " -"Communication, covers networking and server topics. The fifth " -"section contains appendices of reference information." -msgstr "" -"本書主要分為五大部分,第一部份入門:介紹 FreeBSD 的安" -"裝、基本操作。 讀者可根據自己的程度,循序或者跳過一些熟悉的主題來閱讀; 第二" -"部分一般作業:介紹 FreeBSD 常用功能,這部分可以不按順序" -"來讀。 每章前面都會有概述,概述會描述本章節涵蓋的內容和讀者應該已知的, 這主" -"要是讓讀者可以挑喜歡的章節閱讀; 第三部分系統管理:介紹 " -"FreeBSD 老手所感興趣的各種主題部分; 第四部分網路通訊:" -"則包括網路和各式伺服器主題;而第五部分則為附錄包含各種有關 FreeBSD 的資源。" - -#. (itstool) path: listitem/para -#: book.translate.xml:1151 -msgid "" -"Introduces FreeBSD to a new user. It describes the history of the FreeBSD " -"Project, its goals and development model." -msgstr "向新手介紹 FreeBSD。該篇說明了 FreeBSD 計劃的歷史、目標和開發模式。" - -#. (itstool) path: listitem/para -#: book.translate.xml:1161 -msgid "" -"Walks a user through the entire installation process of FreeBSD 9." -"x and later using bsdinstall." -msgstr "" -"帶領使用者走一次使用 bsdinstall 在 FreeBSD 9." -"x 及之後版本的完整安裝流程。" - -#. (itstool) path: listitem/para -#: book.translate.xml:1171 -msgid "" -"Covers the basic commands and functionality of the FreeBSD operating system. " -"If you are familiar with Linux " -"or another flavor of UNIX then " -"you can probably skip this chapter." -msgstr "" -"涵蓋 FreeBSD 作業系統的基礎指令及功能。若您熟悉 Linux 或其他類 UNIX® 系統,您則可跳過此章。" - -#. (itstool) path: listitem/para -#: book.translate.xml:1182 -msgid "" -"Covers the installation of third-party software with both FreeBSD's " -"innovative Ports Collection and standard binary packages." -msgstr "" -"涵蓋如何使用 FreeBSD 獨創的 Port 套件集 與標準 Binary 套件安裝" -"第三方軟體。" - -#. (itstool) path: listitem/para -#: book.translate.xml:1192 -msgid "" -"Describes the X Window System in general and using X11 on FreeBSD in " -"particular. Also describes common desktop environments such as " -"KDE and GNOME." -msgstr "" -"介紹 X Windows 系統概要及在 FreeBSD 上使用 X11,同時也會介紹常用的桌面環境如 " -"KDEGNOME。" - -#. (itstool) path: listitem/para -#: book.translate.xml:1205 -msgid "" -"Lists some common desktop applications, such as web browsers and " -"productivity suites, and describes how to install them on FreeBSD." -msgstr "" -"列出一些常用的桌面應用程式,例如:網頁瀏覽器、辦工工具並介紹如何安裝這些應用" -"程式到 FreeBSD。" - -#. (itstool) path: listitem/para -#: book.translate.xml:1214 -msgid "" -"Shows how to set up sound and video playback support for your system. Also " -"describes some sample audio and video applications." -msgstr "" -"示範如何在您的系統設定音效及影像播放支援,同時會介紹幾個代表性的音訊及視訊應" -"用程式。" - -#. (itstool) path: listitem/para -#: book.translate.xml:1224 -msgid "" -"Explains why you might need to configure a new kernel and provides detailed " -"instructions for configuring, building, and installing a custom kernel." -msgstr "說明為何需要設定新的核心並會提供設定、編譯與安裝的詳細操作說明。" - -#. (itstool) path: listitem/para -#: book.translate.xml:1234 -msgid "" -"Describes managing printers on FreeBSD, including information about banner " -"pages, printer accounting, and initial setup." -msgstr "" -"介紹如何在 FreeBSD 管理印表機,包含橫幅頁面、列印帳務以及初始設定等資訊。" - -#. (itstool) path: listitem/para -#: book.translate.xml:1244 -msgid "" -"Describes the Linux " -"compatibility features of FreeBSD. Also provides detailed installation " -"instructions for many popular Linux applications such as Oracle and Mathematica." -msgstr "" -"介紹 FreeBSD 的 Linux 相容性功" -"能,同時提供許多熱門的 Linux 應用" -"程式詳細的安裝操作說明,例如 OracleMathematica。" - -#. (itstool) path: listitem/para -#: book.translate.xml:1258 -msgid "" -"Describes the parameters available for system administrators to tune a " -"FreeBSD system for optimum performance. Also describes the various " -"configuration files used in FreeBSD and where to find them." -msgstr "" -"介紹可供系統管理者用來調校 FreeBSD 系統的可用參數來最佳化效率,同時也介紹 " -"FreeBSD 用到的各種設定檔以及到何處尋找這些設定檔。" - -#. (itstool) path: listitem/para -#: book.translate.xml:1269 -msgid "" -"Describes the FreeBSD boot process and explains how to control this process " -"with configuration options." -msgstr "介紹 FreeBSD 開機流程並說明如何使用設定選項控制開機流程。" - -#. (itstool) path: listitem/para -#: book.translate.xml:1278 -msgid "" -"Describes many different tools available to help keep your FreeBSD system " -"secure, including Kerberos, IPsec and OpenSSH." -msgstr "" -"介紹許多可讓您的 FreeBSD 系統更安全的各種工具,包含 Kerberos, IPsec 及 " -"OpenSSH。" - -#. (itstool) path: listitem/para -#: book.translate.xml:1288 -msgid "" -"Describes the jails framework, and the improvements of jails over the " -"traditional chroot support of FreeBSD." -msgstr "" -"介紹 Jail Framework,以及 Jail 改進那些 FreeBSD 傳統 chroot 不足的地方。" - -#. (itstool) path: listitem/para -#: book.translate.xml:1297 -msgid "" -"Explains what Mandatory Access Control (MAC) is and how this mechanism can " -"be used to secure a FreeBSD system." -msgstr "" -"說明什麼是強制存取控制 (Mandatory Access Control, MAC) 及這個機制如何用來確" -"保 FreeBSD 系統的安全。" - -#. (itstool) path: listitem/para -#: book.translate.xml:1307 -msgid "" -"Describes what FreeBSD Event Auditing is, how it can be installed, " -"configured, and how audit trails can be inspected or monitored." -msgstr "" -"介紹什麼事 FreeBSD 事件稽查,如何安裝與設定,以及如何檢查與監控稽查線索。" - -#. (itstool) path: listitem/para -#: book.translate.xml:1317 -msgid "" -"Describes how to manage storage media and filesystems with FreeBSD. This " -"includes physical disks, RAID arrays, optical and tape media, memory-backed " -"disks, and network filesystems." -msgstr "" -"介紹如何在 FreeBSD 管理儲存媒體及檔案系統,這包含了實體磁碟、RAID 陣列、光碟" -"與磁帶媒體、記憶體為基礎的磁碟以及網路檔案系統。" - -#. (itstool) path: listitem/para -#: book.translate.xml:1328 -msgid "" -"Describes what the GEOM framework in FreeBSD is and how to configure various " -"supported RAID levels." -msgstr "" -"介紹在 FreeBSD 中的 GEOM Framework 是什麼,以及如何設定各種支援的 RAID 階層。" - -#. (itstool) path: listitem/para -#: book.translate.xml:1337 -msgid "" -"Examines support of non-native file systems in FreeBSD, like the Z File " -"System from Sun." -msgstr "" -"查看 FreeBSD 還支援那些非原生檔案系統,如 Sun 的 Z 檔" -"案系統。" - -#. (itstool) path: listitem/para -#: book.translate.xml:1346 -msgid "" -"Describes what virtualization systems offer, and how they can be used with " -"FreeBSD." -msgstr "介紹虛擬化系統提供了那些功能,以及如何在 FreeBSD 上使用。" - -#. (itstool) path: listitem/para -#: book.translate.xml:1355 -msgid "" -"Describes how to use FreeBSD in languages other than English. Covers both " -"system and application level localization." -msgstr "介紹如何在 FreeBSD 使用非英文的語言,這涵蓋了系統及應用層的在地化。" - -#. (itstool) path: listitem/para -#: book.translate.xml:1365 -msgid "" -"Explains the differences between FreeBSD-STABLE, FreeBSD-CURRENT, and " -"FreeBSD releases. Describes which users would benefit from tracking a " -"development system and outlines that process. Covers the methods users may " -"take to update their system to the latest security release." -msgstr "" -"說明 FreeBSD-STABLE、FreeBSD-CURRENT 以及 FreeBSD 發佈版之間的差異,並介紹那" -"些使用者適何追蹤開發系統以及程序的概述,這涵蓋了使用者更新系統到最新安全性發" -"佈版本的方法。" - -#. (itstool) path: listitem/para -#: book.translate.xml:1378 -msgid "" -"Describes how to configure and use the DTrace tool from Sun in FreeBSD. Dynamic tracing can help locate performance issues, " -"by performing real time system analysis." -msgstr "" -"介紹如何在 FreeBSD 設定及使用 Sun 的 DTrace 工具,動態" -"追蹤可以透過執行真實時間系統分析來協助定位效能問題。" - -#. (itstool) path: listitem/para -#: book.translate.xml:1391 -msgid "" -"Explains how to connect terminals and modems to your FreeBSD system for both " -"dial in and dial out connections." -msgstr "介紹如何使用撥入及撥出連線到您的 FreeBSD 系統的終端機與數據機。" - -#. (itstool) path: listitem/para -#: book.translate.xml:1401 -msgid "Describes how to use PPP to connect to remote systems with FreeBSD." -msgstr "介紹如何在 FreeBSD 使用 PPP 來連線遠端的系統。" - -#. (itstool) path: listitem/para -#: book.translate.xml:1410 -msgid "" -"Explains the different components of an email server and dives into simple " -"configuration topics for the most popular mail server software: " -"sendmail." -msgstr "" -"說明組成電子郵件伺服器的各種元件,並深入說明如何設定最熱門的郵件伺服器軟體:" -"sendmail。" - -#. (itstool) path: listitem/para -#: book.translate.xml:1421 -msgid "" -"Provides detailed instructions and example configuration files to set up " -"your FreeBSD machine as a network filesystem server, domain name server, " -"network information system server, or time synchronization server." -msgstr "" -"提供詳細的操作說明與範例設定檔,讓您可安裝您的 FreeBSD 機器為網路檔案伺服器、" -"網域名稱伺服器、網路資訊系統伺服器或時間同步伺服器。" - -#. (itstool) path: listitem/para -#: book.translate.xml:1432 -msgid "" -"Explains the philosophy behind software-based firewalls and provides " -"detailed information about the configuration of the different firewalls " -"available for FreeBSD." -msgstr "" -"說明軟體為基礎的防火牆背後的理念,並提供可用於 FreeBSD 中不同的防火牆設定的詳" -"細資訊。" - -#. (itstool) path: listitem/para -#: book.translate.xml:1442 -msgid "" -"Describes many networking topics, including sharing an Internet connection " -"with other computers on your LAN, advanced routing topics, wireless " -"networking, Bluetooth, ATM, " -"IPv6, and much more." -msgstr "" -"介紹許多網路主題,包含在您的區域網路 (LAN) 分享網際網路連線給其他電腦、進階路" -"由主題、無線網路、Bluetooth、" -"ATM、IPv6 以及更多相關主題。" - -#. (itstool) path: listitem/para -#: book.translate.xml:1455 -msgid "" -"Lists different sources for obtaining FreeBSD media on CDROM or DVD as well " -"as different sites on the Internet that allow you to download and install " -"FreeBSD." -msgstr "" -"列出取得 FreeBSD CDROM 或 DVD 媒體的各種來源,以及在網際網路上的各種網站,讓" -"您可以下載並安裝 FreeBSD。" - -#. (itstool) path: listitem/para -#: book.translate.xml:1465 -msgid "" -"This book touches on many different subjects that may leave you hungry for a " -"more detailed explanation. The bibliography lists many excellent books that " -"are referenced in the text." -msgstr "" -"本書觸及許多不同主題,可能會讓您想更深入的了解,參考書目列出了在文中引用的許" -"多優秀書籍。" - -#. (itstool) path: listitem/para -#: book.translate.xml:1476 -msgid "" -"Describes the many forums available for FreeBSD users to post questions and " -"engage in technical conversations about FreeBSD." -msgstr "" -"介紹了可讓 FreeBSD 使用者提出問題以及參與有關 FreeBSD 技術會談的許多論壇。" - -#. (itstool) path: listitem/para -#: book.translate.xml:1486 -msgid "Lists the PGP fingerprints of several FreeBSD Developers." -msgstr "列出了數個 FreeBSD 開發人員的 PGP 指紋。" - -#. (itstool) path: preface/bridgehead -#. (itstool) id: book.translate.xml#preface-conv -#: book.translate.xml:1492 -msgid "Conventions used in this book" -msgstr "本書的編排體裁" - -#. (itstool) path: preface/para -#: book.translate.xml:1495 -msgid "" -"To provide a consistent and easy to read text, several conventions are " -"followed throughout the book." -msgstr "為了提供有一致性且易於閱讀的內容,以下是一些本書所遵循的編排體裁。" - -#. (itstool) path: preface/bridgehead -#. (itstool) id: book.translate.xml#preface-conv-typographic -#: book.translate.xml:1498 -msgid "Typographic Conventions" -msgstr "文字編排體裁" - -#. (itstool) path: varlistentry/term -#: book.translate.xml:1502 -msgid "Italic" -msgstr "斜體字" - -#. (itstool) path: listitem/para -#: book.translate.xml:1505 -msgid "" -"An italic font is used for filenames, URLs, emphasized " -"text, and the first usage of technical terms." -msgstr "" -"斜體字用於:檔名、目錄、網址 (URL)、 強調語氣、以及第一" -"次提及的技術詞彙。" - -#. (itstool) path: varlistentry/term -#: book.translate.xml:1512 -msgid "Monospace" -msgstr "等寬字" - -#. (itstool) path: listitem/para -#: book.translate.xml:1515 -msgid "" -"A monospaced font is used for error messages, commands, " -"environment variables, names of ports, hostnames, user names, group names, " -"device names, variables, and code fragments." -msgstr "" -"等寬字用於: 錯誤訊息、指令、環境變數、Port 名稱、主機名" -"稱、帳號、群組、裝置名稱、變數、程式碼等。" - -#. (itstool) path: varlistentry/term -#: book.translate.xml:1523 -msgid "Bold" -msgstr "粗體字" - -#. (itstool) path: listitem/para -#: book.translate.xml:1526 -msgid "" -"A bold font is used for applications, commands, and keys." -msgstr "以粗體字表示:應用程式、指令、按鍵。" - -#. (itstool) path: preface/bridgehead -#. (itstool) id: book.translate.xml#preface-conv-commands -#: book.translate.xml:1533 -msgid "User Input" -msgstr "使用者輸入" - -#. (itstool) path: preface/para -#: book.translate.xml:1536 -msgid "" -"Keys are shown in bold to stand out from other text. Key " -"combinations that are meant to be typed simultaneously are shown with " -"`+' between the keys, such as:" -msgstr "" -"鍵盤輸入以粗體字表示,以便與一般文字做區隔。 組合鍵是指同時" -"按下一些按鍵,我們以 `+' 來表示連接,像是:" - -#. (itstool) path: preface/para -#: book.translate.xml:1541 -msgid "" -" Ctrl Alt " -"Del" -msgstr "" - -#. (itstool) path: preface/para -#: book.translate.xml:1547 -msgid "" -"Meaning the user should type the Ctrl, Alt, and Del keys at the same time." -msgstr "" -"是說,一起按 CtrlAlt 以及 Del 鍵。" - -#. (itstool) path: preface/para -#: book.translate.xml:1551 -msgid "" -"Keys that are meant to be typed in sequence will be separated with commas, " -"for example:" -msgstr "若要逐一按鍵,那麼會以逗號 (,) 來表示,像是:" - -#. (itstool) path: preface/para -#: book.translate.xml:1554 -msgid "" -" Ctrl X , Ctrl S" -msgstr "" - -#. (itstool) path: preface/para -#: book.translate.xml:1563 -msgid "" -"Would mean that the user is expected to type the Ctrl and " -"X keys simultaneously and then to type the Ctrl and S keys simultaneously." -msgstr "" -"是說:先同時按下 CtrlX 鍵, 然後放開後" -"再同時按 CtrlS 鍵。" - -#. (itstool) path: preface/bridgehead -#. (itstool) id: book.translate.xml#preface-conv-examples -#: book.translate.xml:1569 -msgid "Examples" -msgstr "範例" - -#. (itstool) path: preface/para -#: book.translate.xml:1571 -msgid "" -"Examples starting with C:\\> indicate a MS-DOS command. Unless otherwise noted, " -"these commands may be executed from a Command Prompt window " -"in a modern Microsoft Windows environment." -msgstr "" -"範例以 C:\\> 為開頭代表 MS-DOS 的指令。 若沒有特殊情況的話,這些指令應該是" -"在 Microsoft Windows 環境的 指令提示字元 (Command " -"Prompt) 視窗內執行。" - -#. (itstool) path: preface/screen -#: book.translate.xml:1577 -#, no-wrap -msgid "E:\\> tools\\fdimage floppies\\kern.flp A:" -msgstr "" - -#. (itstool) path: preface/para -#: book.translate.xml:1579 -msgid "" -"Examples starting with # indicate a command that must be " -"invoked as the superuser in FreeBSD. You can login as root to type the command, or login as your normal " -"account and use su1 to gain superuser privileges." -msgstr "" -"範例以 # 為開頭代表在 FreeBSD 中以超級使用者權限來執行的指" -"令。 你可以先以 root 登入系統並下" -"指令,或是以你自己的帳號登入再使用 su1 來取得超級使用者權限。" - -#. (itstool) path: preface/screen -#: book.translate.xml:1585 -#, no-wrap -msgid "# dd if=kern.flp of=/dev/fd0" -msgstr "" - -#. (itstool) path: preface/para -#: book.translate.xml:1587 -msgid "" -"Examples starting with % indicate a command that should be " -"invoked from a normal user account. Unless otherwise noted, C-shell syntax " -"is used for setting environment variables and other shell commands." -msgstr "" -"範例以 % 為開頭代表在 FreeBSD 中以一般使用者帳號執行的指" -"令。 除非有提到其他用法,否則都是預設為 C-shell 語法,用來設定環境變數以及下" -"其他指令的意思。" - -#. (itstool) path: preface/screen -#: book.translate.xml:1592 -#, no-wrap -msgid "% top" -msgstr "" - -#. (itstool) path: preface/bridgehead -#. (itstool) id: book.translate.xml#preface-acknowledgements -#: book.translate.xml:1594 -msgid "Acknowledgments" -msgstr "銘謝" - -#. (itstool) path: preface/para -#: book.translate.xml:1596 -msgid "" -"The book you are holding represents the efforts of many hundreds of people " -"around the world. Whether they sent in fixes for typos, or submitted " -"complete chapters, all the contributions have been useful." -msgstr "" -"您所看到的這本書是經過數百個分散在世界各地的人所努力而來的結果。 無論他們只是" -"糾正一些錯誤或提交完整的章節,所有的點滴貢獻都是非常寶貴有用的。" - -#. (itstool) path: preface/para -#: book.translate.xml:1601 -msgid "" -"Several companies have supported the development of this document by paying " -"authors to work on it full-time, paying for publication, etc. In particular, " -"BSDi (subsequently acquired by Wind River Systems) paid members of the FreeBSD Documentation " -"Project to work on improving this book full time leading up to the " -"publication of the first printed edition in March 2000 (ISBN 1-57176-241-8). " -"Wind River Systems then paid several additional authors to make a number of " -"improvements to the print-output infrastructure and to add additional " -"chapters to the text. This work culminated in the publication of the second " -"printed edition in November 2001 (ISBN 1-57176-303-1). In 2003-2004, FreeBSD Mall, Inc, paid " -"several contributors to improve the Handbook in preparation for the third " -"printed edition." -msgstr "" -"也有一些公司透過提供資金讓作者專注於撰稿、提供出版資金等模式來支持文件的寫" -"作。 其中,BSDi (之後併入 Wind " -"River Systems) 資助 FreeBSD 文件計劃成員來專職改善這本書直到 2000 年 " -"3 月第一版的出版。(ISBN 1-57176-241-8) Wind River Systems 同時資助其他作者來" -"對輸出架構做很多改進,以及給文章增加一些附加章節。這項工作結束於 2001 年 11 " -"月第二版。(ISBN 1-57176-303-1) 在 2003-2004 兩年中,FreeBSD Mall, Inc 把報酬支付給改進這本" -"手冊以使第三版印刷版本能夠出版的志工。" - -#. (itstool) path: part/title -#: book.translate.xml:1620 -msgid "Getting Started" -msgstr "入門" - -#. (itstool) path: partintro/para -#: book.translate.xml:1623 -msgid "" -"This part of the handbook is for users and administrators who are new to " -"FreeBSD. These chapters:" -msgstr "這部份是提供給初次使用 FreeBSD 的使用者和系統管理者。 這些章節包括:" - -#. (itstool) path: listitem/para -#: book.translate.xml:1628 -msgid "Introduce FreeBSD." -msgstr "介紹 FreeBSD 給您。" - -#. (itstool) path: listitem/para -#: book.translate.xml:1632 -msgid "Guide readers through the installation process." -msgstr "在安裝過程給您指引。" - -#. (itstool) path: listitem/para -#: book.translate.xml:1636 -msgid "" -"Teach UNIX basics and " -"fundamentals." -msgstr "教您 UNIX 的基礎及原理。" - -#. (itstool) path: listitem/para -#: book.translate.xml:1640 -msgid "" -"Show how to install the wealth of third party applications available for " -"FreeBSD." -msgstr "展示給您看如何安裝豐富的 FreeBSD 的應用軟體。" - -#. (itstool) path: listitem/para -#: book.translate.xml:1645 -msgid "" -"Introduce X, the UNIX windowing " -"system, and detail how to configure a desktop environment that makes users " -"more productive." -msgstr "" -"向您介紹 X,UNIX 的視窗系統以及詳" -"細的桌面環境設定,讓您更有生產力。" - -#. (itstool) path: partintro/para -#: book.translate.xml:1651 -msgid "" -"The number of forward references in the text have been kept to a minimum so " -"that this section can be read from front to back with minimal page flipping." -msgstr "" -"我們試著儘可能的讓這段文字的參考連結數目降到最低,讓您在讀使用手冊的這部份時" -"可以不太需要常常前後翻頁。" - -#. (itstool) path: info/title -#. (itstool) path: sect1/title -#. (itstool) path: sect2/title -#: book.translate.xml:1665 book.translate.xml:23731 book.translate.xml:65535 -msgid "Introduction" -msgstr "簡介" - -#. (itstool) path: authorgroup/author -#: book.translate.xml:1668 book.translate.xml:2774 -msgid "" -" Jim Mock Restructured, reorganized, and parts rewritten by " -msgstr "" - -#. (itstool) path: sect1/title -#: book.translate.xml:1680 book.translate.xml:2829 book.translate.xml:5454 -#: book.translate.xml:8842 book.translate.xml:10621 book.translate.xml:12851 -#: book.translate.xml:13841 book.translate.xml:15509 book.translate.xml:17991 -#: book.translate.xml:19255 book.translate.xml:22733 book.translate.xml:23643 -#: book.translate.xml:27738 book.translate.xml:29352 book.translate.xml:31120 -#: book.translate.xml:31854 book.translate.xml:35518 book.translate.xml:41475 -#: book.translate.xml:41680 book.translate.xml:43489 book.translate.xml:44537 -#: book.translate.xml:46182 book.translate.xml:46526 book.translate.xml:46941 -#: book.translate.xml:49135 book.translate.xml:50803 book.translate.xml:52716 -#: book.translate.xml:57502 book.translate.xml:61692 -msgid "Synopsis" -msgstr "概述" - -#. (itstool) path: sect1/para -#: book.translate.xml:1682 -msgid "" -"Thank you for your interest in FreeBSD! The following chapter covers various " -"aspects of the FreeBSD Project, such as its history, goals, development " -"model, and so on." -msgstr "" -"非常感謝您對 FreeBSD 感興趣!以下章節涵蓋 FreeBSD 計劃的各方面:比如它的歷" -"史、目標、開發模式等等。" - -#. (itstool) path: sect1/para -#: book.translate.xml:1686 book.translate.xml:2898 book.translate.xml:5461 -#: book.translate.xml:8854 book.translate.xml:10642 book.translate.xml:15522 -#: book.translate.xml:18017 book.translate.xml:19269 book.translate.xml:23656 -#: book.translate.xml:27810 book.translate.xml:29379 book.translate.xml:31144 -#: book.translate.xml:31862 book.translate.xml:35544 book.translate.xml:41506 -#: book.translate.xml:41688 book.translate.xml:44549 book.translate.xml:46220 -#: book.translate.xml:46595 book.translate.xml:46952 book.translate.xml:49146 -#: book.translate.xml:50814 book.translate.xml:57557 book.translate.xml:61697 -msgid "After reading this chapter, you will know:" -msgstr "讀完這章,您將了解:" - -#. (itstool) path: listitem/para -#: book.translate.xml:1690 -msgid "How FreeBSD relates to other computer operating systems." -msgstr "FreeBSD 與其他作業系統之間的關係。" - -#. (itstool) path: listitem/para -#: book.translate.xml:1695 -msgid "The history of the FreeBSD Project." -msgstr "FreeBSD 計劃的歷史。" - -#. (itstool) path: listitem/para -#: book.translate.xml:1699 -msgid "The goals of the FreeBSD Project." -msgstr "FreeBSD 計劃的目標。" - -#. (itstool) path: listitem/para -#: book.translate.xml:1703 -msgid "The basics of the FreeBSD open-source development model." -msgstr "FreeBSD 開源開發模式的基礎概念。" - -#. (itstool) path: listitem/para -#: book.translate.xml:1708 -msgid "And of course: where the name FreeBSD comes from." -msgstr "當然囉,還有 FreeBSD 這名字的由來。" - -#. (itstool) path: sect1/title -#: book.translate.xml:1715 -msgid "Welcome to FreeBSD!" -msgstr "歡迎使用 FreeBSD!" - -#. (itstool) path: sect1/indexterm -#. (itstool) path: para/indexterm -#: book.translate.xml:1717 book.translate.xml:1808 -msgid "4.4BSD-Lite" -msgstr "" - -#. (itstool) path: sect1/para -#: book.translate.xml:1719 -msgid "" -"FreeBSD is an Open Source, standards-compliant Unix-like operating system " -"for x86 (both 32 and 64 bit), ARM, AArch64, RISC-V, " -"MIPS, POWER, PowerPC, and Sun UltraSPARC " -"computers. It provides all the features that are nowadays taken for granted, " -"such as preemptive multitasking, memory protection, virtual memory, multi-" -"user facilities, SMP support, all the Open Source development tools for " -"different languages and frameworks, and desktop features centered around X " -"Window System, KDE, or GNOME. Its particular strengths are:" -msgstr "" -"FreeBSD 是一套開源、符合標準的類 Unix 的作業系統,適用於 x86 (32 與 64 位" -"元), ARM, AArch64, RISC-V, MIPS, POWER, " -"PowerPC 以及 Sun UltraSPARC 的電腦。它提供了現代作業系統所應" -"具備的所有功能,例如:先佔式多工、記憶體保護、虛擬記憶體、多使用者架構、對稱" -"多工處理 (SMP)、各種針對不同語言和框架的開源開發工具以及以 X Window 系統、" -"KDE 及 GNOME 為主的桌面功能,而它有以下優勢:" - -#. (itstool) path: listitem/para -#: book.translate.xml:1732 -msgid "" -"Liberal Open Source license, which grants you rights to " -"freely modify and extend its source code and incorporate it in both Open " -"Source projects and closed products without imposing restrictions typical to " -"copyleft licenses, as well as avoiding potential license incompatibility " -"problems." -msgstr "" -"自由的開放原始碼授權,授予您自由修改和擴充其原始碼並將其" -"合併到開放原始碼專案或封閉的產品中的權力,不會對 Copyleft 授權施加典型的限" -"制,也避免了授權不相容的潛在問題。" - -#. (itstool) path: para/indexterm -#: book.translate.xml:1743 -msgid "TCP/IP networking" -msgstr "TCP/IP 網路" - -#. (itstool) path: listitem/para -#: book.translate.xml:1742 -msgid "" -"Strong TCP/IP networking <_:indexterm-1/> - FreeBSD " -"implements industry standard protocols with ever increasing performance and " -"scalability. This makes it a good match in both server, and routing/" -"firewalling roles - and indeed many companies and vendors use it precisely " -"for that purpose." -msgstr "" -"強大的 TCP/IP 網路 <_:indexterm-1/> - FreeBSD 以工業標準" -"實作通訊協定並不斷改善效能與擴展性,這使得 FreeBSD 非常適合應用在伺服器、路由" -"器/防火牆的角色 - 這也是許多公司和供應商使用它的原因。" - -#. (itstool) path: listitem/para -#: book.translate.xml:1753 -msgid "" -"Fully integrated OpenZFS support, including root-on-" -"ZFS, ZFS Boot Environments, fault management, administrative delegation, " -"support for jails, FreeBSD specific documentation, and system installer " -"support." -msgstr "" -"完全整合 OpenZFS,包含 root-on-ZFS、ZFS 開機環境、故障管" -"理、委託管理、對 Jail 的支援、FreeBSD 專屬的文件以及系統安裝程式的支援。" - -#. (itstool) path: listitem/para -#: book.translate.xml:1761 -msgid "" -"Extensive security features, from the Mandatory Access " -"Control framework to Capsicum capability and sandbox mechanisms." -msgstr "" -"鉅細靡遺的安全性功能,從強制存取控制 (Mandatory Access " -"Control, MAC) 框架到 Capsicum 功能以及沙盒機制。" - -#. (itstool) path: listitem/para -#: book.translate.xml:1767 -msgid "" -"Over 30 thousand prebuilt packages for all supported " -"architectures, and the Ports Collection which makes it easy to build your " -"own, customized ones." -msgstr "" -"超過 3 萬個預編的套件供所有支援的架構以及可簡單編譯依您" -"的需求所客製的 Port 套件集。" - -#. (itstool) path: listitem/para -#: book.translate.xml:1774 -msgid "" -"Documentation - in addition to Handbook and books from " -"different authors that cover topics ranging from system administration to " -"kernel internals, there are also the man1 pages, not only for " -"userspace daemons, utilities, and configuration files, but also for kernel " -"driver APIs (section 9) and individual drivers (section 4)." -msgstr "" -"說明文件 - 除了操作手冊及由許多作者著作從系統管理到核心" -"內部主題的書籍外,也有不僅只針對 Userspace Daemon、工具及設定檔,同樣也有針對" -"核心驅動程式 APIs (第 9 節) 及各別驅動程式 (第 4 節) 的操作說明頁 " -"( man1 page)。" - -#. (itstool) path: listitem/para -#: book.translate.xml:1784 -msgid "" -"Simple and consistent repository structure and build system - FreeBSD uses a single repository for all of its components, both " -"kernel and userspace. This, along with an unified and easy to customize " -"build system and a well thought out development process makes it easy to " -"integrate FreeBSD with build infrastructure for your own product." -msgstr "" -"簡單且具一致性的檔案庫架構與編譯系統 - FreeBSD 對所有的" -"元件、核心與 Userspace 使用單一的檔案庫,加上統一、易於客製的編譯系統以及嚴謹" -"的開發流程,讓 FreeBSD 的編譯基礎架構更容易與您產品的整合。" - -#. (itstool) path: listitem/para -#: book.translate.xml:1794 -msgid "" -"Staying true to Unix philosophy, preferring " -"composability instead of monolithic all in one daemons with " -"hardcoded behavior." -msgstr "" -"忠於 Unix 哲學,偏好可組合而非具寫死的 多合一 單一 Daemon。" - -#. (itstool) path: para/indexterm -#. (itstool) path: sect1/indexterm -#: book.translate.xml:1800 book.translate.xml:17996 -msgid "binary compatibility Linux" -msgstr "Binary 相容性 Linux" - -#. (itstool) path: listitem/para -#: book.translate.xml:1800 -msgid "" -"<_:indexterm-1/> Binary compatibility with Linux, which " -"makes it possible to run many Linux binaries without the need for " -"virtualisation." -msgstr "" -"<_:indexterm-1/> Linux 執行檔 (Binary) 相容性,無需虛擬" -"化即可執行許多 Linux 執行檔。" - -#. (itstool) path: para/indexterm -#: book.translate.xml:1811 -msgid "Computer Systems Research Group (CSRG)" -msgstr "電腦系統研究組 (CSRG)" - -#. (itstool) path: sect1/para -#: book.translate.xml:1808 -msgid "" -"FreeBSD is based on the 4.4BSD-Lite<_:indexterm-1/> release from Computer " -"Systems Research Group (CSRG)<_:indexterm-2/> at the University of " -"California at Berkeley, and carries on the distinguished tradition of BSD " -"systems development. In addition to the fine work provided by CSRG, the " -"FreeBSD Project has put in many thousands of man-hours into extending the " -"functionality and fine-tuning the system for maximum performance and " -"reliability in real-life load situations. FreeBSD offers performance and " -"reliability on par with other Open Source and commercial offerings, combined " -"with cutting-edge features not available anywhere else." -msgstr "" -"FreeBSD 系統是基於美國加州大學柏克萊分校的電腦系統研究組 (Computer Systems " -"Research Group 也就是 CSRG) 所發行的 4.4BSD-Lite<_:indexterm-1/>,繼承了 BSD " -"系統開發的優良傳統。 除了由 CSRG 所提供的高品質的成果外,FreeBSD 計劃也投入了" -"上千人時在擴充及微調,來讓系統在真實情境下能達到最大的效能與可靠性。 FreeBSD " -"提供了其他開源與商業產品的效能及穩定性,並結合其他產品所沒有的尖端功能。" - -#. (itstool) path: sect2/title -#: book.translate.xml:1825 -msgid "What Can FreeBSD Do?" -msgstr "FreeBSD 能做什麼?" - -#. (itstool) path: sect2/para -#: book.translate.xml:1827 -msgid "" -"The applications to which FreeBSD can be put are truly limited only by your " -"own imagination. From software development to factory automation, inventory " -"control to azimuth correction of remote satellite antennae; if it can be " -"done with a commercial UNIX " -"product then it is more than likely that you can do it with FreeBSD too! " -"FreeBSD also benefits significantly from literally thousands of high quality " -"applications developed by research centers and universities around the " -"world, often available at little to no cost." -msgstr "" -"FreeBSD 能應用的情境完全限制在你的想像力上。 從軟體開發到工廠自動化,庫存管控" -"到遠程衛星天線的方位角校正;若您的需求可以用商用的 UNIX 產品來達成,那麼極有可能使用 FreeBSD 也能辦" -"到! FreeBSD 也受益於來自於全球各研究中心及大學所開發的數千個高品質的軟體 ," -"這些通常只需要花費很少的費用或根本就是免費的。" - -#. (itstool) path: sect2/para -#: book.translate.xml:1837 -msgid "" -"Because the source code for FreeBSD itself is generally available, the " -"system can also be customized to an almost unheard of degree for special " -"applications or projects, and in ways not generally possible with operating " -"systems from most major commercial vendors. Here is just a sampling of some " -"of the applications in which people are currently using FreeBSD:" -msgstr "" -"由於每個人都可以取得 FreeBSD 的原始程式碼, 這個系統可以被量身訂做成能執行任" -"何原本完全無法想像的功能或計劃, 而對於從各廠商取得的作業系統通常沒有辦法這樣" -"地被修改。 以下提供一些人們使用 FreeBSD 的例子:" - -#. (itstool) path: listitem/para -#: book.translate.xml:1847 -msgid "" -"Internet Services: The robust TCP/IP networking built " -"into FreeBSD makes it an ideal platform for a variety of Internet services " -"such as:" -msgstr "" -"網際網路服務: FreeBSD 內建強勁的網路功能使它成為網路服" -"務 (如下例) 的理想平台:" - -#. (itstool) path: listitem/para -#: book.translate.xml:1854 -msgid "Web servers" -msgstr "網頁伺服器" - -#. (itstool) path: listitem/para -#: book.translate.xml:1858 -msgid "IPv4 and IPv6 routing" -msgstr "IPv4 及 IPv6 路由" - -#. (itstool) path: para/indexterm -#. (itstool) path: chapter/indexterm -#: book.translate.xml:1862 book.translate.xml:57493 -msgid "firewall" -msgstr "防火牆" - -#. (itstool) path: para/indexterm -#. (itstool) path: sect2/indexterm -#: book.translate.xml:1865 book.translate.xml:60841 -msgid "NAT" -msgstr "" - -#. (itstool) path: listitem/para -#: book.translate.xml:1862 -msgid "" -"Firewalls<_:indexterm-1/> and NAT<_:indexterm-2/> (IP masquerading) gateways" -msgstr "" -"防火牆<_:indexterm-1/>以及 NAT<_:indexterm-2/> (IP 偽裝) 通訊" -"閘" - -#. (itstool) path: para/indexterm -#: book.translate.xml:1872 -msgid "FTP servers" -msgstr "FTP 伺服器" - -#. (itstool) path: listitem/para -#: book.translate.xml:1872 -msgid "FTP servers<_:indexterm-1/>" -msgstr "檔案傳輸協定伺服器<_:indexterm-1/>" - -#. (itstool) path: para/indexterm -#: book.translate.xml:1879 -msgid "electronic mail email" -msgstr "電子郵件 email" - -#. (itstool) path: para/indexterm -#. (itstool) path: sect1/indexterm -#: book.translate.xml:1883 book.translate.xml:50805 -msgid "email" -msgstr "" - -#. (itstool) path: listitem/para -#: book.translate.xml:1878 -msgid "<_:indexterm-1/> <_:indexterm-2/> Email servers" -msgstr "<_:indexterm-1/> <_:indexterm-2/> 電子郵件伺服器" - -#. (itstool) path: listitem/para -#: book.translate.xml:1890 -msgid "And more..." -msgstr "還有更多..." - -#. (itstool) path: listitem/para -#: book.translate.xml:1896 -msgid "" -"Education: Are you a student of computer science or a " -"related engineering field? There is no better way of learning about " -"operating systems, computer architecture and networking than the hands on, " -"under the hood experience that FreeBSD can provide. A number of freely " -"available CAD, mathematical and graphic design packages also make it highly " -"useful to those whose primary interest in a computer is to get " -"other work done!" -msgstr "" -"教育:您是電腦科學相關領域的學生嗎?再也沒有比使用 " -"FreeBSD 能學到更多作業系統、計算機結構、及網路的方法了。其中許多免費提供的 " -"CAD,數學和圖形設計套件對於那些需要在電腦完成 其他 工作" -"的人也非常有用!" - -#. (itstool) path: listitem/para -#: book.translate.xml:1908 -msgid "" -"Research: With source code for the entire system " -"available, FreeBSD is an excellent platform for research in operating " -"systems as well as other branches of computer science. FreeBSD's freely " -"available nature also makes it possible for remote groups to collaborate on " -"ideas or shared development without having to worry about special licensing " -"agreements or limitations on what may be discussed in open forums." -msgstr "" -"研究:有了完整的原始程式碼,FreeBSD 是研究作業系統及電腦" -"科學的極佳環境。 具有免費且自由取得特性的 FreeBSD 也使得一個分置兩地的合作計" -"劃,不必擔心版權及系統開放性的問題, 而能自在的交流。" - -#. (itstool) path: para/indexterm -#. (itstool) path: sect2/indexterm -#: book.translate.xml:1920 book.translate.xml:62049 -msgid "router" -msgstr "路由器" - -#. (itstool) path: para/indexterm -#: book.translate.xml:1922 -msgid "DNS Server" -msgstr "DNS 伺服器" - -#. (itstool) path: listitem/para -#: book.translate.xml:1919 -msgid "" -"Networking: Need a new router?<_:indexterm-1/> A name " -"server (DNS)?<_:indexterm-2/> A firewall to keep people out of your internal " -"network? FreeBSD can easily turn that unused PC sitting in the corner into " -"an advanced router with sophisticated packet-filtering capabilities." -msgstr "" -"網路: 你如果需要 路由器<_:indexterm-1/>、名稱伺服器 " -"(DNS)<_:indexterm-2/> 或安全的防火牆, FreeBSD 可以輕易的將你沒有用到的 386 " -"或 486 PC 變身成為絕佳的伺服器,甚至具有過濾封包的功能。" - -#. (itstool) path: para/indexterm -#: book.translate.xml:1933 -msgid "embedded" -msgstr "嵌入式" - -#. (itstool) path: listitem/para -#: book.translate.xml:1931 -msgid "" -"Embedded: FreeBSD makes an excellent platform to build " -"embedded systems upon. <_:indexterm-1/> With support for the ARM, MIPS and PowerPC " -"platforms, coupled with a robust network stack, cutting edge features and " -"the permissive BSD license " -"FreeBSD makes an excellent foundation for building embedded routers, " -"firewalls, and other devices." -msgstr "" -"嵌入式: FreeBSD 是一套可用來建立嵌入式系統的傑出平台。 " -"<_:indexterm-1/> 支援 ARM, " -"MIPS 以及 PowerPC 平台,再加上健全的網路環境、尖端的功能以及" -"自由的 BSD 授權條款,FreeBSD 成" -"為用來建置嵌入式路由器、防火牆及其他裝置的絕佳基礎。" - -#. (itstool) path: para/indexterm -#: book.translate.xml:1946 -msgid "X Window System" -msgstr "X Window 系統" - -#. (itstool) path: para/indexterm -#. (itstool) path: sect2/indexterm -#: book.translate.xml:1949 book.translate.xml:12043 -msgid "GNOME" -msgstr "" - -#. (itstool) path: para/indexterm -#. (itstool) path: sect2/indexterm -#: book.translate.xml:1952 book.translate.xml:12128 -msgid "KDE" -msgstr "" - -#. (itstool) path: listitem/para -#: book.translate.xml:1945 -msgid "" -"<_:indexterm-1/> <_:indexterm-2/> <_:indexterm-3/> Desktop: FreeBSD makes a fine choice for an inexpensive desktop solution " -"using the freely available X11 server. FreeBSD offers a choice from many " -"open-source desktop environments, including the standard GNOME and KDE graphical user interfaces. " -"FreeBSD can even boot diskless from a central server, making " -"individual workstations even cheaper and easier to administer." -msgstr "" -"<_:indexterm-1/> <_:indexterm-2/> <_:indexterm-3/> 桌面: FreeBSD 同時也是低成本桌面解決方案中不錯的選擇,使用了免費的 X11 伺" -"服器。FreeBSD 提供許多開源桌面環境可選擇,包含了標準 GNOMEKDE 圖型化使用者介面。FreeBSD 甚至" -"可以透過中央伺服器做 無磁碟 開機,讓個人工作站變的更便宜、更易" -"於管理。" - -#. (itstool) path: para/indexterm -#: book.translate.xml:1971 -msgid "Compiler" -msgstr "編譯器" - -#. (itstool) path: listitem/para -#: book.translate.xml:1968 -msgid "" -"Software Development: The basic FreeBSD system comes " -"with a full complement of development tools including a full C/C++<_:" -"indexterm-1/> compiler and debugger suite. Support for many other languages " -"are also available through the ports and packages collection." -msgstr "" -"軟體開發: 基本安裝的 FreeBSD 就包含了完整的程式開發工" -"具,如 C/C++<_:indexterm-1/> 編譯器及除錯器。 透過 Port 與套件管理系統也可支" -"援需多其他語言。" - -#. (itstool) path: sect2/para -#: book.translate.xml:1980 -msgid "" -"FreeBSD is available to download free of charge, or can be obtained on " -"either CD-ROM or DVD. Please see for more " -"information about obtaining FreeBSD." -msgstr "" -"你可以經由燒錄 CD-ROM、DVD 或是從 FTP 站上抓回 FreeBSD。 詳情請參閱 取得 FreeBSD。" - -#. (itstool) path: sect2/title -#: book.translate.xml:1987 -msgid "Who Uses FreeBSD?" -msgstr "誰在用 FreeBSD?" - -#. (itstool) path: sect2/indexterm -#: book.translate.xml:1989 -msgid "" -"users large sites running FreeBSD" -msgstr "" -"使用者 執行 FreeBSD 的大型站台" - -#. (itstool) path: sect2/para -#: book.translate.xml:1994 -msgid "" -"FreeBSD has been known for its web serving capabilities - sites that run on " -"FreeBSD include Hacker " -"News, Netcraft, " -"NetEase, Netflix, Sina, Sony Japan, Rambler, Yahoo!, " -"and Yandex." -msgstr "" -"FreeBSD 以其網頁 (Web) 服務功能而聞名 - 在 FreeBSD 上運作的網站包括 Hacker News, Netcraft, NetEase, Netflix, Sina, Sony Japan, Rambler, Yahoo! 及 Yandex。" - -#. (itstool) path: sect2/para -#: book.translate.xml:2007 -msgid "" -"FreeBSD's advanced features, proven security, predictable release cycle, and " -"permissive license have led to its use as a platform for building many " -"commercial and open source appliances, devices, and products. Many of the " -"world's largest IT companies use FreeBSD:" -msgstr "" -"FreeBSD 先進的功能、成熟的安全性、可預測的發佈週期以及自由的授權條款,讓 " -"FreeBSD 已經被用來做為建立許多商業、開源應用、裝置以及產品的平台,有許多世界" -"上最大的資訊公司使用 FreeBSD:" - -#. (itstool) path: para/indexterm -#. (itstool) path: sect1/indexterm -#: book.translate.xml:2017 book.translate.xml:56075 -msgid "Apache" -msgstr "" - -#. (itstool) path: listitem/para -#: book.translate.xml:2016 -msgid "" -"Apache <_:indexterm-1/> - " -"The Apache Software Foundation runs most of its public facing " -"infrastructure, including possibly one of the largest SVN repositories in " -"the world with over 1.4 million commits, on FreeBSD." -msgstr "" -"Apache <_:indexterm-1/> - " -"Apache 軟體基金會中大部分面對大眾的基礎設施,包括可能是世界上最大的 SVN 檔案" -"庫 (擁有超過 140 萬次提交) 都是在 FreeBSD 上運作。" - -#. (itstool) path: para/indexterm -#: book.translate.xml:2027 -msgid "Apple" -msgstr "" - -#. (itstool) path: listitem/para -#: book.translate.xml:2026 -msgid "" -"Apple <_:indexterm-1/> - " -"OS X borrows heavily from FreeBSD for the network stack, virtual file " -"system, and many userland components. Apple iOS also contains elements " -"borrowed from FreeBSD." -msgstr "" -"Apple <_:indexterm-1/> - " -"OS X 大量借鑒 FreeBSD 的網路 Stack、虛擬檔案系統以及許多使用者空間的元件。" -"Apple iOS 中含有從 FreeBSD 借鑒來的元素。" - -#. (itstool) path: para/indexterm -#: book.translate.xml:2037 -msgid "Cisco" -msgstr "" - -#. (itstool) path: listitem/para -#: book.translate.xml:2036 -msgid "" -"Cisco <_:indexterm-1/> - " -"IronPort network security and anti-spam appliances run a modified FreeBSD " -"kernel." -msgstr "" -"Cisco <_:indexterm-1/> - " -"IronPort 網路安全及反垃圾郵件設備是採用改良後 FreeBSD 核心來運作。" - -#. (itstool) path: para/indexterm -#: book.translate.xml:2045 -msgid "Citrix" -msgstr "" - -#. (itstool) path: listitem/para -#: book.translate.xml:2044 -msgid "" -"Citrix <_:indexterm-1/> - " -"The NetScaler line of security appliances provide layer 4-7 load balancing, " -"content caching, application firewall, secure VPN, and mobile cloud network " -"access, along with the power of a FreeBSD shell." -msgstr "" -"Citrix <_:indexterm-1/> - " -"安全設備的 NetScaler 產品線提供的第 4-7 層的負載均衡、內容快取、應用層防火" -"牆、安全的 VPN 以及行動雲端網路存取,皆運用了 FreeBSD Shell 強大的功能。" - -#. (itstool) path: para/indexterm -#: book.translate.xml:2055 -msgid "Isilon" -msgstr "" - -#. (itstool) path: listitem/para -#: book.translate.xml:2054 -msgid "" -"Dell EMC Isilon <_:" -"indexterm-1/> - Isilon's enterprise storage appliances are based on FreeBSD. " -"The extremely liberal FreeBSD license allowed Isilon to integrate their " -"intellectual property throughout the kernel and focus on building their " -"product instead of an operating system." -msgstr "" -"Dell EMC Isilon <_:" -"indexterm-1/> - Isilon 的企業存儲設備是以 FreeBSD 為基礎。非常自由的 FreeBSD " -"授權條款讓 Isilon 整合了它們的智慧財產到整個核心,並專注打造自己的產品,而不" -"是一個作業系統。" - -#. (itstool) path: para/indexterm -#: book.translate.xml:2067 -msgid "Quest KACE" -msgstr "Quest KACE" - -#. (itstool) path: listitem/para -#: book.translate.xml:2065 -msgid "" -"Quest KACE <_:" -"indexterm-1/> - The KACE system management appliances run FreeBSD because of " -"its reliability, scalability, and the community that supports its continued " -"development." -msgstr "" -"Quest KACE <_:" -"indexterm-1/> - KACE 系統管理設備中運作了 FreeBSD,是因為 FreeBSD 的可靠性、" -"可擴展性以及支持其持續發展的社群。" - -#. (itstool) path: para/indexterm -#: book.translate.xml:2076 -msgid "iXsystems" -msgstr "" - -#. (itstool) path: listitem/para -#: book.translate.xml:2075 -msgid "" -"iXsystems <_:" -"indexterm-1/> - The TrueNAS line of unified storage appliances is based on " -"FreeBSD. In addition to their commercial products, iXsystems also manages " -"development of the open source projects TrueOS and FreeNAS." -msgstr "" -"iXsystems <_:" -"indexterm-1/> - 統合存儲 (Unified Storage) 設備的 TrueNAS 產品線是以 FreeBSD " -"為基礎。除了該公司自己的商業產品外,iXsystems 也管理著 TrueOS 和 FreeNAS 兩個" -"開源計劃的開發。" - -#. (itstool) path: para/indexterm -#: book.translate.xml:2086 -msgid "Juniper" -msgstr "" - -#. (itstool) path: listitem/para -#: book.translate.xml:2085 -msgid "" -"Juniper <_:indexterm-1/> " -"- The JunOS operating system that powers all Juniper networking gear " -"(including routers, switches, security, and networking appliances) is based " -"on FreeBSD. Juniper is one of many vendors that showcases the symbiotic " -"relationship between the project and vendors of commercial products. " -"Improvements generated at Juniper are upstreamed into FreeBSD to reduce the " -"complexity of integrating new features from FreeBSD back into JunOS in the " -"future." -msgstr "" -"Juniper <_:indexterm-1/> " -"- JunOS 作業系統驅動了所有的 Juniper 網絡設備 (包括路由器,交換器,安全與網" -"絡設備) 便是以 FreeBSD 為基礎。Juniper 在眾多廠商之中,展現了計劃與商業產品供" -"應商之間的共生關係。由 Juniper 所開發的改進內容會回饋給 FreeBSD 來降低未來新" -"功能從 FreeBSD 整合回 JunOS 的複雜性。" - -#. (itstool) path: para/indexterm -#: book.translate.xml:2101 -msgid "McAfee" -msgstr "" - -#. (itstool) path: listitem/para -#: book.translate.xml:2100 -msgid "" -"McAfee <_:indexterm-1/> - " -"SecurOS, the basis of McAfee enterprise firewall products including " -"Sidewinder is based on FreeBSD." -msgstr "" -"McAfee <_:indexterm-1/> - " -"SecurOS 是 McAfee 企業防火牆產品的基礎,其中包含了 Sidewinder ,也是以 " -"FreeBSD 為基礎。" - -#. (itstool) path: para/indexterm -#: book.translate.xml:2110 -msgid "NetApp" -msgstr "" - -#. (itstool) path: listitem/para -#: book.translate.xml:2109 -msgid "" -"NetApp <_:indexterm-1/> - " -"The Data ONTAP GX line of storage appliances are based on FreeBSD. In " -"addition, NetApp has contributed back many features, including the new BSD " -"licensed hypervisor, bhyve." -msgstr "" -"NetApp <_:indexterm-1/> - " -"存儲設備中的 Data ONTAP GX 產品線是以 FreeBSD 為基礎。除此之外,NetApp 還貢獻" -"了回 FreeBSD 許多功能,包括新 BSD 條款授權的 hypervisor, bhyve。" - -#. (itstool) path: para/indexterm -#: book.translate.xml:2120 -msgid "Netflix" -msgstr "" - -#. (itstool) path: listitem/para -#: book.translate.xml:2119 -msgid "" -"Netflix <_:indexterm-1/> " -"- The OpenConnect appliance that Netflix uses to stream movies to its " -"customers is based on FreeBSD. Netflix has made extensive contributions to " -"the codebase and works to maintain a zero delta from mainline FreeBSD. " -"Netflix OpenConnect appliances are responsible for delivering more than 32% " -"of all Internet traffic in North America." -msgstr "" -"Netflix <_:indexterm-1/> " -"- Netflix 用來以串流傳送電影到客戶的 OpenConnect 設備是以 FreeBSD 為基礎。 " -"Netflix 也做了大量貢獻到程式碼庫,並致力於維持與主線 FreeBSD 的零修正關係。" -"Netflix 的 OpenConnect 設備負責了北美所有的網路流量 32% 以上。" - -#. (itstool) path: para/indexterm -#: book.translate.xml:2133 -msgid "Sandvine" -msgstr "" - -#. (itstool) path: listitem/para -#: book.translate.xml:2132 -msgid "" -"Sandvine <_:indexterm-1/" -"> - Sandvine uses FreeBSD as the basis of their high performance real-time " -"network processing platforms that make up their intelligent network policy " -"control products." -msgstr "" -"Sandvine <_:indexterm-1/" -"> - Sandvine 使用 FreeBSD 作為它的高性能即時網路處理平台的基礎來建立它們的智" -"慧網路策略控制產品。" - -#. (itstool) path: para/indexterm -#: book.translate.xml:2143 -msgid "Sony" -msgstr "" - -#. (itstool) path: listitem/para -#: book.translate.xml:2142 -msgid "" -"Sony <_:indexterm-1/> - The " -"PlayStation 4 gaming console runs a modified version of FreeBSD." -msgstr "" -"Sony <_:indexterm-1/> - " -"PlayStation 4 遊戲主機使用了修改過的 FreeBSD 版本來運作。" - -#. (itstool) path: para/indexterm -#: book.translate.xml:2151 -msgid "Sophos" -msgstr "" - -#. (itstool) path: listitem/para -#: book.translate.xml:2150 -msgid "" -"Sophos <_:indexterm-1/> - " -"The Sophos Email Appliance product is based on a hardened FreeBSD and scans " -"inbound mail for spam and viruses, while also monitoring outbound mail for " -"malware as well as the accidental loss of sensitive information." -msgstr "" -"Sophos <_:indexterm-1/> - " -"Sophos 電子郵件設備產品是以加強防護 (Hardened) 的 FreeBSD 為基礎,可掃描入站" -"郵件中的垃圾郵件和病毒,同時也可監控出站郵件中的惡意軟體及敏感資訊。" - -#. (itstool) path: para/indexterm -#: book.translate.xml:2163 -msgid "Spectra Logic" -msgstr "" - -#. (itstool) path: listitem/para -#: book.translate.xml:2161 -msgid "" -"Spectra Logic <_:" -"indexterm-1/> - The nTier line of archive grade storage appliances run " -"FreeBSD and OpenZFS." -msgstr "" -"Spectra Logic <_:" -"indexterm-1/> - 儲藏級儲存設備的 nTier 產品線以 FreeBSD 和 OpenZFS 來運作。" - -#. (itstool) path: para/indexterm -#: book.translate.xml:2171 -msgid "Stormshield" -msgstr "Stormshield" - -#. (itstool) path: listitem/para -#: book.translate.xml:2170 -msgid "" -"Stormshield <_:" -"indexterm-1/> - Stormshield Network Security appliances are based on a " -"hardened version of FreeBSD. The BSD license allows them to integrate their " -"own intellectual property with the system while returning a great deal of " -"interesting development to the community." -msgstr "" -"Stormshield <_:" -"indexterm-1/> - Stormshield 網路安全設備使用了硬體化版本的 FreeBSD 做為基礎," -"BSD 授權條款讓他們可將其智慧財產與系統整合並同時回饋大量有趣的發展給社群。" - -#. (itstool) path: para/indexterm -#: book.translate.xml:2184 -msgid "The Weather Channel" -msgstr "" - -#. (itstool) path: listitem/para -#: book.translate.xml:2182 -msgid "" -"The Weather Channel <_:" -"indexterm-1/> - The IntelliStar appliance that is installed at each local " -"cable provider's headend and is responsible for injecting local weather " -"forecasts into the cable TV network's programming runs FreeBSD." -msgstr "" -"The Weather Channel <_:" -"indexterm-1/> - 被安裝在各地有線電視營運商前端,負責加入當地天氣預報到有線電" -"視網路節目的 IntelliStar 設備便是使用 FreeBSD。" - -#. (itstool) path: para/indexterm -#: book.translate.xml:2195 -msgid "Verisign" -msgstr "" - -#. (itstool) path: listitem/para -#: book.translate.xml:2194 -msgid "" -"Verisign <_:indexterm-1/" -"> - Verisign is responsible for operating the .com and .net root domain " -"registries as well as the accompanying DNS infrastructure. They rely on a " -"number of different network operating systems including FreeBSD to ensure " -"there is no common point of failure in their infrastructure." -msgstr "" -"Verisign <_:indexterm-1/" -"> - VeriSign 主要經營 .com 與 .net 根網域名稱註冊業務以及隨附的 DNS 基礎設施" -"運作。這些基礎設施的運作仰賴各種不同的網路作業系統包括 FreeBSD 來確保不會有單" -"點故障的問題。" - -#. (itstool) path: para/indexterm -#: book.translate.xml:2208 -msgid "Voxer" -msgstr "" - -#. (itstool) path: listitem/para -#: book.translate.xml:2207 -msgid "" -"Voxer <_:indexterm-1/> - " -"Voxer powers their mobile voice messaging platform with ZFS on FreeBSD. " -"Voxer switched from a Solaris derivative to FreeBSD because of its superior " -"documentation, larger and more active community, and more developer friendly " -"environment. In addition to critical features like ZFS " -"and DTrace, FreeBSD also offers TRIM support for ZFS." -msgstr "" -"Voxer <_:indexterm-1/> - " -"Voxer 使用了 FreeBSD 的 ZFS 來驅動行動語音通訊平台,讓 Voxer 從 Solaris 改使" -"用 FreeBSD 的原因是 FreeBSD 擁有詳盡的文件、更大型且活躍的社群、較便利的開發" -"人員環境。除了提供關鍵的 ZFS 和 DTrace 功能之外 FreeBSD " -"的 ZFS 也支援了 TRIM。" - -#. (itstool) path: para/indexterm -#: book.translate.xml:2222 -msgid "WhatsApp" -msgstr "" - -#. (itstool) path: listitem/para -#: book.translate.xml:2221 -msgid "" -"WhatsApp <_:indexterm-1/" -"> - When WhatsApp needed a platform that would be able to handle more than 1 " -"million concurrent TCP connections per server, they chose FreeBSD. They then " -"proceeded to scale past 2.5 million connections per server." -msgstr "" -"WhatsApp <_:indexterm-1/" -"> - 當 WhatsApp 面臨需要一個每台伺服器能夠同時處理超過 100 萬個 TCP 連線的平" -"台時,它們選擇了 FreeBSD。它們接著擴大規模到每台伺服器處理超過 250 萬的連線。" - -#. (itstool) path: para/indexterm -#: book.translate.xml:2234 -msgid "Wheel Systems" -msgstr "" - -#. (itstool) path: listitem/para -#: book.translate.xml:2232 -msgid "" -"Wheel Systems <_:" -"indexterm-1/> - The FUDO security appliance allows enterprises to monitor, " -"control, record, and audit contractors and administrators who work on their " -"systems. Based on all of the best security features of FreeBSD including " -"ZFS, GELI, Capsicum, HAST, and auditdistd." -msgstr "" -"Wheel Systems <_:" -"indexterm-1/> - FUDO 安全性設備讓企業可以監控、控制、記錄以及稽查在其系統中作" -"業的承包商與管理員。這些功能皆是以 FreeBSD 最佳的安全性功能為基礎,包括 ZFS, " -"GELI, Capsicum, HAST 及 auditdistd。" - -#. (itstool) path: sect2/para -#: book.translate.xml:2246 -msgid "FreeBSD has also spawned a number of related open source projects:" -msgstr "FreeBSD 也催生了數個相關的開源計劃:" - -#. (itstool) path: para/indexterm -#: book.translate.xml:2253 -msgid "BSD Router" -msgstr "" - -#. (itstool) path: listitem/para -#: book.translate.xml:2251 -msgid "" -"BSD Router <_:indexterm-1/> - " -"A FreeBSD based replacement for large enterprise routers designed to run on " -"standard PC hardware." -msgstr "" -"BSD Router <_:indexterm-1/> - " -"以 FreeBSD 為基礎的大型企業路由器替代方案,專門設計為可在標準 PC 硬體上運作。" - -#. (itstool) path: para/indexterm -#: book.translate.xml:2262 -msgid "FreeNAS" -msgstr "" - -#. (itstool) path: listitem/para -#: book.translate.xml:2261 -msgid "" -"FreeNAS <_:indexterm-1/> " -"- A customized FreeBSD designed to be used as a network file server " -"appliance. Provides a python based web interface to simplify the management " -"of both the UFS and ZFS file systems. Includes support for NFS, SMB/CIFS, " -"AFP, FTP, and iSCSI. Includes an extensible plugin system based on FreeBSD " -"jails." -msgstr "" -"FreeNAS <_:indexterm-1/> " -"- 專為網路檔案伺服器設備使用所設計的 FreeBSD。提供了以 Python 為基礎的網頁介" -"面來簡化 UFS 與 ZFS 檔案系統的管理,支援了 NFS、SMB/ CIFS、AFP、FTP 與 " -"iSCSI,還有以 FreeBSD Jail 為基礎的套件系統。" - -#. (itstool) path: para/indexterm -#: book.translate.xml:2274 -msgid "GhostBSD" -msgstr "" - -#. (itstool) path: listitem/para -#: book.translate.xml:2273 -msgid "" -"GhostBSD <_:indexterm-1/" -"> - A desktop oriented distribution of FreeBSD bundled with the Gnome " -"desktop environment." -msgstr "" -"GhostBSD <_:indexterm-1/" -"> - 採用 Gnome 桌面環境的 FreeBSD 發行版。" - -#. (itstool) path: para/indexterm -#: book.translate.xml:2282 -msgid "mfsBSD" -msgstr "" - -#. (itstool) path: listitem/para -#: book.translate.xml:2281 -msgid "" -"mfsBSD <_:indexterm-1/> - A " -"toolkit for building a FreeBSD system image that runs entirely from memory." -msgstr "" -"mfsBSD <_:indexterm-1/> - 用" -"來建置可完全從記憶體執行 FreeBSD 系統映像檔工具。" - -#. (itstool) path: para/indexterm -#: book.translate.xml:2290 -msgid "NAS4Free" -msgstr "" - -#. (itstool) path: listitem/para -#: book.translate.xml:2289 -msgid "" -"NAS4Free <_:indexterm-1/" -"> - A file server distribution based on FreeBSD with a PHP powered web " -"interface." -msgstr "" -"NAS4Free <_:indexterm-1/" -"> - 以 FreeBSD 及 PHP 驅動網頁介面為基礎的檔案伺服器。" - -#. (itstool) path: para/indexterm -#: book.translate.xml:2298 -msgid "OPNsense" -msgstr "" - -#. (itstool) path: listitem/para -#: book.translate.xml:2297 -msgid "" -"OPNSense <_:indexterm-1/" -"> - OPNsense is an open source, easy-to-use and easy-to-build FreeBSD based " -"firewall and routing platform. OPNsense includes most of the features " -"available in expensive commercial firewalls, and more in many cases. It " -"brings the rich feature set of commercial offerings with the benefits of " -"open and verifiable sources." -msgstr "" -"OPNSense <_:indexterm-1/" -"> - OPNsense 是一個以 FreeBSD 為基礎的開源、易於使用及易於建置的防火牆和路由" -"平台。OPNsense 有大多數在昂貴的商業防火牆上才有的功能。它帶來了商業產品的豐富" -"功能集,同時擁有開放和安全的來源。" - -#. (itstool) path: para/indexterm -#: book.translate.xml:2310 -msgid "TrueOS" -msgstr "TrueOS" - -#. (itstool) path: listitem/para -#: book.translate.xml:2309 -msgid "" -"TrueOS <_:indexterm-1/> - " -"A customized version of FreeBSD geared towards desktop users with graphical " -"utilities to exposing the power of FreeBSD to all users. Designed to ease " -"the transition of Windows and OS X users." -msgstr "" -"TrueOS <_:indexterm-1/> - " -"訂製版本的 FreeBSD,裝備了給桌面使用者使用的圖型化工具來展示 FreeBSD 強大的功" -"能給所有使用者,專門設計來緩解使用者在 Windows 與 OS X 間的過渡。" - -#. (itstool) path: para/indexterm -#: book.translate.xml:2320 -msgid "pfSense" -msgstr "" - -#. (itstool) path: listitem/para -#: book.translate.xml:2319 -msgid "" -"pfSense <_:indexterm-1/> " -"- A firewall distribution based on FreeBSD with a huge array of features and " -"extensive IPv6 support." -msgstr "" -"pfSense <_:indexterm-1/> " -"- 以 FreeBSD 為基礎的防火牆發行版,支援巨型陣列及大規模 IPv6。" - -#. (itstool) path: para/indexterm -#: book.translate.xml:2329 -msgid "ZRouter" -msgstr "" - -#. (itstool) path: listitem/para -#: book.translate.xml:2328 -msgid "" -"ZRouter <_:indexterm-1/> - " -"An open source alternative firmware for embedded devices based on FreeBSD. " -"Designed to replace the proprietary firmware on off-the-shelf routers." -msgstr "" -"ZRouter <_:indexterm-1/> - 嵌" -"入式裝置韌體的開源替代方案,以 FreeBSD 為基礎,專門設計來取代現成路由器上的專" -"用韌體。" - -#. (itstool) path: sect2/para -#: book.translate.xml:2337 -msgid "" -"A list of testimonials from companies basing their products and " -"services on FreeBSD can be found at the FreeBSD Foundation website. " -"Wikipedia also maintains a list of products based on FreeBSD." -msgstr "" -"在 FreeBSD 基金會網站上可以找到以 FreeBSD 為基礎的產品與服務的公" -"司的推薦 清單。 Wikipedia 也維護了一份以 FreeBSD 為基礎的產" -"品清單。" - -#. (itstool) path: sect1/title -#: book.translate.xml:2347 -msgid "About the FreeBSD Project" -msgstr "關於 FreeBSD 計劃" - -#. (itstool) path: sect1/para -#: book.translate.xml:2349 -msgid "" -"The following section provides some background information on the project, " -"including a brief history, project goals, and the development model of the " -"project." -msgstr "接下來講的是 FreeBSD 計劃的背景,包含歷史、計劃目標以及開發模式。" - -#. (itstool) path: sect2/title -#: book.translate.xml:2354 -msgid "A Brief History of FreeBSD" -msgstr "FreeBSD 歷史簡介" - -#. (itstool) path: sect2/indexterm -#: book.translate.xml:2356 -msgid "386BSD Patchkit" -msgstr "" - -#. (itstool) path: sect2/indexterm -#: book.translate.xml:2357 -msgid "Hubbard, Jordan" -msgstr "" - -#. (itstool) path: sect2/indexterm -#: book.translate.xml:2358 -msgid "Williams, Nate" -msgstr "" - -#. (itstool) path: sect2/indexterm -#: book.translate.xml:2359 -msgid "Grimes, Rod" -msgstr "" - -#. (itstool) path: sect2/indexterm -#: book.translate.xml:2360 -msgid "FreeBSD Project history" -msgstr "" - -#. (itstool) path: sect2/para -#: book.translate.xml:2365 -msgid "" -"The FreeBSD Project had its genesis in the early part of 1993, partially as " -"an outgrowth of the Unofficial 386BSDPatchkit by the patchkit's last 3 " -"coordinators: Nate Williams, Rod Grimes and Jordan Hubbard." -msgstr "" -"FreeBSD 計畫起源於 1993 年初, 那是源自於維護一組『非官方 386BSD 修正工具』計" -"劃的最後三個協調人 Nate Williams,Rod Grimes 和 Jordan Hubbard。" - -#. (itstool) path: sect2/indexterm -#: book.translate.xml:2370 book.translate.xml:2410 -msgid "386BSD" -msgstr "" - -#. (itstool) path: sect2/para -#: book.translate.xml:2371 -msgid "" -"The original goal was to produce an intermediate snapshot of 386BSD in order " -"to fix a number of problems with it that the patchkit mechanism just was not " -"capable of solving. The early working title for the project was 386BSD 0.5 " -"or 386BSD Interim in reference of that fact." -msgstr "" -"最初的目標是做出一份 386BSD 的中間版本的快照 (Snapshot) 來修正使用修正工具 " -"(Patchkit) 機制無法解決的數個問題,也因此早期的計劃名稱叫做 386BSD 0.5 或 " -"386BSD Interim 便是這個原因。" - -#. (itstool) path: sect2/indexterm -#: book.translate.xml:2377 -msgid "Jolitz, Bill" -msgstr "" - -#. (itstool) path: sect2/para -#: book.translate.xml:2378 -msgid "" -"386BSD was Bill Jolitz's operating system, which had been up to that point " -"suffering rather severely from almost a year's worth of neglect. As the " -"patchkit swelled ever more uncomfortably with each passing day, they decided " -"to assist Bill by providing this interim cleanup snapshot. " -"Those plans came to a rude halt when Bill Jolitz suddenly decided to " -"withdraw his sanction from the project without any clear indication of what " -"would be done instead." -msgstr "" -"386BSD 是 Bill Jolitz 的作業系統,在當時就已經忍受了將近一年的忽視,隨著修正" -"工具日漸龐大的令人不舒服,他們決定提供一份過渡性的 簡潔 快照來" -"幫助 Bill。 然而,由於 Bill Jolitz 忽然決定取消其對該計劃的認可,且沒有明確指" -"出未來的打算,所以該計劃便突然面臨中止。" - -#. (itstool) path: sect2/indexterm -#: book.translate.xml:2388 -msgid "Greenman, David" -msgstr "" - -#. (itstool) path: sect2/indexterm -#: book.translate.xml:2389 -msgid "Walnut Creek CDROM" -msgstr "" - -#. (itstool) path: sect2/para -#: book.translate.xml:2391 -msgid "" -"The trio thought that the goal remained worthwhile, even without Bill's " -"support, and so they adopted the name \"FreeBSD\" coined by David Greenman. " -"The initial objectives were set after consulting with the system's current " -"users and, once it became clear that the project was on the road to perhaps " -"even becoming a reality, Jordan contacted Walnut Creek CDROM with an eye " -"toward improving FreeBSD's distribution channels for those many unfortunates " -"without easy access to the Internet. Walnut Creek CDROM not only supported " -"the idea of distributing FreeBSD on CD but also went so far as to provide " -"the project with a machine to work on and a fast Internet connection. " -"Without Walnut Creek CDROM's almost unprecedented degree of faith in what " -"was, at the time, a completely unknown project, it is quite unlikely that " -"FreeBSD would have gotten as far, as fast, as it has today." -msgstr "" -"這三人認為這個目標即始沒有 Bill 的支持仍有保留的價值,最後他們採用 David " -"Greenman 丟銅板決定的名字,也就是 \"FreeBSD\"。在詢問了當時的一些使用者意見之" -"後決定了最初的目標,隨著目標越來越明確便開始著手進行。Jordan 找了 Walnut " -"Creek CD-ROM 商討,著眼於如何改進 FreeBSD 的發行通路,讓那些不便上網的人可簡" -"單的取得。 Walnut Creek CD-ROM 不只贊成以 CD 來發行 FreeBSD 的想法,同時提供" -"了一台機器以及快速的網路。 若不是 Walnut Creek CD-ROM 在那個時間上史無前例的" -"信任,這個默默無名的計劃很可能不會成為現在的 FreeBSD 快速的成長到今日這樣的規" -"模。" - -#. (itstool) path: sect2/indexterm -#: book.translate.xml:2407 -msgid "4.3BSD-Lite" -msgstr "" - -#. (itstool) path: sect2/indexterm -#: book.translate.xml:2408 book.translate.xml:2423 -msgid "Net/2" -msgstr "" - -#. (itstool) path: sect2/indexterm -#: book.translate.xml:2409 book.translate.xml:2422 -msgid "U.C. Berkeley" -msgstr "" - -#. (itstool) path: sect2/indexterm -#: book.translate.xml:2411 book.translate.xml:8809 -msgid "Free Software Foundation" -msgstr "" - -#. (itstool) path: sect2/para -#: book.translate.xml:2413 -msgid "" -"The first CD-ROM (and general net-wide) distribution was FreeBSD 1.0, " -"released in December of 1993. This was based on the 4.3BSD-Lite " -"(Net/2) tape from U.C. Berkeley, with many components also " -"provided by 386BSD and the Free Software Foundation. It was a fairly " -"reasonable success for a first offering, and they followed it with the " -"highly successful FreeBSD 1.1 release in May of 1994." -msgstr "" -"第一張以 CD-ROM (及網路) 發行的版本為 FreeBSD 1.0,是在 1993 年十二月發佈。 " -"該版本採用了 U.C. Berkeley 以磁帶方式發行的 4.3BSD-Lite (Net/2) 及許多來自於 386BSD 和自由軟體基金會的元件為基礎。對於第一次發行而言" -"還算成功,我們又接著於 1994 年 5 月發行了相當成功的 FreeBSD 1.1。" - -#. (itstool) path: sect2/indexterm -#: book.translate.xml:2421 -msgid "Novell" -msgstr "" - -#. (itstool) path: sect2/indexterm -#: book.translate.xml:2424 -msgid "AT&T" -msgstr "" - -#. (itstool) path: sect2/para -#: book.translate.xml:2425 -msgid "" -"Around this time, some rather unexpected storm clouds formed on the horizon " -"as Novell and U.C. Berkeley settled their long-running lawsuit over the " -"legal status of the Berkeley Net/2 tape. A condition of that settlement was " -"U.C. Berkeley's concession that large parts of Net/2 were encumbered code and the property of Novell, who had in turn acquired it from " -"AT&T some time previously. What Berkeley got in return was Novell's " -"blessing that the 4.4BSD-Lite release, when it was finally " -"released, would be declared unencumbered and all existing Net/2 users would " -"be strongly encouraged to switch. This included FreeBSD, and the project was " -"given until the end of July 1994 to stop shipping its own Net/2 based " -"product. Under the terms of that agreement, the project was allowed one last " -"release before the deadline, that release being FreeBSD 1.1.5.1." -msgstr "" -"然而此後不久,另一個意外的風暴在 Novell 與 U.C. Berkeley 關於 Berkeley Net/2 " -"磁帶之法律地位的訴訟確定之後形成。 U.C. Berkeley 承認大部份的 Net/2 的程式碼" -"都是侵佔來的且是屬於 Novell 的財產 -- 事實上是當時不久前從 " -"AT&T 取得的。 Berkeley 得到的是 Novell 對於 4.4BSD-Lite 的祝福,最後當 4.4BSD-Lite 終於發行之後,便不再是侵佔行為。 而所有現有 Net/2 " -"使用者都被強烈建議更換新版本,這包括了 FreeBSD。 於是,我們被要求於 1994 年 " -"6 月底前停止散佈以 Net/2 為基礎的產品。在此前提之下,本計劃被允許在期限以前作" -"最後一次發行,也就是 FreeBSD 1.1.5.1。" - -#. (itstool) path: sect2/para -#: book.translate.xml:2442 -msgid "" -"FreeBSD then set about the arduous task of literally re-inventing itself " -"from a completely new and rather incomplete set of 4.4BSD-Lite bits. The " -"Lite releases were light in part because Berkeley's CSRG had " -"removed large chunks of code required for actually constructing a bootable " -"running system (due to various legal requirements) and the fact that the " -"Intel port of 4.4 was highly incomplete. It took the project until November " -"of 1994 to make this transition, and in December it released FreeBSD 2.0 to " -"the world. Despite being still more than a little rough around the edges, " -"the release was a significant success and was followed by the more robust " -"and easier to install FreeBSD 2.0.5 release in June of 1995." -msgstr "" -"FreeBSD 便開始了這宛如『重新發明輪子』的艱鉅工作 -- 從全新的且不完整的 " -"4.4BSD-Lite 重新整合。 這個 Lite 版本是不完整的,因為 " -"Berkeley 的 CSRG 已經刪除了大量在建立一個可以開機執行的系統所需要的程式碼 (基" -"於若干法律上的要求),且該版本在 Intel 平台的移植是非常不完整的。 直到 1994 " -"年 11 月本計劃才完成了這個轉移, 同時在該年 12 月底以 CD-ROM 以及網路的形式發" -"行了 FreeBSD 2.0。 雖然該份版本在當時有點匆促粗糙,但仍是富有意義的成功。 隨" -"之於 1995 年 6 月又發行了更容易安裝,更好的 FreeBSD 2.0.5。" - -#. (itstool) path: sect2/para -#: book.translate.xml:2456 -msgid "" -"Since that time, FreeBSD has made a series of releases each time improving " -"the stability, speed, and feature set of the previous version." -msgstr "" -"自那時以來,FreeBSD 在每一次對先前版本改進穩定性、速度及功能時便會發佈一個新" -"的發佈版本。" - -#. (itstool) path: sect2/para -#: book.translate.xml:2460 -msgid "" -"For now, long-term development projects continue to take place in the 10.X-" -"CURRENT (trunk) branch, and snapshot releases of 10.X are continually made " -"available from the snapshot server as work progresses." -msgstr "" -"目前,長期的開發計畫繼續在 10.X-CURRENT (trunk) 分支中進行,而 10.X 的快照 " -"(Snapshot) 版本可以在 快照伺服器 取得。" - -#. (itstool) path: info/title -#: book.translate.xml:2468 -msgid "FreeBSD Project Goals" -msgstr "FreeBSD 計劃目標" - -#. (itstool) path: authorgroup/author -#: book.translate.xml:2471 -msgid "" -" Jordan Hubbard Contributed by " -msgstr "" - -#. (itstool) path: sect2/indexterm -#: book.translate.xml:2481 -msgid "FreeBSD Project goals" -msgstr "FreeBSD 計劃 目標" - -#. (itstool) path: sect2/para -#: book.translate.xml:2485 -msgid "" -"The goals of the FreeBSD Project are to provide software that may be used " -"for any purpose and without strings attached. Many of us have a significant " -"investment in the code (and project) and would certainly not mind a little " -"financial compensation now and then, but we are definitely not prepared to " -"insist on it. We believe that our first and foremost mission " -"is to provide code to any and all comers, and for whatever purpose, so that " -"the code gets the widest possible use and provides the widest possible " -"benefit. This is, I believe, one of the most fundamental goals of Free " -"Software and one that we enthusiastically support." -msgstr "" -"FreeBSD 計劃的目標在於提供可作任意用途的軟體而不附帶任何限制條文。 我們之中許" -"多人對程式碼 (以及計畫本身) 都有非常大的投入, 因此,當然不介意偶爾有一些資金" -"上的補償,但我們並沒打算堅決地要求得到這類資助。 我們認為我們的首要使" -"命是為任何人提供程式碼, 不管他們打算用這些程式碼做什麼, 因為這樣程" -"式碼將能夠被更廣泛地使用,從而發揮其價值。 我認為這是自由軟體最基本的,同時也" -"是我們所倡導的一個目標。" - -#. (itstool) path: sect2/indexterm -#: book.translate.xml:2497 -msgid "GNU General Public License (GPL)" -msgstr "GNU 通用公共授權條款 (GPL)" - -#. (itstool) path: sect2/indexterm -#: book.translate.xml:2500 -msgid "GNU Lesser General Public License (LGPL)" -msgstr "GNU 較寬鬆通用公共授權條款 (LGPL)" - -#. (itstool) path: sect2/indexterm -#: book.translate.xml:2503 -msgid "BSD Copyright" -msgstr "BSD 版權" - -#. (itstool) path: sect2/para -#: book.translate.xml:2504 -msgid "" -"That code in our source tree which falls under the GNU General Public " -"License (GPL) or Library General Public License (LGPL) comes with slightly " -"more strings attached, though at least on the side of enforced access rather " -"than the usual opposite. Due to the additional complexities that can evolve " -"in the commercial use of GPL software we do, however, prefer software " -"submitted under the more relaxed BSD copyright when it is a reasonable " -"option to do so." -msgstr "" -"我們程式碼樹中,有若干是以 GNU 通用公共授權條款 (GPL) 或者 GNU 較寬鬆通用公共" -"授權條款 (LGPL) 發佈的那些程式碼帶有少許的附加限制,還好只是強制性的要求開放" -"程式碼而不是別的。 由於使用 GPL 的軟體在商業用途上會增加若干複雜性,因此,如" -"果可以選擇的話, 我們會比較喜歡使用限制相對更寬鬆的 BSD 版權來發佈軟體。" - -#. (itstool) path: info/title -#: book.translate.xml:2516 -msgid "The FreeBSD Development Model" -msgstr "FreeBSD 開發模式" - -#. (itstool) path: authorgroup/author -#: book.translate.xml:2519 -msgid "" -" Satoshi Asami Contributed by " -msgstr "" - -#. (itstool) path: sect2/indexterm -#: book.translate.xml:2529 -msgid "" -"FreeBSD Project development model" -msgstr "FreeBSD 專案 開發模式" - -#. (itstool) path: sect2/para -#: book.translate.xml:2534 -msgid "" -"The development of FreeBSD is a very open and flexible process, being " -"literally built from the contributions of thousands of people around the " -"world, as can be seen from our list of contributors. FreeBSD's development infrastructure allow these thousands of " -"contributors to collaborate over the Internet. We are constantly on the " -"lookout for new developers and ideas, and those interested in becoming more " -"closely involved with the project need simply contact us at the FreeBSD " -"technical discussions mailing list. The FreeBSD announcements " -"mailing list is also available to those wishing to make other FreeBSD " -"users aware of major areas of work." -msgstr "" -"FreeBSD 的開發是一個非常開放且具彈性的過程,就像從 貢獻" -"者名單 所看到的,是由全世界成千上萬的貢獻者發展起來的。 FreeBSD 的開發" -"基礎架構允許數以百計的開發者透過網際網路協同工作。 我們也經常關注著那些對我們" -"的計畫感興趣的新開發者和新的創意, 那些有興趣更進一步參與計劃的人只需要在 " -"FreeBSD 技術討論郵遞論壇 連繫我們。 FreeBSD 公告郵遞論壇 對那些希望了解我們進度的人也是相當有用的。" - -#. (itstool) path: sect2/para -#: book.translate.xml:2547 -msgid "" -"Useful things to know about the FreeBSD Project and its development process, " -"whether working independently or in close cooperation:" -msgstr "" -"無論是單獨開發者或者封閉式的團隊合作,多瞭解 FreeBSD 計劃和它的開發過程會是不" -"錯的:" - -#. (itstool) path: varlistentry/term -#: book.translate.xml:2553 -msgid "The SVN repositories" -msgstr "SVN 檔案庫" - -#. (itstool) path: para/indexterm -#: book.translate.xml:2557 -msgid "CVS" -msgstr "" - -#. (itstool) path: para/indexterm -#: book.translate.xml:2561 -msgid "CVS Repository" -msgstr "CVS 檔案庫" - -#. (itstool) path: para/indexterm -#: book.translate.xml:2565 -msgid "Concurrent Versions System CVS" -msgstr "" - -#. (itstool) path: para/indexterm -#. (itstool) path: sect1/indexterm -#: book.translate.xml:2570 book.translate.xml:45602 book.translate.xml:65535 -msgid "Subversion" -msgstr "" - -#. (itstool) path: para/indexterm -#: book.translate.xml:2574 -msgid "Subversion Repository" -msgstr "" - -#. (itstool) path: para/indexterm -#: book.translate.xml:2578 -msgid "SVN Subversion" -msgstr "" - -#. (itstool) path: listitem/para -#: book.translate.xml:2556 -msgid "" -"<_:indexterm-1/> <_:indexterm-2/> <_:indexterm-3/> <_:indexterm-4/> <_:" -"indexterm-5/> <_:indexterm-6/> For several years, the central source tree " -"for FreeBSD was maintained by CVS (Concurrent Versions System), a freely available source code " -"control tool. In June 2008, the Project switched to using SVN (Subversion). The switch was " -"deemed necessary, as the technical limitations imposed by CVS were becoming obvious due to the rapid expansion of the source " -"tree and the amount of history already stored. The Documentation Project and " -"Ports Collection repositories also moved from CVS " -"to SVN in May 2012 and July 2012, respectively. " -"Please refer to the Synchronizing your source " -"tree section for more information on obtaining the FreeBSD " -"src/ repository and Using " -"the Ports Collection for details on obtaining the FreeBSD Ports " -"Collection." -msgstr "" -"<_:indexterm-1/> <_:indexterm-2/> <_:indexterm-3/> <_:indexterm-4/> <_:" -"indexterm-5/> <_:indexterm-6/>過去數年來 FreeBSD 的中央原始碼樹 (Source " -"tree) 一直是以 CVS " -"(Concurrent Versions System) 來維護的, 它是一套免費的原始碼控管工具。 從 " -"2008 年 6 月起, FreeBSD 計劃開始改用 SVN (Subversion)。 這是一個必要的更換動作,因為隨著原始碼" -"樹及歷史版本儲存的數量不斷快速擴張,CVS 先天的技術" -"限制越來越明顯。 文件計劃與 Port 套件集檔案庫也同樣於 2012 年 5 月及 2012 年 " -"7 月由 CVS 改為 SVN。請" -"參考 同步您的原始碼樹 一節來取得有關如何取" -"得 FreeBSD src/ 檔案庫的更多資訊,以及 使用 Port 套件集 了解如何取得 FreeBSD Port 套件集。" - -#. (itstool) path: varlistentry/term -#: book.translate.xml:2605 -msgid "The committers list" -msgstr "提交者名單" - -#. (itstool) path: para/indexterm -#: book.translate.xml:2609 -msgid "committers" -msgstr "提交者" - -#. (itstool) path: listitem/para -#: book.translate.xml:2608 -msgid "" -"The committers <_:indexterm-1/> are the people who " -"have write access to the Subversion tree, and are " -"authorized to make modifications to the FreeBSD source (the term " -"committer comes from commit, the source " -"control command which is used to bring new changes into the repository). " -"Anyone can submit a bug to the Bug Database. Before submitting a bug report, the FreeBSD " -"mailing lists, IRC channels, or forums can be used to help verify that an " -"issue is actually a bug." -msgstr "" -"所謂的 提交者 (Committer) 指的是對 Subversion 原始碼樹" -"有 寫入 權限的人, 並且被授予修改 FreeBSD 原始碼的權" -"限。 (committer 一詞源自版本管理系統中的 commit 指令,該指令是用來把新的修改提交給檔案庫)。 任何人都可以回報問題到 " -"Bug Database,在" -"回報問題之前,可以使用 FreeBSD 郵遞清單、IRC 頻道或論壇來確認問題真的是一個錯" -"誤 (Bug)。" - -#. (itstool) path: varlistentry/term -#: book.translate.xml:2625 -msgid "The FreeBSD core team" -msgstr "FreeBSD 核心團隊" - -#. (itstool) path: para/indexterm -#: book.translate.xml:2629 -msgid "core team" -msgstr "核心團隊" - -#. (itstool) path: listitem/para -#: book.translate.xml:2628 -msgid "" -"The FreeBSD core team <_:indexterm-1/> would be " -"equivalent to the board of directors if the FreeBSD Project were a company. " -"The primary task of the core team is to make sure the project, as a whole, " -"is in good shape and is heading in the right directions. Inviting dedicated " -"and responsible developers to join our group of committers is one of the " -"functions of the core team, as is the recruitment of new core team members " -"as others move on. The current core team was elected from a pool of " -"committer candidates in July 2018. Elections are held every 2 years." -msgstr "" -"如果把 FreeBSD 看成是一家公司的話, FreeBSD 核心團隊 (FreeBSD " -"core team)<_:indexterm-1/> 就相當於公司的董事會。 核心團隊的主要" -"職責在於確保此計劃的整體有良好的架構,以朝著正確的方向發展。 此外,邀請敬業且" -"負責的開發者加入提交者的行列也是核心團隊的職責之一,隨著其他新成員的加入也招" -"募新的核心團隊成員。 目前的核心團隊是在 2018 年 7 月從提交者候選人之中選出來" -"的,這個選舉每兩年會舉辦一次。" - -#. (itstool) path: note/para -#: book.translate.xml:2644 -msgid "" -"Like most developers, most members of the core team are also volunteers when " -"it comes to FreeBSD development and do not benefit from the project " -"financially, so commitment should also not be misconstrued as " -"meaning guaranteed support. The board of directors analogy above is not very accurate, and it may be more suitable to " -"say that these are the people who gave up their lives in favor of FreeBSD " -"against their better judgement!" -msgstr "" -"如同多數的開發者,核心團隊大部分成員加入 FreeBSD 開發都是志工性質而已, 並未" -"從本計劃中獲得任何薪酬,所以這只是一個 承諾 不應該被誤解為 " -"保證支援 才對。 前面用 董事會 來舉例可能不是很" -"恰當,或許我們應該說: 他們是一群自願放棄原本的優渥生活、個人其他領域成就, " -"而選擇投入 FreeBSD 開發的熱血有為者才對!" - -#. (itstool) path: varlistentry/term -#: book.translate.xml:2659 -msgid "Outside contributors" -msgstr "非官方貢獻者" - -#. (itstool) path: listitem/para -#: book.translate.xml:2662 -msgid "" -"Last, but definitely not least, the largest group of developers are the " -"users themselves who provide feedback and bug fixes to us on an almost " -"constant basis. The primary way of keeping in touch with FreeBSD's more non-" -"centralized development is to subscribe to the FreeBSD technical " -"discussions mailing list where such things are discussed. See for more information about the various FreeBSD " -"mailing lists." -msgstr "" -"最後一點,但這點絕非最不重要的, 最大的開發者團隊就是持續為我們提供回饋以及錯" -"誤修正的使用者自己。 與 FreeBSD 非核心開發者互動的主要方式,便是透過訂閱 " -"FreeBSD 技術討論郵遞論壇 來進行溝通,這方面可參考,請參閱 以瞭解各式不同的 FreeBSD 郵遞論壇。" - -#. (itstool) path: para/indexterm -#: book.translate.xml:2673 -msgid "contributors" -msgstr "貢獻者" - -#. (itstool) path: listitem/para -#: book.translate.xml:2671 -msgid "" -"The FreeBSD Contributors List " -"<_:indexterm-1/> is a long and growing one, so why not join it by " -"contributing something back to FreeBSD today?" -msgstr "" -"FreeBSD 貢獻者名單 <_:" -"indexterm-1/> 相當長且不斷成長中, 只要有貢獻就會被列入其中, 要不要立即考慮" -"貢獻 FreeBSD 一些回饋呢?" - -#. (itstool) path: listitem/para -#: book.translate.xml:2678 -msgid "" -"Providing code is not the only way of contributing to the project; for a " -"more complete list of things that need doing, please refer to the FreeBSD Project web site." -msgstr "" -"提供原始碼並非為這個計劃做貢獻的唯一方式; 需要大家投入的完整工作清單請參閱 " -"FreeBSD 計畫網站。" - -#. (itstool) path: sect2/para -#: book.translate.xml:2686 -msgid "" -"In summary, our development model is organized as a loose set of concentric " -"circles. The centralized model is designed for the convenience of the " -"users of FreeBSD, who are provided with an easy way of " -"tracking one central code base, not to keep potential contributors out! Our " -"desire is to present a stable operating system with a large set of coherent " -"application programs that the users can " -"easily install and use — this model works very well in accomplishing that." -msgstr "" -"總而言之,我們的開發模式像是由鬆散的同心圓所組織。這個集中模式的設計為的是讓 " -"FreeBSD 的使用者更便利,可以很容易的追蹤同一個中央的程式" -"庫,避免把潛在的貢獻者排除在外!而我們的目標是提供一個穩定的作業系統,並有大" -"量相關的 應用程式,讓使用者能夠輕鬆的安裝與使" -"用 — 而這個開發模式對我們要完成這個目標來說運作的非常好。" - -#. (itstool) path: sect2/para -#: book.translate.xml:2696 -msgid "" -"All we ask of those who would join us as FreeBSD developers is some of the " -"same dedication its current people have to its continued success!" -msgstr "" -"我們對於那些想要加入 FreeBSD 開發者的期待是: 請保持如同前人一樣的投入,以確" -"保繼續成功!" - -#. (itstool) path: sect2/title -#: book.translate.xml:2702 -msgid "Third Party Programs" -msgstr "第三方程式" - -#. (itstool) path: sect2/para -#: book.translate.xml:2704 -msgid "" -"In addition to the base distributions, FreeBSD offers a ported software " -"collection with thousands of commonly sought-after programs. At the time of " -"this writing, there were over 24,000 ports! The list of ports ranges from " -"http servers, to games, languages, editors, and almost everything in " -"between. The entire Ports Collection requires approximately 500 MB. To " -"compile a port, you simply change to the directory of the program you wish " -"to install, type make install, and let the system do the " -"rest. The full original distribution for each port you build is retrieved " -"dynamically so you need only enough disk space to build the ports you want. " -"Almost every port is also provided as a pre-compiled package, " -"which can be installed with a simple command (pkg install) by those who do not wish to compile their own ports from source. " -"More information on packages and ports can be found in ." -msgstr "" -"除了基礎發行版之外,FreeBSD 提供了擁有上千個常用的程式的移植軟體的套件集,在" -"撰寫本文的同時,已有超過 24,000 個 Port!Port 的範圍從 HTTP 伺服器到遊戲、語" -"系、編輯器,幾乎所有東西都在裡面。完整的 Port 套件集需要將近 500 MB。要編譯一" -"個 Port 您只需要切換目錄到您想安裝的程式目錄,然後輸入 make " -"install,接著系統便會處理剩下的動作。您編譯的每個 Port 完整原始發行" -"版內容是動態下載的,所以您只需要有足夠的磁碟空間來編譯您想要的 Port。幾乎所" -"有 Port 都提供已經預先編譯好的套件,您可以透過簡單的指令來安" -"裝 (pkg install),提供那些不想要自行從原始碼編譯的人使用。" -"更多有關套件與 Port 的資訊可於 取得。" - -#. (itstool) path: sect2/title -#: book.translate.xml:2725 -msgid "Additional Documentation" -msgstr "其他文件" - -#. (itstool) path: sect2/para -#: book.translate.xml:2727 -msgid "" -"All supported FreeBSD versions provide an option in the installer to install " -"additional documentation under /usr/local/share/doc/freebsd during the initial system setup. Documentation may also be " -"installed at any later time using packages as described in . You may view the locally installed manuals " -"with any HTML capable browser using the following URLs:" -msgstr "" -"所有支援的 FreeBSD 版本都會在安裝程式中提供一個選項,讓您可以在初始化系統安裝" -"的階段安裝額外的說明文件到 /usr/local/share/doc/freebsd。說明文件也可在往後隨時使用套件安裝,詳細說明於 。您也可以使用任何支援 HTML 的瀏覽器進入下列 " -"URL 檢視已安裝在本機的手冊:" - -#. (itstool) path: varlistentry/term -#: book.translate.xml:2739 -msgid "The FreeBSD Handbook" -msgstr "FreeBSD 使用手冊" - -#. (itstool) path: listitem/para -#: book.translate.xml:2742 -msgid "" -"/usr/local/share/doc/freebsd/handbook/index.html" -msgstr "" - -#. (itstool) path: varlistentry/term -#: book.translate.xml:2747 -msgid "The FreeBSD FAQ" -msgstr "FreeBSD 常見問答集" - -#. (itstool) path: listitem/para -#: book.translate.xml:2750 -msgid "" -"/usr/local/share/doc/freebsd/faq/index.html" -msgstr "" - -#. (itstool) path: sect2/para -#: book.translate.xml:2755 -msgid "" -"You can also view the master (and most frequently updated) copies at https://www.FreeBSD.org/." -msgstr "" -"此外,可在下列網址找到最新版 (也是更新最頻繁的版本):https://www.FreeBSD.org/。" - -#. (itstool) path: info/title -#: book.translate.xml:2771 -msgid "Installing FreeBSD" -msgstr "安裝 FreeBSD" - -#. (itstool) path: authorgroup/author -#: book.translate.xml:2799 -msgid "" -" Gavin Atkinson Updated for bsdinstall by " -msgstr "" - -#. (itstool) path: authorgroup/author -#: book.translate.xml:2808 -msgid "" -" Warren Block " -msgstr "" - -#. (itstool) path: authorgroup/author -#: book.translate.xml:2817 -msgid "" -" Allan Jude Updated for root-on-ZFS by " -msgstr "" - -#. (itstool) path: sect1/indexterm -#: book.translate.xml:2831 -msgid "installation" -msgstr "安裝" - -#. (itstool) path: sect1/para -#: book.translate.xml:2833 -msgid "" -"There are several different ways of getting FreeBSD to run, depending on the " -"environment. Those are:" -msgstr "有多種不同的方法可以執行 FreeBSD,根據所在環境,包含:" - -#. (itstool) path: listitem/para -#: book.translate.xml:2838 -msgid "" -"Virtual Machine images, to download and import on a virtual environment of " -"choice. These can be downloaded from the Download FreeBSD page. There are images for " -"KVM (qcow2), VMWare (vmdk), Hyper-V " -"(vhd), and raw device images that are universally supported. " -"These are not installation images, but rather the preconfigured " -"(already installed) instances, ready to run and perform post-" -"installation tasks." -msgstr "" -"一般虛擬機映像檔,可下載並匯入到您所選擇的虛擬環境。映像檔可從 Download FreeBSD 頁面下" -"載,KVM (qcow2), VMWare (vmdk), Hyper-V " -"(vhd) 及原始裝置的映像檔都支援。這些並非安裝程式的映像檔,而是" -"已經預先設定好 (已安裝好) 的實例,可直接使用並執行安裝後的作" -"業。" - -#. (itstool) path: listitem/para -#: book.translate.xml:2851 -msgid "" -"Virtual Machine images available at Amazon's AWS Marketplace, Microsoft Azure Marketplace, and Google Cloud Platform, to run on their respective " -"hosting services. For more information on deploying FreeBSD on Azure please " -"consult the relevant chapter in the Azure Documentation." -msgstr "" -"託管服務虛擬機映像檔,可在 Amazon 的 AWS Marketplace, Microsoft Azure Marketplace 和 Google Cloud Platform 等託管服務上運行的虛擬機映像檔。有" -"關如何在 Azure 上部署 FreeBSD 的資訊可查詢 Azure 說明文件中的相關章節。" - -#. (itstool) path: listitem/para -#: book.translate.xml:2861 -msgid "" -"SD card images, for embedded systems such as Raspberry Pi or BeagleBone " -"Black. These can be downloaded from the Download FreeBSD page. These files must be " -"uncompressed and written as a raw image to an SD card, from which the board " -"will then boot." -msgstr "" -"SD 卡映像檔,供嵌入式系統,如 Raspberry Pi 或 BeagleBone Black 使用的映像檔," -"可從 Download " -"FreeBSD 頁面下載,這些檔案必須先解壓縮後以原始映像檔的格式寫入 SD 卡以" -"讓這些開發電路板能夠啟動。" - -#. (itstool) path: listitem/para -#: book.translate.xml:2870 -msgid "" -"Installation images, to install FreeBSD on a hard drive for the usual " -"desktop, laptop, or server systems." -msgstr "" -"安裝程式映像檔,用來安裝 FreeBSD 到硬碟,供一般的桌機、筆電或伺服器系統使用。" - -#. (itstool) path: sect1/para -#: book.translate.xml:2876 -msgid "" -"The rest of this chapter describes the fourth case, explaining how to " -"install FreeBSD using the text-based installation program named " -"bsdinstall." -msgstr "" -"此章接下來的部份會介紹第四個案例,說明如何使用文字介面為基礎的安裝程式 " -"bsdinstall 安裝 FreeBSD。" - -#. (itstool) path: sect1/para -#: book.translate.xml:2881 -msgid "" -"In general, the installation instructions in this chapter are written for " -"the i386 and AMD64 architectures. " -"Where applicable, instructions specific to other platforms will be listed. " -"There may be minor differences between the installer and what is shown here, " -"so use this chapter as a general guide rather than as a set of literal " -"instructions." -msgstr "" -"一般來說,本章所寫的安裝說明是針對 i386 和 " -"AMD64 架構。如果可以用於其他平台,將會列表說明。 安裝程式" -"和本章所敘述的內容可能會有些微差異,所以請將本章視為通用的指引,而不是完全照" -"著來做。" - -#. (itstool) path: note/para -#: book.translate.xml:2890 -msgid "" -"Users who prefer to install FreeBSD using a graphical installer may be " -"interested in pc-sysinstall, the installer used " -"by the TrueOS Project. It can be used to install either a graphical desktop " -"(TrueOS) or a command line version of FreeBSD. Refer to the TrueOS Users " -"Handbook for details (https://www.trueos.org/handbook/trueos.html)." -msgstr "" -"喜歡用圖形化安裝程式安裝 FreeBSD 的使用者, 可能會對 pc-" -"sysinstall 有興趣,這是 TrueOS 計畫所使用的。 他可以用來安裝圖" -"形化桌面 (TrueOS) 或是指令列版本的 FreeBSD。 細節請參考 TrueOS 使用者 " -"Handbook (https://www.trueos.org/handbook/trueos.html)。" - -#. (itstool) path: listitem/para -#: book.translate.xml:2902 -msgid "The minimum hardware requirements and FreeBSD supported architectures." -msgstr "最低的硬體需求和 FreeBSD 支援的架構。" - -#. (itstool) path: listitem/para -#: book.translate.xml:2907 -msgid "How to create the FreeBSD installation media." -msgstr "如何建立 FreeBSD 的安裝媒體。" - -#. (itstool) path: listitem/para -#: book.translate.xml:2911 -msgid "How to start bsdinstall." -msgstr "如何開始執行 bsdinstall。" - -#. (itstool) path: listitem/para -#: book.translate.xml:2916 -msgid "" -"The questions bsdinstall will ask, what they " -"mean, and how to answer them." -msgstr "" -"bsdinstall 會詢問的問題,問題代表的意思,以及如何" -"回答。" - -#. (itstool) path: listitem/para -#: book.translate.xml:2921 -msgid "How to troubleshoot a failed installation." -msgstr "安裝失敗時如何做故障排除。" - -#. (itstool) path: listitem/para -#: book.translate.xml:2925 -msgid "" -"How to access a live version of FreeBSD before committing to an installation." -msgstr "如何在正式安裝前使用 live 版本的 FreeBSD。" - -#. (itstool) path: sect1/para -#: book.translate.xml:2930 book.translate.xml:10671 book.translate.xml:13908 -#: book.translate.xml:18041 book.translate.xml:19302 book.translate.xml:23716 -#: book.translate.xml:29415 book.translate.xml:31162 book.translate.xml:31914 -#: book.translate.xml:35569 book.translate.xml:41524 book.translate.xml:41718 -#: book.translate.xml:43549 book.translate.xml:44580 book.translate.xml:46237 -#: book.translate.xml:46970 book.translate.xml:49172 book.translate.xml:50878 -#: book.translate.xml:57585 book.translate.xml:61743 -msgid "Before reading this chapter, you should:" -msgstr "在開始閱讀這章之前,您需要:" - -#. (itstool) path: listitem/para -#: book.translate.xml:2934 -msgid "" -"Read the supported hardware list that shipped with the version of FreeBSD to " -"be installed and verify that the system's hardware is supported." -msgstr "" -"閱讀即將安裝的 FreeBSD 版本所附帶的硬體支援清單,並核對系統的硬體是否有支援。" - -#. (itstool) path: sect1/title -#: book.translate.xml:2942 -msgid "Minimum Hardware Requirements" -msgstr "最低硬體需求" - -#. (itstool) path: sect1/para -#: book.translate.xml:2944 -msgid "" -"The hardware requirements to install FreeBSD vary by architecture. Hardware " -"architectures and devices supported by a FreeBSD release are listed on the " -"FreeBSD Release " -"Information page. The FreeBSD download page also has recommendations for choosing the " -"correct image for different architectures." -msgstr "" -"安裝 FreeBSD 的硬體需求隨 FreeBSD 的版本和硬體架構而不同。 FreeBSD 發行版支援" -"的硬體架構和裝置會列在 FreeBSD 發佈資訊 頁面。FreeBSD 下載頁面\n" -"也有建議如何正確的選擇在不同架構使用的映像檔。" - -#. (itstool) path: sect1/para -#: book.translate.xml:2951 -msgid "" -"A FreeBSD installation requires a minimum of 96 MB of RAM " -"and 1.5 GB of free hard drive space. However, such small amounts of memory " -"and disk space are really only suitable for custom applications like " -"embedded appliances. General-purpose desktop systems need more resources. " -"2-4 GB RAM and at least 8 GB hard drive space is a good starting point." -msgstr "" -"FreeBSD 安裝程序需要至少 96 MB 的 RAM 以及 1.5 GB 的硬碟空" -"間。然而,如此少的記憶體及磁碟空間只適合在客製的應用上,如嵌入式設備。一般用" -"途的桌面系統會需要更多的資源,2-4 GB RAM 與至少 8 GB 的硬碟空間是不錯的起點。" - -#. (itstool) path: sect1/para -#: book.translate.xml:2959 -msgid "These are the processor requirements for each architecture:" -msgstr "每一種架構的處理器需求概述如下:" - -#. (itstool) path: varlistentry/term -#: book.translate.xml:2964 -msgid "amd64" -msgstr "" - -#. (itstool) path: listitem/para -#: book.translate.xml:2966 -msgid "" -"This is the most common desktop and laptop processor type, used in most " -"modern systems. Intel calls it " -"Intel64. Other manufacturers sometimes call it " -"x86-64." -msgstr "" -"桌面電腦與筆記型電腦最常見的處理器類型,運用在近代的系統。Intel 稱該類型為 Intel64,其他" -"製造商則稱該類型為 x86-64。" - -#. (itstool) path: listitem/para -#: book.translate.xml:2971 -msgid "" -"Examples of amd64 compatible processors include: AMD Athlon64, AMD Opteron, multi-core Intel Xeon, and " -"Intel Core 2 and later processors." -msgstr "" -"與 amd64 相容的處理器範例包含:AMD Athlon64, " -"AMD Opteron, 多核心 Intel Xeon 以及 Intel Core 2 與之後的處理" -"器。" - -#. (itstool) path: varlistentry/term -#: book.translate.xml:2979 -msgid "i386" -msgstr "" - -#. (itstool) path: listitem/para -#: book.translate.xml:2981 -msgid "Older desktops and laptops often use this 32-bit, x86 architecture." -msgstr "舊型的桌面電腦與筆記型電腦常使用此 32-bit, x86 架構。" - -#. (itstool) path: listitem/para -#: book.translate.xml:2984 -msgid "" -"Almost all i386-compatible processors with a floating point unit are " -"supported. All Intel processors " -"486 or higher are supported." -msgstr "" -"幾乎所有含浮點運算單元的 i386 相容處理器都有支援。所有 Intel 486 或是更高階的處理器也有支援。" - -#. (itstool) path: listitem/para -#: book.translate.xml:2988 -msgid "" -"FreeBSD will take advantage of Physical Address Extensions (PAE) support on CPUs with this feature. A kernel " -"with the PAE feature enabled will detect memory above " -"4 GB and allow it to be used by the system. However, using PAE places constraints on device drivers and other features of FreeBSD. " -"Refer to pae4 for details." -msgstr "" -"FreeBSD 可在有支援實體位址延伸 (Physical Address Extensions, PAE) 功能的 CPU 上運用該功能所帶來的優點。有開啟 " -"PAE 支援的核心會偵測超過 4 GB 的記憶體,並讓這些超過的記憶" -"體能夠被系統使用。 但使用 PAE 會限制裝置驅動程式及 " -"FreeBSD 的其他功能,詳情請見 pae4。" - -#. (itstool) path: varlistentry/term -#: book.translate.xml:3000 -msgid "ia64" -msgstr "" - -#. (itstool) path: listitem/para -#: book.translate.xml:3002 -msgid "" -"Currently supported processors are the Itanium and the Itanium 2. Supported chipsets include the HP zx1, Intel 460GX, and Intel E8870. Both Uniprocessor (UP) and " -"Symmetric Multi-processor (SMP) configurations are " -"supported." -msgstr "" -"目前支援的處理器是 Itanium 和 " -"Itanium 2。支援的晶片組包括 HP " -"zx1, Intel 460GX 和 Intel E8870。 單處理器 (Uniprocessor, " -"UP) 和對稱多處理器 (Symmetric Multi-processor, " -"SMP) 的設定都有支援。" - -#. (itstool) path: varlistentry/term -#: book.translate.xml:3012 -msgid "powerpc" -msgstr "" - -#. (itstool) path: listitem/para -#: book.translate.xml:3014 -msgid "" -"All New World ROM Apple Mac systems with " -"built-in USB are supported. SMP is " -"supported on machines with multiple CPUs." -msgstr "" -"所有內建 USB 的 New World ROM " -"Apple Mac 系統都有支援。 SMP 在多 " -"CPU 的機器都有支援。" - -#. (itstool) path: listitem/para -#: book.translate.xml:3019 -msgid "A 32-bit kernel can only use the first 2 GB of RAM." -msgstr "32 位元的核心只能使用前 2 GB 的 RAM。" - -#. (itstool) path: varlistentry/term -#: book.translate.xml:3025 -msgid "sparc64" -msgstr "" - -#. (itstool) path: listitem/para -#: book.translate.xml:3027 -msgid "" -"Systems supported by FreeBSD/sparc64 are listed at the FreeBSD/sparc64 Project." -msgstr "" -"FreeBSD/sparc64 支援的系統列在 FreeBSD/sparc64 計劃。" - -#. (itstool) path: listitem/para -#: book.translate.xml:3031 -msgid "" -"SMP is supported on all systems with more than 1 " -"processor. A dedicated disk is required as it is not possible to share a " -"disk with another operating system at this time." -msgstr "" -"所有超過一個處理器的系統都有支援 SMP。需要專用的磁碟系統," -"因為此時無法和其他作業系統共用磁碟。" - -#. (itstool) path: sect1/title -#: book.translate.xml:3041 -msgid "Pre-Installation Tasks" -msgstr "安裝前準備工作" - -#. (itstool) path: sect1/para -#: book.translate.xml:3043 -msgid "" -"Once it has been determined that the system meets the minimum hardware " -"requirements for installing FreeBSD, the installation file should be " -"downloaded and the installation media prepared. Before doing this, check " -"that the system is ready for an installation by verifying the items in this " -"checklist:" -msgstr "" -"一旦確定系統符合安裝 FreeBSD 的最低硬體需求,就可以下載安裝檔案並準備安裝的媒" -"體。 做這些之前,先檢查以下核對清單的項目是否準備好了:" - -#. (itstool) path: step/title -#: book.translate.xml:3052 -msgid "Back Up Important Data" -msgstr "備份重要資料" - -#. (itstool) path: step/para -#: book.translate.xml:3054 -msgid "" -"Before installing any operating system, always backup " -"all important data first. Do not store the backup on the system being " -"installed. Instead, save the data to a removable disk such as a " -"USB drive, another system on the network, or an online " -"backup service. Test the backup before starting the installation to make " -"sure it contains all of the needed files. Once the installer formats the " -"system's disk, all data stored on that disk will be lost." -msgstr "" -"安裝任何作業系統前, 總是 要先備份所有重要資料。 不要儲" -"存備份在即將安裝的系統上,而是將資料儲存在可移除磁碟,像是 USB 隨身碟、網路上的另一個系統或是線上備份服務上。 開始安裝程序前要檢查" -"備份,確定備份含有所有需要的檔案,一旦安裝程式格式化系統的磁碟,所有儲存在上" -"面的資料都會遺失。" - -#. (itstool) path: step/title -#: book.translate.xml:3066 -msgid "Decide Where to Install FreeBSD" -msgstr "決定 FreeBSD 安裝在哪裡" - -#. (itstool) path: step/para -#: book.translate.xml:3068 -msgid "" -"If FreeBSD will be the only operating system installed, this step can be " -"skipped. But if FreeBSD will share the disk with another operating system, " -"decide which disk or partition will be used for FreeBSD." -msgstr "" -"如果 FreeBSD 是唯一一套要安裝到電腦的作業系統,這個步驟可以略過。 但是假如 " -"FreeBSD 要和其他作業系統共用磁碟空間的話,就要決定 FreeBSD 要安裝在哪個磁碟或" -"是哪個分割區 (Partition)。" - -#. (itstool) path: step/para -#: book.translate.xml:3073 -msgid "" -"In the i386 and amd64 architectures, disks can be divided into multiple " -"partitions using one of two partitioning schemes. A traditional " -"Master Boot Record (MBR) holds a " -"partition table defining up to four primary partitions. For historical reasons, FreeBSD calls these primary partition " -"slices. One of these primary partitions can be made " -"into an extended partition containing multiple " -"logical partitions. The GUID Partition " -"Table (GPT) is a newer and simpler method of " -"partitioning a disk. Common GPT implementations allow up " -"to 128 partitions per disk, eliminating the need for logical partitions." -msgstr "" -"在 i386 和 amd64 架構,可將磁碟分割成多個分割區,可以選擇下列兩種分割表格式 " -"(Partitioning scheme) 的其中一種達成。 傳統的主開機紀錄 (Master " -"Boot Record, MBR) 的一個分割區表定義最多可有四" -"個主分割區 (Primary partition),因一些歷史淵源," -"FreeBSD 稱這些主分割區為 slice,其中一個主分割區可作為" -"延伸分割區 (Extended partition),延伸分割區又可分割成" -"多個邏輯分割區 (Logical partition)。 GUID " -"分割區表 (GUID Partition Table, GPT) 是較新和" -"較簡單的分割磁碟的方法,一般 GPT 實作允許每個磁碟多達 128 " -"個分割區,不再需要使用邏輯分割區。" - -#. (itstool) path: warning/para -#: book.translate.xml:3091 -msgid "" -"Some older operating systems, like Windows XP, are not compatible with the GPT partition " -"scheme. If FreeBSD will be sharing a disk with such an operating system, " -"MBR partitioning is required." -msgstr "" -"一些比較舊的作業系統,像是 Windows XP 並不相容 GPT 分割表格式。 如果 FreeBSD 將和" -"這類作業系統共用一個磁碟,則需要用 MBR 分割表格式。" - -#. (itstool) path: step/para -#: book.translate.xml:3098 -msgid "" -"The FreeBSD boot loader requires either a primary or GPT " -"partition. If all of the primary or GPT partitions are " -"already in use, one must be freed for FreeBSD. To create a partition without " -"deleting existing data, use a partition resizing tool to shrink an existing " -"partition and create a new partition using the freed space." -msgstr "" -"FreeBSD 開機啟動程式需要主分割區或是 GPT 分割區。如果所有" -"的主分割區或 GPT 分割區都已使用,必須釋放其中一個分割區讓 " -"FreeBSD 使用。如果要建立一個分割區而不刪除原有的資料,可以使用磁碟重設大小的" -"工具來縮小現有的分割區,並使用釋放出來的空間建立新分割區。" - -#. (itstool) path: step/para -#: book.translate.xml:3106 -msgid "" -"A variety of free and commercial partition resizing tools are listed at " -"http://en.wikipedia.org/wiki/" -"List_of_disk_partitioning_software. GParted Live (http://gparted.sourceforge.net/livecd.php) is a free live " -"CD which includes the GParted " -"partition editor. GParted is also included with " -"many other Linux live CD distributions." -msgstr "" -"各種免費和付費的磁碟重設大小工具列於 http://en.wikipedia.org/wiki/" -"List_of_disk_partitioning_software。GParted Live (http://gparted.sourceforge.net/livecd.php) 是內含分割區編輯程式 " -"GParted 的免費 Live CD。 " -"GParted 同時也被許多 Linux Live CD 發行版所收錄。" - -#. (itstool) path: warning/para -#: book.translate.xml:3116 -msgid "" -"When used properly, disk shrinking utilities can safely create space for " -"creating a new partition. Since the possibility of selecting the wrong " -"partition exists, always backup any important data and verify the integrity " -"of the backup before modifying disk partitions." -msgstr "" -"在正確使用的情況下,磁碟重設大小的工具可以安全的建立讓新的分割區使用的空間。 " -"但因仍有可能會誤選已經存在的分割區,所以在修改磁碟分割區前, 一定要備份重要資" -"料,並確認備份的完整性。" - -#. (itstool) path: step/para -#: book.translate.xml:3123 -msgid "" -"Disk partitions containing different operating systems make it possible to " -"install multiple operating systems on one computer. An alternative is to use " -"virtualization () which allows multiple " -"operating systems to run at the same time without modifying any disk " -"partitions." -msgstr "" -"在磁碟分割區中儲存不同的作業系統讓一台電腦可以安裝多個作業系統,另一種作法是" -"使用虛擬化技術 () ,可讓多個作業系統同時間" -"執行而不需要改變任何磁碟分割區。" - -#. (itstool) path: step/title -#: book.translate.xml:3132 -msgid "Collect Network Information" -msgstr "收集網路資訊" - -#. (itstool) path: step/para -#: book.translate.xml:3134 -msgid "" -"Some FreeBSD installation methods require a network connection in order to " -"download the installation files. After any installation, the installer will " -"offer to setup the system's network interfaces." -msgstr "" -"部份 FreeBSD 安裝方式需要網路連線來下載安裝檔,因此之後的安裝程序,安裝程式進" -"入設定系統網路的介面。" - -#. (itstool) path: step/para -#: book.translate.xml:3139 -msgid "" -"If the network has a DHCP server, it can be used to " -"provide automatic network configuration. If DHCP is not " -"available, the following network information for the system must be obtained " -"from the local network administrator or Internet service provider:" -msgstr "" -"如果網路中有 DHCP 伺服器,則可透過該伺服器自動設定網路,若" -"無法使用 DHCP,則需要從區域網路管理者或是網際網路服務供應" -"商 (Internet Service Provider, ISP) 取得以的網路資訊供系統使用:" - -#. (itstool) path: orderedlist/title -#: book.translate.xml:3147 -msgid "Required Network Information" -msgstr "需要的網路資訊" - -#. (itstool) path: listitem/para -#. (itstool) path: row/entry -#: book.translate.xml:3150 book.translate.xml:53932 -msgid "IP address" -msgstr "IP 位址" - -#. (itstool) path: listitem/para -#: book.translate.xml:3154 -msgid "Subnet mask" -msgstr "子網路遮罩" - -#. (itstool) path: listitem/para -#: book.translate.xml:3158 -msgid "IP address of default gateway" -msgstr "預設通訊閘 IP 位址" - -#. (itstool) path: listitem/para -#: book.translate.xml:3163 -msgid "Domain name of the network" -msgstr "網路的網域名稱" - -#. (itstool) path: listitem/para -#: book.translate.xml:3167 -msgid "" -"IP addresses of the network's DNS " -"servers" -msgstr "網路 DNS 伺服器 IP 位址" - -#. (itstool) path: step/title -#: book.translate.xml:3174 -msgid "Check for FreeBSD Errata" -msgstr "檢查 FreeBSD 勘誤表" - -#. (itstool) path: step/para -#: book.translate.xml:3176 -msgid "" -"Although the FreeBSD Project strives to ensure that each release of FreeBSD " -"is as stable as possible, bugs occasionally creep into the process. On very " -"rare occasions those bugs affect the installation process. As these problems " -"are discovered and fixed, they are noted in the FreeBSD Errata (https://www.freebsd." -"org/releases/12.0R/errata.html) on the FreeBSD web site. Check the " -"errata before installing to make sure that there are no problems that might " -"affect the installation." -msgstr "" -"儘管 FreeBSD 計劃努力確保每個 FreeBSD 發行版能夠儘可能地穩定,但臭蟲偶爾還是" -"會悄悄出現,並有極小的可能會發生影響安裝流程的錯誤,當這些問題被發現並修正" -"後,會被紀錄在 FreeBSD 網站的 FreeBSD 勘誤表 (https://www.freebsd.org/" -"releases/12.0R/errata.html)。 安裝前先檢查勘誤表,以確保沒有會影響到安" -"裝的問題。" - -#. (itstool) path: step/para -#: book.translate.xml:3186 -msgid "" -"Information and errata for all the releases can be found on the release " -"information section of the FreeBSD web site (https://www.freebsd.org/releases/" -"index.html)." -msgstr "" -"所有發行版的資訊和勘誤表可以在 FreeBSD 網站的發行資訊找到 (https://www.freebsd.org/releases/" -"index.html)。" - -#. (itstool) path: sect2/title -#: book.translate.xml:3193 -msgid "Prepare the Installation Media" -msgstr "準備安裝的媒體" - -#. (itstool) path: sect2/para -#: book.translate.xml:3195 -msgid "" -"The FreeBSD installer is not an application that can be run from within " -"another operating system. Instead, download a FreeBSD installation file, " -"burn it to the media associated with its file type and size (CD, DVD, or USB), and boot the " -"system to install from the inserted media." -msgstr "" -"FreeBSD 安裝程式並不是一個可以在其他作業系統上執行的應用程式,反而您需要下載 " -"FreeBSD 安裝檔,燒錄安裝檔到符合其檔案類型與大小的媒體 (CD, DVDUSB),然後開機從插入的" -"媒體來安裝。" - -#. (itstool) path: sect2/para -#: book.translate.xml:3202 -msgid "" -"FreeBSD installation files are available at www.freebsd.org/where." -"html#download. Each installation file's name includes the release " -"version of FreeBSD, the architecture, and the type of file. For example, to " -"install FreeBSD 10.2 on an amd64 system from a DVD, " -"download FreeBSD-10.2-RELEASE-amd64-dvd1.iso, burn this " -"file to a DVD, and boot the system with the DVD inserted." -msgstr "" -"FreeBSD 的安裝檔可於 www.freebsd.org/where.html#download 取得。安裝檔的名稱由 FreeBSD 發" -"佈版本、架構、以及檔案類型所組成,舉例,要從 DVD 安裝 " -"FreeBSD 10.2 到 amd64 的系統,需下載 FreeBSD-10.2-RELEASE-amd64-" -"dvd1.iso,並燒錄這個檔案到 DVD,然後使用插入 " -"DVD 來開機。" - -#. (itstool) path: sect2/para -#: book.translate.xml:3211 -msgid "" -"Installation files are available in several formats. The formats vary " -"depending on computer architecture and media type." -msgstr "安裝檔有許多種可用的格式,格式會依據電腦架構及媒體類型的不同而異。" - -#. (itstool) path: sect2/para -#. (itstool) id: book.translate.xml#bsdinstall-installation-media-uefi -#: book.translate.xml:3215 -msgid "" -"Additional installation files are included for computers that boot with " -"UEFI (Unified Extensible Firmware Interface). The names " -"of these files include the string uefi." -msgstr "" -"還有另一種安裝檔是給使用 UEFI (Unified Extensible " -"Firmware Interface) 開機的電腦使用,這些安裝檔的名稱會含有 uefi。" - -#. (itstool) path: sect2/para -#: book.translate.xml:3221 -msgid "File types:" -msgstr "檔案類型:" - -#. (itstool) path: listitem/para -#: book.translate.xml:3225 -msgid "" -"-bootonly.iso: This is the smallest installation file as " -"it only contains the installer. A working Internet connection is required " -"during installation as the installer will download the files it needs to " -"complete the FreeBSD installation. This file should be burned to a " -"CD using a CD burning application." -msgstr "" -"-bootonly.iso:這是最精簡的安裝檔,檔案中只含安裝程式。 安" -"裝時需要網際網路連線來下載所需的檔案以完成 FreeBSD 安裝。這個檔案應使用 " -"CD 燒錄應用程式燒錄到 CD 使用。" - -#. (itstool) path: listitem/para -#: book.translate.xml:3235 -msgid "" -"-disc1.iso: This file contains all of the files needed to " -"install FreeBSD, its source, and the Ports Collection. It should be burned " -"to a CD using a CD burning application." -msgstr "" -"-disc1.iso:這個檔案含有所有安裝 FreeBSD 所需的檔案,包含" -"原始碼及 Port 套件集。這個檔案應使用 CD 燒錄應用程式燒錄" -"到 CD 使用。" - -#. (itstool) path: listitem/para -#: book.translate.xml:3243 -msgid "" -"-dvd1.iso: This file contains all of the files needed to " -"install FreeBSD, its source, and the Ports Collection. It also contains a " -"set of popular binary packages for installing a window manager and some " -"applications so that a complete system can be installed from media without " -"requiring a connection to the Internet. This file should be burned to a " -"DVD using a DVD burning application." -msgstr "" -"-dvd1.iso:這個檔案含有所有安裝 FreeBSD 所需的檔案,包含原" -"始碼及 Port 套件集,也內含熱門的 Binary 套件可安裝視窗管理程式以及一些應用程" -"式,如此便可從媒體安裝完整的系統,無須連線到網際網路。這個檔案應使用 " -"DVD 燒錄應用程式燒錄到 DVD 使用。" - -#. (itstool) path: listitem/para -#: book.translate.xml:3254 -msgid "" -"-memstick.img: This file contains all of the files needed " -"to install FreeBSD, its source, and the Ports Collection. It should be " -"burned to a USB stick using the instructions below." -msgstr "" -"-memstick.img:這個檔案含有所有安裝 FreeBSD 所需的檔案,包" -"含原始碼及 Port 套件集。這個檔案應依據以下操作指示寫入到 USB 隨身碟使用。" - -#. (itstool) path: listitem/para -#: book.translate.xml:3262 -msgid "" -"-mini-memstick.img: Like -bootonly.iso, does not include installation files, but downloads them as needed. " -"A working internet connection is required during installation. Write this " -"file to a USB stick as shown in ." -msgstr "" -"-mini-memstick.img:類似 -bootonly.iso,但不含安裝檔 (可依所要下載),安裝時需要網際網路連線,可依 的說明將此檔案寫入至 USB 隨身" -"碟。" - -#. (itstool) path: sect2/para -#: book.translate.xml:3271 -msgid "" -"After downloading the image file, download CHECKSUM.SHA256 from the same directory. Calculate a checksum for the image file. FreeBSD provides " -"sha2561 for this, used as sha256 imagefilename. Other operating systems have similar programs." -msgstr "" -"映像檔下載完成之後,下載同一個目錄之中的 CHECKSUM.SHA256。FreeBSD 提供 sha2561 可用來計算映像檔的 " -"校驗碼 (Checksum),使用方式為 sha256 " -"imagefilename,其他作業系統也會有類似的" -"程式。" - -#. (itstool) path: sect2/para -#: book.translate.xml:3279 -msgid "" -"Compare the calculated checksum with the one shown in CHECKSUM." -"SHA256. The checksums must match exactly. If the checksums do not " -"match, the image file is corrupt and must be downloaded again." -msgstr "" -"比對計算後的校驗碼與 CHECKSUM.SHA256 檔案中的值,校驗碼" -"應該要完全相符,若校驗碼不相符,則代表該映像檔是損壞的,必須再下載一次。" - -#. (itstool) path: sect3/title -#: book.translate.xml:3285 -msgid "Writing an Image File to USB" -msgstr "寫入映象檔到 USB" - -#. (itstool) path: sect3/para -#: book.translate.xml:3287 -msgid "" -"The *.img file is an image of the " -"complete contents of a memory stick. It cannot be " -"copied to the target device as a file. Several applications are available " -"for writing the *.img to a USB " -"stick. This section describes two of these utilities." -msgstr "" -"*.img 檔案是隨身碟的完整內容的映像檔 (image),該檔案不能直接用檔案的方式複製到目標裝置。有" -"許多應用程式可用來寫入 *.imgUSB " -"隨身碟,本節會介紹其中兩種。" - -#. (itstool) path: important/para -#: book.translate.xml:3296 -msgid "" -"Before proceeding, back up any important data on the USB " -"stick. This procedure will erase the existing data on the stick." -msgstr "" -"在繼續之前,請先備份 USB 上的重要資料,這個程序會清除在隨" -"身碟上既有的資料。" - -#. (itstool) path: procedure/title -#: book.translate.xml:3302 -msgid "Using dd to Write the Image" -msgstr "使用 dd 來寫入映像檔" - -#. (itstool) path: warning/para -#: book.translate.xml:3306 -msgid "" -"This example uses /dev/da0 as the target device where " -"the image will be written. Be very careful that the " -"correct device is used as this command will destroy the existing data on the " -"specified target device." -msgstr "" -"本範例使用 /dev/da0 做為目標裝置,是映像檔將會寫入的位" -"置。 務必十分小心確認要使用的裝置正確,因為這個指示會摧" -"毀所有在指定目標裝置上已存在的資料。" - -#. (itstool) path: step/para -#: book.translate.xml:3314 -msgid "" -"The dd1 command-line utility is available on BSD, Linux, and Mac OS systems. To burn the image using dd, insert the USB stick and determine its device " -"name. Then, specify the name of the downloaded installation file and the " -"device name for the USB stick. This example burns the " -"amd64 installation image to the first USB device on an " -"existing FreeBSD system." -msgstr "" -"dd1 指令列工具在 BSD, Linux 以及Mac OS 系統皆可使" -"用。要使用 dd 燒錄映像檔需先插入 USB 隨" -"身碟,然後確認隨身碟的裝置名稱。然後指定已下載的安裝檔名稱以及 USB 隨身碟的裝置名稱。本例示範在已有的 FreeBSD 系統燒錄 amd64 安裝映像檔" -"到第一個 USB 裝置。" - -#. (itstool) path: step/screen -#: book.translate.xml:3325 -#, no-wrap -msgid "# dd if=FreeBSD-10.2-RELEASE-amd64-memstick.img of=/dev/da0 bs=1M conv=sync" -msgstr "" - -#. (itstool) path: step/para -#: book.translate.xml:3327 -msgid "" -"If this command fails, verify that the USB stick is not " -"mounted and that the device name is for the disk, not a partition. Some " -"operating systems might require this command to be run with " -"sudo8. The dd1 syntax varies slightly " -"across different platforms; for example, Mac OS requires a lower-case . Systems " -"like Linux might buffer writes. " -"To force all writes to complete, use sync8." -msgstr "" -"若這個指示執行失敗,請確認 USB 隨身碟是否還未掛載,以及該" -"裝置名稱是否指向這個隨身碟,而不是一個分割區。有些作業系統可能需要使用 " -"sudo8 來執行這個指令。且 dd1 的指令語法在不同的作業" -"系統上有些不同,例如在 Mac OS 需" -"要使用小寫的 ,而在 Linux 這類的系統可能會暫存寫入動作,要強制完成所有寫入動作,需" -"使用 sync8。" - -#. (itstool) path: procedure/title -#: book.translate.xml:3341 -msgid "" -"Using Windows to Write the Image" -msgstr "使用 Windows 來寫入映象檔" - -#. (itstool) path: warning/para -#: book.translate.xml:3344 -msgid "" -"Be sure to give the correct drive letter as the existing data on the " -"specified drive will be overwritten and destroyed." -msgstr "" -"務必確認指定的磁碟機代號正確,因在指定磁碟機上的既有資料將會被覆蓋與摧毀。" - -#. (itstool) path: step/title -#: book.translate.xml:3350 -msgid "" -"Obtaining Image Writer for Windows" -msgstr "" -"取得 Image Writer Windows" - -#. (itstool) path: step/para -#: book.translate.xml:3353 -msgid "" -"Image Writer for Windows is a free application that can correctly write an " -"image file to a memory stick. Download it from https://sourceforge.net/projects/" -"win32diskimager/ and extract it into a folder." -msgstr "" -"Image Writer Windows 是一個免費的應用程式,可以正確地將映像檔寫入隨身" -"碟。可從 https://sourceforge.net/projects/win32diskimager/ 下載,並解壓縮到一" -"個資料夾。" - -#. (itstool) path: step/title -#: book.translate.xml:3361 -msgid "Writing the Image with Image Writer" -msgstr "用 Image Writer 寫入映象檔" - -#. (itstool) path: step/para -#: book.translate.xml:3363 -msgid "" -"Double-click the Win32DiskImager icon to start " -"the program. Verify that the drive letter shown under " -"Device is the drive with the memory stick. " -"Click the folder icon and select the image to be written to the memory " -"stick. Click [ Save ] to accept the image file name. " -"Verify that everything is correct, and that no folders on the memory stick " -"are open in other windows. When everything is ready, click " -"[ Write ] to write the image file to the memory stick." -msgstr "" -"雙擊 Win32DiskImager 圖示啟動程式。 確認 " -"Device 顯示的磁碟機代號是隨身碟的磁碟機代" -"號。 按下資料夾圖示選擇要寫入隨身碟的映像檔。 按下 [ Save ] 按鈕確定映像檔名。 確認所有東西都正確,隨身碟的資料夾並沒有在其他" -"視窗開啟。 所有東西準備好後,按下 [ Write ] 將映像檔寫" -"入隨身碟。" - -#. (itstool) path: sect3/para -#: book.translate.xml:3378 -msgid "You are now ready to start installing FreeBSD." -msgstr "您現在可以開始安裝 FreeBSD 。" - -#. (itstool) path: sect1/title -#: book.translate.xml:3384 -msgid "Starting the Installation" -msgstr "開始安裝" - -#. (itstool) path: important/para -#: book.translate.xml:3387 -msgid "" -"By default, the installation will not make any changes to the disk(s) before " -"the following message:" -msgstr "預設安裝程序在下列訊息顯示之前不會對磁碟做任何更動:" - -#. (itstool) path: important/programlisting -#: book.translate.xml:3390 -#, no-wrap -msgid "" -"Your changes will now be written to disk. If you\n" -"have chosen to overwrite existing data, it will\n" -"be PERMANENTLY ERASED. Are you sure you want to\n" -"commit your changes?" -msgstr "" - -#. (itstool) path: important/para -#: book.translate.xml:3395 -msgid "" -"The install can be exited at any time prior to this warning. If there is a " -"concern that something is incorrectly configured, just turn the computer off " -"before this point and no changes will be made to the system's disks." -msgstr "" -"在這個警告訊息之前可以隨時中止安裝,若有任何設定錯誤的疑慮,只需在此時關閉電" -"腦,將不會對系統磁碟做任何更改。" - -#. (itstool) path: sect1/para -#: book.translate.xml:3402 -msgid "" -"This section describes how to boot the system from the installation media " -"which was prepared using the instructions in . When using a bootable USB stick, plug in the " -"USB stick before turning on the computer. When booting " -"from CD or DVD, turn on the computer " -"and insert the media at the first opportunity. How to configure the system " -"to boot from the inserted media depends upon the architecture." -msgstr "" -"本節將介紹如何使用根據 指示" -"所準備的安裝媒體來開機。要使用可開機的 USB,請在開啟電腦前插入 USB 隨身碟。要使用 CDDVD,則可" -"開啟電腦後在第一時間插入媒體。如何設定系統使用插入的媒體開機依不同的系統架構" -"會有所不同。" - -#. (itstool) path: sect2/title -#: book.translate.xml:3413 -msgid "Booting on i386 and amd64" -msgstr "在 i386 及 amd64 開機" - -#. (itstool) path: sect2/para -#: book.translate.xml:3415 -msgid "" -"These architectures provide a BIOS menu for selecting the " -"boot device. Depending upon the installation media being used, select the " -"CD/DVD or USB " -"device as the first boot device. Most systems also provide a key for " -"selecting the boot device during startup without having to enter the " -"BIOS. Typically, the key is either F10, " -"F11, F12, or Escape." -msgstr "" -"這兩種架構提供了 BIOS 選單可選擇開機的裝置,依據要使用的安" -"裝媒體類型,選擇 CD/DVD 或 " -"USB 裝置做為第一個開機裝置。大多數的系統也會提供快速鍵可在" -"啟動時選擇開機裝置,而不需要進入BIOS,通常這個按鍵可能是 " -"F10, F11, F12 或 " -"Escape 其中之一。" - -#. (itstool) path: sect2/para -#: book.translate.xml:3426 -msgid "" -"If the computer loads the existing operating system instead of the FreeBSD " -"installer, then either:" -msgstr "若電腦仍載入了現有的作業系統,而不是 FreeBSD 安裝程式,原因可能為:" - -#. (itstool) path: listitem/para -#: book.translate.xml:3431 -msgid "" -"The installation media was not inserted early enough in the boot process. " -"Leave the media inserted and try restarting the computer." -msgstr "" -"執行開機程序時安裝媒體插入主機的時間不夠早,請讓安裝媒體留在電腦中並重新啟動" -"電腦。" - -#. (itstool) path: listitem/para -#: book.translate.xml:3437 -msgid "" -"The BIOS changes were incorrect or not saved. Double-" -"check that the right boot device is selected as the first boot device." -msgstr "" -"未正確修改 BIOS 或未儲檔,請再三檢查第一個開機裝置選擇了正" -"確的裝置。" - -#. (itstool) path: listitem/para -#: book.translate.xml:3443 -msgid "" -"This system is too old to support booting from the chosen media. In this " -"case, the Plop Boot Manager () can be used to boot the " -"system from the selected media." -msgstr "" -"系統太舊,無法支援使用選擇的開機媒體開機,發生這個情況可以使用 " -"Plop Boot Manager () 來從選擇的開機媒體開機。" - -#. (itstool) path: sect2/title -#: book.translate.xml:3453 -msgid "Booting on PowerPC" -msgstr "在 PowerPC 開機" - -#. (itstool) path: sect2/para -#: book.translate.xml:3455 -msgid "" -"On most machines, holding C on the keyboard during boot " -"will boot from the CD. Otherwise, hold Command Option O F , or " -"Windows Alt O F on non-Apple " -"keyboards. At the 0 > prompt, enter" -msgstr "" -"在大部份機型,可於開機時按住鍵盤上的 C,便可從 CD 開機。若在非 Apple 的鍵" -"盤則可按住 Command " -"Option O F 或 " -" Windows Alt " -"O F ,出現 0 > 提示時,輸入" - -#. (itstool) path: sect2/screen -#: book.translate.xml:3471 -#, no-wrap -msgid "boot cd:,\\ppc\\loader cd:0" -msgstr "" - -#. (itstool) path: sect2/title -#: book.translate.xml:3475 -msgid "Booting on SPARC64" -msgstr "在 SPARC64 開機" - -#. (itstool) path: sect2/para -#: book.translate.xml:3477 -msgid "" -"Most SPARC64 systems are set up " -"to boot automatically from disk. To install FreeBSD from a CD requires a break into the PROM." -msgstr "" -"大多數 SPARC64 系統會自動從磁碟開" -"機,要從 CD 安裝 FreeBSD 需要進入 PROM。" - -#. (itstool) path: sect2/para -#: book.translate.xml:3481 -msgid "" -"To do this, reboot the system and wait until the boot message appears. The " -"message depends on the model, but should look something like this:" -msgstr "" -"要進入 PROM,需重新開機系統然後等候開機訊息出現。訊息會依" -"機型而有所不同,但大致結果會如:" - -#. (itstool) path: sect2/screen -#: book.translate.xml:3485 -#, no-wrap -msgid "" -"Sun Blade 100 (UltraSPARC-IIe), Keyboard Present\n" -"Copyright 1998-2001 Sun Microsystems, Inc. All rights reserved.\n" -"OpenBoot 4.2, 128 MB memory installed, Serial #51090132.\n" -"Ethernet address 0:3:ba:b:92:d4, Host ID: 830b92d4." -msgstr "" - -#. (itstool) path: sect2/para -#: book.translate.xml:3490 -msgid "" -"If the system proceeds to boot from disk at this point, press L1A or " -"StopA on the keyboard, or send a BREAK over the " -"serial console. When using tip or " -"cu, ~# will issue a BREAK. The " -"PROM prompt will be ok on systems with " -"one CPU and ok {0} on SMP systems, where the digit indicates the number of the active " -"CPU." -msgstr "" -"若系統繼續從磁碟開機,此時按下鍵盤上的 L1AStopA 或透過序列 " -"Console 送出 BREAK。當使用 tip " -"或 cu, ~# 發出一個 BREAK 後," -"PROM 的提示會在單 CPU 的系統出現 " -"okSMP 的系統出現 ok {0} ,其中的數字代表啟動的 CPU 數。" - -#. (itstool) path: sect2/para -#: book.translate.xml:3502 -msgid "" -"At this point, place the CD into the drive and type " -"boot cdrom from the PROM prompt." -msgstr "" -"此時,放入 CD 到磁碟機然後在 PROM 提示" -"畫面輸入 boot cdrom。" - -#. (itstool) path: sect2/title -#: book.translate.xml:3508 -msgid "FreeBSD Boot Menu" -msgstr "FreeBSD 開機選單" - -#. (itstool) path: sect2/para -#: book.translate.xml:3510 -msgid "" -"Once the system boots from the installation media, a menu similar to the " -"following will be displayed:" -msgstr "從安裝媒體開機之後,會顯示如下的選單:" - -#. (itstool) path: figure/title -#: book.translate.xml:3514 -msgid "FreeBSD Boot Loader Menu" -msgstr "FreeBSD 開機載入程式選單" - -#. (itstool) path: imageobject/imagedata -#. This is a reference to an external file such as an image or video. When -#. the file changes, the md5 hash will change to let you know you need to -#. update your localized copy. The msgstr is not used at all. Set it to -#. whatever you like once you have updated your copy of the file. -#: book.translate.xml:3518 -msgctxt "_" -msgid "" -"external ref='bsdinstall/bsdinstall-newboot-loader-menu' md5='__failed__'" -msgstr "" - -#. (itstool) path: sect2/para -#: book.translate.xml:3523 -msgid "" -"By default, the menu will wait ten seconds for user input before booting " -"into the FreeBSD installer or, if FreeBSD is already installed, before " -"booting into FreeBSD. To pause the boot timer in order to review the " -"selections, press Space. To select an option, press its " -"highlighted number, character, or key. The following options are available." -msgstr "" -"預設在開機進入 FreeBSD 安裝程式前選單會等候使用者輸入 10 秒鐘,若已經安裝 " -"FreeBSD,則會在開機進入 FreeBSD 前等候。要暫停開機計時器來仔細查看選項,請按 " -"Space 鍵。要選擇選項,按下明顯標示的數字、字元或按鍵。選單有" -"以下選項可選。" - -#. (itstool) path: listitem/para -#: book.translate.xml:3533 -msgid "" -"Boot Multi User: This will continue the FreeBSD boot " -"process. If the boot timer has been paused, press 1, upper- " -"or lower-case B, or Enter." -msgstr "" -"啟動多使用者模式 (Boot Multi User):這個選項會繼續 " -"FreeBSD 開機程序,若開機計時器已經暫停,可按 1、大寫或小寫 " -"BEnter 鍵。" - -#. (itstool) path: listitem/para -#: book.translate.xml:3541 -msgid "" -"Boot Single User: This mode can be used to fix an " -"existing FreeBSD installation as described in . Press 2 or the upper- or lower-case S to enter this mode." -msgstr "" -"啟動單使用者模式 (Boot Single User):這個模式用來修正已安" -"裝的 FreeBSD,如 所述。可按 2、大寫或小寫 S 進入這個模式。" - -#. (itstool) path: listitem/para -#: book.translate.xml:3549 -msgid "" -"Escape to loader prompt: This will boot the system into a " -"repair prompt that contains a limited number of low-level commands. This " -"prompt is described in . Press 3 or Esc to boot into this prompt." -msgstr "" -"離開到載入程式提示 (Escape to loader prompt):這個選項會開" -"機進入修復提示,這個模式含有有限數量的低階指令,這個模式詳細說明於 。可按 3Esc 進" -"入這個提示。" - -#. (itstool) path: listitem/para -#: book.translate.xml:3558 -msgid "Reboot: Reboots the system." -msgstr "重新開機 (Reboot):重新開啟系統。" - -#. (itstool) path: listitem/para -#: book.translate.xml:3562 -msgid "" -"Configure Boot Options: Opens the menu shown in, and " -"described under, ." -msgstr "" -"設定開機選項 (Configure Boot Options):開啟內部選單,詳細" -"說明於 。" - -#. (itstool) path: figure/title -#: book.translate.xml:3568 -msgid "FreeBSD Boot Options Menu" -msgstr "FreeBSD 開機選項選單" - -#. (itstool) path: imageobject/imagedata -#. This is a reference to an external file such as an image or video. When -#. the file changes, the md5 hash will change to let you know you need to -#. update your localized copy. The msgstr is not used at all. Set it to -#. whatever you like once you have updated your copy of the file. -#: book.translate.xml:3572 -msgctxt "_" -msgid "external ref='bsdinstall/bsdinstall-boot-options-menu' md5='__failed__'" -msgstr "" - -#. (itstool) path: sect2/para -#: book.translate.xml:3577 -msgid "" -"The boot options menu is divided into two sections. The first section can be " -"used to either return to the main boot menu or to reset any toggled options " -"back to their defaults." -msgstr "" -"開機選項選單分成兩個部份。第一個部份用來返回主開機選單或重設任何已切換的選項" -"回預設值。" - -#. (itstool) path: sect2/para -#: book.translate.xml:3582 -msgid "" -"The next section is used to toggle the available options to On or Off by pressing the option's highlighted " -"number or character. The system will always boot using the settings for " -"these options until they are modified. Several options can be toggled using " -"this menu:" -msgstr "" -"第二個部份用來切換可用的選項為開 (On) 或關 (Off),透過按下選項明顯標示的編號或字元。系統將會一直使用這些選項開機,直" -"到選項被修改。有數個選項可以在這個選單做切換:" - -#. (itstool) path: listitem/para -#: book.translate.xml:3591 -msgid "" -"ACPI Support: If the system hangs during boot, try " -"toggling this option to Off." -msgstr "" -"ACPI 支援 (ACPI Support):若系統在開機時卡住,可嘗試切換這" -"個選項為關 (Off)。" - -#. (itstool) path: listitem/para -#: book.translate.xml:3597 -msgid "" -"Safe Mode: If the system still hangs during boot even " -"with ACPI Support set to Off, try " -"setting this option to On." -msgstr "" -"安全模式 (Safe Mode):若系統在 ACPI 支援 (ACPI " -"Support) 設為關 (Off) 時開機時仍然會卡住,可嘗試" -"將此選項設為開 (On)。" - -#. (itstool) path: listitem/para -#: book.translate.xml:3604 -msgid "" -"Single User: Toggle this option to On " -"to fix an existing FreeBSD installation as described in . Once the problem is fixed, set it back to Off." -msgstr "" -"單使用者 (Single User):切換這個選項為開 (On) 來修正已存在的 FreeBSD 如 所" -"述,問題修正後,將其設回關 (Off)。" - -#. (itstool) path: listitem/para -#: book.translate.xml:3612 -msgid "" -"Verbose: Toggle this option to On to " -"see more detailed messages during the boot process. This can be useful when " -"troubleshooting a piece of hardware." -msgstr "" -"詳細資訊 (Verbose):切換這個選項為開 (On) 來查看開機程序中更詳細的訊息,這在診斷硬體問題時非常有用。" - -#. (itstool) path: sect2/para -#: book.translate.xml:3619 -msgid "" -"After making the needed selections, press 1 or " -"Backspace to return to the main boot menu, then press " -"Enter to continue booting into FreeBSD. A series of boot " -"messages will appear as FreeBSD carries out its hardware device probes and " -"loads the installation program. Once the boot is complete, the welcome menu " -"shown in will be displayed." -msgstr "" -"在做完所需的選擇後,按下 1Backspace 返" -"回主開機選單,然後按下 Enter 繼續開機進入 FreeBSD。FreeBSD " -"執行裝置偵測及載入安裝程式時會顯示一系列的開機訊息,開機完成之後,會顯示歡迎" -"選單如 。" - -#. (itstool) path: figure/title -#: book.translate.xml:3628 -msgid "Welcome Menu" -msgstr "歡迎選單" - -#. (itstool) path: imageobject/imagedata -#. This is a reference to an external file such as an image or video. When -#. the file changes, the md5 hash will change to let you know you need to -#. update your localized copy. The msgstr is not used at all. Set it to -#. whatever you like once you have updated your copy of the file. -#: book.translate.xml:3632 -msgctxt "_" -msgid "external ref='bsdinstall/bsdinstall-choose-mode' md5='__failed__'" -msgstr "" - -#. (itstool) path: sect2/para -#: book.translate.xml:3637 -msgid "" -"Press Enter to select the default of " -"[ Install ] to enter the installer. The rest of this " -"chapter describes how to use this installer. Otherwise, use the right or " -"left arrows or the colorized letter to select the desired menu item. The " -"[ Shell ] can be used to access a FreeBSD shell in " -"order to use command line utilities to prepare the disks before " -"installation. The [ Live CD ] option can be used to " -"try out FreeBSD before installing it. The live version is described in ." -msgstr "" -"按下 Enter 選擇預設的 [ Install ] 進" -"入安裝程式,接下來本章將介紹如何使用這個安裝程式。 若要選擇其他項目,可使用右" -"或左方向鍵或顏色標示的字母選擇想要的選單項目。[ Shell ] 可用來進入 FreeBSD 的 Shell 使用指令列工具在安裝之前準備磁碟。" -"[ Live CD ] 選項可用來在安裝之前試用 FreeBSD,Live 版" -"本的詳細說明於 。" - -#. (itstool) path: tip/para -#: book.translate.xml:3650 -msgid "" -"To review the boot messages, including the hardware device probe, press the " -"upper- or lower-case S and then Enter to " -"access a shell. At the shell prompt, type more /var/run/dmesg.boot and use the space bar to scroll through the messages. When " -"finished, type exit to return to the welcome menu." -msgstr "" -"要重新檢視開機訊息,包含硬體裝置偵測,請按大寫或小寫 S 然後" -"再按 Enter 進入 Shell。在 Shell 提示之後輸入 more /" -"var/run/dmesg.boot 然後使用空白鍵來捲動訊息。當查看完畢後輸入 " -"exit 返回歡迎選單。" - -#. (itstool) path: sect1/title -#: book.translate.xml:3663 -msgid "Using bsdinstall" -msgstr "使用 bsdinstall" - -#. (itstool) path: sect1/para -#: book.translate.xml:3665 -msgid "" -"This section shows the order of the bsdinstall " -"menus and the type of information that will be asked before the system is " -"installed. Use the arrow keys to highlight a menu option, then " -"Space to select or deselect that menu item. When finished, " -"press Enter to save the selection and move onto the next " -"screen." -msgstr "" -"本節將告訴您在系統安裝之前 bsdinstall 選單的順序以" -"及會詢問的資訊類型,可使用方向鍵來選擇選單的選項,然後按下 Space 選擇或取消選擇選單項目。當完成之後,按下 Enter 儲存" -"選項然後進入下一個畫面。" - -#. (itstool) path: sect2/title -#: book.translate.xml:3674 -msgid "Selecting the Keymap Menu" -msgstr "選擇鍵盤對應表選單" - -#. (itstool) path: sect2/para -#: book.translate.xml:3676 -msgid "" -"Depending on the system console being used, bsdinstall may initially display the menu shown in ." -msgstr "" -"依據使用的系統 Console,bsdinstall 可能一開始顯示" -"的選單會如 。" - -#. (itstool) path: figure/title -#: book.translate.xml:3681 -msgid "Keymap Selection" -msgstr "鍵盤對應表選擇" - -#. (itstool) path: imageobject/imagedata -#. This is a reference to an external file such as an image or video. When -#. the file changes, the md5 hash will change to let you know you need to -#. update your localized copy. The msgstr is not used at all. Set it to -#. whatever you like once you have updated your copy of the file. -#: book.translate.xml:3685 -msgctxt "_" -msgid "" -"external ref='bsdinstall/bsdinstall-keymap-select-default' md5='__failed__'" -msgstr "" - -#. (itstool) path: sect2/para -#: book.translate.xml:3690 -msgid "" -"To configure the keyboard layout, press Enter with " -"[ YES ] selected, which will display the menu shown " -"in . To instead use the default " -"layout, use the arrow key to select [ NO ] and press " -"Enter to skip this menu screen." -msgstr "" -"要設定鍵盤配置,請選擇 [ YES ] 按下 Enter,接著會顯示選單如 。若要" -"使用預設的配置,則可使用方向鍵選擇 [ NO ] 然後按下 " -"Enter 跳過這個選單畫面。" - -#. (itstool) path: figure/title -#: book.translate.xml:3699 -msgid "Selecting Keyboard Menu" -msgstr "選擇鍵盤選單" - -#. (itstool) path: imageobject/imagedata -#. This is a reference to an external file such as an image or video. When -#. the file changes, the md5 hash will change to let you know you need to -#. update your localized copy. The msgstr is not used at all. Set it to -#. whatever you like once you have updated your copy of the file. -#: book.translate.xml:3703 -msgctxt "_" -msgid "external ref='bsdinstall/bsdinstall-config-keymap' md5='__failed__'" -msgstr "" - -#. (itstool) path: sect2/para -#: book.translate.xml:3708 -msgid "" -"When configuring the keyboard layout, use the up and down arrows to select " -"the keymap that most closely represents the mapping of the keyboard attached " -"to the system. Press Enter to save the selection." -msgstr "" -"設定鍵盤配置時,可使用上與下方向鍵來選擇最接近已連接到系統的鍵盤的鍵盤對應表 " -"(Keymap),然後按下 Enter 儲存選項。" - -#. (itstool) path: note/para -#: book.translate.xml:3714 -msgid "" -"Pressing Esc will exit this menu and use the default " -"keymap. If the choice of keymap is not clear, United States of " -"America ISO-8859-1 is also a safe option." -msgstr "" -"按 Esc 會離開這個選單然後使用預設的鍵盤對應表,若不清楚要使" -"用那種鍵盤對應表,United States of America ISO-8859-1 是也是保險的選項。" - -#. (itstool) path: sect2/para -#: book.translate.xml:3720 -msgid "" -"In FreeBSD 10.0-RELEASE and later, this menu has been enhanced. The full " -"selection of keymaps is shown, with the default preselected. In addition, " -"when selecting a different keymap, a dialog is displayed that allows the " -"user to try the keymap and ensure it is correct before proceeding." -msgstr "" -"在 FreeBSD 10.0-RELEASE 以及之後的版本,已經加強了這個選單,會顯示完整的鍵盤" -"對應表選項,並預先選擇預設值。另外,當選擇其他鍵盤對應用時,在繼續之前會顯示" -"對話框讓使用者測試鍵盤對應表來確認。" - -#. (itstool) path: figure/title -#: book.translate.xml:3727 -msgid "Enhanced Keymap Menu" -msgstr "改進後的鍵盤對應表選單" - -#. (itstool) path: imageobject/imagedata -#. This is a reference to an external file such as an image or video. When -#. the file changes, the md5 hash will change to let you know you need to -#. update your localized copy. The msgstr is not used at all. Set it to -#. whatever you like once you have updated your copy of the file. -#: book.translate.xml:3731 -msgctxt "_" -msgid "external ref='bsdinstall/bsdinstall-keymap-10' md5='__failed__'" -msgstr "" - -#. (itstool) path: sect2/title -#. (itstool) path: figure/title -#: book.translate.xml:3739 book.translate.xml:3746 -msgid "Setting the Hostname" -msgstr "設定主機名稱" - -#. (itstool) path: sect2/para -#: book.translate.xml:3741 -msgid "" -"The next bsdinstall menu is used to set the " -"hostname for the newly installed system." -msgstr "" -"下一個 bsdinstall 選單用來為新安裝的系統設定主機名" -"稱。" - -#. (itstool) path: imageobject/imagedata -#. This is a reference to an external file such as an image or video. When -#. the file changes, the md5 hash will change to let you know you need to -#. update your localized copy. The msgstr is not used at all. Set it to -#. whatever you like once you have updated your copy of the file. -#: book.translate.xml:3750 -msgctxt "_" -msgid "external ref='bsdinstall/bsdinstall-config-hostname' md5='__failed__'" -msgstr "" - -#. (itstool) path: sect2/para -#: book.translate.xml:3755 -msgid "" -"Type in a hostname that is unique for the network. It should be a fully-" -"qualified hostname, such as machine3." -"example.com." -msgstr "" -"輸入在網路上獨一無二的主機名稱,主機名稱要是完整的主機名稱,如 machine3.example.com。" - -#. (itstool) path: sect2/title -#. (itstool) path: figure/title -#: book.translate.xml:3760 book.translate.xml:3766 -msgid "Selecting Components to Install" -msgstr "選擇要安裝的元件" - -#. (itstool) path: sect2/para -#: book.translate.xml:3762 -msgid "" -"Next, bsdinstall will prompt to select optional " -"components to install." -msgstr "" -"接下來 bsdinstall 會提示選擇要安裝的選用元件。" - -#. (itstool) path: imageobject/imagedata -#. This is a reference to an external file such as an image or video. When -#. the file changes, the md5 hash will change to let you know you need to -#. update your localized copy. The msgstr is not used at all. Set it to -#. whatever you like once you have updated your copy of the file. -#: book.translate.xml:3770 -msgctxt "_" -msgid "external ref='bsdinstall/bsdinstall-config-components' md5='__failed__'" -msgstr "" - -#. (itstool) path: sect2/para -#: book.translate.xml:3775 -msgid "" -"Deciding which components to install will depend largely on the intended use " -"of the system and the amount of disk space available. The FreeBSD kernel and " -"userland, collectively known as the base system, are " -"always installed. Depending on the architecture, some of these components " -"may not appear:" -msgstr "" -"決定要安裝的元件主要會根據系統的用途以及可用的磁碟空間容量。FreeBSD 核心 " -"(Kernel) 及 Userland 統稱為 基礎系統 (Base system),是" -"必須安裝的部份。依據系統的架構,部份元件可能不會顯示:" - -#. (itstool) path: listitem/para -#: book.translate.xml:3784 -msgid "" -"doc - Additional documentation, mostly of historical " -"interest, to install into /usr/share/doc. The " -"documentation provided by the FreeBSD Documentation Project may be installed " -"later using the instructions in ." -msgstr "" -"doc - 額外的說明文件,大部份是經年累月的產物,會安裝到 " -"/usr/share/doc。由 FreeBSD 文件計劃所提供的說明文件可在" -"之後安裝,依照 中的指示" -"操作。" - -#. (itstool) path: listitem/para -#: book.translate.xml:3792 -msgid "" -"games - Several traditional BSD games, " -"including fortune, rot13, and others." -msgstr "" -"games - 數個傳統 BSD 遊戲,包含 " -"fortune, rot13 以及其" -"他。" - -#. (itstool) path: listitem/para -#: book.translate.xml:3799 -msgid "" -"lib32 - Compatibility libraries for running 32-bit " -"applications on a 64-bit version of FreeBSD." -msgstr "" -"lib32 - 在 64-bit 版本的 FreeBSD 供執行 32-bit 應用程式使" -"用的相容性程式庫。" - -#. (itstool) path: listitem/para -#: book.translate.xml:3805 -msgid "" -"ports - The FreeBSD Ports Collection is a collection of " -"files which automates the downloading, compiling and installation of third-" -"party software packages. discusses how to use the " -"Ports Collection." -msgstr "" -"ports - FreeBSD Port 套件集是一套可自動下載、編譯安裝第三" -"方軟體套件的集合, 中會討論到如何使用 Port 套件集。" - -#. (itstool) path: warning/para -#: book.translate.xml:3812 -msgid "" -"The installation program does not check for adequate disk space. Select this " -"option only if sufficient hard disk space is available. The FreeBSD Ports " -"Collection takes up about 500 MB of disk space." -msgstr "" -"安裝程式並不會檢查是否有充足的磁碟空間,FreeBSD Port 套件集會使用約 500 MB 的" -"磁碟空間,只有在有足夠的磁碟空間時才選擇這個選項。" - -#. (itstool) path: listitem/para -#: book.translate.xml:3821 -msgid "" -"src - The complete FreeBSD source code for both the " -"kernel and the userland. Although not required for the majority of " -"applications, it may be required to build device drivers, kernel modules, or " -"some applications from the Ports Collection. It is also used for developing " -"FreeBSD itself. The full source tree requires 1 GB of disk space and " -"recompiling the entire FreeBSD system requires an additional 5 GB of space." -msgstr "" -"src - 完整的 FreeBSD 原始碼,包含核心 (Kernel) 與 " -"Userland。雖然大多數的應用程式並不需要,但它可以編譯裝置驅動程式、核心模組或" -"部份來自 Port 套件集的應用程式,它同時也用來做為開發 FreeBSD 本身所使用。完整" -"的原始碼樹需要 1 GB 的磁碟空間,重新編譯整個 FreeBSD 系統需要額外再 5 GB 的空" -"間。" - -#. (itstool) path: sect2/title -#. (itstool) path: figure/title -#: book.translate.xml:3834 book.translate.xml:3845 -msgid "Installing from the Network" -msgstr "從網路安裝" - -#. (itstool) path: sect2/para -#: book.translate.xml:3836 -msgid "" -"The menu shown in only " -"appears when installing from a -bootonly.iso " -"CD as this installation media does not hold copies of the " -"installation files. Since the installation files must be retrieved over a " -"network connection, this menu indicates that the network interface must be " -"first configured." -msgstr "" -"於 所示的選單只會在使用 " -"-bootonly.iso CD 安裝時顯示,因這個安" -"裝媒體中並未含安裝檔的複本。由於安裝檔必須透過網路下載,此選單會告知要先設定" -"網路介面。" - -#. (itstool) path: imageobject/imagedata -#. This is a reference to an external file such as an image or video. When -#. the file changes, the md5 hash will change to let you know you need to -#. update your localized copy. The msgstr is not used at all. Set it to -#. whatever you like once you have updated your copy of the file. -#: book.translate.xml:3849 -msgctxt "_" -msgid "external ref='bsdinstall/bsdinstall-netinstall-files' md5='__failed__'" -msgstr "" - -#. (itstool) path: sect2/para -#: book.translate.xml:3854 -msgid "" -"To configure the network connection, press Enter and follow " -"the instructions in . Once " -"the interface is configured, select a mirror site that is located in the " -"same region of the world as the computer on which FreeBSD is being " -"installed. Files can be retrieved more quickly when the mirror is close to " -"the target computer, reducing installation time." -msgstr "" -"要設定網路連線,按下 Enter 然後依照 中的指示操作,完成網路介面的設定之後,選" -"擇與要安裝 FreeBSD 的電腦相同所在地區的鏡像站,當鏡像站越接近目標電腦,檔案下" -"載的速度會比較快,這會減少安裝的時間。" - -#. (itstool) path: figure/title -#: book.translate.xml:3863 -msgid "Choosing a Mirror" -msgstr "選擇鏡像站" - -#. (itstool) path: imageobject/imagedata -#. This is a reference to an external file such as an image or video. When -#. the file changes, the md5 hash will change to let you know you need to -#. update your localized copy. The msgstr is not used at all. Set it to -#. whatever you like once you have updated your copy of the file. -#: book.translate.xml:3867 -msgctxt "_" -msgid "" -"external ref='bsdinstall/bsdinstall-netinstall-mirrorselect' md5='__failed__'" -msgstr "" - -#. (itstool) path: sect2/para -#: book.translate.xml:3872 -msgid "" -"Installation will then continue as if the installation files were located on " -"the local installation media." -msgstr "若在本機的安裝媒體中找到安裝檔案,安裝程序便會繼續。" - -#. (itstool) path: sect1/title -#: book.translate.xml:3878 -msgid "Allocating Disk Space" -msgstr "配置磁碟空間" - -#. (itstool) path: sect1/para -#: book.translate.xml:3880 -msgid "" -"The next menu is used to determine the method for allocating disk space." -msgstr "接下來的選單用來決定配置磁碟空間的方式。" - -#. (itstool) path: figure/title -#: book.translate.xml:3884 -msgid "Partitioning Choices on FreeBSD 10.x and Higher" -msgstr "FreeBSD 10.x 或更新版本的磁碟分割選項" - -#. (itstool) path: imageobject/imagedata -#. This is a reference to an external file such as an image or video. When -#. the file changes, the md5 hash will change to let you know you need to -#. update your localized copy. The msgstr is not used at all. Set it to -#. whatever you like once you have updated your copy of the file. -#: book.translate.xml:3888 -msgctxt "_" -msgid "external ref='bsdinstall/bsdinstall-zfs-partmenu' md5='__failed__'" -msgstr "" - -#. (itstool) path: sect1/para -#: book.translate.xml:3893 -msgid "" -"Guided partitioning automatically sets up the disk " -"partitions, Manual partitioning allows advanced users to " -"create customized partitions from menu options, and Shell " -"opens a shell prompt where advanced users can create customized partitions " -"using command-line utilities like gpart8, " -"fdisk8, and bsdlabel8. ZFS partitioning, only available in FreeBSD 10 and later, creates an " -"optionally encrypted root-on-ZFS system with support for boot " -"environments." -msgstr "" -"引導式 (Guided) 磁碟分割會自動設定磁碟的分割區 " -"(Partition),手動 (Manual) 磁碟分割可讓進階的使用者使用選" -"單項目建立自訂的分割區,而 Shell 會開啟 Shell 提示讓進階的" -"使用者可以使用指示列工具如 gpart8, " -"fdisk8 以及 bsdlabel8 來建立自訂的分割區。" -"ZFS 磁碟分割只在 FreeBSD 10 及之後的版本可以使用,可建立選" -"擇性加密的 root-on-ZFS 系統並支援 開機環境 (Boot environment)。" - -#. (itstool) path: sect1/para -#: book.translate.xml:3904 -msgid "" -"This section describes what to consider when laying out the disk partitions. " -"It then demonstrates how to use the different partitioning methods." -msgstr "" -"本節會介紹在配置磁碟分割時需要考量那些事情,並且會示範各種磁碟分割的方式。" - -#. (itstool) path: sect2/title -#: book.translate.xml:3909 -msgid "Designing the Partition Layout" -msgstr "規劃分割區配置" - -#. (itstool) path: sect2/indexterm -#: book.translate.xml:3911 -msgid "partition layout" -msgstr "分割區配置" - -#. (itstool) path: sect2/indexterm -#: book.translate.xml:3912 -msgid "/etc" -msgstr "" - -#. (itstool) path: sect2/indexterm -#: book.translate.xml:3915 -msgid "/var" -msgstr "" - -#. (itstool) path: sect2/indexterm -#: book.translate.xml:3918 -msgid "/usr" -msgstr "" - -#. (itstool) path: sect2/para -#: book.translate.xml:3922 -msgid "" -"When laying out file systems, remember that hard drives transfer data faster " -"from the outer tracks to the inner. Thus, smaller and heavier-accessed file " -"systems should be closer to the outside of the drive, while larger " -"partitions like /usr should be placed toward the inner " -"parts of the disk. It is a good idea to create partitions in an order " -"similar to: /, swap, /var, and " -"/usr." -msgstr "" -"配置檔案系統時要記得硬碟的資料傳輸的速度外軌較內軌快,因此較小且大量存取的檔" -"案系統應要較接近磁碟的外軌,而較大的分割區如 /usr 應放置" -"在磁碟較內部,建議建立分割區的順序如下:/, swap, " -"/var 然後 /usr。" - -#. (itstool) path: sect2/para -#: book.translate.xml:3932 -msgid "" -"The size of the /var partition reflects the intended " -"machine's usage. This partition is used to hold mailboxes, log files, and " -"printer spools. Mailboxes and log files can grow to unexpected sizes " -"depending on the number of users and how long log files are kept. On " -"average, most users rarely need more than about a gigabyte of free disk " -"space in /var." -msgstr "" -"機器預期的用途會反映到 /var 分割區的大小,這個分割區用來" -"保存郵件 (Mailbox)、日誌檔 (Log file) 及印表機緩衝 (Spool)。依使用者數及保存" -"的期間,郵件及日誌檔可能成長到無法預期的大小,一般來說大部份的使用很少會在 " -"/var 需要超過 1 GB 的可用磁碟空間。" - -#. (itstool) path: note/para -#: book.translate.xml:3942 -msgid "" -"Sometimes, a lot of disk space is required in /var/tmp. " -"When new software is installed, the packaging tools extract a temporary copy " -"of the packages under /var/tmp. Large software " -"packages, like Firefox, Apache " -"OpenOffice or LibreOffice may be " -"tricky to install if there is not enough disk space under /var/" -"tmp." -msgstr "" -"有時在 /var/tmp 會需要較多的空間,當新軟體安裝,套件工具" -"會從套件中取出暫存的複本置於 /var/tmp。若在 /" -"var/tmp 沒有足夠的空間,要安裝大型軟體套件,例如 " -"Firefox, Apache OpenOfficeLibreOffice 會很困難。" - -#. (itstool) path: sect2/para -#: book.translate.xml:3953 -msgid "" -"The /usr partition holds many of the files which " -"support the system, including the FreeBSD Ports Collection and system source " -"code. At least 2 gigabytes of space is recommended for this partition." -msgstr "" -"/usr 分割區保存了許多支持系統運作的檔案,包含 FreeBSD " -"Port 套件集以及系統原始碼,這個分割區建議至少要有 2 GB 的空間。" - -#. (itstool) path: sect2/para -#: book.translate.xml:3958 -msgid "" -"When selecting partition sizes, keep the space requirements in mind. Running " -"out of space in one partition while barely using another can be a hassle." -msgstr "" -"在規劃分割區大小時,請牢記空間需求,當因某個分割區空間不足時要改使用其他分割" -"區時會很麻煩。" - -#. (itstool) path: sect2/indexterm -#: book.translate.xml:3962 -msgid "swap sizing" -msgstr "" - -#. (itstool) path: sect2/indexterm -#: book.translate.xml:3965 -msgid "swap partition" -msgstr "" - -#. (itstool) path: sect2/para -#: book.translate.xml:3969 -msgid "" -"As a rule of thumb, the swap partition should be about double the size of " -"physical memory (RAM). Systems with minimal RAM may perform better with more swap. Configuring too little swap can " -"lead to inefficiencies in the VM page scanning code and " -"might create issues later if more memory is added." -msgstr "" -"根據經驗,交換分割區應為是實體記憶體 (RAM) 的兩倍。使用最" -"低需求的 RAM 來運作的系統會需要更多的交換空間來取得更好的" -"表現。配置太小的交換交間可能導致 VM 分頁掃描碼效率不佳,且" -"往後增加更多記憶體時可能會產生問題。" - -#. (itstool) path: sect2/para -#: book.translate.xml:3977 -msgid "" -"On larger systems with multiple SCSI disks or multiple " -"IDE disks operating on different controllers, it is " -"recommended that swap be configured on each drive, up to four drives. The " -"swap partitions should be approximately the same size. The kernel can handle " -"arbitrary sizes but internal data structures scale to 4 times the largest " -"swap partition. Keeping the swap partitions near the 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." -msgstr "" -"在有數個 SCSI 磁碟或數個 IDE 磁碟在不同" -"控制器的大型系統建議在每個磁碟機上都設定交換空間,最多可至四個磁碟機。每個交" -"換分割區的大小應接近相同。核心雖可以處以任意大小的交換空間,但內部資料結構擴" -"充到 4 倍的最大交換分割區大小時,讓交換分割區擁有相同的大小可以讓核心可以最佳" -"的方式串連各個磁碟的交換空間。規劃較大交換空間是可以的,即使沒有使用到多少交" -"換空間,這也會讓要從失控的程式恢復運作更容易,而不需強制重新啟動系統。" - -#. (itstool) path: sect2/para -#: book.translate.xml:3990 -msgid "" -"By properly partitioning a system, fragmentation introduced in the smaller " -"write heavy partitions will not bleed over into the mostly read partitions. " -"Keeping the write loaded partitions closer to the disk's edge will increase " -"I/O performance in the partitions where it occurs the " -"most. While I/O performance in the larger partitions may " -"be needed, shifting them more toward the edge of the disk will not lead to a " -"significant performance improvement over moving /var to " -"the edge." -msgstr "" -"正確的做磁碟分割,可以區隔頻繁寫入所產生的資料碎片與經常讀取的分割區,將寫入" -"頻繁的分割區放在磁碟的邊緣可以增加 I/O 效率。雖然較大的分" -"割區可能也需要增加 I/O 效率,但將這些分割區往磁碟邊緣移動" -"所增加的效率並不會比將 /var 移到磁碟邊緣所增加的效率來的" -"顯著。" - -#. (itstool) path: sect2/title -#: book.translate.xml:4003 -msgid "Guided Partitioning" -msgstr "引導式磁碟分割" - -#. (itstool) path: sect2/para -#: book.translate.xml:4005 -msgid "" -"When this method is selected, a menu will display the available disk(s). If " -"multiple disks are connected, choose the one where FreeBSD is to be " -"installed." -msgstr "" -"當選擇這個方法,選單上會顯示可用的磁碟,若電腦有安裝多個磁碟,則需選擇其中一" -"個來安裝 FreeBSD。" - -#. (itstool) path: figure/title -#: book.translate.xml:4010 -msgid "Selecting from Multiple Disks" -msgstr "自多個磁碟選擇" - -#. (itstool) path: imageobject/imagedata -#. This is a reference to an external file such as an image or video. When -#. the file changes, the md5 hash will change to let you know you need to -#. update your localized copy. The msgstr is not used at all. Set it to -#. whatever you like once you have updated your copy of the file. -#: book.translate.xml:4014 -msgctxt "_" -msgid "external ref='bsdinstall/bsdinstall-part-guided-disk' md5='__failed__'" -msgstr "" - -#. (itstool) path: sect2/para -#: book.translate.xml:4019 -msgid "" -"Once the disk is selected, the next menu prompts to install to either the " -"entire disk or to create a partition using free space. If " -"[ Entire Disk ] is chosen, a general partition layout " -"filling the whole disk is automatically created. Selecting " -"[ Partition ] creates a partition layout from the " -"unused space on the disk." -msgstr "" -"選擇磁碟之後,接下來選單會提示是否要安裝到整個磁碟或是使用剩餘的空間建立新的" -"分割區。若選擇 [ Entire Disk ],會自動建立通用的分割區" -"配置來填滿整個磁碟。選擇 [ Partition ] 則會使用磁碟上" -"未使用的空間來建立分割區配置。" - -#. (itstool) path: figure/title -#: book.translate.xml:4029 -msgid "Selecting Entire Disk or Partition" -msgstr "選擇完整磁碟或分割區" - -#. (itstool) path: imageobject/imagedata -#. This is a reference to an external file such as an image or video. When -#. the file changes, the md5 hash will change to let you know you need to -#. update your localized copy. The msgstr is not used at all. Set it to -#. whatever you like once you have updated your copy of the file. -#: book.translate.xml:4033 -msgctxt "_" -msgid "external ref='bsdinstall/bsdinstall-part-entire-part' md5='__failed__'" -msgstr "" - -#. (itstool) path: sect2/para -#: book.translate.xml:4038 -msgid "" -"After the partition layout has been created, review it to ensure it meets " -"the needs of the installation. Selecting [ Revert ] " -"will reset the partitions to their original values and pressing " -"[ Auto ] will recreate the automatic FreeBSD " -"partitions. Partitions can also be manually created, modified, or deleted. " -"When the partitioning is correct, select [ Finish ] " -"to continue with the installation." -msgstr "" -"分割區配置建立完成之後,再檢查一次確定是否符合安裝的需求。選擇 " -"[ Revert ] 會重設分割區回復為原來的設定值,選擇 " -"[ Auto ] 會重新建立自動配置的 FreeBSD 分割區。分割區也" -"可以手動建立、修改或刪除。當確認磁碟分割正確之後,選擇 " -"[ Finish ] 繼續安裝。" - -#. (itstool) path: figure/title -#: book.translate.xml:4049 -msgid "Review Created Partitions" -msgstr "確認已建立的分割區" - -#. (itstool) path: imageobject/imagedata -#. This is a reference to an external file such as an image or video. When -#. the file changes, the md5 hash will change to let you know you need to -#. update your localized copy. The msgstr is not used at all. Set it to -#. whatever you like once you have updated your copy of the file. -#: book.translate.xml:4053 -msgctxt "_" -msgid "external ref='bsdinstall/bsdinstall-part-review' md5='__failed__'" -msgstr "" - -#. (itstool) path: sect2/title -#: book.translate.xml:4060 -msgid "Manual Partitioning" -msgstr "手動磁碟分割" - -#. (itstool) path: sect2/para -#: book.translate.xml:4062 -msgid "Selecting this method opens the partition editor:" -msgstr "選擇這個方法會開啟分割區編輯程式:" - -#. (itstool) path: figure/title -#: book.translate.xml:4065 book.translate.xml:4080 book.translate.xml:4152 -msgid "Manually Create Partitions" -msgstr "手動建立分割區" - -#. (itstool) path: imageobject/imagedata -#. This is a reference to an external file such as an image or video. When -#. the file changes, the md5 hash will change to let you know you need to -#. update your localized copy. The msgstr is not used at all. Set it to -#. whatever you like once you have updated your copy of the file. -#: book.translate.xml:4069 -msgctxt "_" -msgid "" -"external ref='bsdinstall/bsdinstall-part-manual-create' md5='__failed__'" -msgstr "" - -#. (itstool) path: sect2/para -#: book.translate.xml:4074 -msgid "" -"Highlight the installation drive (ada0 in this example) " -"and select [ Create ] to display a menu of available " -"partition schemes:" -msgstr "" -"選擇要安裝的磁碟機 (在這個例子為 ada0) 然後選擇 " -"[ Create ] 會以選單顯示可用的分割表格式 (Partition " -"scheme):" - -#. (itstool) path: imageobject/imagedata -#. This is a reference to an external file such as an image or video. When -#. the file changes, the md5 hash will change to let you know you need to -#. update your localized copy. The msgstr is not used at all. Set it to -#. whatever you like once you have updated your copy of the file. -#: book.translate.xml:4084 -msgctxt "_" -msgid "" -"external ref='bsdinstall/bsdinstall-part-manual-partscheme' md5='__failed__'" -msgstr "" - -#. (itstool) path: sect2/para -#: book.translate.xml:4089 -msgid "" -"GPT is usually the most appropriate choice for amd64 " -"computers. Older computers that are not compatible with GPT should use MBR. The other partition schemes are " -"generally used for uncommon or older computers." -msgstr "" -"amd64 電腦最適合的選擇通常是 GPT,無法相容 GPT 的舊電腦則應使用 MBR。而其他分割表格式一般會用在" -"那些較罕見或較舊的電腦上。" - -#. (itstool) path: table/title -#: book.translate.xml:4096 -msgid "Partitioning Schemes" -msgstr "磁碟分割表格式" - -#. (itstool) path: row/entry -#: book.translate.xml:4101 -msgid "Abbreviation" -msgstr "縮寫" - -#. (itstool) path: row/entry -#: book.translate.xml:4102 book.translate.xml:7065 book.translate.xml:8403 -#: book.translate.xml:11910 book.translate.xml:23042 book.translate.xml:23221 -#: book.translate.xml:27327 book.translate.xml:31316 book.translate.xml:43584 -#: book.translate.xml:45762 book.translate.xml:53274 book.translate.xml:53781 -#: book.translate.xml:54540 book.translate.xml:54581 book.translate.xml:65535 -msgid "Description" -msgstr "說明" - -#. (itstool) path: row/entry -#. (itstool) path: glossentry/glossterm -#. (itstool) path: glossentry/acronym -#: book.translate.xml:4108 book.translate.xml:65535 -msgid "APM" -msgstr "" - -#. (itstool) path: row/entry -#: book.translate.xml:4109 -msgid "" -"Apple Partition Map, used by PowerPC." -msgstr "" -"Apple Partition Map,用於 PowerPC。" - -#. (itstool) path: row/entry -#. (itstool) path: glossentry/glossterm -#. (itstool) path: glossentry/acronym -#: book.translate.xml:4113 book.translate.xml:65535 -msgid "BSD" -msgstr "" - -#. (itstool) path: row/entry -#: book.translate.xml:4114 -msgid "" -"BSD label without an MBR, sometimes " -"called dangerously dedicated mode as non-" -"BSD disk utilities may not recognize it." -msgstr "" -"無 MBRBSD 標籤,因非 BSD 的磁碟工具可能無法辨識該標籤,有時被稱做 危險專用模式 " -"(Dangerously dedicated mode)。" - -#. (itstool) path: row/entry -#: book.translate.xml:4122 -msgid "GPT" -msgstr "" - -#. (itstool) path: row/entry -#: book.translate.xml:4123 -msgid "" -"GUID Partition Table (http://en.wikipedia.org/wiki/GUID_Partition_Table)." -msgstr "" -"GUID 分割區表 (http://en.wikipedia.org/wiki/GUID_Partition_Table)。" - -#. (itstool) path: row/entry -#: book.translate.xml:4127 -msgid "MBR" -msgstr "" - -#. (itstool) path: row/entry -#: book.translate.xml:4128 -msgid "" -"Master Boot Record (http://en.wikipedia.org/wiki/Master_boot_record)." -msgstr "" -"主開機記錄 (http://en.wikipedia.org/wiki/Master_boot_record)。" - -#. (itstool) path: row/entry -#: book.translate.xml:4132 -msgid "PC98" -msgstr "" - -#. (itstool) path: row/entry -#: book.translate.xml:4133 -msgid "" -"MBR variant used by NEC PC-98 computers (http://en.wikipedia.org/wiki/Pc9801)." -msgstr "" -"使用 MBR 改編,用於 NEC PC-98 電腦 (http://en.wikipedia.org/wiki/Pc9801)。" - -#. (itstool) path: row/entry -#: book.translate.xml:4138 -msgid "VTOC8" -msgstr "" - -#. (itstool) path: row/entry -#: book.translate.xml:4139 -msgid "Volume Table Of Contents used by Sun SPARC64 and UltraSPARC computers." -msgstr "Volume Table Of Contents,用於 Sun SPARC64 及 UltraSPARC 電腦。" - -#. (itstool) path: sect2/para -#: book.translate.xml:4146 -msgid "" -"After the partitioning scheme has been selected and created, select " -"[ Create ] again to create the partitions. The " -"Tab key is used to move the cursor between fields." -msgstr "" -"選擇完分割區表格式並建立之後,再選擇 [ Create ] 一次來" -"建立分割區。Tab 鍵可用來在欄位間移動游標。" - -#. (itstool) path: imageobject/imagedata -#. This is a reference to an external file such as an image or video. When -#. the file changes, the md5 hash will change to let you know you need to -#. update your localized copy. The msgstr is not used at all. Set it to -#. whatever you like once you have updated your copy of the file. -#: book.translate.xml:4156 -msgctxt "_" -msgid "" -"external ref='bsdinstall/bsdinstall-part-manual-addpart' md5='__failed__'" -msgstr "" - -#. (itstool) path: sect2/para -#: book.translate.xml:4161 -msgid "" -"A standard FreeBSD GPT installation uses at least three " -"partitions:" -msgstr "標準的 FreeBSD GPT 安裝會使用至少三種分割區:" - -#. (itstool) path: listitem/para -#: book.translate.xml:4166 -msgid "freebsd-boot - Holds the FreeBSD boot code." -msgstr "freebsd-boot - 儲存 FreeBSD 開機程式 (Boot code)。" - -#. (itstool) path: listitem/para -#: book.translate.xml:4171 -msgid "" -"freebsd-ufs - A FreeBSD UFS file " -"system." -msgstr "" -"freebsd-ufs - FreeBSD 的 UFS 檔案系統。" - -#. (itstool) path: listitem/para -#: book.translate.xml:4176 -msgid "freebsd-swap - FreeBSD swap space." -msgstr "freebsd-swap - FreeBSD 交換空間。" - -#. (itstool) path: sect2/para -#: book.translate.xml:4181 -msgid "" -"Another partition type worth noting is freebsd-zfs, used " -"for partitions that will contain a FreeBSD ZFS file " -"system (). Refer to " -"gpart8 for descriptions of the available GPT " -"partition types." -msgstr "" -"另一個值得注意的分割區類型是 freebsd-zfs,這個分割區用來放" -"置 FreeBSD ZFS 檔案系統 ()。請參考 " -"gpart8 取得可用的 GPT 分割區類型說明。" - -#. (itstool) path: sect2/para -#: book.translate.xml:4187 -msgid "" -"Multiple file system partitions can be created and some people prefer a " -"traditional layout with separate partitions for /, " -"/var, /tmp, and /usr. See for an " -"example." -msgstr "" -"檔案系統分割區可建立多個,且有部份人會偏好使用傳統的配置方式將 /, /var, /tmp 以及 " -"/usr 分開存放在不同的分割區。請參考 的範例。" - -#. (itstool) path: sect2/para -#: book.translate.xml:4194 -msgid "" -"The Size may be entered with common abbreviations: " -"K for kilobytes, M for megabytes, " -"or G for gigabytes." -msgstr "" -"大小 (Size) 欄位可以使用常用的縮寫來輸入:K 代表 KB, M 代表 MB, G 代" -"表 GB。" - -#. (itstool) path: tip/para -#: book.translate.xml:4200 -msgid "" -"Proper sector alignment provides the best performance, and making partition " -"sizes even multiples of 4K bytes helps to ensure alignment on drives with " -"either 512-byte or 4K-byte sectors. Generally, using partition sizes that " -"are even multiples of 1M or 1G is the easiest way to make sure every " -"partition starts at an even multiple of 4K. There is one exception: the " -"freebsd-boot partition should be no larger than 512K " -"due to current boot code limitations." -msgstr "" -"適當的對齊磁碟扇區 (Sector) 會提供最佳的效能,而且讓分割區大小為 4 KB 的偶數" -"倍數可協助確保對齊在磁碟機上的 512-byte 或 4K-byte 扇區。一般來說,使用分割區" -"大小為 1M 或 1G 的偶數倍數是最簡單的方式確保每個分割區以 4K 的偶數倍數做為開" -"始。唯一一個例外是:freebsd-boot 分割區因目前開機程式 " -"(Boot code) 的限制,不可大於 512K。" - -#. (itstool) path: sect2/para -#: book.translate.xml:4211 -msgid "" -"A Mountpoint is needed if the partition will contain a " -"file system. If only a single UFS partition will be " -"created, the mountpoint should be /." -msgstr "" -"若分割區內含檔案系統便會需要一個掛載點 (Mountpoint),若只" -"要建立一個 UFS 分割區,那麼掛載點應設為 /。" - -#. (itstool) path: sect2/para -#: book.translate.xml:4216 -msgid "" -"The Label is a name by which the partition will be known. " -"Drive names or numbers can change if the drive is connected to a different " -"controller or port, but the partition label does not change. Referring to " -"labels instead of drive names and partition numbers in files like /" -"etc/fstab makes the system more tolerant to hardware changes. " -"GPT labels appear in /dev/gpt/ when " -"a disk is attached. Other partitioning schemes have different label " -"capabilities and their labels appear in different directories in /" -"dev/." -msgstr "" -"標籤 (Label) 是分割區的名稱,磁碟機名稱或編號可能因為磁碟" -"機連接到不同的控制器或連結埠而有所不同,但分割區標籤並不會改變。因此在檔案如 " -"/etc/fstab 中參照時,使用標籤來替代磁碟機名稱與分割區編" -"號會讓系統對硬體變更有更多的容錯空間。GPT 標籤會於磁碟連結" -"之後出現在 /dev/gpt/。其他分割表格式的標籤格有不同功能," -"且標籤會在 /dev/ 中有各自的目錄。" - -#. (itstool) path: tip/para -#: book.translate.xml:4229 -msgid "" -"Use a unique label on every partition to avoid conflicts from identical " -"labels. A few letters from the computer's name, use, or location can be " -"added to the label. For instance, use labroot or " -"rootfslab for the UFS root partition " -"on the computer named lab." -msgstr "" -"每個分割區請使用獨一無二的標籤來避免相同名稱的衝突,標籤可以加入與電腦名稱、" -"用途、地點有關的文字。例如,使用 labroot 或 " -"rootfslab 來做為電腦名稱為 lab 的 " -"UFS 根目錄分割區。" - -#. (itstool) path: example/title -#: book.translate.xml:4239 -msgid "Creating Traditional Split File System Partitions" -msgstr "建立傳統分割的檔案系統分割區" - -#. (itstool) path: example/para -#: book.translate.xml:4242 -msgid "" -"For a traditional partition layout where the /, " -"/var, /tmp, and /usr directories are separate file systems on their own partitions, " -"create a GPT partitioning scheme, then create the " -"partitions as shown. Partition sizes shown are typical for a 20G target " -"disk. If more space is available on the target disk, larger swap or " -"/var partitions may be useful. Labels shown here are " -"prefixed with ex for example, but readers " -"should use other unique label values as described above." -msgstr "" -"傳統的分割區配置會將 /, /var, " -"/tmp 以及 /usr 分別使用不同的檔案系" -"統與分割區。先建立 GPT 分割表格式,然後依照下表所示建立分" -"割區。下表是針對 20G 目標磁碟的分割區大小,若在目標磁碟有更多可用的空間,則可" -"增加交換空間 (Swap) 或 /var 會比較有用。以下所示的標籤皆" -"以 ex 為字首,代表 example,讀者應照前面的" -"說明使用其他獨一無二的標籤。" - -#. (itstool) path: example/para -#: book.translate.xml:4255 -msgid "" -"By default, FreeBSD's gptboot expects the first " -"UFS partition to be the / partition." -msgstr "" -"預設 FreeBSD 的 gptboot 會預期第一個 UFS 分割區為 / 分割區。" - -#. (itstool) path: row/entry -#: book.translate.xml:4263 -msgid "Partition Type" -msgstr "分割區類型" - -#. (itstool) path: row/entry -#: book.translate.xml:4264 -msgid "Size" -msgstr "大小" - -#. (itstool) path: row/entry -#: book.translate.xml:4265 -msgid "Mountpoint" -msgstr "掛載點" - -#. (itstool) path: row/entry -#: book.translate.xml:4266 -msgid "Label" -msgstr "標籤" - -#. (itstool) path: row/entry -#: book.translate.xml:4272 -msgid "freebsd-boot" -msgstr "" - -#. (itstool) path: row/entry -#: book.translate.xml:4273 -msgid "512K" -msgstr "" - -#. (itstool) path: row/entry -#: book.translate.xml:4277 book.translate.xml:4291 book.translate.xml:4298 -#: book.translate.xml:4305 -msgid "freebsd-ufs" -msgstr "" - -#. (itstool) path: row/entry -#: book.translate.xml:4278 book.translate.xml:4292 -msgid "2G" -msgstr "" - -#. (itstool) path: row/entry -#: book.translate.xml:4279 book.translate.xml:7070 -msgid "/" -msgstr "" - -#. (itstool) path: row/entry -#: book.translate.xml:4280 -msgid "exrootfs" -msgstr "" - -#. (itstool) path: row/entry -#: book.translate.xml:4284 -msgid "freebsd-swap" -msgstr "" - -#. (itstool) path: row/entry -#: book.translate.xml:4285 -msgid "4G" -msgstr "" - -#. (itstool) path: row/entry -#: book.translate.xml:4287 -msgid "exswap" -msgstr "" - -#. (itstool) path: row/entry -#: book.translate.xml:4293 -msgid "/var" -msgstr "" - -#. (itstool) path: row/entry -#: book.translate.xml:4294 -msgid "exvarfs" -msgstr "" - -#. (itstool) path: row/entry -#: book.translate.xml:4299 -msgid "1G" -msgstr "" - -#. (itstool) path: row/entry -#: book.translate.xml:4300 -msgid "/tmp" -msgstr "" - -#. (itstool) path: row/entry -#: book.translate.xml:4301 -msgid "extmpfs" -msgstr "" - -#. (itstool) path: row/entry -#: book.translate.xml:4306 -msgid "accept the default (remainder of the disk)" -msgstr "接受預設值 (依磁碟提示)" - -#. (itstool) path: row/entry -#: book.translate.xml:4308 -msgid "/usr" -msgstr "" - -#. (itstool) path: row/entry -#: book.translate.xml:4309 -msgid "exusrfs" -msgstr "" - -#. (itstool) path: sect2/para -#: book.translate.xml:4316 -msgid "" -"After the custom partitions have been created, select [ Finish ] to continue with the installation." -msgstr "" -"自訂的分割區建立完後,選擇 [ Finish ] 繼續安裝。" - -#. (itstool) path: sect2/title -#: book.translate.xml:4322 -msgid "Root-on-ZFS Automatic Partitioning" -msgstr "Root-on-ZFS 自動磁碟分割" - -#. (itstool) path: sect2/para -#: book.translate.xml:4324 -msgid "" -"Support for automatic creation of root-on-ZFS installations was added in " -"FreeBSD 10.0-RELEASE. This partitioning mode only works with whole disks and " -"will erase the contents of the entire disk. The installer will automatically " -"create partitions aligned to 4k boundaries and force ZFS " -"to use 4k sectors. This is safe even with 512 byte sector disks, and has the " -"added benefit of ensuring that pools created on 512 byte disks will be able " -"to have 4k sector disks added in the future, either as additional storage " -"space or as replacements for failed disks. The installer can also optionally " -"employ GELI disk encryption as described in . If encryption is enabled, a 2 GB unencrypted " -"boot pool containing the /boot directory is created. It " -"holds the kernel and other files necessary to boot the system. A swap " -"partition of a user selectable size is also created, and all remaining space " -"is used for the ZFS pool." -msgstr "" -"在 FreeBSD 10.0-RELEASE 之後支援了自動建立 root-on-ZFS 的安裝程序。這種磁碟分" -"割模式只能使用整個磁碟,並會清除整個磁碟內的內容。安裝程式會自動建立對齊 4k " -"邊界的分割區然後強制 ZFS 使用 4k 扇區 (Sector)。即使在 " -"512 位元扇區的磁碟使用也很安全,並增加了確保在 512 位元的磁碟上建立儲存池 " -"(Pool) 也可在未來加入 4k 扇區磁碟的好處,無論是作為額外的存儲空間或作為故障磁" -"碟的替代品。安裝程式也可選擇性採用 GELI 磁碟加密,如 " -" 所介紹,若開啟磁碟加密,會建立一個" -"內含 /boot 目錄的 2 GB 未加密的開機儲存池,這個儲存池中" -"會儲存核心及其他開機必要的檔案。然後剩餘的空用會給 ZFS 儲" -"存池使用。" - -#. (itstool) path: sect2/para -#: book.translate.xml:4343 -msgid "" -"The main ZFS configuration menu offers a number of " -"options to control the creation of the pool." -msgstr "" -"主要 ZFS 設定選單提供了數個設定選項來控制儲存池的建立。" - -#. (itstool) path: figure/title -#: book.translate.xml:4348 -msgid "ZFS Partitioning Menu" -msgstr "ZFS 磁碟分割選單" - -#. (itstool) path: imageobject/imagedata -#. This is a reference to an external file such as an image or video. When -#. the file changes, the md5 hash will change to let you know you need to -#. update your localized copy. The msgstr is not used at all. Set it to -#. whatever you like once you have updated your copy of the file. -#: book.translate.xml:4352 -msgctxt "_" -msgid "external ref='bsdinstall/bsdinstall-zfs-menu' md5='__failed__'" -msgstr "" - -#. (itstool) path: sect2/para -#: book.translate.xml:4357 -msgid "" -"Select T to configure the Pool Type and " -"the disk(s) that will constitute the pool. The automatic ZFS installer currently only supports the creation of a single top " -"level vdev, except in stripe mode. To create more complex pools, use the " -"instructions in to create the " -"pool. The installer supports the creation of various pool types, including " -"stripe (not recommended, no redundancy), mirror (best performance, least " -"usable space), and RAID-Z 1, 2, and 3 (with the capability to withstand the " -"concurrent failure of 1, 2, and 3 disks, respectively). While selecting the " -"pool type, a tooltip is displayed across the bottom of the screen with " -"advice about the number of required disks, and in the case of RAID-Z, the " -"optimal number of disks for each configuration." -msgstr "" -"選擇 T 來設定儲存池類型 (Pool Type) 以及" -"要組成儲存池的磁碟。自動 ZFS 安裝程式目前僅支援建立單一頂" -"層 vdev,除了在串連 (Stripe) 模式。要建立更複雜的儲存池,需使用 的操作來建立儲存池。安裝程式支援建立各種" -"儲存池類型,包含串連 Stripe (不建議,沒有備援功能)、鏡像 Mirror (效能較佳,但" -"可用空間較少) 以及 RAID-Z 1, 2, 與 3 (分別有能力承受同時 1, 2 與 3 個磁碟的損" -"壞)。在選擇儲存池類型時會在螢幕的下方提示所需的磁碟數量,以及在使用 RAID-Z " -"時,每種配置最佳的磁碟數。" - -#. (itstool) path: figure/title -#: book.translate.xml:4374 -msgid "ZFS Pool Type" -msgstr "ZFS 儲存池類型" - -#. (itstool) path: imageobject/imagedata -#. This is a reference to an external file such as an image or video. When -#. the file changes, the md5 hash will change to let you know you need to -#. update your localized copy. The msgstr is not used at all. Set it to -#. whatever you like once you have updated your copy of the file. -#: book.translate.xml:4378 -msgctxt "_" -msgid "external ref='bsdinstall/bsdinstall-zfs-vdev_type' md5='__failed__'" -msgstr "" - -#. (itstool) path: sect2/para -#: book.translate.xml:4383 -msgid "" -"Once a Pool Type has been selected, a list of available " -"disks is displayed, and the user is prompted to select one or more disks to " -"make up the pool. The configuration is then validated, to ensure enough " -"disks are selected. If not, select <Change Selection> to return to the list of disks, or <Cancel> to change the pool type." -msgstr "" -"選擇儲存池 (Pool Type) 之後,會顯示可用的磁碟清單,然後會" -"提示使用者選擇一個或多個磁碟來建立儲存池。接著會檢驗設定來確定選擇的磁碟足" -"夠,若不足,選擇更改選項 (<Change Selection>) 來" -"返回磁碟清單或取消 (<Cancel>) 來更改儲存池類型。" - -#. (itstool) path: figure/title -#: book.translate.xml:4393 -msgid "Disk Selection" -msgstr "磁碟選擇" - -#. (itstool) path: imageobject/imagedata -#. This is a reference to an external file such as an image or video. When -#. the file changes, the md5 hash will change to let you know you need to -#. update your localized copy. The msgstr is not used at all. Set it to -#. whatever you like once you have updated your copy of the file. -#: book.translate.xml:4397 -msgctxt "_" -msgid "external ref='bsdinstall/bsdinstall-zfs-disk_select' md5='__failed__'" -msgstr "" - -#. (itstool) path: figure/title -#: book.translate.xml:4403 -msgid "Invalid Selection" -msgstr "無效的選擇" - -#. (itstool) path: imageobject/imagedata -#. This is a reference to an external file such as an image or video. When -#. the file changes, the md5 hash will change to let you know you need to -#. update your localized copy. The msgstr is not used at all. Set it to -#. whatever you like once you have updated your copy of the file. -#: book.translate.xml:4407 -msgctxt "_" -msgid "external ref='bsdinstall/bsdinstall-zfs-vdev_invalid' md5='__failed__'" -msgstr "" - -#. (itstool) path: sect2/para -#: book.translate.xml:4412 -msgid "" -"If one or more disks are missing from the list, or if disks were attached " -"after the installer was started, select - Rescan Devices to repopulate the list of available disks. To avoid accidentally " -"erasing the wrong disk, the - Disk Info menu can be " -"used to inspect each disk, including its partition table and various other " -"information such as the device model number and serial number, if available." -msgstr "" -"若有一個或多磁碟未出現在清單上,或在安裝程式啟動後才連接的磁碟,可選擇重新掃" -"描裝置 (- Rescan Devices) 來更新可用磁碟的清單。要避免" -"清除掉錯的磁碟,可用磁碟資訊 (- Disk Info) 來檢查每個" -"磁碟,包含磁碟中的分割表以及各種其他資訊如裝置型號與序號 (若有的話)。" - -#. (itstool) path: figure/title -#: book.translate.xml:4423 -msgid "Analyzing a Disk" -msgstr "分析磁碟" - -#. (itstool) path: imageobject/imagedata -#. This is a reference to an external file such as an image or video. When -#. the file changes, the md5 hash will change to let you know you need to -#. update your localized copy. The msgstr is not used at all. Set it to -#. whatever you like once you have updated your copy of the file. -#: book.translate.xml:4427 -msgctxt "_" -msgid "external ref='bsdinstall/bsdinstall-zfs-disk_info' md5='__failed__'" -msgstr "" - -#. (itstool) path: sect2/para -#: book.translate.xml:4432 -msgid "" -"The main ZFS configuration menu also allows the user to " -"enter a pool name, disable forcing 4k sectors, enable or disable encryption, " -"switch between GPT (recommended) and MBR partition table types, and select the amount of swap space. Once " -"all options have been set to the desired values, select the >" -">> Install option at the top of the menu." -msgstr "" -"主 ZFS 設定選單也允許使用者輸入儲存池名稱、關閉強制 4k 扇" -"區對齊、開啟或關閉加密、切換 GPT (建議) 與 MBR 分割表類型以及選擇交換空間容量。設定所有選項為想要的值之後,請選擇選" -"單上方的安裝 (>>> Install) 選項。" - -#. (itstool) path: sect2/para -#: book.translate.xml:4442 -msgid "" -"If GELI disk encryption was enabled, the installer will " -"prompt twice for the passphrase to be used to encrypt the disks." -msgstr "" -"若開啟了 GELI 磁碟加密,安裝程式會提示輸入兩次用來加密磁碟" -"的密碼。" - -#. (itstool) path: figure/title -#: book.translate.xml:4447 -msgid "Disk Encryption Password" -msgstr "磁碟加密密碼" - -#. (itstool) path: imageobject/imagedata -#. This is a reference to an external file such as an image or video. When -#. the file changes, the md5 hash will change to let you know you need to -#. update your localized copy. The msgstr is not used at all. Set it to -#. whatever you like once you have updated your copy of the file. -#: book.translate.xml:4451 -msgctxt "_" -msgid "external ref='bsdinstall/bsdinstall-zfs-geli_password' md5='__failed__'" -msgstr "" - -#. (itstool) path: sect2/para -#: book.translate.xml:4456 -msgid "" -"The installer then offers a last chance to cancel before the contents of the " -"selected drives are destroyed to create the ZFS pool." -msgstr "" -"安裝程式接著會提供最後一次修改的機會可取消先前所選擇摧毀用來建立 " -"ZFS 儲存池的磁碟機。" - -#. (itstool) path: figure/title -#: book.translate.xml:4461 -msgid "Last Chance" -msgstr "最後修改" - -#. (itstool) path: imageobject/imagedata -#. This is a reference to an external file such as an image or video. When -#. the file changes, the md5 hash will change to let you know you need to -#. update your localized copy. The msgstr is not used at all. Set it to -#. whatever you like once you have updated your copy of the file. -#: book.translate.xml:4465 -msgctxt "_" -msgid "external ref='bsdinstall/bsdinstall-zfs-warning' md5='__failed__'" -msgstr "" - -#. (itstool) path: sect2/para -#: book.translate.xml:4470 -msgid "The installation then proceeds normally." -msgstr "然後安裝程序會正常繼續。" - -#. (itstool) path: sect2/title -#: book.translate.xml:4475 -msgid "Shell Mode Partitioning" -msgstr "Shell 模式磁碟分割" - -#. (itstool) path: sect2/para -#: book.translate.xml:4477 -msgid "" -"When creating advanced installations, the bsdinstall partitioning menus may not provide the level of flexibility " -"required. Advanced users can select the Shell option " -"from the partitioning menu in order to manually partition the drives, create " -"the file system(s), populate /tmp/bsdinstall_etc/fstab, " -"and mount the file systems under /mnt. Once this is " -"done, type exit to return to bsdinstall and continue the installation." -msgstr "" -"當要做進階的安裝時,bsdinstall 的磁碟分割選單可能" -"無法提供需要的彈性。進階的使用者可以在磁碟分割選單選擇 Shell 選項來手動分割磁碟機、建立檔案系統、填寫 /tmp/" -"bsdinstall_etc/fstab 以及掛載檔案系統到 /mnt " -"下。這些動作完成之後,輸入 exit 可返回 " -"bsdinstall 繼續安裝程序。" - -#. (itstool) path: sect1/title -#: book.translate.xml:4492 -msgid "Committing to the Installation" -msgstr "確認安裝" - -#. (itstool) path: sect1/para -#: book.translate.xml:4494 -msgid "" -"Once the disks are configured, the next menu provides the last chance to " -"make changes before the selected hard drive(s) are formatted. If changes " -"need to be made, select [ Back ] to return to the " -"main partitioning menu. [ Revert & Exit ] will " -"exit the installer without making any changes to the hard drive." -msgstr "" -"磁碟設定完之後,接下來的選單會讓您在格式化所選的硬碟之前有最後一次機會做變" -"更,若需要做變更,可選 [ Back ] 返回到主磁碟分割選單。" -"[ Revert & Exit ] 則會離開安裝程式,不會對硬碟做任" -"何變更。" - -#. (itstool) path: figure/title -#: book.translate.xml:4504 -msgid "Final Confirmation" -msgstr "最後確認" - -#. (itstool) path: imageobject/imagedata -#. This is a reference to an external file such as an image or video. When -#. the file changes, the md5 hash will change to let you know you need to -#. update your localized copy. The msgstr is not used at all. Set it to -#. whatever you like once you have updated your copy of the file. -#: book.translate.xml:4508 -msgctxt "_" -msgid "" -"external ref='bsdinstall/bsdinstall-final-confirmation' md5='__failed__'" -msgstr "" - -#. (itstool) path: sect1/para -#: book.translate.xml:4513 -msgid "" -"To instead start the actual installation, select [ Commit ] and press Enter." -msgstr "" -"要開始實際的安裝,請選擇 [ Commit ] 然後按下 " -"Enter。" - -#. (itstool) path: sect1/para -#: book.translate.xml:4517 -msgid "" -"Installation time will vary depending on the distributions chosen, " -"installation media, and speed of the computer. A series of messages will " -"indicate the progress." -msgstr "" -"安裝時間會依據選擇的發行版、安裝媒體、電腦的速度而有所不同,接下來會有一系列" -"訊息會告知目前的進度。" - -#. (itstool) path: sect1/para -#: book.translate.xml:4521 -msgid "" -"First, the installer formats the selected disk(s) and initializes the " -"partitions. Next, in the case of a bootonly media, it downloads the selected " -"components:" -msgstr "" -"首先,安裝程式會格式化選擇的磁碟,然後初始化分割區。然後,若使用僅可開機 " -"(Boot only) 的媒體則會開始下載選擇的元件:" - -#. (itstool) path: figure/title -#: book.translate.xml:4526 -msgid "Fetching Distribution Files" -msgstr "取得發行版檔案" - -#. (itstool) path: imageobject/imagedata -#. This is a reference to an external file such as an image or video. When -#. the file changes, the md5 hash will change to let you know you need to -#. update your localized copy. The msgstr is not used at all. Set it to -#. whatever you like once you have updated your copy of the file. -#: book.translate.xml:4530 -msgctxt "_" -msgid "external ref='bsdinstall/bsdinstall-distfile-fetching' md5='__failed__'" -msgstr "" - -#. (itstool) path: sect1/para -#: book.translate.xml:4535 -msgid "" -"Next, the integrity of the distribution files is verified to ensure they " -"have not been corrupted during download or misread from the installation " -"media:" -msgstr "" -"接著,會檢驗發行版的檔案完整性來確保沒有因下載過程中或安裝媒體的讀取過程中讀" -"取錯誤造成的損壞:" - -#. (itstool) path: figure/title -#: book.translate.xml:4540 -msgid "Verifying Distribution Files" -msgstr "檢驗發行版檔案" - -#. (itstool) path: imageobject/imagedata -#. This is a reference to an external file such as an image or video. When -#. the file changes, the md5 hash will change to let you know you need to -#. update your localized copy. The msgstr is not used at all. Set it to -#. whatever you like once you have updated your copy of the file. -#: book.translate.xml:4544 -msgctxt "_" -msgid "" -"external ref='bsdinstall/bsdinstall-distfile-verifying' md5='__failed__'" -msgstr "" - -#. (itstool) path: sect1/para -#: book.translate.xml:4549 -msgid "Finally, the verified distribution files are extracted to the disk:" -msgstr "最後,檢驗過的發行版檔案會被取出儲存至磁碟:" - -#. (itstool) path: figure/title -#: book.translate.xml:4553 -msgid "Extracting Distribution Files" -msgstr "解開發行版檔案" - -#. (itstool) path: imageobject/imagedata -#. This is a reference to an external file such as an image or video. When -#. the file changes, the md5 hash will change to let you know you need to -#. update your localized copy. The msgstr is not used at all. Set it to -#. whatever you like once you have updated your copy of the file. -#: book.translate.xml:4557 -msgctxt "_" -msgid "" -"external ref='bsdinstall/bsdinstall-distfile-extracting' md5='__failed__'" -msgstr "" - -#. (itstool) path: sect1/para -#: book.translate.xml:4562 -msgid "" -"Once all requested distribution files have been extracted, " -"bsdinstall displays the first post-installation " -"configuration screen. The available post-configuration options are described " -"in the next section." -msgstr "" -"所有選擇的發行版檔案取出後,bsdinstall 會顯示第一" -"次安裝後設定畫面,可用的安裝後設定選項會在下一節說明。" - -#. (itstool) path: sect1/title -#: book.translate.xml:4570 -msgid "Post-Installation" -msgstr "安裝後注意事項" - -#. (itstool) path: sect1/para -#: book.translate.xml:4572 -msgid "" -"Once FreeBSD is installed, bsdinstall will prompt " -"to configure several options before booting into the newly installed system. " -"This section describes these configuration options." -msgstr "" -"FreeBSD 安裝完之後,bsdinstall 會在開機進入新安裝" -"的系統之前提示設定數個選項,本節將介紹這些設定選項。" - -#. (itstool) path: tip/para -#: book.translate.xml:4578 -msgid "" -"Once the system has booted, bsdconfig provides a menu-" -"driven method for configuring the system using these and additional options." -msgstr "" -"系統開機之後,bsdconfig 提供了一個選單導向的方式可用來設定" -"系統使用這些以及其他的選項。" - -#. (itstool) path: sect2/title -#. (itstool) path: figure/title -#: book.translate.xml:4585 book.translate.xml:4596 -msgid "Setting the root Password" -msgstr "設定 root 密碼" - -#. (itstool) path: sect2/para -#: book.translate.xml:4589 -msgid "" -"First, the root password must be " -"set. While entering the password, the characters being typed are not " -"displayed on the screen. After the password has been entered, it must be " -"entered again. This helps prevent typing errors." -msgstr "" -"首先,必需設定 root 的密碼,輸入" -"密碼時,並不會直接在畫面上顯示輸入的字元。輸入完密碼之後,必須再輸入一次來確" -"認沒有輸入錯誤。" - -#. (itstool) path: imageobject/imagedata -#. This is a reference to an external file such as an image or video. When -#. the file changes, the md5 hash will change to let you know you need to -#. update your localized copy. The msgstr is not used at all. Set it to -#. whatever you like once you have updated your copy of the file. -#: book.translate.xml:4600 -msgctxt "_" -msgid "external ref='bsdinstall/bsdinstall-post-root-passwd' md5='__failed__'" -msgstr "" - -#. (itstool) path: sect2/title -#: book.translate.xml:4607 -msgid "Configuring Network Interfaces" -msgstr "設定網路介面卡" - -#. (itstool) path: sect2/para -#: book.translate.xml:4609 -msgid "" -"Next, a list of the network interfaces found on the computer is shown. " -"Select the interface to configure." -msgstr "接著,會顯示在電腦上找到的網路介面卡清單。請選擇要設定的介面卡。" - -#. (itstool) path: note/para -#: book.translate.xml:4613 -msgid "" -"The network configuration menus will be skipped if the network was " -"previously configured as part of a bootonly " -"installation." -msgstr "" -"若使用 bootonly 的方式安裝在先前已有設定過網路,將會跳過" -"網路設定選單。" - -#. (itstool) path: figure/title -#: book.translate.xml:4619 -msgid "Choose a Network Interface" -msgstr "選擇網路介面卡" - -#. (itstool) path: imageobject/imagedata -#. This is a reference to an external file such as an image or video. When -#. the file changes, the md5 hash will change to let you know you need to -#. update your localized copy. The msgstr is not used at all. Set it to -#. whatever you like once you have updated your copy of the file. -#: book.translate.xml:4623 -msgctxt "_" -msgid "" -"external ref='bsdinstall/bsdinstall-configure-network-interface' " -"md5='__failed__'" -msgstr "" - -#. (itstool) path: sect2/para -#: book.translate.xml:4628 -msgid "" -"If an Ethernet interface is selected, the installer will skip ahead to the " -"menu shown in . If a " -"wireless network interface is chosen, the system will instead scan for " -"wireless access points:" -msgstr "" -"若選擇的是乙太網路介面卡,安裝程式會跳過這部份直接到 ,若選擇的是無線網路介面卡,系統則會開始掃" -"描無線存取點 (Wireless Access Point):" - -#. (itstool) path: figure/title -#: book.translate.xml:4634 -msgid "Scanning for Wireless Access Points" -msgstr "掃描無線網路存取點" - -#. (itstool) path: imageobject/imagedata -#. This is a reference to an external file such as an image or video. When -#. the file changes, the md5 hash will change to let you know you need to -#. update your localized copy. The msgstr is not used at all. Set it to -#. whatever you like once you have updated your copy of the file. -#: book.translate.xml:4638 -msgctxt "_" -msgid "" -"external ref='bsdinstall/bsdinstall-configure-wireless-scan' md5='__failed__'" -msgstr "" - -#. (itstool) path: sect2/para -#: book.translate.xml:4643 -msgid "" -"Wireless networks are identified by a Service Set Identifier (SSID), a short, unique name given to each network. SSIDs found during the scan are listed, followed by a description of the " -"encryption types available for that network. If the desired SSID does not appear in the list, select [ Rescan ] to scan again. If the desired network still does not appear, " -"check for problems with antenna connections or try moving the computer " -"closer to the access point. Rescan after each change is made." -msgstr "" -"網線網路會使用 Service Set Identifier (SSID) 來辦識,SSID " -"是一段簡短、獨一無二的名稱,用來命名每個網路。 掃描時找到的 SSID 會列到清單,並會說明該網路可用的加密類型。 若想要連線的 " -"SSID 並未出現在清單上,可選擇 [ Rescan ] 再掃描一次,若想要連線的網路仍然沒有出現,請檢查天線的連線是否有問" -"題,或者嘗試將電腦移至更靠近存取點的位置,然後再掃描一次。" - -#. (itstool) path: figure/title -#: book.translate.xml:4655 -msgid "Choosing a Wireless Network" -msgstr "選擇無線網路" - -#. (itstool) path: imageobject/imagedata -#. This is a reference to an external file such as an image or video. When -#. the file changes, the md5 hash will change to let you know you need to -#. update your localized copy. The msgstr is not used at all. Set it to -#. whatever you like once you have updated your copy of the file. -#: book.translate.xml:4659 -msgctxt "_" -msgid "" -"external ref='bsdinstall/bsdinstall-configure-wireless-accesspoints' " -"md5='__failed__'" -msgstr "" - -#. (itstool) path: sect2/para -#: book.translate.xml:4664 -msgid "" -"Next, enter the encryption information for connecting to the selected " -"wireless network. WPA2 encryption is strongly recommended " -"as older encryption types, like WEP, offer little " -"security. If the network uses WPA2, input the password, " -"also known as the Pre-Shared Key (PSK). For security " -"reasons, the characters typed into the input box are displayed as asterisks." -msgstr "" -"然後,輸入加密資訊來連線到選擇的無線網路。強列建議使用 WPA2 加密,因較舊的加密類型,如 WEP 僅提供微弱的安全" -"性。若網路使用 WPA2 則需輸入密碼,也稱作 Pre-Shared Key " -"(PSK)。考量安全性,輸入到輸入框的字元會以星號顯示。" - -#. (itstool) path: figure/title -#: book.translate.xml:4674 -msgid "WPA2 Setup" -msgstr "WPA2 設定" - -#. (itstool) path: imageobject/imagedata -#. This is a reference to an external file such as an image or video. When -#. the file changes, the md5 hash will change to let you know you need to -#. update your localized copy. The msgstr is not used at all. Set it to -#. whatever you like once you have updated your copy of the file. -#: book.translate.xml:4678 -msgctxt "_" -msgid "" -"external ref='bsdinstall/bsdinstall-configure-wireless-wpa2setup' " -"md5='__failed__'" -msgstr "" - -#. (itstool) path: sect2/para -#: book.translate.xml:4683 -msgid "" -"Next, choose whether or not an IPv4 address should be " -"configured on the Ethernet or wireless interface:" -msgstr "" -"接下來,選擇是否要設定乙太網路或無線網路介面卡的 IPv4 位" -"址:" - -#. (itstool) path: figure/title -#: book.translate.xml:4688 -msgid "Choose IPv4 Networking" -msgstr "選擇 IPv4 網路" - -#. (itstool) path: imageobject/imagedata -#. This is a reference to an external file such as an image or video. When -#. the file changes, the md5 hash will change to let you know you need to -#. update your localized copy. The msgstr is not used at all. Set it to -#. whatever you like once you have updated your copy of the file. -#: book.translate.xml:4692 -msgctxt "_" -msgid "" -"external ref='bsdinstall/bsdinstall-configure-network-interface-ipv4' " -"md5='__failed__'" -msgstr "" - -#. (itstool) path: sect2/para -#: book.translate.xml:4697 -msgid "" -"There are two methods of IPv4 configuration. " -"DHCP will automatically configure the network interface " -"correctly and should be used if the network provides a DHCP server. Otherwise, the addressing information needs to be input " -"manually as a static configuration." -msgstr "" -"有兩種方式可以設定 IPv4DHCP 會自動設" -"定網路介面卡且該網路上需有 DHCP 伺服器才可使用。否則,必須" -"手動輸入位址的資訊來做靜態設定。" - -#. (itstool) path: note/para -#: book.translate.xml:4705 -msgid "" -"Do not enter random network information as it will not work. If a " -"DHCP server is not available, obtain the information " -"listed in from " -"the network administrator or Internet service provider." -msgstr "" -"請不要隨便輸入網路資訊,因為這不管用。如果沒有可用的 DHCP " -"伺服器,可向網路管理者或網路服務供應商 (Internet Service Provider, ISP) 索取" -"列於 的資訊。" - -#. (itstool) path: sect2/para -#: book.translate.xml:4712 -msgid "" -"If a DHCP server is available, select [ Yes ] in the next menu to automatically configure the network " -"interface. The installer will appear to pause for a minute or so as it finds " -"the DHCP server and obtains the addressing information " -"for the system." -msgstr "" -"若有可用的 DHCP 伺服器,請在接下來的選單中選擇 " -"[ Yes ] 則會自動設定網路介面卡。當找到 DHCP 伺服器並且取得系統的位址資訊時,安裝程式會出現一分鐘左右的停頓。" - -#. (itstool) path: figure/title -#: book.translate.xml:4720 -msgid "Choose IPv4 DHCP Configuration" -msgstr "選擇 IPv4 DHCP 設定" - -#. (itstool) path: imageobject/imagedata -#. This is a reference to an external file such as an image or video. When -#. the file changes, the md5 hash will change to let you know you need to -#. update your localized copy. The msgstr is not used at all. Set it to -#. whatever you like once you have updated your copy of the file. -#: book.translate.xml:4725 -msgctxt "_" -msgid "" -"external ref='bsdinstall/bsdinstall-configure-network-interface-ipv4-dhcp' " -"md5='__failed__'" -msgstr "" - -#. (itstool) path: sect2/para -#: book.translate.xml:4730 -msgid "" -"If a DHCP server is not available, select " -"[ No ] and input the following addressing information " -"in this menu:" -msgstr "" -"若沒有可用的 DHCP 伺服器,則選擇 [ No ] 然後在這個選單中輸入以下位址資訊:" - -#. (itstool) path: figure/title -#: book.translate.xml:4735 -msgid "IPv4 Static Configuration" -msgstr "IPv4 靜態位置設定" - -#. (itstool) path: imageobject/imagedata -#. This is a reference to an external file such as an image or video. When -#. the file changes, the md5 hash will change to let you know you need to -#. update your localized copy. The msgstr is not used at all. Set it to -#. whatever you like once you have updated your copy of the file. -#: book.translate.xml:4739 -msgctxt "_" -msgid "" -"external ref='bsdinstall/bsdinstall-configure-network-interface-ipv4-static' " -"md5='__failed__'" -msgstr "" - -#. (itstool) path: listitem/para -#: book.translate.xml:4746 -msgid "" -"IP Address - The IPv4 address assigned " -"to this computer. The address must be unique and not already in use by " -"another piece of equipment on the local network." -msgstr "" -"IP 位址 (IP Address) - 要分配給這台電腦的 IPv4 位址。位址必須獨一無二且不可已被其他在區域網路上的設備使用。" - -#. (itstool) path: listitem/para -#: book.translate.xml:4753 -msgid "Subnet Mask - The subnet mask for the network." -msgstr "子網路遮罩 (Subnet Mask) - 網路的子網路遮罩。" - -#. (itstool) path: listitem/para -#: book.translate.xml:4758 -msgid "" -"Default Router - The IP address of the " -"network's default gateway." -msgstr "" -"預設路由器 (Default Router) - IP 位址所" -"在網段的預設通訊閘。" - -#. (itstool) path: sect2/para -#: book.translate.xml:4764 -msgid "" -"The next screen will ask if the interface should be configured for " -"IPv6. If IPv6 is available and " -"desired, choose [ Yes ] to select it." -msgstr "" -"接下來的畫面會詢問是否要設定介面卡的 IPv6 位址,若可以且想" -"要使用 IPv6,請選擇 [ Yes ]。" - -#. (itstool) path: figure/title -#: book.translate.xml:4770 -msgid "Choose IPv6 Networking" -msgstr "選擇 IPv6 網路" - -#. (itstool) path: imageobject/imagedata -#. This is a reference to an external file such as an image or video. When -#. the file changes, the md5 hash will change to let you know you need to -#. update your localized copy. The msgstr is not used at all. Set it to -#. whatever you like once you have updated your copy of the file. -#: book.translate.xml:4774 -msgctxt "_" -msgid "" -"external ref='bsdinstall/bsdinstall-configure-network-interface-ipv6' " -"md5='__failed__'" -msgstr "" - -#. (itstool) path: sect2/para -#: book.translate.xml:4779 -msgid "" -"IPv6 also has two methods of configuration. StateLess " -"Address AutoConfiguration (SLAAC) will automatically " -"request the correct configuration information from a local router. Refer to " -"http://tools.ietf." -"org/html/rfc4862 for more information. Static configuration requires " -"manual entry of network information." -msgstr "" -"同樣有兩種方式可以設定 IPv6。StateLess Address " -"AutoConfiguration (SLAAC) 會自動向區域路由器請求取得正確的" -"設定資訊,請參考 http://tools.ietf.org/html/rfc4862 取得進一步資訊。靜態設定" -"則需要手動輸入網路資訊。" - -#. (itstool) path: sect2/para -#: book.translate.xml:4787 -msgid "" -"If an IPv6 router is available, select " -"[ Yes ] in the next menu to automatically configure " -"the network interface. The installer will appear to pause for a minute or so " -"as it finds the router and obtains the addressing information for the system." -msgstr "" -"若有可用的 IPv6 路由器,請在接下來的選單選擇 " -"[ Yes ] 來自動設定網路介面卡。當找到路由器並且取得系統" -"的位址資訊時,安裝程式會出現一分鐘左右的停頓。" - -#. (itstool) path: figure/title -#: book.translate.xml:4794 -msgid "Choose IPv6 SLAAC Configuration" -msgstr "選擇 IPv6 SLAAC 設定" - -#. (itstool) path: imageobject/imagedata -#. This is a reference to an external file such as an image or video. When -#. the file changes, the md5 hash will change to let you know you need to -#. update your localized copy. The msgstr is not used at all. Set it to -#. whatever you like once you have updated your copy of the file. -#: book.translate.xml:4798 -msgctxt "_" -msgid "" -"external ref='bsdinstall/bsdinstall-configure-network-interface-slaac' " -"md5='__failed__'" -msgstr "" - -#. (itstool) path: sect2/para -#: book.translate.xml:4803 -msgid "" -"If an IPv6 router is not available, select " -"[ No ] and input the following addressing information " -"in this menu:" -msgstr "" -"若沒有可用的 IPv6 路由器,請選擇 [ No ] 然後在這個選單中輸入以下位址資訊:" - -#. (itstool) path: figure/title -#: book.translate.xml:4808 -msgid "IPv6 Static Configuration" -msgstr "IPv6 靜態位置設定" - -#. (itstool) path: imageobject/imagedata -#. This is a reference to an external file such as an image or video. When -#. the file changes, the md5 hash will change to let you know you need to -#. update your localized copy. The msgstr is not used at all. Set it to -#. whatever you like once you have updated your copy of the file. -#: book.translate.xml:4812 -msgctxt "_" -msgid "" -"external ref='bsdinstall/bsdinstall-configure-network-interface-ipv6-static' " -"md5='__failed__'" -msgstr "" - -#. (itstool) path: listitem/para -#: book.translate.xml:4819 -msgid "" -"IPv6 Address - The IPv6 address " -"assigned to this computer. The address must be unique and not already in use " -"by another piece of equipment on the local network." -msgstr "" -"IPv6 位址 (IPv6 Address) - 要分配給這台電腦的 " -"IPv6 位址。位址必須獨一無二且不可已被其他在區域網路上的設" -"備使用。" - -#. (itstool) path: listitem/para -#: book.translate.xml:4826 -msgid "" -"Default Router - The IPv6 address of " -"the network's default gateway." -msgstr "" -"預設路由器 (Default Router) - IPv6 位址" -"所在網段的預設通訊閘。" - -#. (itstool) path: sect2/para -#: book.translate.xml:4832 -msgid "" -"The last network configuration menu is used to configure the Domain Name " -"System (DNS) resolver, which converts hostnames to and " -"from network addresses. If DHCP or SLAAC was used to autoconfigure the network interface, the " -"Resolver Configuration values may already be filled in. " -"Otherwise, enter the local network's domain name in the Search field. DNS #1 and DNS #2 are " -"the IPv4 and/or IPv6 addresses of the " -"DNS servers. At least one DNS server " -"is required." -msgstr "" -"最後的網路設定選單是用來設定網域名稱系統 (Domain Name System, DNS) 的解析器,解析器會轉換主機名稱為網路位址。若已使用 DHCPSLAAC 來自動設定網路介面卡,解析器設定 " -"(Resolver Configuration) 的值可能會事先已填入,否則需輸入" -"區域網路的網域名稱到搜尋 (Search) 欄位。 DNS #1DNS #2 要填寫 DNS 伺服器的 " -"IPv4 及/或 IPv6 位址,至少需填寫一個 " -"DNS 伺服器。" - -#. (itstool) path: figure/title -#: book.translate.xml:4846 -msgid "DNS Configuration" -msgstr "DNS 設定" - -#. (itstool) path: imageobject/imagedata -#. This is a reference to an external file such as an image or video. When -#. the file changes, the md5 hash will change to let you know you need to -#. update your localized copy. The msgstr is not used at all. Set it to -#. whatever you like once you have updated your copy of the file. -#: book.translate.xml:4850 -msgctxt "_" -msgid "" -"external ref='bsdinstall/bsdinstall-configure-network-ipv4-dns' " -"md5='__failed__'" -msgstr "" - -#. (itstool) path: sect2/title -#: book.translate.xml:4857 -msgid "Setting the Time Zone" -msgstr "設定時區" - -#. (itstool) path: sect2/para -#: book.translate.xml:4859 -msgid "" -"The next menu asks if the system clock uses UTC or local " -"time. When in doubt, select [ No ] to choose the more " -"commonly-used local time." -msgstr "" -"接下來的選單會詢問系統時鐘要使用 UTC 或者當地時間。 若有疑" -"問時可選擇 [ No ]使用更常用的當地時間。" - -#. (itstool) path: figure/title -#: book.translate.xml:4865 -msgid "Select Local or UTC Clock" -msgstr "選擇本地或 UTC 時鐘" - -#. (itstool) path: imageobject/imagedata -#. This is a reference to an external file such as an image or video. When -#. the file changes, the md5 hash will change to let you know you need to -#. update your localized copy. The msgstr is not used at all. Set it to -#. whatever you like once you have updated your copy of the file. -#: book.translate.xml:4869 -msgctxt "_" -msgid "" -"external ref='bsdinstall/bsdinstall-set-clock-local-utc' md5='__failed__'" -msgstr "" - -#. (itstool) path: sect2/para -#: book.translate.xml:4874 -msgid "" -"The next series of menus are used to determine the correct local time by " -"selecting the geographic region, country, and time zone. Setting the time " -"zone allows the system to automatically correct for regional time changes, " -"such as daylight savings time, and perform other time zone related functions " -"properly." -msgstr "" -"接下來一系列的選單會透過選擇地理區域、城市及時區來判斷正確的當地時間。設定時" -"區可讓系統自動更正區域時間的更改,如日光節約時間以及正確執行其他時區相關的功" -"能。" - -#. (itstool) path: sect2/para -#: book.translate.xml:4881 -msgid "" -"The example shown here is for a machine located in the Eastern time zone of " -"the United States. The selections will vary according to the geographical " -"location." -msgstr "此處以位於美國東部時區的機器為例,選擇會依據地理位置不同改變。" - -#. (itstool) path: figure/title -#: book.translate.xml:4886 -msgid "Select a Region" -msgstr "選擇區域" - -#. (itstool) path: imageobject/imagedata -#. This is a reference to an external file such as an image or video. When -#. the file changes, the md5 hash will change to let you know you need to -#. update your localized copy. The msgstr is not used at all. Set it to -#. whatever you like once you have updated your copy of the file. -#: book.translate.xml:4890 -msgctxt "_" -msgid "external ref='bsdinstall/bsdinstall-timezone-region' md5='__failed__'" -msgstr "" - -#. (itstool) path: sect2/para -#: book.translate.xml:4895 -msgid "" -"The appropriate region is selected using the arrow keys and then pressing " -"Enter." -msgstr "使用方向鍵選擇適當的區域然後按下 Enter。" - -#. (itstool) path: figure/title -#: book.translate.xml:4899 -msgid "Select a Country" -msgstr "選擇城市" - -#. (itstool) path: imageobject/imagedata -#. This is a reference to an external file such as an image or video. When -#. the file changes, the md5 hash will change to let you know you need to -#. update your localized copy. The msgstr is not used at all. Set it to -#. whatever you like once you have updated your copy of the file. -#: book.translate.xml:4903 -msgctxt "_" -msgid "external ref='bsdinstall/bsdinstall-timezone-country' md5='__failed__'" -msgstr "" - -#. (itstool) path: sect2/para -#: book.translate.xml:4908 -msgid "" -"Select the appropriate country using the arrow keys and press Enter." -msgstr "使用方向鍵選擇適當的城市然後按下 Enter。" - -#. (itstool) path: figure/title -#: book.translate.xml:4912 -msgid "Select a Time Zone" -msgstr "選擇時區" - -#. (itstool) path: imageobject/imagedata -#. This is a reference to an external file such as an image or video. When -#. the file changes, the md5 hash will change to let you know you need to -#. update your localized copy. The msgstr is not used at all. Set it to -#. whatever you like once you have updated your copy of the file. -#: book.translate.xml:4916 -msgctxt "_" -msgid "external ref='bsdinstall/bsdinstall-timezone-zone' md5='__failed__'" -msgstr "" - -#. (itstool) path: sect2/para -#: book.translate.xml:4921 -msgid "" -"The appropriate time zone is selected using the arrow keys and pressing " -"Enter." -msgstr "使用方向鍵選擇適當的時區然後按下 Enter。" - -#. (itstool) path: figure/title -#: book.translate.xml:4925 -msgid "Confirm Time Zone" -msgstr "確認時區" - -#. (itstool) path: imageobject/imagedata -#. This is a reference to an external file such as an image or video. When -#. the file changes, the md5 hash will change to let you know you need to -#. update your localized copy. The msgstr is not used at all. Set it to -#. whatever you like once you have updated your copy of the file. -#: book.translate.xml:4929 -msgctxt "_" -msgid "external ref='bsdinstall/bsdinstall-timezone-confirm' md5='__failed__'" -msgstr "" - -#. (itstool) path: sect2/para -#: book.translate.xml:4934 -msgid "" -"Confirm the abbreviation for the time zone is correct. If it is, press " -"Enter to continue with the post-installation configuration." -msgstr "" -"確認時區的縮寫是否正確,若正確,按下 Enter 繼續安裝後設定。" - -#. (itstool) path: sect2/title -#: book.translate.xml:4940 -msgid "Enabling Services" -msgstr "開啟服務" - -#. (itstool) path: sect2/para -#: book.translate.xml:4942 -msgid "" -"The next menu is used to configure which system services will be started " -"whenever the system boots. All of these services are optional. Only start " -"the services that are needed for the system to function." -msgstr "" -"接下來的選單用來設定有那些系統服務要在系統啟動時執行。所有的服務為選用,只需" -"開啟系統運作真正需要的服務。" - -#. (itstool) path: figure/title -#: book.translate.xml:4948 -msgid "Selecting Additional Services to Enable" -msgstr "選擇要開啟的其他服務" - -#. (itstool) path: imageobject/imagedata -#. This is a reference to an external file such as an image or video. When -#. the file changes, the md5 hash will change to let you know you need to -#. update your localized copy. The msgstr is not used at all. Set it to -#. whatever you like once you have updated your copy of the file. -#: book.translate.xml:4952 -msgctxt "_" -msgid "external ref='bsdinstall/bsdinstall-config-services' md5='__failed__'" -msgstr "" - -#. (itstool) path: sect2/para -#: book.translate.xml:4957 -msgid "Here is a summary of the services which can be enabled in this menu:" -msgstr "這是可以在這個選單開啟的服務摘要:" - -#. (itstool) path: listitem/para -#: book.translate.xml:4962 -msgid "" -"sshd - The Secure Shell (SSH) daemon " -"is used to remotely access a system over an encrypted connection. Only " -"enable this service if the system should be available for remote logins." -msgstr "" -"sshd - Secure Shell (SSH) Daemon 可從遠" -"端透過加密的連線存取系統,只有在系統允許遠端登入時開啟這個服務。" - -#. (itstool) path: listitem/para -#: book.translate.xml:4970 -msgid "" -"moused - Enable this service if the mouse will be used " -"from the command-line system console." -msgstr "" -"moused - 若在指令列系統 Console 會使用到滑鼠時,可開啟此服" -"務。" - -#. (itstool) path: listitem/para -#: book.translate.xml:4976 -msgid "" -"ntpd - The Network Time Protocol (NTP) " -"daemon for automatic clock synchronization. Enable this service if there is " -"a Windows, Kerberos, or " -"LDAP server on the network." -msgstr "" -"ntpd - 網路時間通訊協定 (Network Time Protoco, " -"NTP) Daemon 用來自動同步時間。若在網路上有使用 Windows, Kerberos 或 LDAP 伺服器時,可開啟此服務。" - -#. (itstool) path: listitem/para -#: book.translate.xml:4984 -msgid "" -"powerd - System power control utility for power control " -"and energy saving." -msgstr "powerd - 系統電源控制工具用來做電源控制與節能。" - -#. (itstool) path: sect2/title -#. (itstool) path: figure/title -#: book.translate.xml:4991 book.translate.xml:4999 -msgid "Enabling Crash Dumps" -msgstr "開啟當機資訊 (Crash Dump)" - -#. (itstool) path: sect2/para -#: book.translate.xml:4993 -msgid "" -"The next menu is used to configure whether or not crash dumps should be " -"enabled. Enabling crash dumps can be useful in debugging issues with the " -"system, so users are encouraged to enable crash dumps." -msgstr "" -"接下來的選單用來設定是否開啟當機資訊 (Crash dump),開啟當機資訊對系統除錯非常" -"有用,因此建議使用者開啟當機資訊。" - -#. (itstool) path: imageobject/imagedata -#. This is a reference to an external file such as an image or video. When -#. the file changes, the md5 hash will change to let you know you need to -#. update your localized copy. The msgstr is not used at all. Set it to -#. whatever you like once you have updated your copy of the file. -#: book.translate.xml:5003 -msgctxt "_" -msgid "external ref='bsdinstall/bsdinstall-config-crashdump' md5='__failed__'" -msgstr "" - -#. (itstool) path: sect2/title -#: book.translate.xml:5010 -msgid "Add Users" -msgstr "新增使用者" - -#. (itstool) path: sect2/para -#: book.translate.xml:5012 -msgid "" -"The next menu prompts to create at least one user account. It is recommended " -"to login to the system using a user account rather than as root. When logged in as root, there are essentially no limits or " -"protection on what can be done. Logging in as a normal user is safer and " -"more secure." -msgstr "" -"下個選單會提示建立至少一個使用者帳號。建議使用 root 以外的使用者帳號登入系統,當使用 root 登入時,基本上沒有任何的限制或保護。\n" -"使用一般使用者登入較保險且安全。" - -#. (itstool) path: sect2/para -#: book.translate.xml:5019 -msgid "Select [ Yes ] to add new users." -msgstr "選擇 [ Yes ] 來新增新使用者。" - -#. (itstool) path: figure/title -#: book.translate.xml:5023 -msgid "Add User Accounts" -msgstr "新增使用者帳號" - -#. (itstool) path: imageobject/imagedata -#. This is a reference to an external file such as an image or video. When -#. the file changes, the md5 hash will change to let you know you need to -#. update your localized copy. The msgstr is not used at all. Set it to -#. whatever you like once you have updated your copy of the file. -#: book.translate.xml:5027 -msgctxt "_" -msgid "external ref='bsdinstall/bsdinstall-adduser1' md5='__failed__'" -msgstr "" - -#. (itstool) path: sect2/para -#: book.translate.xml:5032 -msgid "" -"Follow the prompts and input the requested information for the user account. " -"The example shown in creates the " -"asample user account." -msgstr "" -"請依照提示輸入請求的使用者帳號資訊, " -"的範例示範建立 asample 使用者帳" -"號。" - -#. (itstool) path: figure/title -#: book.translate.xml:5036 -msgid "Enter User Information" -msgstr "輸入使用者資訊" - -#. (itstool) path: imageobject/imagedata -#. This is a reference to an external file such as an image or video. When -#. the file changes, the md5 hash will change to let you know you need to -#. update your localized copy. The msgstr is not used at all. Set it to -#. whatever you like once you have updated your copy of the file. -#: book.translate.xml:5040 -msgctxt "_" -msgid "external ref='bsdinstall/bsdinstall-adduser2' md5='__failed__'" -msgstr "" - -#. (itstool) path: sect2/para -#: book.translate.xml:5045 -msgid "Here is a summary of the information to input:" -msgstr "這裡是要輸入的資訊摘要:" - -#. (itstool) path: listitem/para -#: book.translate.xml:5049 -msgid "" -"Username - The name the user will enter to log in. A " -"common convention is to use the first letter of the first name combined with " -"the last name, as long as each username is unique for the system. The " -"username is case sensitive and should not contain any spaces." -msgstr "" -"使用者名稱 (Username) - 登入時使用者要輸入的名稱,常見的慣" -"例是用姓的前一個字母與名結合,只要每個使用者名稱在系統唯一的皆可。使用者名稱" -"區分大小寫且不應含有任何空白字元。" - -#. (itstool) path: listitem/para -#: book.translate.xml:5058 -msgid "" -"Full name - The user's full name. This can contain spaces " -"and is used as a description for the user account." -msgstr "" -"全名 (Full name) - 使用者的全名,這個欄位可使用空白並且會" -"用來描述該使用者帳號。" - -#. (itstool) path: listitem/para -#: book.translate.xml:5064 -msgid "" -"Uid - User ID. Typically, this is left " -"blank so the system will assign a value." -msgstr "" -"Uid - 使用者 ID,通常這個欄位會留空,系" -"統會自動分配一個值。" - -#. (itstool) path: listitem/para -#: book.translate.xml:5070 -msgid "" -"Login group - The user's group. Typically this is left " -"blank to accept the default." -msgstr "" -"登入群組 (Login group) - 使用者的群組,通常這個欄位會留空" -"來使用預設值。" - -#. (itstool) path: listitem/para -#: book.translate.xml:5075 -msgid "" -"Invite user into other groups? " -"- Additional groups to which the user will be added as a member. If the user " -"needs administrative access, type wheel here." -msgstr "" -"邀請使用者進入其他群組? (Invite user " -"into other groups?) - 使用者要加入成為其成員的其他群組,若該使用者" -"需要管理權限,則在此輸入 wheel。" - -#. (itstool) path: listitem/para -#: book.translate.xml:5083 -msgid "Login class - Typically left blank for the default." -msgstr "登入類別 (Login class) - 通常會留空來使用預設值。" - -#. (itstool) path: listitem/para -#: book.translate.xml:5088 -msgid "" -"Shell - Type in one of the listed values to set the " -"interactive shell for the user. Refer to for more " -"information about shells." -msgstr "" -"Shell - 輸入清單中的其中一項來設定使用者所互動的 Shell,請" -"參考 取得更多有關 Shell 的資訊。" - -#. (itstool) path: listitem/para -#: book.translate.xml:5095 -msgid "" -"Home directory - The user's home directory. The default " -"is usually correct." -msgstr "" -"家目錄 (Home directory) - 使用者的家目錄,預設值通常是沒有" -"問題的。" - -#. (itstool) path: listitem/para -#: book.translate.xml:5100 -msgid "" -"Home directory permissions - Permissions on the user's " -"home directory. The default is usually correct." -msgstr "" -"家目錄權限 (Home directory permissions) - 使用者家目錄的權" -"限,預設值通常是沒有問題的。" - -#. (itstool) path: listitem/para -#: book.translate.xml:5106 -msgid "" -"Use password-based authentication? - Typically " -"yes so that the user is prompted to input their password " -"at login." -msgstr "" -"使用密碼為基礎的認証方式? (Use password-based authentication?) - 通常為是 (yes),使用者才可於登入時輸入密碼。" - -#. (itstool) path: listitem/para -#: book.translate.xml:5112 -msgid "" -"Use an empty password? - Typically no " -"as it is insecure to have a blank password." -msgstr "" -"使用空白密碼? (Use an empty password?) - 通常為否 " -"(no),因為使用空白密碼並不安全。" - -#. (itstool) path: listitem/para -#: book.translate.xml:5118 -msgid "" -"Use a random password? - Typically no " -"so that the user can set their own password in the next prompt." -msgstr "" -"使用隨機密碼? (Use a random password?) - 通常為否 " -"(no),這樣使用者接下來才可設定自己的密碼。" - -#. (itstool) path: listitem/para -#: book.translate.xml:5124 -msgid "" -"Enter password - The password for this user. Characters " -"typed will not show on the screen." -msgstr "" -"輸入密碼 (Enter password) - 這個使用者的密碼,輸入的字元不" -"會顯示在畫面上。" - -#. (itstool) path: listitem/para -#: book.translate.xml:5130 -msgid "" -"Enter password again - The password must be typed again " -"for verification." -msgstr "" -"再輸入密碼一次 (Enter password again) - 再輸入一次密碼來確" -"認無誤。" - -#. (itstool) path: listitem/para -#: book.translate.xml:5135 -msgid "" -"Lock out the account after creation? - Typically " -"no so that the user can login." -msgstr "" -"建立後鎖定使用者帳號? (Lock out the account after creation?) - 通常為否 (no),這樣使用者才可以登入。" - -#. (itstool) path: sect2/para -#: book.translate.xml:5141 -msgid "" -"After entering everything, a summary is shown for review. If a mistake was " -"made, enter no and try again. If everything is correct, " -"enter yes to create the new user." -msgstr "" -"在輸入完全部的資料後,會顯示摘要供檢查,若發現錯誤,可輸入否 (no) 然後再輸入一次,若輸入的所有資訊皆正確,輸入是 (yes) 以後便會建立新使用者。" - -#. (itstool) path: figure/title -#: book.translate.xml:5147 -msgid "Exit User and Group Management" -msgstr "離開使用者與群組管理" - -#. (itstool) path: imageobject/imagedata -#. This is a reference to an external file such as an image or video. When -#. the file changes, the md5 hash will change to let you know you need to -#. update your localized copy. The msgstr is not used at all. Set it to -#. whatever you like once you have updated your copy of the file. -#: book.translate.xml:5151 -msgctxt "_" -msgid "external ref='bsdinstall/bsdinstall-adduser3' md5='__failed__'" -msgstr "" - -#. (itstool) path: sect2/para -#: book.translate.xml:5156 -msgid "" -"If there are more users to add, answer the Add another user? question with yes. Enter no " -"to finish adding users and continue the installation." -msgstr "" -"若還有其他要新增的使用者,則在詢問新增其他使用者? (Add another user?" -") 時回答是 (yes)。輸入否 (no) 來完成加入使用者然後繼續安裝。" - -#. (itstool) path: sect2/para -#: book.translate.xml:5161 -msgid "" -"For more information on adding users and user management, see ." -msgstr "" -"要取得新增使用者與使用者管理的更多資訊,請參考 。" - -#. (itstool) path: sect2/title -#. (itstool) path: figure/title -#: book.translate.xml:5166 book.translate.xml:5172 -msgid "Final Configuration" -msgstr "最後設定" - -#. (itstool) path: sect2/para -#: book.translate.xml:5168 -msgid "" -"After everything has been installed and configured, a final chance is " -"provided to modify settings." -msgstr "在所有東西安裝並設定完之後,會提供最後一次修改設定的機會。" - -#. (itstool) path: imageobject/imagedata -#. This is a reference to an external file such as an image or video. When -#. the file changes, the md5 hash will change to let you know you need to -#. update your localized copy. The msgstr is not used at all. Set it to -#. whatever you like once you have updated your copy of the file. -#: book.translate.xml:5176 -msgctxt "_" -msgid "" -"external ref='bsdinstall/bsdinstall-finalconfiguration' md5='__failed__'" -msgstr "" - -#. (itstool) path: sect2/para -#: book.translate.xml:5181 -msgid "" -"Use this menu to make any changes or do any additional configuration before " -"completing the installation." -msgstr "使用這個選單在完成安裝前做任何更改或做任何額外的設定。" - -#. (itstool) path: listitem/para -#: book.translate.xml:5186 -msgid "" -"Add User - Described in ." -msgstr "" -"新增使用者 (Add User) - 詳述於 。" - -#. (itstool) path: listitem/para -#: book.translate.xml:5190 -msgid "" -"Root Password - Described in ." -msgstr "" -"Root 密碼 (Root Password) - 詳述於 。" - -#. (itstool) path: listitem/para -#: book.translate.xml:5194 -msgid "" -"Hostname - Described in ." -msgstr "" -"主機名稱 (Hostname) - 詳述於 。" - -#. (itstool) path: listitem/para -#: book.translate.xml:5198 -msgid "" -"Network - Described in ." -msgstr "" -"網路 (Network) - 詳述於 。" - -#. (itstool) path: listitem/para -#: book.translate.xml:5202 -msgid "" -"Services - Described in ." -msgstr "" -"服務 (Services) - 詳述於 。" - -#. (itstool) path: listitem/para -#: book.translate.xml:5206 -msgid "" -"Time Zone - Described in ." -msgstr "" -"時區 (Time Zone) - 詳述於 。" - -#. (itstool) path: listitem/para -#: book.translate.xml:5210 -msgid "" -"Handbook - Download and install the FreeBSD Handbook." -msgstr "使用手冊 (Handbook) - 下載並安裝 FreeBSD 使用手冊。" - -#. (itstool) path: sect2/para -#: book.translate.xml:5215 -msgid "" -"After any final configuration is complete, select Exit." -msgstr "完成最後的設定之後,選擇 Exit。" - -#. (itstool) path: figure/title -#. (itstool) path: sect2/title -#: book.translate.xml:5219 book.translate.xml:11496 -msgid "Manual Configuration" -msgstr "手動設定" - -#. (itstool) path: imageobject/imagedata -#. This is a reference to an external file such as an image or video. When -#. the file changes, the md5 hash will change to let you know you need to -#. update your localized copy. The msgstr is not used at all. Set it to -#. whatever you like once you have updated your copy of the file. -#: book.translate.xml:5223 -msgctxt "_" -msgid "" -"external ref='bsdinstall/bsdinstall-final-modification-shell' " -"md5='__failed__'" -msgstr "" - -#. (itstool) path: sect2/para -#: book.translate.xml:5228 -msgid "" -"bsdinstall will prompt if there are any " -"additional configuration that needs to be done before rebooting into the new " -"system. Select [ Yes ] to exit to a shell within the " -"new system or [ No ] to proceed to the last step of " -"the installation." -msgstr "" -"bsdinstall 會提示是否有任何額外的設定需要在重新開" -"機進入新系統之前完成。選擇 [ Yes ] 會離開進入到新系統" -"的 Shell 或 [ No ] 繼續最後的安裝步驟。" - -#. (itstool) path: figure/title -#: book.translate.xml:5237 -msgid "Complete the Installation" -msgstr "完成安裝" - -#. (itstool) path: imageobject/imagedata -#. This is a reference to an external file such as an image or video. When -#. the file changes, the md5 hash will change to let you know you need to -#. update your localized copy. The msgstr is not used at all. Set it to -#. whatever you like once you have updated your copy of the file. -#: book.translate.xml:5241 -msgctxt "_" -msgid "external ref='bsdinstall/bsdinstall-mainexit' md5='__failed__'" -msgstr "" - -#. (itstool) path: sect2/para -#: book.translate.xml:5246 -msgid "" -"If further configuration or special setup is needed, select " -"[ Live CD ] to boot the install media into Live " -"CD mode." -msgstr "" -"若有需要做進一步或特殊的設定,選擇 [ Live CD ] 會開機" -"進入安裝媒體的 Live CD 模式。" - -#. (itstool) path: sect2/para -#: book.translate.xml:5251 -msgid "" -"If the installation is complete, select [ Reboot ] to " -"reboot the computer and start the new FreeBSD system. Do not forget to " -"remove the FreeBSD install media or the computer may boot from it again." -msgstr "" -"若安裝已完成,選擇 [ Reboot ] 重新開啟電腦然後啟動新" -"的 FreeBSD 電腦。不要忘了移除 FreeBSD 安裝媒體,否則電腦會再次開機進入安裝程" -"式。" - -#. (itstool) path: sect2/para -#: book.translate.xml:5257 -msgid "" -"As FreeBSD boots, informational messages are displayed. After the system " -"finishes booting, a login prompt is displayed. At the login: prompt, enter the username added during the installation. Avoid " -"logging in as root. Refer to " -" for instructions on how to become the " -"superuser when administrative access is needed." -msgstr "" -"FreeBSD 開機的過程會顯示許多可以參考的訊息,系統開機完成後,會顯示登入提示," -"在 login: 提示,輸入安裝時新增的使用者名稱。登入時避免直接使" -"用 root,請參考 來取得當需要管理權限時如何成為超級使用者的說明。" - -#. (itstool) path: sect2/para -#: book.translate.xml:5266 -msgid "" -"The messages that appeared during boot can be reviewed by pressing " -"Scroll-Lock to turn on the scroll-back buffer. The " -"PgUp, PgDn, and arrow keys can be used to " -"scroll back through the messages. When finished, press Scroll-Lock again to unlock the display and return to the console. To review " -"these messages once the system has been up for some time, type " -"less /var/run/dmesg.boot from a command prompt. Press " -"q to return to the command line after viewing." -msgstr "" -"要查看開機過程顯示的訊息可按 Scroll-Lock 鍵來開啟卷軸暫存," -"然後可使用 PgUp, PgDn 以及方向鍵來捲動訊" -"息。查看完成之後再按 Scroll-Lock 鍵一次來解除畫面鎖定並返回 " -"Console。系統開機一段時間之後要查看這些訊息可在指令提示後輸入 less /" -"var/run/dmesg.boot,查看後按下 q 鍵便可返回指令" -"列。" - -#. (itstool) path: sect2/para -#: book.translate.xml:5278 -msgid "" -"If sshd was enabled in , the first boot may be a bit slower as the system will " -"generate the RSA and DSA keys. " -"Subsequent boots will be faster. The fingerprints of the keys will be " -"displayed, as seen in this example:" -msgstr "" -"若在 有開啟 sshd,因系統會產生 RSADSA " -"金鑰第一次開機可能會有點慢,之後的開機便會恢復正常速度。接著會顯示金鑰的指紋 " -"(Fingerprint),如這個範例:" - -#. (itstool) path: sect2/screen -#: book.translate.xml:5284 -#, no-wrap -msgid "" -"Generating public/private rsa1 key pair.\n" -"Your identification has been saved in /etc/ssh/ssh_host_key.\n" -"Your public key has been saved in /etc/ssh/ssh_host_key.pub.\n" -"The key fingerprint is:\n" -"10:a0:f5:af:93:ae:a3:1a:b2:bb:3c:35:d9:5a:b3:f3 root@machine3.example.com\n" -"The key's randomart image is:\n" -"+--[RSA1 1024]----+\n" -"| o.. |\n" -"| o . . |\n" -"| . o |\n" -"| o |\n" -"| o S |\n" -"| + + o |\n" -"|o . + * |\n" -"|o+ ..+ . |\n" -"|==o..o+E |\n" -"+-----------------+\n" -"Generating public/private dsa key pair.\n" -"Your identification has been saved in /etc/ssh/ssh_host_dsa_key.\n" -"Your public key has been saved in /etc/ssh/ssh_host_dsa_key.pub.\n" -"The key fingerprint is:\n" -"7e:1c:ce:dc:8a:3a:18:13:5b:34:b5:cf:d9:d1:47:b2 root@machine3.example.com\n" -"The key's randomart image is:\n" -"+--[ DSA 1024]----+\n" -"| .. . .|\n" -"| o . . + |\n" -"| . .. . E .|\n" -"| . . o o . . |\n" -"| + S = . |\n" -"| + . = o |\n" -"| + . * . |\n" -"| . . o . |\n" -"| .o. . |\n" -"+-----------------+\n" -"Starting sshd." -msgstr "" - -#. (itstool) path: sect2/para -#: book.translate.xml:5320 -msgid "" -"Refer to for more information about fingerprints " -"and SSH." -msgstr "" -"請參考 來取得更多有關指紋與 SSH 的資訊。" - -#. (itstool) path: sect2/para -#: book.translate.xml:5323 -msgid "" -"FreeBSD does not install a graphical environment by default. Refer to for more information about installing and configuring a " -"graphical window manager." -msgstr "" -"FreeBSD 預設並不會安裝圖型化介面,請參考 取得有關安裝" -"與設定圖型化視窗管理程式的資訊。" - -#. (itstool) path: sect2/para -#: book.translate.xml:5327 -msgid "" -"Proper shutdown of a FreeBSD computer helps protect data and hardware from " -"damage. Do not turn off the power before the system has been " -"properly shut down! If the user is a member of the wheel group, become the superuser by typing " -"su at the command line and entering the root password. Then, type shutdown -p " -"now and the system will shut down cleanly, and if the hardware " -"supports it, turn itself off." -msgstr "" -"正確的將 FreeBSD 電腦關機對保護資料及避免硬體損壞有幫助。在系統尚未" -"正常關機之前請不要關閉電源! 若使用者為 wheel 群組的成員之一,可在指令列輸入 su 然後輸入 root 密碼來成為" -"超級使用者。接著輸入 shutdown -p now 系統便會關機,若硬體" -"支援的話,電腦會自行關閉電源。" - -#. (itstool) path: sect1/title -#. (itstool) path: sect2/title -#. (itstool) path: sect3/title -#: book.translate.xml:5340 book.translate.xml:12455 book.translate.xml:15126 -#: book.translate.xml:20296 book.translate.xml:35453 book.translate.xml:36223 -#: book.translate.xml:43361 book.translate.xml:48283 book.translate.xml:51529 -#: book.translate.xml:62189 book.translate.xml:63870 book.translate.xml:64608 -msgid "Troubleshooting" -msgstr "疑難排解" - -#. (itstool) path: sect1/indexterm -#: book.translate.xml:5342 -msgid "installation troubleshooting" -msgstr "" - -#. (itstool) path: sect1/para -#: book.translate.xml:5346 -msgid "" -"This section covers basic installation troubleshooting, such as common " -"problems people have reported." -msgstr "本節涵蓋基礎的安裝疑難排解,例如一些已有人回報的常見問題。" - -#. (itstool) path: sect1/para -#: book.translate.xml:5350 -msgid "" -"Check the Hardware Notes (https://www.freebsd.org/releases/index.html) document " -"for the version of FreeBSD to make sure the hardware is supported. If the " -"hardware is supported and lock-ups or other problems occur, build a custom " -"kernel using the instructions in to add " -"support for devices which are not present in the GENERIC kernel. The default kernel assumes that most hardware devices are " -"in their factory default configuration in terms of IRQs, " -"I/O addresses, and DMA channels. If " -"the hardware has been reconfigured, a custom kernel configuration file can " -"tell FreeBSD where to find things." -msgstr "" -"查看該 FreeBSD 版本的 Hardware Notes (https://www.freebsd.org/releases/index.html) 文" -"件來確認是否支援該硬體。若確定有支援該硬體但仍然卡住或發生其他問題,請依照 " -" 的指示編譯自訂核心來加入未在 " -"GENERIC 核心的裝置。預設的核心會假設大部份的硬體裝置會使" -"用原廠預設的 IRQs, I/O 位址,及 " -"DMA 通道,若硬體已經被重新設定過,自訂的核心設定檔可以告" -"訴 FreeBSD 到那找到這些裝置。" - -#. (itstool) path: note/para -#: book.translate.xml:5364 -msgid "" -"Some installation problems can be avoided or alleviated by updating the " -"firmware on various hardware components, most notably the motherboard. " -"Motherboard firmware is usually referred to as the BIOS. " -"Most motherboard and computer manufacturers have a website for upgrades and " -"upgrade information." -msgstr "" -"部份安裝問題可以透過更各種硬體元件的韌體來避免或緩解,特別是主機板。主機板的" -"韌體通常稱為 BIOS,大部份主機板與電腦製造商會有網站可以取" -"得升級程式與升級資訊。" - -#. (itstool) path: note/para -#: book.translate.xml:5371 -msgid "" -"Manufacturers generally advise against upgrading the motherboard " -"BIOS unless there is a good reason for doing so, like a " -"critical update. The upgrade process can go wrong, " -"leaving the BIOS incomplete and the computer inoperative." -msgstr "" -"製造商通常會建議若沒有特殊原因盡量避免升級主機板 BIOS,例" -"如:重大更新,升級的程多可能會出錯,導致未更新完成的 " -"BIOS 並讓電腦無法運作。" - -#. (itstool) path: sect1/para -#: book.translate.xml:5379 -msgid "" -"If the system hangs while probing hardware during boot, or it behaves " -"strangely during install, ACPI may be the culprit. " -"FreeBSD makes extensive use of the system ACPI service on " -"the i386, amd64, and ia64 platforms to aid in system configuration if it is " -"detected during boot. Unfortunately, some bugs still exist in both the " -"ACPI driver and within system motherboards and " -"BIOS firmware. ACPI can be disabled by " -"setting the hint.acpi.0.disabled hint in the third stage " -"boot loader:" -msgstr "" -"若系統在開機偵測硬體時卡住或安裝時運作異常,可能主因為 ACPI,FreeBSD 在 i386, amd64 及 ia64 平台廣泛的使用了系統 ACPI 服務來協助設定系統組態,若在開機時有偵測到該功能。不幸的是," -"ACPI 驅動程式與系統主機板及 BIOS 韌體之" -"間仍存在部份問題。可於開機載入程式的第三階段設定 hint.acpi.0." -"disabled Hint 來關閉 ACPI:" - -#. (itstool) path: sect1/screen -#: book.translate.xml:5391 -#, no-wrap -msgid "set hint.acpi.0.disabled=\"1\"" -msgstr "" - -#. (itstool) path: sect1/para -#: book.translate.xml:5393 -msgid "" -"This is reset each time the system is booted, so it is necessary to add " -"hint.acpi.0.disabled=\"1\" to the file /boot/" -"loader.conf. More information about the boot loader can be found " -"in ." -msgstr "" -"每一次系統重開之後便會重設,因此需要在 /boot/loader.conf 檔案加入 hint.acpi.0.disabled=\"1\"。更多有關開" -"機載入程式的資訊可於 取得。" - -#. (itstool) path: sect1/title -#: book.translate.xml:5400 -msgid "Using the Live CD" -msgstr "使用 Live CD" - -#. (itstool) path: sect1/para -#: book.translate.xml:5402 -msgid "" -"The welcome menu of bsdinstall, shown in , provides a [ Live CD ] option. This is useful for those who are still wondering whether " -"FreeBSD is the right operating system for them and want to test some of the " -"features before installing." -msgstr "" -"如 所示 bsdinstall 的歡迎選單提供了 [ Live CD ] 選項,這對那" -"些對 FreeBSD 是否為正確的作業系統尚存疑慮的人非常有幫助,這可讓這些人在安裝前" -"測試一部份功能。" - -#. (itstool) path: sect1/para -#: book.translate.xml:5409 -msgid "" -"The following points should be noted before using the " -"[ Live CD ]:" -msgstr "在使用 [ Live CD ] 之前必須注意以下幾點事項:" - -#. (itstool) path: listitem/para -#: book.translate.xml:5414 -msgid "" -"To gain access to the system, authentication is required. The username is " -"root and the password is blank." -msgstr "" -"若要增加存取權限,必須透過認証。使用者名稱為 root 而密碼則是空白。" - -#. (itstool) path: listitem/para -#: book.translate.xml:5420 -msgid "" -"As the system runs directly from the installation media, performance will be " -"significantly slower than that of a system installed on a hard disk." -msgstr "系統是直接從安裝媒體上執行,比起安裝到硬碟的系統,效能可能較差。" - -#. (itstool) path: listitem/para -#: book.translate.xml:5426 -msgid "" -"This option only provides a command prompt and not a graphical interface." -msgstr "這個選項只提供指令提示,不會有圖型化介面。" - -#. (itstool) path: chapter/title -#: book.translate.xml:5451 -msgid "FreeBSD Basics" -msgstr "FreeBSD 基礎" - -#. (itstool) path: sect1/para -#: book.translate.xml:5456 -msgid "" -"This chapter covers the basic commands and functionality of the FreeBSD " -"operating system. Much of this material is relevant for any UNIX-like operating system. New FreeBSD users are " -"encouraged to read through this chapter carefully." -msgstr "" -"接下來的這一章將涵蓋 FreeBSD 作業系統的基本指令及功能。 大部份的內容在 " -"UNIX-like 作業系統中都是相通的。 " -"如果您對這些內容熟悉的話,可以放心的跳過。 如果您剛接觸 FreeBSD,那您一定要仔" -"細的讀完這章。" - -#. (itstool) path: listitem/para -#: book.translate.xml:5465 -msgid "How to use and configure virtual consoles." -msgstr "如何使用 FreeBSD 的虛擬 Console。" - -#. (itstool) path: listitem/para -#: book.translate.xml:5469 -msgid "How to create and manage users and groups on FreeBSD." -msgstr "如何在 FreeBSD 建立與管理使用者與群組。" - -#. (itstool) path: listitem/para -#: book.translate.xml:5474 -msgid "" -"How UNIX file permissions and " -"FreeBSD file flags work." -msgstr "" -"UNIX 檔案權限以及 FreeBSD 檔案標" -"記的運作方式。" - -#. (itstool) path: listitem/para -#: book.translate.xml:5479 -msgid "The default FreeBSD file system layout." -msgstr "預設的 FreeBSD 檔案系統配置。" - -#. (itstool) path: listitem/para -#: book.translate.xml:5483 -msgid "The FreeBSD disk organization." -msgstr "FreeBSD 的磁碟組織。" - -#. (itstool) path: listitem/para -#: book.translate.xml:5487 -msgid "How to mount and unmount file systems." -msgstr "如何掛載 (Mount)、卸載 (Umount) 檔案系統。" - -#. (itstool) path: listitem/para -#: book.translate.xml:5491 -msgid "What processes, daemons, and signals are." -msgstr "什麼是程序、Daemon 以及信號 (Signal)。" - -#. (itstool) path: listitem/para -#: book.translate.xml:5495 -msgid "What a shell is, and how to change the default login environment." -msgstr "什麼是 Shell,以及如何變更您預設的登入環境。" - -#. (itstool) path: listitem/para -#: book.translate.xml:5500 -msgid "How to use basic text editors." -msgstr "如何使用基本的文字編輯器。" - -#. (itstool) path: listitem/para -#: book.translate.xml:5504 -msgid "What devices and device nodes are." -msgstr "什麼是裝置 (Device) 和裝置節點 (Device node)。" - -#. (itstool) path: listitem/para -#: book.translate.xml:5508 -msgid "How to read manual pages for more information." -msgstr "如何閱讀操作手冊以獲得更多的資訊。" - -#. (itstool) path: sect1/title -#: book.translate.xml:5514 -msgid "Virtual Consoles and Terminals" -msgstr "虛擬 Console 與終端機" - -#. (itstool) path: sect1/indexterm -#: book.translate.xml:5516 -msgid "virtual consoles" -msgstr "" - -#. (itstool) path: sect1/indexterm -#: book.translate.xml:5519 book.translate.xml:47574 -msgid "terminals" -msgstr "" - -#. (itstool) path: sect1/indexterm -#. (itstool) path: sect3/indexterm -#: book.translate.xml:5522 book.translate.xml:23271 -msgid "console" -msgstr "" - -#. (itstool) path: sect1/para -#: book.translate.xml:5526 -msgid "" -"Unless FreeBSD has been configured to automatically start a graphical " -"environment during startup, the system will boot into a command line login " -"prompt, as seen in this example:" -msgstr "" -"如果您沒有將 FreeBSD 設定成開機時自動進入圖形化模式,系統會進入指令登入提示像" -"是這樣的東西:" - -#. (itstool) path: sect1/screen -#: book.translate.xml:5531 -#, no-wrap -msgid "" -"FreeBSD/amd64 (pc3.example.org) (ttyv0)\n" -"\n" -"login:" -msgstr "" - -#. (itstool) path: sect1/para -#: book.translate.xml:5535 -msgid "" -"The first line contains some information about the system. The " -"amd64 indicates that the system in this example is " -"running a 64-bit version of FreeBSD. The hostname is pc3.example." -"org, and ttyv0 indicates that this is the " -"system console. The second line is the login prompt." -msgstr "" -"第一行包含了剛開機完系統的資訊,amd64 代表此範例所使用的系" -"統是執行 64-位元版本的 FreeBSD,這台主機的名稱是 pc3.example." -"orgttyv0 代表這是個 系統 Console。第二行則是登人的提示訊息。" - -#. (itstool) path: sect1/para -#: book.translate.xml:5543 -msgid "" -"Since FreeBSD is a multiuser system, it needs some way to distinguish " -"between different users. This is accomplished by requiring every user to log " -"into the system before gaining access to the programs on the system. Every " -"user has a unique name username and a personal " -"password." -msgstr "" -"FreeBSD 是一個多使用者的系統,需要一套可以分辨不同使用者的方法。因此所有的使" -"用者在執行程式之前必須先“登入”系統以取得系統內程式的存取權限。每個使用者都有" -"一組獨一無二的使用者名稱 (username) 及個人密碼 " -"(password)。" - -#. (itstool) path: sect1/para -#: book.translate.xml:5550 -msgid "" -"To log into the system console, type the username that was configured during " -"system installation, as described in , and press Enter. Then enter the password associated with " -"the username and press Enter. The password is not " -"echoed for security reasons." -msgstr "" -"要登入系統 Console 需輸入在系統安裝時設定的使用者名稱,請參考 ,並按下 Enter。 接著輸入該使用者名" -"稱的密碼按下 Enter。 輸入的密碼為了安全起見不會顯" -"示在畫面上。" - -#. (itstool) path: sect1/para -#: book.translate.xml:5558 -msgid "" -"Once the correct password is input, the message of the day (MOTD) will be displayed followed by a command prompt. Depending upon the " -"shell that was selected when the user was created, this prompt will be a " -"#, $, or % " -"character. The prompt indicates that the user is now logged into the FreeBSD " -"system console and ready to try the available commands." -msgstr "" -"如果您輸入了正確的密碼,您應該會看到今日訊息 (Message of the day, " -"MOTD),後面接著顯示指令提示字元,依使用者建立時所選擇的 " -"Shell 會有不同的提示字元可能為 #, $ 或" -"者 %。 看到指令提示代表使用者現在已經登入 FreeBSD 系統 " -"Console 且已經準備好可以下指令。" - -#. (itstool) path: sect2/title -#: book.translate.xml:5568 -msgid "Virtual Consoles" -msgstr "虛擬 Console" - -#. (itstool) path: sect2/para -#: book.translate.xml:5570 -msgid "" -"While the system console can be used to interact with the system, a user " -"working from the command line at the keyboard of a FreeBSD system will " -"typically instead log into a virtual console. This is because system " -"messages are configured by default to display on the system console. These " -"messages will appear over the command or file that the user is working on, " -"making it difficult to concentrate on the work at hand." -msgstr "" -"雖然系統 Console 已經可以用來與系統互動,但使用鍵盤來下指令使用 FreeBSD 系統" -"的使用者通常會使用虛擬 Console 登入。 因為系統訊息預設會顯示在系統 Console," -"這些訊些會在使用者作業的過程中不斷出現,讓使用者難以專心作業。" - -#. (itstool) path: sect2/para -#: book.translate.xml:5579 -msgid "" -"By default, FreeBSD is configured to provide several virtual consoles for " -"inputting commands. Each virtual console has its own login prompt and shell " -"and it is easy to switch between virtual consoles. This essentially provides " -"the command line equivalent of having several windows open at the same time " -"in a graphical environment." -msgstr "" -"FreeBSD 預設提供多個虛擬 Console 可輸入指令,每個虛擬 Console 都有自己的登入" -"提示及 Shell 並且可以輕易的在虛擬 Console 間切換。 這實際上讓指令輸入有了類似" -"於圖型化環境中可以同時開啟多個視窗的功能。" - -#. (itstool) path: sect2/para -#: book.translate.xml:5586 -msgid "" -"The key combinations AltF1 through AltF8 have been reserved by FreeBSD for switching between virtual " -"consoles. Use AltF1 " -"to switch to the system console (ttyv0), " -"AltF2 to access the " -"first virtual console (ttyv1), AltF3 to access the second virtual console " -"(ttyv2), and so on. When using Xorg as a graphical console, the combination becomes " -"CtrlAltF1 to " -"return to a text-based virtual console." -msgstr "" -"組合鍵 AltF1 至 " -"AltF8 被 FreeBSD 保留" -"用來切換虛擬 Console,使用 AltF1 可切換至系統 Console (ttyv0)," -"AltF2 可存取第一個虛" -"擬 Console (ttyv1),AltF3 可存取第二個虛擬 Console " -"(ttyv2),以此類推。當使用 Xorg 作為圖型化 Console 時,組合鍵則改使用 CtrlAltF1 來切換回文字介面的" -"虛擬 Console。" - -#. (itstool) path: sect2/para -#: book.translate.xml:5606 -msgid "" -"When switching from one console to the next, FreeBSD manages the screen " -"output. The result is an illusion of having multiple virtual screens and " -"keyboards that can be used to type commands for FreeBSD to run. The programs " -"that are launched in one virtual console do not stop running when the user " -"switches to a different virtual console." -msgstr "" -"當您從一個 Console 切換到下一個的時候,FreeBSD 會切換畫面顯示的內容, 這就好" -"像有很多虛擬的螢幕和鍵盤可以讓您輸入指令到 FreeBSD 執行。 在某一個虛擬 " -"Console 上執行的程式並不會因為使用者切到別的 Console 而停止執行。" - -#. (itstool) path: sect2/para -#: book.translate.xml:5613 -msgid "" -"Refer to kbdcontrol1, " -"vidcontrol1, atkbd4, " -"syscons4, and vt4 for a more technical " -"description of the FreeBSD console and its keyboard drivers." -msgstr "" -"請參考 kbdcontrol1, vidcontrol1, " -"atkbd4, syscons4 以及 " -"vt4 來取得更多有關 FreeBSD Console 及鍵盤驅動程式的技術說明。" - -#. (itstool) path: sect2/para -#: book.translate.xml:5618 -msgid "" -"In FreeBSD, the number of available virtual consoles is configured in this " -"section of /etc/ttys:" -msgstr "" -"FreeBSD 中虛擬 Console 的數量設定在 /etc/ttys 檔案中的下" -"列章節:" - -#. (itstool) path: sect2/programlisting -#: book.translate.xml:5622 -#, no-wrap -msgid "" -"# name getty type status comments\n" -"#\n" -"ttyv0 \"/usr/libexec/getty Pc\" xterm on secure\n" -"# Virtual terminals\n" -"ttyv1 \"/usr/libexec/getty Pc\" xterm on secure\n" -"ttyv2 \"/usr/libexec/getty Pc\" xterm on secure\n" -"ttyv3 \"/usr/libexec/getty Pc\" xterm on secure\n" -"ttyv4 \"/usr/libexec/getty Pc\" xterm on secure\n" -"ttyv5 \"/usr/libexec/getty Pc\" xterm on secure\n" -"ttyv6 \"/usr/libexec/getty Pc\" xterm on secure\n" -"ttyv7 \"/usr/libexec/getty Pc\" xterm on secure\n" -"ttyv8 \"/usr/X11R6/bin/xdm -nodaemon\" xterm off secure" -msgstr "" - -#. (itstool) path: sect2/para -#: book.translate.xml:5636 -msgid "" -"To disable a virtual console, put a comment symbol (#) at " -"the beginning of the line representing that virtual console. For example, to " -"reduce the number of available virtual consoles from eight to four, put a " -"# in front of the last four lines representing virtual " -"consoles ttyv5 through ttyv8. " -"Do not comment out the line for the system console " -"ttyv0. Note that the last virtual console " -"(ttyv8) is used to access the graphical environment if " -"Xorg has been installed and configured as " -"described in ." -msgstr "" -"要關閉虛擬 Console 只要在指定的虛擬 Console 該行設定的一開始加上註解符號 " -"(#)。 例如要將虛擬 Console 的數量由 8 個改為 4 個,則可將 " -"# 加在代表虛擬 Console 的 ttyv5 到 " -"ttyv8 的最後四行一開始。 請勿將系" -"統 Console ttyv0 加上註解符號。 注意,若有依照 安裝並設定 Xorg 時,會用到最後一" -"個虛擬 Console (ttyv8)。" - -#. (itstool) path: sect2/para -#: book.translate.xml:5650 -msgid "" -"For a detailed description of every column in this file and the available " -"options for the virtual consoles, refer to " -"ttys5." -msgstr "" -"有關各欄位的設定以及其他選項,請參閱 ttys5 說明。" - -#. (itstool) path: sect2/title -#: book.translate.xml:5656 -msgid "Single User Mode" -msgstr "單使用者模式" - -#. (itstool) path: sect2/para -#: book.translate.xml:5658 -msgid "" -"The FreeBSD boot menu provides an option labelled as Boot Single " -"User. If this option is selected, the system will boot into a " -"special mode known as single user mode. This mode is " -"typically used to repair a system that will not boot or to reset the " -"root password when it is not " -"known. While in single user mode, networking and other virtual consoles are " -"not available. However, full root access to the system is available, and by default, the " -"root password is not needed. For " -"these reasons, physical access to the keyboard is needed to boot into this " -"mode and determining who has physical access to the keyboard is something to " -"consider when securing a FreeBSD system." -msgstr "" -"FreeBSD 開機選單會提供一個選項為 Boot Single User,若選擇該項" -"目,系統將會進入所謂 單使用者模式 的特殊模式。 此模式通常用在" -"修復系統無法開機或重設已忘掉的 root 密碼。 在當使用者模式中無法使用網路及其他虛擬 Console,但有完整 " -"root 對系統的存取權限,而且預設是" -"不須要輸入 root 密碼。 也因此,要" -"能透過實體鍵盤操作才能進入此模式,在考量 FreeBSD 系統安全時須要限制可操作實體" -"鍵盤的人員。" - -#. (itstool) path: sect2/para -#: book.translate.xml:5674 -msgid "" -"The settings which control single user mode are found in this section of " -"/etc/ttys:" -msgstr "" -"有關單使用者模式的設定可在 /etc/ttys 中的以下章節中找" -"到:" - -#. (itstool) path: sect2/programlisting -#: book.translate.xml:5677 -#, no-wrap -msgid "" -"# name getty type status comments\n" -"#\n" -"# If console is marked \"insecure\", then init will ask for the root password\n" -"# when going to single-user mode.\n" -"console none unknown off secure" -msgstr "" - -#. (itstool) path: sect2/para -#: book.translate.xml:5683 -msgid "" -"By default, the status is set to secure. This assumes " -"that who has physical access to the keyboard is either not important or it " -"is controlled by a physical security policy. If this setting is changed to " -"insecure, the assumption is that the environment itself " -"is insecure because anyone can access the keyboard. When this line is " -"changed to insecure, FreeBSD will prompt for the " -"root password when a user " -"selects to boot into single user mode." -msgstr "" -"預設狀態為安全 (secure),這代表誰能夠操作實體鍵盤不是不重" -"要就是已受到實體安全規範管制。 若設定更該為不安全 (insecure) 則代表主機所在的環境不安全,因為任何人皆可接觸鍵盤。 當此行設定更改" -"為不安全 (insecure) 時,當使用擇選擇單使用者模式時," -"FreeBSD 將會要求輸入 root 的密" -"碼。" - -#. (itstool) path: note/para -#: book.translate.xml:5695 -msgid "" -"Be careful when changing this setting to insecure! If the root " -"password is forgotten, booting into single user mode is still possible, but " -"may be difficult for someone who is not familiar with the FreeBSD booting " -"process." -msgstr "" -"請審慎考慮是否要改為 insecure! 因為" -"萬一忘記 root 密碼的話,雖然還是" -"有其他辦法可以登入單使用者模式,只是對不熟 FreeBSD 開機程序的人可就麻煩了。" - -#. (itstool) path: sect2/title -#: book.translate.xml:5705 -msgid "Changing Console Video Modes" -msgstr "更改 Console 影像模式" - -#. (itstool) path: sect2/para -#: book.translate.xml:5707 -msgid "" -"The FreeBSD console default video mode may be adjusted to 1024x768, " -"1280x1024, or any other size supported by the graphics chip and monitor. To " -"use a different video mode load the VESA module:" -msgstr "" -"FreeBSD Console 預設顯示大小可以調整為 1024x768、1280x1024 或其他顯示卡與螢幕" -"有支援的解析度大小。 要使用不同的影像模式需載入 VESA 模" -"組:" - -#. (itstool) path: sect2/screen -#: book.translate.xml:5712 -#, no-wrap -msgid "# kldload vesa" -msgstr "" - -#. (itstool) path: sect2/para -#: book.translate.xml:5714 -msgid "" -"To determine which video modes are supported by the hardware, use " -"vidcontrol1. To get a list of supported video modes issue the " -"following:" -msgstr "" -"要偵測硬體支援的影像模式,可使用 vidcontrol1。 要取得支援的影像模式" -"清單可輸入以下指令:" - -#. (itstool) path: sect2/screen -#: book.translate.xml:5718 -#, no-wrap -msgid "# vidcontrol -i mode" -msgstr "" - -#. (itstool) path: sect2/para -#: book.translate.xml:5720 -msgid "" -"The output of this command lists the video modes that are supported by the " -"hardware. To select a new video mode, specify the mode using " -"vidcontrol1 as the root user:" -msgstr "" -"該指令會顯示硬體所支援的影像模式清單,要採用新的影像模式需以 root 使用者執行 " -"vidcontrol1 指令:" - -#. (itstool) path: sect2/screen -#: book.translate.xml:5725 -#, no-wrap -msgid "# vidcontrol MODE_279" -msgstr "" - -#. (itstool) path: sect2/para -#: book.translate.xml:5727 -msgid "" -"If the new video mode is acceptable, it can be permanently set on boot by " -"adding it to /etc/rc.conf:" -msgstr "" -"若可接受新的影像模式,可以在 /etc/rc.conf 加入設定,讓每" -"次重開機後會自動生效:" - -#. (itstool) path: sect2/programlisting -#: book.translate.xml:5731 -#, no-wrap -msgid "allscreens_flags=\"MODE_279\"" -msgstr "" - -#. (itstool) path: sect1/title -#: book.translate.xml:5748 -msgid "Users and Basic Account Management" -msgstr "使用者與基礎帳號管理" - -#. (itstool) path: sect1/para -#: book.translate.xml:5750 -msgid "" -"FreeBSD allows multiple users to use the computer at the same time. While " -"only one user can sit in front of the screen and use the keyboard at any one " -"time, any number of users can log in to the system through the network. To " -"use the system, each user should have their own user account." -msgstr "" -"FreeBSD 允許多使用者同時使用電腦,在一次只能有一位使用者坐在電腦螢幕前使用鍵" -"盤操作的同時,可讓任何數量的使用者透過網路登入到系統。每一位要使用該系統的使" -"用者應有自己的帳號。" - -#. (itstool) path: sect1/para -#: book.translate.xml:5756 -msgid "This chapter describes:" -msgstr "本章介紹:" - -#. (itstool) path: listitem/para -#: book.translate.xml:5760 -msgid "The different types of user accounts on a FreeBSD system." -msgstr "FreeBSD 系統中各種類型的使用者帳號。" - -#. (itstool) path: listitem/para -#: book.translate.xml:5765 -msgid "How to add, remove, and modify user accounts." -msgstr "如何加入、移除與修改使用者帳號。" - -#. (itstool) path: listitem/para -#: book.translate.xml:5769 -msgid "" -"How to set limits to control the resources that users and groups are allowed " -"to access." -msgstr "如何設定用來控制使用者與群組允許存取的資源的限制。" - -#. (itstool) path: listitem/para -#: book.translate.xml:5775 -msgid "How to create groups and add users as members of a group." -msgstr "如何建立群組與加入使用者作為群組成員。" - -#. (itstool) path: sect2/title -#: book.translate.xml:5781 -msgid "Account Types" -msgstr "帳號類型" - -#. (itstool) path: sect2/para -#: book.translate.xml:5783 -msgid "" -"Since all access to the FreeBSD system is achieved using accounts and all " -"processes are run by users, user and account management is important." -msgstr "" -"由於所有對 FreeBSD 系統的存取是透過使用者帳號來達成,且所有的程序需要經由使用" -"者來執行,因此使用者帳號管理非常重要。" - -#. (itstool) path: sect2/para -#: book.translate.xml:5787 -msgid "" -"There are three main types of accounts: system accounts, user accounts, and " -"the superuser account." -msgstr "有三種主要類型的帳號:系統帳號、使用者帳號以及超級使用者帳號。" - -#. (itstool) path: sect3/title -#: book.translate.xml:5791 -msgid "System Accounts" -msgstr "系統帳號" - -#. (itstool) path: sect3/indexterm -#: book.translate.xml:5793 -msgid "accounts system" -msgstr "" - -#. (itstool) path: sect3/para -#: book.translate.xml:5798 -msgid "" -"System accounts are used to run services such as DNS, mail, and web servers. " -"The reason for this is security; if all services ran as the superuser, they " -"could act without restriction." -msgstr "" -"系統帳號用來執行服務,例如 DNS、郵件及網頁伺服器,要這麼作是因為安全性考量," -"若所有的服務均以超級使用者來執行,那麼這些服務的運作將不會受到限制。" - -#. (itstool) path: sect3/indexterm -#: book.translate.xml:5803 -msgid "" -"accounts daemon" -msgstr "" - -#. (itstool) path: sect3/indexterm -#: book.translate.xml:5807 -msgid "" -"accounts operator" -msgstr "" - -#. (itstool) path: sect3/para -#: book.translate.xml:5812 -msgid "" -"Examples of system accounts are daemon, operator, " -"bind, news, and www." -msgstr "" -"系統帳號的例子有 daemon, " -"operator, bind, news, and www。" - -#. (itstool) path: sect3/indexterm -#: book.translate.xml:5819 -msgid "" -"accounts nobody" -msgstr "" - -#. (itstool) path: sect3/para -#: book.translate.xml:5824 -msgid "" -"nobody is the generic " -"unprivileged system account. However, the more services that use nobody, the more files and processes that " -"user will become associated with, and hence the more privileged that user " -"becomes." -msgstr "" -"nobody 是通用的無權限系統帳號。雖" -"然如此,只有要越多的服務使用 nobody,就會有更多的檔案與程式與該使用者相關聯,會讓該使用者擁有更多的權" -"限。" - -#. (itstool) path: sect3/title -#: book.translate.xml:5833 -msgid "User Accounts" -msgstr "使用者帳號" - -#. (itstool) path: sect3/indexterm -#: book.translate.xml:5835 -msgid "accounts user" -msgstr "" - -#. (itstool) path: sect3/para -#: book.translate.xml:5840 -msgid "" -"User accounts are assigned to real people and are used to log in and use the " -"system. Every person accessing the system should have a unique user account. " -"This allows the administrator to find out who is doing what and prevents " -"users from clobbering the settings of other users." -msgstr "" -"使用者帳號會分配給實際人員,用來登入及使用系統。每位要存取系統的人員需要擁有" -"一組唯一的使用者帳號,這可讓管理者辨識誰在做什麼以及避免使用者覆蓋其他使用者" -"的設定。" - -#. (itstool) path: sect3/para -#: book.translate.xml:5846 -msgid "" -"Each user can set up their own environment to accommodate their use of the " -"system, by configuring their default shell, editor, key bindings, and " -"language settings." -msgstr "" -"每位使用者可以設定自己的環境來配合自己使用系統的習慣,透過設定預設的 Shell、" -"編輯器、組合鍵 (Key Binding) 及語言設定。" - -#. (itstool) path: sect3/para -#: book.translate.xml:5851 -msgid "" -"Every user account on a FreeBSD system has certain information associated " -"with it:" -msgstr "每個在 FreeBSD 系統的使用者帳號都會有一些相關的資訊:" - -#. (itstool) path: varlistentry/term -#: book.translate.xml:5856 -msgid "User name" -msgstr "使用者名稱 (User name)" - -#. (itstool) path: listitem/para -#: book.translate.xml:5859 -msgid "" -"The user name is typed at the login: prompt. Each user must " -"have a unique user name. There are a number of rules for creating valid user " -"names which are documented in passwd5. It is recommended to " -"use user names that consist of eight or fewer, all lower case characters in " -"order to maintain backwards compatibility with applications." -msgstr "" -"在 login: 提示出現時便要輸入使用者名稱,每位使用者必須要有一" -"個唯一的使用者名稱。要建立有效的使用者名稱要遵守數條規則,在 " -"passwd5 中有說明。建議使用者名稱由 8 個或更少的字母組成,全部採用小寫字" -"元以向下相容應用程式。" - -#. (itstool) path: varlistentry/term -#: book.translate.xml:5871 -msgid "Password" -msgstr "密碼 (Password)" - -#. (itstool) path: listitem/para -#: book.translate.xml:5874 -msgid "Each account has an associated password." -msgstr "每個帳號都會有密碼。" - -#. (itstool) path: varlistentry/term -#: book.translate.xml:5879 -msgid "User ID (UID)" -msgstr "使用者 ID (UID)" - -#. (itstool) path: listitem/para -#: book.translate.xml:5882 -msgid "" -"The User ID (UID) is a number used to uniquely identify " -"the user to the FreeBSD system. Commands that allow a user name to be " -"specified will first convert it to the UID. It is " -"recommended to use a UID less than 65535, since higher values may cause " -"compatibility issues with some software." -msgstr "" -"使用者 ID (User ID, UID) 是一組數字用來獨一無二的辨識 " -"FreeBSD 系統的使用者,用到使用者名稱的指令會先將使用者名稱轉換為 " -"UID。建議使用小於 65535 的 UID,超過這個值可能會造成部份軟" -"體的相容性問題。" - -#. (itstool) path: varlistentry/term -#: book.translate.xml:5893 -msgid "Group ID (GID)" -msgstr "群組 ID (GID)" - -#. (itstool) path: listitem/para -#: book.translate.xml:5896 -msgid "" -"The Group ID (GID) is a number used to uniquely identify " -"the primary group that the user belongs to. Groups are a mechanism for " -"controlling access to resources based on a user's GID " -"rather than their UID. This can significantly reduce the " -"size of some configuration files and allows users to be members of more than " -"one group. It is recommended to use a GID of 65535 or lower as higher GIDs " -"may break some software." -msgstr "" -"群組 ID (Group ID, GID) 是一組數字用來獨一無二的辨識使用者" -"所屬的主要群組。群組是一個除了使用 UID 之外根據使用者的 " -"GID 來控制資源存取權的機制。這可以顯著的降低某些設定檔的大" -"小且可讓使用者成為一個以上群組的成員。建議使用 65535 或以下的 GID,因超過此值" -"的 GID 可能會讓部份軟體無法運作。" - -#. (itstool) path: varlistentry/term -#: book.translate.xml:5910 -msgid "Login class" -msgstr "登入類別 (Login class)" - -#. (itstool) path: listitem/para -#: book.translate.xml:5913 -msgid "" -"Login classes are an extension to the group mechanism that provide " -"additional flexibility when tailoring the system to different users. Login " -"classes are discussed further in ." -msgstr "" -"登入類別 (Login class) 擴充了群組機制,當在對不同使用者客製化系統時可提供額外" -"的彈性。在 有對登入類別更進一步的討論。" - -#. (itstool) path: varlistentry/term -#: book.translate.xml:5922 -msgid "Password change time" -msgstr "密碼更改時間 (Password change time)" - -#. (itstool) path: listitem/para -#: book.translate.xml:5925 -msgid "" -"By default, passwords do not expire. However, password expiration can be " -"enabled on a per-user basis, forcing some or all users to change their " -"passwords after a certain amount of time has elapsed." -msgstr "" -"預設情況下密碼並不會過期,雖然如此,密碼期限可在各別使用者上開啟,可強制部份" -"或所有使用者在某段期間過後更改他們的密碼。" - -#. (itstool) path: varlistentry/term -#: book.translate.xml:5934 -msgid "Account expiration time" -msgstr "帳號到期時間 (Account expiration time)" - -#. (itstool) path: listitem/para -#: book.translate.xml:5937 -msgid "" -"By default, FreeBSD does not expire accounts. When creating accounts that " -"need a limited lifespan, such as student accounts in a school, specify the " -"account expiry date using pw8. 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." -msgstr "" -"預設情況下 FreeBSD 的帳號不會有期限。當建立需要有限壽命的帳號時,例如,學校的" -"學生帳號,可使用 pw8 指定帳號的到期日期。到" -"期日期過後,便無法使用該帳號登入到系統,儘管該帳號的目錄及檔案仍存在。" - -#. (itstool) path: varlistentry/term -#: book.translate.xml:5948 -msgid "User's full name" -msgstr "使用者的全名 (User's full name)" - -#. (itstool) path: listitem/para -#: book.translate.xml:5951 -msgid "" -"The user name uniquely identifies the account to FreeBSD, but does not " -"necessarily reflect the user's real name. Similar to a comment, this " -"information can contain spaces, uppercase characters, and be more than 8 " -"characters long." -msgstr "" -"使用者名稱用來獨一無二的辦識 FreeBSD 的帳號,但並不一定反映了使用者的真實姓" -"名。類似註解,這個資訊可以含有空白、大寫字元並可超過 8 個字母的長度。" - -#. (itstool) path: varlistentry/term -#: book.translate.xml:5960 -msgid "Home directory" -msgstr "家目錄 (Home directory)" - -#. (itstool) path: listitem/para -#: book.translate.xml:5963 -msgid "" -"The home directory is the full path to a directory on the system. This is " -"the user's starting directory when the user logs in. A common convention is " -"to put all user home directories under /home/" -"username or /usr/home/" -"username. Each user stores their personal files and " -"subdirectories in their own home directory." -msgstr "" -"家目錄是系統中某個目錄的完整路徑,這個目錄是使用者登入後的起點目錄。習慣上會" -"將所有使用者目錄放置在 /home/username/usr/home/username。每位使用者可以儲存他們的個人檔案及子目錄於他們自己的家目錄。" - -#. (itstool) path: varlistentry/term -#: book.translate.xml:5974 -msgid "User shell" -msgstr "使用者 Shell (User shell)" - -#. (itstool) path: listitem/para -#: book.translate.xml:5977 -msgid "" -"The shell provides the user's default environment for interacting with the " -"system. There are many different kinds of shells and experienced users will " -"have their own preferences, which can be reflected in their account settings." -msgstr "" -"Shell 提供了使用者預設的環境來與系統互動。有數種不同類型的 Shell,有經驗的使" -"用者會有自己偏好的選擇,可儲存在自己的帳號設定。" - -#. (itstool) path: sect3/title -#: book.translate.xml:5988 -msgid "The Superuser Account" -msgstr "超級使用者帳號" - -#. (itstool) path: sect3/indexterm -#: book.translate.xml:5990 -msgid "accounts superuser (root)" -msgstr "" - -#. (itstool) path: sect3/para -#: book.translate.xml:5995 -msgid "" -"The superuser account, usually called root, is used to manage the system with no limitations on privileges. " -"For this reason, it should not be used for day-to-day tasks like sending and " -"receiving mail, general exploration of the system, or programming." -msgstr "" -"超級使用者帳號,通常稱作 root,用" -"來管理系統,沒有權限的限制,也因這個原因,該帳號不應該用來做每日的例行作業," -"如:寄信與收信、系統的一般探索或程式設計。" - -#. (itstool) path: sect3/para -#: book.translate.xml:6002 -msgid "" -"The superuser, unlike other user accounts, can operate without limits, and " -"misuse of the superuser account may result in spectacular disasters. User " -"accounts are unable to destroy the operating system by mistake, so it is " -"recommended to login as a user account and to only become the superuser when " -"a command requires extra privilege." -msgstr "" -"超級使用者並不像其他使用者帳號,可以沒有限制的操作,不正確的使用超級使用者帳" -"號可能會造成可觀的災害。一般使用者帳號不會因為失誤而法摧毀作業系統,所以建議" -"登入一般使用者帳號,只有在指令需要額外權限時切換為超級使用者。" - -#. (itstool) path: sect3/para -#: book.translate.xml:6010 -msgid "" -"Always double and triple-check any commands issued as the superuser, since " -"an extra space or missing character can mean irreparable data loss." -msgstr "" -"使用超級使用者下指令時永遠要再三檢查,由於一個多餘的空白或缺少的字元可能意味" -"著無法挽回的資料遺失。" - -#. (itstool) path: sect3/para -#: book.translate.xml:6014 -msgid "" -"There are several ways to gain superuser privilege. While one can log in as " -"root, this is highly discouraged." -msgstr "" -"有數種方法可以提升為超級使用者權限,雖然可以直接登入為 root,但強烈不建議這樣做。" - -#. (itstool) path: sect3/para -#: book.translate.xml:6019 -msgid "" -"Instead, use su1 to become the superuser. If - " -"is specified when running this command, the user will also inherit the root " -"user's environment. The user running this command must be in the wheel group or else the command will fail. " -"The user must also know the password for the root user account." -msgstr "" -"改使用 su1 切換為超級使用者。執行此指令時若指定 - 參數,該使用者會繼承 root 的使用者環境。執行此指令的使用者必須在 " -"wheel 群組中,否則指令會失敗。使" -"用者也必須要知道 root 使用者帳號" -"的密碼。" - -#. (itstool) path: sect3/para -#: book.translate.xml:6029 -msgid "" -"In this example, the user only becomes superuser in order to run " -"make install as this step requires superuser privilege. " -"Once the command completes, the user types exit to leave " -"the superuser account and return to the privilege of their user account." -msgstr "" -"在此例當中,該使用者只在要執行 make install 時切換為超級使" -"用者,因為這個步驟需要超級使用者權限。指令完成之後,該使用者輸入 " -"exit 離開超級使用者帳號並返回他的使用者帳號權限。" - -#. (itstool) path: example/title -#: book.translate.xml:6037 -msgid "Install a Program As the Superuser" -msgstr "以超級使用者的身份安裝程式" - -#. (itstool) path: example/screen -#: book.translate.xml:6039 -#, no-wrap -msgid "" -"% configure\n" -"% make\n" -"% su -\n" -"Password:\n" -"# make install\n" -"# exit\n" -"%" -msgstr "" - -#. (itstool) path: sect3/para -#: book.translate.xml:6048 -msgid "" -"The built-in su1 framework works well for single systems or small " -"networks with just one system administrator. An alternative is to install " -"the security/sudo package or port. This software provides " -"activity logging and allows the administrator to configure which users can " -"run which commands as the superuser." -msgstr "" -"內建的 su1 框架在單人系統或只有一位系統管理者的小型網路可以運" -"作的很好。另一種方式是安裝 security/sudo 套件或 Port。此軟" -"體提供了活動記錄且允許管理者設定那個使用者可以用超級使用者執行那個指令。" - -#. (itstool) path: sect2/title -#: book.translate.xml:6059 -msgid "Managing Accounts" -msgstr "管理帳號" - -#. (itstool) path: sect2/indexterm -#: book.translate.xml:6061 -msgid "accounts modifying" -msgstr "" - -#. (itstool) path: sect2/para -#: book.translate.xml:6066 -msgid "" -"FreeBSD provides a variety of different commands to manage user accounts. " -"The most common commands are summarized in , followed by some examples of their usage. See the manual page " -"for each utility for more details and usage examples." -msgstr "" -"FreeBSD 提供了各種不同指令來管理使用者帳號,最常用的指令已摘要於 ,接著有一些用法的範例。請參考每個工具" -"的操作手冊來取得更多詳細的資訊與用法範例。" - -#. (itstool) path: table/title -#: book.translate.xml:6073 -msgid "Utilities for Managing User Accounts" -msgstr "管理使用者帳號的工具" - -#. (itstool) path: row/entry -#: book.translate.xml:6081 book.translate.xml:57917 book.translate.xml:61955 -msgid "Command" -msgstr "指令" - -#. (itstool) path: row/entry -#. (itstool) path: sect2/title -#: book.translate.xml:6082 book.translate.xml:17042 book.translate.xml:17196 -msgid "Summary" -msgstr "摘要" - -#. (itstool) path: row/entry -#: book.translate.xml:6087 -msgid "" -"adduser8" -msgstr "" - -#. (itstool) path: row/entry -#: book.translate.xml:6088 -msgid "The recommended command-line application for adding new users." -msgstr "建議用來新增新使用者的指令列應用程式。" - -#. (itstool) path: row/entry -#: book.translate.xml:6093 -msgid "" -"rmuser8" -msgstr "" - -#. (itstool) path: row/entry -#: book.translate.xml:6094 -msgid "The recommended command-line application for removing users." -msgstr "建議用來移除使用者的指令列應用程式。" - -#. (itstool) path: row/entry -#: book.translate.xml:6099 -msgid "" -"chpass1" -msgstr "" - -#. (itstool) path: row/entry -#: book.translate.xml:6100 -msgid "A flexible tool for changing user database information." -msgstr "用來更改使用者資料庫資訊的工具。" - -#. (itstool) path: row/entry -#: book.translate.xml:6105 -msgid "" -"passwd1" -msgstr "" - -#. (itstool) path: row/entry -#: book.translate.xml:6106 -msgid "The command-line tool to change user passwords." -msgstr "用來更改使用者密碼的指令列工具。" - -#. (itstool) path: row/entry -#: book.translate.xml:6111 -msgid "" -"pw8" -msgstr "" - -#. (itstool) path: row/entry -#: book.translate.xml:6112 -msgid "" -"A powerful and flexible tool for modifying all aspects of user accounts." -msgstr "用來修改使用者帳號各方面資訊強大且靈活的工具。" - -#. (itstool) path: sect3/title -#: book.translate.xml:6120 -msgid "adduser" -msgstr "" - -#. (itstool) path: sect3/indexterm -#: book.translate.xml:6122 -msgid "accounts adding" -msgstr "" - -#. (itstool) path: sect3/indexterm -#. (itstool) path: sect4/indexterm -#: book.translate.xml:6126 book.translate.xml:43770 -msgid "adduser" -msgstr "" - -#. (itstool) path: sect3/indexterm -#: book.translate.xml:6129 -msgid "/usr/share/skel" -msgstr "" - -#. (itstool) path: sect3/indexterm -#: book.translate.xml:6132 -msgid "skeleton directory" -msgstr "" - -#. (itstool) path: sect3/para -#: book.translate.xml:6136 -msgid "" -"The recommended program for adding new users is " -"adduser8. When a new user is added, this program " -"automatically updates /etc/passwd and /etc/" -"group. It also creates a home directory for the new user, copies " -"in the default configuration files from /usr/share/skel, and can optionally mail the new user a welcome message. This " -"utility must be run as the superuser." -msgstr "" -"建議用來新增新使用者的程式為 adduser8。當新使用者新增之後,此" -"程式會自動更新 /etc/passwd 以及 /etc/group,這同時也會建立新使用者的家目錄 (複製 /usr/share/skel 中的預設設定檔),並且可以選擇是否要寄送歡迎訊息通知新使用者。這個工" -"具必須使用超級使用者執行。" - -#. (itstool) path: sect3/para -#: book.translate.xml:6146 -msgid "" -"The adduser8 utility is interactive and walks through the steps " -"for creating a new user account. As seen in , either input the required information or press Return to accept the default value shown in square brackets. In this " -"example, the user has been invited into the wheel group, allowing them to become the superuser with " -"su1. When finished, the utility will prompt to either create " -"another user or to exit." -msgstr "" -"adduser8 工具採用互動的方式,只需幾個步驟便可建立新使用者帳" -"號。如 所示,可輸入必填的資訊或" -"按 Return 鍵採用方括中的預設值。在此例當中,使用者被邀請加" -"入 wheel 群組,這讓使用者可使用 " -"su1 變成超級使用者。完成之後,此工具會詢問是否要建立其他的使用者或" -"離開。" - -#. (itstool) path: example/title -#: book.translate.xml:6158 -msgid "Adding a User on FreeBSD" -msgstr "在 FreeBSD 新增使用者" - -#. (itstool) path: example/screen -#: book.translate.xml:6160 -#, no-wrap -msgid "" -"# adduser\n" -"Username: jru\n" -"Full name: J. Random User\n" -"Uid (Leave empty for default):\n" -"Login group [jru]:\n" -"Login group is jru. Invite jru into other groups? []: wheel\n" -"Login class [default]:\n" -"Shell (sh csh tcsh zsh nologin) [sh]: zsh\n" -"Home directory [/home/jru]:\n" -"Home directory permissions (Leave empty for default):\n" -"Use password-based authentication? [yes]:\n" -"Use an empty password? (yes/no) [no]:\n" -"Use a random password? (yes/no) [no]:\n" -"Enter password:\n" -"Enter password again:\n" -"Lock out the account after creation? [no]:\n" -"Username : jru\n" -"Password : ****\n" -"Full Name : J. Random User\n" -"Uid : 1001\n" -"Class :\n" -"Groups : jru wheel\n" -"Home : /home/jru\n" -"Shell : /usr/local/bin/zsh\n" -"Locked : no\n" -"OK? (yes/no): yes\n" -"adduser: INFO: Successfully added (jru) to the user database.\n" -"Add another user? (yes/no): no\n" -"Goodbye!\n" -"#" -msgstr "" - -#. (itstool) path: note/para -#: book.translate.xml:6193 -msgid "" -"Since the password is not echoed when typed, be careful to not mistype the " -"password when creating the user account." -msgstr "由於密碼在輸入時並不會顯示,在建立使用者帳號時要小心密碼不要輸入錯誤。" - -#. (itstool) path: sect3/title -#: book.translate.xml:6200 -msgid "rmuser" -msgstr "" - -#. (itstool) path: sect3/indexterm -#: book.translate.xml:6202 -msgid "rmuser" -msgstr "" - -#. (itstool) path: sect3/indexterm -#: book.translate.xml:6205 -msgid "accounts removing" -msgstr "" - -#. (itstool) path: sect3/para -#: book.translate.xml:6210 -msgid "" -"To completely remove a user from the system, run " -"rmuser8 as the superuser. This command performs the following steps:" -msgstr "" -"要自系統完全移除一個使用者可使用超級使用者執行 " -"rmuser8。這個指令會執行以下步驟:" - -#. (itstool) path: step/para -#: book.translate.xml:6216 -msgid "" -"Removes the user's crontab1 entry, if one exists." -msgstr "" -"移除使用者的 crontab1 項目,若項目存在。" - -#. (itstool) path: step/para -#: book.translate.xml:6221 -msgid "" -"Removes any at1 jobs belonging to the user." -msgstr "" -"移除任何屬於該使用者的 at1 工作。" - -#. (itstool) path: step/para -#: book.translate.xml:6226 -msgid "Kills all processes owned by the user." -msgstr "中止所有該使用者擁有的程序。" - -#. (itstool) path: step/para -#: book.translate.xml:6230 -msgid "Removes the user from the system's local password file." -msgstr "自系統本地密碼檔移除該使用者。" - -#. (itstool) path: step/para -#: book.translate.xml:6235 -msgid "" -"Optionally removes the user's home directory, if it is owned by the user." -msgstr "選擇性移除該使用者的家目錄,若使用者擁有該目錄。" - -#. (itstool) path: step/para -#: book.translate.xml:6240 -msgid "" -"Removes the incoming mail files belonging to the user from /var/" -"mail." -msgstr "自 /var/mail 移除屬於該使用者的收件郵件檔。" - -#. (itstool) path: step/para -#: book.translate.xml:6245 -msgid "" -"Removes all files owned by the user from temporary file storage areas such " -"as /tmp." -msgstr "" -"自暫存檔儲存區域 (如 /tmp) 移除所有使用者擁有的檔案。" - -#. (itstool) path: step/para -#: book.translate.xml:6251 -msgid "" -"Finally, removes the username from all groups to which it belongs in " -"/etc/group. If a group becomes empty and the group name " -"is the same as the username, the group is removed. This complements the per-" -"user unique groups created by adduser8." -msgstr "" -"最後,自 /etc/group 中該使用者所屬的所有群組移除該使用" -"者。若群組無任何成員且群組名稱與該使用者名稱相同,則該群組也會一併移除。這是" -"為了輔助 adduser8 替每位使用者建立獨一無二的群組。" - -#. (itstool) path: sect3/para -#: book.translate.xml:6260 -msgid "" -"rmuser8 cannot be used to remove superuser accounts since that is " -"almost always an indication of massive destruction." -msgstr "" -"rmuser8 無法用來移除超級使用者帳號,因為這幾乎代表著大規模破壞。" - -#. (itstool) path: sect3/para -#: book.translate.xml:6264 -msgid "" -"By default, an interactive mode is used, as shown in the following example." -msgstr "預設會使用互動式模式,如下範例所示。" - -#. (itstool) path: example/title -#: book.translate.xml:6268 -msgid "rmuser Interactive Account Removal" -msgstr "rmuser 互動式帳號移除" - -#. (itstool) path: example/screen -#: book.translate.xml:6271 -#, no-wrap -msgid "" -"# rmuser jru\n" -"Matching password entry:\n" -"jru:*:1001:1001::0:0:J. Random User:/home/jru:/usr/local/bin/zsh\n" -"Is this the entry you wish to remove? y\n" -"Remove user's home directory (/home/jru)? y\n" -"Removing user (jru): mailspool home passwd.\n" -"#" -msgstr "" - -#. (itstool) path: sect3/title -#: book.translate.xml:6282 -msgid "chpass" -msgstr "" - -#. (itstool) path: sect3/indexterm -#: book.translate.xml:6284 -msgid "chpass" -msgstr "" - -#. (itstool) path: sect3/para -#: book.translate.xml:6288 -msgid "" -"Any user can use chpass1 to change their " -"default shell and personal information associated with their user account. " -"The superuser can use this utility to change additional account information " -"for any user." -msgstr "" -"任何使用者都可以使用 chpass1 來變更自己的預設 Shell " -"以及與自己的使用者帳號關聯的個人資訊。超級使用者可以使用這個工具更改任何使用" -"者的其他帳號資訊。" - -#. (itstool) path: sect3/para -#: book.translate.xml:6293 -msgid "" -"When passed no options, aside from an optional username, " -"chpass1 displays an editor containing user information. When the user " -"exits from the editor, the user database is updated with the new information." -msgstr "" -"除了選填的使用者名稱外,未傳入任何選項時," -"chpass1 會開啟含有使用者資訊的編輯器。當使用者自編輯器離開,便會更新新" -"的資訊到使用者資料庫。" - -#. (itstool) path: note/para -#: book.translate.xml:6299 -msgid "" -"This utility will prompt for the user's password when exiting the editor, " -"unless the utility is run as the superuser." -msgstr "" -"離開編輯器時,此工具會提示使用者輸入密碼,除非使用超級使用者執行此工具。" - -#. (itstool) path: sect3/para -#: book.translate.xml:6304 -msgid "" -"In , the superuser has typed " -"chpass jru and is now viewing the fields that can be " -"changed for this user. If jru " -"runs this command instead, only the last six fields will be displayed and " -"available for editing. This is shown in ." -msgstr "" -"在 中,超級使用者輸入了 " -"chpass jru 並正在檢視這個使用者可以更改的欄位。若改以 " -"jru 執行這個指令,只會顯示最後六" -"個欄位供編輯,如 所示。" - -#. (itstool) path: example/title -#: book.translate.xml:6313 -msgid "Using chpass as Superuser" -msgstr "以超級使用者的身份使用 chpass" - -#. (itstool) path: example/screen -#: book.translate.xml:6316 -#, no-wrap -msgid "" -"#Changing user database information for jru.\n" -"Login: jru\n" -"Password: *\n" -"Uid [#]: 1001\n" -"Gid [# or name]: 1001\n" -"Change [month day year]:\n" -"Expire [month day year]:\n" -"Class:\n" -"Home directory: /home/jru\n" -"Shell: /usr/local/bin/zsh\n" -"Full Name: J. Random User\n" -"Office Location:\n" -"Office Phone:\n" -"Home Phone:\n" -"Other information:" -msgstr "" - -#. (itstool) path: example/title -#: book.translate.xml:6334 -msgid "Using chpass as Regular User" -msgstr "以一般使用者的身份使用 chpass" - -#. (itstool) path: example/screen -#: book.translate.xml:6337 -#, no-wrap -msgid "" -"#Changing user database information for jru.\n" -"Shell: /usr/local/bin/zsh\n" -"Full Name: J. Random User\n" -"Office Location:\n" -"Office Phone:\n" -"Home Phone:\n" -"Other information:" -msgstr "" - -#. (itstool) path: note/para -#: book.translate.xml:6347 -msgid "" -"The commands chfn1 and chsh1 are links to " -"chpass1, as are ypchpass1, " -"ypchfn1, and ypchsh1. Since NIS support is automatic, specifying the yp before " -"the command is not necessary. How to configure NIS is covered in ." -msgstr "" -"指令 chfn1 以及 chsh1 皆連結至 " -"chpass1,就如同 ypchpass1, " -"ypchfn1 以及 ypchsh1 的關係。自從 NIS 支援自" -"動化以後,便不再需要特別加上 yp,如何設定 NIS 在 中有說明。" - -#. (itstool) path: sect3/title -#: book.translate.xml:6357 -msgid "passwd" -msgstr "" - -#. (itstool) path: sect3/indexterm -#: book.translate.xml:6359 -msgid "passwd" -msgstr "" - -#. (itstool) path: sect3/indexterm -#: book.translate.xml:6362 -msgid "accounts changing password" -msgstr "" - -#. (itstool) path: sect3/para -#: book.translate.xml:6367 -msgid "" -"Any user can easily change their password using " -"passwd1. To prevent accidental or unauthorized changes, this command " -"will prompt for the user's original password before a new password can be " -"set:" -msgstr "" -"任何使用者皆可簡單的使用 passwd1 更改自己的密碼。要避免" -"意外或未授權的變更,這個指令在設定新密碼之前會提示使用者輸入原來的密碼:" - -#. (itstool) path: example/title -#: book.translate.xml:6373 -msgid "Changing Your Password" -msgstr "更改您的密碼" - -#. (itstool) path: example/screen -#: book.translate.xml:6375 -#, no-wrap -msgid "" -"% passwd\n" -"Changing local password for jru.\n" -"Old password:\n" -"New password:\n" -"Retype new password:\n" -"passwd: updating the database...\n" -"passwd: done" -msgstr "" - -#. (itstool) path: sect3/para -#: book.translate.xml:6384 -msgid "" -"The superuser can change any user's password by specifying the username when " -"running passwd1. When this utility is run as the superuser, it " -"will not prompt for the user's current password. This allows the password to " -"be changed when a user cannot remember the original password." -msgstr "" -"超級使用者可以更改任何使用者的密碼透過在執行 " -"passwd1 時指定使用者名稱。當此工具以超級使用者執行時,將不會提示輸入使" -"用者目前的密碼,這可在使用者忘記原來的密碼時更改密碼。" - -#. (itstool) path: example/title -#: book.translate.xml:6392 -msgid "Changing Another User's Password as the Superuser" -msgstr "以超級使用者的身份更改其他使用者的密碼" - -#. (itstool) path: example/screen -#: book.translate.xml:6395 -#, no-wrap -msgid "" -"# passwd jru\n" -"Changing local password for jru.\n" -"New password:\n" -"Retype new password:\n" -"passwd: updating the database...\n" -"passwd: done" -msgstr "" - -#. (itstool) path: note/para -#: book.translate.xml:6404 -msgid "" -"As with chpass1, yppasswd1 is a link to " -"passwd1, so NIS works with either command." -msgstr "" -"如同 chpass1yppasswd1 連結到 " -"passwd1,因此 NIS 在兩個指令上皆可運作。" - -#. (itstool) path: sect3/title -#: book.translate.xml:6411 -msgid "pw" -msgstr "" - -#. (itstool) path: sect3/indexterm -#. (itstool) path: sect4/indexterm -#: book.translate.xml:6413 book.translate.xml:43793 -msgid "pw" -msgstr "" - -#. (itstool) path: sect3/para -#: book.translate.xml:6417 -msgid "" -"The pw8 utility can create, remove, modify, and display users and " -"groups. It functions as a front end to the system user and group files. " -"pw8 has a very powerful set of command line options that make it " -"suitable for use in shell scripts, but new users may find it more " -"complicated than the other commands presented in this section." -msgstr "" -"pw8 工具可以建立、移除、修改以及顯示使用者與群組,它的功能是做為系" -"統使用者與群組檔的前端。pw8 有非常強大的的指令列選" -"項集,這讓該指令非常適合用於 Shell scripts,但新的使用者可能會發現它比其他在" -"本節的指令要複雜許多。" - -#. (itstool) path: sect2/title -#: book.translate.xml:6428 -msgid "Managing Groups" -msgstr "管理群組" - -#. (itstool) path: sect2/indexterm -#: book.translate.xml:6430 -msgid "groups" -msgstr "" - -#. (itstool) path: sect2/indexterm -#: book.translate.xml:6433 -msgid "/etc/groups" -msgstr "" - -#. (itstool) path: sect2/indexterm -#: book.translate.xml:6436 -msgid "accounts groups" -msgstr "" - -#. (itstool) path: sect2/para -#: book.translate.xml:6441 -msgid "" -"A group is a list of users. A group is identified by its group name and " -"GID. In FreeBSD, the kernel uses the UID of a process, and the list of groups it belongs to, to determine " -"what the process is allowed to do. Most of the time, the GID of a user or process usually means the first group in the list." -msgstr "" -"群組代表一群使用者,群組可以由其群組名稱及 GID 來辨識。在 " -"FreeBSD,核心會使用程序的 UID 以及其所屬的群組清單來決定程" -"序可以做那些事。大多數情況使用者或程序的 GID 通常指的是清" -"單中的第一個群組。" - -#. (itstool) path: sect2/para -#: book.translate.xml:6448 -msgid "" -"The group name to GID mapping is listed in /etc/" -"group. This is a plain text file with four colon-delimited " -"fields. The first field is the group name, the second is the encrypted " -"password, the third the GID, and the fourth the comma-" -"delimited list of members. For a more complete description of the syntax, " -"refer to group5." -msgstr "" -"群組名稱與 GID 的對應表列在 /etc/group。這個純文字檔案使用了四個以冒號分隔的欄位,第一個欄位為群組名稱,第" -"二個欄位為加密後的密碼,第二個欄位為 GID 以及第四個欄位為" -"以逗號分隔的成員清單。要取得更完整的語法說明,請參考 " -"group5。" - -#. (itstool) path: sect2/para -#: book.translate.xml:6456 -msgid "" -"The superuser can modify /etc/group using a text " -"editor. Alternatively, pw8 can be used to add and " -"edit groups. For example, to add a group called teamtwo and then confirm that it exists:" -msgstr "" -"超級使用者可以使用文字編輯器修改 /etc/group,或者可使用 " -"pw8 加入與編輯群組。例如,要加入一個叫做 teamtwo 的群組然後確認該群組已新增:" - -#. (itstool) path: example/title -#: book.translate.xml:6463 -msgid "" -"Adding a Group Using pw8" -msgstr "" -"使用 pw8 新增群組" - -#. (itstool) path: example/screen -#: book.translate.xml:6465 -#, no-wrap -msgid "" -"# pw groupadd teamtwo\n" -"# pw groupshow teamtwo\n" -"teamtwo:*:1100:" -msgstr "" - -#. (itstool) path: sect2/para -#: book.translate.xml:6470 -msgid "" -"In this example, 1100 is the GID of " -"teamtwo. Right now, teamtwo has no members. This command will " -"add jru as a member of " -"teamtwo." -msgstr "" -"在本例中,1100teamtwoGID。目前 teamtwo 沒有任何成員,這個指令會加入 jru 作為 teamtwo 的成員。" - -#. (itstool) path: example/title -#: book.translate.xml:6479 -msgid "" -"Adding User Accounts to a New Group Using pw8" -msgstr "" -"使用 pw8 加入使用者帳號到新的群組" - -#. (itstool) path: example/screen -#: book.translate.xml:6482 -#, no-wrap -msgid "" -"# pw groupmod teamtwo -M jru\n" -"# pw groupshow teamtwo\n" -"teamtwo:*:1100:jru" -msgstr "" - -#. (itstool) path: sect2/para -#: book.translate.xml:6487 -msgid "" -"The argument to is a comma-delimited list of users to be " -"added to a new (empty) group or to replace the members of an existing group. " -"To the user, this group membership is different from (and in addition to) " -"the user's primary group listed in the password file. This means that the " -"user will not show up as a member when using with " -"pw8, but will show up when the information is queried via " -"id1 or a similar tool. When pw8 is used to add a user " -"to a group, it only manipulates /etc/group and does not " -"attempt to read additional data from /etc/passwd." -msgstr "" -"給 的參數是以逗號分隔的使用者清單,用來加入成員到新的 (空" -"的) 群組或取代既有群組中的成員。對使用者來說這裡的群組成員與使用者列於密碼檔" -"的主要群組不同 (額外的),這代表在 pw8 使用 " -" 時不會顯示做為使用者主要群組的成員,但會顯示在使" -"用 id1 或同類工具所查詢的資訊當中。當使用 " -"pw8 來加入使用者到某個群組,該指令只會處理 /etc/group 且不會嘗試自 /etc/passwd 讀取其他的資料。" - -#. (itstool) path: example/title -#: book.translate.xml:6501 -msgid "" -"Adding a New Member to a Group Using pw8" -msgstr "" -"使用 pw8 加入新成員到群組" - -#. (itstool) path: example/screen -#: book.translate.xml:6503 -#, no-wrap -msgid "" -"# pw groupmod teamtwo -m db\n" -"# pw groupshow teamtwo\n" -"teamtwo:*:1100:jru,db" -msgstr "" - -#. (itstool) path: sect2/para -#: book.translate.xml:6508 -msgid "" -"In this example, the argument to is a comma-delimited " -"list of users who are to be added to the group. Unlike the previous example, " -"these users are appended to the group and do not replace existing users in " -"the group." -msgstr "" -"在本例當中,給 的參數是以逗號分隔的使用者清單,用來加入使" -"用者到群組。不像前面的例子,這些使用者會加入到群組,而非取代既有群組中的使用" -"者。" - -#. (itstool) path: example/title -#: book.translate.xml:6515 -msgid "" -"Using id1 to Determine Group Membership" -msgstr "" -"使用 id1 來查看所屬群組" - -#. (itstool) path: example/screen -#: book.translate.xml:6517 -#, no-wrap -msgid "" -"% id jru\n" -"uid=1001(jru) gid=1001(jru) groups=1001(jru), 1100(teamtwo)" -msgstr "" - -#. (itstool) path: sect2/para -#: book.translate.xml:6521 -msgid "" -"In this example, jru is a member " -"of the groups jru and " -"teamtwo." -msgstr "" -"在本例中,jru 是群組 jru 以及 teamtwo 的成員。" - -#. (itstool) path: sect2/para -#: book.translate.xml:6526 -msgid "" -"For more information about this command and the format of /etc/" -"group, refer to pw8 and " -"group5." -msgstr "" -"要取得更多有關此指令的資訊及 /etc/group 的格式,請參考 " -"pw8 以及 group5。" - -#. (itstool) path: sect1/title -#: book.translate.xml:6533 -msgid "Permissions" -msgstr "權限" - -#. (itstool) path: sect1/indexterm -#: book.translate.xml:6535 -msgid "UNIX" -msgstr "" - -#. (itstool) path: sect1/para -#: book.translate.xml:6539 -msgid "" -"In FreeBSD, every file and directory has an associated set of permissions " -"and several utilities are available for viewing and modifying these " -"permissions. Understanding how permissions work is necessary to make sure " -"that users are able to access the files that they need and are unable to " -"improperly access the files used by the operating system or owned by other " -"users." -msgstr "" -"在 FreeBSD 中,每個檔案與目都有相關聯的數個權限,且有許多工具可以檢視與修改這" -"些權限。了解權限如何運作是必須的,這可確保使用者能夠存存取它們所需的檔案以及" -"無法不正確的存取供作業系統或其他使用者擁有的檔案。" - -#. (itstool) path: sect1/para -#: book.translate.xml:6547 -msgid "" -"This section discusses the traditional UNIX permissions used in FreeBSD. For finer grained file system access " -"control, refer to ." -msgstr "" -"本節會探討在 FreeBSD 中所用到的傳統 UNIX 權限。要做檔案系統存取控制的微調,請參考 。" - -#. (itstool) path: sect1/para -#: book.translate.xml:6551 -msgid "" -"In UNIX, basic permissions are " -"assigned using three types of access: read, write, and execute. These access " -"types are used to determine file access to the file's owner, group, and " -"others (everyone else). The read, write, and execute permissions can be " -"represented as the letters r, w, and " -"x. They can also be represented as binary numbers as each " -"permission is either on or off (0). When represented as a " -"number, the order is always read as rwx, where " -"r has an on value of 4, w has an on value of 2 and x " -"has an on value of 1." -msgstr "" -"在 UNIX,基礎權限透過三種類型的存" -"取來分配:讀取、寫入與執行。這些存取類型用來決定檔案擁有者、群組以及其他人 " -"(其他任何人) 的檔案存取權。讀取、寫入及執行權限可使用 r, " -"w, and x 字母來表示。這些權限也可以使用" -"二進位數字來表示每種權限的開或關 (0)。當以二進位數字來表示" -"時,閱讀的順序為 rwx,其中 r 開啟的值" -"為 4w 開啟的值為 2 以及 x 開啟的值為 1。" - -#. (itstool) path: sect1/para -#: book.translate.xml:6566 -msgid "" -"Table 4.1 summarizes the possible numeric and alphabetic possibilities. When " -"reading the Directory Listing column, a - " -"is used to represent a permission that is set to off." -msgstr "" -"表格 4.1 摘要了可用的數字及可用的字母。當閱讀 目錄清單標示 欄" -"位時,- 用來代表該權限設為關閉。" - -#. (itstool) path: sect1/indexterm -#: book.translate.xml:6571 -msgid "permissions" -msgstr "" - -#. (itstool) path: sect1/indexterm -#: book.translate.xml:6574 -msgid "file permissions" -msgstr "" - -#. (itstool) path: table/title -#: book.translate.xml:6579 -msgid "UNIX Permissions" -msgstr "UNIX 權限" - -#. (itstool) path: row/entry -#: book.translate.xml:6584 -msgid "Value" -msgstr "數值" - -#. (itstool) path: row/entry -#: book.translate.xml:6585 -msgid "Permission" -msgstr "權限" - -#. (itstool) path: row/entry -#: book.translate.xml:6586 -msgid "Directory Listing" -msgstr "目錄清單標示" - -#. (itstool) path: row/entry -#: book.translate.xml:6592 -msgid "0" -msgstr "" - -#. (itstool) path: row/entry -#: book.translate.xml:6593 -msgid "No read, no write, no execute" -msgstr "不可讀取, 不可寫入, 不可執行" - -#. (itstool) path: row/entry -#: book.translate.xml:6594 -msgid "---" -msgstr "" - -#. (itstool) path: row/entry -#: book.translate.xml:6598 book.translate.xml:47272 book.translate.xml:47294 -#: book.translate.xml:47384 -msgid "1" -msgstr "" - -#. (itstool) path: row/entry -#: book.translate.xml:6599 -msgid "No read, no write, execute" -msgstr "不可讀取, 不可寫入, 可執行" - -#. (itstool) path: row/entry -#: book.translate.xml:6600 -msgid "--x" -msgstr "" - -#. (itstool) path: row/entry -#: book.translate.xml:6604 book.translate.xml:47164 book.translate.xml:47174 -#: book.translate.xml:47246 book.translate.xml:47256 book.translate.xml:47336 -#: book.translate.xml:47338 -msgid "2" -msgstr "" - -#. (itstool) path: row/entry -#: book.translate.xml:6605 -msgid "No read, write, no execute" -msgstr "不可讀取, 可寫入, 不可執行" - -#. (itstool) path: row/entry -#: book.translate.xml:6606 -msgid "-w-" -msgstr "" - -#. (itstool) path: row/entry -#: book.translate.xml:6610 book.translate.xml:47166 book.translate.xml:47172 -#: book.translate.xml:47248 book.translate.xml:47254 book.translate.xml:47344 -#: book.translate.xml:47346 -msgid "3" -msgstr "" - -#. (itstool) path: row/entry -#: book.translate.xml:6611 -msgid "No read, write, execute" -msgstr "不可讀取, 可寫入, 可執行" - -#. (itstool) path: row/entry -#: book.translate.xml:6612 -msgid "-wx" -msgstr "" - -#. (itstool) path: row/entry -#: book.translate.xml:6616 book.translate.xml:47180 book.translate.xml:47190 -#: book.translate.xml:47262 book.translate.xml:47270 book.translate.xml:47288 -#: book.translate.xml:47296 book.translate.xml:47352 book.translate.xml:47360 -#: book.translate.xml:47402 -msgid "4" -msgstr "" - -#. (itstool) path: row/entry -#: book.translate.xml:6617 -msgid "Read, no write, no execute" -msgstr "可讀取, 不可寫入, 不可執行" - -#. (itstool) path: row/entry -#: book.translate.xml:6618 -msgid "r--" -msgstr "" - -#. (itstool) path: row/entry -#: book.translate.xml:6622 book.translate.xml:47182 book.translate.xml:47188 -#: book.translate.xml:47278 book.translate.xml:47280 book.translate.xml:47368 -#: book.translate.xml:47394 -msgid "5" -msgstr "" - -#. (itstool) path: row/entry -#: book.translate.xml:6623 -msgid "Read, no write, execute" -msgstr "可讀取, 不可寫入, 可執行" - -#. (itstool) path: row/entry -#: book.translate.xml:6624 -msgid "r-x" -msgstr "" - -#. (itstool) path: row/entry -#: book.translate.xml:6628 book.translate.xml:47198 book.translate.xml:47212 -#: book.translate.xml:47264 book.translate.xml:47286 book.translate.xml:47354 -#: book.translate.xml:47376 -msgid "6" -msgstr "" - -#. (itstool) path: row/entry -#: book.translate.xml:6629 -msgid "Read, write, no execute" -msgstr "可讀取, 可寫入, 不可執行" - -#. (itstool) path: row/entry -#: book.translate.xml:6630 -msgid "rw-" -msgstr "" - -#. (itstool) path: row/entry -#: book.translate.xml:6634 book.translate.xml:47156 book.translate.xml:47158 -#: book.translate.xml:47302 book.translate.xml:47312 book.translate.xml:47370 -#: book.translate.xml:47392 -msgid "7" -msgstr "" - -#. (itstool) path: row/entry -#: book.translate.xml:6635 -msgid "Read, write, execute" -msgstr "可讀取, 可寫入, 可執行" - -#. (itstool) path: row/entry -#: book.translate.xml:6636 -msgid "rwx" -msgstr "" - -#. (itstool) path: sect1/indexterm -#: book.translate.xml:6642 -msgid "" -"ls1" -msgstr "" - -#. (itstool) path: sect1/indexterm -#: book.translate.xml:6645 -msgid "directories" -msgstr "" - -#. (itstool) path: sect1/para -#: book.translate.xml:6649 -msgid "" -"Use the argument to ls1 to view a long " -"directory listing that includes a column of information about a file's " -"permissions for the owner, group, and everyone else. For example, a " -"ls -l in an arbitrary directory may show:" -msgstr "" -"使用 ls1 指令時,可以加上 參數, 來檢視" -"詳細的目錄清單。 清單中欄位的資訊包含檔案對所有者、群組及其他人的權限。 在任" -"一個目錄底下執行 ls -l,會顯示如下的結果:" - -#. (itstool) path: sect1/screen -#: book.translate.xml:6655 -#, no-wrap -msgid "" -"% ls -l\n" -"total 530\n" -"-rw-r--r-- 1 root wheel 512 Sep 5 12:31 myfile\n" -"-rw-r--r-- 1 root wheel 512 Sep 5 12:31 otherfile\n" -"-rw-r--r-- 1 root wheel 7680 Sep 5 12:31 email.txt" -msgstr "" - -#. (itstool) path: sect1/para -#: book.translate.xml:6661 -msgid "" -"The first (leftmost) character in the first column indicates whether this " -"file is a regular file, a directory, a special character device, a socket, " -"or any other special pseudo-file device. In this example, the - indicates a regular file. The next three characters, rw- in this example, give the permissions for the owner of the file. " -"The next three characters, r--, give the permissions for " -"the group that the file belongs to. The final three characters, r--" -", give the permissions for the rest of the world. A dash means " -"that the permission is turned off. In this example, the permissions are set " -"so the owner can read and write to the file, the group can read the file, " -"and the rest of the world can only read the file. According to the table " -"above, the permissions for this file would be 644, where " -"each digit represents the three parts of the file's permission." -msgstr "" -"第一個 (最左邊) 的字元用來表示這個檔案的類型為何,除標準檔案以外,尚有目錄、" -"特殊字元裝置、Socket 及其他特殊虛擬檔案裝置, 在此例當中,- 表示該檔案為一個標準的檔案。 範例中接下來的三個字元中,rw-" -" 代表所有者對檔案擁有的權限。 再接下來的三個字元, r-- 則代表群組對檔案擁有的權限, 最後三個字元,r-- 則" -"代表其他人對檔案擁有的權限。 破折號 (-) 表示沒有權限,範例中的這個檔案的權" -"限, 只允許所有者讀取、寫入檔案,群組以及其他人僅能讀取檔案。 根據以上的表" -"格,此種權限的檔案可以使用 644 來表示, 每組數字分別代表檔" -"案的三種權限。" - -#. (itstool) path: sect1/para -#: book.translate.xml:6678 -msgid "" -"How does the system control permissions on devices? FreeBSD treats most " -"hardware devices as a file that programs can open, read, and write data to. " -"These special device files are stored in /dev/." -msgstr "" -"那系統如何控制裝置的權限? 實際上 FreeBSD 對大多的硬碟裝置就如同檔案,程式可" -"以開啟、讀取以及寫入資料如一般檔案。 這些特殊裝置檔案都儲存於 /dev/" -" 目錄中。" - -#. (itstool) path: sect1/para -#: book.translate.xml:6683 -msgid "" -"Directories are also treated as files. They have read, write, and execute " -"permissions. The executable bit for a directory has a slightly different " -"meaning than that of files. When a directory is marked executable, it means " -"it is possible to change into that directory using " -"cd1. This also means that it is possible to access the files " -"within that directory, subject to the permissions on the files themselves." -msgstr "" -"目錄也同如檔案,擁有讀取、寫入及執行的權限, 但在執行權限上與檔案有明顯的差" -"異。 當目錄被標示為可執行時,代表可以使用 cd1 指令切換進入該目錄。 也" -"代表能夠存取在此目錄之中的已知檔名的檔案,但仍會受限於檔案本身所設定的權限。" - -#. (itstool) path: sect1/para -#: book.translate.xml:6692 -msgid "" -"In order to perform a directory listing, the read permission must be set on " -"the directory. In order to delete a file that one knows the name of, it is " -"necessary to have write and execute permissions to the " -"directory containing the file." -msgstr "" -"要能夠列出目錄內容,必須擁有目錄的讀取權限。 要刪除已知檔名的檔案,必須擁有檔" -"案所在目錄的寫入 以及 執行的權限。" - -#. (itstool) path: sect1/para -#: book.translate.xml:6698 -msgid "" -"There are more permission bits, but they are primarily used in special " -"circumstances such as setuid binaries and sticky directories. For more " -"information on file permissions and how to set them, refer to " -"chmod1." -msgstr "" -"還有一些權限位元,但這些權限主要在特殊情況使用,如 setuid 執行檔及 sticky 目" -"錄。 如果您還想知道更多檔案權限的資訊及使用方法,請務必參閱 " -"chmod1。" - -#. (itstool) path: info/title -#: book.translate.xml:6705 -msgid "Symbolic Permissions" -msgstr "權限符號" - -#. (itstool) path: authorgroup/author -#: book.translate.xml:6708 book.translate.xml:6843 book.translate.xml:6894 -#: book.translate.xml:19322 book.translate.xml:19429 book.translate.xml:19607 -#: book.translate.xml:20726 book.translate.xml:21245 book.translate.xml:23491 -#: book.translate.xml:33936 book.translate.xml:65535 -msgid "" -" Tom Rhodes Contributed by " -msgstr "" - -#. (itstool) path: sect2/indexterm -#: book.translate.xml:6718 -msgid "permissions symbolic" -msgstr "" - -#. (itstool) path: sect2/para -#: book.translate.xml:6723 -msgid "" -"Symbolic permissions use characters instead of octal values to assign " -"permissions to files or directories. Symbolic permissions use the syntax of " -"(who) (action) (permissions), where the following values are available:" -msgstr "" -"權限符號可稱做符號表示,使用字元的方式來取代使用數值來設定檔案或目錄的權限。 " -"符號表示的格式依序為 (某人)(動作)(權限),可使用的符號如下:" - -#. (itstool) path: row/entry -#: book.translate.xml:6733 book.translate.xml:23220 -msgid "Option" -msgstr "項目" - -#. (itstool) path: row/entry -#: book.translate.xml:6734 -msgid "Letter" -msgstr "字母" - -#. (itstool) path: row/entry -#: book.translate.xml:6735 -msgid "Represents" -msgstr "代表意義" - -#. (itstool) path: row/entry -#: book.translate.xml:6741 book.translate.xml:6747 book.translate.xml:6753 -#: book.translate.xml:6759 -msgid "(who)" -msgstr "(某人)" - -#. (itstool) path: row/entry -#: book.translate.xml:6742 -msgid "u" -msgstr "" - -#. (itstool) path: row/entry -#: book.translate.xml:6743 -msgid "User" -msgstr "使用者" - -#. (itstool) path: row/entry -#: book.translate.xml:6748 -msgid "g" -msgstr "" - -#. (itstool) path: row/entry -#: book.translate.xml:6749 -msgid "Group owner" -msgstr "群組所有者" - -#. (itstool) path: row/entry -#: book.translate.xml:6754 -msgid "o" -msgstr "" - -#. (itstool) path: row/entry -#: book.translate.xml:6755 -msgid "Other" -msgstr "其他" - -#. (itstool) path: row/entry -#: book.translate.xml:6760 -msgid "a" -msgstr "" - -#. (itstool) path: row/entry -#: book.translate.xml:6761 -msgid "All (world)" -msgstr "全部 (world)" - -#. (itstool) path: row/entry -#: book.translate.xml:6765 book.translate.xml:6771 book.translate.xml:6777 -msgid "(action)" -msgstr "(動作)" - -#. (itstool) path: row/entry -#: book.translate.xml:6766 book.translate.xml:31487 book.translate.xml:39276 -msgid "+" -msgstr "" - -#. (itstool) path: row/entry -#: book.translate.xml:6767 -msgid "Adding permissions" -msgstr "增加權限" - -#. (itstool) path: row/entry -#: book.translate.xml:6772 book.translate.xml:31492 book.translate.xml:39281 -msgid "-" -msgstr "" - -#. (itstool) path: row/entry -#: book.translate.xml:6773 -msgid "Removing permissions" -msgstr "移除權限" - -#. (itstool) path: row/entry -#: book.translate.xml:6778 -msgid "=" -msgstr "" - -#. (itstool) path: row/entry -#: book.translate.xml:6779 -msgid "Explicitly set permissions" -msgstr "指定權限" - -#. (itstool) path: row/entry -#: book.translate.xml:6783 book.translate.xml:6789 book.translate.xml:6795 -#: book.translate.xml:6801 book.translate.xml:6807 -msgid "(permissions)" -msgstr "(權限)" - -#. (itstool) path: row/entry -#: book.translate.xml:6784 -msgid "r" -msgstr "" - -#. (itstool) path: row/entry -#: book.translate.xml:6785 -msgid "Read" -msgstr "讀取" - -#. (itstool) path: row/entry -#: book.translate.xml:6790 -msgid "w" -msgstr "" - -#. (itstool) path: row/entry -#: book.translate.xml:6791 -msgid "Write" -msgstr "寫入" - -#. (itstool) path: row/entry -#: book.translate.xml:6796 -msgid "x" -msgstr "" - -#. (itstool) path: row/entry -#: book.translate.xml:6797 -msgid "Execute" -msgstr "執行" - -#. (itstool) path: row/entry -#: book.translate.xml:6802 -msgid "t" -msgstr "" - -#. (itstool) path: row/entry -#: book.translate.xml:6803 -msgid "Sticky bit" -msgstr "Sticky 位元" - -#. (itstool) path: row/entry -#: book.translate.xml:6808 -msgid "s" -msgstr "" - -#. (itstool) path: row/entry -#: book.translate.xml:6809 -msgid "Set UID or GID" -msgstr "設定 UID 或 GID" - -#. (itstool) path: sect2/para -#: book.translate.xml:6815 -msgid "" -"These values are used with chmod1, but with letters " -"instead of numbers. For example, the following command would block other " -"users from accessing FILE:" -msgstr "" -"如先前同樣使用 chmod1 指令來設定,但使用的參" -"數為這些字元。 例如,您可以使用下列指令禁止其他使用者存取檔案 " -"FILE:" - -#. (itstool) path: sect2/screen -#: book.translate.xml:6820 -#, no-wrap -msgid "% chmod go= FILE" -msgstr "" - -#. (itstool) path: sect2/para -#: book.translate.xml:6822 -msgid "" -"A comma separated list can be provided when more than one set of changes to " -"a file must be made. For example, the following command removes the group " -"and world write permission on FILE, and adds the execute permissions for everyone:" -msgstr "" -"若有兩個以上的權限更改可以使用逗號 (,) 區隔。 例如,下列指令將會移除群組及全" -"部人 (world) 對檔案 FILE 的寫入權" -"限, 並使全部人對該檔有執行權限:" - -#. (itstool) path: sect2/screen -#: book.translate.xml:6829 -#, no-wrap -msgid "% chmod go-w,a+x FILE" -msgstr "" - -#. (itstool) path: info/title -#: book.translate.xml:6840 -msgid "FreeBSD File Flags" -msgstr "FreeBSD 檔案旗標" - -#. (itstool) path: sect2/para -#: book.translate.xml:6853 -msgid "" -"In addition to file permissions, FreeBSD supports the use of file " -"flags. These flags add an additional level of security and control " -"over files, but not directories. With file flags, even root can be prevented from removing or altering " -"files." -msgstr "" -"除了前面提到的檔案權限外,FreeBSD 支援使用 檔案旗標。 這些旗標" -"增加了檔案的安全性及管理性,但不包含目錄。有了檔案旗標可確保在某些時候 " -"root 不會意外將檔案修改或移除。" - -#. (itstool) path: sect2/para -#: book.translate.xml:6860 -msgid "" -"File flags are modified using chflags1. For example, to " -"enable the system undeletable flag on the file file1, " -"issue the following command:" -msgstr "" -"修改的檔案 flag 僅需要使用擁有簡易的介面的 " -"chflags1 工具。 例如,標示系統禁止刪除的旗標於檔案 " -"file1,使用下列指令:" - -#. (itstool) path: sect2/screen -#: book.translate.xml:6865 -#, no-wrap -msgid "# chflags sunlink file1" -msgstr "" - -#. (itstool) path: sect2/para -#: book.translate.xml:6867 -msgid "" -"To disable the system undeletable flag, put a no in front of " -"the :" -msgstr "" -"若要移除系統禁止刪除的旗標,只需要簡單在 前加上 " -"no,例如:" - -#. (itstool) path: sect2/screen -#: book.translate.xml:6871 -#, no-wrap -msgid "# chflags nosunlink file1" -msgstr "" - -#. (itstool) path: sect2/para -#: book.translate.xml:6873 -msgid "" -"To view the flags of a file, use with " -"ls1:" -msgstr "" -"使用 ls1 及參數 可檢視檔案目前的旗標:" - -#. (itstool) path: sect2/screen -#: book.translate.xml:6876 -#, no-wrap -msgid "# ls -lo file1" -msgstr "" - -#. (itstool) path: sect2/programlisting -#: book.translate.xml:6878 -#, no-wrap -msgid "-rw-r--r-- 1 trhodes trhodes sunlnk 0 Mar 1 05:54 file1" -msgstr "" - -#. (itstool) path: sect2/para -#: book.translate.xml:6880 -msgid "" -"Several file flags may only be added or removed by the root user. In other cases, the file owner may set " -"its file flags. Refer to chflags1 and " -"chflags2 for more information." -msgstr "" -"多數的旗標僅能由 root 使用者來標" -"示或移除,而部份旗標可由檔案所有者設定。 我們建議系統管理者可閱讀 " -"chflags1chflags2 說明以瞭解相關細節。" - -#. (itstool) path: info/title -#: book.translate.xml:6889 -msgid "" -"The setuid, setgid, and " -"sticky Permissions" -msgstr "" -"setuidsetgidsticky 權限" - -#. (itstool) path: sect2/para -#: book.translate.xml:6904 -msgid "" -"Other than the permissions already discussed, there are three other specific " -"settings that all administrators should know about. They are the " -"setuid, setgid, and sticky permissions." -msgstr "" -"除了已經探討過的權限外,這裡尚有另外三種特別的設定所有管理者都應該知道,這些" -"設定為 setuid, setgid 以及 " -"sticky 權限。" - -#. (itstool) path: sect2/para -#: book.translate.xml:6910 -msgid "" -"These settings are important for some UNIX operations as they provide functionality not normally granted to " -"normal users. To understand them, the difference between the real user ID " -"and effective user ID must be noted." -msgstr "" -"這些設定對某些一般不會授權給一般使用者的 UNIX 操作非常重要,它讓這些功能可運作。要了解這些權限,就必須" -"說明真實使用者 ID (Real user ID) 與有效使用者 ID (Effective user ID) 的差異。" - -#. (itstool) path: sect2/para -#: book.translate.xml:6915 -msgid "" -"The real user ID is the UID who owns or starts the " -"process. The effective UID is the user ID the process " -"runs as. As an example, passwd1 runs with the real " -"user ID when a user changes their password. However, in order to update the " -"password database, the command runs as the effective ID of the root user. This allows users to change their " -"passwords without seeing a Permission Denied error." -msgstr "" -"真實使用者 ID 即是擁有者或啟動程序者的 UID,而有效 " -"UID 是執行程序所使用的使用者 ID。例如," -"passwd1 在使用者更改自己的密碼時會以真實使用者 ID 執行,然而,為了要更" -"新密碼資料庫,該指令必須以 root " -"使用者做為有效 ID 來執行,這讓使用者可以更改自己的密碼而不會遇到權限不足 " -"(Permission Denied) 的錯誤。" - -#. (itstool) path: sect2/para -#: book.translate.xml:6925 -msgid "" -"The setuid permission may be set by prefixing a permission set with the " -"number four (4) as shown in the following example:" -msgstr "setuid 權限可以透過在權限集前加上數字 (4) 來設定,如下範例所示:" - -#. (itstool) path: sect2/screen -#: book.translate.xml:6929 -#, no-wrap -msgid "# chmod 4755 suidexample.sh" -msgstr "" - -#. (itstool) path: sect2/para -#: book.translate.xml:6931 -msgid "" -"The permissions on suidexample.sh now look like the following:" -msgstr "" -"現在 suidexample.sh 的權限會" -"如下所示:" - -#. (itstool) path: sect2/programlisting -#: book.translate.xml:6935 -#, no-wrap -msgid "-rwsr-xr-x 1 trhodes trhodes 63 Aug 29 06:36 suidexample.sh" -msgstr "" - -#. (itstool) path: sect2/para -#: book.translate.xml:6937 -msgid "" -"Note that a s is now part of the permission set " -"designated for the file owner, replacing the executable bit. This allows " -"utilities which need elevated permissions, such as " -"passwd1." -msgstr "" -"注意,s 現在取代了原來的執行位元成為指定檔案擁有者權限集的" -"一部份,這會允許須要提升權限的工具,如 passwd1 可正常使用。" - -#. (itstool) path: note/para -#: book.translate.xml:6943 -msgid "" -"The nosuid mount8 option will cause such " -"binaries to silently fail without alerting the user. That option is not " -"completely reliable as a nosuid wrapper may be able to " -"circumvent it." -msgstr "" -"mount8nosuid 選項會造成這類 Binary 執行失敗,但" -"不會警告使用者。由於 nosuid Wrapper 可能可繞過該選項,因此" -"該選項並非完全可靠。" - -#. (itstool) path: sect2/para -#: book.translate.xml:6950 -msgid "" -"To view this in real time, open two terminals. On one, type passwd as a normal user. While it waits for a new password, check the " -"process table and look at the user information for " -"passwd1:" -msgstr "" -"實際來看這個範例,先開啟兩個終端機,其中一個用一般使用者輸入 " -"passwd。在等待輸入新密碼的同時,檢查程序表並查看 " -"passwd1 程序的使用者資訊:" - -#. (itstool) path: sect2/para -#: book.translate.xml:6956 -msgid "In terminal A:" -msgstr "於終端機 A:" - -#. (itstool) path: sect2/screen -#: book.translate.xml:6958 -#, no-wrap -msgid "" -"Changing local password for trhodes\n" -"Old Password:" -msgstr "" - -#. (itstool) path: sect2/para -#: book.translate.xml:6961 -msgid "In terminal B:" -msgstr "於終端機 B:" - -#. (itstool) path: sect2/screen -#: book.translate.xml:6963 -#, no-wrap -msgid "# ps aux | grep passwd" -msgstr "" - -#. (itstool) path: sect2/screen -#: book.translate.xml:6965 -#, no-wrap -msgid "" -"trhodes 5232 0.0 0.2 3420 1608 0 R+ 2:10AM 0:00.00 grep passwd\n" -"root 5211 0.0 0.2 3620 1724 2 I+ 2:09AM 0:00.01 passwd" -msgstr "" - -#. (itstool) path: sect2/para -#: book.translate.xml:6968 -msgid "" -"Although passwd1 is run as a normal user, it is using the effective " -"UID of root." -msgstr "" -"雖然使用一般使用者來執行 passwd1,但該程序使用了 " -"root 的有效 UID。" - -#. (itstool) path: sect2/para -#: book.translate.xml:6972 -msgid "" -"The setgid permission performs the same function as the " -"setuid permission; except that it alters the group " -"settings. When an application or utility executes with this setting, it will " -"be granted the permissions based on the group that owns the file, not the " -"user who started the process." -msgstr "" -"setgid 權限的功能與 setuid 相似,當應用" -"程式或工具使用此設定執行時,將會以擁有該檔案的群組來執行,而非執行行該程序的" -"使用者。" - -#. (itstool) path: sect2/para -#: book.translate.xml:6979 -msgid "" -"To set the setgid permission on a file, provide " -"chmod1 with a leading two (2):" -msgstr "" -"要在檔案設定 setgid 權限,需在 " -"chmod1 的參數前加上 (2):" - -#. (itstool) path: sect2/screen -#: book.translate.xml:6982 -#, no-wrap -msgid "# chmod 2755 sgidexample.sh" -msgstr "" - -#. (itstool) path: sect2/para -#: book.translate.xml:6984 -msgid "" -"In the following listing, notice that the s is now in the " -"field designated for the group permission settings:" -msgstr "注意以下清單中,s 現在位於指定群組權限設定的欄位:" - -#. (itstool) path: sect2/screen -#: book.translate.xml:6988 -#, no-wrap -msgid "-rwxr-sr-x 1 trhodes trhodes 44 Aug 31 01:49 sgidexample.sh" -msgstr "" - -#. (itstool) path: note/para -#: book.translate.xml:6991 -msgid "" -"In these examples, even though the shell script in question is an executable " -"file, it will not run with a different EUID or effective " -"user ID. This is because shell scripts may not access the " -"setuid2 system calls." -msgstr "" -"在以上這些範例中,雖然在例子中的 Shell script 是可執行的檔案,但並不會以其他" -"的 EUID 或有效使用者 ID 執行,這是因為 Shell script 並不會" -"存取 setuid2 系統呼叫 (System call)。" - -#. (itstool) path: sect2/para -#: book.translate.xml:6998 -msgid "" -"The setuid and setgid permission bits " -"may lower system security, by allowing for elevated permissions. The third " -"special permission, the sticky bit, can strengthen the " -"security of a system." -msgstr "" -"setuidsetgid 權限位元可能會因允許提" -"升權限而降低系統的安全性,因此有了第三個特殊的權限:sticky bit,可以加強系統的安全性。" - -#. (itstool) path: sect2/para -#: book.translate.xml:7004 -msgid "" -"When the sticky bit is set on a directory, it allows file " -"deletion only by the file owner. This is useful to prevent file deletion in " -"public directories, such as /tmp, by users who do not " -"own the file. To utilize this permission, prefix the permission set with a " -"one (1):" -msgstr "" -"當在目錄上設定 sticky bit,將只允許由檔案擁有者刪除檔案。" -"這對避免公開目錄,如 /tmp 中的檔案被不擁有該檔案的人刪除" -"非常有用。要使用這個權限,可在權限集前加上 (1):" - -#. (itstool) path: sect2/screen -#: book.translate.xml:7011 -#, no-wrap -msgid "# chmod 1777 /tmp" -msgstr "" - -#. (itstool) path: sect2/para -#: book.translate.xml:7013 -msgid "" -"The sticky bit permission will display as a t at the very end of the permission set:" -msgstr "" -"sticky bit 權限會以 t 顯示於權限集的最" -"後:" - -#. (itstool) path: sect2/screen -#: book.translate.xml:7017 -#, no-wrap -msgid "# ls -al / | grep tmp" -msgstr "" - -#. (itstool) path: sect2/screen -#: book.translate.xml:7019 -#, no-wrap -msgid "drwxrwxrwt 10 root wheel 512 Aug 31 01:49 tmp" -msgstr "" - -#. (itstool) path: sect1/title -#: book.translate.xml:7025 -msgid "Directory Structure" -msgstr "目錄結構" - -#. (itstool) path: sect1/indexterm -#: book.translate.xml:7027 -msgid "directory hierarchy" -msgstr "" - -#. (itstool) path: sect1/para -#: book.translate.xml:7031 -msgid "" -"The FreeBSD directory hierarchy is fundamental to obtaining an overall " -"understanding of the system. The most important directory is root or, " -"/. This directory is the first one mounted at boot time and " -"it contains the base system necessary to prepare the operating system for " -"multi-user operation. The root directory also contains mount points for " -"other file systems that are mounted during the transition to multi-user " -"operation." -msgstr "" -"認識 FreeBSD 的目錄架構,就可對系統有概略的基礎理解。 最重要的莫過於整個目錄" -"的根目錄,就是 / 目錄, 該目錄會在開機時最先掛載 (mount),裡面" -"會有開機所會用到必備檔案。 此外,根目錄還有紀錄其他檔案系統的掛載點相關設定。" - -#. (itstool) path: sect1/para -#: book.translate.xml:7040 -msgid "" -"A mount point is a directory where additional file systems can be grafted " -"onto a parent file system (usually the root file system). This is further " -"described in . Standard mount points " -"include /usr/, /var/, /" -"tmp/, /mnt/, and /cdrom/. These directories are usually referenced to entries in /" -"etc/fstab. This file is a table of various file systems and mount " -"points and is read by the system. Most of the file systems in /etc/" -"fstab are mounted automatically at boot time from the script " -"rc8 unless their entry includes . Details " -"can be found in ." -msgstr "" -"「掛載點」就是讓新增的檔案系統,能接到上層的檔案系統 (通常就是「根目錄」檔案" -"系統) 的目錄。 在 這邊對此有更詳細介" -"紹。 標準的掛載點包括了 /usr/, /var/, /tmp/, /mnt/ 以及 " -"/cdrom/。 這些目錄通常會記錄在 /etc/fstab 設定檔內。 /etc/fstab 是記錄各檔案系統及相關掛" -"載點的表格。 大部分在 /etc/fstab 有記錄的檔案系統,會在" -"開機時由 rc8 Script 來自動掛載,除非它們有設定 "> - -dryice@FreeBSD.org
"> - -foxfair@FreeBSD.org
"> - -hsu@FreeBSD.org
"> - -ijliao@FreeBSD.org
"> - -kaiw@FreeBSD.org
"> - -keichii@FreeBSD.org"> - -kevlo@FreeBSD.org"> - -leeym@FreeBSD.org"> - -loader@FreeBSD.org"> - -luoqi@FreeBSD.org"> - -lwhsu@FreeBSD.org"> - -nemoliu@FreeBSD.org"> - -pat@FreeBSD.org"> - -rafan@FreeBSD.org"> - -sephe@FreeBSD.org"> - - -vanilla@FreeBSD.org"> - - - - -cwlin0416@gmail.com"> - -gaod.chen@gmail.com"> - -b89605222@ntu.edu.tw"> - -tzhuan@gmail.com"> - -whsyu@arbor.ee.ntu.edu.tw"> - -yzlin1985@gmail.com"> diff --git a/zh_TW.UTF-8/share/xml/catalog.xml b/zh_TW.UTF-8/share/xml/catalog.xml deleted file mode 100644 index 7b67bc4f0f..0000000000 --- a/zh_TW.UTF-8/share/xml/catalog.xml +++ /dev/null @@ -1,34 +0,0 @@ - - - - - - - - - - - - - - - - - - diff --git a/zh_TW.UTF-8/share/xml/entities.ent b/zh_TW.UTF-8/share/xml/entities.ent deleted file mode 100644 index 3129e5da62..0000000000 --- a/zh_TW.UTF-8/share/xml/entities.ent +++ /dev/null @@ -1,26 +0,0 @@ - - - -%freebsd; - -%authors.cn; - -%teams; - -%mailing-lists; - -%newsgroups; - -%trademarks; - -%trademarks-en; - -%urls; diff --git a/zh_TW.UTF-8/share/xml/freebsd-dblatex.xsl b/zh_TW.UTF-8/share/xml/freebsd-dblatex.xsl deleted file mode 100644 index 586cc5aced..0000000000 --- a/zh_TW.UTF-8/share/xml/freebsd-dblatex.xsl +++ /dev/null @@ -1,17 +0,0 @@ - - - - - - - - \setmainfont{AR PL Mingti2L Big5} - - \setsansfont{AR PL KaitiM Big5} - - \setmonofont{DejaVu Sans Mono} - - - - diff --git a/zh_TW.UTF-8/share/xml/freebsd-fo.xsl b/zh_TW.UTF-8/share/xml/freebsd-fo.xsl deleted file mode 100644 index 04034e576e..0000000000 --- a/zh_TW.UTF-8/share/xml/freebsd-fo.xsl +++ /dev/null @@ -1,69 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Gentium Plus, AR PL Mingti2L Big5 - Droid Sans, AR PL KaitiM Big5 - Droid Sans, AR PL KaitiM Big5 - Droid Sans Mono, Droid Sans Fallback - - - - 8pt - - - - - - - - - - - - - - 10pt - - - diff --git a/zh_TW.UTF-8/share/xml/freebsd-xhtml.xsl b/zh_TW.UTF-8/share/xml/freebsd-xhtml.xsl deleted file mode 100644 index f397fec226..0000000000 --- a/zh_TW.UTF-8/share/xml/freebsd-xhtml.xsl +++ /dev/null @@ -1,20 +0,0 @@ - - - - - - - -

本文及其他文件,可由此下載: - ftp://ftp.FreeBSD.org/pub/FreeBSD/doc/

- -

若有 FreeBSD 方面疑問,請先閱讀 - FreeBSD 相關文件,如不能解決的話,再洽詢 - <questions@FreeBSD.org>。
- 關於本文件的問題,請洽詢 - <doc@FreeBSD.org>。

-
-
diff --git a/zh_TW.UTF-8/share/xml/glossary.ent b/zh_TW.UTF-8/share/xml/glossary.ent deleted file mode 100644 index 4aa4c34cb3..0000000000 --- a/zh_TW.UTF-8/share/xml/glossary.ent +++ /dev/null @@ -1,1920 +0,0 @@ - - - - &os; Glossary - This glossary contains terms and acronyms used within the &os; - community and documentation. - - - A - - - ACL - - - - - ACPI - - - - - AMD - - - - - AML - - - - - API - - - - - APIC - - - - - APM - - - - - APOP - - - - - ASL - - - - - ATA - - - - - ATM - - - - - ACPI Machine Language - AML - - Pseudocode, interpreted by a virtual machine within an - ACPI-compliant operating system, providing a - layer between the underlying hardware and the documented - interface presented to the OS. - - - - - ACPI Source Language - ASL - - The programming language AML is written in. - - - - - Access Control List - ACL - - - - - - - Advanced Configuration and Power Interface - ACPI - - A specification which provides an abstraction of the - interface the hardware presents to the operating system, so - that the operating system should need to know nothing about - the underlying hardware to make the most of it. ACPI - evolves and supercedes the functionality provided previously by - APM, PNPBIOS and other technologies, and - provides facilities for controlling power consumption, machine - suspension, device enabling and disabling, etc. - - - - - Application Programming Interface - API - - A set of procedures, protocols and tools that specify the - canonical interaction of one or more program parts; how, when - and why they do work together, and what data they share or - operate on. - - - - - Advanced Power Management - APM - - - - - - - Advanced Programmable Interrupt Controller - APIC - - - - - - - Advanced Technology Attachment - ATA - - - - - - - Asynchronous Transfer Mode - ATM - - - - - - - Authenticated Post Office Protocol - APOP - - - - - - - Automatic Mount Daemon - AMD - - A daemon that automatically mounts a filesystem when a file - or directory within that filesystem is accessed. - - - - - - B - - - BIND - - - - - BIOS - - - - - BSD - - - - - Basic Input/Output System - BIOS - - The definition of BIOS depends a bit on - the context. Some people refer to it as the ROM - chip with a basic set of routines to provide an interface between - software and hardware. Others refer to it as the set of routines - contained in the chip that help in bootstrapping the system. Some - might also refer to it as the screen used to configure the - boostrapping process. The BIOS is PC-specific - but other systems have something similar. - - - - - Berkeley Internet Name Domain - BIND - - An implementation of the DNS protocols. - - - - - Berkeley Software Distribution - BSD - - 這是由 U.C. Berkeley 的 - Computer Systems Research Group(CSRG) 選來當作他們所改良、修改過的 - AT&T's 32V &unix; 名稱。&os; 則是由 CSRG 的這個心血衍生出來。 - - - - - Bikeshed Building - - A phenomenon whereby many people will give an opinion on - an uncomplicated topic, whilst a complex topic receives little - or no discussion. See the - FAQ for - the origin of the term. - - - - - - C - - - CD - - - - - CHAP - - - - - CLIP - - - - - COFF - - - - - CPU - - - - - CTS - - - - - CVS - - - - - Carrier Detect - CD - - An RS232C signal indicating that a carrier has been - detected. - - - - - Central Processing Unit - CPU - - Also known as the processor. This is the brain of the - computer where all calculations take place. There are a number of - different architectures with different instruction sets. Among - the more well-known are the Intel-x86 and derivatives, Sun SPARC, - PowerPC, and Alpha. - - - - - Challenge Handshake Authentication Protocol - CHAP - - - - - - - Classical IP over ATM - CLIP - - - - - - - Clear To Send - CTS - - An RS232C signal giving the remote system - permission to send data. - - - - - Common Object File Format - COFF - - - - - - - Concurrent Versions System - CVS - - - - - - - - D - - - DAC - - - - - DDB - - - - - DES - - - - - DHCP - - - - - DNS - - - - - DSDT - - - - - DSR - - - - - DTR - - - - - DVMRP - - - - - Discretionary Access Control - DAC - - - - - - - Data Encryption Standard - DES - - - - - - - Data Set Ready - DSR - - - - - - - Data Terminal Ready - DTR - - - - - - - Debugger - DDB - - - - - - - Differentiated System Description Table - DSDT - - - - - - - Distance-Vector Multicast Routing Protocol - DVMRP - - - - - - - Domain Name System - DNS - - The system that converts humanly readable hostnames (i.e., - mail.example.net) to Internet addresses and vice versa. - - - - - Dynamic Host Configuration Protocol - DHCP - - A protocol that dynamically assigns IP addresses to a computer - (host) when it requests one from the server. The address assignment - is called a lease. - - - - - - E - - - ECOFF - - - - - ELF - - - - - ESP - - - - - Encapsulated Security Payload - ESP - - - - - - - Executable and Linking Format - ELF - - - - - - - Extended COFF - ECOFF - - - - - - - - F - - - FADT - - - - - FAT - - - - - FAT16 - - - - - FTP - - - - - File Allocation Table - FAT - - - - - - - File Allocation Table (16-bit) - FAT16 - - - - - - - File Transfer Protocol - FTP - - A member of the family of high-level protocols implemented - on top of TCP which can be used to transfer - files over a TCP/IP network. - - - - - Fixed ACPI Description Table - FADT - - - - - - - - G - - - GUI - - - - - Giant - - The name of a mutual exclusion mechanism - (a sleep mutex) that protects a large - set of kernel resources. Although a simple locking mechanism - was adequate in the days where a machine might have only - a few dozen processes, one networking card, and certainly - only one processor, in current times it is an unacceptable - performance bottleneck. &os; developers are actively working - to replace it with locks that protect individual resources, - which will allow a much greater degree of parallelism for - both single-processor and multi-processor machines. - - - - - Graphical User Interface - GUI - - A system where the user and computer interact with - graphics. - - - - - - H - - - HTML - - - - - HUP - - - - - HangUp - HUP - - - - - - - HyperText Markup Language - HTML - - The markup language used to create web pages. - - - - - - I - - - I/O - - - - - IASL - - - - - IMAP - - - - - IP - - - - - IPFW - - - - - IPP - - - - - IPv4 - - - - - IPv6 - - - - - ISP - - - - - IP Firewall - IPFW - - - - - - - IP Version 4 - IPv4 - - The IP protocol version 4, which uses 32 bits - for addressing. This version is still the most widely used, but it - is slowly being replaced with IPv6. - - - - - - IP Version 6 - IPv6 - - The new IP protocol. Invented because the - address space in IPv4 is running out. Uses 128 - bits for addressing. - - - - - Input/Output - I/O - - - - - - - Intel’s ASL compiler - IASL - - Intel’s compiler for converting ASL into - AML. - - - - - Internet Message Access Protocol - IMAP - - - - - - - Internet Printing Protocol - IPP - - - - - - - Internet Protocol - IP - - The packet transmitting protocol that is the basic protocol on - the Internet. Originally developed at the U.S. Department of - Defense and an extremly important part of the TCP/IP - stack. Without the Internet Protocol, the Internet - would not have become what it is today. For more information, see - - RFC 791. - - - - - Internet Service Provider - ISP - - A company that provides access to the Internet. - - - - - - K - - - KAME - - Japanese for turtle, the term KAME is used - in computing circles to refer to the KAME Project, who work on - an implementation of IPv6. - - - - - KDC - - - - - KLD - - - - - KSE - - - - - KVA - - - - - Kbps - - - - - Kernel &man.ld.1; - KLD - - - - - - - Kernel Scheduler Entities - KSE - - A kernel-supported threading system. See the project home page - for further details. - - - - - Kernel Virtual Address - KVA - - - - - - - Key Distribution Center - KDC - - - - - - - Kilo Bits Per Second - Kbps - - Used to measure bandwith (how much data can pass a given - point at a specified amount of time). Alternates to the Kilo - prefix include Mega, Giga, Tera, and so forth. - - - - - - L - - - LAN - - - - - LOR - - - - - LPD - - - - - Line Printer Daemon - LPD - - - - - - - Local Area Network - LAN - - A network used on a local area, e.g. office, home, or so forth. - - - - - - Lock Order Reversal - LOR - - The &os; kernel uses a number of resource locks to - arbitrate contention for those resources. A run-time - lock diagnostic system found in &os.current; kernels - (but removed for releases), called &man.witness.4;, - detects the potential for deadlocks due to locking errors. - (&man.witness.4; is actually slightly conservative, so - it is possible to get false positives.) A true positive - report indicates that if you were unlucky, a deadlock would - have happened here. - - True positive LORs tend to get fixed quickly, so - check &a.current.url; and the - - LORs Seen page before posting to the mailing lists. - - - - - - M - - - MAC - - - - - MADT - - - - - MFC - - - - - MFP4 - - - - - MFS - - - - - MIT - - - - - MLS - - - - - MOTD - - - - - MTA - - - - - MUA - - - - - Mail Transfer Agent - MTA - - An application used to transfer email. An - MTA has traditionally been part of the BSD - base system. Today Sendmail is included in the base system, but - there are many other MTAs, such as postfix, - qmail and Exim. - - - - - Mail User Agent - MUA - - An application used by users to display and write email. - - - - - Mandatory Access Control - MAC - - - - - - - Massachusetts Institute of Technology - MIT - - - - - - - Merge From Current - MFC - - MFC 是一個縮寫,它代表了 Merged From -CURRENT - ,這字眼會在 CVS logs 中常見, - 以表示這是從 -CURRENT 中整合進其他分支(通常是 -STABLE)的 patch 或功能。 - - - - - Merge From Perforce - MFP4 - - To merge functionality or a patch from the Perforce - repository to the -CURRENT branch. - - - - - - Merge From Stable - MFS - - In the normal course of FreeBSD development, a change will - be committed to the -CURRENT branch for testing before being - merged to -STABLE. On rare occasions, a change will go into - -STABLE first and then be merged to -CURRENT. - - This term is also used when a patch is merged from -STABLE - to a security branch. - - - - - - Message Of The Day - MOTD - - A message, usually shown on login, often used to - distribute information to users of the system. - - - - - Multi-Level Security - MLS - - - - - - - Multiple APIC Description Table - MADT - - - - - - - - N - - - NAT - - - - - NDISulator - - - - - NFS - - - - - NTFS - - - - - NTP - - - - - Network Address Translation - NAT - - - - - - - Network File System - NFS - - - - - - - New Technology File System - NTFS - - A filesystem developed by Microsoft and available in its - New Technology operating systems, such as - &windows2k;, &windowsnt; and &windowsxp;. - - - - - Network Time Protocol - NTP - - - - - - - - O - - - OBE - - - - - ODMR - - - - - OS - - - - - On-Demand Mail Relay - ODMR - - - - - - - Operating System - OS - - A set of programs, libraries and tools that provide access to - the hardware resources of a computer. Operating systems range - today from simplistic designs that support only one program - running at a time, accessing only one device to fully - multi-user, multi-tasking and multi-process systems that can - serve thousands of users simultaneously, each of them running - dozens of different applications. - - - - - Overtaken By Events - OBE - - Indicates a suggested change (such as a Problem Report - or a feature request) which is no longer relevant or - applicable due to such things as later changes to &os;, - changes in networking standards, the affected hardware - having since become obsolete, and so forth. - - - - - - P - - - p4 - - - - - PAE - - - - - PAM - - - - - PAP - - - - - PC - - - - - PCNSFD - - - - - PDF - - - - - PID - - - - - POLA - - - - - POP - - - - - POP3 - - - - - PPD - - - - - PPP - - - - - PPPoA - - - - - PPPoE - - - - - PPP over ATM - PPPoA - - - - - - - PPP over Ethernet - PPPoE - - - - - - - PR - - - - - PXE - - - - - Password Authentication Protocol - PAP - - - - - - - Perforce - - A source code control product made by - Perforce Software - which is more advanced than CVS. Although not open source, it use - is free of charge to open-source projects such as &os;. - - Some &os; developers use a Perforce repository as a staging - area for code that is considered too experimental for the - -CURRENT branch. - - - - - Personal Computer - PC - - - - - - - Personal Computer Network File System Daemon - PCNFSD - - - - - - - Physical Address Extensions - PAE - - A method of enabling access to up to 64 GB of RAM on - systems which only physically have a 32-bit wide address space - (and would therefore be limited to 4 GB without PAE). - - - - - Pluggable Authentication Modules - PAM - - - - - - - Point-to-Point Protocol - PPP - - - - - - - Pointy Hat - - A mythical piece of headgear, much like a - dunce cap, awarded to any &os; - committer who breaks the build, makes revision numbers - go backwards, or creates any other kind of havoc in - the source base. Any committer worth his or her salt - will soon accumulate a large collection. The usage is - (almost always?) humorous. - - - - - Portable Document Format - PDF - - - - - - - Post Office Protocol - POP - - - - - - - Post Office Protocol Version 3 - POP3 - - - - - - - PostScript Printer Description - PPD - - - - - - - Preboot eXecution Environment - PXE - - - - - - - Principle Of Least Astonishment - POLA - - 在 &os; 的發展過程中,任何的改變幅度,都不該讓使用者習慣感到不適。 - 舉例來說:若任意調動 /etc/defaults/rc.conf 中的系統啟動順序, - 就是違背 POLA 原則的精神。任何開發人員,都該在做出重大改變前, - 先三思是否會與 POLA 原則有所違背。 - - - - - Problem Report - PR - - A description of some kind of problem that has been - found in either the &os; source or documentation. See - - Writing &os; Problem Reports. - - - - - Process ID - PID - - A number, unique to a particular process on a system, - which identifies it and allows actions to be taken against it. - - - - - Project Evil - - The working title for the NDISulator, - written by Bill Paul, who named it referring to how awful - it is (from a philosophical standpoint) to need to have - something like this in the first place. The - NDISulator is a special compatibility - module to allow Microsoft Windows™ NDIS miniport - network drivers to be used with &os;/i386. This is usually - the only way to use cards where the driver is closed-source. - See src/sys/compat/ndis/subr_ndis.c. - - - - - - R - - - RA - - - - - RAID - - - - - RAM - - - - - RD - - - - - RFC - - - - - RISC - - - - - RPC - - - - - RS232C - - - - - RTS - - - - - Random Access Memory - RAM - - - - - - - Received Data - RD - - - - - - - Recommended Standard 232C - RS232C - - A standard for communications between serial devices. - - - - - Reduced Instruction Set Computer - RISC - - - - - - - Redundant Array of Inexpensive Disks - RAID - - - - - - - Remote Procedure Call - RPC - - - - - - - repocopy - - - - - Repository Copy - - repocopy(repository copy 的縮寫) - 就是直接從 CVS repository 中複製檔案。 - - 若不用 repocopy 的方式,那麼若要在 repository 內複製、移動檔案的話, - committer 就必須執行 cvs add 來把檔案放到新位置, - 並且還要執行 cvs rm 來刪除舊檔。 - - 剛剛講的這種方式的缺點在於,該檔的之前相關紀錄 - (比如在 CVS logs 中的相關項目)並不會隨之而複製到新地方去。 - 而 &os; 計劃中認為這些歷史記錄都是相當有用的, - 所以會經常採用 repository copy 的方式。 - 這也就是為何 repository 管理員會直接在 repository 內複製檔案的方式, - 而非採取 &man.cvs.1; 程式來進行 cvs add、 - cvs rm之類的動作。 - - - - - Request For Comments - RFC - - A set of documents defining Internet standards, protocols, and - so forth. See - www.rfc-editor.org. - - - Also used as a general term when someone has a suggested change - and wants feedback. - - - - - Request To Send - RTS - - - - - - - Router Advertisement - RA - - - - - - - - S - - - SCI - - - - - SCSI - - - - - SG - - - - - SMB - - - - - SMP - - - - - SMTP - - - - - SMTP AUTH - - - - - SSH - - - - - STR - - - - - SMTP Authentication - SMTP AUTH - - - - - - - Server Message Block - SMB - - - - - - - Signal Ground - SG - - An RS232 pin or wire that is the ground reference - for the signal. - - - - - Simple Mail Transfer Protocol - SMTP - - - - - - - Secure Shell - SSH - - - - - - - Small Computer System Interface - SCSI - - - - - - - Suspend To RAM - STR - - - - - - - Symmetric MultiProcessor - SMP - - - - - - - System Control Interrupt - SCI - - - - - - - - T - - - TCP - - - - - TCP/IP - - - - - TD - - - - - TFTP - - - - - TGT - - - - - TSC - - - - - Ticket-Granting Ticket - TGT - - - - - - - Time Stamp Counter - TSC - - - A profiling counter internal to modern &pentium; processors - that counts core frequency clock ticks. - - - - - Transmission Control Protocol - TCP - - A protocol that sits on top of (e.g.) the IP - protocol and guarantees that packets are delivered in a reliable, - ordered, fashion. - - - - - Transmission Control Protocol/Internet Protocol - TCP/IP - - The term for the combination of the TCP - protocol running over the IP protocol. Much of - the Internet runs over TCP/IP. - - - - - Transmitted Data - TD - - - - - - - Trivial FTP - TFTP - - - - - - - - U - - - UDP - - - - - UFS1 - - - - - UFS2 - - - - - UID - - - - - URL - - - - - USB - - - - - Uniform Resource Locator - URL - - - - - - - Unix File System Version 1 - UFS1 - - - - - - - Unix File System Version 2 - UFS2 - - - - - - - Universal Serial Bus - USB - - - - - - - User ID - UID - - A unique number assigned to each user of a computer, - by which the resources and permissions assigned to that - user can be identified. - - - - - User Datagram Protocol - UDP - - - - - - - - V - - - VPN - - - - - Virtual Private Network - VPN - - - - - - diff --git a/zh_TW.UTF-8/share/xml/header.l10n.ent b/zh_TW.UTF-8/share/xml/header.l10n.ent deleted file mode 100644 index ae2a209995..0000000000 --- a/zh_TW.UTF-8/share/xml/header.l10n.ent +++ /dev/null @@ -1,121 +0,0 @@ - - - - - - - -Site Map | - 法律聲明 | © 1995–2021 FreeBSD 計劃。 - 保留所有權利。'> -首頁   |   聯絡   |   版權   |   ©right;'> -FreeBSD 首頁'> - - - - - - -
.
- -
.
- -'> - - - - - - - - - - - - - - - - - - '> - - -介紹如何手動透過 SVN repository 更新, -以及如何編譯 FreeBSD 網頁。

'> diff --git a/zh_TW.UTF-8/share/xml/l10n.ent b/zh_TW.UTF-8/share/xml/l10n.ent deleted file mode 100644 index ea1ff38c7a..0000000000 --- a/zh_TW.UTF-8/share/xml/l10n.ent +++ /dev/null @@ -1,124 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/zh_TW.UTF-8/share/xml/libcommon.xsl b/zh_TW.UTF-8/share/xml/libcommon.xsl deleted file mode 100644 index c1dbe8e2f5..0000000000 --- a/zh_TW.UTF-8/share/xml/libcommon.xsl +++ /dev/null @@ -1,105 +0,0 @@ - - - - - - - - - - - - - - - - FreeBSD 新聞快遞 - -

FreeBSD 是個發展迅速的作業系統。 - 保持最新的開發版是比較繁瑣的!你可以定期來查閱本頁,此外,也可能訂閱 - freebsd-announce - 郵件論壇 或使用 RSS feed

- -

下列的每項都有自己的新聞頁面,裡面有這些的更新細節。

- - - -

更詳細的描述、介紹、和未來的發行版本,請看 Release 資訊這頁。

- -

對於 FreeBSD 的安全公告, 請查閱 安全資訊 頁面。

-
- - - 新聞首頁 - - - -

更早的公告: - 2003, - 2002, - 2001, - 2000, - 1999, - 1998, - 1997, - 1996

-
- - - 媒體報導首頁 - - - -

如果您知道我們沒有在這裡列出的關於 FreeBSD 的消息, 請寫信到 - www@FreeBSD.org 以便我們更新,謝謝。

-
- - - - - - - - - - - - - - - - 一月 - 二月 - 三月 - 四月 - 五月 - 六月 - 七月 - 八月 - 九月 - 十月 - 十一月 - 十二月 - 月份無效 - - - - - - - - - - -
diff --git a/zh_TW.UTF-8/share/xml/mailing-lists.ent b/zh_TW.UTF-8/share/xml/mailing-lists.ent deleted file mode 100644 index 61dba0953b..0000000000 --- a/zh_TW.UTF-8/share/xml/mailing-lists.ent +++ /dev/null @@ -1,645 +0,0 @@ - - - - -FreeBSD list server"> -&a.mailman.listinfo;"> - - -FreeBSD ACPI 郵遞論壇"> -freebsd-acpi"> - - -FreeBSD advocacy 郵遞論壇"> -freebsd-advocacy"> - - -FreeBSD AFS porting 郵遞論壇"> -freebsd-afs"> - - -FreeBSD Adaptec AIC7xxx discussions 郵遞論壇"> -freebsd-aic7xxx"> - - -Porting FreeBSD to AMD64 systems"> -freebsd-amd64"> - - -FreeBSD announcements 郵遞論壇"> -freebsd-announce"> - - -FreeBSD Apache 郵遞論壇"> -freebsd-apache"> - - -FreeBSD architecture and design 郵遞論壇"> -freebsd-arch"> - - -FreeBSD ARM porting 郵遞論壇"> -freebsd-arm"> - - -FreeBSD ATM networking 郵遞論壇"> -freebsd-atm"> - - -FreeBSD Bluetooth 郵遞論壇"> -freebsd-bluetooth"> - - -FreeBSD bugbusters 郵遞論壇"> -freebsd-bugbusters"> - - -FreeBSD problem reports 郵遞論壇"> -freebsd-bugs"> - - -FreeBSD chat 郵遞論壇"> -freebsd-chat"> - - -FreeBSD-specific Chromium issues"> -freebsd-chromium"> - - -FreeBSD clustering 郵遞論壇"> -freebsd-cluster"> - - - - - - - -&os.current; 郵遞論壇"> -freebsd-current"> - - -CTM 公告"> -ctm-announce"> - - -CTM 4-STABLE src branch distribution 郵遞論壇"> -ctm-src-4"> - - -CTM 5-STABLE src branch distribution mailing list"> -ctm-src-5"> - - -CTM 6-STABLE src branch distribution mailing list"> -ctm-src-6"> - - -CTM 7-STABLE src branch distribution mailing list"> -ctm-src-7"> - - -CTM 8-STABLE src branch distribution mailing list"> -ctm-src-8"> - - -CTM 9-STABLE src branch distribution mailing list"> -ctm-src-9"> - - -CTM 10-STABLE src branch distribution mailing list"> -ctm-src-10"> - - -CTM -CURRENT src branch distribution 郵遞論壇"> -ctm-src-cur"> - - -CTM user discussion 郵遞論壇"> -ctm-users"> - - -FreeBSD CVS commit message 郵遞論壇"> -cvs-all"> - - -FreeBSD CVS doc commit list"> -cvs-doc"> - - -FreeBSD CVS ports commit list"> -cvs-ports"> - - -FreeBSD CVS projects commit list"> -cvs-projects"> - - -FreeBSD CVS src commit list"> -cvs-src"> - - -FreeBSD based Databases 郵遞論壇"> -freebsd-database"> - - -Using and improving &os; on the desktop"> -freebsd-desktop"> - - - - - -FreeBSD documentation project 郵遞論壇"> -freebsd-doc"> - - - - - - - - -Writing device drivers for FreeBSD"> -freebsd-drivers"> - - -Using and working on DTrace in &os;."> -freebsd-dtrace"> - - -FreeBSD users of Eclipse IDE, tools, rich client applications and ports"> -freebsd-eclipse"> - -FreeBSD-embedded 郵遞論壇"> -freebsd-embedded"> - - -FreeBSD-emulation 郵遞論壇"> -freebsd-emulation"> - - -FreeBSD-enlightenment mailing list"> -freebsd-enlightenment"> - - -FreeBSD-eol 郵遞論壇"> -freebsd-eol"> - - -FreeBSD FireWire (IEEE 1394) discussion 郵遞論壇"> -freebsd-firewire"> - - -Fortran on FreeBSD mailing list"> -freebsd-fortran"> - - -FreeBSD file system project 郵遞論壇"> -freebsd-fs"> - - -Games on FreeBSD mailing list"> -freebsd-games"> - - -FreeBSD gecko mailing list"> -freebsd-gecko"> - - -FreeBSD GEOM 郵遞論壇"> -freebsd-geom"> - - -Discussion of git use in the FreeBSD project"> -freebsd-git"> - - -FreeBSD GNOME and GNOME applications 郵遞論壇"> -freebsd-gnome"> - - -FreeBSD technical discussions 郵遞論壇"> -freebsd-hackers"> - - -FreeBSD hardware and equipment 郵遞論壇"> -freebsd-hardware"> - - -FreeBSD mirror sites 郵遞論壇s"> -freebsd-hubs"> - - -FreeBSD internationalization 郵遞論壇"> -freebsd-i18n"> - - -FreeBSD i386-specific issues 郵遞論壇"> -freebsd-i386"> - - -FreeBSD IA32 porting 郵遞論壇"> -freebsd-ia32"> - - -FreeBSD IA64 porting 郵遞論壇"> -freebsd-ia64"> - - -Infiniband on FreeBSD"> -freebsd-infiniband"> - - -FreeBSD IPFW code 郵遞論壇"> -freebsd-ipfw"> - - -FreeBSD ISDN 郵遞論壇"> -freebsd-isdn"> - - -FreeBSD Internet service provider's 郵遞論壇"> -freebsd-isp"> - - -FreeBSD jails 郵遞論壇"> -freebsd-jail"> - - -FreeBSD Java Language 郵遞論壇"> -freebsd-java"> - - -FreeBSD related employment 郵遞論壇"> -freebsd-jobs"> - - -FreeBSD KDE/Qt and KDE applications 郵遞論壇"> -freebsd-kde"> - - -FreeBSD LFS porting 郵遞論壇"> -freebsd-lfs"> - - -FreeBSD MIPS porting 郵遞論壇"> -freebsd-mips"> - - -FreeBSD mirror site administrators"> -mirror-announce"> - - -FreeBSD laptop computer 郵遞論壇"> -freebsd-mobile"> - - -FreeBSD port of the Mozilla browser 郵遞論壇"> -freebsd-mozilla"> - - -FreeBSD multimedia 郵遞論壇"> -freebsd-multimedia"> - - -FreeBSD networking 郵遞論壇"> -freebsd-net"> - - -FreeBSD new users 郵遞論壇"> -freebsd-newbies"> - - -FreeBSD new-bus 郵遞論壇"> -freebsd-new-bus"> - - -Discussions of high quality implementation of libm functions"> -freebsd-numerics"> - - -Office applications on FreeBSD"> -freebsd-office"> - - -Project Infrastructure Announcements"> -freebsd-ops-announce"> - - -FreeBSD performance 郵遞論壇"> -freebsd-performance"> - - -FreeBSD Perl 郵遞論壇"> -freebsd-perl"> - - -FreeBSD packet filter 郵遞論壇"> -freebsd-pf"> - - -Binary package management and package tools discussion"> -freebsd-pkg"> - - -Fallout logs from package building"> -freebsd-pkg-fallout"> - - -FreeBSD non-Intel platforms porting 郵遞論壇"> -freebsd-platforms"> - -FreeBSD ports 郵遞論壇"> -freebsd-ports"> - - -FreeBSD ports announce mailing list"> -freebsd-ports-announce"> - - -FreeBSD ports bugs 郵遞論壇"> -freebsd-ports-bugs"> - - - - - - - - -FreeBSD PowerPC porting 郵遞論壇"> -freebsd-ppc"> - - -Technical discussion of FreeBSD on HP ProLiant server platforms"> -freebsd-proliant"> - - -FreeBSD Python 郵遞論壇"> -freebsd-python"> - - -FreeBSD general questions 郵遞論壇"> -freebsd-questions"> - - -FreeBSD boot script system 郵遞論壇"> -freebsd-rc"> - - -FreeBSD realtime extensions 郵遞論壇"> -freebsd-realtime"> - - -FreeBSD Ruby mailing list"> -freebsd-ruby"> - - -FreeBSD SCSI subsystem 郵遞論壇"> -freebsd-scsi"> - - -FreeBSD security 郵遞論壇"> -freebsd-security"> - - -FreeBSD security notifications 郵遞論壇"> -freebsd-security-notifications"> - - -FreeBSD-small 郵遞論壇"> -freebsd-small"> - - -FreeBSD Development Snapshot Announcements"> -freebsd-snapshots"> - - -FreeBSD SPARC porting 郵遞論壇"> -freebsd-sparc64"> - - - - - - - - -&os.stable; 郵遞論壇"> -freebsd-stable"> - - -FreeBSD C99 and POSIX compliance 郵遞論壇"> -freebsd-standards"> - - -FreeBSD sun4v porting 郵遞論壇"> -freebsd-sun4v"> - - -SVN commit messages for the entire doc tree (except for user, projects and translations)"> -svn-doc-all"> - - -SVN commit messages for the doc tree for head/"> -svn-doc-head"> - - -SVN commit messages for the doc projects tree"> -svn-doc-projects"> - - -SVN commit messages for the doc admin / configuration tree"> -svn-doc-svnadmin"> - - -SVN commit messages for the entire ports tree"> -svn-ports-all"> - - -SVN commit messages for the ports tree for head/"> -svn-ports-head"> - - -SVN commit messages for the ports admin / configuration tree"> -svn-ports-svnadmin"> - - -SVN commit messages for the entire src tree (except for user and projects)"> -svn-src-all"> - - -SVN commit messages for the src tree for head/-current"> -svn-src-head"> - - -SVN commit messages for the src projects tree"> -svn-src-projects"> - - -SVN commit messages for releases in the src tree"> -svn-src-release"> - - -SVN commit messages for the release engineering / security commits to the src tree"> -svn-src-releng"> - - -SVN commit messages for all the -stable branches of the src tree"> -svn-src-stable"> - - -SVN commit messages for only the 6-stable src tree"> -svn-src-stable-6"> - - -SVN commit messages for only the 7-stable src tree"> -svn-src-stable-7"> - - -SVN commit messages for only the 8-stable src tree"> -svn-src-stable-8"> - - -SVN commit messages for only the 9-stable src tree"> -svn-src-stable-9"> - - -SVN commit messages for only the 10-stable src tree"> -svn-src-stable-10"> - - -SVN commit messages for the old stable src trees"> -svn-src-stable-other"> - - -SVN commit messages for the admin / configuration tree"> -svn-src-svnadmin"> - - -SVN commit messages for the experimental user src tree"> -svn-src-user"> - - -SVN commit messages for the vendor work area tree"> -svn-src-vendor"> - - -Sysinstall development mailing list"> -freebsd-sysinstall"> - - -FreeBSD-specific Tcl/Tk discussions"> -freebsd-tcltk"> - - -FreeBSD test 郵遞論壇"> -freebsd-test"> - - -FreeBSD performance and stability testing 郵遞論壇"> -freebsd-testing"> - - -Porting TeX and its applications to &os;"> -freebsd-tex"> - - -FreeBSD threads 郵遞論壇"> -freebsd-threads"> - - -Porting FreeBSD to the Tilera family of CPUs"> -freebsd-tilera"> - - -FreeBSD tokenring 郵遞論壇"> -freebsd-tokenring"> - - -FreeBSD integrated toolchain mailing list"> -freebsd-toolchain"> - - -FreeBSD translators mailing list"> -freebsd-translators"> - - -FreeBSD USB 郵遞論壇"> -freebsd-usb"> - - -FreeBSD user group coordination 郵遞論壇"> -freebsd-user-groups"> - - -FreeBSD vendors pre-release coordination 郵遞論壇"> -freebsd-vendors"> - - -Discussion of various virtualization techniques supported by FreeBSD"> -freebsd-virtualization"> - - -Discussion on the VuXML -infrastructure"> -freebsd-vuxml"> - - -FreeBSD Work-In-Progress Status"> -freebsd-wip-status"> - - -Discussions of 802.11 stack, tools, device driver development"> -freebsd-wireless"> - - -FreeBSD Webmaster 郵遞論壇"> -freebsd-www"> - - -FreeBSD X11 郵遞論壇"> -freebsd-x11"> - - -FreeBSD port to Xen mailing list"> -freebsd-xen"> - - -XFCE for FreeBSD mailing list"> -freebsd-xfce"> - - -Zope for FreeBSD mailing list"> -freebsd-zope"> - - - -bug-followup@FreeBSD.org"> - - -majordomo@FreeBSD.org"> - - - - -FreeBSD Alpha porting mailing list"> -freebsd-alpha"> - - -FreeBSD Quality Assurance mailing list"> -freebsd-qa"> - - -FreeBSD symmetric multiprocessing mailing list"> -freebsd-smp"> diff --git a/zh_TW.UTF-8/share/xml/navibar.l10n.ent b/zh_TW.UTF-8/share/xml/navibar.l10n.ent deleted file mode 100644 index 9ad4ba603a..0000000000 --- a/zh_TW.UTF-8/share/xml/navibar.l10n.ent +++ /dev/null @@ -1,171 +0,0 @@ - - - - -

Section Navigation

- - - '> - - -

Section Navigation

- - - '> - - -

Section Navigation

- - - '> - - -

Section Navigation

- - - '> - ->即將發佈:
&betarel.current; -'> -]]> - - ->即將發佈:
&betarel2.current; -'> -]]> - - - -

Section Navigation

- - '> - - -

Section Navigation

- - '> - - -

Section Navigation

- - - '> - diff --git a/zh_TW.UTF-8/share/xml/news.xml b/zh_TW.UTF-8/share/xml/news.xml deleted file mode 100644 index 66be3457c5..0000000000 --- a/zh_TW.UTF-8/share/xml/news.xml +++ /dev/null @@ -1,4976 +0,0 @@ - - - - - - - - $FreeBSD$ - - - - 2021 - - - 1 - - - 2 - -

新任 committer: - Neel Chauhan - (ports)

-
-
-
- -
- - - 2020 - - - 12 - - - 19 - -

FreeBSD src 程式庫將轉換為 git。詳情請見 - the git wiki - 。

-
-
- - - 12 - -

新任 committer: - Juraj Lutter - (ports)

-
-
- - - 5 - -

FreeBSD doc 程式庫已轉換為 git。

-
-
-
- - - 10 - - - 27 - - - &os; 12.2-RELEASE 發布了 - -

FreeBSD - 12.2-RELEASE現已發布了。安裝前,請查看發布通知發行勘誤以了解 12.2 的最新消息和問題。更多資訊可查看發行版資訊頁面。

- -
-
- - - 21 - - 2020 第三季開發進度報告發布 - -

- 2020 第三季開發進度報告 35 則條目現已發布。

-
-
- - - 17 - - - &os; 12.2-RC3 發布了 - -

&os; 12.2 的第三個候選發布版本現已發布。 - 用於amd64、armv6、armv7、arm64、i386、powerpc、powerpc64、powerpcspe和sparc64 - 的ISO 映像檔案已經發布 - ,可以在多數的&os; - 鏡像站取得。

-
-
- - - 10 - - - &os; 12.2-RC2 發布了 - -

&os; 12.2 的第二個候選發布版本現已發布。 - 用於amd64、armv6、armv7、arm64、i386、powerpc、powerpc64、powerpcspe和sparc64 - 的ISO 映像檔案已經發布 - ,可以在多數的&os; - 鏡像站取得。

-
-
- - - 3 - - - &os; 12.2-RC1 發布了 - -

&os; 12.2 的第一個候選發布版本現已發布。 - 用於amd64、armv6、armv7、arm64、i386、powerpc、powerpc64、powerpcspe和sparc64 - 的ISO 映像檔案已經發布 - ,可以在多數的&os; - 鏡像站取得。

-
-
-
- - - 9 - - - 26 - - - &os; 12.2-BETA3 發布了 - -

&os; 12.2 的第三個 BETA 版本現已發布。 - 用於amd64、armv6、armv7、arm64、i386、powerpc、powerpc64、powerpcspe和sparc64 - 的ISO 映像檔案已經發布 - ,可以在多數的&os; - 鏡像站取得。

-
-
- - - 18 - - - &os; 12.2-BETA2 發布了 - -

&os; 12.2 的第二個 BETA 版本現已發布。 - 用於amd64、armv6、armv7、arm64、i386、powerpc、powerpc64、powerpcspe和sparc64 - 的ISO 映像檔案已經發布 - ,可以在多數的&os; - 鏡像站取得。

-
-
- - - 12 - - - &os; 12.2-BETA1 發布了 - -

&os; 12.2 的第一個 BETA 版本現已發布。 - 用於amd64、armv6、armv7、arm64、i386、powerpc、powerpc64、powerpcspe和sparc64 - 的ISO 映像檔案已經發布 - ,可以在多數的&os; - 鏡像站取得。

-
-
-
- - - 8 - - - 31 - -

新任 committer: - Rainer Hurling - (ports)

-
-
-
- - - 7 - - - 26 - -

新任 committer: - Daniel Ebdrup Jensen - (doc)

-
-
- - - 23 - - -

新任 committer: - Robert Wing - (src)

-
-
- - - 15 - - - 2020 第二季開發進度報告發布 - -

- 2020 第二季開發進度報告51則條目現已發布。

-
-
- - - 1 - - 新任 &os; Core Team 已選出 - -

計畫的 active committers 已選出第十一屆的 - &os; Core Team。詳情請見 - 官方公告

-
-
-
- - - 6 - - - 16 - - - &os; 11.4-RELEASE 發布了 - -

FreeBSD - 11.4-RELEASE現已發布了。安裝前,請查看發布通知發行勘誤以了解 11.4 的最新消息和問題。更多資訊可查看發行版資訊頁面。

- -
-
- - - 9 - - - FreeBSD 修訂了新的、源於 LLVM 的 code of conduct 。 - -

修訂過的政策請見 Code - of Conduct

-
-
- - - 8 - -

新任 committer: - Gordon Bergling - (doc) -

-
-
- - - 2 - - - FreeBSD 2020 社群調查 - -

FreeBSD - 2020 社群調查 開始了。歡迎將調查連結和您的雇主、同事、 - 朋友或任何對 FreeBSD 有興趣的社群成員分享。 - 調查將於 6月16日 17:00 UTC ( 周二 10am PDT ) 結束。

-
-
-
- - 5 - - - 29 - - - &os; 11.4-RC2 發布了 - -

&os; 11.4 的第二個候選發布版本現已發布。 - 用於amd64、armv6、arm64、i386、powerpc、powerpc64和sparc64 - 的ISO 映像檔案已經發布 - ,可以在多數的&os; - 鏡像站取得。

-
-
- - - 22 - - - &os; 11.4-RC1 發布了 - -

&os; 11.4 的第一個候選發布版本現已發布。 - 用於amd64、armv6、arm64、i386、powerpc、powerpc64和sparc64 - 的ISO 映像檔案已經發布 - ,可以在多數的&os; - 鏡像站取得。

-
-
- - - 16 - - - &os; 11.4-BETA2 發布了 - -

&os; 11.4 的第二個 BETA 版本現已發布。 - 用於amd64、armv6、arm64、i386、powerpc、powerpc64和sparc64 - 的ISO 映像檔案已經發布 - ,可以在多數的&os; - 鏡像站取得。

-
- - - &os;  參與 Google Season of Docs - -

&os;  計畫再次在 - Google Season of Docs 計畫 擔任指導組織 - 。此計畫的目的是讓開源與技術作家們聚在一起, - 技術作家會花三個月和開源社群緊密地一起工作,提供他們的專業給開源計畫的文件。 - 任務與連絡資訊清單請洽 &os; wiki

-
-
- - - 9 - - - &os; 11.4-BETA1 發布了 - -

&os; 11.4 的第一個 BETA 版本現已發布。 - 用於amd64、armv6、arm64、i386、powerpc、powerpc64和sparc64 - 的ISO 映像檔案已經發布 - ,可以在多數的&os; - 鏡像站取得。

-
-
-
- - - 4 - - - 12 - - - 2020 第一季開發進度報告發布 - -

- 2020 第一季開發進度報告現已發布。

-
-
- - - 6 - - -

新任 committer: - Richard Scheffenegger - (src)

-
-
- - - 1 - - -

新任 committer: - Hiroki Tagato - (ports)

-
-
- -
- - - 3 - - - 10 - - -

新任 committer: - Aleksandr Fedorov - (src)

-
-
- - - 9 - - -

新任 committer: - Nick O'Brien - (src)

-
-
- -
- - - 2 - - - 18 - - -

新任 committer: - Lorenzo Salvadore - (ports)

-
-
- - - 10 - - -

新任 committer: - Ryan Moeller - (src)

-
-
- -
- - - 1 - - - 27 - - -

新任 committer: - Alfredo Dal'Ava Júnior - (src)

-
- - - 2019 第四季開發進度報告發布 - -

- 2019 第四季開發進度報告現已發布。

-
-
- - - 21 - - - 以 Weblate 翻譯 FreeBSD 官方文件與書籍 - -

為了讓新貢獻者翻譯 - FreeBSD - 官方文件與書籍 的過程更平易近人,本計畫採用 - Weblate - 做為網頁翻譯平台。

- -

本工具已由部分翻譯團隊 (pt_BR、 es_ES 和 zh_CN) 使用數個月。 - 由於有優異的成果和成熟的工作流程,我們決定採用它。 - 我們相信我們已經準備好啟用此平台給新協同翻譯者使用。

- -

採用這個新工具後,翻譯過程變得很簡單, - 想貢獻的任何人都可以花個幾分鐘貢獻翻譯!

- -

如果您有興趣藉由翻譯官方文件貢獻文件計畫,您可以在 - - wiki 和 freebsd-translators 郵件論壇的 - 公告 獲得更多訊息。

-
-
- - - 10 - - -

新任 committer: - Mikaël Urankar - (ports)

-
-
- - - 2 - - -

新任 committer: - Loïc Bartoletti - (ports)

-
-
- -
- -
- - - 2019 - - - 11 - - - 25 - - - 2019 第三季開發進度報告發布 - -

- 2019 第三季開發進度報告現已發布。

-
-
- - - 4 - - - &os; 12.1-RELEASE 發布了 - -

FreeBSD - 12.1-RELEASE現已發布了。安裝前,請查看發布通知發行勘誤以了解12.1的最新消息和問題。更多資訊可查看發行版資訊頁面。

-
-
-
- - - 10 - - - 18 - - - &os; 12.1-RC2 發布了 - -

&os; 12.1 的第二個候選發布版本現已發布。 - 用於amd64、armv6、armv7、arm64、i386、powerpc、powerpc64、powerpcspe - 和sparc64 的ISO 映像檔案已經發布 - ,可以在多數的&os; - 鏡像站取得。

-
-
- - - 11 - - - &os; 12.1-RC1 發布了 - -

&os; 12.1 的第一個候選發布版本現已發布。 - 用於amd64、armv6、armv7、arm64、i386、powerpc、powerpc64、powerpcspe - 和sparc64 的ISO 映像檔案已經發布 - ,可以在多數的&os; - 鏡像站取得。

-
- - -

新任 committer: - Alex Samorukov - (ports)

-
-
- - - - 4 - - - &os; 12.1-BETA3 發布了 - -

&os; 12.1 的第三個 BETA 版本現已發布。 - 用於amd64、armv6、armv7、arm64、i386、powerpc、powerpc64、powerpcspe和sparc64 - 的ISO 映像檔案已經發布 - ,可以在多數的&os; - 鏡像站取得。

-
-
-
- - - 9 - - - 28 - - - &os; 12.1-BETA2 發布了 - -

&os; 12.1 的第二個 BETA 版本現已發布。 - 用於amd64、armv6、armv7、arm64、i386、powerpc、powerpc64、powerpcspe和sparc64 - 的ISO 映像檔案已經發布 - ,可以在多數的&os; - 鏡像站取得。

-
-
- - - 26 - - -

新任 committer: - Pawel Biernacki - (src)

-
-
- - - 20 - - - &os; 12.1-BETA1 發布了 - -

&os; 12.1 的第一個 BETA 版本現已發布。 - 用於amd64、armv6、armv7、arm64、i386、powerpc、powerpc64、powerpcspe和sparc64 - 的ISO 映像檔案已經發布 - ,可以在多數的&os; - 鏡像站取得。

-
-
- - - 15 - - -

新任 committer: - Dmitri Goutnik - (ports)

-
-
- - - 10 - - -

新任 committer: - Stephen Gregoratto - (src). 從事 - - Google's Season of Docs 之 FreeBSD 計畫使用者手冊的改善工作。

-
-
-
- - - 8 - - - 28 - - -

新任 committer: - Santhosh Raju - (ports)

-
-
- - - 25 - - - 2019 第二季開發進度報告發布 - -

- 2019 第二季開發進度報告現已發布。

-
-
-
- - - 7 - - - 16 - - - &os;.org 外寄郵件系統變更 - -

由於我們無法控制的情況,我們需要變更 - &os;.org 郵件的外寄 SMTP 伺服器位址。 - 我們了解到會因為 SMTP 寄件者信譽系統而遭遇一些挑戰

- -

更多資訊,請見 - 此公告

-
-
- - - 9 - - - &os; 11.3-RELEASE 發布了 - -

FreeBSD - 11.3-RELEASE現已發布了。安裝前,請查看發布通知發行勘誤以了解11.3的最新消息和問題。更多資訊可查看發行版資訊頁面。

-
-
-
- - - 6 - - - 28 - - - &os; 11.3-RC3 發布了 - -

&os; 11.3 的第三個候選發布版本現已發布。 - 用於amd64、armv6、arm64、i386、powerpc、powerpc64和sparc64 - 的ISO 映像檔案已經發布 - ,可以在多數的&os; - 鏡像站取得。

-
-
- - - 21 - - - &os; 11.3-RC2 發布了 - -

&os; 11.3 的第二個候選發布版本現已發布。 - 用於amd64、armv6、arm64、i386、powerpc、powerpc64和sparc64 - 的ISO 映像檔案已經發布 - ,可以在多數的&os; - 鏡像站取得。

-
-
- - - 14 - - - &os; 11.3-RC1 發布了 - -

&os; 11.3 的第一個候選發布版本現已發布。 - 用於amd64、armv6、arm64、i386、powerpc、powerpc64和sparc64 - 的ISO 映像檔案已經發布 - ,可以在多數的&os; - 鏡像站取得。

-
-
- - - 7 - - - &os; 11.3-BETA3 發布了 - -

&os; 11.3 的第三個 BETA 版本現已發布。 - 用於amd64、armv6、arm64、i386、powerpc、powerpc64和sparc64 - 的ISO 映像檔案已經發布 - ,可以在多數的&os; - 鏡像站取得。

-
-
- - - 4 - - - 2019 第一季開發進度報告發布 - -

- 2019 第一季開發進度報告現已發布。

-
-
-
- - - 5 - - - 31 - - - &os; 11.3-BETA2 發布了 - -

&os; 11.3 的第二個 BETA 版本現已發布。 - 用於amd64、armv6、arm64、i386、powerpc、powerpc64和sparc64 - 的ISO 映像檔案已經發布 - ,可以在多數的&os; - 鏡像站取得。

-
- - -

新任 committer: - Brandon Bergren - (src)

-
-
- - - 24 - - - &os; 11.3-BETA1 發布了 - -

&os; 11.3 的第一個 BETA 版本現已發布。 - 用於amd64、armv6、arm64、i386、powerpc、powerpc64和sparc64 - 的ISO 映像檔案已經發布 - ,可以在多數的&os; - 鏡像站取得。

-
-
- - - 16 - - -

新任 committer: - Sergio Carlavilla Delgado - (docs, Spanish translator) -

-
-
-
- - - 4 - - - 30 - - -

新任 committer: - Doug Moore - (src)

-
-
- - - 28 - - - <a - href="https://lists.freebsd.org/pipermail/freebsd-pkgbase/2019-April/000396.html">CFT - FreeBSD pkg base</a> 現已發布 - -

FreeBSD 正在測試新的 pkgbase。詳情請見CFT - FreeBSD pkg base

-
-
- - - 27 - - - <a href="https://www.research.net/r/freebsd2019">FreeBSD 2019 - 社群調查</a>現已公布 - -

FreeBSD 2019 - 社群調查現已公布。歡迎與您的雇主、同事、朋友或是任何對 FreeBSD 有興趣的社群成員分享調查連結。 - 調查將於5月13日 UTC 時間午夜結束。

-
-
- - - 19 - - - <a - href="https://lists.freebsd.org/pipermail/freebsd-stable/2019-April/090915.html">CFT - FreeBSD + 新的 ZFS 上游 (ZoL)</a> - -

FreeBSD 正在測試新的 ZFS 實作的上游 - ZFS on Linux。 - 測試 FreeBSD + ZoL (ZFS on Linux) 的 FreeBSD 12-STABLE and 13-CURRENT 映像檔現已發布。 - 測試細節請見 - CFT - FreeBSD + ZoL

-
-
- - - 14 - - -

新任 committer: - Piotr Kubaj - (ports)

-
- - -

增加提交權限: - Pedro Giffuni - (ports, src)

-
-
- -
- - - 3 - - - 20 - - -

新任 committer: - Mitchell Horne - (src)

-
-
-
- - - 2 - - - 1 - - -

新任 committer: - Kai Knoblich - (ports)

-
- -
- -
- - - 1 - - - 19 - - -

新任 committer: - Johannes Lundberg - (src)

-
- -
-
- -
- - - 2018 - - - 12 - - - 24 - - - 2018 第一至三季開發進度報告發布 - -

- 2018 第一至三季開發進度報告現已發布。

-
-
- - - 11 - - - &os; 12.0-RELEASE 發布了 - -

FreeBSD - 12.0-RELEASE現已發布了。安裝前,請查看發布通知發行勘誤以了解12.0的最新消息和問題。更多資訊可查看發行版資訊頁面。

-
- - - Cirrus CI 支援 &os; - -

Cirrus CI 系統最近增加 &os; 支援。 - Cirrus CI 藉由現代雲端技術使您的開發週期更快速、有效和安全。 - Cirrus CI 和您的團隊一起擴展,讓軟體的傳送更快速和經濟。 - 更多詳情請參閱 &os; 虛擬機器 - 指引。

-
-
- - - 1 - - - &os; 12.0-RC3 發布了 - -

&os; 12.0 的第三個候選發布版本現已發布。 - 用於amd64、armv6、armv7、arm64、 - i386、powerpc、powerpc64、powerpcspe和sparc64 - 的ISO 映像檔案已經發布 - ,可以在多數的&os; - 鏡像站取得。

-
-
-
- - - 11 - - - 25 - - - &os; 12.0-RC2 發布了 - -

&os; 12.0 的第二個候選發布版本現已發布。 - 用於amd64、armv6、armv7、arm64、 - i386、powerpc、powerpc64、powerpcspe和sparc64 - 的ISO 映像檔案已經發布 - ,可以在多數的&os; - 鏡像站取得。

-
-
- - - 17 - - - &os; 12.0-RC1 發布了 - -

&os; 12.0 的第一個候選發布版本現已發布。 - 用於amd64、armv6、armv7、arm64、 - i386、powerpc、powerpc64、powerpcspe和sparc64 - 的ISO 映像檔案已經發布 - ,可以在多數的&os; - 鏡像站取得。

- -
-
- - - 10 - - - &os; 12.0-BETA4 發布了 - -

&os; 12.0的第四個 BETA 版本現已發布。 - 用於amd64、armv6、armv7、arm64、 - i386、powerpc、powerpc64、powerpcspe和sparc64 - 的ISO 映像檔案已經發布 - ,可以在多數的&os; - 鏡像站取得。

-
-
- - - 3 - - - &os; 12.0-BETA3 發布了 - -

&os; 12.0的第三個 BETA 版本現已發布。 - 用於amd64、armv6、armv7、arm64、 - i386、powerpc、powerpc64、powerpcspe和sparc64 - 的ISO 映像檔案已經發布 - ,可以在多數的&os; - 鏡像站取得。

-
-
-
- - - 10 - - - 27 - - - &os; 12.0-BETA2 發布了 - -

&os; 12.0的第二個 BETA 版本現已發布。 - 用於amd64、armv6、armv7、arm64、 - i386、powerpc、powerpc64、powerpcspe和sparc64 - 的ISO 映像檔案已經發布 - ,可以在多數的&os; - 鏡像站取得。

-
-
- - - 20 - - - &os; 12.0-BETA1 發布了 - -

&os; 12.0的第一個 BETA 版本現已發布。 - 用於amd64、armv6、armv7、arm64、 - i386、powerpc、powerpc64、powerpcspe和sparc64 - 的ISO 映像檔案已經發布 - ,可以在多數的&os; - 鏡像站取得。

-
-
- - - 16 - -

新任 committer: - Thomas Munro - (src)

-
-
- - - 9 - -

新任 committer: - Yuri Pankov - (src)

-
-
- - - 8 - -

新任 committer: - Vinícius Zavam - (ports)

-
-
- - - 1 - -

新任 committer: - Alexandre C. Guimaraes - (ports)

-
-
- -
- - - 9 - - - 21 - -

新任 committer: - Sergey Kozlov - (ports)

-
-
- - - 6 - -

新任 committer: - Emmanuel Vadot - (ports)

-
-
- - - 2 - -

新任 committer: - Kevin Bowling - (ports)

-
-
-
- - - 8 - - - 9 - - -

增加提交權限: - Li-Wen Hsu - (ports, src)

-
-
-
- - - 7 - - - 16 - - -

新任 committer: - John Hixson - (ports)

-
-
- - - 4 - - - 新任 &os; Core Team 已選出 - -

計畫的 active committers 已選出第十屆的 - &os; Core Team。詳情請見 - 官方公告

-
-
- - - 6 - - - 30 - - -

新任 committer: - Jesper Schmitz Mouridsen - (ports)

-
-
- - - 27 - - - &os; 11.2-RELEASE 發布了 - -

FreeBSD - 11.2-RELEASE現已發布了。安裝前,請查看發布通知發行勘誤以了解11.2的最新消息和問題。更多資訊可查看發行版資訊頁面。

-
-
- - - 19 - - - 國家 &os; 日: &os; 今天 25 歲了 - ! - -

&os; 這個名字在 1993 年 6 月 19 - 日正式確定並使用至今。 了解更多 - 關於如何和我們一起慶祝這個重要的日子。

-
-
- - - 16 - - - &os; 11.2-RC3 發布了 - -

&os; 11.2 的第三個候選發布版本現已發布。 - 用於amd64、armv6、arm64、 - i386、powerpc、powerpc64和sparc64 - 的ISO 映像檔案已經發布 - ,可以在多數的&os; - 鏡像站取得。

-
- - -

新任 committer: - Mateusz Piotrowski - (ports)

-
-
- - - 9 - - - &os; 11.2-RC2 發布了 - -

&os; 11.2 的第二個候選發布版本現已發布。 - 用於amd64、armv6、arm64、 - i386、powerpc、powerpc64和sparc64 - 的ISO 映像檔案已經發布 - ,可以在多數的&os; - 鏡像站取得。

-
-
- - - 8 - - - 服務中斷 - -

部分 &os; 叢集將於六月九日星期六因電力工程維護而離線。 - 服務將受到影響,特別是郵件論壇與我們的部分網站服務。

- -

維護時段自六月九日 11:00 UTC (04:00 US-Pacific) 至 20:00 UTC (13:00 US-Pacific)

-
-
- - - 2 - - - &os; 11.2-RC1 發布了 - -

&os; 11.2 的第一個候選發布版本現已發布。 - 用於amd64、armv6、arm64、 - i386、powerpc、powerpc64和sparc64 - 的ISO 映像檔案已經發布 - ,可以在多數的&os; - 鏡像站取得。

-
-
-
- - - 5 - - - 26 - - - &os; 11.2-BETA3 發布了 - -

&os; 11.2的第三個 BETA 版本現已發布。 - 用於amd64、armv6、arm64、 - i386、powerpc、powerpc64和sparc64 - 的ISO 映像檔案已經發布 - ,可以在多數的&os; - 鏡像站取得。

-
-
- - - 22 - -

新任 committer: - Breno Leitao - (src)

-
-
- - - 21 - - -

新任 committer: - Leandro Lupori - (src)

-
-
- - - 19 - - - &os; 11.2-BETA2 發布了 - -

&os; 11.2的第二個 BETA 版本現已發布。 - 用於amd64、armv6、arm64、 - i386、powerpc、powerpc64和sparc64 - 的ISO 映像檔案已經發布 - ,可以在多數的&os; - 鏡像站取得。

-
-
- - - 15 - - -

新任 committer: - Gleb Popov - (ports)

-
-
- - - 12 - - - &os; 11.2-BETA1 發布了 - -

&os; 11.2的第一個 BETA 版本現已發布。 - 用於amd64、armv6、arm64、 - i386、powerpc、powerpc64和sparc64 - 的ISO 映像檔案已經發布 - ,可以在多數的&os; - 鏡像站取得。

-
-
-
- - - 4 - - - 17 - - -

新任 committer: - Sean Eric Fagan - (src)

-
-
- - - 7 - - -

新任 committer: - Tom Jones - (src)

-
-
- - - 4 - - -

新任 committer: - Ram Kishore Vegesna - (src)

-
-
-
- - - 3 - - - 23 - - -

新任 committer: - Matthias Fechner - (ports)

-
-
- - - 17 - - -

新任 committer: - Eric Turgeon - (ports)

-
-
- - 16 - - -

新任 committer: - Vincenzo Maffione - (src)

-
-
- - - 14 - - -

新任 committer: - Koichiro Iwao - (ports)

-
-
- - - 3 - - -

新任 committer: - Fernando Apesteguia - (ports)

-
-
- - - 1 - - -

新任 committer: - Devin Teske - (ports)

-
-
-
- - - 2 - - - 14 - - - FreeBSD 計畫參加 Google Summer of Code 2018 - -

FreeBSD 計畫開心地宣佈參加 Google 的 2018 年 Summer of Code 計畫,補助暑期學生加入許多開源項目。這將是 FreeBSD 專案加入這個計畫的第 14 年,在 2005 年到 2017 年之間已經透過暑期程式設計專案指導超過 210 名成功的學生。

- -

過去成功的項目包含改進 Linux ABI 模擬、NFSv4 ACLs、TCP 迴歸測試、FUSE 檔案系統支援以及其他無數個項目。 - 許多學生繼而成為 FreeBSD 開發人員,也透過 FreeBSD 基金會的持續協助參加世界各地的 FreeBSD 開發者活動。

- -

邀請未來的參加者來參加;更多資訊,包含提案與截止日期資訊在FreeBSD 暑期計畫頁面。

-
-
- - - 8 - - -

新任 committer: - Slava Shwartsman - (src)

-
-
-
- - - 1 - - 4 - - - - 關於 Meltdown 和 Spectre 攻擊 - -

關於 Meltdown - 和 Spectre 攻擊: - &os; 在 2017 年十二月下旬已經意識到這個問題。 - 我們正在與 CPU 製造商和已發布的論文努力來減輕這類攻擊對 &os; 的影響。 - 因為此次攻擊手法利用到 CPU 與作業系統互動的一些根本、關鍵機制, - 因此對應修正的發布時間未定。

-
-
-
- -
- - - 2017 - - - 12 - - - 25 - - - 2017 第三季開發進度報告發布 - -

- 2017 第三季開發進度報告現已發布。

-
-
-
- - 11 - - - 11 - - -

新任 committer: - Jason W. Bacon - (ports)

-
-
-
- - - 10 - - - 30 - - -

新任 committer: - Alex Richardson - (src)

-
-
- - - 29 - - -

新任 committer: - Yuri Victorovich - (ports)

-
-
- - - 4 - - - &os; 10.4-RELEASE 發布了 - -

FreeBSD - 10.4-RELEASE現已發布了。安裝前,請查看發布通知發行勘誤以了解10.4的最新消息和問題。更多資訊可查看發行版資訊頁面。

-
-
-
- - - 9 - - - 27 - - - 2017 第二季開發進度報告發布 - -

- 2017 第二季開發進度報告現已發布。

-
-
- - - 23 - - - &os; 10.4-RC2 發布了 - -

&os; 10.4 的第二個候選發布版本現已發布。 - 用於 amd64、armv6,i386、ia64、powerpc、powerpc64 和 sparc64 的 ISO 映像檔案 - 已經發布 - ,可以在多數的&os; - 鏡像站取得。

-
-
- - - 19 - - -

新任 committer: - Eugene Grosbein - (src)

-
-
- - - 18 - - -

新任 committer: - Guangyuan Yang - (doc)

-
-
- - - 17 - - - &os; 10.4-RC1 發布了 - -

&os; 10.4 的第一個候選發布版本現已發布。 - 用於 amd64、armv6,i386、ia64、powerpc、powerpc64 和 sparc64 的 ISO 映像檔案 - 已經發布 - ,可以在多數的&os; - 鏡像站取得。

-
-
- - - 11 - - -

新任 committer: - Craig Leres - (ports)

-
-
- - - 9 - - -

新任 committer: - Dave Cottlehuber - (ports)

-
- - - &os; 10.4-BETA4 發布了 - -

&os; 10.4的第四個 BETA 版本現已發布。 - 用於amd64、armv6、 - i386、aarch64、powerpc、powerpc64和sparc64 - 的ISO 映像檔案已經發布 - ,可以在多數的&os; - 鏡像站取得。

-
-
- - - 8 - - -

新任 committer: - Adriaan de Groot - (ports)

-
-
- - - 6 - - -

新任 committer: - Chuck Tuffli - (src)

-
-
- - - 2 - - -

新任 committer: - Stephen Hurd - (src)

-
- - - &os; 10.4-BETA3 發布了 - -

&os; 10.4的第三個 BETA 版本現已發布。 - 用於amd64、armv6、 - i386、aarch64、powerpc、powerpc64和sparc64 - 的ISO 映像檔案已經發布 - ,可以在多數的&os; - 鏡像站取得。

-
- - -

新任 committer: - Ilya Bakulin - (src)

-
- -
- -
- - - 8 - - - 28 - - -

新任 committer: - Fedor Uporov - (src)

-
-
- - - 26 - - - &os; 10.4-BETA2 發布了 - -

&os; 10.4的第二個 BETA 版本現已發布。 - 用於amd64、armv6、 - i386、aarch64、powerpc、powerpc64和sparc64 - 的ISO 映像檔案已經發布 - ,可以在多數的&os; - 鏡像站取得。

-
-
- - - 25 - - -

新任 committer: - Luca Pizzamiglio - (ports)

-
-
- - - 19 - - - &os; 10.4-BETA1 發布了 - -

&os; 10.4的第一個 BETA 版本現已發布。 - 用於amd64、armv6、 - i386、aarch64、powerpc、powerpc64和sparc64 - 的ISO 映像檔案已經發布 - ,可以在多數的&os; - 鏡像站取得。

-
-
- -
- - 7 - - - 26 - - - &os; 11.1-RELEASE 發布了 - -

FreeBSD - 11.1-RELEASE現已發布了。安裝前,請查看發布通知發行勘誤以了解11.1的最新消息和問題。更多資訊可查看發行版資訊頁面。

-
-
- - - 18 - - -

新任 committer: - Marcin Wojtas - (src)

-
-
- - 15 - - - &os; 11.1-RC3 發布了 - -

&os; 11.1 的第三個候選發布版本現已發布。 - 用於 amd64、armv6,i386、aarch64、powerpc、powerpc64 和 sparc6 的 ISO 映像檔案 - 已經發布 - ,可以在多數的&os; - 鏡像站取得。

-
-
- - - 12 - - -

新任 committer: - Matt Joras - (src)

-
-
- - 8 - - - &os; 11.1-RC2 發布了 - -

&os; 11.1 的第二個候選發布版本現已發布。 - 用於 amd64、armv6,i386、aarch64、powerpc、powerpc64 和 sparc6 的 ISO 映像檔案 - 已經發布 - ,可以在多數的&os; - 鏡像站取得。

-
-
- - - 1 - - - &os; 11.1-RC1 發布了 - -

&os; 11.1 的第一個候選發布版本現已發布。 - 用於 amd64、armv6,i386、aarch64、powerpc、powerpc64 和 sparc6 的 ISO 映像檔案 - 已經發布 - ,可以在多數的&os; - 鏡像站取得。

-
-
-
- - - 6 - - - 24 - - - &os; 11.1-BETA3 現已發布 - -

&os; 11.1的第三個 BETA 版本現已發布。 - 用於amd64、armv6、 - i386、aarch64、powerpc、powerpc64和sparc64 - 的ISO 映像檔案已經發布 - ,可以在多數的&os; - 鏡像站取得。

-
-
- - - 20 - - -

新任 committer: - Kyle Evans - (src)

-
-
- - - 17 - - - &os; 11.1-BETA2 現已發布 - -

&os; 11.1的第二個 BETA 版本現已發布。 - 用於amd64、armv6、 - i386、aarch64、powerpc、powerpc64和sparc64 - 的ISO 映像檔案已經發布 - ,可以在多數的&os; - 鏡像站取得。

-
-
- - - 10 - - - &os; 11.1-BETA1 現已發布 - -

&os; 11.1的第一個 BETA 版本現已發布。 - 用於amd64、armv6、 - i386、aarch64、powerpc、powerpc64和sparc64 - 的ISO 映像檔案已經發布 - ,可以在多數的&os; - 鏡像站取得。

-
-
- - - 7 - - -

新任 committer: - Ryan Libby - (src)

-
-
- -
- - - 5 - - - 31 - - -

新任 committer: - Richard Gallamore - (ports)

-
-
- - - 16 - - -

新任 committer: - Jochen Neumeister - (ports)

-
-
- - - 15 - - - 2017 第一季開發進度報告發布 - -

- 2017 第一季開發進度報告現已發布。

-
-
- - - 3 - - -

新任 committer: - Danilo G. Baio - (ports)

-
-
- -
- - - 4 - - - 27 - - -

新任 committer: - Vladimir Kondratyev - (src)

-
-
- - - 18 - - -

新任 committer: - Bradley T. Hughes - (ports)

-
-
- -
- - 3 - - - 4 - - -

新任 committer: - Eugene Grosbein - (ports)

-
-
- - - 3 - - -

回歸 committer: - Rodney W. Grimes - (src)

-
-
- -
- - 2 - - - 27 - - FreeBSD 計畫參加 Google Summer of Code 2017 - -

FreeBSD 計畫開心地宣佈參加 Google 的 2017 年 Summer of Code 計畫,補助暑期學生加入許多開源項目。這將是 FreeBSD 專案加入這個計畫的第 13 年,在 2005 年到 2016 年之間已經透過暑期程式設計專案指導超過 200 名成功的學生。

- -

過去成功的項目包含改進 Linux ABI 模擬、NFSv4 ACLs、TCP 迴歸測試、FUSE 檔案系統支援以及其他無數個項目。 - 許多學生繼而成為 FreeBSD 開發人員,也透過 FreeBSD 基金會的持續協助參加世界各地的 FreeBSD 開發者活動。

- -

邀請未來的參加者來參加;更多資訊,包含提案與截止日期資訊在FreeBSD 暑期計畫頁面。

-
-
- - 13 - - - 2016 第四季開發進度報告發布 - -

- 2016 第四季開發進度報告現已發布

-
-
- - - 10 - - -

新任 committer: - Mahdi Mokhtari - (ports)

-
-
- - 10 - - -

新任 committer: - Mahdi Mokhtari - (ports)

-
-
- - 8 - - -

新任 committer: - Tobias Kortkamp - (ports)

-
-
-
- - 1 - - - 10 - - -

增加提交權限: - Jean-Sébastien Pédron - (ports)

-
-
- - - 9 - - -

新任 committer: - Matthew Rezny - (ports)

-
- - -

新任 committer: - Larry Rosenman - (ports)

-
- - -

新任 committer: - Johannes Dieterich - (ports)

-
-
-
-
- - - 2016 - - - 12 - - - 11 - - -

新任 committer: - Piotr Paweł Stefaniak - (src)

-
- - -

新任 committer: - Nikolai Lifanov - (ports)

-
-
-
- - - 11 - - - 15 - - -

新任 committer: - Mikhail Pchelin (ports)

-
-
- - - - 13 - - - 2016 第三季開發進度報告發布 - -

- 2016 第三季開發進度報告現已發布

-
-
- - - 2 - - -

新任 committer: - Konrad Witaszczyk (src)

-
-
-
- - - 10 - - - 22 - - -

新任 committer: - David Bright (src)

-
-
- - - 10 - - - &os; 11.0-RELEASE 發布了 -

FreeBSD 11.0-RELEASE現已發布了。安裝前,請查看 發布通知發行勘誤 以了解 11.0的最新消息和問題。更多資訊可查看發行版資訊頁面

-
-
- -
- - - 9 - - - 16 - - -

新任 committer: - Sevan Janiyan - (doc)

-
-
- - - 28 - - - &os; 11.0-RELEASE 進度更新 - -

為了處理一些發布時最新更新的項目,最終的 11.0-RELEASE 將重新建構。 - 更多資訊請參見發行工程團隊的 官方公告 - 。 -

-
-
- - - 17 - - -

新任 committer: - Ruey-Cherng Yu - (doc)

-
- - -

新任 committer: - Joseph Mingrone - (ports)

-
- - - &os; 11.0-RC3 發布了 - -

&os; 11.0 的第三個候選發布版本現已發布。 - 用於 amd64、armv6,i386、aarch64、powerpc、powerpc64 和 sparc6 的 ISO 映像檔案 - 已經發布, - 可以在多數的&os; - 鏡像站取得

-
-
-
-
- - - 2006 - - 12 - - - 27 - -

New committer: Jordan Sissel - (src)

-
- - - FreeBSD 6.2-RC2 Available - -

FreeBSD 6.2 的第二個候選發布版本現已 發布。 - 用於 Tier-1 平台的 ISO 映像檔案,已可以透過眾多的 - - FreeBSD 鏡像站點 獲得。

-
-
- - - 26 - -

新增 committer:劉棟 - (ports)

-
-
- - - 22 - -

新增 committer:Juergen Lock - (ports)

-
-
- - - 10 - - 對 FreeBSD 開發人員 Joseph Koshy 的 Podcast 訪談 - -

在最新一期 bsdtalk - podcast 中,Will Backman 就 FreeBSD 開發人員 Joseph Koshy - 近期在 libElf 上所做的工作進行了訪談。 這期 podcast 可以透過 - - http://cisx1.uma.maine.edu/~wbackman/bsdtalk/bsdtalk087.mp3 收聽。

-
-
- - - 7 - - 對 FreeBSD 開發人員 Kip Macy 的 Podcast 訪談 - -

在最新一期 bsdtalk - podcast 中,Will Backman 就近期 FreeBSD/sun4v - 的移植進展,對 FreeBSD 開發人員 Joseph Koshy 進行了採訪。 這期 podcast 可以透過 - - http://cisx1.uma.maine.edu/~wbackman/bsdtalk/bsdtalk086.mp3 收聽。

-
-
- - - 5 - -

新增 committer:Nicola Vitale - (ports)

-
- - -

新增 committer:Gábor Kövesdán - (ports)

-
-
- - - 1 - - 對 FreeBSD 開發人員 Tom McLaughlin 的 Podcast 訪談 - -

在最新一期 bsdtalk - podcast 中,Will Backman 就 BSD# 計畫和 FreeBSD 上的 Mono - 對 FreeBSD 開發人員 Tom McLaughlin 進行了採訪。 這期 podcast 可以透過 - - http://cisx1.uma.maine.edu/~wbackman/bsdtalk/bsdtalk085.mp3 收聽。

-
-
-
- - - 11 - - - 29 - -

新增 committer:David Thiel - (ports)

-
- - - 對 FreeBSD release engineer馬源浩的 Podcast 訪談 - -

在最新一期 bsdtalk - podcast 中,Will Backman 就將要發布的 FreeBSD 6.2 版對release engineer馬源浩 (Bruce - Mah) 進行了採訪。 這期 podcast 可以透過 - - http://cisx1.uma.maine.edu/~wbackman/bsdtalk/bsdtalk084.mp3 收聽

-
-
- - - 17 - - FreeBSD 6.2-RC1 發布了 - -

FreeBSD 6.2 的第一個候選發布版本現已 發布。 - 用於 Tier-1 平台的 ISO 映像檔案,已可透過眾多的 - - FreeBSD 鏡像站點 獲得。

-
-
- - - 16 - - FreeBSD 基金會秋季募捐 - -

FreeBSD 基金會 - 正在舉行 秋季募捐。 - 本次募捐將在很大程度上影響明年基金會的預算。

-
-
- - - 14 - - FreeBSD.org 系統搬移推遲 - -

計劃於 11 月 13 日 (周一) 進行的 FreeBSD.org 系統搬移工作因故推遲。 - 目前的最新計畫是於美國太平洋時間 11 月 17 日 (周五) 進行此項工作。

-
-
- - - 12 - - FreeBSD/sun4v 安裝 / Live CD 發布了 - -

在 Sun 的 UltraSparc-T1 架構上的 FreeBSD 移植工作目前已經取得了階段性的進展, - 我們制作了一張包含現場檔案系統的安裝 ISO。 更多細節請參見 - FreeBSD/sun4v 計畫專頁

-
- - -

新增 committer:Jeremy Chadwick - (ports)

-
-
- - - 7 - -

新增 committer:Babak Farrokhi - (ports)

-
- - -

新增 committer:Frank J. Laszlo - (ports)

-
-
- - - 5 - - FreeBSD.org 系統遷移 - -

用於提供 FreeBSD Project 郵件、web、CVS 等的 FreeBSD.org 伺服器, - 即將遷移到新的數據中心。 我們計劃在 11 月 13 日周一 (美國太平洋標準時間) - 進行本次遷移。

- -

本次搬移的準備過程可能導致 FreeBSD.org 在最終完成遷移之前出現短暫的服務停止。 - 在搬移的當天,只有靜態的部分 (例如,純 HTML 頁面,而不包括 CGI) 的 http://www.FreeBSD.org/ - 會提供服務。

-
-
-
- - - 10 - - - 31 - - FreeBSD 6.2-BETA3 發布了 - -

FreeBSD 6.2 的第三個 beta 版本現已 發布。 - 用於 Tier-1 平台的 ISO 映像檔案,已可以透過眾多的 - - FreeBSD 鏡像站點 獲得。

-
-
- - - 25 - - Summer of Code 計畫結項了 - -

我們非常高興全部 14 位學生都成功地完成了他們的 FreeBSD Summer of - Code 計畫。 在此祝賀參與計畫的導師和學生,並感謝 Google 運營此項活動, - 並為其提供資金贊助。

- -
-
- - - 19 - - 2006 年第三季度開發進度報告 - -

2006 年第三季度開發進度報告 現已發表,其中介紹了 49 項內容。

-
-
- - - 14 - - 用於 FreeBSD 的 GNOME 2.16.1 發布了 - -

GNOME 2.16.1 已經發布,並已合併到了 FreeBSD - ports tree。 請訪問 - FreeBSD GNOME 主頁 - 以查看正式的公告,以及重要的 - 升級指南

-
-
- - - 8 - -

新增 committer:Shteryana Shopova - (src)

-
-
- - - 5 - - FreeBSD 6.2-BETA2 發布了 - -

FreeBSD 6.2 的第二個 beta 版本現已 發布。 - 用於 Tier-1 平台的 ISO 映像檔案,已可以透過眾多的 - - FreeBSD 鏡像站點 獲得。

-
-
-
- - 9 - - - 28 - -

新增 committer:Soeren Straarup (ports)

-
-
- - - 21 - -

新增 committer:Jack F. Vogel - (src)

-
- - - FreeBSD 6.2-BETA1 發布了 - -

FreeBSD 6.2 的第一個 beta 版本現已 發布。 - 本次 BETA1 的 ISO 映像檔案,已可以透過眾多的 - - FreeBSD 鏡像站點 獲得。

-
-
- - - 20 - -

新增 committer:黃青山 - (doc)

-
-
- - - 18 - -

新增 committer:Stanislav Sedov - (ports)

-
-
- - - 12 - -

新增 committer:Alexander Botero-Lowry - (ports)

-
-
- - - 1 - -

新增 committer:Randall R. Stewart - (src)

-
-
-
- - 8 - - - 20 - -

新增 committer:Daniel - Geržo (doc)

-
-
-
- - - 7 - - 26 - - 選舉產生了新一屆 FreeBSD Core Team - -

FreeBSD Core Team 競選已經結束。 - 選舉結果已在 這裡 公布。 -

-
-
- - - 19 - - 對 FreeBSD 開發人員 Greg Lehey 的 Podcast 訪談 - -

在最新一期 bsdtalk - podcast 中,Will Backman 對 FreeBSD 開發人員 Greg Lehey - 就他在 FreeBSD 和 MySQL 上的工作進行了採訪。 這期 podcast 可以透過 - - http://cisx1.uma.maine.edu/~wbackman/bsdtalk/bsdtalk055.mp3 收聽。

-
-
- - - 18 - -

新增 committer:Jose Alonso Cardenas Marquez - (ports)

-
-
- - - 13 - - 對 FreeBSD 開發人員 Pawel Jakub Dawidek 的 Podcast 訪談 - -

在最新一期 bsdtalk - podcast 中,Will Backman 對 FreeBSD 開發人員 Pawel Jakub Dawidek - 就他在 FreeBSD 上的工作,特別是 GEOM 日志計畫進行了採訪。 這期 - podcast 可以透過 - http://cisx1.uma.maine.edu/~wbackman/bsdtalk/bsdtalk052.mp3 收聽。

-
-
- - - 12 - - 2006 年第二季度開發進度報告發布了 - -

2006 年第二季度的開發進度報告 現已發布, - 其中介紹了 39 項內容。

-
-
- - - 5 - - FreeBSD 基金會發布了用於 FreeBSD 5.5、6.1 以及 AMD64 平台的預編譯 Java - -

FreeBSD 基金會現已開始提供基於 Sun Microsystems UPDATE7 的專用於 FreeBSD - 的預編譯版本 Java JDK 和 JRE 1.5。 欲了解更多詳情, - 請參見 FreeBSD 基金會 - 發布的新聞

-
-
-
- - - 6 - - - 24 - -

- 新增 committer:範榮恩 - (ports) -

-
-
- - - 21 - -

- 新增 committer:Boris Samorodov - (ports) -

-
-
- - - 19 - -

新增 committer:Shaun Amott - (ports)

-
-
- - - 5 - -

新增 committer:Konstantin Belousov - (src)

-
- - -

新增 committer:Martin Wilke - (ports)

-
-
-
- - - 5 - - 30 - - 在校生計畫資助計畫公告 - -

The FreeBSD Project 收到了超過 120 份 Google's - Summer of Code 計畫計畫申請,並從中選出了 14 個進行資助。 - 非常遺憾的是,第一流的申請遠遠超出了學生的名額。 不過, - 我們鼓勵在校生繼續與我們一起工作。 The FreeBSD Project - 一直都希望能夠透過我們的郵件列表和開發論壇, - 幫助帶領學生了解更多關於操作系統開發。 為開源軟體計畫提供幫助, - 是 Computer Scienc 教育中的重要一環, - 同時也是軟體開發職業生涯的一項絕佳的準備條件。

- -

選出的完整的學生和計畫名單可以在 這裡 找到。 Summer of Code wiki 也提供了更多的細節資訊。

-
- - - 新增 committer:<a - href="mailto:piso@FreeBSD.org">Paolo Pisati</a> - (src)。 前 SoC2005 計畫成員。 - -

Paolo Pisati, - 去年 Summer of Code 計畫的獲選學生,仍在繼續參加 FreeBSD Project - 並成為了正式的 src/ committer。

- -
-
- - - 26 - - 對 FreeBSD 開發者 Poul-Henning Kamp 的 Podcast 訪談 - -

在最新的 bsdtalk - podcast 中,Will Backman 就 FreeBSD 上的開發活動採訪了 FreeBSD - 開發者 Poul-Henning Kamp。 這期 podcast 可以透過 - http://cisx1.uma.maine.edu/~wbackman/bsdtalk/bsdtalk048.mp3 收聽。

-
-
- - - 25 - - FreeBSD 5.5-RELEASE 發布了 - -

FreeBSD - 5.5-RELEASE 發布了。 請查看 發行版勘誤 - 以了解最新發生的新聞和已知問題。 發行版資訊 - 網頁提供了關於 FreeBSD 發行版的進一步詳情。

-
-
- - - 21 - - FreeBSD 能夠在 Sun T1 處理器上獨立運行了 - -

FreeBSD 目前已經能夠在 採用 CoolThreads - 技術的 Sun T1 處理器 的電腦上完整地完成 - "make buildworld" 命令,從而達到了獨立運行的目標。 - 這些原始碼目前存放於 - FreeBSD 的 Perforce 版本控制系統 中, - 並將在對 logical domaining 的支持功能完成後,會合併回官方的 CVS repository。 - 開機過程的 log 檔可以在 這裡 找到。

-
-
- - - 17 - -

新增 committer:Thomas Wintergerst - (src)

-
-
- - - 16 - - - FreeBSD 5.5-RC1 發布了 - -

FreeBSD 5.5 的首個,同時也有望成為最終的發行候選版本 發布了。 - RC1 ISO 映像檔案,已經可以從眾多 - - FreeBSD 鏡像站點 獲得。

-
-
- - - 8 - - FreeBSD 6.1-RELEASE 發布了 - -

FreeBSD - 6.1-RELEASE 正式發布了。 在安裝前,請查看 發行版勘誤 - 以了解關於 6.1 最新的消息和已知問題。 在 發行版資訊 - 頁面上提供了關於 FreeBSD 發行版的進一步資訊。

-
- - - Summer of Code 申請最後期限延長 1 天 - -

Google 的 Summer - of Code 2006 活動的申請最後期限已延長至太平洋時間周二 - 11:00AM PDT。 關於 FreeBSD 專屬計畫以及候選導師的資訊可以在 here 找到。

-
- -
- - - 7 - -

新增 committer:Ion-Mihai Tetcu - (ports)

-
-
- - - 6 - -

新增 committer:Stefan Walter - (ports)

-
- - -

新增 committer:Andrew Pantyukhin - (ports)

-
-
- - - 2 - - - FreeBSD 6.1-RC2 發布了 - -

FreeBSD 6.1 的第二個,也應該是最後一個候選發行版 發布了。 - RC2 ISO 映像檔案,可以從眾多 - - FreeBSD 鏡像站點 獲得。

-
-
- - - 1 - - 開始接受 Summer of Code 計畫申請 - -

FreeBSD Project 現在開始接受先前宣布的 Google Summer - of Code 2006 計畫的計畫申請。 - 這個計畫將為在暑期為開源計畫提供幫助的學生提供資助。 - FreeBSD 專有的計畫以及潛在的導師名單,可以在 這裡 找到。

- -

如果找到了合適的計畫以及導師,則有興趣參與計畫的學生應完成申請, - 並提交給 Google。 這些申請的最後期限是太平洋日光時間 2006 年 - 5 月 8 日 17:00 (UTC 時間 2006 年 5 月 9 日午夜)。 獲贗的候選人, - 將在五月下旬宣布。 請參見 Student - FAQ 以了解進一步的資訊。

-
- - - 新增了用於 HighPoint RocketRAID 232x SATA RAID 控制器的驅動 - -

在 FreeBSD-CURRENT 以及 RELENG_6 和 RELENG_6_1 分支中, - 新增了 HighPoint 的 RocketRAID 232x 系列 SATA RAID 控制器驅動 rr232x(4)。 - 這一驅動將包含在將發布的 FreeBSD 6.1-RELEASE 版本中。

-
- - -

commit 權限提升:李鑫 - (src, doc, ports)

-
-
-
- - - 4 - - - 30 - -

新增 committer:Lars Balker Rasmussen - (ports)

-
-
- - - 15 - - 對 FreeBSD 開發者 Joe Marcus Clarke 的 Podcast 訪談 - -

在最新的 bsdtalk - podcast中,Will Backman 訪問了 FreeBSD 開發者 Joe Marcus Clarke, - 討論了與 FreeBSD 上的 GNOME 桌面環境有關的話題。 這期 podcast 可以從 - http://cisx1.uma.maine.edu/~wbackman/bsdtalk/bsdtalk032.mp3 下載。

-
-
- - - 14 - - 2006 年一至三月進度報告 - -

現在可以訪問包含 29 個計畫的 2006 年一至三月 進度報告 - 了。

-
- - - Summer of Code - -

FreeBSD Project 愉快地參加了 Google 的 - Summer - of Code 2006 計畫。 這一計畫將為在校生參與開源計畫提供資助。 - FreeBSD 專屬的計畫和導師候選人可以在 這裡 訪問。

-
-
- - - 13 - - FreeBSD 6.1-RC1 發布了 - -

FreeBSD 6.1 的第一個候選發行版 發布了。 - RC1 的 ISO 映像檔案可以從多數 - - FreeBSD 鏡像站點 獲得。

-
-
- - - 11 - - 新增了用於 Broadcom NetXtreme II 千兆以太網芯片的驅動 - -

在 FreeBSD-CURRENT 中新增了 bce(4),一個用於 - Broadcom NetXtreme II 系列千兆以太網控制芯片的驅動。 - 這一驅動將很快合併至 FreeBSD 6-STABLE 分支。

-
-
- - - 6 - - FreeBSD 基金會宣布用於 FreeBSD 的預編譯版本 Java JDK 和 JRE 1.5 - -

FreeBSD 基金會現在開始提供用於 FreeBSD 的預編譯版本 Java JDK 和 JRE - 1.5。 更多細節,請參見 - FreeBSD 基金會的 - 新聞稿

-
-
- - - 4 - -

新增 committer:Alejandro Pulver - (ports)

-
-
- - - 2 - -

新增 committer:Johan van Selst - (ports)

-
-
-
- - - 3 - - - 31 - -

新增 committer:Jean Milanez Melo - (ports)

-
-
- - - 15 - - FreeBSD 5.5-BETA4 和 6.1-BETA4 發布了 - -

FreeBSD 5.5 和 FreeBSD 6.1 的第四個 beta 版本 發布了。 - 這些 BETA4 ISO 映像檔案,可以在多數 - - FreeBSD 鏡像站點 上獲得。

-
-
-
- - - 2 - - - 22 - -

新增 committer: Wojciech A. Koszek - (src)

-
-
- - - 20 - - FreeBSD 5.5-BETA2 和 6.1-BETA2 發布了 - -

FreeBSD 5.5 和 FreeBSD 6.1 的第二個 BETA 版本現在 可用了。 - 對應的 BETA2 ISO 鏡像檔案可以從眾多 - - FreeBSD 鏡像站點 之一下載。

-
-
- - - 18 - - 對 FreeBSD 開發者 Kirk McKusick 的 Podcast 訪談 - -

在最新的 bsdtalk - podcast 中,Will Backman 訪問了 FreeBSD 開發者 Marshall Kirk - McKusick。 這期 podcast 可以從 - http://cisx1.uma.maine.edu/~wbackman/bsdtalk/bsdtalk018.mp3 - 下載。

-
-
- - - 17 - - 對 FreeBSD release engineer Scott Long 的 Podcast 訪談 - -

bsdtalk - 系列 podcast 的第 17 期中,Will Backman 訪問了 FreeBSD release engineer 之一的 - Scott Long,並就正在開發的 FreeBSD 5.5 和 6.1 版本, - 以及一些相關話題進行了討論。 這期 podcast 可以從 - http://cisx1.uma.maine.edu/~wbackman/bsdtalk/bsdtalk017.mp3 - 下載。 -

-
-
- - - 13 - -

新增 committer:Chuck Lever - (src)

-
- - - 即將進行的晚間 FreeBSD kernel code 導讀課程 - -

在 2006 年春季將舉辦 “FreeBSD Kernel Internals: An Intensive Code - Walkthrough” 課程。 這一課程將在具有歷史意義的 Hillside Club - 進行,其地址是 2286 Cedar Strett, Berkeley, CA 94709, - 從伯克利校園出發向北三個街區即可到達。 課程從 2 月 22 日周三開始, - 到 6 月 13 日結束,每周一次,從 6:30PM 到 - 9:45PM。 您可以從 這裡 - 了解參加這一培訓班的詳情。

-
-
- - - 9 - - FreeBSD 5.5-BETA1 和 6.1-BETA1 發布了 - -

FreeBSD 5.5 和 FreeBSD 6.1 的首個 BETA 版本現在 可用 了。 - 對應的 BETA1 ISO 鏡像可以從許多 - - FreeBSD 鏡像站點 之一下載。

-
-
-
- - - 1 - - - 31 - -

commit 權限提升:Colin Percival - (src, ports)

-
-
- - - 26 - - 2005 年十至十二月進度報告 - -

現在可以訪問包含 26 個計畫的 2005 年十至十二月 進度報告 - 了。

-
-
- - 19 - -

新增 committer:Matteo Riondato - (src)

-
- - -

新增 committer:Vasil Dimov - (ports)

-
-
- - - 16 - -

新增 committer:Rink Springer - (src)

-
-
-
-
- - - 2005 - - - 12 - - - 23 - - FreeBSD 基金會發布十二月通訊 - -

FreeBSD 基金會發布了其 十二月通訊, - 對本年度基金會的活動進行了總結。

-
-
- - - 21 - -

歸來的 committer: Jason Evans - (src)

-
-
- - - 17 - - 2006 年發行版工作計畫 - -

Scott Long 代表交付工程組宣布了 2006 年度的發行版工作計畫。 - 請參見 - 公告 以了解進一步的資訊。

-
-
- - - 14 - - 在 FreeBSD-CURRENT 上加入了 XFS 的只讀支持 - -

在 FreeBSD 上加入了 XFS 文件系統的只讀支持。 這些原始碼派生自 SGI - 所發布的 source code ,它受限於 GPL 授權。 您可以在 - 公告 中找到更多資訊。

-
-
- - - 12 - -

新增 committer: Andrey Slusar - (ports)

-
-
- - - 7 - - 新增網站欄目: 針對志願者的計畫和想法 - -

FreeBSD project 有數百名遍布世界各地的活躍的開發人員, - 他們分別在 source code 樹上的不同部分進行工作。 但是, - 還有許多新的有趣的計畫和想法需要加以研究和評估, - 在這些地方,FreeBSD project 需要來自志願者的英雄般的努力。 - 在 FreeBSD 網站上新增了一個欄目,其中列出了這樣的計畫。 - 盡管這個列表還有待進一步的補充,但它是希望在未來成為 - committer 的志願者的一個很好的起點。 您可以 在這裡查看計畫列表

-
-
- - - 1 - - - 惠普公司向 FreeBSD 基金會捐獻 blade 式伺服器 cluster - -

FreeBSD 基金會收到了來自惠普公司的一項 blade 系統捐贈, - 它將用作 third-party 軟體的構建工作。 這個包含 20 個節點的 HP BladeSystem - cluster 將 i386 預編譯 package 的構建過程提高了三倍。 您可以 - 在這裡看到更多的細節

-
- - -

新增 committer: Tim Bishop - (ports)

-
-
-
- - - 11 - - - 29 - -

新增 committer: Oleg Bulyzhin - (src)

-
-
- - - 27 - - - 新文章: 用 FreeBSD 來做產品 - -

一篇新的文章, - 用 FreeBSD 來做產品 介紹了在開發產品時與 FreeBSD - project 合作的好處。 成功的軟體產品中的技術投入的一大部分, - 是來自於如何讓其符合不斷變化的市場節奏。 透過使用成熟的、 - 採用寬鬆授權的原始碼,例如 FreeBSD project 的原始碼作為基礎, - 並遵循這篇文章中所介紹的最佳實踐, - 開發組織就能夠從因此而降低的研發投入和更好的市場佔有率中受益。

-
-
- - - 18 - - - 2005 年七月至十月進度報告 - -

2005 年七月至十月的進度報告 現在發布了, - 其中包括了 37 項內容。

-
-
- - - 5 - - - FreeBSD 版本的 KDE 3.4.3 發布了 - -

KDE 3.4.3 已經合併到了 ports tree 中。 - 要了解自 KDE 3.4.2 版本以來的改進, - 請參見 KDE 3.4.2 - 修改日志。 要了解進一步資訊,請參見 KDE 3.4.3 - 資訊頁。 - 要了解關於在 FreeBSD 上運行 KDE 的日常資訊, - 請參閱 FreeBSD 上的 KDE 計畫主頁

-
- - - FreeBSD 版本的 GNOME 2.12.1 發布了 - -

伴隨著 6.0 的發布,GNOME 2.12.1 也已經進入 ports tree 。 - 請務必閱讀 升級 FAQ - 以了解全部修改、升級指導,以及已知問題。 - 您還可以在 FreeBSD GNOME - 主頁 上找到更多資料。

-
-
- - - 4 - - - FreeBSD 6.0-RELEASE 發布了 - -

FreeBSD - 6.0-RELEASE 發布了。 請在安裝前參見 發行版勘誤 - 以了解關於 6.0 的最新新聞和問題。 在 發行版資訊 - 網頁中提供了關於 FreeBSD 發行版的進一步資訊。

-
-
- - - 1 - - FreeBSD 標志設計大賽結果 - -

我們非常愉快地宣布我們的標志設計大賽的勝者: Anton K. Gural。 - 要了解關於比賽的進一步詳情,請參見 比賽結果網頁。 - 透過新的標志,我們將能夠更好的在網絡上展示我們的身份, - 同時也為市場推廣鋪平了道路。 我們將很快發布一個指導性頁面, - 其中將給出使用規則,以及可用的 (矢量格式) 標志數據, - 以與 FreeBSD 同樣的 BSD 授權發布。

-
-
-
- - - 10 - - - 30 - -

新增 committer: Aaron Dalton - (ports)

-
-
- - - 18 - -

新增 committer: Ariff Abdullah - (src)

-
-
- - - 11 - - FreeBSD 6.0-RC1 發布了 - -

FreeBSD 6.0 的第一個發行候選版本 發布了。 - RC1 ISO 鏡像,以及透過 FTP 的安裝支持可以在絕大多數的 - - FreeBSD 鏡像站點 找到。

- -
-
- - - 6 - - 新增成功案例: Argentina.com - -

新增了成功案例, - argentina.com,介紹了在拉丁美洲的一家 ISP - 是如何透過使用 FreeBSD 在競爭激烈的市場上取得成功的。

-
-
- - - 5 - - 新網站發布了 - -

新網站發布了。 我們希望新的設計能夠使瀏覽變得更容易。 - 這一版本的網站是 Emily Boyd 在 Google 的 - Summer of Code 計畫中完成的。 出於比較的目的, - 舊網站的備份留在了 - 這裡。 - 請將您關於新站點的看法發到 freebsd-www@FreeBSD.org 郵件列表。

-
-
- - - 3 - -

新增 committer: Vitaly Bogdanov - (doc)

-
- - -

新增 committer: Emanuel Haupt - (ports)

-
- - -

新增 committer: Andrej Zverev - (ports)

-
-
-
- - - 9 - - - 18 - -

新增 committer: Tom McLaughlin - (ports)

-
-
- - - 15 - -

新增 committer: Marcus Alves Grando - (ports)

-
-
- - - 7 - - FreeBSD 6.0-BETA4 發布了 -

6.0-BETA4 發布公告

-
-
-
- - - 8 - - - 29 - - FreeBSD 6.0-BETA3 發布了 -

6.0-BETA3 發布公告

-
-
- - - 22 - -

新增 committer: Gary W. Swearingen - (doc)

-
-
- - - 21 - - - 新任安全官: Colin Percival - -

在擔任安全官 43 個月之後,Jacques Vidrine - 將這一職務交給了 Colin Percival。 Colin 的主要作品包括 - FreeBSD Update、portsnap、bsdiff 工具, - 以及最近發表的關於在 hyperthreaded 處理器系統上敏感資訊洩露問題的論文 - "Cache missing for fun and profit"。 您可以在 - 這裡 找到進一步的資訊。 -

-
-
- - - 17 - - - 增加了 FreeBSD 活動的 iCalendar Feed - -

使用能夠支持 iCalendar 格式的日程軟體的用戶,現在可以訂閱 - FreeBSD 近期活動歷 了。

-
- - - 新增文章: 如何選擇 FreeBSD 版本 - -

新增的一篇文章, - 選擇適合您的 FreeBSD 版本, - 討論了選擇最適合具體應用的 FreeBSD 版本時所需要考慮的問題。 - 其中包括發行版與分支,以及 FreeBSD-STABLE 和 - FreeBSD-CURRENT 等一些概念的區別。 此外,它還介紹了 FreeBSD - 的開發過程如何達到適應頻繁發布主要版本的目標, - 如何引入較小的功能集,並比較了過去的發行版所採用的方法。 - 這篇文章的目標讀者是正準備安裝 FreeBSD 的新用戶, - 以及準備未來進行升級的現有用戶。

-
-
- - - 5 - - - FreeBSD 6.0-BETA2 發布了 - -

6.0-BETA2 發布公告

-
-
- - - 1 - - - 新的 FreeBSD/Linux 白皮書 - -

Dru Lavigne 剛剛發布了 FreeBSD: - Linux 的一種開源替代品。 這篇白皮書的目的是, - 介紹 FreeBSD 所提供的功能和好處,並與 Linux - 進行適當的比較。 它為那些打算尋找 Linux - 的開源替代品的人提供了一個好的起點。

-
-
-
- - - 7 - - - 22 - - - 2005 年 三月至六月進度報告 - -

2005 三月至六月的進度報告 現已發布, - 其中包括了 43 個計畫。

-
-
- - - 20 - -

新增 committer: Vsevolod Stakhov - (ports)

-
-
- - - 18 - -

新增 committer: Bruno Ducrot - (src)

-
-
- - - 16 - - - 宣布了受資助的在校生計畫 - -

FreeBSD Project 收到了超過 350 個關於 Google 的 - Summer of Code 計畫的申請,其中選出了 18 個進行資助。 - 遺憾的是,能夠進行資助的數量不到申請數量的零頭。 - 不過,我們鼓勵在校生與我們一同進行全年的工作。 FreeBSD - Project 一直希望,透過我們日常的社區郵件列表, - 以及開發論壇來幫助指導在校生了解更多的關於操作系統開發的過程。 - 為開源軟體計畫提供幫助,是計算科學教育中非常有價值的一部分, - 也是個人軟體開發職業生涯的一項重要準備。

- -

關於資助在校生計畫的更多資訊,可以從 FreeBSD - Summer of Code Wiki 獲得。

- -
-
- - - 15 - - - FreeBSD 6.0-BETA1 發布了 - -

6.0-BETA1 發布公告.

-
-
- - - 11 - - - 6-STABLE 分支 (RELENG_6) 建立了 - -

我們已經到達了 6.0-RELEASE 過程的下一個裡程碑。 RELENG_6 - CVS 分支已經從 HEAD 上分離出來。 即將發布的 6.0-RELEASE, - 以及所有後續的 6.x 版本,都將從這一分支上開發。 - 更多詳情請參見: - 6.0-RELEASE 計畫、 - RELENG_6 公告

-
- - -

新增 committer: Renato Botelho - (ports)

-
-
- - - 6 - -

新增 committer: Jung-uk Kim - (src)

-
-
- - - 2 - - - 2005 年 7 月的快照版本發布了 - -

FreeBSD 6-CURRENT 在 2005 年 7 月的快照版本發布了。 - 這應該是 RELENG_6 分支創建前的最後一個 6.0-CURRENT 快照版本。 - FreeBSD 交付工程組發布了 5-STABLE 和 6-CURRENT - 以鼓勵人們測試其中的新功能,並改善其可靠性。 - 要了解更進一步的細節,請參見 - 快照主頁

-
-
- - - 1 - - -

新增 committer: Wayne Salamon - (src)

-
-
-
- - - 6 - - - 17 - - -

新增志願者: Matteo Riondato - (PR database)

-
- - -

新增 committer: Kip Macy - (src)

-
-
- - - 11 - - - 6.0-RELEASE 原始碼凍結開始 - -

FreeBSD - 6.0 原始碼凍結開始了。 開發人員在 src/ 的 HEAD 分支上提交原始碼之前, - 必須首先得到 re@FreeBSD.org 的許可。 您可以從 FTP 站點下載 - 6.0 的最新快照版本,並幫助測試這個新的 FreeBSD 主要版本。 - 要了解進一步的資訊,請參見網站的 交付工程 部分。

-
-
- - - 1 - - - 受資助的在校生編碼工作機會 - -

FreeBSD Project 很高興地參加了 Google 的 - Summer - of Code 2005 計畫,為將在暑期參與開源軟體計畫的在校學生提供資助。 - FreeBSD 專屬的計畫列表和候選導師可以在 這裡 找到。

-
- - -

新增 committer: Brad Davis - (doc)

-
-
-
- - - 5 - - - 26 - - -

新增 committer: Andrew Thompson - (src)

-
-
- - - 21 - - -

新增 committer: Craig Rodrigues - (src)

-
-
- - - 15 - - - BSDCan 大會總結 - -

在渥太華的又一次 BSD - conference 盛會已經圓滿結束了。 此前舉行了為期兩天的 FreeBSD - 開發人員峰會。 特別感謝 Dan Langille 組織本次會議,以及由 - Scott Long 組織的峰會。

- -
-
- - - 9 - - - FreeBSD 5.4-RELEASE 正式發布了 - -

FreeBSD - 5.4-RELEASE 正式發布了。 安裝前,請查看 發行勘誤 - 以了解 5.4 上新發現的問題。 發行版資訊 - 網頁提供了關於 FreeBSD 發行版的更多資訊。

- -
-
- - - 3 - - - FreeBSD 5.4-RC4 版發布了 - -

FreeBSD 5.4-RC4 版本已經發布。 FreeBSD 交付工程組愉快地宣布, - 現在 FreeBSD 5.4-RC3,FreeBSD 5.4 - 交付工程中的第四個發行候選版本已經可用。 除非發現重大問題, - 這將是最後一個發行候選版本。 RC4 ISO 映像檔案, - 以及透過 FTP 的安裝支持,已經可以從眾多 - FreeBSD 鏡像站點 上獲得。

-
- - - PF 更新到了 3.7 - -

packet filter (pf) 原始碼已經被更新為即將發布的 - OpenBSD 3.7 相同的版本。 包括嵌套 anchor 和連接速率限制, - 現在都可以為 FreeBSD 用戶直接使用了。

-
-
-
- - - 4 - - - 21 - - - 2005 年第一季度開發進度報告 - -

2005 年第一季度開發進度報告共有 39 個條目,可以在 這裡訪問。

-
-
- - - 18 - - - FreeBSD 5.4-RC3 版發布了 - -

FreeBSD 5.4-RC3 版本已經發布。 FreeBSD 交付工程組愉快地宣布, - 現在 FreeBSD 5.4-RC3,FreeBSD 5.4 - 交付工程中的第三個發行候選版本已經可用。 RC3 ISO 映像檔案, - 以及透過 FTP 的安裝支持,已經可以從眾多 - FreeBSD 鏡像站點 上獲得。

-
-
- - - 13 - - -

新增 committer:Qing Li - (src)

-
-
- - - 12 - - -

新增 committer:Jean-Yves Lefort - (ports)

-
- - -

新增 committer:Sam Lawrance - (ports)

-
-
- - - 11 - - - FreeBSD 5.4-RC2 版發布了 - -

FreeBSD 5.4-RC2 版本已經發布。 FreeBSD 交付工程組愉快地宣布, - 現在 FreeBSD 5.4-RC2,FreeBSD 5.4 - 交付工程中的第二個發行候選版本已經可用。 - 我們鼓勵大家對這個版本進行測試, - 以便發現其中的遺留問題並加以修正。 RC2 ISO 映像檔案, - 以及透過 FTP 的安裝支持,已經可以從眾多 - FreeBSD 鏡像站點 上獲得。

-
-
- - - 7 - - -

新增 committer:Joel Dahl - (doc)

-
-
- - - 5 - - - FreeBSD 5.4-RC1 版發布了 - -

FreeBSD 5.4-RC1 版發布了。 - FreeBSD 交付工程組愉快地宣布, - 現在 FreeBSD 5.4-RC1,FreeBSD 5.4 - 的第一個發行候選版本已經發布。 我們鼓勵人們幫助對其進行測試, - 以便發現其中的遺留問題並加以修正。 RC1 ISO 映像檔案, - 以及透過 FTP 的安裝支持,已經可以從眾多 - FreeBSD 鏡像站點 上找到。

-
-
-
- - - 3 - - - 31 - - -

增強 commit 權限:Alexander Leidinger (src, ports)

-
-
- - - 20 - - - FreeBSD 5.4-BETA1 版發布了 - -

FreeBSD 5.4-BETA1 版正式發布了。 - 這是 FreeBSD 5.4 發行周期的第一個 BETA 版本,Release Engineering - 團隊鼓勵人們幫助測試以便於在正式發布前確定並解決任何最終的 - bug。安裝支持的 ISO 鏡像和 FTP 可以訪問大多數的 - FreeBSD 鏡像站點

-
-
- - - 17 - - - 2005 年三月版的快照發行版可用了 - -

FreeBSD 6-CURRENT 的 2005 年三月快照版本現在可用了。 - 請注意本月的快照並不包括 5-STABLE,因為很快將發布 - 5.4-PRERELEASE。 FreeBSD Release Engineering 團隊, - 透過發布每月一次的 5-STABLE 和 6-CURRENT 快照版本, - 來鼓勵人們常識新特性,並提高軟體的可靠性。 - 要了解更多細節,請訪問 - 快照 的網頁。

-
-
- - - 12 - - - GNOME 2.10.0 可以在 FreeBSD 上用了 - -

GNOME 2.10.0 已經發布,並進入了 ports tree, - 從而可以趕上 5.4-RELEASE 的進度了。 請務必閱讀我們的 - 升級 FAQ - 以了解關於變動、升級指導,以及已知的問題。 - 更多資源,可以在 FreeBSD GNOME - 主頁 找到。

-
-
- - - 7 - - -

新增 committer: Roman Bogorodskiy (ports)

-
-
- - - 3 - - -

新增 committer: Damien Bergamini (src)

-
-
- - - 1 - - -

新增 committer: Jesus R. Camou (doc)

-
- - -

新增 committer: Florent Thoumie (ports)

-
-
-
- - - 2 - - - 27 - - -

新增 committer: Simon Barner (ports)

-
-
- - - 22 - - -

標志設計競賽 全面啟動。

-
- - -

新增 committer: Tai-hwa Liang (src)

-
-
-
- - - 1 - - - 25 - - FreeBSD 4.11-RELEASE 正式發布了 - -

FreeBSD - 4.11-RELEASE 正式發布了。 安裝之前請查看 發行版勘誤 - 以了解新發現的 4.11 版本的問題。 發行版資料 - 頁提供了關於 FreeBSD 發行版更為詳盡的資料。

-
-
- - - 17 - - - 2004 年 下半年度計畫狀況報告 - -

現在 - 就可以從包含了 44 個條目的狀況報告,來了解去年七月到十二月的計畫發展情況。

-
- - - FreeBSD 4.11 RC3 發布了 - -

FreeBSD 4.11 的第三個發行候選版本現在已經可以使用了。 請參見 - FreeBSD-STABLE 郵件列表上的 這份公告。 - 完整的 4.11 發布計畫可以在 這裡 找到。

-
-
- - - 2 - - - FreeBSD 4.11 RC2 發布了 - -

FreeBSD 4.11 的第二個發行候選版本現在已經可以使用了。 請參見 - FreeBSD-STABLE 郵件列表上的 這份 - 完整的公告。 完整的 4.11 發布計畫可以在 這裡 找到。

-
-
-
-
- - - 2004 - - - 12 - - - 28 - - - Mozilla 授權 FreeBSD 的 thunderbird 和 firefox ports - -

Mozilla 授權團隊 - 已經 授權 - FreeBSD Gnome 團隊 - 使用 Firefox 和 Thunderbird 的名稱、官方圖標, - 以及制作官方品牌的預編譯版本。

-
- -

新增 committer: Sam Hopkins (src)

-
-
- - - 23 - - - FreeBSD 基金會季刊發布 - -

FreeBSD 基金會發布了它的 - 季刊,並借此呼籲對其進行捐助以維持它的 501(c)3 - 非盈利慈善團體地位。

-
-
- - - 18 - - - FreeBSD 4.11 RC1 發布了 - -

FreeBSD 4.11 的第一個發行候選版本現在已經可以使用了。 請參見 - FreeBSD-STABLE 郵件列表上的 完整公告。 - 完整的 4.11 發布計畫可以在 這裡 找到。

-
-
- - - 13 - - -

新增 committer: Niels Heinen - (ports)

-
-
- - - 6 - - -

FreeSBIE 1.1 FreeBSD - Live CD 發布了 ── 參見 - 發布公告 了解更進一步的詳情。

-
- - -

新增 committer: Palle Girgensohn - (ports)

-
-
- - - 2 - - - 正式公告 FreeBSD 4.11 發行日程 - -

FreeBSD 4.11 發行版的發行日程已經正式公告, - 我們的目標是在 2005 年 1 月 24 日發布它。 - 完整的日程表在 - 這裡

-
-
- - - 1 - - -

新增 committer: Jean-Sébastien Pédron - (src)

-
-
-
- - - 11 - - - 27 - - - FreeBSD 商標已轉入基金會名下 - -

'FreeBSD' 商標在 1996 年曾被授予由 Walnut Creek CDROM (現在的 FreeBSD Mall, - Inc.) 使用,它現在已經轉到了 FreeBSD - 基金會 名下。

-
-
- - - 19 - - -

新增 committer: Vicente Carrasco - (doc)

-
-
- - - 11 - - -

新增 committer: Johann Kois - (doc)

-
-
- - - 7 - - - GNOME 2.8.1 發布了 FreeBSD 版本 - -

在 FreeBSD 5.3 發布之後,GNOME 2.8.1 已經合併到了 ports tree 中。 - 請參見 - FreeBSD GNOME - 主頁 以獲取升級的具體步驟。

-
-
- - - 6 - - - FreeBSD 5.3-RELEASE 發布了 - -

FreeBSD - 5.3-RELEASE 正式發布了。 在安裝前請查看 發行版勘誤 - 以了解 5.3 上面新近發現的問題和新聞。 發行版資訊 - 頁面提供了更多的關於發行版的資訊。

- -
-
-
- - - 10 - - - 31 - - - FreeBSD 5.3-RC2 發布了 - -

FreeBSD Release Engineering Team 驕傲地宣布, - FreeBSD 5.3-RC2 已經可以用了。 - 由於在 RC1 測試中發現了兩個嚴重問題, - 我們認為需要再發布一個 RC 以讓這些問題的修正得到更廣泛的測試。 - 如果沒有再出現新的嚴重問題,這將是 5.3-RELEASE - 之前的最後一個發行測試版本。 請參見 - FreeBSD-CURRENT 上的完整公告,它在 這裡

-
-
- - - 29 - - -

新增 committer: Michael Johnson (ports)

-
-
- - - 16 - - -

新增 committer: Remko Lodder (doc)

-
-
- - - 12 - -

新增 committer: George V. Neville-Neil - (src)

-
-
- - - 8 - -

新增 committer: Stephan Uphoff - (src)

-
-
- -
- - - 9 - - - 15 - -

新增 committer: Koop Mast - (ports)

-
- - -

新增 committer: 李鑫 - (src, doc)

-
-
- -
- - - 8 - - - 20 - -

新增 committer: Alexey Dokuchaev - (ports)

-
-
- - - 19 - -

新增 committer: Dejan Lesjak - (ports)

-
-
- - - 18 - -

新增 committer: 宋政隆 - (ports)

-
-
- - - 10 - -

新增 committer: Dmitry Morozovsky - (doc)

-
-
- - - 5 - -

新增 committer: Herve Quiroz - (ports)

-
-
- - - 2 - -

新增 committer: Pyun YongHyeon - (src)

-
-
- -
- - - 7 - - - 27 - -

新增 committer: Bjoern A. Zeeb - (src)

-
-
- - - 26 - - 2004 年五月至六月進度報告發布 - -

五月至六月的進度報告發布了; 請參見 進度報告 Web - 頁 了解具體資訊。

-
- - - 24 - -

新增 committer: Suleiman Souhlal - (PowerPC)

-
-
- - - 23 - - FreeBSD 切換為使用 X.Org -

FreeBSD-CURRENT 現在默認採用 X.Org 的 X 系統, - 而 XFree86 仍然繼續被支持。 欲了解如何在 -CURRENT 和 -STABLE 上升級到 X.org - 的詳情,請參考 - - HEADS UP

-
-
- - - 14 - -

新增 committer: Gleb Smirnoff - (src)

-
-
- - - 7 - -

新增 committer: Sergey Matveychuk - (ports)

-
-
- -
- - - 5 - - - 30 - -

新增 committer: Lars Thegler - (ports)

-
-
- - - 27 - - FreeBSD 4.10-RELEASE 正式發布了 - -

FreeBSD - 4.10-RELEASE 已經正式發布了。 在安裝之前請首先參考 發布版勘誤 - 以了解關於 4.10 的最新的消息和已知問題。 - Release Information - 頁提供了關於 FreeBSD 發行版本的進一步資訊。

-
-
- - - 23 - -

新增 committer: Koichi Suzuki - (doc)

-
-
- - - 15 - - 2004 年 3、4 月開發進度報告 - -

3、4 月開發進度報告,更多資訊請看 - web狀態頁面。 -

-
-
- - - 4 - -

新增 committer: Christian S.J. Peron - (src)

-
- -

新增 committer: Stefan Farfeleder - (src)

-
-
- -
- - - 4 - - - 30 - -

新增 committer: Jeremy Messenger - (ports)

-
-
- - - 19 - -

新增 committer: Tony Ackerman - (src)

-
-
- - - 17 - -

新增 committer: Marius Strobl - (src)

-
-
- - - 5 - -

新增 committer: Daniel Hartmeier - (src)

-
-
- -
- - - 3 - - - 29 - -

新增 committer: Niklas J. Saers - (doc)

-
-
- - - - 25 - - 刪去了 Gallery - -

由於維護困難而收效甚微,我們決定刪去 - gallery 頁面。 - 這些內容將在兩周後刪除,今後提交的內容將不再受理。 - 不過,這並不影響 - Commercial Gallery

-
-
- - - 18 - -

新增 committer: Mark Santcroos - (src)

-
-
- - - 17 - - 2004 年一月至二月進度報告 - -

一月至二月的進度報告現在發布了; 請參見 - 進度報告網站 - 了解更多資訊。

-
-
- - 13 - -

新增 committer: Thierry Thomas - (ports)

-
-
- - - 10 - -

新增 committer: Volker Stolz - (ports)

-
-
- - - 9 - -

新增 committer: Peter Edwards - (src)

-
-
- -
- - - 2 - - - 26 - -

新增 committer: Vinod Kashyap - (src)

-
-
- - - 25 - - FreeBSD 5.2.1-RELEASE 發布了 - -

FreeBSD - 5.2.1-RELEASE 發布了。 在安裝前,請查看 發行版勘誤 - 以了解最新消息和 5.2.1 發布之後所發現的問題。 在 發行版資訊 - 網頁中,您可以找到更多關於 FreeBSD 發行版的資訊。

- -
-
- - - 22 - -

新增 committer: Markus Brüffer - (Ports)

-
-
- - - 17 - -

新增 committer: Jim Rees - (src)

-
-
- - - 15 - -

核心團隊成員辭職: Greg Lehey

-
-
- - - 10 - -

新增 committer: Max Laier - (src)

-
-
- - - 2 - -

新增 committer: Lukas Ertl - (src)

-
- - -

新增 committer: Pawel Jakub Dawidek - (src)

-
-
- -
- - - 1 - - - 28 - - - 2003 年十月至十二月開發進度報告 - -

剛剛發表了十月至十二月的開發進度報告; 請參見 - 進度報告網站 - 以了解進一步的資訊。

-
-
- - - 21 - -

新增 committer:Philip Paeps - (src)

-
- - -

新增 committer:Colin Percival - (src)

-
-
- - - 15 - -

新增 committer:Josef El-Rayes - (docs)

-
-
- - - 12 - - FreeBSD 5.2-RELEASE 正式發布了 - -

FreeBSD - 5.2-RELEASE 正式發布了。 安裝之前請查閱 發行版勘誤資訊 - 以便了解關於 5.2 發表之後的新聞和問題。 發行版資訊 - 提供了關於 FreeBSD 發行版的進一步資訊。

- -
-
- - - 4 - -

新增 committer: Vincent Tougait - (文件計畫)

-
-
- -
- -
- -
diff --git a/zh_TW.UTF-8/share/xml/press.xml b/zh_TW.UTF-8/share/xml/press.xml deleted file mode 100644 index 7f7fc915f8..0000000000 --- a/zh_TW.UTF-8/share/xml/press.xml +++ /dev/null @@ -1,528 +0,0 @@ - - - - - - - - - - $FreeBSD$ - - - - 2006 - - - 12 - - - 安裝 FreeBSD 6.1 - http://www.openaddict.com/installing_freebsd_6_1.html - OpenAddict - http://www.openaddict.com/ - 2006 年 12 月 11 日 - Sharaz -

一篇關於 FreeBSD 6.1 安裝過程的詳細介紹文章

-
- - - 部署 FreeBSD 6.1 伺服器之快速指南 - http://www.openaddict.com/quick_and_dirty_guide_to_deploying_a_freebsd_6_1_server.html - OpenAddict - http://www.openaddict.com/ - 2006 年 12 月 08 日 - Rich Morgan -

介紹如何配置 FreeBSD 6.1 伺服器,並在其上安裝 - Apache、Webmin、PHP 5、MySQL 5.0、具 SMTP 身份認証的 Sendmail、Bind - DNS、SNMP 以及本地時間同步服務的文章。

-
- - - 中國研發伺服器 OS; 聯想參與其中 - http://www.pacificepoch.com/newsstories/82819_0_5_0_M/ - 彌亞世代 - http://www.pacificepoch.com/ - 2006 年 12 月 04 日 - Zhengqian Zhou -

中國的科技部(MOST)宣稱,中國已經完成了一種 FreeBSD-based - 的伺服器作業系統的研發工作。

-
-
- - - 11 - - - FreeBSD 安全事件稽核 - http://www.securityfocus.com/columnists/422 - Security Focus - http://www.securityfocus.com/ - 2006 年 11 月 10 日 - Federico Biancuzzi -

對 FreeBSD 開發人員 Robert Watson 就 FreeBSD 6.2 - 中新增的稽核子系統的訪談。

-
- - - FreeBSD 發布了 6.2 Beta 3 - http://www.itjungle.com/tug/tug110906-story06.html - IT Jungle - http://www.itjungle.com/ - 2006 年 11 月 9 日 - Timothy Prickett Morgan -

關於即將發布的 6.2 release 的新聞,同時介紹了一些 FreeBSD 7 的新功能。

-
-
- - - 10 - - - 企業 Unix 的下一輪競爭: PC-BSD 可能會是下一個 Linux - http://www.serverwatch.com/eur/article.php/3640151 - ServerWatch.com - http://www.serverwatch.com/ - 2006 年 10 月 25 日 - Brian Proffitt -

關於 iXsystems 收購 FreeBSD-based 的 PC-BSD 的交易公告的說明。

-
- - - iXsystems 為何收購 PC-BSD - http://www.onlamp.com/pub/a/bsd/2006/10/23/ixsystems-pc-bsd.html - OnLamp.com - http://www.onlamp.com/ - 2006 年 10 月 23 日 - Dru Lavigne -

一篇就 iXsystems Inc. 收購 PC-BSD 的針對 Kris Moore 和 Matt Olander - 的訪談。

-
- - - 利用虛擬化技術構建 NAS 設備 - http://www.itweek.co.uk/2166671 - IT Week - http://www.itweek.co.uk/ - 2006 年 10 月 18 日 - Alan Stevens -

在 VMWare 虛擬機中利用 FreeBSD-based 的 FreeNAS 建立您自己的虛擬網路存儲設備。

-
- - - Desktop FreeBSD: 全面優化的 6.x 安裝 - http://www.ofb.biz/safari/article/402.html - Open For Business - http://www.ofb.biz/ - 2006 年 10 月 12 日 - Ed Hurst -

本文介紹了如何為優化性能從源原始碼 (重) 編譯 FreeBSD 系統。

-
- - - FreeBSD-based 的 PC-BSD 被收購了 - http://www.internetnews.com/dev-news/article.php/3637341 - InternetNews.com - http://www.internetnews.com/ - 2006 年 10 月 12 日 - Sean Michael Kerner -

iXsystems Inc. 收購了 PC-BSD (FreeBSD-based 的一種桌面作業系統之商標權、智慧財產權)。

-
- - - 將舊的筆記型電腦變為一套便攜式網路故障排除系統 - http://www.techbuilder.org/recipes/193105146 - TechBuilder - http://www.techbuilder.org/ - 2006 年 10 月 09 日 - David S. Markowitz -

如何用舊的筆記型電腦和 FreeBSD 來建立網路監控系統。

-
- - - Desktop FreeBSD: 64位元之未來 - http://www.ofb.biz/safari/article/400.html - Open For Business - http://www.ofb.biz/ - 2006 年 10 月 04 日 - Ed Hurst -

這篇文章的作者介紹了建立令人滿意的 FreeBSD-based 的 64 位元桌面計算效果。

-
-
- - - 9 - - - Win4BSD 發布了 - http://win4bsd.com/content/index.php?option=com_content&task=view&id=20&Itemid=2 - Win4BSD - http://www.win4bsd.com/ - 2006 年 09 月 25 日 - Dan Perlman -

Virtual Bridges,一家利用虛擬化技術實現企業和 SMB 解決方案的供應商今天宣布發布 Win4BSD - Pro Desktop™。 Win4BSD Pro Desktop 作為 - &os;/PC-BSD 的應用程式運行,並允許用戶運行 Windows 應用程式和桌面, - 而無需對 BSD 平台進行其它變動。

-
- - - POSIX Asynchronous I/O - http://www.informit.com/articles/article.asp?p=607373&seqNum=1&rl=1 - InformIT - http://www.informit.com/ - 2006 年 09 月 22 日 - David Chisnall -

介紹了 FreeBSD 和其它開源 OS 中的 asynchronous I/O 程式撰寫。

-
- - - DesktopBSD 1.0:用於桌面的 FreeBSD - http://os.newsforge.com/os/06/09/01/2053249.shtml - NewsForge - http://www.newsforge.com/ - 2006 年 09 月 11 日 - Stefan Vrabie -

關於 DesktopBSD 1.0 的評論。

-
- - - (遲到的) FreeBSD 6.1 一瞥 - http://weblog.infoworld.com/venezia/archives/007779.html - InfoWorld - http://www.infoworld.com/ - 2006 年 09 月 06 日 - Paul Venezia -

作者介紹了使用軟體 RAID 和 PF 的 FreeBSD-based 的郵件伺服器和 Web 主機。

-
-
- - - 8 - - - VMware 的虛擬設備競賽 - 勝者是? - http://weblog.infoworld.com/virtualization/archives/2006/08/vmwares_virtual_1.html - InfoWorld - http://www.infoworld.com/ - 2006 年 08 月 15 日 - David Marshall -

FreeBSD-based 的 FreeNAS 存儲服務項目贏得了 VMWare Inc. 的虛擬化競賽大獎。

-
- - - FreeBSD 6 中的高級安裝任務 - http://www.informit.com/articles/article.asp?p=597694&rl=1 - InformIT - http://www.informit.com - 2006年 8月 11日 - Brian Tiemann -

從 "FreeBSD 6 Unleashed" 書中的節錄, - 介紹了非標準的 FreeBSD 安裝方法。

-
- - - PC-BSD: 對初學者最友善的 OS - http://www.osweekly.com/index.php?option=com_content&task=view&id=2287&Itemid=449 - OSWeekly.com - http://www.osweekly.com/ - 2006年 8月 10日 - Matt Hartley -

對 PC-BSD 的一篇評論,介紹了它的安裝和套件管理。

-
- - - 持續前進的 BSD Unix 項目 - http://www.itjungle.com/breaking/bn080206-story01.html - ITJungle - http://www.itjungle.com/ - 2 August 2006 - Timothy Prickett Morgan -

這篇文章報道了 FreeBSD project 向 Sparc (T1) 平台移植的進展, - 以及在最新的幾次發行版本中可伸縮性方面的改進。 同時, - 它也提到了其他 BSD 項目的一些進展情況。

-
- - - 在 Sun Fire X2100 上使用 gmirror - http://ezine.daemonnews.org/200608/gmirror_1.html - DaemonNews - http://www.daemonnews.org/ - August 2006 - Grzegorz Czaplinski -

關於如何構建和卸下 gmirror 系統的兩篇系列文章的第一部分。

-
-
- - - 7 - - - CBC 的網站全面使用開源產品! - http://www.insidethecbc.com/2006/07/15/under-the-hood-at-cbcca-open-source - InsideTheCBC.com - http://www.insidethecbc.com/ - 2006年 7月 15日 - Blake Crosby -

一篇關於加拿大廣播公司介紹他們在 IT 基礎設施中使用 FreeBSD 的文章。

-
- - - 對 NVIDIA 公司 Andy Ritger 和 Christian Zander 的採訪 - http://bsdtalk.blogspot.com/2006/07/bsdtalk054-interview-with-andy-ritger.html - BSDTalk - http://bsdtalk.blogspot.com/ - 2006年 7月 14日 - Will Backman -

Will Backman 與來自 NVIDIA 的 Andy Ritger 和 Christian Zander - 就 NVIDIA FreeBSD 顯示驅動程式進行了對話。 - 這期介紹了該驅動程式目前提供的功能、未來的改進計劃, - 並就授權和 NVIDIA 參與開源項目進行了一些討論。

-
- - - 使用 DesktopBSD - http://www.onlamp.com/pub/a/bsd/2006/07/13/FreeBSDBasics.html - OnLamp.com - http://www.onlamp.com/ - 2006年 7月 13日 - Dru Lavigne -

這篇文章深入介紹了 DesktopBSD,一種易用的針對桌面的 FreeBSD 5.5 - 版本。

-
- - - 用於社區中心的 PC-BSD - http://os.newsforge.com/os/06/06/23/1442207.shtml?tid=8 - NewsForge - http://www.newsforge.com/ - 2006 年 7 月 03 日 - Henry Gillow-Wiles -

一家非營利社區中心的 IT 總監對於 FreeBSD-based 的 PC-BSD - 作業系統的速度、可靠性以及硬體相容性十分滿意。

-
-
- - - 6 - - - 用普通硬體和 FreeBSD 建立郵件伺服器,第 2 部分 - http://www.techbuilder.org/article/189400686 - TechBuilder - http://www.techbuilder.org/ - 2006年 6月 12日 - David S. Markowitz -

TechBuilder 這份案例的第二部分介紹了如何在使用 FreeBSD 和 PC 構建的郵件伺服器上, - 增加反病毒、垃圾郵件防護以及 webmail 功能。

-
- - - 五月份最可靠的六家主機托管公司 - http://news.netcraft.com/archives/2006/06/06/six_hosting_companies_most_reliable_hoster_in_may.html - Netcraft - http://www.netcraft.com/ - 2006年 6月 06日 - Mandy -

Netcraft 在 2006 年五月所進行的普查顯示, - 可靠性排名前五的 Internet 主機托管公司中有四家使用 FreeBSD。

-
- - - 用普通硬體和 FreeBSD 建立郵件伺服器,第 1 部分 - http://www.techbuilder.org/article/188701471 - TechBuilder - http://www.techbuilder.org/ - 2006年 6月 05日 - David S. Markowitz -

如何使用 PC 和 FreeBSD 為中小企業建立郵件伺服器。

-
-
- - - 5 - - - FreeNAS 伺服器印象 - http://hardware.newsforge.com/hardware/06/05/19/1349206.shtml?tid=69 - NewsForge - http://www.newsforge.com/ - 2006年 5月 30日 - Gary Sims -

一篇關於 FreeNAS,一種基於 FreeBSD 的 NAS 產品的文章。

-
- - - DTrace 在 FreeBSD 上的黃金時段 - http://www.zdnet.com.au/news/software/soa/DTrace_reaches_prime_time_on_FreeBSD/0,2000061733,39257452,00.htm - ZDNet Australia - http://www.zdnet.com.au/ - 2006年 5月 29日 - Renai LeMay -

ZDNet 的一篇關於 FreeBSD 上的 DTrace 的文章。

-
- - - BSD 的套件管理系統 - http://www.informit.com/articles/article.asp?p=471098&rl=1 - InformIT.com - http://www.informit.com/ - 26 May 2006 - David Chisnall -

一篇關於各式 BSD 作業系統中套件管理系統的文章。

-
- - - 專訪 FlightAware 的 Karl Lehenbauer of - http://bsdtalk.blogspot.com/2006/05/bsdtalk042-interview-with-karl.html - BSDTalk - http://bsdtalk.blogspot.com/ - 2006年 5月 15日 - Will Backman -

FlightAware - 使用 FreeBSD/amd64 系統 用以追蹤每日多達 70, 000 - 架次的航班位置。 Will Backman 與 Karl Lehenbauer - 共同討論了關於 FlightAware 如何成功地運用 FreeBSD 以及其他開源技術, - 以驅動其產品的相關話題。

-
- - - FreeBSD 誓與 Linux 桌面系統一決高下 - http://news.com.com/2100-1011_3-6071598.html - News.com - http://news.com.com/ - 2006年 5月 12日 - Ingrid Marson -

ZDNet 關於 FreeBSD 即將增加的桌面特性的文章。

-
- - - FreeBSD 6.1 評論 - http://www.softwareinreview.com/cms/content/view/37/1/ - Software in review - http://www.softwareinreview.com/ - 2006年 5月 12日 - Jem Matzan -

關於 amd64 平台上 FreeBSD 6.1 的評論。

-
- - - FreeBSD 6.1 的穩定性 - http://www.internetnews.com/dev-news/article.php/3605211 - InternetNews.com - http://www.internetnews.com/ - 2006年 5月 10日 - Sean Michael Kerner -

一篇介紹 FreeBSD 項目的文章,重點討論了 6.1 和 5.5 - 版本的可靠性和品質控制。

-
- -
- - - 4 - - - 訪談: FreeBSD 基金會的 Deb Goodkin - http://blogs.ittoolbox.com/unix/bsd/archives/008670.asp - Blog: BSD 領袖一年的生活 - http://blogs.ittoolbox.com/unix/bsd/ - 2006年 4月 11日 - Dru Lavigne -

在這次訪談中,Deb Goodkin 介紹了一些您感興趣的關於 FreeBSD - 基金會的資訊,及其工作內幕。

-
- - - 訪談: FreeBSD 的 John Baldwin - http://blogs.ittoolbox.com/unix/bsd/archives/008672.asp - Blog: BSD 領袖一年的生活 - http://blogs.ittoolbox.com/unix/bsd/ - 2006年 4月 10日 - Dru Lavigne -

在這次訪談中,FreeBSD 項目的 John Baldwin - 介紹了 FreeBSD 開發團隊,以及在大型開源項目背後的一些事情。

-
-
- - - 3 - - - 在 FreeBSD 6 中配置 Linux 相容環境 - http://os.newsforge.com/os/06/03/22/1531252.shtml?tid=8&tid=2 - Newsforge - http://www.newsforge.com/ - 2006年 3月 31日 - Gordon McEwen -

一份關於如何在 FreeBSD 6 中配置和運行 Linux 應用程式的說明。

-
-
- - - 2 - - - 透過作業系統,進行網路過濾 - http://www.onlamp.com/pub/a/bsd/2006/02/16/os_fingerprint_filtering.html - Onlamp.com - http://www.onlamp.com/ - 2006年 2月 16日 - Avleen Vig -

透過使用 FreeBSD、pf、ALTQ 和 squid - 使病毒、蠕蟲和 malware 遠離您的網路。

-
- - - 開啟南非青少年的數位之門 - http://www.tectonic.co.za/view.php?id=859 - tectonic - http://www.tectonic.co.za/ - 2006年 2月 08日 - Lunga Madlala -

一篇在介紹南非某些省份的 “數位之門” 中提到 FreeBSD - 使用的文章。

-
-
- - - 1 - - - BSD: 另一種自由的 UNIX 家族 - http://www.informit.com/articles/article.asp?p=439601&rl=1 - InformIT - http://www.informit.com/ - 20 January 2006 - David Chisnall -

介紹開放源碼的 BSD 作業系統。

-
- - - 訪談: BSD 認証小組的 Dru Lavigne - http://business.newsforge.com/business/06/01/13/173233.shtml?tid=35&tid=8 - Newsforge - http://www.newsforge.com/ - 20 January 2006 - Federico Biancuzzi -

採訪了 BSD 認証小組,一個為建立 BSD 作業系統認証標準而成立的非營利組織的締造者。

-
- - - 在 FreeBSD 上運行商業 Linux 軟體 - http://www.onlamp.com/pub/a/bsd/2006/01/12/Big_Scary_Daemons.html - Onlamp.com - http://www.onlamp.com/ - 2006年 1月 12日 - Michael W. Lucas -

作者展示了如何在 FreeBSD 上運行為 Linux-based - 的作業系統編譯的應用程式。

-
-
-
-
diff --git a/zh_TW.UTF-8/share/xml/release.l10n.ent b/zh_TW.UTF-8/share/xml/release.l10n.ent deleted file mode 100644 index adebc15c3c..0000000000 --- a/zh_TW.UTF-8/share/xml/release.l10n.ent +++ /dev/null @@ -1,137 +0,0 @@ - - - - - - - 版本 & 平台 - 發行版安裝檔案 - ISO - 計劃 - 待解決問題列表 - - - - - FreeBSD &betarel2.current;-&betarel2.vers; - - [查看] - [查看] - - -     - alpha - [安裝檔案] - [ISO] - - - - amd64 - [安裝檔案] - [ISO] - - - - i386 - [安裝檔案] - [ISO] - - - - ia64 - [安裝檔案] - [ISO] - - - - pc98 - [安裝檔案] - [ISO] - - - - ppc - - - - sparc64 - [安裝檔案] - [ISO] - - - -'> -]]> - - - - -

為即將發佈的 FreeBSD 版本提供幫助

- -

我們的開發人員和 release engineers 目前正在為 FreeBSD - 接下來的版本努力工作; 如果您希望幫助進行測試, 請下載最新編譯的版本。 - 請注意這些光碟鏡像是設計用於測試目的, 因而不應在正式環境中使用。

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
版本 & 平台發行版安裝檔案ISO計劃待解決問題列表
FreeBSD &betarel.current;-&betarel.vers;[查看][查看]
   alpha[安裝檔案][ISO]
amd64[安裝檔案][ISO]
i386[安裝檔案][ISO]
ia64[安裝檔案][ISO]
ppc
sparc64[安裝檔案][ISO]
- - &beta.second; - -'> -]]> - diff --git a/zh_TW.UTF-8/share/xml/trademarks.ent b/zh_TW.UTF-8/share/xml/trademarks.ent deleted file mode 100644 index f380310060..0000000000 --- a/zh_TW.UTF-8/share/xml/trademarks.ent +++ /dev/null @@ -1,310 +0,0 @@ - - - -3Com 和 HomeConnect 是 3Com Corporation - 的註冊商標。"> - -3Com"> - -3ware 和 Escalade 是 3ware Inc 的註冊商標。 - "> -3ware"> - - -Adaptec 是 Adaptec, Inc. 的註冊商標。"> -Adaptec"> - -Adobe, Acrobat, Acrobat Reader, 以及 PostScript - 是 Adobe Systems Incorporated 在美國和/或其他國家的商標或註冊商標。"> -Acrobat"> -Acrobat Reader"> -Adobe"> -PostScript"> - - -AMD, AMD Athlon, -AMD Opteron, Athlon, Élan, Opteron, 和 PCnet 是 - Advanced Micro Devices, Inc. 的商標。"> -AMD Athlon"> -AMD Opteron"> -Athlon"> -Élan"> -Opteron"> - - -Apple, AirPort, FireWire, Mac, Macintosh, Mac OS, - Quicktime, 以及 TrueType 是 Apple Computer, Inc. 在美國以及其他國家的註冊商標。"> -AirPort"> -Apple"> -FireWire"> -iMac"> -Mac"> -Macintosh"> -Mac OS"> -Quicktime"> -TrueType"> - -ARM 是 ARM Limited. 的註冊商標。"> -ARM"> - - -Bluetooth"> - -Cisco, Catalyst, 和 IOS - 是 Cisco Systems, Inc. 和/或其附屬機構在美國和一些其他國家的註冊商標。"> -Catalyst"> -IOS"> - -Corel 和 WordPerfect 是 Corel Corporation - 和/或其子公司在加拿大、美國和/或其他國家的註冊商標。"> -WordPerfect"> - - -Coverity 是註冊商標。 -而 Coverity Extend、Coverity Prevent、Coverity Prevent SQS 是 Coverity, Inc. -的註冊商標。"> -Coverity"> -Coverity Prevent"> - - -Sound Blaster 是 - Creative Technology Ltd. 在美國和/或其他國家的註冊商標。"> -SoundBlaster"> - - -CVSup 是 - John D. Polstra 的註冊商標。"> - - -Dell"> -PowerEdge"> - - -EPSON - Perfection"> - -FreeBSD 是 FreeBSD基金會的註冊商標"> - - -Heidelberg, Helvetica, - Palatino, 和 Times Roman 是 Heidelberger Druckmaschinen AG 在美國以及其他國家的商標或註冊商標。"> - - - -IBM, AIX, OS/2, PowerPC, PS/2, S/390, 和 ThinkPad 是 - 國際商用機器公司在美國和其他國家的註冊商標或商標。"> -AIX"> -OS/2"> -PowerPC"> -PS/2"> -S/390"> -ThinkPad"> - -IEEE, POSIX, 和 802 是 Institute of Electrical and Electronics Engineers, - Inc. 在美國的註冊商標。"> -POSIX"> - - -Intel, Celeron, EtherExpress, i386, - i486, Itanium, Pentium, 和 Xeon 是 Intel Corporation - 及其分支機構在美國和其他國家的商標或註冊商標。"> -Celeron"> -EtherExpress"> -i386"> -i486"> -Intel"> -Itanium"> -Pentium"> -Xeon"> -Core"> - - -Intuit 和 Quicken 是 Intuit Inc., 或其子公司在美國和其他國家的商標或註冊商標。"> - - - -Iomega, Zip, 和 Jaz 是 Iomega Corporation - 在美國和/或其他國家的商標或註冊商標。"> -Zip"> -Jaz"> - -Lantronix 和 EasyIO 是 Lantronix Corporation 的商標。"> -EasyIO"> - - -Linux 是 Linus Torvalds 的註冊商標。"> - -Linux"> - - -LSI Logic, AcceleRAID, eXtremeRAID, - MegaRAID 和 Mylex 是 LSI - Logic Corp 的商標或註冊商標。"> -AcceleRAID"> -MegaRAID"> -Mylex"> - -Macromedia, Flash, 以及 Shockwave - Macromedia, Inc. 在美國和/或其他國家的商標或註冊商標。"> -Flash"> -Macromedia"> - -Microsoft, IntelliMouse, MS-DOS, - Outlook, Windows, Windows Media, 和 Windows NT 是 Microsoft Corporation - 在美國和/或其他國家的商標或註冊商標。"> -IntelliMouse"> -Microsoft"> - -MS-DOS"> -Outlook"> -Windows"> -Windows Media"> - -Windows NT"> - - -MIPS 和 R4000 是 MIPS Technologies, Inc. - 在美國以及其他國家的註冊商標。"> -MIPS"> - - -MySQL"> - - -M-Systems 和 DiskOnChip 是 M-Systems Flash Disk - Pioneers, Ltd. 的商標或註冊商標。"> -DiskOnChip"> - - -NetBSD是 NetBSD Foundation的註冊商標。"> - -Netscape 以及 Netscape Navigator - 是 Netscape Communications Corporation 在美國和其他國家的註冊商標。"> -Netscape"> -Netscape Navigator"> - - -GateD 和 NextHop 是 NextHop 在美國和其他國家的商標或註冊商標。"> -GateD"> - -Motif, OSF/1, 和 UNIX - 是 The Open Group 在美國和其他國家的註冊商標; IT DialTone 和 The Open Group - 是其商標。"> -UNIX是 Open Group - 在美國和其它國家的註冊商標。"> -Motif"> -UNIX"> - - - -Oracle 是 Oracle Corporation 的註冊商標。"> -Oracle"> - - -PowerQuest 和 PartitionMagic 是 - PowerQuest Corporation 在美國和/或其他國家的註冊商標。"> -PartitionMagic"> - - -QUALCOMM 和 Eudora 是 QUALCOMM Incorporated - 的註冊商標。"> -Eudora"> - - -RealNetworks, RealPlayer, 和 - RealAudio 是 RealNetworks, Inc. 的註冊商標。"> -RealPlayer"> - - - -Red Hat, RPM, 是 Red Hat, Inc. - 在美國和其他國家的註冊商標。"> - - -SAP, R/3, 和 mySAP 是 SAP AG - 在德國以及許多其他國家的商標或註冊商標。"> -R/3"> -SAP"> - - -Silicon Graphics, SGI, 和 OpenGL 是 Silicon - Graphics, Inc. 在美國和/或其他國家的註冊商標。"> -OpenGL"> - -Sparc, Sparc64, 以及 - UltraSPARC 是 SPARC International, Inc 在美國和其他國家的商標。 - 為 Sun Microsystems, Inc. 所開發的架構,包含 SPARC 商標的產品。"> -Sparc"> -Sparc64"> -UltraSPARC"> - - -Sun, Sun Microsystems, Java, Java Virtual Machine, JDK, JSP, JVM, Netra, Solaris, StarOffice - 和 SunOS 是 - Sun Microsystems, Inc. 在美國和其他國家的商標或註冊商標。"> -Java"> -Java Virtual Machine"> -JDK"> -JRE"> -JSP"> -JVM"> -Netra"> -Solaris"> -StarOffice"> -Sun"> -SunOS"> - - -Symantec 和 Ghost 是 - Symantec Corporation 在美國和其他國家的註冊商標。"> - - -MATLAB 是 - The MathWorks, Inc. 的註冊商標。"> -MATLAB"> - -SpeedTouch 是 Thomson 的商標。"> -SpeedTouch"> - - - -U.S. Robotics 和 Sportster 是 U.S. Robotics Corporation 的註冊商標。"> -Sportster"> -U.S. Robotics"> - - -Waterloo Maple 和 Maple 是 Waterloo Maple Inc 的商標或註冊商標"> -Maple"> - - -Mathematica 是 Wolfram Research, Inc 的註冊商標。"> -Mathematica"> - - -VMware 是 VMware, - Inc. 的商標"> - - -Xen"> - -XFree86 是 The - XFree86 Project, Inc 的商標。."> -XFree86"> - - -Ogg Vorbis 和 Xiph.Org 是 Xiph.Org 的商標。"> - -許多製造商和經銷商使用一些稱為商標的圖案或文字設計來彰顯自己的產品。 - 本文中出現的眾多商標,以及 FreeBSD Project 本身廣所人知的商標,後面將以 '™' 或 '®' 符號來標註。"> diff --git a/zh_TW.UTF-8/share/xml/urls.ent b/zh_TW.UTF-8/share/xml/urls.ent deleted file mode 100644 index cf403ccd31..0000000000 --- a/zh_TW.UTF-8/share/xml/urls.ent +++ /dev/null @@ -1,125 +0,0 @@ - - - - - - - - - - - - -]]> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -- cgit v1.2.3