On 2014-07-30 11:16, gollmer wrote:
>
> I got the same problem in openSuSe 12.3: gethostid just results in
> 00000000 as does the hostid commad, while ‘/sbin/ifconfig -a’ shows
> devices eth0, eth1 and wlan0 with their real hardware addresses.
> So what is gethostid querying?
I don’t see any command “gethostid” :-?
“hostid” does exist, but the scarce documentation does not say how it is
calculated:
info coreutils ‘hostid invocation’:
On that system, the 32-bit quantity happens to be
closely related to the system’s Internet address,
but that isn’t always the case.
There are 3 man pages for “gethostid”: it is not a command, but a
function declared in <unistd.h>
There you read what it is:
DESCRIPTION
gethostid() and sethostid() respectively 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.
NOTES
In the glibc implementation, the hostid is stored in
the file /etc/hostid. (In glibc versions before
2.2, the file /var/adm/hostid was used.)
In the glibc implementation, if gethostid() cannot
open the file containing the host ID, then it
obtains the hostname using gethostname(2), passes
that hostname to gethostbyname_r(3) in order to
obtain the host’s IPv4 address, and returns a value
obtained by bit-twiddling the IPv4 address. (This
value may not be unique.)
BUGS
It is impossible to ensure that the identifier is
globally unique.
> The problem is with any software using a node-locked license that needs
> a result from gethostid different from all zeros. Everything worked fine
> under my previous openSuSE installation.
See above… It is an invented number, and you can change it.
–
Cheers / Saludos,
Carlos E. R.
(from 13.1 x86_64 “Bottle” (Minas Tirith))