[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: bug in hostname
Re: bug in hostname
Thu, 9 Oct 2003 01:32:34 -0600
Steven Augart wrote:
> Linux, at least, ships with a fine "hostname" in net-tools 1.60, and I'm
> not clear on why the world needs a second one, but I wasn't part of the
> bug-coreutils list at the time that decision was made. (I've just
> searched the archives and can't find any discussion of such an issue.)
My I be so bold as to speak on this subject even though I was not
there when GNU hostname was written? (I learned on the early HP-UX
systems which were based on a hodgepodge of various flavors of systems
and so I had to get to know them individually in self defense.)
In the beginning were the systems from AT&T. V7 from AT&T did not
have a hostname command. Networking features and the hostname command
were developed at Berkeley. BSD is the original reference for the
hostname command. If you look at the 3BSD reference for hostname you
hostname [ nameofhost ]
My how such a simple thing can cause such trouble! But look at that.
No options allowed at all. Just the name of the host which is
optional. No args means print the hostname. One single optional arg
means set the hostname.
Several commercial systems have been based on the BSD such as SunOS
and HP-UX and others. Those systems implement the same hostname
command from 3BSD. There are no options in that flavor of hostname.
I can't speak from the authority of personal knowledge of the GNU
hostname but it seems obvious that the GNU hostname command has the
feature set it does because BSD hostname has the feature set that it
has and hostname came from BSD. The GNU hostname is a clone of the
BSD hostname. Why is it still a clone? There has been no pressure to
improve GNU hostname. With the net-tools version available to anyone
there has been no pressure to evolve. Certainly I have not seen any
patches being supplied by folks on the 'net. Why should there be a
duplication of effort here? And why complain that GNU is providing a
free program? You are not obligated to use it. I don't use a lot of
free software! But lets get back to the topic of features.
Another point of contention arises around hostname. Should the host's
name be the fully qualified hostname? Or should the hostname be the
short hostname? BSD set the fully qualified hostname. That is what I
prefer as well and I always set the fully qualified hostname.
Everything is simpler that way and I like things to be simpler when
possible. But others disagree and like the short name. This has been
and continues to be a source of low level conflict. Because of this
well behaved software needs to have ways to deal with either. But
this makes things more complicated than it might otherwise be. That
brings us to the 4BSD release of hostname. (You see this really was
not the topic drift you thought it was.)
The 4BSD the hostname command has the following syntax.
hostname [-s] [name-of-host]
-s Trim off any domain information from the printed name.
New in 4BSD was the -s option to return the short name. This arose
because since the BSD hostname is the fully qualified name the -s
option gave a convenient way to avoid the domain part and return only
the short name without needing to resort to other scripting. There is
no option present to return the fully qualified name. The FQDN is the
name returned without any options since that is the hostname.
Therefore there is no need to have a special option to return the
FQDN. Simple. Correct. Completely consistent. And exactly the
opposite of the way that people who like the short name will implement
People who like the short name use hostname with the option to return
the fully qualified name without resorting to scripting. On their
systems there is no need to have an option to return the short name.
The short name is returned without any options. Also simple and
correct and completely consistent. And exactly the opposite of the
way that people who like the FQDN will implement systems.
Today FreeBSD, OpenBSD, and NetBSD all have the same hostname command
syntax from 4BSD. If you are a *BSD user today you don't have the
long list of options that the net-tools version supplies. Commercial
systems like HP-UX have the basic hostname command from 3BSD without
any options. GNU hostname is simply 3BSD compatible with the now
defacto standard --help and --version options recently added.
Obviously all of those systems have been very successful without
needing the long list of extensions supplied by the net-tools version.
So I really can't see how someone can call it a bug that they don't
exist. I can only see that someone would rather use the net-tools
version with all of the bells and whistles instead of basic
functionality of the BSD compatible versions. But since no standards
exist for hostname any scripts that use those options cannot be
considered portable and a dependency should be explicitly declared.
Re: bug in hostname,
Bob Proulx <=
Re: bug in hostname, Steven Augart, 2003/10/10