新聞中心
- 7.1. 文檔資源
-
- 7.1.1. 手冊(cè)頁面
- 7.1.2. info文檔
- 7.1.3. 特定的文檔
- 7.1.4. 網(wǎng)站
- 7.1.5. 入門指導(dǎo)類文檔(HOWTO文檔)
- 7.2. 通常步驟
-
- 7.2.1. 配置一個(gè)程序
- 7.2.2. 監(jiān)控后臺(tái)進(jìn)程在做什么
- 7.2.3. 通過郵件列表尋求幫助
- 7.2.4. 報(bào)告棘手的問題所存在的Bug
對(duì)于一名系統(tǒng)管理員來說,面對(duì)任何已知或者未知的情況仍然能從容面對(duì)是一種重要的技能。本章將給出一些方法,用意幫助您定位出引發(fā)問題的原因,希望能幫助你們解決問題。

明水網(wǎng)站制作公司哪家好,找創(chuàng)新互聯(lián)建站!從網(wǎng)頁設(shè)計(jì)、網(wǎng)站建設(shè)、微信開發(fā)、APP開發(fā)、響應(yīng)式網(wǎng)站建設(shè)等網(wǎng)站項(xiàng)目制作,到程序開發(fā),運(yùn)營維護(hù)。創(chuàng)新互聯(lián)建站成立與2013年到現(xiàn)在10年的時(shí)間,我們擁有了豐富的建站經(jīng)驗(yàn)和運(yùn)維經(jīng)驗(yàn),來保證我們的工作的順利進(jìn)行。專注于網(wǎng)站建設(shè)就選創(chuàng)新互聯(lián)建站。
7.1. 文檔資源
在你能搞懂引發(fā)問題的原因之前,你需要從原理上明白程序及其所包含的子程序所扮演的角色。為此,最好的方法是參考程序的文檔;但這些文檔往往數(shù)量巨大且分散,因此你也需要知道如何找到這些文檔。
7.1.1. 手冊(cè)頁面
文化 讀那該死的文檔去!(RTFM)
本標(biāo)題縮寫意思是“讀那該死的文檔!(Read the F**king Manual)”,當(dāng)然,也可以翻譯得文雅一些,“讀那些好文檔(Read the Fine Manual)”。這個(gè)短語經(jīng)常是用來回復(fù)新手的提問時(shí),表達(dá)略帶厭煩的情緒。有人認(rèn)為這種回應(yīng)略顯粗魯,畢竟對(duì)于提問的人來說,他們未必會(huì)介意去閱讀文檔。但也有人認(rèn)為,這種經(jīng)典的回應(yīng)方式聊勝于無(至少指出已有的文檔包含了相關(guān)的信息),畢竟也比直接得到一個(gè)滿是抱怨并且十分冗長答復(fù)要好些。 在任何情況下,如果有人用“RTFM”來回應(yīng)你,通常并沒有任何冒犯的意思。要是這種回應(yīng)讓你覺得腦火,要么你就直接無視,要么你最好在提問之初就說明在手冊(cè)當(dāng)中沒有找到相關(guān)信息。在上論壇提問前,最好也能描述你已經(jīng)尋找資料的一些步驟。Eric Raymod曾發(fā)表過一篇指引性的文章,就如何提問給出了建議,這能有效避免常識(shí)性的錯(cuò)誤并得到有用的答案。文章地址是: → http://catb.org/~esr/faqs/smart-questions.html Manual pages, while relatively terse in style, contain a great deal of essential information. We will quickly go over the command for viewing them, provided by the
man-db package. Simply type
man manual-page — the manual page usually goes by the same name as the command whose documentation is sought. For example, to learn about the possible options for the
cp command, you would type the
man cp command at the shell prompt (see sidebar
基本知識(shí) 命令行解析器 - Shell).
基本知識(shí) 命令行解析器 - Shell
命令行解析器,通常也稱作“shell”, 是一種執(zhí)行用戶輸入或者文本命令的程序。在交互模式下,會(huì)顯示一個(gè)提示符(普通用戶會(huì)顯示一個(gè)
$ 符號(hào),管理員用戶會(huì)顯示一個(gè)
#),用來表示shell已經(jīng)就緒,可以讀取一個(gè)新的命令。附錄 B,
簡(jiǎn)短輔導(dǎo)課程 描述了shell的基本使用方法。 默認(rèn)且經(jīng)常會(huì)被用到的shell程序是
bash (Bourne Again SHell), 當(dāng)然也有其他,包括
dash,
csh,
tcsh 和
zsh等等。 Among other things, most shells offer help (type
help) and assistance during input at the prompt, such as the completion of command or file names (which you can generally activate by pressing the
tab key), or recalling previous commands (history management; i.e. check out the mappings for "page up" and "page down" in
/etc/inputrc). Man pages not only document commands and programs accessible from the command line, but also configuration files, system calls, library functions, and so forth. Sometimes names can collide. For example, the shell's
read command has the same name as the
read system call. This is why manual pages are organized in numbered sections:
- 1
- 可從命令行執(zhí)行的程序
- 2
- 系統(tǒng)調(diào)度(由內(nèi)核提供的函數(shù))
- 3
- 庫函數(shù)(有系統(tǒng)庫提供的函數(shù))
- 4
- 設(shè)備(在Unix下,設(shè)備就是一些特殊的文件,通常放置在
/dev/目錄下); - 5
- 配置文件(格式與約定)
- 6
- 游戲
- 7
- 系統(tǒng)宏與標(biāo)準(zhǔn)集
- 8
- 系統(tǒng)管理命令
- 9
- 內(nèi)核例程。
如果出現(xiàn)上述的沖突情況,你可以在使用手冊(cè)頁面查看文檔的時(shí)候指定對(duì)應(yīng)的分類數(shù)字(section):例如瀏覽系統(tǒng)調(diào)用
read的文檔時(shí),你可以鍵入
man 2 read。如果不指定具體的分類數(shù)字(section),系統(tǒng)則會(huì)從小到大獲取第一個(gè)數(shù)字作為默認(rèn)值。因此直接輸入
man shadow的時(shí)候,系統(tǒng)就會(huì)返回
shadow(5)的文檔內(nèi)容,這是在分類頁面1-4都沒有
shadow這個(gè)命令的手冊(cè)頁面所導(dǎo)致的。
TIP whatis命令
如果你只是想顯示一些簡(jiǎn)短的描述來確認(rèn)所輸入的命令是否自己所需,不希望顯示完整的手冊(cè)頁面的話,只需要輸入
whatis command就可以了。
$whatis scpscp (1) - secure copy (remote file copy program)
這部分描述同樣包含在手冊(cè)頁面的
NAME部分。 當(dāng)然,如果你連命令的名字都不知道,手冊(cè)頁面恐怕就無能為力了。遇到這種情況,我們可以用命令
apropos 來解決,這個(gè)命令能幫你查詢手冊(cè)頁面的功能,或者簡(jiǎn)要的描述。每個(gè)手冊(cè)頁面都有一個(gè)單行的描述。
apropos 返回手冊(cè)頁面請(qǐng)求的關(guān)鍵字列表。關(guān)鍵字選擇得恰當(dāng),就能通過此工具很快得到結(jié)果。
例 7.1. 通過apropos查找 cp命令
$apropos "copy file"cp (1) - copy files and directories cpio (1) - copy files to and from archives hpcopy (1) - copy files from an HFS+ volume install (1) - copy files and set attributes ntfscp (8) - copy file to an NTFS volume.
提示通過以下鏈接瀏覽
很多的手冊(cè)頁面都有"SEE ALSO"的段落,通常位于內(nèi)容的最后。其作用是同時(shí)指出其他相關(guān)的類似命令,或者外部的文檔。這樣就可以在不選擇第一個(gè)選項(xiàng)的情況下,仍可尋找到相關(guān)文檔。 The
man command is not the only means of consulting the manual pages, since
khelpcenter and
konqueror (by KDE) and
yelp (under GNOME) programs also offer this possibility. There is also a web interface, provided by the
man2html package, which allows you to view manual pages in a web browser. On a computer where this package is installed, use this URL after following the instructions in
/usr/share/doc/man2html/README.Debian: → http://localhost/cgi-bin/man/man2html 這個(gè)工具需要一個(gè)web服務(wù)器,因此你應(yīng)該將其安裝包安裝在一臺(tái)服務(wù)器上:本地網(wǎng)絡(luò)的所有用戶將會(huì)因此受惠(包括非linux的機(jī)器),也不需要在每臺(tái)工作站上面都安裝http服務(wù)。如果你的服務(wù)器同時(shí)也能從外部網(wǎng)絡(luò)訪問的話,比較建議對(duì)這項(xiàng)服務(wù)的訪問限制在本地網(wǎng)絡(luò)的用戶。 Last but not least, you can view all manual pages available in Debian (even those that are not installed on your machine) on the
manpages.debian.org service. It offers each manual page in multiple versions, one for each Debian release. → https://manpages.debian.org
DEBIAN政策對(duì)手冊(cè)頁面的規(guī)定
Debian要求每個(gè)程序都必須配備手冊(cè)頁面。如果上游的作者沒有提供這份文檔,Debian軟件包的維護(hù)者就必須為讀者編寫一份最少內(nèi)容的頁面作為原文檔。
7.1.2. info文檔
GNU項(xiàng)目為其大部分的程序編寫了
info格式的文檔;這將解釋為何很多手冊(cè)頁面的內(nèi)容直接引用
info 文檔的內(nèi)容。這種格式有一定的優(yōu)勢(shì),但默認(rèn)的查看程序(也就是
info 命令)卻會(huì)使得查看文檔變得復(fù)雜。更好的建議,是使用
pinfo 程序來替代默認(rèn)的程序(使用
pinfo 的軟件包)。
info文檔擁有一個(gè)分層次的結(jié)構(gòu),如果在調(diào)用
pinfo 命令的時(shí)候沒有輸入任何參數(shù),它將會(huì)列出第一層所有有效的節(jié)點(diǎn)。通常來說,節(jié)點(diǎn)名稱與命令的名稱相對(duì)應(yīng)。 With
pinfo navigating between these nodes is easy to achieve with the arrow keys. Alternatively, you could also use a graphical browser, which is a lot more user-friendly. Again,
konqueror and
yelp work; the
info2www package also provides a web interface. → http://localhost/cgi-bin/info2www 需要注意的是,
info 系統(tǒng)不支持翻譯功能,這點(diǎn)與
man 系統(tǒng)不一樣。因此
info 總是以英文編寫。然而,當(dāng)你嘗試用
pinfo 命令訪問一個(gè)并不存在的
info頁面的時(shí)候,將會(huì)回退到同名的
man 頁面(如果該頁面存在),這時(shí)的頁面有可能是被翻譯了的。
7.1.3. 特定的文檔
每個(gè)軟件包都包含起自身的文檔。即使是最缺乏文檔的包也至少會(huì)包含
README 文件,里面包含了有趣并且(或者)重要的信息。這些文檔通常會(huì)被安裝在
/usr/share/doc/package/ 目錄(這里的
package 代表軟件包的名字)。當(dāng)文件特別巨大的情況下,這些文檔不會(huì)包含在程序的主包當(dāng)眾,而是另外提供一個(gè)通常以
package-doc 的包名格式另外提供一個(gè)軟件包。通過主包名稱通常都能很快找到文檔包。 The
/usr/share/doc/package/ directory also contains some files provided by Debian which complete the documentation by specifying the package's particularities or improvements compared to a traditional installation of the software. The
README.Debian file also indicates all of the adaptations that were made to comply with the Debian Policy. The
changelog.Debian.gz file allows the user to follow the modifications made to the package over time: it is very useful to try to understand what has changed between two installed versions that do not have the same behavior. Finally, there is sometimes a
NEWS.Debian.gz file which documents the major changes in the program that may directly concern the administrator (see 第 6.7.2 節(jié) “處理升級(jí)后的問題”).
7.1.4. 網(wǎng)站
在大部分情況下,自由軟件(Free software)都擁有各自的網(wǎng)站,網(wǎng)站上面提供程序發(fā)布的地址,以及提供了開發(fā)者和用戶交流的社區(qū)。這些網(wǎng)站通常都有以不同形式組織起來的如下一些信息:官方文檔, FAQ(常見問題列表), 郵件列表和歸檔內(nèi)容等等。通常,你所遇到的問題都已經(jīng)被很多人提出過了的,這你就能在FAQ和郵件列表歸檔等方式找到解決的方法。同歸對(duì)搜索引擎指定搜索的域名和子域名,能切實(shí)有效的提高查找問題的效率。但凡搜索引擎所返回的頁面過多或者結(jié)果并非你所想要,你可以通過添加查詢關(guān)鍵字
debian 來限制結(jié)果和目標(biāo)的相關(guān)信息。
TIP From error to solution
如果軟件返回了一個(gè)特定的錯(cuò)誤信息,你可以將這段信息以半角雙引號(hào)
"括起(這樣能保證以完整的句子進(jìn)行查找,而不是單個(gè)單詞),輸入到搜索引擎中進(jìn)行查找。在大部分情況下,第一條鏈接就會(huì)包括你所需要的答案。 在其它情況下,會(huì)出現(xiàn)一種經(jīng)常遇到的錯(cuò)誤信息,例如 “Permission denied”。在這種情況下,你最好檢查一下相關(guān)元素的權(quán)限情況如何(文件、用戶ID,組別等)。 If you do not know the address for the software's website, there are various means of getting it. First, check if there is a
Homepage field in the package's meta-information (
apt show package). Alternately, the package description may contain a link to the program's official website. If no URL is indicated, look at
/usr/share/doc/package/copyright. The Debian maintainer generally indicates in this file where they got the program's source code, and this is likely to be the website that you need to find. If at this stage your search is still unfruitful, consult a free software directory, such as FSF's Free Software Directory, or search directly with a search engine, such as Google, DuckDuckGo, Yahoo, etc. → https://directory.fsf.org/wiki/Main_Page You might also want to check the Debian wiki, a collaborative website where anybody, even simple visitors, can make suggestions directly from their browsers. It is used equally by developers who design and specify their projects, and by users who share their knowledge by writing documents collaboratively. → https://wiki.debian.org/
7.1.5. 入門指導(dǎo)類文檔(HOWTO文檔)
A
HOWTO is a document that describes, in concrete terms and step by step, “how to” reach a predefined goal. The covered goals are relatively varied, but often technical in nature: for example, setting up IP Masquerading, configuring software RAID, installing a Samba server, etc. These documents often attempt to cover all of the potential problems likely to occur during the implementation of a given technology. Many such tutorials are managed by the Linux Documentation Project (LDP), whose website hosts all of these documents: → https://www.tldp.org/ Debian also provides tutorials for its users: → https://www.debian.org/doc/ All these documents should be taken with a grain of salt. They are often several years old; the information they contain is sometimes obsolete. This phenomenon is even more frequent for their translations, since updates are neither systematic nor instant after the publication of a new version of the original documents. Further many tutorials nowadays are provided by bloggers, sharing their individual solution with the interested reader. They often lack important information, i.e. the reason why some configuration has been chosen over another, or why some option has been enabled or disabled. Because blogging and creating own websites made it so easy to share, many of these often short tutorials exist, but only a few are actively maintained and well-kept. This can make it hard, to find the "right" one for you. This is all part of the joys of working in a volunteer environment and without constraints…
網(wǎng)頁名稱:【Debian管理員手冊(cè)】第?7?章?問題的解決與相關(guān)信息的檢索
鏈接分享:http://www.dlmjj.cn/article/ccsdscs.html


咨詢
建站咨詢
