<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
  "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
  <!ENTITY % general-entities SYSTEM "../general.ent">
  %general-entities;
]>

<sect1 id="ch-system-sysklogd" role="wrap" revision="sysv">
  <?dbhtml filename="sysklogd.html"?>

  <sect1info condition="script">
    <productname>sysklogd</productname>
    <productnumber>&sysklogd-version;</productnumber>
    <address>&sysklogd-url;</address>
  </sect1info>

  <title>Sysklogd-&sysklogd-version;</title>

  <indexterm zone="ch-system-sysklogd">
    <primary sortas="a-Sysklogd">Sysklogd</primary>
  </indexterm>

  <sect2 role="package">
    <title/>

    <para>Sysklogd 软件包包含记录系统消息的程序，
    例如在意外情况发生时内核给出的消息。</para>

    <segmentedlist>
      <segtitle>&buildtime;</segtitle>
      <segtitle>&diskspace;</segtitle>

      <seglistitem>
        <seg>&sysklogd-ch6-sbu;</seg>
        <seg>&sysklogd-ch6-du;</seg>
      </seglistitem>
    </segmentedlist>

  </sect2>

  <sect2 role="installation">
    <title>安装 Sysklogd</title>

	<para>首先，修复 klogd 中在特定情况下会发生段错误的问题，
    并修复一个过时的程序结构：</para>

<screen><userinput remap="pre">sed -i '/Error loading kernel symbols/{n;n;d}' ksym_mod.c
sed -i 's/union wait/int/' syslogd.c</userinput></screen>

    <para>编译该软件包：</para>

<screen><userinput remap="make">make</userinput></screen>

    <para>该软件包不包含测试套件。</para>

    <para>安装该软件包：</para>

<screen><userinput remap="install">make BINDIR=/sbin install</userinput></screen>

  </sect2>

  <sect2 id="conf-sysklogd" role="configuration">
    <title>配置 Sysklogd</title>

    <indexterm zone="conf-sysklogd">
      <primary sortas="a-Sysklogd">Sysklogd</primary>
      <secondary>configuring</secondary>
    </indexterm>

    <indexterm zone="conf-sysklogd">
      <primary sortas="e-/etc/syslog.conf">/etc/syslog.conf</primary>
    </indexterm>

    <para>执行以下命令，创建一个新的 <filename>/etc/syslog.conf</filename>
    文件：</para>

<screen><userinput>cat &gt; /etc/syslog.conf &lt;&lt; "EOF"
<literal># Begin /etc/syslog.conf

auth,authpriv.* -/var/log/auth.log
*.*;auth,authpriv.none -/var/log/sys.log
daemon.* -/var/log/daemon.log
kern.* -/var/log/kern.log
mail.* -/var/log/mail.log
user.* -/var/log/user.log
*.emerg *

# End /etc/syslog.conf</literal>
EOF</userinput></screen>

  </sect2>

  <sect2 id="contents-sysklogd" role="content">
    <title>Sysklogd 的内容</title>

    <segmentedlist>
      <segtitle>安装的程序</segtitle>

      <seglistitem>
        <seg>klogd 和 syslogd</seg>
      </seglistitem>
    </segmentedlist>

    <variablelist>
      <bridgehead renderas="sect3">简要描述</bridgehead>
      <?dbfo list-presentation="list"?>
      <?dbhtml list-presentation="table"?>

      <varlistentry id="klogd">
        <term><command>klogd</command></term>
        <listitem>
          <para>一个截获并记录内核消息的系统守护程序</para>
          <indexterm zone="ch-system-sysklogd klogd">
            <primary sortas="b-klogd">klogd</primary>
          </indexterm>
        </listitem>
      </varlistentry>

      <varlistentry id="syslogd">
        <term><command>syslogd</command></term>
        <listitem>
          <para>记录系统程序提供给日志系统的消息
          [每条消息至少包含时间戳和主机名，通常还包含程序的名字，
          但这依赖于日志守护进程的信任度设置。]</para>
          <indexterm zone="ch-system-sysklogd syslogd">
            <primary sortas="b-syslogd">syslogd</primary>
          </indexterm>
        </listitem>
      </varlistentry>

    </variablelist>

  </sect2>

</sect1>
