HomeFreeBSD

Stabilize the hostid for RPM installations.

Description

Stabilize the hostid for RPM installations.

ZFS requires a stable hostid to recognize foreign pool imports,
but the hostid of a Linux system can change if the /etc/hostid
file is missing, particularly during DHCP lease updates.

Ensure that the system hostid is stable by creating the
/etc/hostid file from the output of the /usr/bin/hostid utility.
The /sbin/genhostid utility that is provided by the initscripts
package is not used because it creates a random hostid, which
breaks upgrades on systems that already have the SPL module
installed.

The external printf is used because the dash builtin lacks
the byte format. Conveniences like a ${HOSTID:$ii:2} substring
range or a sed one-liner are similarly avoided.

Details

Provenance
Darik Horn <dajhorn@vanadac.com>Authored on Jun 24 2011, 3:10 AM
Brian Behlendorf <behlendorf1@llnl.gov>Committed on Jun 24 2011, 4:58 PM
Parents
rG0d54dcb56685: Read the /etc/hostid file directly.
Branches
Unknown
Tags
Unknown
Reverted By
rG39a87c69211a: Revert "Stabilize the hostid for RPM installations."