dk14: переводы
Linux Fundamentals, Part 4 / Основы Linux от основателя Gentoo. Часть 4
→For example, a default configuration of logrotate might rotate the logs weekly, keeping 4 weeks worth of backlogs (by appending a sequence number to the filename), and compress the backlogs to save space. Additionally, the program can be configured to deliver a SIGHUP to syslogd so that the daemon will notice the now-empty log files and append to them appropriately.
0 Например, по умолчанию logrotate может чередовать логи еженедельно, сохраняя 4 недели бэклогов (добавляя номер последовательности к имени файла), сжимая их (бэклоги) для сохранения места. Кроме того, программа может быть сконфигурирована чтобы посылать сигнал SIGHUP демону syslogd, так что-бы он заметил непустые лог-файлы и надлежащим образом к ним присоединился.
→logrotate The log files in /var/log will grow over time, and potentially could fill the filesystem. It is advisable to employ a program such as logrotate to manage the automatic archiving of the logs. The logrotate program usually runs as a daily cron job, and can be configured to rotate, compress, remove, or mail the log files.
0 logrotate. Лог-файлы в /var/log со временем растут и потенциально могут переполнить файловую систему. Целесообразно воспользоваться программой навроде logrotate чтобы управлять автоматическим архивированием логов. Logrotate обычно запускается как ежедневная задача планировщика cron, и может быть сконфигурирована чтобы чередовать, сжимать, удалять или посылать по почте log-файлы.
→A security note You should beware that the log files written to by syslogd will be created by the program if they don't exist. Regardless of your current umask setting, the files will be created world-readable. If you're concerned about the security, you should chmod the files to be read-write by root only. Additionally, the logrotate program (described below) can be configured to create new log files with the appropriate permissions. The syslog daemon always preserves the current attributes of an existing log file, so you don't need to worry about it once the file is created.
0 Примечание по безопасности. Стоит остерегаться автоматического создания лог-файлов программой syslog при их отсутствии, т.к. независимо от текущих настроек прав доступа в umask, файлы будут созданы читаемыми для всех (world-readable). Если вы беспокоитесь о безопасности, нужно установить разрешения(посредством chmod) на чтение-запись только суперпользователю. Кроме того, программа logrotate(описанная далее) может быть сконфигурирована для создания новых лог-файлов с подходящими правами доступа. Демон syslog всегда сохраняет текущие атрибуты существующего log-файла, так что не стоит об этом беспокоиться если файл уже был однажды создан.
→Note that you need to inform the syslog daemon of changes to the configuration file before they are put into effect. Sending it a SIGHUP is the right method, and you can use the killall command to do this easily:
0 Стоит отметить, что необходимо оповещать демон syslog об изменениях в конфиге прежде чем они приступят в силу. Лучше это сделать отсылкой сигнала SIGHUP, который проще всего послать командой killall:
→Hopefully this overview of the configuration file helps you to get a feel for the strength of the syslog system. You should read the syslog.conf(5) man-page for more information prior to making changes. Additionally the syslogd(8) man-page supplies lots more detailed information.
0 Надеюсь, этот обзор кофига поможет вам почувствовать себя увереннее при работе с системой syslog. Прежде чем вносить какие-либо изменения, стоит почитать syslog.conf(5) страницу руководства для более подробной информации. Также, syslogd(8) страница даст множество более подробной информации.
→For more information on logrotate, see the logrotate(8) man page, which contains a description of the program and the syntax of the configuration file.
Advanced topic -- klogd
Advanced topic -- klogd
0 Для более подробной информации по logrotate, см. logrotate(8) страницу руководства, которая содержит описание программы и синтаксис конфигурационного файла.
Дополнение -- klogd
Дополнение -- klogd
→# killall -HUP syslogd
0 # killall -HUP syslogd
→First, the syslog daemon is actually part of the sysklogd package, which contains a second daemon called klogd. It's klogd's job to receive information and error messages from the kernel, and pass them on to syslogd for categorization and logging. The messages received by klogd are exactly the same as those you can retrieve using the dmesg command. The difference is that dmesg prints the current contents of a ring buffer in the kernel, whereas klogd is passing the messages to syslogd so that they won't be lost when the ring wraps around.
Advanced topic -- alternate loggers
Advanced topic -- alternate loggers
0 Во-первых демон syslog на самом деле - часть пакета syslogd, который также содержит второй демон klogd. Именно klogd отвечает за получение информационных сообщений и сообщений об ошибках из ядра, и передает их в syslogd для категоризации и журналирования. Сообщения, которые получает klogd точно такие-же как при выводе утилитой dmesg кольцевого буфера ядра. В то время как klogd передает сообщения в syslogd так, чтобы они не потерялись при перезаписи новых записей в кольце поверх старых (в следующем "витке" указателя буфера).
Дополнительные темы -- альтернативные логгеры.
Дополнительные темы -- альтернативные логгеры.
→Before moving away from syslog, I'd like to note a couple of advanced topics for ambitious readers. These tips may save you some grief when trying to understand syslog-related topics.
0 Прежде чем закончить рассмотрение syslog, хотелось-бы затронуть некоторые дополнительные вопросы для претенциозных читателей. Эти советы могут уберечь вас от некоторых бед, при попытке понять темы, связанные с syslog.
→Second, there are alternatives to the standard sysklogd package. The alternatives attempt to be more efficient, easier to configure, and possibly more featureful than sysklogd. Syslog-ng and Metalog seem to be some of the more popular alternatives; you might investigate them if you find sysklogd doesn't provide the level of power you need.
0 Во вторых, существуют альтернативы стандартному пакету sysklogd. Они пытаются быть эффективнее, простыми в настройке, и возможно - более функциональными чем sysklogd. Syslog-ng и Metalog похоже самые популярные альтернативы; Их можно исследовать если syslogd покажется недостаточно мощным средством для ваших потребностей.
→Third, you can log messages in your scripts using the logger command. See the logger(1) man page for more information.
0 В третьих, в сценариях можно вести лог сообщений используя команду logger. Подробнее см. logger(1) в руководстве.
→priority: Specifies the minimum severity of the message, meaning that messages of this priority and higher will be matched by this rule. The valid keywords for priority are debug, info, notice, warning, err, crit, alert, and emerg.
0 priority (приоритет) - определяет минимальный вес сообщения, в том смысле, что под это правило будут попадать сообщения с указанным или большим приоритетом. Допустимы следующие ключи: debug, info, notice, warning, err, crit, alert и emerg.
Резюме
- Пол:
- мужчина
- Родной язык:
- русский
- С нами:
-
с 9 ноября 2010 г.
(5823 дня)
Не является членом клуба. - Деятельность:
-
61 версия перевода
с общим рейтингом 7
2 комментария
Карма: 1 (оценок: 1)
