Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 113036 - net-dns/bind init script (named) should need mysql if USE=bind-mysql
Summary: net-dns/bind init script (named) should need mysql if USE=bind-mysql
Status: RESOLVED LATER
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Server (show other bugs)
Hardware: All Linux
: High enhancement (vote)
Assignee: Konstantin Arkhipov (RETIRED)
URL:
Whiteboard:
Keywords:
: 121175 (view as bug list)
Depends on:
Blocks:
 
Reported: 2005-11-19 14:54 UTC by Martin Lindquist
Modified: 2008-10-13 21:12 UTC (History)
4 users (show)

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Martin Lindquist 2005-11-19 14:54:28 UTC
After installing net-dns/bind-9.2.5-r6 and dev-db/mysql-4.1.14 with
USE=bind-mysql , adding both init scripts to default using rc-update and
rebooting named starts before mysqld, which prevents named from loading any
zones that are stored in a database accessed through the local mysqld.

Reproducible: Always
Steps to Reproduce:
1. USE=bind-mysql emerge net-dns/bind dev-db/mysql
2. rc-update add named default && rc-update add mysql default
3. shutdown -r now

Actual Results:  
 * Starting named ... [ ok ]
 * Starting mysqld (/etc/mysql/my.cnf) ... [ ok ]

Expected Results:  
 * Starting mysqld (/etc/mysql/my.cnf) ... [ ok ]
 * Starting named ... [ ok ]

Portage 2.0.51.22-r3 (default-linux/amd64/2005.1/no-multilib, gcc-3.4.4,
glibc-2.3.5-r2, 2.6.11-hardened-r15 x86_64)
=================================================================
System uname: 2.6.11-hardened-r15 x86_64 AMD Athlon(tm) 64 Processor 3000+
Gentoo Base System version 1.6.13
dev-lang/python:     2.3.5-r2, 2.4.2
sys-apps/sandbox:    1.2.12
sys-devel/autoconf:  2.13, 2.59-r6
sys-devel/automake:  1.4_p6, 1.5, 1.6.3, 1.7.9-r1, 1.8.5-r3, 1.9.6-r1
sys-devel/binutils:  2.15.92.0.2-r10
sys-devel/libtool:   1.5.20
virtual/os-headers:  2.6.11-r2
ACCEPT_KEYWORDS="amd64"
AUTOCLEAN="yes"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-march=k8 -O2 -pipe -fomit-frame-pointer -funroll-loops"
CHOST="x86_64-pc-linux-gnu"
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="-march=k8 -O2 -pipe -fomit-frame-pointer -funroll-loops"
DISTDIR="/usr/portage/distfiles"
FEATURES="autoconfig distlocks sandbox sfperms strict"
GENTOO_MIRRORS="ftp://ftp.du.se/pub/os/gentoo"
MAKEOPTS="-j2"
PKGDIR="/usr/portage/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
SYNC="rsync://rsync.se.gentoo.org/gentoo-portage/"
USE="amd64 64bit X509 acl acpi apache2 async authdaemond authfile automount
bash-completion berkdb bind-mysql bitmap-fonts bootsplash bzip2 chroot clamav
clamd crypt curl curlwrappers dba dedicated dio doc ecc eds elf ethereal
examples exif expat extensions extraengine fftw flash foomaticdb fortran freetds
ftp gd geometry gif gmp gnutls gpm gstreamer guile hal hardened hardenedphpicq
hpn idea idn imagemagick imap imlib inline innodb ipv6 jabber jpeg junit
kerberos ldap libwww lm_sensors lua lzw lzw-tiff mad maildir mcal memlimit mhash
mime ming mmap mng mpm-prefork msn mysql mysqli ncurses netcdf nis nls
no-old-linux no-suexec noauthunix nolvmstatic nptl nptlonly ntlm offensive oscar
pam pam_chroot pam_console pam_timestamp pcntl pcre pdflib perl php pic
plotutils png prelude pwdb python quotas rc5 readline rpm ruby samba sasl
sendfile session sftplogging sguil shaper sharedext sharedmem skey slang smime
smux snmp snortsam sockets socks5 softquota spell ssl subject-rewrite svg swat
sysfs syslog sysvipc szip tcpd threads tiff truetype truetype-fonts type1-fonts
udev usb userlocales v4l vim-pager winbind wmf xface xml xml2 yahoo zlib
userland_GNU kernel_linux elibc_glibc"
Unset:  ASFLAGS, CTARGET, LANG, LC_ALL, LDFLAGS, LINGUAS, PORTDIR_OVERLAY
Comment 1 Martin Lindquist 2005-11-19 16:12:07 UTC
I noticed after attempting to quick-fix this by inserting 'need mysql' into
depend() in /etc/init.d/named that /etc/init.d/mysql has 'need named' in its
depend(), which it informed me of when caching dependencies while running
another init script.

A somewhat dirty fix might be to have another init script run after mysql ('need
mysql' and 'need named') and send SIGHUP to named (or use rndc), but perhaps
someone has a better suggestion?
Comment 2 Konstantin Arkhipov (RETIRED) gentoo-dev 2006-01-02 09:59:06 UTC
it will cause a lot of voodoo in making 'personalized' init-scripts. mysql, berkdb, postgresql..

it will cause testing overhead too.
Comment 3 Konstantin Arkhipov (RETIRED) gentoo-dev 2006-02-12 07:47:47 UTC
*** Bug 121175 has been marked as a duplicate of this bug. ***
Comment 4 Jakub Moc (RETIRED) gentoo-dev 2006-02-21 04:25:23 UTC
(In reply to comment #1)
> I noticed after attempting to quick-fix this by inserting 'need mysql' into
> depend() in /etc/init.d/named that /etc/init.d/mysql has 'need named'

Not here (CCing vivo to confirm):

use dns net (non-slotted mysql-4.0)
use dns net localmount netmount nfsmount (slotted mysql ebuilds)

Adding need mysql to /etc/init.d/named works fine:

# /etc/init.d/named stop
 * Re-caching dependency info (mtimes differ)...
 * Stopping chrooted named ...                                                                                                         [ ok ]
wac init.d # /etc/init.d/mysql stop
 * Stopping mysqld (/etc/mysql/my.cnf) ...                                                                                             [ ok ]
wac init.d # /etc/init.d/named start
 * Starting mysqld (/etc/mysql/my.cnf) ...                                                                                             [ ok ]
 * Starting chrooted named ...           

Should be doable with a bit of sed magic based on use flags, no messing with mysql init scripts is required. 
Comment 5 Francesco R. (RETIRED) gentoo-dev 2006-02-21 12:54:25 UTC
confirmed, latest changes to the rc scripts after bug #108532
Comment 6 Konstantin Arkhipov (RETIRED) gentoo-dev 2006-02-23 15:57:40 UTC
> Adding need mysql to /etc/init.d/named works fine:

try to add and/or remove named and or/mysql from default run level. you'll get:

 *  Service 'named' NEED service 'mysql', but service 'mysql' wants
 *  to USE service 'named'!
Comment 7 Jakub Moc (RETIRED) gentoo-dev 2006-02-23 17:58:24 UTC
(In reply to comment #6)
> > Adding need mysql to /etc/init.d/named works fine:
> 
> try to add and/or remove named and or/mysql from default run level. you'll get:
> 
>  *  Service 'named' NEED service 'mysql', but service 'mysql' wants
>  *  to USE service 'named'!
> 

Shrug. No such issue here...

# grep need /etc/init.d/named
        need net mysql

# rc-update del named
 * named removed from the following runlevels: default
 * rc-update complete.

# rc-update add named default
 * named added to runlevel default
 * rc-update complete.
Comment 8 Konstantin Arkhipov (RETIRED) gentoo-dev 2006-02-27 08:09:03 UTC
what's your baselayout version?
Comment 9 Jakub Moc (RETIRED) gentoo-dev 2006-02-27 10:25:16 UTC
(In reply to comment #8)
> what's your baselayout version?

Never mind, reproduced now (looks like the caching has been playing around with that, so the issue only shows up later on). Doesn't seem to break anything however, just get the message you posted in Comment #6 but the services still start properly.

Probably uberlord will have better explanation for this warning, I'll CC him.
Comment 10 Roy Marples (RETIRED) gentoo-dev 2006-02-28 00:01:17 UTC
It's a classic chicken and egg situation - which comes first?

bind can store its zone files in a mysql db
mysql requires dns

Now, as both init script need/use each other you get a circular dependency which is what the warning is about, so the ordering is not guaranteed. Technically one has to start before the order - but which one? We have no way of knowing in baselayout.

Most people will not be storing their bind zones in a mysql db, so I suggest that mysql USES dns. bind should have no reference to mysql, but both the bind and mysql init scripts, configs and ebuilds should have a big fat warning about this situation and the user should tailor their init.d mysql and named scripts.

That's just my optinion however. We are trying to work towards a possible solution for this in baselayout-1.13, but it's not going to be in portage for a long time yet.
Comment 11 Jakub Moc (RETIRED) gentoo-dev 2006-02-28 02:51:41 UTC
(In reply to comment #10)
> mysql requires dns

Well, it doesn't - "use dns net". Better said, I feel that we shouldn't be getting any warning unless there's "need dns". mysql can use dns, doesn't need it, isn't that the difference between use and need? There's should be warning (maybe rather error) in case of circular "need" statement, but not in this case. But maybe I missed something :)
Comment 12 Roy Marples (RETIRED) gentoo-dev 2006-02-28 03:03:46 UTC
(In reply to comment #11)
> (In reply to comment #10)
> > mysql requires dns
> 
> Well, it doesn't - "use dns net". Better said, I feel that we shouldn't be
> getting any warning unless there's "need dns". mysql can use dns, doesn't need
> it, isn't that the difference between use and need? There's should be warning
> (maybe rather error) in case of circular "need" statement, but not in this
> case. But maybe I missed something :)
> 

The only difference between need and use is that if a needed service fails to start, we fail to start otherwise we try and start.
Comment 13 Konstantin Arkhipov (RETIRED) gentoo-dev 2006-03-25 13:55:34 UTC
> We are trying to work towards a possible
> solution for this in baselayout-1.13, but it's
> not going to be in portage for a long time yet.

so, we'll wait for it.
Comment 14 Olliver Schinagl 2008-10-13 21:12:31 UTC
2 Years later ...

still waiting :)

though if it was fixed, the fix was forgotten for postgresql. My postgres starts fine, my named fails to start. Since baselayout 2 is almost ready, do we have something for it there? Do we now wait for that?

enterprise ~ # emerge --info
Portage 2.1.4.5 (hardened/amd64/multilib, gcc-3.4.6, glibc-2.6.1-r0, 2.6.25-hardened-r7 x86_64)
=================================================================
System uname: 2.6.25-hardened-r7 x86_64 Intel(R) Xeon(TM) CPU 3.00GHz
Timestamp of tree: Mon, 13 Oct 2008 16:21:01 +0000
app-shells/bash:     3.2_p33
dev-lang/python:     2.5.2-r7
sys-apps/baselayout: 1.12.11.1
sys-apps/sandbox:    1.2.18.1-r2
sys-devel/autoconf:  2.13, 2.61-r2
sys-devel/automake:  1.5, 1.7.9-r1, 1.8.5-r3, 1.9.6-r2, 1.10.1-r1
sys-devel/binutils:  2.18-r3
sys-devel/gcc-config: 1.4.0-r4
sys-devel/libtool:   1.5.26
virtual/os-headers:  2.6.23-r3
ACCEPT_KEYWORDS="amd64"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-Os -march=nocona -pipe"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /opt/glftpd/etc /opt/glftpd/ftp-data /var/bind"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/fonts/fonts.conf /etc/gconf /etc/php/apache2-php5/ext-active/ /etc/php/cgi-php5/ext-active/ /etc/php/cli-php5/ext-active/ /etc/revdep-rebuild /etc/terminfo /etc/texmf/web2c /etc/udev/rules.d"
CXXFLAGS="-Os -march=nocona -pipe"
DISTDIR="/usr/portage/distfiles"
FEATURES="autoconfig distlocks metadata-transfer parallel-fetch sandbox sfperms strict unmerge-orphans userfetch userpriv usersandbox"
GENTOO_MIRRORS="ftp://ftp.snt.utwente.nl/pub/os/linux/gentoo ftp://vlaai.snt.ipv6.utwente.nl/pub/os/linux/gentoo/ ftp://mirror.scarlet-internet.nl/pub/gentoo ftp://mirror.nutsmaas.nl/gentoo/"
MAKEOPTS="-j5"
PKGDIR="/usr/portage/packages"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --stats --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/usr/portage/local/layman/nx /usr/portage/local/layman/webapps-experimental /usr/local/portage"
SYNC="rsync://rsync.nl.gentoo.org/gentoo-portage"
USE="7zip X a52 aac acpi aim alsa amd64 amr apache2 apm authdaemond avahi bash-completion bcmath berkdb bindist bzip2 bzlib cairo calendar cdr cli console cracklib cross crypt ctype cups curl curlwrappers dba dbus dedicated dlz dts dvb dvd dvdr encode exif fam fastcgi ffmpeg fftw firefox flash foomatic foomaticdb ftp gcc64 gd ggi gif glitz gnutls gstreamer gtk hal hardened icq idn imagemagick imap imlib ipv6 jabber jbig jpeg jpeg2k justify kerberos ldap lesstif libwww logrotate mad maildir mcal mdnsresponder-compat memlimit mhash midi mikmod mime mmap mng mp3 mp4 mp4live mpeg mpeg2 msn multilib ncurses netpbm nls nocd nptl nptlonly ogg oggvorbis opengl oscar pam pcre php pic plugins png posix postfix postgres ppds pulseaudio rdesktop readline resolvconf rle samba sasl sdl server session shared sharedmem simplexml slang slp snmp sockets sound spell sse sse2 ssl svg sysfs szip tcpd tetex theora thunderbird tidy tiff tokenizer truetype unicode unzip urandom usb vda vhosts videos vnc vorbis x264 xinetd xml xml2 xmlreader xmlrpc xmlwriter xorg xvid yahoo yp zeroconf zip zlib" ALSA_CARDS="ali5451 als4000 atiixp atiixp-modem bt87x ca0106 cmipci emu10k1x ens1370 ens1371 es1938 es1968 fm801 hda-intel intel8x0 intel8x0m maestro3 trident usb-audio via82xx via82xx-modem ymfpci" ALSA_PCM_PLUGINS="adpcm alaw asym copy dmix dshare dsnoop empty extplug file hooks iec958 ioplug ladspa lfloat linear meter mmap_emul mulaw multi null plug rate route share shm softvol" APACHE2_MODULES="actions alias auth_basic auth_digest authn_anon authn_dbd authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache dav dav_fs dav_lock dbd deflate dir disk_cache env expires ext_filter file_cache filter headers ident imagemap include info log_config logio mem_cache mime mime_magic negotiation proxy proxy_ajp proxy_balancer proxy_connect proxy_http rewrite setenvif so speling status unique_id userdir usertrack vhost_alias jk" ELIBC="glibc" INPUT_DEVICES="mouse keyboard" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" USERLAND="GNU" VIDEO_CARDS="radeon"
Unset:  CPPFLAGS, CTARGET, EMERGE_DEFAULT_OPTS, FFLAGS, INSTALL_MASK, LANG, LC_ALL, LDFLAGS, LINGUAS, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS