LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 06-12-2013, 08:51 AM   #1
krasl
Member
 
Registered: Nov 2005
Distribution: Fedora 4
Posts: 40

Rep: Reputation: 15
Question named/bind9 service takes a LONG time to stop


Hello everyone, my question relates to bind9/named service. This is a webserver running CentOS 6.4, BIND 9.8.2rc1, and virtualmin/webmin with all named updates applied.

When restarting BIND, the named service takes over 60 seconds to stop. During this time, no messages are logged to /var/log/messages. Finally, at the end of the period, the following are written to the log and the service immediately stops:
Jun 12 13:43:33 d01s02 named[23965]: shutting down
Jun 12 13:43:33 d01s02 named[23965]: stopping command channel on 127.0.0.1#953
Jun 12 13:43:33 d01s02 named[23965]: no longer listening on 127.0.0.1#53
Jun 12 13:43:33 d01s02 named[23965]: no longer listening on xxx.xxx.xxx.xxx#53
Jun 12 13:43:33 d01s02 named[23965]: exiting

Please note: Starting the service is instantaneous. No problems on that end. It's the STOPPING that takes so long.

In /etc/init.d/named there is a line:
NAMED_SHUTDOWN_TIMEOUT=${NAMED_SHUTDOWN_TIMEOUT:-25}

But I changed the number from -25 to -5 and it made no difference whatsoever on the delay.


Does anyone have any idea what the service is waiting for, or why it takes so long? This seems to be a bug in newer versions of CentOS as I have noticed this issue on two different servers.

I also have a server running CentOS 6.2 and BIND 9.7.3-P3 and the issue does NOT occur - named stops within 1 second of issuing the "service named stop" command.


Any information or pointers would be greatly appreciated. As I search google, the results are focused on slow "startup" times for named, but this is not the same issue.


Thank you!

krasl

Last edited by krasl; 06-12-2013 at 08:53 AM.
 
Old 06-12-2013, 11:54 PM   #2
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Rocky 9.2
Posts: 18,359

Rep: Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751
See 'Use a default value' http://wiki.bash-hackers.org/syntax/..._default_value
 
Old 12-05-2015, 12:55 PM   #3
tomek-k
LQ Newbie
 
Registered: Dec 2015
Posts: 1

Rep: Reputation: Disabled
I know this is an old thread, but when looking for a solution to exactly same problem, I kept finding this thread and other sources of information didn't give a straightforward answer.

The problem here is the firewall configuration. The named listens on two ports — port 53 on all network interfaces, and port 953 on the loopback interface (the latter being DNS RNDC Service). Both port numbers are mentioned in your log snippet.

When it is being stopped/restarted, named waits for something on the port 953, and it hangs for a long time if the port is blocked by the firewall.

So the solution is to allow incoming connections to the port 953 on the loopback interface:
Code:
iptables -A INPUT -i lo -p tcp --dport 953 -j ACCEPT
 
  


Reply

Tags
bind, dns, named, service



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
GDM takes a *long* time to start first time grumpybuffalo Linux From Scratch 2 09-09-2007 12:17 PM
NFS service takes tooo long to start dbiswas_slg Linux - Networking 1 10-12-2006 04:22 AM
service named stop does not work sailu_mvn Linux - Software 3 12-29-2005 12:09 AM
service named can't stop... TAAN Linux - Networking 1 09-11-2003 03:43 AM
why my named service stop after running a few minute? lzyking Linux - Software 4 06-24-2003 09:15 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 03:52 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration