[Pkg-zfsonlinux-devel] Bug#595790: hostid: useless unless fixed

Petter Reinholdtsen pere at hungry.com
Thu Sep 29 20:37:27 UTC 2016


[Richard Laager]
> For example, if you want to use the low 32-bits of /etc/machine-id,
> that would work too. It'd mean carrying a patch on Debian, but if the
> pain of a patch and different behavior is less than the benefits of
> the change, go for it.

I guess we would have to verify that /etc/machine-id is available in the
initrd for this to work with / in zfs.  But I guess that is a problem
with /etc/hostid too for gethostid(). :)

While researching this topic I came across
<URL: http://stackoverflow.com/questions/9258228/how-to-prevent-gethostid-from-doing-dns-lookups-on-linux >
which report that gethostid() might lock up a program if the DNS server
become unavailable.  A scary scenario just to get the machine ID.

I also came across <URL: http://0pointer.de/blog/projects/ids.html >,
which provide a very useful list of possible IDs to use in addition to
the gethostid() value.  It agrees that gethostid() have unclear
sematics. :)

-- 
Happy hacking
Petter Reinholdtsen



More information about the Pkg-zfsonlinux-devel mailing list