Skip to content

Commit 4e0fff2

Browse files
nabijaczlewelibehlendorf
authored andcommitted
zgenhostid.8: revisit
Reviewed-by: Richard Laager <[email protected]> Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Ahelenia Ziemiańska <[email protected]> Closes openzfs#12212
1 parent 14973b9 commit 4e0fff2

File tree

1 file changed

+33
-27
lines changed

1 file changed

+33
-27
lines changed

man/man8/zgenhostid.8

Lines changed: 33 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -18,77 +18,83 @@
1818
.\"
1919
.\" CDDL HEADER END
2020
.\"
21-
.\"
2221
.\" Copyright (c) 2017 by Lawrence Livermore National Security, LLC.
2322
.\"
2423
.Dd May 26, 2021
25-
.Dt ZGENHOSTID 8 SMM
24+
.Dt ZGENHOSTID 8
2625
.Os
26+
.
2727
.Sh NAME
2828
.Nm zgenhostid
29-
.Nd generate and store a hostid in
30-
.Em /etc/hostid
29+
.Nd generate host ID into /etc/hostid
3130
.Sh SYNOPSIS
3231
.Nm
3332
.Op Fl f
3433
.Op Fl o Ar filename
3534
.Op Ar hostid
35+
.
3636
.Sh DESCRIPTION
3737
Creates
3838
.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"
4547
.It Fl h
4648
Display a summary of the command-line options.
4749
.It Fl f
48-
Force file overwrite.
50+
Allow output overwrite.
4951
.It Fl o Ar filename
5052
Write to
5153
.Pa filename
52-
instead of default
53-
.Pa /etc/hostid
54+
instead of the default
55+
.Pa /etc/hostid .
5456
.It Ar hostid
5557
Specifies the value to be placed in
5658
.Pa /etc/hostid .
5759
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.
5963
This value
60-
.Sy must
64+
.Em must
6165
be unique among your systems.
6266
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 .
6870
.El
71+
.
6972
.Sh FILES
7073
.Pa /etc/hostid
74+
.
7175
.Sh EXAMPLES
7276
.Bl -tag -width Bd
7377
.It Generate a random hostid and store it
74-
.Dl # zgenhostid
78+
.Dl # Nm
7579
.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
8185
.El
86+
.
8287
.Sh SEE ALSO
8388
.Xr genhostid 1 ,
8489
.Xr hostid 1 ,
8590
.Xr sethostid 3 ,
8691
.Xr spl 4
92+
.
8793
.Sh HISTORY
8894
.Nm
8995
emulates the
9096
.Xr genhostid 1
9197
utility and is provided for use on systems which
9298
do not include the utility or do not provide the
9399
.Xr sethostid 3
94-
call.
100+
function.

0 commit comments

Comments
 (0)