Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Chrooted named wont be stopped
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
petrjanda
Veteran
Veteran


Joined: 05 Sep 2003
Posts: 1557
Location: Brno, Czech Republic

PostPosted: Sun Oct 30, 2005 5:02 am    Post subject: Chrooted named wont be stopped Reply with quote

Something very funny going on here. "/etc/init.d/named" starts the named daemon, but "/etc/init.d/named stop" fails to stop it. I KNOW named is running via ps -aux. While investigating, i found 2 ways to stop it.

First way:
killall named
/etc/init.d/named zap

Second way:
Edit /chroot/dns/etc/bind/named.conf, the line that says location of the pid file, change it from /var/run/named/named.conf to /chroot/dns/var/run/named/named.conf and then stop it normally. But before you start it again change to the original pid file location. It seems like the initscript seek the pid file in the REAL /var/run/named location instead of the chrooted one (/chroot/dns/var/run/named).

Has one got a REAL fix for this?
_________________
There is, a not-born, a not-become, a not-made, a not-compounded. If that unborn, not-become, not-made, not-compounded were not, there would be no escape from this here that is born, become, made and compounded. - Gautama Siddharta
Back to top
View user's profile Send private message
WladyX
Guru
Guru


Joined: 25 Nov 2004
Posts: 503
Location: Romania

PostPosted: Sun Oct 30, 2005 10:26 am    Post subject: Reply with quote

Just upgraded bind, same issue, resolved by:

Code:

ln -s /chroot/dns/var/run/named/named.pid /var/run/named/

_________________
We are not alone.
Back to top
View user's profile Send private message
r1
n00b
n00b


Joined: 07 Jul 2005
Posts: 13

PostPosted: Sun Oct 30, 2005 10:11 pm    Post subject: Reply with quote

Hi,

2 ways to solve this,

1) put your chrooted path to your pid-file in named.conf

for example change
pid-file "/var/run/named/named.pid";

by
pid-file "/[YOUR_CHROOT_PATH]/named.pid";


2) change the init.d/named file with this

# as suggested in bug #107724
PIDFILE=$(\
egrep -v \
"^([[:cntrl:] ]+(#|//|/\*)|(#|//|/\*))" \
${CHROOT}/etc/bind/named.conf \
| egrep -o -m1 "pid\-file +\".+\" *;" \
| cut -d\" -f2
)

by

# as suggested in bug #107724
PIDFILE=${CHROOT}$(\
egrep -v \
"^([[:cntrl:] ]+(#|//|/\*)|(#|//|/\*))" \
${CHROOT}/etc/bind/named.conf \
| egrep -o -m1 "pid\-file +\".+\" *;" \
| cut -d\" -f2
)



r1.



diff for init.d/named

25c25
< PIDFILE=$(\
---
> PIDFILE=${CHROOT}$(\
Back to top
View user's profile Send private message
petrjanda
Veteran
Veteran


Joined: 05 Sep 2003
Posts: 1557
Location: Brno, Czech Republic

PostPosted: Mon Oct 31, 2005 3:43 am    Post subject: Reply with quote

WladyX wrote:
Just upgraded bind, same issue, resolved by:

Code:

ln -s /chroot/dns/var/run/named/named.pid /var/run/named/

heh, thats what i did too (but put it in /etc/init.d/named). A post above is a superior solution though. Thanks all!
_________________
There is, a not-born, a not-become, a not-made, a not-compounded. If that unborn, not-become, not-made, not-compounded were not, there would be no escape from this here that is born, become, made and compounded. - Gautama Siddharta
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