View previous topic :: View next topic |
Author |
Message |
stillman Apprentice
![Apprentice Apprentice](/images/ranks/rank_rect_2.gif)
![](images/avatars/19835627663fa03425b9de9.gif)
Joined: 07 Dec 2002 Posts: 223 Location: Vienna, Austria
|
Posted: Thu Aug 11, 2005 1:44 pm Post subject: [SOLVED] /etc/init.d/named asks for extra options |
|
|
i've configured bind and it starts fine with Code: | /usr/sbin/named -u named -n 1 -g -c /etc/bind/named.conf -d 9 -t /chroot/dns | but running it with the runscript /etc/init.d/named says: Code: |
/etc/init.d/named start
* Starting chrooted named ...
usage: named [-c conffile] [-d debuglevel] [-f|-g] [-n number_of_cpus]
[-p port] [-s] [-t chrootdir] [-u username]
named: extra command line arguments [ !! ] |
i've added the flags in the first command to /etc/conf.d/named but that doesn't seem to have any effect. thx for your suggestions...
Last edited by stillman on Sat Aug 13, 2005 8:50 am; edited 3 times in total |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
kashani Advocate
![Advocate Advocate](/images/ranks/rank-G-1-advocate.gif)
![](images/avatars/9629732313ee51df8c5935.jpg)
Joined: 02 Sep 2002 Posts: 2032 Location: San Francisco
|
Posted: Thu Aug 11, 2005 3:02 pm Post subject: |
|
|
I'd think /etc/conf.d/named would need to look like this. You shouldn't need the -c since that's the default location in the /etc/init.d/named script. That script also adds -u named as well.
Code: |
# Set various named options here.
#
OPTIONS="-g -d 9"
# Set this to the number of processors you have.
#
CPU="1"
# If you wish to run bind in a chroot, run:
# ebuild /var/db/pkg/net-dns/<bind version>/<bind-version> config
# and un-comment the following line.
# You can specify a different chroot directory but MAKE SURE it's empty.
CHROOT="/chroot/dns"
|
kashani _________________ Will personally fix your server in exchange for motorcycle related shop tools in good shape. |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
stillman Apprentice
![Apprentice Apprentice](/images/ranks/rank_rect_2.gif)
![](images/avatars/19835627663fa03425b9de9.gif)
Joined: 07 Dec 2002 Posts: 223 Location: Vienna, Austria
|
Posted: Thu Aug 11, 2005 3:29 pm Post subject: |
|
|
yupp, after having a closer look at the init.d-file i'm more puzzled. i've tried to change the start-stop command to one line - instead of Code: | start-stop-daemon --start --quiet --pidfile ${PIDFILE} \
--exec /usr/sbin/named \
-- -u named -n ${CPU} ${OPTIONS} ${CHROOT:+-t $CHROOT}
|
to
Code: | start-stop-daemon --start --quiet --pidfile ${PIDFILE} \
--exec /usr/sbin/named -u named -n ${CPU} ${OPTIONS} ${CHROOT:+-t $CHROOT} |
and it works Code: | /etc/init.d/named start
* Re-caching dependency info (mtimes differ)...
* Starting chrooted named ...
Would start /usr/sbin/named // location of pid file /chroot/dns . [ ok ]
|
(as long as i don't add options in /etc/conf.d/named else the script cries for not knowing the flag). but i'm not really happy with that...
[edit]ok, actually it doesn't work, it just pretends to have started - without error messages
Last edited by stillman on Thu Aug 11, 2005 3:36 pm; edited 1 time in total |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
kashani Advocate
![Advocate Advocate](/images/ranks/rank-G-1-advocate.gif)
![](images/avatars/9629732313ee51df8c5935.jpg)
Joined: 02 Sep 2002 Posts: 2032 Location: San Francisco
|
Posted: Thu Aug 11, 2005 3:33 pm Post subject: |
|
|
Weird, though not surprising. The Gentoo named startup scripts have always had strange issues like trying to put the pid file into directories that it doesn't have enough priveledge to write to and nonsense like that.
I'd look around bugzilla and file a bug if there isn't one already.
kashani _________________ Will personally fix your server in exchange for motorcycle related shop tools in good shape. |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
stillman Apprentice
![Apprentice Apprentice](/images/ranks/rank_rect_2.gif)
![](images/avatars/19835627663fa03425b9de9.gif)
Joined: 07 Dec 2002 Posts: 223 Location: Vienna, Austria
|
Posted: Thu Aug 11, 2005 3:40 pm Post subject: |
|
|
plz check my last edit. actually i'm using the same ebuild as the one you've used in your gentoo-wiki -> 9.2.5-r4
so why should it not work in my case? or don't you start it as a service? |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
kashani Advocate
![Advocate Advocate](/images/ranks/rank-G-1-advocate.gif)
![](images/avatars/9629732313ee51df8c5935.jpg)
Joined: 02 Sep 2002 Posts: 2032 Location: San Francisco
|
Posted: Thu Aug 11, 2005 3:46 pm Post subject: |
|
|
hmmm I'm currently not chrooting and not adding any flags so the problem is either there or in your config. Is there anything in your logs and does a named-checkconf come back clean?
kashani _________________ Will personally fix your server in exchange for motorcycle related shop tools in good shape. |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
stillman Apprentice
![Apprentice Apprentice](/images/ranks/rank_rect_2.gif)
![](images/avatars/19835627663fa03425b9de9.gif)
Joined: 07 Dec 2002 Posts: 223 Location: Vienna, Austria
|
Posted: Thu Aug 11, 2005 3:51 pm Post subject: |
|
|
yes, no probs at all. i'm currently working with this nameserver started manually(and only this ns). the init-script doesn't work with flags either, it just responds everything is working(i switched back to the old syntax and get the message in my first post). can you post your named-init-script plz? thanks for your interest so far. |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
stillman Apprentice
![Apprentice Apprentice](/images/ranks/rank_rect_2.gif)
![](images/avatars/19835627663fa03425b9de9.gif)
Joined: 07 Dec 2002 Posts: 223 Location: Vienna, Austria
|
Posted: Thu Aug 11, 2005 4:42 pm Post subject: |
|
|
hmm, updating to 9.3.1 and overwriting init.d/named didn't solve it either - going to file a bug report... |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
kashani Advocate
![Advocate Advocate](/images/ranks/rank-G-1-advocate.gif)
![](images/avatars/9629732313ee51df8c5935.jpg)
Joined: 02 Sep 2002 Posts: 2032 Location: San Francisco
|
Posted: Thu Aug 11, 2005 4:49 pm Post subject: |
|
|
You know that might it. I helped morphal out last week or so and his /etc/init.d/named script was different from mine. Once we swapped his for mine he had no problems.
My script assumes that you have a /var/run/named dir and it's owned by named:named. You might want to create it or edit my script.
kashani
Code: |
#!/sbin/runscript
# Copyright 1999-2004 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/net-dns/bind/files/named.rc6,v 1.15 2004/07/14 23:18:19 agriffis
Exp $
opts="start stop reload restart"
depend() {
need net
use logger
provide dns
}
checkconfig() {
if [ ! -f ${CHROOT}/etc/bind/named.conf ] ; then
eerror "No ${CHROOT}/etc/bind/named.conf file exists!"
fi
# In case someone doesn't have $CPU set from /etc/conf.d/named
if [ ! $CPU ] ; then
CPU=1
fi
if [ $CHROOT -a -d $CHROOT ] ; then
PIDFILE="${CHROOT}/var/run/named/named.pid"
KEY="${CHROOT}/etc/bind/rndc.key"
else
PIDFILE="/var/run/named/named.pid"
KEY="/etc/bind/rndc.key"
fi
}
start() {
ebegin "Starting ${CHROOT:+chrooted }named"
checkconfig || return 1
start-stop-daemon --start --quiet --exec /usr/sbin/named \
--pid ${CHROOT}/var/run/named/named.pid \
-- -u named -n $CPU $OPTIONS ${CHROOT:+-t $CHROOT}
eend $?
}
stop() {
ebegin "Stopping ${CHROOT:+chrooted }named"
checkconfig || return 2
start-stop-daemon --stop --quiet --pidfile $PIDFILE \
--exec /usr/sbin/named -- stop
eend $?
}
reload() {
checkconfig || return 3
if [ ! -f $PIDFILE ] ; then
/etc/init.d/named start &>/dev/null
exit
fi
if [ -f $KEY ] ; then
ebegin "Reloading named.conf and zone files"
rndc -k $KEY reload &>/dev/null
eend $?
else /etc/init.d/named restart &>/dev/null
fi
}
restart() {
svc_stop
svc_start
}
|
_________________ Will personally fix your server in exchange for motorcycle related shop tools in good shape. |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
UberLord Retired Dev
![Retired Dev Retired Dev](/images/ranks/rank-retired.gif)
![](images/avatars/16007251014200867ea775c.gif)
Joined: 18 Sep 2003 Posts: 6835 Location: Blighty
|
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
stillman Apprentice
![Apprentice Apprentice](/images/ranks/rank_rect_2.gif)
![](images/avatars/19835627663fa03425b9de9.gif)
Joined: 07 Dec 2002 Posts: 223 Location: Vienna, Austria
|
Posted: Thu Aug 11, 2005 5:16 pm Post subject: |
|
|
well, 9.3.1-r3 uses the --pidfile syntax. my named-script looks like this now: Code: | #!/sbin/runscript
# Copyright 1999-2004 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/net-dns/bind/files/named.rc,v 1.1 2005/08/03 16:54:38 voxus Exp $
opts="start stop reload restart"
depend() {
need net
use logger
provide dns
}
checkconfig() {
if [ ! -f ${CHROOT}/etc/bind/named.conf ] ; then
eerror "No ${CHROOT}/etc/bind/named.conf file exists!"
fi
# In case someone doesn't have $CPU set from /etc/conf.d/named
if [ ! ${CPU} ] ; then
CPU="1"
fi
# As with the named.conf test, above, there's no need
# for chroot and non-chroot cases here
PIDFILE=$(grep "pid-file" ${CHROOT}/etc/bind/named.conf | \
egrep -v ".*[#,//].*pid-file" | \
head -n 1 | \
sed -ne 's:.*pid-file\(.*\)\"\(.*\)\";:\2:p')
[ -n "$PIDFILE" ] || PIDFILE=/var/run/named.pid
PIDFILE="${CHROOT}$PIDFILE"
KEY="${CHROOT}/etc/bind/rndc.key"
}
start() {
ebegin "Starting ${CHROOT:+chrooted }named"
checkconfig || return 1
start-stop-daemon --start --quiet --pidfile ${PIDFILE} \
--exec /usr/sbin/named \
-- -u named -n ${CPU} ${OPTIONS} ${CHROOT:+-t $CHROOT}
eend $?
}
stop() {
ebegin "Stopping ${CHROOT:+chrooted }named"
checkconfig || return 2
start-stop-daemon --stop --quiet --pidfile $PIDFILE \
--exec /usr/sbin/named -- stop
eend $?
}
reload() {
checkconfig || return 3
if [ ! -f $PIDFILE ] ; then
/etc/init.d/named start &>/dev/null
exit
fi
if [ -f $KEY ] ; then
ebegin "Reloading named.conf and zone files"
rndc -k $KEY reload &>/dev/null
eend $?
else /etc/init.d/named restart &>/dev/null
fi
}
restart() {
svc_stop
svc_start
} |
|
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
UberLord Retired Dev
![Retired Dev Retired Dev](/images/ranks/rank-retired.gif)
![](images/avatars/16007251014200867ea775c.gif)
Joined: 18 Sep 2003 Posts: 6835 Location: Blighty
|
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
stillman Apprentice
![Apprentice Apprentice](/images/ranks/rank_rect_2.gif)
![](images/avatars/19835627663fa03425b9de9.gif)
Joined: 07 Dec 2002 Posts: 223 Location: Vienna, Austria
|
Posted: Thu Aug 11, 2005 5:35 pm Post subject: |
|
|
no, it's a production server so i have 1.11.13. guess i'll also downgrade to bind 9.2.5 again. having added the stuff to local.start and local.stop in the meanwhile since i don't really see through how the start-stop-daemon works with starting(stopping is easier). thanks for your help!
Edit: it works with kashanis script. got no concentration left to analyze it but thank you sir! |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
kashani Advocate
![Advocate Advocate](/images/ranks/rank-G-1-advocate.gif)
![](images/avatars/9629732313ee51df8c5935.jpg)
Joined: 02 Sep 2002 Posts: 2032 Location: San Francisco
|
Posted: Thu Aug 11, 2005 9:46 pm Post subject: |
|
|
Finally got a chance to test this on my private box. baselayout 1.11.13 works fine with 9.3.1 however your options are goofy. -g means run named in the foreground. As soon as you get any entry on the command line it exits. Is that the behavior you want?
kashani _________________ Will personally fix your server in exchange for motorcycle related shop tools in good shape. |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
stillman Apprentice
![Apprentice Apprentice](/images/ranks/rank_rect_2.gif)
![](images/avatars/19835627663fa03425b9de9.gif)
Joined: 07 Dec 2002 Posts: 223 Location: Vienna, Austria
|
Posted: Sat Aug 13, 2005 8:48 am Post subject: |
|
|
nope, that was just for testing. thx! |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
|