Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
BIND9 Can't stop service correctly
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
ianneub
Tux's lil' helper
Tux's lil' helper


Joined: 29 May 2003
Posts: 90
Location: HB, CA, USA

PostPosted: Mon Jun 16, 2003 6:29 pm    Post subject: BIND9 Can't stop service correctly Reply with quote

Hello all,

I've just emerge'd net-dns/bind-9.2.2 and ran the script to put it in a chroot'ed envirnment. I can't seem to stop the server cleanly.

Here is what I did:
Code:
emerge bind
ebuild /var/db/pkg/net-dns/bind-9.2.2/bind-9.2.2.ebuild config
echo "alias rndc='rndc -k /chroot/dns/etc/bind/rndc.key'" > /root/.bashrc # I had no /root/.bashrc
source /root/.bashrc
/etc/init.d/named start
/etc/init.d/named stop

 * Stopping named...                                                      [ !! ]


The default /etc/init.d/named script is looking for the pid file in the wrong place.

Code:
if [ $CHROOT -a -d $CHROOT ] ; then
      PIDFILE="${CHROOT}/var/run/named.pid"
      KEY="${CHROOT}/etc/bind/rndc.key"
   else
      PIDFILE="/var/run/named.pid"
      KEY="/etc/bind/rndc.key"
fi


The line "PIDFILE="${CHROOT}/var/run/named.pid"" should read "PIDFILE="${CHROOT}/var/run/named/named.pid"" according to the default /etc/bind/named.conf.
_________________
There's nothing to see here, move along...
Back to top
View user's profile Send private message
jsleeper
Tux's lil' helper
Tux's lil' helper


Joined: 04 Apr 2003
Posts: 75
Location: Virginia Beach, VA, US

PostPosted: Tue Jul 01, 2003 9:03 pm    Post subject: Reply with quote

I had the same situation, and this suggestion made it work correctly.

Thanks ianneub!!!
_________________
are sigs really usefull?
Back to top
View user's profile Send private message
eagle_cz
Apprentice
Apprentice


Joined: 06 Jun 2003
Posts: 213

PostPosted: Wed Jul 02, 2003 8:56 pm    Post subject: Reply with quote

lol i got same problem
named by default save pid to /var/run/named.pid

bun when i try to stop named, he is looking for /var/run/named/named.pid

Soution is to edit /etc/init.d/named a put /var/run/named.pid instead of $PIDFILE in stop section

i tested it on 2 machines... both had this problem

no im only wondering whi is he starting named as root, while there is ............... /usr/sbin/named -u named

chmmm ...any tips ?
Back to top
View user's profile Send private message
Sven Vermeulen
Developer
Developer


Joined: 29 Aug 2002
Posts: 1345
Location: Mechelen, Belgium

PostPosted: Thu Jul 03, 2003 9:01 am    Post subject: Reply with quote

A better solution is to not touch /etc/init.d/named but edit /etc/named.conf in which you can define pid-file.
Back to top
View user's profile Send private message
To
Veteran
Veteran


Joined: 12 Apr 2003
Posts: 1145
Location: Coimbra, Portugal

PostPosted: Thu Jul 03, 2003 12:01 pm    Post subject: Reply with quote

Sven Vermeulen wrote:
A better solution is to not touch /etc/init.d/named but edit /etc/named.conf in which you can define pid-file.


Well that's what I did but it's /etc/bind/named.conf but I think everybody understood what you mean :D


_________________

------------------------------------------------
Linux Gandalf 3.2.35-grsec
Gentoo Base System version 2.2
------------------------------------------------
Back to top
View user's profile Send private message
ianneub
Tux's lil' helper
Tux's lil' helper


Joined: 29 May 2003
Posts: 90
Location: HB, CA, USA

PostPosted: Thu Jul 03, 2003 5:25 pm    Post subject: Reply with quote

Sven Vermeulen wrote:
A better solution is to not touch /etc/init.d/named but edit /etc/named.conf in which you can define pid-file.
Good call, but shouldn't the ebuild handle chroot properly?
_________________
There's nothing to see here, move along...
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum