Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 248925 - net-dns/openresolv-2.0 - resolvconf and automatical interaction with net-dns/pdnsd
Summary: net-dns/openresolv-2.0 - resolvconf and automatical interaction with net-dns/...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: High major (vote)
Assignee: Jim Ramsay (lack) (RETIRED)
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-11-26 18:03 UTC by Oldrich Jedlicka
Modified: 2010-07-28 15:05 UTC (History)
2 users (show)

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


Attachments
Updated pdnsd script, version 2008-11-26 (pdnsd,17.31 KB, text/plain)
2008-11-26 18:04 UTC, Oldrich Jedlicka
Details
Updated pdnsd script, version 2008-12-17 (pdnsd,17.31 KB, text/plain)
2008-12-17 11:12 UTC, Oldrich Jedlicka
Details
Updated pdnsd script, version 2009-01-18 (pdnsd,17.58 KB, text/plain)
2009-01-18 02:32 UTC, Oldrich Jedlicka
Details
Updated pdnsd script, version 2009-05-04 (pdnsd,17.89 KB, text/plain)
2009-05-04 18:26 UTC, Oldrich Jedlicka
Details
Updated pdnsd script, version 2009-10-29 (pdnsd,18.60 KB, text/plain)
2009-10-29 21:23 UTC, Oldrich Jedlicka
Details
Updated pdnsd script, version 2009-10-29 (2) (pdnsd,18.59 KB, text/plain)
2009-10-29 21:24 UTC, Oldrich Jedlicka
Details
Updated pdnsd script, version 2009-10-30 (pdnsd,18.71 KB, text/plain)
2009-10-30 22:27 UTC, Oldrich Jedlicka
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Oldrich Jedlicka 2008-11-26 18:03:09 UTC
Here is update for pdnsd script from resolvconf that works with openresolv-2.0.
Comment 1 Oldrich Jedlicka 2008-11-26 18:04:45 UTC
Created attachment 173493 [details]
Updated pdnsd script, version 2008-11-26
Comment 2 Lars Wendler (Polynomial-C) (RETIRED) gentoo-dev 2008-11-26 18:12:32 UTC
Reassigning to net-dialup herd.
Comment 3 Lars Wendler (Polynomial-C) (RETIRED) gentoo-dev 2008-11-26 18:29:44 UTC
Sorry, wrong assignment. This belongs to openresolv package, not pdnsd. Fixing summary as well...
Comment 4 Oldrich Jedlicka 2008-12-17 11:12:38 UTC
Created attachment 175599 [details]
Updated pdnsd script, version 2008-12-17

This is a bug-fix of previous update. Some variable expansions used wrongly first/shortest matches.
Comment 5 Oldrich Jedlicka 2008-12-17 11:14:06 UTC
The file is part of pdnsd currently, so why the openresolv assignment?
Comment 6 Lars Wendler (Polynomial-C) (RETIRED) gentoo-dev 2008-12-18 16:38:01 UTC
This script is supposed to reside in /etc/resolvconf/update.d/, right?
If yes, /etc/resolvconf belongs to net-dns/openresolv package and not net-dns/pdnsd. That's why I assigned this bug to openresolv-maintainer since the current 2.0 package also installs the scripts for dnsmasq and named...
Comment 7 Oldrich Jedlicka 2008-12-18 16:44:16 UTC
Ok, no problem. I just want to have it somewhere.

If there are any problems with my script, don't hesitate to report it here.
Comment 8 Oldrich Jedlicka 2009-01-18 02:32:19 UTC
Created attachment 178849 [details]
Updated pdnsd script, version 2009-01-18

Updated configuration description for openresolv-2.0 (update /etc/conf.d/resolvconf/resolv.conf.d/base instead of /etc/conf.d/net).
Comment 9 Oldrich Jedlicka 2009-01-30 07:31:03 UTC
Is here some progress? The old resolvconf script simply doesn't work with openresolv-2.0, so the user cannot use it!
Comment 10 Oldrich Jedlicka 2009-04-20 19:31:44 UTC
Please make ANY progress on this bug report. I'm very unhappy to see that nobody wants to put a single file into the portage tree.

During the last updates guys from pdnsd were MUCH faster in including the update. Once more I repeat the the update script is _unusable_ in the unchanged state with openresolv-2+.

THANKS!
Comment 11 Oldrich Jedlicka 2009-04-20 19:33:14 UTC
And this is a bug fix, not an enhancement.
Comment 12 Jim Ramsay (lack) (RETIRED) gentoo-dev 2009-05-01 18:35:45 UTC
Hi, I'm the new maintainer of openresolv, so let's see what we can do about this.

Does this script work with openresolv-3.x as well?  Or just 2.x?

Please let me know exactly what versions this script works with, and I'd be glad to include it.

By the way, have you tried contacting openresolv upstream to see if they would be interested in putting this in the official distribution?
Comment 13 Oldrich Jedlicka 2009-05-04 18:26:41 UTC
Created attachment 190334 [details]
Updated pdnsd script, version 2009-05-04

Included usage description for openresolv-3*
Comment 14 Oldrich Jedlicka 2009-05-04 18:34:41 UTC
Hi Jim, thanks for hearing me :-)

I've tested the script now and it works with both versions - 3.3 and 2.0. It worked with 1.x last time I've checked it (December 2008). There haven't been no functional changes since then, only the activation description had to be tuned a little bit for openresolv-2.x and 3.x (see top of the file).

Thanks.
Comment 15 Oldrich Jedlicka 2009-05-04 18:44:18 UTC
(In reply to comment #12)
> By the way, have you tried contacting openresolv upstream to see if they would
> be interested in putting this in the official distribution?

I didn't try to contact any maintainer of openresolv, because it always worked this way (via Bugzilla) flawlessly. And because the script was part of Gentoo's pdnsd package already, I didn't have any need to push anybody to update the script - until now...

I don't have much spare time (building a house), so I preffer to use Bugzilla - the thread doesn't go away like it does on IRC with an online, but not responding maintainer.
Comment 16 Roy Marples 2009-05-06 12:01:13 UTC
openresolv-3.3.2 tarball includes a subscriber for the PowerDNS recursor as that is what should be used here. However, it's not installed by default because there is no ability to set global forwarders. Aside from that it's good.

I see no reason why PowerDNS itself couldn't be supported either, but I do have a lot of issues with the subscriber attached here becoming part of upstream.

* Needs to be same code style as other subscribers
* Needs to work with /bin/sh (ie, not bash)
* Restricted to POSIX interfaces for all userland tools so it works on the BSD family and others
* Try and avoid using any program found in /usr on any platform as there is no guarantee /usr is available when resolvconf runs.

The last point rules out using tools suchs as awk, grep and sed on the BSDs.
Comment 17 Oldrich Jedlicka 2009-05-06 13:56:47 UTC
(In reply to comment #16)
> * Needs to be same code style as other subscribers
> * Needs to work with /bin/sh (ie, not bash)
> * Restricted to POSIX interfaces for all userland tools so it works on the BSD
> family and others
> * Try and avoid using any program found in /usr on any platform as there is no
> guarantee /usr is available when resolvconf runs.
>
> The last point rules out using tools suchs as awk, grep and sed on the BSDs.

That is bad, because I don't have much time to rewrite the script (do the parsing in bash instead of generating the sed script). Better choice would be to have it written in python/C, but former requirement was to have it in shell language.

I will see how much time I will have, but it would be better to have clear requirements from the beginning. Should it be written to work with /bin/sh only, or could it be a perl, python (prefferable) script or a C program? Language doesn't limit me at all (as you can see programming in `sed` is also possible) :-)
Comment 18 Oldrich Jedlicka 2009-05-06 14:19:12 UTC
(In reply to comment #16)
> openresolv-3.3.2 tarball includes a subscriber for the PowerDNS recursor as
> that is what should be used here. However, it's not installed by default
> because there is no ability to set global forwarders. Aside from that it's
> good.

This is about support for pdnsd (http://www.phys.uu.nl/~rombouts/pdnsd.html), not PowerDNS.
Comment 19 Jim Ramsay (lack) (RETIRED) gentoo-dev 2009-05-06 16:24:26 UTC
Well, for now I've added this to the Gentoo ebuilds...

Since they're all unstable except for 2.0, I've added them directly to all the versions there except for 2.0, which I rev-bumped to 2.0-r1.
Comment 20 Roy Marples 2009-05-06 16:33:10 UTC
You two will have to support it then :)
Comment 21 Oldrich Jedlicka 2009-05-07 04:42:46 UTC
The net-dns/pdnsd also needs new revision, because it provides the old version of the script; net-dns/openresolv needs to block old revisions afterwards.
Comment 22 Oldrich Jedlicka 2009-05-07 04:44:19 UTC
(In reply to comment #20)
> You two will have to support it then :)

I'm providing support for my script for a long time now and see no problem providing it in future too :-)
Comment 23 Davide Pesavento gentoo-dev 2009-10-29 10:03:05 UTC
The current version of /lib/resolvconf/pdnsd installed with openresolv-3.3.2 is not posix compliant.
/sbin/resolvconf sources every file in /lib/resolvconf/ and, since resolvconf itself uses /bin/sh, those scripts must be sh-compliant too. Currently pdnsd script contains bashisms, thus it doesn't work on systems where /bin/sh points to another shell (dash for example).
Comment 24 Oldrich Jedlicka 2009-10-29 21:23:40 UTC
Created attachment 208673 [details]
Updated pdnsd script, version 2009-10-29

Updated to be more POSIX compliant.
Comment 25 Oldrich Jedlicka 2009-10-29 21:24:58 UTC
Created attachment 208675 [details]
Updated pdnsd script, version 2009-10-29 (2)

Updated to call /bin/sh
Comment 26 Oldrich Jedlicka 2009-10-29 21:26:42 UTC
(In reply to comment #23)
> The current version of /lib/resolvconf/pdnsd installed with openresolv-3.3.2 is
> not posix compliant.
> /sbin/resolvconf sources every file in /lib/resolvconf/ and, since resolvconf
> itself uses /bin/sh, those scripts must be sh-compliant too. Currently pdnsd
> script contains bashisms, thus it doesn't work on systems where /bin/sh points
> to another shell (dash for example).

I did some updates according to what I found about the POSIX shells on the internet. Can you please have a look at the updated script? Thanks!
Comment 27 Davide Pesavento gentoo-dev 2009-10-30 15:22:34 UTC
You must use printf instead of 'echo -e', 'echo -n', etc... POSIX echo does not support any options.
And replace '&>/dev/null' with '>/dev/null 2>&1' too (I think you can use grep -q in the first occurrence).

Apart from that it looks fine to me. Thanks!
Comment 28 Oldrich Jedlicka 2009-10-30 22:27:20 UTC
Created attachment 208808 [details]
Updated pdnsd script, version 2009-10-30

1. Fixed usage of echo (replaced by clearer printf)
2. Replaced &>/dev/null by >/dev/null 2>&1
3. Fixed bug with missing ending @ in "@RULE"
Comment 29 Oldrich Jedlicka 2009-10-30 22:28:14 UTC
(In reply to comment #27)
> You must use printf instead of 'echo -e', 'echo -n', etc... POSIX echo does not
> support any options.
> And replace '&>/dev/null' with '>/dev/null 2>&1' too (I think you can use grep
> -q in the first occurrence).
> 
> Apart from that it looks fine to me. Thanks!

Fixed in new version. Thanks for comments :-)
Comment 30 Jeremy Olexa (darkside) (RETIRED) archtester gentoo-dev Security 2010-01-09 23:47:59 UTC
(In reply to comment #29)
> (In reply to comment #27)

> Fixed in new version. Thanks for comments :-)
> 

Version of what?
Comment 31 Oldrich Jedlicka 2010-01-10 15:16:34 UTC
(In reply to comment #30)
> (In reply to comment #29)
> > (In reply to comment #27)
> 
> > Fixed in new version. Thanks for comments :-)
> > 
> 
> Version of what?
> 

Version of attachment of this bug. This "project" doesn't have any home page, nor I'm Gentoo dev to have a Git tree. Currently if there is no Gentoo dev to apply the changes to the portage tree, it will not be there.

If you have any questions, don't hesitate to ask here :-) 
Comment 32 Oldrich Jedlicka 2010-01-10 15:27:07 UTC
The file is part of net-dns/pdnsd, but the tree has an old version. Also new is that for openresolv-3* it needs to be put in /lib/resolvconf/pdnsd, not in /etc/resolvconf/update.d.
Comment 33 Oldrich Jedlicka 2010-01-11 10:58:20 UTC
(In reply to comment #32)
> The file is part of net-dns/pdnsd, but the tree has an old version. Also new is
> that for openresolv-3* it needs to be put in /lib/resolvconf/pdnsd, not in
> /etc/resolvconf/update.d.

Sorry, wrong information. The file _was_ part of net-dns/pdnsd, you can find in with in-tree version of net-dns/openresolv (version 3). I either case, the newest version isn't included.
Comment 34 Jeremy Olexa (darkside) (RETIRED) archtester gentoo-dev Security 2010-01-13 03:33:28 UTC
(In reply to comment #33)
> (In reply to comment #32)
> > The file is part of net-dns/pdnsd, but the tree has an old version. Also new is
> > that for openresolv-3* it needs to be put in /lib/resolvconf/pdnsd, not in
> > /etc/resolvconf/update.d.
> 
> Sorry, wrong information. The file _was_ part of net-dns/pdnsd, you can find in
> with in-tree version of net-dns/openresolv (version 3). I either case, the
> newest version isn't included.
> 

Ok, thanks. I now see the missing link. It is this file: 
%% qlist openresolv | grep pdns
/lib/resolvconf/pdnsd

Well, it is too bad that Roy doesn't want to support it/add it. I'll remove him from CC (comment #20).

Should I drop the new file in for the 3.3.4 version?
Comment 35 Oldrich Jedlicka 2010-01-13 06:34:01 UTC
(In reply to comment #34)
> Should I drop the new file in for the 3.3.4 version?

Yes, please (3.3.4-r1).
Comment 36 Jim Ramsay (lack) (RETIRED) gentoo-dev 2010-07-28 15:05:48 UTC
I've dropped it in for all current versions, as well as revbumped 3.3.4-r1 so everyone gets it.