|
18 | 18 | .\"
|
19 | 19 | .\" CDDL HEADER END
|
20 | 20 | .\"
|
21 |
| -.\" |
22 | 21 | .\" Copyright (c) 2017 by Lawrence Livermore National Security, LLC.
|
23 | 22 | .\"
|
24 | 23 | .Dd May 26, 2021
|
25 |
| -.Dt ZGENHOSTID 8 SMM |
| 24 | +.Dt ZGENHOSTID 8 |
26 | 25 | .Os
|
| 26 | +. |
27 | 27 | .Sh NAME
|
28 | 28 | .Nm zgenhostid
|
29 |
| -.Nd generate and store a hostid in |
30 |
| -.Em /etc/hostid |
| 29 | +.Nd generate host ID into /etc/hostid |
31 | 30 | .Sh SYNOPSIS
|
32 | 31 | .Nm
|
33 | 32 | .Op Fl f
|
34 | 33 | .Op Fl o Ar filename
|
35 | 34 | .Op Ar hostid
|
| 35 | +. |
36 | 36 | .Sh DESCRIPTION
|
37 | 37 | Creates
|
38 | 38 | .Pa /etc/hostid
|
39 |
| -file and stores hostid in it. |
40 |
| -If the user provides |
41 |
| -.Op Ar hostid |
42 |
| -on the command line, validates and stores that value. |
43 |
| -Otherwise, randomly generates a value to store. |
44 |
| -.Bl -tag -width "hostid" |
| 39 | +file and stores the host ID in it. |
| 40 | +If |
| 41 | +.Ar hostid |
| 42 | +was provided, validate and store that value. |
| 43 | +Otherwise, randomly generate an ID. |
| 44 | +. |
| 45 | +.Sh OPTIONS |
| 46 | +.Bl -tag -width "-o filename" |
45 | 47 | .It Fl h
|
46 | 48 | Display a summary of the command-line options.
|
47 | 49 | .It Fl f
|
48 |
| -Force file overwrite. |
| 50 | +Allow output overwrite. |
49 | 51 | .It Fl o Ar filename
|
50 | 52 | Write to
|
51 | 53 | .Pa filename
|
52 |
| -instead of default |
53 |
| -.Pa /etc/hostid |
| 54 | +instead of the default |
| 55 | +.Pa /etc/hostid . |
54 | 56 | .It Ar hostid
|
55 | 57 | Specifies the value to be placed in
|
56 | 58 | .Pa /etc/hostid .
|
57 | 59 | 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. |
| 60 | +If |
| 61 | +.Sy 0 , |
| 62 | +generate a random ID. |
59 | 63 | This value
|
60 |
| -.Sy must |
| 64 | +.Em must |
61 | 65 | be unique among your systems.
|
62 | 66 | It
|
63 |
| -.Sy must |
64 |
| -be expressed in hexadecimal and be exactly |
65 |
| -.Em 8 |
66 |
| -digits long, optionally prefixed by |
67 |
| -.Em 0x . |
| 67 | +.Em must |
| 68 | +be an 8-digit-long hexadecimal number, optionally prefixed by |
| 69 | +.Qq 0x . |
68 | 70 | .El
|
| 71 | +. |
69 | 72 | .Sh FILES
|
70 | 73 | .Pa /etc/hostid
|
| 74 | +. |
71 | 75 | .Sh EXAMPLES
|
72 | 76 | .Bl -tag -width Bd
|
73 | 77 | .It Generate a random hostid and store it
|
74 |
| -.Dl # zgenhostid |
| 78 | +.Dl # Nm |
75 | 79 | .It Record the libc-generated hostid in Pa /etc/hostid
|
76 |
| -.Dl # zgenhostid "$(hostid)" |
77 |
| -.It Record a custom hostid (0xdeadbeef) in Pa /etc/hostid |
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 |
| 80 | +.Dl # Nm Qq $ Ns Pq Nm hostid |
| 81 | +.It Record a custom hostid Po Ar 0xdeadbeef Pc in Pa /etc/hostid |
| 82 | +.Dl # Nm Ar deadbeef |
| 83 | +.It Record a custom hostid Po Ar 0x01234567 Pc in Pa /tmp/hostid No and ovewrite the file if it exists |
| 84 | +.Dl # Nm Fl f o Ar /tmp/hostid 0x01234567 |
81 | 85 | .El
|
| 86 | +. |
82 | 87 | .Sh SEE ALSO
|
83 | 88 | .Xr genhostid 1 ,
|
84 | 89 | .Xr hostid 1 ,
|
85 | 90 | .Xr sethostid 3 ,
|
86 | 91 | .Xr spl 4
|
| 92 | +. |
87 | 93 | .Sh HISTORY
|
88 | 94 | .Nm
|
89 | 95 | emulates the
|
90 | 96 | .Xr genhostid 1
|
91 | 97 | utility and is provided for use on systems which
|
92 | 98 | do not include the utility or do not provide the
|
93 | 99 | .Xr sethostid 3
|
94 |
| -call. |
| 100 | +function. |
0 commit comments