Product SiteDocumentation Site

第 7 章 问题的解决与相关信息的检索

7.1. Documentation Sources
7.1.1. 手册页面
7.1.2. info文档
7.1.3. 特定的文档
7.1.4. 网站
7.1.5. Tutorials (HOWTO)
7.2. 通常步骤
7.2.1. 配置一个程序
7.2.2. 监控后台进程在做什么
7.2.3. 通过邮件列表寻求帮助
7.2.4. 报告棘手的问题所存在的Bug
对于一名系统管理员来说,面对任何已知或者未知的情况仍然能从容面对是一种重要的技能。本章将给出一些方法,用意帮助您定位出引发问题的原因,希望能帮助你们解决问题。

7.1. Documentation Sources

Before you can understand what is really going on when there is a problem, you need to know the theoretical role played by each program involved in the problem. To do this, the best reflex to have is consult their documentation; but since these documentations are many and can be scattered far and wide, you should know all the places where they can be found.

7.1.1. 手册页面

Manual pages, while relatively terse in style, contain a great deal of essential information. We will quickly go over the command for viewing them. 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).
Man pages not only document programs accessible from the command line, but also configuration files, system calls, C 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. 可从命令行执行的程序
  2. 系统调度(由内核提供的函数)
  3. 库函数(有系统库提供的函数)
  4. devices (on Unix-like systems, these are special files, usually placed in the /dev/ directory);
  5. configuration files (formats and conventions);
  6. 游戏
  7. 系统宏与标准集
  8. 系统管理命令
  9. 内核程序
如果出现上述的冲突情况,你可以在使用手册页面查看文档的时候指定对应的分类数字(section):例如浏览系统调用read的文档时,你可以键入man 2 read。如果不指定具体的分类数字(section),系统则会从小到大获取第一个数字作为默认值。因此直接输入man shadow的时候,由于在分类页面1-4都没有这个命令的手册页面,系统就会返回 shadow(5)的文档内容。
Of course, if you do not know the names of the commands, the manual is not going to be of much use to you. This is the purpose of the apropos command, which helps you conduct a search in the manual pages, or more specifically in their short descriptions. Each manual page begins essentially with a one line summary. apropos returns a list of manual pages whose summary mentions the requested keyword(s). If you choose them well, you will find the name of the command that you need.

例 7.1. 通过apropos查找 cp

$ apropos "copy file"
cp (1)               - copy files and directories
cpio (1)             - copy files to and from archives
hcopy (1)            - copy files from or to an HFS volume
install (1)          - copy files and set attributes
并不仅仅man这个命令可以用来查看手册页面,在KDE环境中也可以使用konqueror,在GNOME当中可以用yelp命令,均可实现相同功能。而用 man2html 软件包甚至能提供手册页面的web接口,允许你通过网页浏览器来浏览手册页面。使用方法是在已经安装了这个软件包的计算机上浏览这个连接
这个工具需要一个web服务器,因此你应该将其安装包安装在一台服务器上:本地网络的所有用户将会因此受惠(包括非linux的机器),也不需要在每台工作站上面都安装http服务。如果你的服务器同时也能从外部网络访问的话,比较建议对这项服务的访问限制在本地网络的用户。

7.1.2. info文档

GNU项目为其大部分的程序编写了info格式的文档;这将解释为何很多手册页面的内容直接引用 info 文档的内容。这种格式有某些优势,但却会使得查看文档变得复杂。
查看这类文档的命令理所当然的是 info, 这个命令将查询的节点的名字做成参数对待。info 的文档有一个层次结构,如果在调用 info 命令的时候没有输入任何参数,它将会列出第一层所有有效的节点。通常来说,节点名称与命令的名称相对应。
info文档有导航控制的功能,但并非如直觉上那么简单易用。要熟悉这个功能的最好方法,就是在输入命令之后输入 h (表示 help 的意思),然后跟着指令的顺序进行练习。你同样可以使用图形浏览器进行上述动作,这样会对用户显得更加友好。并且, konqueroryelp 这两个命令在这里也有效。而 info2www 命令则提供了一个web接口,你可以访问
需要注意的是,info 系统不支持翻译功能,这点与 man 系统不一样。因此 info 总是以英文编写。然而,当你尝试用 info 命令访问一个并不存在的页面的时候,将会回退到同名的 man 页面,这时的页面有可能是被翻译了的。

7.1.3. 特定的文档

每个软件包都包含起自身的文档。即使是最缺乏文档的包也至少会包含 README 文件,里面包含了有趣并且(或者)重要的信息。这些文档通常会被安装在/usr/share/doc/package/ 目录(这里的 package 代表软件包的名字)。当文件特别巨大的情况下,这些文档不会包含在程序的主包当众,而是另外提供一个通常以 package-doc 的包名格式另外提供一个软件包。通过主包名称通常都能很快找到文档包。
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.

7.1.4. 网站

In most cases, free software programs have websites that are used to distribute it and to bring together the community of its developers and users. These sites are frequently loaded with relevant information in various forms: official documentation, FAQ (Frequently Asked Questions), mailing list archives, etc. Often, problems that you may have have already been the subject of many questions; the FAQ or mailing list archives may have a solution for it. A good mastery of search engines will prove immensely valuable to find relevant pages quickly (by restricting the search to the Internet domain or sub-domain dedicated to the program). If the search returns too many pages or if the results do not match what you seek, you can add the keyword debian to limit results and target relevant information.
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-cache 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 Freecode.com (formerly Freshmeat.net), or search directly with a search engine, such as Google or Yahoo.
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.

7.1.5. Tutorials (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.
许多这类的文档都是""由Linux文档项目(LDP)进行管理,该网站保存着所有这些文档,访问地址是:
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. This is part of the joys of working in a volunteer environment and without constraints…