The command used in the start() routine in the /etc/init.d/named script is this(freshly emerged): start-stop-daemon --start --quiet --exec /usr/sbin/named -- -u named -n $CPU $OPTIONS ${CHROOT:+-t $CHROOT} With no experience with this I begun looking for errors and while comparing with other start scripts I corrected the start command to: start-stop-daemon --start --quiet --pidfile $PIDFILE --exec /usr/sbin/named -u named -n $CPU $OPTIONS ${CHROOT:+-t $CHROOT} Now it worked just fine :) Reproducible: Always Steps to Reproduce: 1. Run /etc/init.d/named start Actual Results: Named starts with a incorrect path for the pidfile and therefore can't write to it. This makes start-stop-daemon hanging in thin air, believing named is started but can't stop it. Expected Results: Started normaly Portage 2.0.50-r11 (default-x86-2004.2, gcc-3.3.4, glibc-2.3.3.20040420-r1, 2.6.8-gentoo-r3) ================================================================= System uname: 2.6.8-gentoo-r3 i686 Intel(R) Xeon(TM) CPU 2.40GHz Gentoo Base System version 1.4.16 Autoconf: sys-devel/autoconf-2.59-r4 Automake: sys-devel/automake-1.8.5-r1 ACCEPT_KEYWORDS="x86" AUTOCLEAN="yes" CFLAGS="-march=prescott -O3 -pipe -fomit-frame-pointer" CHOST="i686-pc-linux-gnu" COMPILER="" CONFIG_PROTECT="/etc /usr/kde/2/share/config /usr/kde/3/share/config /usr/share/config /var/bind /var/qmail/control" CONFIG_PROTECT_MASK="/etc/gconf /etc/terminfo /etc/env.d" CXXFLAGS="-O2 -mcpu=i686 -pipe" DISTDIR="/usr/portage/distfiles" FEATURES="autoaddcvs ccache sandbox" GENTOO_MIRRORS="http://gentoo.osuosl.org http://distro.ibiblio.org/pub/Linux/distributions/gentoo" MAKEOPTS="-j5" PKGDIR="/usr/portage/packages" PORTAGE_TMPDIR="/var/tmp" PORTDIR="/usr/portage" PORTDIR_OVERLAY="" SYNC="rsync://rsync.gentoo.org/gentoo-portage" USE="X apm arts avi berkdb bitmap-fonts crypt cups encode foomaticdb gdbm gif gnome gpm gtk gtk2 imlib jpeg kde libg++ libwww mad mikmod motif mpeg ncurses nls oggvorbis opengl oss pam pdflib perl png python qt quicktime readline sdl slang spell ssl svga tcpd truetype x86 xml2 xmms xprint xv zlib"
Also, bind won't start properly until this is removed: rm /var/lib/init.d/started/named Took me a minute to figure that one out...
this startup script has major problems ;) i hafta keep zapping it, and sometimes it says it didn't start, but it launches named anyway..
When is this going to be fixed? The init script wasn't working for me either until I found Andre's fix. This is a trivial fix and really should be fixed asap.
sure, that init script is totally screwed. Anyone cares to fix it? any maintainer out there?
Created attachment 56288 [details, diff] named init script pid fix This patch is a functional pid-fix. It reads the correct PIDFILE from named.conf, or defaults to var/run/named.pid, the bind default. I realize it's generally bad to require the configuration to be the same or exist while stopping, but I'm not sure how this can be otherwise handled without externally keeping track of PIDFILE.
The init pid fix currently in portage is broken. Most importantly, it uses "--pid" which isn't a documented option of start-stop-daemon. I've replaced this with the proper "--pidfile". Additionally, to reliably determine the PIDFILE named is configured to use, I'm grabbing it from named.conf. It is possible a PIDFILE in /etc/conf.d/named could be used, but this would of course require it to match named.conf. I'm not aware of a named command line option to specify the PIDFILE and override what might be in named.conf. -Jacob
fixed in 9.2.5-r2 and 9.3.1-r1 thanks everyone