]>
Commit | Line | Data |
---|---|---|
b9373170 OF |
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 | .\" | |
b1821d06 | 24 | .Dd May 26, 2021 |
b9373170 | 25 | .Dt ZGENHOSTID 8 SMM |
6706552e | 26 | .Os |
b9373170 OF |
27 | .Sh NAME |
28 | .Nm zgenhostid | |
29 | .Nd generate and store a hostid in | |
30 | .Em /etc/hostid | |
31 | .Sh SYNOPSIS | |
32 | .Nm | |
9cc177ba GY |
33 | .Op Fl f |
34 | .Op Fl o Ar filename | |
b9373170 OF |
35 | .Op Ar hostid |
36 | .Sh DESCRIPTION | |
9cc177ba GY |
37 | Creates |
38 | .Pa /etc/hostid | |
39 | file and stores hostid in it. | |
40 | If the user provides | |
b9373170 | 41 | .Op Ar hostid |
9cc177ba GY |
42 | on the command line, validates and stores that value. |
43 | Otherwise, randomly generates a value to store. | |
44 | .Bl -tag -width "hostid" | |
45 | .It Fl h | |
46 | Display a summary of the command-line options. | |
47 | .It Fl f | |
48 | Force file overwrite. | |
49 | .It Fl o Ar filename | |
50 | Write to | |
51 | .Pa filename | |
52 | instead of default | |
0ab84bff | 53 | .Pa /etc/hostid |
9cc177ba | 54 | .It Ar hostid |
b9373170 | 55 | Specifies the value to be placed in |
9cc177ba | 56 | .Pa /etc/hostid . |
9c4b6dbb ÉR |
57 | It should be a number with a value between 1 and 2^32-1. |
58 | If it is 0, zgenhostid will generate a random hostid. | |
9cc177ba | 59 | This value |
b9373170 | 60 | .Sy must |
9cc177ba GY |
61 | be unique among your systems. |
62 | It | |
63 | .Sy must | |
64 | be expressed in hexadecimal and be exactly | |
65 | .Em 8 | |
66 | digits long, optionally prefixed by | |
67 | .Em 0x . | |
68 | .El | |
69 | .Sh FILES | |
70 | .Pa /etc/hostid | |
b9373170 | 71 | .Sh EXAMPLES |
9cc177ba | 72 | .Bl -tag -width Bd |
b9373170 | 73 | .It Generate a random hostid and store it |
b1821d06 | 74 | .Dl # zgenhostid |
9cc177ba | 75 | .It Record the libc-generated hostid in Pa /etc/hostid |
b1821d06 | 76 | .Dl # zgenhostid "$(hostid)" |
9cc177ba | 77 | .It Record a custom hostid (0xdeadbeef) in Pa /etc/hostid |
b1821d06 AZ |
78 | .Dl # zgenhostid deadbeef |
79 | .It Record a custom hostid (0x01234567) in Pa /tmp/hostid No and ovewrite the file if it exists | |
80 | .Dl # zgenhostid -f -o /tmp/hostid 0x01234567 | |
b9373170 OF |
81 | .El |
82 | .Sh SEE ALSO | |
b9373170 | 83 | .Xr genhostid 1 , |
90cdf283 | 84 | .Xr hostid 1 , |
9cc177ba | 85 | .Xr sethostid 3 , |
2badb345 | 86 | .Xr spl 4 |
9cc177ba GY |
87 | .Sh HISTORY |
88 | .Nm | |
89 | emulates the | |
90 | .Xr genhostid 1 | |
91 | utility and is provided for use on systems which | |
b1821d06 | 92 | do not include the utility or do not provide the |
9cc177ba GY |
93 | .Xr sethostid 3 |
94 | call. |