PDA

View Full Version : Named reload issue


ActiveDomain.NL
09-25-2003, 03:04 PM
Hello,

On my server and one of my client's servers (I didn't test the other servers) I have a small issue with reloading named. After one of my resellers or after I added a user/domain to the control panel, named isn't reloaded (the config/zone is created correctly). Also, when I use the reload function in DA (Show Services menu), I get an error without any information/details:

The following error has occured
---
Details

Also with SSH I'm not able to reload the named:
[root@da1 root]# service named reload
23023: no process killed
23022: no process killed
23021: no process killed
23020: no process killed
23018: no process killed

[root@da1 root]# ps -auxw | grep named
named 23018 0.0 0.5 11024 3008 ? S 22:52 0:00 named -u named

Restarting the named is possible with both the DA web interface and SSH. Only with SSH I get the following:

[root@da1 root]# service named restart
Stopping named: rndc: connect failed: connection refused

But it is able to stop and start the named. I'm not sure if this is wrong?

Both servers are running Red Hat 8.0. DirectAdmin is updated to the last version.

DirectAdmin Support
09-26-2003, 12:17 PM
Hello,

Since DirectAdmin doesn't install bind, im not sure what boot script is being used to do the work, here is one that I use:
#!/bin/bash
#
# named This shell script takes care of starting and stopping
# named (BIND DNS server).
#
# chkconfig: - 55 45
# description: named (BIND) is a Domain Name Server (DNS) \
# that is used to resolve host names to IP addresses.
# probe: true

# Source function library.
. /etc/rc.d/init.d/functions

# Source networking configuration.
. /etc/sysconfig/network

# Check that networking is up.
[ "${NETWORKING}" = "no" ] && exit 0

[ -f /etc/sysconfig/named ] && . /etc/sysconfig/named

[ -f /usr/sbin/named ] || exit 0

[ -f ${ROOTDIR}/etc/named.conf ] || exit 0

RETVAL=0
prog="named"

start() {
# Start daemons.
if [ -n "`/sbin/pidof named`" ]; then
echo -n $"$prog: already running"
return 1
fi
echo -n $"Starting $prog: "
if [ -n "${ROOTDIR}" -a "x${ROOTDIR}" != "x/" ]; then
OPTIONS="${OPTIONS} -t ${ROOTDIR}"
fi
# Since named doesn't return proper exit codes at the moment
# (won't be fixed before 9.2), we can't use daemon here - emulate
# its functionality
base=$prog
named -u named ${OPTIONS}
RETVAL=$?
usleep 100000
if [ -z "`/sbin/pidof named`" ]; then
# The child processes have died after fork()ing, e.g.
# because of a broken config file
RETVAL=1
fi
[ $RETVAL -ne 0 ] && failure $"$base startup"
[ $RETVAL -eq 0 ] && touch /var/lock/subsys/named && success $"$base startup"
echo
return $RETVAL
}
stop() {
# Stop daemons.
echo -n $"Stopping $prog: "
/usr/sbin/rndc stop
RETVAL=$?
[ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/named || {
killproc named
RETVAL=$?
[ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/named
}
echo
return $RETVAL
}
rhstatus() {
/usr/sbin/rndc status
return $?
}
restart() {
stop
start
}
reload() {
/usr/sbin/rndc reload >/dev/null 2>&1 || /usr/bin/killall -HUP `/sbin/pidof -o %PPID named`
return $?
}
probe() {
# named knows how to reload intelligently; we don't want linuxconf
# to offer to restart every time
/usr/sbin/rndc reload >/dev/null 2>&1 || echo start
return $?
}

# See how we were called.
case "$1" in
start)
start
;;
stop)
stop
;;
status)
rhstatus
;;
restart)
restart
;;
condrestart)
[ -f /var/lock/subsys/named ] && restart
;;
reload)
reload
;;
probe)
probe
;;
*)
echo $"Usage: $0 {start|stop|status|restart|condrestart|reload|probe}"
exit 1
esac

exit $?


just paste that into your /etc/rc.d/init.d/named file and see if that helps any.

John

ActiveDomain.NL
09-28-2003, 03:38 PM
It still doesn't work with your version.

I think the problem is in this line:
/usr/sbin/rndc reload >/dev/null 2>&1 || /usr/bin/killall -HUP `/sbin/pidof -o %PPID named`

Killall is a tool to kill processes by name, not to kill processed by PID. The utility /sbin/pidof returns the PID of named.

After changing 'killall' in 'kill', the reload function works fine in both DA and the shell.

Thanks for your help!