FS#24651 - [net-tools] loss of functionality in hostname/dnsdomainname tools

Attached to Project: Arch Linux
Opened by Ivan Todoroski (Grnch) - Thursday, 09 June 2011, 15:59 GMT
Last edited by Tom Gundersen (tomegun) - Saturday, 18 June 2011, 18:27 GMT
Task Type Bug Report
Category Packages: Extra
Status Closed
Assigned To Tom Gundersen (tomegun)
Architecture All
Severity Low
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 2
Private No

Details

After the move of hostname/domainname to coreutils/yp-tools the following bugs occur:

- dnsdomainname is nowhere to be found
- hostname does not support the -f parameter (used for getting the fully qualified domain name)
- a warning is not printed during net-tools package installation informing the sysadmin about this change
This task depends upon

Closed by  Tom Gundersen (tomegun)
Saturday, 18 June 2011, 18:27 GMT
Reason for closing:  Fixed
Comment by Ivan Todoroski (Grnch) - Thursday, 09 June 2011, 16:02 GMT
Tom Gundersen has suggested that Fedora is also using this approach (using hostname from coreutils), but upon closer inspection this is not actually the case.

This is the link Tom provided:

http://pkgs.fedoraproject.org/gitweb/?p=coreutils.git;a=blob;f=coreutils.spec;h=729c14943cca283310655b717d9863c37e5931d0;hb=HEAD

I took a second look at the Fedora coreutils.spec and in fact they DO NOT use hostname from coreutils. So Arch will indeed be incompatible with all major distros if it decides to use hostname from coreutils.

If you look further down in the Fedora coreutils.spec you will find this:

----------------------------
# These come from util-linux and/or procps.
for i in hostname uptime kill ; do
rm $RPM_BUILD_ROOT{%_bindir/$i,%_mandir/man1/$i.1}
done
---------------------------

So as you can see they in fact remove /bin/hostname from the coreutils build before packaging it, and they explicitly state that they expect "hostname" to be supplied by some other package.

Digging further, you will see that their "hostname" does not come from net-tools either:

http://pkgs.fedoraproject.org/gitweb/?p=net-tools.git;a=blob;f=net-tools.spec;h=3c0520e88fd325e993663cd0eb7be906019bd334;hb=HEAD

-------------------
#remove hostname (has its own package)
rm %{buildroot}/bin/dnsdomainname
rm %{buildroot}/bin/domainname
rm %{buildroot}/bin/hostname
rm %{buildroot}/bin/nisdomainname
rm %{buildroot}/bin/ypdomainname
------------------

As you can see, they expect all these hostname related tools to come from a third package called "hostname". Now if you look inside that package:

http://pkgs.fedoraproject.org/gitweb/?p=hostname.git;a=blob;f=hostname.spec;h=c80d2b05ee17d8dca948a447d1aaaec9f0ca59dc;hb=HEAD

you will see that its source code ultimately comes from Debian:

http://packages.qa.debian.org/h/hostname.html

I downloaded this Debian package and confirmed that the "hostname" command indeed supports the -f option, so it is functionally equivalent to the one from net-tools. In fact it's very likely that Debian took the hostname-related tools from net-tools and assigned someone to properly maintain them.
Comment by Ivan Todoroski (Grnch) - Thursday, 09 June 2011, 16:04 GMT
Quoting Tom Gundersen from the other issue:

"If you have a suggestion for versions of these tools that are better than what we provide, and still maintained, feel free to suggest them."

I didn't explicitly say it in my previous comment, but this is what I am in fact proposing:

Instead of using hostname from coreutils, take the Debian package called "hostname" and package it for Arch Linux. Then make "initscripts" and "yp-tools" depend on this "hostname" package. That way they will be depending on an actively maintained package for their hostname-related needs, instead of "net-tools".

You could also make "net-tools" depend on this "hostname" package for a smoother transition during upgrades.

This way you get best of both worlds: hostname/dnsdomainname tools that are functionally compatible to the old ones from net-tools (hostname supports -f, dnsdomainname does an actual DNS lookup), but which are also well maintained by the Debian team. You avoid breakage by suddenly missing options, and you maintain compatibility with the major distros.

It satisfies both conditions set by Tom above: it provides better hostname/dnsdomainname tools than Arch currently provides, and they are still maintained.

Are there any objections to this solution?
Comment by Tom Gundersen (tomegun) - Thursday, 09 June 2011, 16:07 GMT
@Ivan: thanks for your research. We'll look into debian's hostname package, as well as other options.
Comment by This Account (and mail) is dead. (macaronyde) - Thursday, 16 June 2011, 13:51 GMT

Loading...