Arch Linux

Please read this before reporting a bug:

Do NOT report bugs when a package is just outdated, or it is in Unsupported. Use the 'flag out of date' link on the package page, or the Mailing List.

REPEAT: Do NOT report bugs for outdated packages!

FS#24772 - dhcpcd needs hostname

Attached to Project: Arch Linux
Opened by Simon Schneider (schneida) - Saturday, 18 June 2011, 17:52 GMT
Last edited by Tom Gundersen (tomegun) - Sunday, 21 August 2011, 13:23 GMT
Task Type Bug Report
Category Packages
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 2
Private No



After removing net-tools from the base group, trying to setup network via dhcpcd without installing anything except base group, results in two error-messages:

/usr/lib/dhcpcd/dhcpcd-hooks/30-hostname: line 9: hostname: command not found
/usr/lib/dhcpcd/dhcpcd-hooks/30-hostname: line 24: hostname: command not found

Even though the network will still work, there shouldn't come up any errors when doing such an essential thing without installing anything else. I've had a look at the file in question and it seems (there are not many helpful comments) that the file is to fetch a hostname from DHCP-Server if needed. Maybe it could be removed or dhcpcd must depend on a package that provides hostname.

Additional info:
dhcpcd: 5.2.12-1

Steps to reproduce:

ip link set eth0 up
dhcpcd eth0
This task depends upon

Closed by  Tom Gundersen (tomegun)
Sunday, 21 August 2011, 13:23 GMT
Reason for closing:  Fixed
Comment by Tom Gundersen (tomegun) - Saturday, 18 June 2011, 18:10 GMT
dhcpcd should probably depend on net-tools for the time being.
Comment by Simon Schneider (schneida) - Saturday, 18 June 2011, 18:29 GMT
But wouldn't that make it part of the base group again and defeat the purpose of deprecating it? As a side note: I just saw that X is complaining about missing hostname too, but thats a different issue.
Comment by Dave Reisner (falconindy) - Saturday, 18 June 2011, 18:32 GMT
Feature request upstream to use the same 'echo' method we use to set the hostname, perhaps?
Comment by Tom Gundersen (tomegun) - Saturday, 18 June 2011, 18:44 GMT
Even if some packages still pull in net-tools, it will still be a good thing to minimise the number of packages that actually use it. By adding the dependencies explicitly, at least it will show us where the problems are.

The thing is that we cannot really remove "hostname" from net-tools as it has lots of features that some people rely on.

I guess we could create a really basic "hostname" package which only does enough to support the LSB spec. (from some maintained source). Then, "net-tools" colud provide "hostname" and conflict with the hostname package.

For what it is worth, this is my /bin/hostname:

cat /proc/sys/kernel/hostname

So, probably X and dhcpcd could easily read the hostname from the kernel directly (either from /proc or using gethostname()).
Comment by Dan McGee (toofishes) - Sunday, 19 June 2011, 20:46 GMT
The only thing this 30-hostname script does is invoke `hostname "$1"`. I'd be surprised if they didn't take a patch that changed that to something like:

if [ -f /proc/sys/kernel/hostname ]; then
echo "$1" > /proc/sys/kernel/hostname
hostname "$1"

Up to someone to take the initiative to do this and follow through with it though, I've got enough on my plate.
Comment by Dave Reisner (falconindy) - Sunday, 19 June 2011, 20:52 GMT
I'll do it...
Comment by Dave Reisner (falconindy) - Sunday, 19 June 2011, 21:02 GMT Comment by Emil Renner Berthing (Esmil) - Monday, 11 July 2011, 08:34 GMT
How about moving hostname from net-utils to coreutils?

Right now the PKGBUILD of coreutils explicitly disables it.
Comment by Tom Gundersen (tomegun) - Monday, 11 July 2011, 08:53 GMT
@Esmil: this was done and reverted. The hostname in coreutils does not have the same features as the one in net-tools.

My suggestion (though I don't have the time to push it), is:

Create a new packages "coreutils-hostname" (by splitting coreutils). Add "provide=hostname" to both this new package and net-tools. Then make all the packages that need hostname depend on "hostname". Then the local admin can install what they want.
Comment by Emil Renner Berthing (Esmil) - Monday, 11 July 2011, 08:55 GMT
Ahh, thank you for the explanation. I like that solution.
Comment by dauerbaustelle (dauerbaustelle) - Friday, 05 August 2011, 08:16 GMT

this is also a problem with xorg-xinit
Comment by Tom Gundersen (tomegun) - Friday, 05 August 2011, 10:41 GMT
Someone suggested that we should rather add inetutils to base, as it contains hostname and a few other tools from net-tools. They are supposedly compatible. I have not had time to check if this is really the case though. Any comments would be appreciated.

If that i the case I suggest removing some of these things from net-tools and enabling them in inetutils instead.