named will not restart or stop and start

Jeff

Verified User
Joined
Aug 25, 2003
Messages
9
On my new Redhat 9 DirectAdmin server, named won't restart from the control panel nor from SSH.

From SSH if I do # service named stop I get an [OK]
If I then do # service named start I get a message that named is already running. If I do # service named restart I get stopping [ok] but then a message that named is already running when it attemptes to restart.

From the DirectAdmin control panel when I click on the Restart Link next to Named under Services I get the following error:
Code:
The following error has occured
 
 
 
Details
Stopping named:

And that's it.

Any idea on what to do to troubleshoot this?
 
After this:
[root@server2 admin]# service named stop
Stopping named:
[root@server2 admin]# service named stop
Stopping named:
[root@server2 admin]# service named stop
Stopping named:
[root@server2 admin]# service named stop
Stopping named:
[root@server2 admin]#
to be sure I did a
ps -ax | grep named
and there was still a PID for named.

So I went to top and killed the PID.

Then I was able to run
[root@server2 admin]# service named start
[root@server2 admin]# ]
[/quote]
without the error that it was already running. But Notice that extra ] there. Where is that coming from?

Named does seem to be running:
[root@server2 admin]# service named status
number of zones: 4
debug level: 0
xfers running: 0
xfers deferred: 0
soa queries in progress: 0
query logging is OFF
server is up and running
But you can't stop it or restart it without an error that it's already running - it just refuses to stop it seems.

I want to solve this because today when I did a reboot my server didn't come back up. named is the only known issue on my server. I've been ignoring this thinking it was just a fluke of DirectAdmin and I would live with it, but I wondre if the failure for named to stop is also what caused my server to hang for 3 hours before the folks at the datacenter had to hard power cycle it to get the reboot to boot back up :( So I want to eliminate this as the potential problem.
 
Or to try and do it another way with the same error (not sure if it makes a bit of difference)
[root@server2 init.d]# /etc/rc.d/init.d/named restart
Stopping named:
named: already running[root@server2 init.d]#
 
Hello,

Named is supposed to be installed before DirectAdmin is put on the server, so I'm not sure what's up ... have a look at the named boot script that was installed with bind to see how's it's stopping it... I've seen a few instances where rndc was being used to stop named, but it really wasn't doing it's job so I just changed it to stop named directly.

John
 
I guess I'm in a little over my head here.

Here is the relevant section (I believe) from /etc/rc.d/init.d/named

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
}

How would I change it to stop named directly?
 
Thanks very much for pointing me in the right direction.

I made a backup of the /etc/rc.d/init.d/named file and then spliced in an alternate stop section I found from google:

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
daemon /usr/sbin/named -u named ${OPTIONS}
RETVAL=$?
[ $RETVAL -eq 0 ] && touch /var/lock/subsys/named
# return $RETVAL
}

stop() {
# Stop daemons.
echo -n "Shutting down named: "
killproc named
RETVAL=$?
[ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/named
# return $RETVAL
}

The above seems to work to start and stop named.

But it's still a little off in that when you stop you end up with:
[root@server2 init.d]# OK ]
and then when you start you get
[root@server2 init.d]# ]
and you type over instead of ending up on a new line
All other commands return a nice neat [ OK ].

This isn't really an issue at all, it's just a little strange :confused:
 
Back
Top