Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 295260 - net-dns/bind-9.6.1_p2 initscript depends are excessive
Summary: net-dns/bind-9.6.1_p2 initscript depends are excessive
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Server (show other bugs)
Hardware: AMD64 Linux
: High normal (vote)
Assignee: Konstantin Arkhipov (RETIRED)
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-11-30 23:30 UTC by Jon Gerdes
Modified: 2010-10-09 21:30 UTC (History)
3 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 Jon Gerdes 2009-11-30 23:30:03 UTC
I have disabled both USE mysql and postgresql for BIND yet named still has:

depend (){after pg_autovacuum postgresql mysql ldap}

However, mysql has:

depend() {use dns net localmount netmount nfsmount}

I think this is what causes a large string of yellow messages on boot up whereby services depend on each other causes a slow boot up until timeout.

Reproducible: Always

Steps to Reproduce:
1. Install both BIND and PostgreSQL or MySQL without USE=mysql postgresql
2. 
3.

Actual Results:  
Slow boot up due to dependencies

Expected Results:  
No dependency on a DB for BIND
Comment 1 Robin Johnson archtester Gentoo Infrastructure gentoo-dev Security 2009-12-28 22:38:44 UTC
@bind team:
When there is USE=-postgres/-mysql/-ldap, please exclude them from your init script entirely.

Alternatively, drop them entirely, and add the following block to your conf.d:
# If you are using MySQL/Postgresql/LDAP support and are running 
# the other server on the local machine, you may wish to 
# uncomment one of the following:
#rc_named_after="mysql"
#rc_named_after="postgresql pg_autovacuum"
#rc_named_after="ldap"

(You could possible auto-uncomment based on the use-flags as well).
Comment 2 Jon Gerdes 2009-12-29 00:00:55 UTC
Does a database daemon really *need* a DNS server on the *local* machine to start up?

If a user has created a set up that needed (I don't have that kind of imagination) DNS to start locally before the DBs then perhaps that should be done in /etc/rc.conf.

As I think about this more then it is surely the DB system maintainers that need to lose the depend() { dns }.

Basically, a DB will function the same way regardless of whether the DNS server is local or not.
Comment 3 Robin Johnson archtester Gentoo Infrastructure gentoo-dev Security 2009-12-29 08:14:43 UTC
(In reply to comment #2)
> Does a database daemon really *need* a DNS server on the *local* machine to
> start up?
> 
> If a user has created a set up that needed (I don't have that kind of
> imagination) DNS to start locally before the DBs then perhaps that should be
> done in /etc/rc.conf.
That's precisely what I said, just in the conf.d files.

I do however think that MySQL really needing DNS is a LOT more common than BIND being built+configured with mysql/postgres/ldap.

Two major cases for DNS use in MySQL:
1.
Say you're running BIND on MySQL, and you gave the ACL as:
# GRANT SELECT ON bind.* TO bind@foobar;
Where 'foobar' was the hostname that needed full resolution.
When BIND starts up and tries to connect to MySQL, it's auth is going to fail.
That's why I asked if BIND failed on start when built+configured w/ USE=mysql, or if it retried.

2.
If you are using replication in MySQL (and your machine is the slave), and the replication might need DNS to find the master.

> As I think about this more then it is surely the DB system maintainers that
> need to lose the depend() { dns }.
> 
> Basically, a DB will function the same way regardless
> of whether the DNS server is local or not.
If the nameserver and the record we want is local, then MySQL may fail due to DNS not being available (some DNS records are looked up at start, and their result is cached).

As a general improvement, BOTH sides should convert the 'depend ...' into commented-out depend_SVC_use/need=... blocks in the conf.d files.

I don't personally use BIND with postgres, mysql OR ldap. Just plain files. So I'd like it to start long before those services.

I do however use DNS in my MySQL configurations.

For the generic everyday user, that just has localhost MySQL, and no postgres/mysql/ldap BIND, absolutely NONE of these various use/need deps should be present.
Comment 4 Jon Gerdes 2009-12-29 13:09:42 UTC
(In reply to comment #3)

Thanks for the detailed comment.

> As a general improvement, BOTH sides should convert the 'depend ...' into
> commented-out depend_SVC_use/need=... blocks in the conf.d files.

That seems the Gentoo way to do it, perhaps with a note at the end of the emerge output mentioning this if BIND et al have USE=$potential_dns_db_backend and a corresponding mention at the end of a DB emerge or is that a bit over the top.  If you are skilled enough to want to store dns data in a db then you should have enough Gentoo-Fu to know how to deal with service dependencies and having them ready to go commented out is a bit of a gift. 
Comment 5 Christian Ruppert (idl0r) gentoo-dev 2010-06-19 15:47:31 UTC
(In reply to comment #1)
> @bind team:
> When there is USE=-postgres/-mysql/-ldap, please exclude them from your init
> script entirely.
>
This has been applied now to bind-9.7.1.

> Alternatively, drop them entirely, and add the following block to your conf.d:
> # If you are using MySQL/Postgresql/LDAP support and are running 
> # the other server on the local machine, you may wish to 
> # uncomment one of the following:
> #rc_named_after="mysql"
> #rc_named_after="postgresql pg_autovacuum"
> #rc_named_after="ldap"
> 
> (You could possible auto-uncomment based on the use-flags as well).
>

Have you some more details about that? Will that work with and without openrc?
I just have to add them to /etc/conf.d/named?
I couldn't find any useful docs about that by now but I'll try to take a deeper look at it.

Comment 6 Christian Ruppert (idl0r) gentoo-dev 2010-10-09 21:30:33 UTC
Fixed in 9.4.3_p5-r1, 9.6.2_p2-r1, 9.7.1_p2-r1 and above.