1.\" 2.\" CDDL HEADER START 3.\" 4.\" The contents of this file are subject to the terms of the 5.\" Common Development and Distribution License (the "License"). 6.\" You may not use this file except in compliance with the License. 7.\" 8.\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 9.\" or http://www.opensolaris.org/os/licensing. 10.\" See the License for the specific language governing permissions 11.\" and limitations under the License. 12.\" 13.\" When distributing Covered Code, include this CDDL HEADER in each 14.\" file and include the License file at usr/src/OPENSOLARIS.LICENSE. 15.\" If applicable, add the following below this CDDL HEADER, with the 16.\" fields enclosed by brackets "[]" replaced with your own identifying 17.\" information: Portions Copyright [yyyy] [name of copyright owner] 18.\" 19.\" CDDL HEADER END 20.\" 21.\" 22.\" Copyright (c) 2017 by Lawrence Livermore National Security, LLC. 23.\" 24.Dd September 13, 2020 25.Dt ZGENHOSTID 8 SMM 26.Os 27.Sh NAME 28.Nm zgenhostid 29.Nd generate and store a hostid in 30.Em /etc/hostid 31.Sh SYNOPSIS 32.Nm 33.Op Fl f 34.Op Fl o Ar filename 35.Op Ar hostid 36.Sh DESCRIPTION 37Creates 38.Pa /etc/hostid 39file and stores hostid in it. 40If the user provides 41.Op Ar hostid 42on the command line, validates and stores that value. 43Otherwise, randomly generates a value to store. 44.Bl -tag -width "hostid" 45.It Fl h 46Display a summary of the command-line options. 47.It Fl f 48Force file overwrite. 49.It Fl o Ar filename 50Write to 51.Pa filename 52instead of default 53.Pa /etc/hostd 54.It Ar hostid 55Specifies the value to be placed in 56.Pa /etc/hostid . 57It must be a number with a value between 1 and 2^32-1. 58This value 59.Sy must 60be unique among your systems. 61It 62.Sy must 63be expressed in hexadecimal and be exactly 64.Em 8 65digits long, optionally prefixed by 66.Em 0x . 67.El 68.Sh FILES 69.Pa /etc/hostid 70.Sh EXAMPLES 71.Bl -tag -width Bd 72.It Generate a random hostid and store it 73.Bd -literal 74# zgenhostid 75.Ed 76.It Record the libc-generated hostid in Pa /etc/hostid 77.Bd -literal 78# zgenhostid "$(hostid)" 79.Ed 80.It Record a custom hostid (0xdeadbeef) in Pa /etc/hostid 81.Bd -literal 82# zgenhostid deadbeef 83.Ed 84.It Record a custom hostid (0x01234567) in Pa /tmp/hostid 85and ovewrite the file if it exists 86.Bd -literal 87# zgenhostid -f -o /tmp/hostid 0x01234567 88.Ed 89.El 90.Sh SEE ALSO 91.Xr genhostid 1 , 92.Xr hostid 1 , 93.Xr sethostid 3 , 94.Xr spl-module-parameters 5 95.Sh HISTORY 96.Nm 97emulates the 98.Xr genhostid 1 99utility and is provided for use on systems which 100do not include the utility or do not provide 101.Xr sethostid 3 102call. 103