Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 53562 - net-dns/mydns initscript includes dependencies which can conflict
Summary: net-dns/mydns initscript includes dependencies which can conflict
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: High normal
Assignee: MATSUU Takuto (RETIRED)
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-06-10 12:08 UTC by Davin Boling
Modified: 2004-06-13 00:19 UTC (History)
0 users

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 Davin Boling 2004-06-10 12:08:15 UTC
The way depends are specified in the mydns initscript allows for a rare condition where the mydns script fails to start mydns, returning a false positive. The initscript should only have a depend of "mysql" or "postgre", BUT NEVER BOTH. The  consequences of this mistake are somewhat obscure and illustrated in very specific steps below.

Reproducible: Always
Steps to Reproduce:
1. Both the mysql and postgresql ebuilds need to be installed.
2. mydns must be built with the "postgres" USE flag. By design, you can only specify a USE flag of "mysql" or "postgres" for the ebuild.
3. Start postgresql.
3. Configure mydns appropriately so that it retrieves information from the postgresql server, and not mysql. Use mydnscheck to ensure that the database is set up correctly, make sure the mydns initscript is spawning mydns servers on the process list.
4. Goto either steps 5-6 below, or step 7. Both will exhibit the bug.

5. Stop all three daemons.
6. Start mydns.

7. Reboot.
Actual Results:  
Because mysql is listed as a depend first, the mysql server will be started.
Having only one of these servers started meets the dependency of the initscript
("mydns postgres"), and mydns is allowed to start without postgresql running.
Since mydns has been compiled with the "postgre" USE flag, it is expecting to
use a postgresql server with the credentials in /etc/mydns.conf. Since a
postgresql server is not running, the mydns script will start with a false
positive. No mydns processes will be spawned because the needed database servers
are missing.

Expected Results:  
The *appropriate* SQL server should be started before mydns.

Since this ebuild strictly limits a USE flag of either "mydns" or "postgres" as
it is (and never both), it would make sense that the installed initscript only
contain the depend() for the server in the USE flag. This is the fix I would
suggest.

A temporary fix for mydns users would be to edit /etc/init.d/mydns and remove
the offending depend().
Comment 1 Davin Boling 2004-06-10 12:11:58 UTC
Correction:
For step 7 (reboot) to work, all three servers needed to be added to the default runlevel.

Comment 2 Davin Boling 2004-06-10 12:22:28 UTC
Further clarification:

The true problem is that the initscript actually contains a typo. The depend() "postgres" should actually be "postgresql". I was wondering why that depend() didn't simply start both of them!

A correction of the typo would be enough to unbreak this initscript, but is it really necessary to start both of these servers when mydns can only be compiled to use one or the other anyway? A dynamic insertion of the appropriate server based on USE flag selection would make more sense.

Please note that if you're trying to use the quick fix I suggested, the depend() will needed to be changed from "postgres" to "postgresql". You'll also need to run depscan.sh, which I completely neglected to mention.
Comment 3 MATSUU Takuto (RETIRED) gentoo-dev 2004-06-13 00:19:24 UTC
I fixed typo(files/mydns.rc6) and dependencies(files/mydns.rc6-0.11.0).
in cvs.