bug-sh-utils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: same Host ID


From: Bob Proulx
Subject: Re: same Host ID
Date: Sat, 24 Mar 2001 11:16:32 -0700

> I have two linux machines with redhat 7.0 and its korean derivative.
> Two have the same hostid.
> What's the problem.
> There is no problem in readhat 6.2.
>  
> Thanks for your effort.
>  
> ---
> Sung-IL Kang
> KAIST in Korea

The hostid command is only a wrapper around the gethostid() kernel
system call.  The man page for hostid was autogenerated from the
online help message and in this case particularly terse.  And I could
not find an info page for hostid.  Since this is only a wrapper around
gethostid() that man page is more informative.

  man gethostid

: DESCRIPTION
:        Get or set a unique  32-bit  identifier  for  the  current
:        machine.   The  32-bit identifier is intended to be unique
:        among all UNIX systems in existence. This normally  resem
:        bles  the  Internet  address  for  the  local  machine, as
:        returned by gethostbyname(3), and thus usually never needs
:        to be set.
: 
: CONFORMING TO
:        4.2BSD.  These functions were dropped in 4.4BSD.   POSIX.1
:        does  not  define these functions, but ISO/IEC 9945-1:1990
:        mentions them in B.4.4.1.  SVr4 includes gethostid but not
:        sethostid.

This leads me to believe that your machines with identical hostid
output also have identical IP addresses.  I am guessing that changing
one or more IP addresses would then give a unique hostid.  But it is
not guarenteed that the kernel will place the IP address information
as the hostid information.  Different systems put different
information there.

The hostid information itself is not covered by practical standards.
It has been dropped from BSD.  HP-UX does not include it although IBM
AIX does.  It cannot be counted on to be available everywhere.  X/Open
mentions it but does not define the domain in which the return value
is unique which makes it pretty useless there too.  My advice is to
never use that information.  Avoid it.

The hostid command is so nonportable and impractical to use that it
should be dropped from the sh-utils distribution.  It can only cause
trouble.

Note that your original message was posted both in base64 encoded
plain text and in base64 encoded html.  Many people on the net do not
appreciate the duplication in a single message and request only the
plain/text version be sent.  If possible send your messages to mailing
lists using only non-encoded, plain text messages.

Bob



reply via email to

[Prev in Thread] Current Thread [Next in Thread]