Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 433441

Summary: net-misc/dhcpcd should RDEPEND on net-dns/bind-tools (for either dig or host)
Product: Gentoo Linux Reporter: Hubert Mercier <anigel>
Component: [OLD] Core systemAssignee: William Hubbs <williamh>
Status: RESOLVED FIXED    
Severity: minor CC: anigel, base-system, ibuyandtrade0+bugs.gentoo.org, roy
Priority: Normal    
Version: unspecified   
Hardware: All   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---

Description Hubert Mercier 2012-08-30 12:57:49 UTC
Hi.

Currently the dhcpcd package' ebuild has an empty RDEPEND variable.

But, in order to make hostname acquired from the DHCP server, the /lib64/dhcpcd/dhcpcd-hooks/29-lookup-hostname script uses "dig", which is part from net-dns/bind-tools.

Maybe this package should be added as a required dependency of dhcpcd ?

Reproducible: Always

Steps to Reproduce:
1. try to get hostname from server with dhcpcd if bind-tools is not installed
2.
3.
Actual Results:  
getting hostname fails, system defaults to "localhost" or 127.0.0.1 equivalent
Comment 1 Roy Marples 2012-09-03 09:27:20 UTC
It can use host(1) or dig(1), both of which are provided by net-dns/bind-tools.

(In reply to comment #0)
> But, in order to make hostname acquired from the DHCP server, the
> /lib64/dhcpcd/dhcpcd-hooks/29-lookup-hostname script uses "dig", which is
> part from net-dns/bind-tools.

The premise is wrong. That script is only used when the DHCP server did not supply a hostname. To it's correct to say this: "But, in order to make the hostname aquired from the DNS server"

Also, the default is not to actually run it so you would have needed to edit /etc/dhcpcd.conf

> Maybe this package should be added as a required dependency of dhcpcd ?

I strongly disagree. Added as an optional dependency maybe, but pulling net-dns/bind-tools just for this is too much imho.
Comment 2 Hubert Mercier 2012-09-03 10:05:20 UTC
Hi

> > Maybe this package should be added as a required dependency of dhcpcd ?
> 
> I strongly disagree. Added as an optional dependency maybe, but pulling
> net-dns/bind-tools just for this is too much imho.

An optional dependency sounds good. But since this functionality is not working unless this dep is satisfied, it does not seem "too much". Anyway at least some piece of information that would help users to understand why, when using this script, the hostname is not found (elog in post_inst should be fine too).
Comment 3 Hubert Mercier 2012-09-03 10:14:53 UTC
*** Bug 433501 has been marked as a duplicate of this bug. ***
Comment 4 Roy Marples 2012-09-03 18:12:25 UTC
(In reply to comment #2)
> An optional dependency sounds good. But since this functionality is not
> working unless this dep is satisfied, it does not seem "too much". Anyway at
> least some piece of information that would help users to understand why,
> when using this script, the hostname is not found (elog in post_inst should
> be fine too).

By too much I mean that pulling net-dns/bind-tools in for embedded systems that use dhcpcd is too much. Just because an optional piece of functionality is required by you doesn't mean that everyone else desires it. Hence making it an option USE flag. I would propose -lookup_dns_hostname to avoid any confusion, or just -lookup_hostname. The ebuild could even modify the default config to enable the script at runtime.
Comment 5 Hubert Mercier 2012-10-14 14:42:50 UTC
(In reply to comment #4)

> By too much I mean that pulling net-dns/bind-tools in for embedded systems
> that use dhcpcd is too much.

I agree.

> Just because an optional piece of functionality
> is required by you doesn't mean that everyone else desires it. Hence making
> it an option USE flag. I would propose -lookup_dns_hostname to avoid any
> confusion, or just -lookup_hostname. The ebuild could even modify the
> default config to enable the script at runtime.

I've probably misexplained my thoughts (sorry, english is not my native language).

I agree with this proposal too.

Want me to modify the ebuilds ?
Comment 6 William Hubbs gentoo-dev 2013-05-08 15:57:31 UTC
Hello,

sorry it has taken me a while to look at this.

I can add a use flag to control whether the hook is installed, then I
can set up the runtime dependency as you suggest. However, I am not
comfortable adding another a use flag that modifies dhcpcd.conf. That
seems to go against our definition of how use flags are supposed to be
used [1].

Roy,

it seems a little counter-intuitive to install the lookup-hostname hook
by default then disable it in the default configuration. Are you willing
to not install it by default and not mention it at all in the default
configuration? I'll attach a patch if you want.

[1] http://devmanual.gentoo.org/general-concepts/use-flags/index.html
Comment 7 Roy Marples 2013-05-10 10:49:11 UTC
(In reply to comment #6)
> it seems a little counter-intuitive to install the lookup-hostname hook
> by default then disable it in the default configuration.

How else am I meant to provide it? For systems other than Gentoo.

> Are you willing
> to not install it by default and not mention it at all in the default
> configuration? I'll attach a patch if you want.

Well, the only conceivable option would be to store it like in say /usr/share/examples/dhcpcd-hooks and document this in the readme.
Comment 8 Hubert Mercier 2013-05-10 17:38:31 UTC
Hello,

As I said in my second post here, the technical way this problem is handled is not very important. But it should be mentioned to users, since, for those who need this hook, missing this piece of information does not help to debug...

Thank you in advance !
Comment 9 William Hubbs gentoo-dev 2013-06-04 01:40:08 UTC
I added the following elogs to pkg_postinst in dhcpcd-5.99.6.

	if ! has_version net-dns/bind-tools; then
		elog
		elog "If you activate the lookup-hostname hook to look up your hostname"
		elog "using the dns, you need to install net-dns/bind-tools."
	fi

	Please feel free to let me know if you can think of a better fix.
	
	Thanks,

	William
Comment 10 Hubert Mercier 2013-06-04 12:13:06 UTC
Hi,

From my point of view this is a good solution.

Thank you,
Comment 11 Roy Marples 2015-01-22 20:39:46 UTC
Newer dhcpcd-6.6.5 and fewer fallback to getent(1), so this warning can now be removed.