FS#26117 - dhcpcd hooks use commands provided only by net-tools

Attached to Project: Arch Linux
Opened by Kerin Millar (kerframil) - Sunday, 25 September 2011, 23:22 GMT
Last edited by Ronald van Haren (pressh) - Thursday, 03 November 2011, 21:25 GMT
Task Type Bug Report
Category Packages: Core
Status Closed
Assigned To Ronald van Haren (pressh)
Architecture All
Severity Low
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 3
Private No

Details

dhcpcd implements hooks which utilise the 'ifconfig' and 'hostname' commands. However, the net-tools package has been deprecated in favour of iproute2 and does not appear to be a dependency of any package in the base group.

dhcpcd[1149]: eth2: writing lease `/var/lib/dhcpcd/dhcpcd-eth2.lease'
dhcpcd[1149]: eth2: executing `/usr/lib/dhcpcd/dhcpcd-run-hooks', reason BOUND
/usr/lib/dhcpcd/dhcpcd-hooks/10-mtu: line 10: ifconfig: command not found
/usr/lib/dhcpcd/dhcpcd-hooks/30-hostname: line 9: hostname: command not found
dhcpcd[1149]: forking to background

One solution would obviously be to have dhcpcd depend upon net-tools. Alternatively, the offending scripts could be adapted to use 'ip' and 'sysctl' instead, as demonstrated in the attached patch (against dhcpcd-5.2.12-1).

EDIT: just as I finished writing this report, I realised the existence of #24772! I'm filing this anyway because the other bug (a) didn't mention the 'ifconfig' aspect (b) is now closed (c) the patch here presents a different take on the matter.
This task depends upon

Closed by  Ronald van Haren (pressh)
Thursday, 03 November 2011, 21:25 GMT
Reason for closing:  Fixed
Additional comments about closing:  dhcpcd 5.2.12-2 depends on both inetutils and net-tools (for hostname and ifconfig)
Comment by Tom Gundersen (tomegun) - Sunday, 25 September 2011, 23:42 GMT
hostname is provided by inetutils which is now in base.
Comment by Karol Błażewicz (karol) - Sunday, 25 September 2011, 23:55 GMT
Tom means inetutils 1.8-4, currently in [testing] http://www.archlinux.org/packages/testing/i686/inetutils/
Comment by Kerin Millar (kerframil) - Monday, 26 September 2011, 00:38 GMT
Thanks for the clarification, Karol. I'm not overly familiar with Arch development practices so Tom's comment had me puzzled for a moment there! However, the testing instance of inetutils does not replace ifconfig so there remains the matter of the mtu setting hook.

Roy Marples (the author of dhcpcd/openrc) writes his software with portability in mind. The manner in which he employs ifconfig here is fairly portable i.e. it covers BSD also. I understand the decision to decisively deprecate net-tools and even applaud Arch for making such a bold and progressive move. That said, iproute2 _is_ Linux-specific. In this case, it's difficult to envisage upstream adopting the less-portable method. For that reason, patching it to use 'ip' strikes me as the logical thing to do, even if deviations from upstream are normally considered undesirable.

On another note, inetutils provides a number of binaries which seem rather archaic and, arguably, anachronistic in the context of the core of a modern Linux distro. It seems a pity that they will effectively become mandatory in order to ensure the general presence of the hostname command, though I have to admit that it's a simple solution.
Comment by Tom Gundersen (tomegun) - Monday, 26 September 2011, 16:09 GMT
Sorry for the too terse answer. I had lost track of this and assumed inetutils had moved to [core] by now, my bad.

I agree that the ifconfig part of your report still needs to be sorted out. One possibility is to apply your patch, another is to move to inetutils' ifconfig, but that would cause possible compatibility problems.
Comment by Kerin Millar (kerframil) - Wednesday, 28 September 2011, 00:00 GMT
ifconfig appears to be excluded from the inetutils package in [testing]. Opting to include it would presumably induce a conflict with net-tools that would need to be managed. Because of that, and because you say that it may pose compatibility problems, I think that patching makes for the simplest approach. Either way, it would be nice to get the current inetutils package into [core] soon; in my view, ensuring that the dhcp client behaves correctly is quite important. EDIT: Or, alternatively, to apply the proposed patch in its entirety.
Comment by Michael Witten (mfwitten) - Thursday, 13 October 2011, 00:28 GMT
I just got bitten by this bug; I was basically getting a harmless warning about a missing `hostname'.

Shouldn't branching from upstream (and therefore any patches) be avoided? It seems like the `dhcpcd' package should CURRENTLY depend explicitly on both `inetutils' AND `net-tools' (from what I can tell, they don't conflict). Then `dhcpcd' can hopefully be updated upstream to use more modern tools, thereby allowing for the downstream pacman package to drop `net-tools'.

Loading...