Product SiteDocumentation Site

Глава 7. Решение проблем и поиск необходимой информации

7.1. Источники документации
7.1.1. Страницы руководств
7.1.2. Документы info
7.1.3. Специфическая документация
7.1.4. Интернет-ресурсы
7.1.5. Практические руководства (HOWTO)
7.2. Общие процедуры
7.2.1. Настраиваем программу
7.2.2. Наблюдение за работой демонов
7.2.3. Поиск помощи в списках рассылки
7.2.4. Отчёт об ошибке в случае сложной проблемы
Наиболее важным навыком администратора является способность справляться с любой ситуацией, известной или неизвестной. В этой главе приведены несколько методов, которые, надеемся, позволят вам изолировать причину любой встретившейся вам проблемы и таким образом решить её.

7.1. Источники документации

Прежде чем вы сможете разобраться в сути проблемы, вы должны понять теоретическую роль каждой программы, вовлечённой в данную проблему. Лучший способ сделать это — обратиться к документации программы; но поскольку документации может быть достаточно много и она может быть распределена по различным источникам, то вам следует знать о тех местах, где её можно найти.

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, 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 К ОСНОВАМ Оболочка, командный интерпретатор).
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
команды, выполняемые из командной строки;
2
системные вызовы (функции, предоставляемые ядром);
3
библиотечные функции (предоставляемые системными библиотеками);
4
устройства (в Unix-подобных системах они являются специальными файлами и обычно находятся в каталоге /dev/);
5
конфигурационные файлы (форматы и соглашения);
6
игры;
7
наборы макросов и стандарты;
8
команды администрирования системы;
9
процедуры ядра.
Вы можете указать необходимую секцию руководства: для чтения документации по системному вызову read вам следует набрать команду man 2 read. В том случае, когда секция явно не указана, страница руководства будет отображена из первой найденной секции, содержащей запрошенное имя. Поэтому man shadow выводит shadow(5), так как страницы руководства для shadow отсутствуют в секциях с 1 по 4.
Разумеется, если вам не известны имена команд, то от руководства будет мало пользы. В этом случае поможет команда apropos, которая выполняет поиск в страницах руководств, точнее, в их секциях коротких описаний. Каждая страница руководства начинается с однострочного описания. apropos выводит список тех страниц руководств, что содержат запрашиваемые ключевые слова в коротком описании. В случае правильного выбора ключевых слов вы найдёте необходимые вам команды.

Пример 7.1. Поиск cp с помощью apropos

$ apropos "copy file"
cp (1)               - copy files and directories
cp (1posix)          - copy files
cpio (1)             - copy files to and from archives
exec (1posix)        - execute commands and open, close, or copy file descriptors
install (1)          - copy files and set attributes
ntfscp (8)           - copy file to an NTFS volume.
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:
Для использования этой утилиты необходим браузер. Именно по этой причине вам следует выбрать установку данного пакета на одном из ваших серверов: все пользователи локальной сети будут в выигрыше при наличии подобной службы (включая пользователей не-Linux машин) и это позволит вам не устанавливать HTTP сервер на каждой рабочей станции. В случае когда ваш сервер доступен из других сетей, доступ к этой службе желательно ограничить только локальной сетью.
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.

7.1.2. Документы info

В рамках проекта GNU подготовлены руководства для большинства программ проекта в формате info, поэтому страницы руководств ссылаются на соответствующую документацию info. У этого формата есть определённые преимущества, но стандартная программа для просмотра таких документов несколько сложна (она называется info). Как её замену, вам настоятельно советуется использовать pinfo из пакета pinfo.
info имеет иерархическую структуру, и если вы вызовите pinfo без параметров, то отобразится список узлов первого уровня. Обычно узлы носят имена соответствующих команд.
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.
Следует отметить, info, в отличие от man, не подходит для перевода. Поэтому документы info почти всегда написаны на английском языке. Однако если вы попросите программу pinfo отобразить несуществующую страницу 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 (see Раздел 6.7.2, «Решение проблем после обновления»).

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 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 new 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. Практические руководства (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:
Debian also provides tutorials for its users:
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 personal 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…