Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 65335 - The init.d script for named got a bogus start command
Summary: The init.d script for named got a bogus start command
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Server (show other bugs)
Hardware: All Linux
: High critical (vote)
Assignee: Jeffrey Forman (RETIRED)
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-09-25 11:13 UTC by André Roaldseth
Modified: 2005-04-17 05:33 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
named init script pid fix (named.rc6-pidfix,1.41 KB, patch)
2005-04-14 12:47 UTC, Jacob Joseph
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description André Roaldseth 2004-09-25 11:13:41 UTC
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"
Comment 1 Steve Arnold archtester gentoo-dev 2004-10-02 13:29:37 UTC
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...
Comment 2 Eric Brown 2004-12-01 14:39:13 UTC
this startup script has major problems ;) i hafta keep zapping it, and sometimes it says it didn't start, but it launches named anyway..
Comment 3 Jeff Terrace 2004-12-26 20:18:34 UTC
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.
Comment 4 LuisMi Garcia 2005-01-06 09:15:28 UTC
sure, that init script is totally screwed. Anyone cares to fix it? any maintainer out there?
Comment 5 Jacob Joseph 2005-04-14 12:47:00 UTC
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.
Comment 6 Jacob Joseph 2005-04-14 12:51:09 UTC
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
Comment 7 Konstantin Arkhipov (RETIRED) gentoo-dev 2005-04-17 05:33:09 UTC
fixed in 9.2.5-r2 and 9.3.1-r1
thanks everyone