(bind) named: couldn't open pid file '/var/run/named/named.pid' - any help?
Linux - ServerThis forum is for the discussion of Linux Software used in a server related context.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
(bind) named: couldn't open pid file '/var/run/named/named.pid' - any help?
Hi,
I am configuring BIND-9.3 server on RHEL5. Can any body look into it and help me to understand why I am getting this message in /var/log/messages
Mar 25 14:10:09 station1 named[27449]: couldn't open pid file '/var/run/named/named.pid': File exists
Mar 25 14:10:09 station1 named[27449]: exiting (due to early fatal error)
I am using RHEL5, port 53 and 953 are allowed by iptables. SELINUX is in enforcing mode.
options {
default-key "rndckey";
default-server 127.0.0.1;
default-port 953;
};
# End of rndc.conf
#############
[root@station1 run]# named -u named -c /etc/named.conf
[root@station1 run]# tail -f /var/log/messages
Mar 25 14:27:38 station1 named[27536]: starting BIND 9.3.3rc2 -u named -c /etc/named.conf
Mar 25 14:27:38 station1 named[27536]: found 1 CPU, using 1 worker thread
Mar 25 14:27:38 station1 named[27536]: loading configuration from '/etc/named.conf'
Mar 25 14:27:38 station1 named[27536]: listening on IPv4 interface lo, 127.0.0.1#53
Mar 25 14:27:38 station1 named[27536]: listening on IPv4 interface eth0, 192.168.182.130#53
Mar 25 14:27:38 station1 named[27536]: command channel listening on 127.0.0.1#953
Mar 25 14:27:38 station1 named[27536]: zone 0.in-addr.arpa/IN: loaded serial 42
Mar 25 14:27:38 station1 named[27536]: zone 0.0.127.in-addr.arpa/IN: loaded serial 1997022700
Mar 25 14:27:38 station1 named[27536]: zone 182.168.192.in-addr.arpa/IN: loaded serial 1997022700
Mar 25 14:27:38 station1 named[27536]: zone 255.in-addr.arpa/IN: loaded serial 42
Mar 25 14:27:38 station1 named[27536]: zone 0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.ip6.arpa/IN: loaded serial 1997022700
Mar 25 14:27:38 station1 named[27536]: zone example.com/IN: loaded serial 42
Mar 25 14:27:38 station1 named[27536]: zone localdomain/IN: loaded serial 42
Mar 25 14:27:38 station1 named[27536]: zone localhost/IN: loaded serial 42
Mar 25 14:27:38 station1 named[27536]: running
Mar 25 14:29:31 station1 named[27536]: shutting down: flushing changes
Mar 25 14:29:31 station1 named[27536]: stopping command channel on 127.0.0.1#953
Mar 25 14:29:31 station1 named[27536]: no longer listening on 127.0.0.1#53
Mar 25 14:29:31 station1 named[27536]: no longer listening on 192.168.182.130#53
Mar 25 14:29:31 station1 named[27536]: exiting
Mar 25 14:29:34 station1 named[27574]: starting BIND 9.3.3rc2 -u named -t /var/named/chroot
Mar 25 14:29:34 station1 named[27574]: found 1 CPU, using 1 worker thread
Mar 25 14:29:34 station1 named[27574]: loading configuration from '/etc/named.conf'
Mar 25 14:29:34 station1 named[27574]: listening on IPv4 interface lo, 127.0.0.1#53
Mar 25 14:29:34 station1 named[27574]: listening on IPv4 interface eth0, 192.168.182.130#53
Mar 25 14:29:34 station1 named[27574]: command channel listening on 127.0.0.1#953
Mar 25 14:29:34 station1 named[27574]: couldn't open pid file '/var/run/named/named.pid': File exists
Mar 25 14:29:34 station1 named[27574]: exiting (due to early fatal error)
Note: SELINUX is in enfrocing mode and iptables are allowing port 53 and 953.
I dont know where is the problem? Can somebody help me to sortout this issue? hope above outputs will help to understand the issue?
Check folder /var/named/chroot/var/run/named for the proper right, should be owned by named user.
Also check if /var/named/chroot/var/run/named/named.pid file doesnt exist, if it does, remove it.
something like:
Thanks mate atleast Its working now. but my bind/DNS is not working dont know whats wrong with this now :-( Can you look into it?
I have pasted my /etc/named.conf in the first message.
Here are the zones definitions
[root@station1 named]# cat /var/named/example.com
$TTL 86400
@ IN SOA station1.example.com. root.station1.example.com. (
42 ; serial (d. adams)
3H ; refresh
15M ; retry
1W ; expiry
1D ) ; minimum
@ IN NS station1.example.com.
station1 IN A 192.168.182.130
IN AAAA ::1
station2 IN A 192.168.182.132
[root@station1 named]# cat /var/named/reverse.example.com
$TTL 86400
@ IN SOA station1.example.com. root.station1.example.com. (
1997022700 ; Serial
28800 ; Refresh
14400 ; Retry
3600000 ; Expire
86400 ) ; Minimum
@ IN NS station1.example.com.
130 IN PTR station1.example.com.
132 IN PTR station2.example.com
=======
[root@station1 named]# host -l example.com
example.com name server station1.example.com.
station1.example.com has address 192.168.182.130
station1.example.com has IPv6 address ::1
station2.example.com has address 192.168.182.132
]# ll -h /var/named/
total 15K
drwxr-x--- 6 root named 1.0K Mar 25 07:13 chroot
drwxr-x--- 2 root named 1.0K Jan 16 2007 data
lrwxrwxrwx 1 root named 39 Mar 25 11:44 example.com -> /var/named/chroot/var/named/example.com
lrwxrwxrwx 1 root named 45 Mar 25 05:41 localdomain.zone -> /var/named/chroot//var/named/localdomain.zone
lrwxrwxrwx 1 root named 43 Mar 25 05:41 localhost.zone -> /var/named/chroot//var/named/localhost.zone
lrwxrwxrwx 1 root named 44 Mar 25 05:41 named.broadcast -> /var/named/chroot//var/named/named.broadcast
lrwxrwxrwx 1 root named 37 Mar 25 05:41 named.ca -> /var/named/chroot//var/named/named.ca
lrwxrwxrwx 1 root named 44 Mar 25 05:41 named.ip6.local -> /var/named/chroot//var/named/named.ip6.local
lrwxrwxrwx 1 root named 40 Mar 25 05:41 named.local -> /var/named/chroot//var/named/named.local
lrwxrwxrwx 1 root named 39 Mar 25 05:41 named.zero -> /var/named/chroot//var/named/named.zero
lrwxrwxrwx 1 root named 36 Mar 25 07:17 reverse.example.com -> chroot/var/named/reverse.example.com
drwxr-x--- 2 root named 1.0K Jan 16 2007 slaves
########
]# ll -h /var/named/chroot/var/named/
total 26K
drwxrwx--- 2 root named 1.0K Aug 25 2004 data
-rwxrwx--- 1 root named 290 Mar 25 09:29 dev.com
-rwxrwx--- 1 root named 302 Mar 25 11:25 example.com
-rwxrwx--- 1 root named 198 Jan 16 2007 localdomain.zone
-rwxrwx--- 1 root named 195 Jan 16 2007 localhost.zone
-rwxrwx--- 1 root named 427 Jan 16 2007 named.broadcast
-rwxrwx--- 1 root named 2.5K Jan 16 2007 named.ca
-rwxrwx--- 1 root named 424 Jan 16 2007 named.ip6.local
-rwxrwx--- 1 root named 426 Jan 16 2007 named.local
-rwxrwx--- 1 root named 427 Jan 16 2007 named.zero
-rwxrwx--- 1 root named 505 Mar 25 07:22 reverse.example.com
drwxrwx--- 2 root named 1.0K Jul 27 2004 slaves
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.