named 스크립트 사용시 오류..
작성자 정보
- 김대현 작성
- 작성일
컨텐츠 정보
- 1,236 조회
- 0 추천
- 목록
본문
/etc/rc.d/init.d/named restart 시..
또는 stop시 실패가 뜹니다...
그래서 named restart 하면.. named 가.. 2개 또하면 3개 뜹니다 -_-;;;
기존 데몬을 죽이지 않고 계속 생성만 되는거네요 ;;
예전에 레드헷9 사용할때 이상 없었떤거 같은데.. ^^;;
이번에 페도라 코어5 최신버젼 설치 할때는.. 오류가 나네요..
소스입니다.. 잘못된부분 지적좀 ^^;
#!/bin/bash
# This shell script takes care of starting and stopping named.
#
# chkconfig: 2345 55 45
# description: Named (BIND) is a Domain Name Server (DNS) that is used
# to resolve host names to IP addresses.
#
# processname: named
# Source function library.
. /etc/init.d/functions
# Source networking configuration.
. /etc/sysconfig/network
# Source for additional options if we have them.
if [ -f /etc/sysconfig/named ] ; then
. /etc/sysconfig/named
fi
# Check that networking is up.
[ "${NETWORKING}" = "no" ] && exit 0
# If Named is not available stop now.
[ -f /usr/local/bind/sbin/named ] || exit 0
[ -f "${ROOTDIR}"/usr/local/bind/etc/named.conf ] || exit 0
# Path to the Named binary.
named=/usr/local/bind/sbin/named
RETVAL=0
prog="Named"
start() {
echo -n $"Starting $prog: "
if [ -n "${ROOTDIR}" -a "x${ROOTDIR}" != "x/" ]; then
OPTIONS="${OPTIONS} -t ${ROOTDIR}"
fi
daemon $named -u named ${OPTIONS}
RETVAL=$?
echo
[ $RETVAL -eq 0 ] && touch /var/lock/subsys/named
return $RETVAL
}
stop() {
echo -n $"Shutting down $prog: "
killproc $named
RETVAL=$?
echo
[ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/named
return $RETVAL
}
# See how we were called.
case "$1" in
start)
start
;;
stop)
stop
;;
status)
status $named
RETVAL=$?
;;
restart)
stop
start
RETVAL=$?
;;
condrestart)
if [ -f /var/lock/subsys/named ]; then
stop
start
RETVAL=$?
fi
;;
reload)
/usr/local/bind/sbin/rndc reload >/dev/null 2>&1 || /usr/bin/killall -HUP $named
;;
probe)
/usr/local/bind/sbin/rndc reload >/dev/null 2>&1 || echo start
;;
*)
echo $"Usage: $0 {start|stop|status|restart|condrestart|reload|probe}"
exit 1
esac
exit $RETVAL
관련자료
-
이전
-
다음