]> git.proxmox.com Git - mirror_zfs.git/blame - man/man8/zgenhostid.8
FreeBSD: Add zfs_link_create() error handling
[mirror_zfs.git] / man / man8 / zgenhostid.8
CommitLineData
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
1d3ba0bf 9.\" or https://opensource.org/licenses/CDDL-1.0.
b9373170
OF
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.\"
b9373170
OF
21.\" Copyright (c) 2017 by Lawrence Livermore National Security, LLC.
22.\"
b1821d06 23.Dd May 26, 2021
4b7ed6a2 24.Dt ZGENHOSTID 8
6706552e 25.Os
4b7ed6a2 26.
b9373170
OF
27.Sh NAME
28.Nm zgenhostid
4b7ed6a2 29.Nd generate host ID into /etc/hostid
b9373170
OF
30.Sh SYNOPSIS
31.Nm
9cc177ba
GY
32.Op Fl f
33.Op Fl o Ar filename
b9373170 34.Op Ar hostid
4b7ed6a2 35.
b9373170 36.Sh DESCRIPTION
9cc177ba
GY
37Creates
38.Pa /etc/hostid
4b7ed6a2
AZ
39file and stores the host ID in it.
40If
41.Ar hostid
42was provided, validate and store that value.
43Otherwise, randomly generate an ID.
44.
45.Sh OPTIONS
46.Bl -tag -width "-o filename"
9cc177ba
GY
47.It Fl h
48Display a summary of the command-line options.
49.It Fl f
4b7ed6a2 50Allow output overwrite.
9cc177ba
GY
51.It Fl o Ar filename
52Write to
53.Pa filename
4b7ed6a2
AZ
54instead of the default
55.Pa /etc/hostid .
9cc177ba 56.It Ar hostid
b9373170 57Specifies the value to be placed in
9cc177ba 58.Pa /etc/hostid .
9c4b6dbb 59It should be a number with a value between 1 and 2^32-1.
4b7ed6a2
AZ
60If
61.Sy 0 ,
62generate a random ID.
9cc177ba 63This value
4b7ed6a2 64.Em must
9cc177ba
GY
65be unique among your systems.
66It
4b7ed6a2
AZ
67.Em must
68be an 8-digit-long hexadecimal number, optionally prefixed by
69.Qq 0x .
9cc177ba 70.El
4b7ed6a2 71.
9cc177ba
GY
72.Sh FILES
73.Pa /etc/hostid
4b7ed6a2 74.
b9373170 75.Sh EXAMPLES
9cc177ba 76.Bl -tag -width Bd
b9373170 77.It Generate a random hostid and store it
4b7ed6a2 78.Dl # Nm
9cc177ba 79.It Record the libc-generated hostid in Pa /etc/hostid
4b7ed6a2
AZ
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
0175272f 83.It Record a custom hostid Po Ar 0x01234567 Pc in Pa /tmp/hostid No and overwrite the file if it exists
4b7ed6a2 84.Dl # Nm Fl f o Ar /tmp/hostid 0x01234567
b9373170 85.El
4b7ed6a2 86.
b9373170 87.Sh SEE ALSO
b9373170 88.Xr genhostid 1 ,
90cdf283 89.Xr hostid 1 ,
9cc177ba 90.Xr sethostid 3 ,
2badb345 91.Xr spl 4
4b7ed6a2 92.
9cc177ba
GY
93.Sh HISTORY
94.Nm
95emulates the
96.Xr genhostid 1
97utility and is provided for use on systems which
b1821d06 98do not include the utility or do not provide the
9cc177ba 99.Xr sethostid 3
4b7ed6a2 100function.