Chinaunix首页 | 论坛 | 博客
  • 博客访问: 1770884
  • 博文数量: 184
  • 博客积分: 10122
  • 博客等级: 上将
  • 技术积分: 5566
  • 用 户 组: 普通用户
  • 注册时间: 2005-12-08 12:32
文章存档

2011年(1)

2008年(183)

我的朋友

分类: LINUX

2008-03-03 21:52:42

6.4. Replacing klogd on Linux

The syslog-ng application can replace both the syslogd and klogd daemons on Linux hosts. To replace klogd, complete the following steps:

# 注释 :syslog-ng 也能从内核获取日志,从而替换 klogd 的角色

#     -)1、首先是创建一个 source ,file()类型,读取 /proc/kmsg 文件

#     -)2、使用 log 连接

#     -)3、停止 klogd 进程

Procedure 6.3. Replacing klogd on Linux

  1. Add a file source pointing to /proc/kmsg to the syslog-ng configuration file.

      source s_kmsg { file("/proc/kmsg"); };            
    [Warning] Warning

    Do not use a pipe source to read /proc/kmsg; pipe opens the source in read-write mode and this may cause problems when using SELinux or similar security measures.

  2. Include the source defined in Step 1 in a log path.

  3. Stop klogd.

    [Warning] Warning

    Do not run klogd and syslog-ng simultaneously when using syslog-ng to read /proc/kmsg, as it might block syslog-ng.

阅读(1259) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~