2011-01-19 4 views
1

我與this tutorial沿下面,我已經成功地就得到了作爲告訴我編輯的「SYSKLOGD」文件/etc/init.d/boot.d中設置Bind9名稱服務器。編輯/etc/init.d/sysklogd幫助?

的教程告訴我的一部分,爲了允許綁定活動的記錄,我需要更換線

SYSLOGD=""

SYSLOGD="-a /var/lib/named/dev/log" 

麻煩的是,我無法找到的第一行。

自本教程開始寫入以來sysklogd文件是否已更改?我應該自己插一行嗎?

下面是sysklogd的內容。對不起,它看起來很可怕,我試圖更好地格式化它,但它似乎並沒有發生在我身上。只希望它可以讓某些人回憶起記憶。

#! /bin/sh 
# /etc/init.d/sysklogd: start the system log daemon. 

### BEGIN INIT INFO 
# Provides:    sysklogd 
# Required-Start:  $remote_fs $time 
# Required-Stop:  $remote_fs $time 
# Should-Start:   $network 
# Should-Stop:   $network 
# Default-Start:  2 3 4 5 
# Default-Stop:   0 1 6 
# Short-Description: System logger 
### END INIT INFO 

PATH=/bin:/usr/bin:/sbin:/usr/sbin 

pidfile=/var/run/syslogd.pid 
binpath=/sbin/syslogd 

test -x $binpath || exit 0 

test ! -r /etc/default/syslogd || . /etc/default/syslogd 

. /lib/lsb/init-functions 

create_xconsole() 
{ 
    # Only proceed if /dev/xconsole is used at all 
    if ! grep -q '^[^#].*/dev/xconsole' /etc/syslog.conf 
    then 
     return 
    fi 

    if [ ! -e /dev/xconsole ]; then 
     mknod -m 640 /dev/xconsole p 
    else 
     chmod 0640 /dev/xconsole 
    fi 
    chown root:adm /dev/xconsole 
    test ! -x /sbin/restorecon || /sbin/restorecon /dev/xconsole 
} 
running() 
{ 
    # No pidfile, probably no daemon present 
    # 
    if [ ! -f $pidfile ] 
    then 
     return 1 
    fi 

    pid=`cat $pidfile` 

    # No pid, probably no daemon present 
    # 
    if [ -z "$pid" ] 
    then 
     return 1 
    fi 

    if [ ! -d /proc/$pid ] 
    then 
     return 1 
    fi 

    cmd=`cat /proc/$pid/cmdline | tr "\000" "\n"|head -n 1` 

    # No syslogd? 
    # 
    if [ "$cmd" != "$binpath" ] 
    then 
     return 1 
    fi 

    return 0 
} 

case "$1" in 
    start) 
    log_begin_msg "Starting system log daemon..." 
    create_xconsole 
    start-stop-daemon --start --quiet --pidfile $pidfile --name syslogd --startas $binpath -- $SYSLOGD 
    log_end_msg $? 
    test -d /lib/init/rw/sendsigs.omit.d || mkdir -p /lib/init/rw/sendsigs.omit.d 
    test ! -f /lib/init/rw/sendsigs.omit.d/sysklogd || rm -f /lib/init/rw/sendsigs.omit.d/sysklogd 
    ln -s $pidfile /lib/init/rw/sendsigs.omit.d/sysklogd 
    ;; 
stop) 
    log_begin_msg "Stopping system log daemon..." 
    start-stop-daemon --stop --quiet --pidfile $pidfile --name syslogd 
    log_end_msg $? 
    ;; 
    reload|force-reload) 
    log_begin_msg "Reloading system log daemon..." 
    start-stop-daemon --stop --quiet --signal 1 --pidfile $pidfile --name syslogd 
    log_end_msg $? 
    ;; 
    restart) 
    log_begin_msg "Restarting system log daemon..." 
    start-stop-daemon --stop --retry 5 --quiet --pidfile $pidfile --name syslogd 
    start-stop-daemon --start --quiet --pidfile $pidfile --name syslogd --startas $binpath -- $SYSLOGD 
    log_end_msg $? 
    ;; 
    reload-or-restart) 
    if running 
    then 
     $0 reload 
    else 
     $0 start 
    fi 
    ;; 
    *) 
    log_success_msg "Usage: /etc/init.d/sysklogd {start|stop|reload|restart|force-reload|reload-or-restart}" 
    exit 1 
esac 

exit 0 

回答

2

請看/etc/default/syslogd

+0

這裏沒事!非常感謝一百萬。 – 2011-01-19 10:18:45