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

7.1.2. info文档

The GNU project has written manuals for most of its programs in the info format; this is why many manual pages refer to the corresponding info documentation. This format offers some advantages, but the default program to view these documents (it is called info) is also slightly more complex. You would be well advised to use pinfo instead (from the pinfo package).
The info documentation has a hierarchical structure, and if you invoke pinfo without parameters, it will display a list of the nodes available at the first level. Usually, nodes bear the name of the corresponding commands.
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 also provides a web interface.
Note that the info system is not suitable for translation, unlike the man page system. info documents are thus almost always in English. However, when you ask the pinfo program to display a non-existing info page, it will fall back on the man page by the same name (if it exists), which might be translated.

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. Problems that you may encounter have often 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 FSF's Free Software Directory, or search directly with a search engine, such as Google, DuckDuckGo, Yahoo, etc.
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.
Many such tutorials are managed by the Linux Documentation Project (LDP), whose website hosts all of these documents:
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…