通常情况下,进程通过“/dev/log”向syslogd发送消息。由于“虚拟”根环境的限制,这种通信被禁止。因此syslogd需要改为监听“/var/named/chroot/dev/log”。可以通过编辑syslog的启动脚本来设定新的监听地点。
编辑syslog脚本(vi +24 /etc/rc.d/init.d/syslog),改变SYSLOGD_OPTIONS

  1. [root@ns8 log]# cat /etc/rc.d/init.d/syslog   
  2. #!/bin/bash  
  3. #  
  4. # syslog        Starts syslogd/klogd.  
  5. #  
  6. #  
  7. # chkconfig: 2345 12 88  
  8. # description: Syslog is the facility by which many daemons use to log \  
  9. # messages to various system log files.  It is a good idea to always \  
  10. # run syslog.  
  11. ### BEGIN INIT INFO  
  12. # Provides: $syslog  
  13. ### END INIT INFO  
  14.  
  15. # Source function library.  
  16. . /etc/init.d/functions  
  17.  
  18. [ -f /sbin/syslogd ] || exit 0  
  19. [ -f /sbin/klogd ] || exit 0  
  20.  
  21. # Source config  
  22. if [ -f /etc/sysconfig/syslog ] ; then  
  23.         . /etc/sysconfig/syslog  
  24. else  
  25.         #SYSLOGD_OPTIONS="-m 0" 
  26.         SYSLOGD_OPTIONS="-m 0 -a /var/named/chroot/dev/log" #修改此处
  27.         KLOGD_OPTIONS="-2" 
  28. fi  
  29. ... 
  1. [root@ns8 log]# vi /etc/sysconfig/syslog   
  2.  
  3. # Options to syslogd  
  4. # -m 0 disables 'MARK' messages.  
  5. # -r enables logging from remote machines  
  6. # -x disables DNS lookups on messages recieved with -r  
  7. # See syslogd(8) for more details  
  8. #SYSLOGD_OPTIONS="-m 0" 
  9. SYSLOGD_OPTIONS="-m 0 -a /var/named/chroot/dev/log" #修改此处
  10. # Options to klogd  
  11. # -2 prints all kernel oops messages twice; once for klogd to decode, and  
  12. #    once for processing with 'ksymoops'  
  13. # -x disables all klogd processing of oops messages entirely  
  14. # See klogd(8) for more details  
  15. KLOGD_OPTIONS="-x" 

本日志由 flyinweb 于 2009-09-01 11:40:09 发表,目前已经被浏览 4595 次,评论 0 次;

作者添加了以下标签: BINDchroot

引用通告:http://www.517sou.net/Article/220/Trackback.ashx

评论订阅:http://www.517sou.net/Article/220/Feeds.ashx

相关文章

评论列表

    暂时没有评论
(必填)
(必填,不会被公开)