| 1 |
'\" t |
| 2 |
.TH "SYSTEMD\-MACHINE\-ID\-SETUP" "1" "" "systemd 261~rc3" "systemd-machine-id-setup" |
| 3 |
.\" ----------------------------------------------------------------- |
| 4 |
.\" * Define some portability stuff |
| 5 |
.\" ----------------------------------------------------------------- |
| 6 |
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
| 7 |
.\" http://bugs.debian.org/507673 |
| 8 |
.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html |
| 9 |
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
| 10 |
.ie \n(.g .ds Aq \(aq |
| 11 |
.el .ds Aq ' |
| 12 |
.\" ----------------------------------------------------------------- |
| 13 |
.\" * set default formatting |
| 14 |
.\" ----------------------------------------------------------------- |
| 15 |
.\" disable hyphenation |
| 16 |
.nh |
| 17 |
.\" disable justification (adjust text to left margin only) |
| 18 |
.ad l |
| 19 |
.\" ----------------------------------------------------------------- |
| 20 |
.\" * MAIN CONTENT STARTS HERE * |
| 21 |
.\" ----------------------------------------------------------------- |
| 22 |
.SH "NAME" |
| 23 |
systemd-machine-id-setup \- Initialize the machine ID in /etc/machine\-id |
| 24 |
.SH "SYNOPSIS" |
| 25 |
.HP \w'\fBsystemd\-machine\-id\-setup\fR\ 'u |
| 26 |
\fBsystemd\-machine\-id\-setup\fR |
| 27 |
.SH "DESCRIPTION" |
| 28 |
.PP |
| 29 |
\fBsystemd\-machine\-id\-setup\fR |
| 30 |
may be used by system installer tools to initialize the machine ID stored in |
| 31 |
/etc/machine\-id |
| 32 |
at install time, with a provisioned or randomly generated ID\&. See |
| 33 |
\fBmachine-id\fR(5) |
| 34 |
for more information about this file\&. |
| 35 |
.PP |
| 36 |
If the tool is invoked without the |
| 37 |
\fB\-\-commit\fR |
| 38 |
switch, |
| 39 |
/etc/machine\-id |
| 40 |
is initialized with a valid, new machine ID if it is missing or empty\&. The new machine ID will be acquired in the following fashion: |
| 41 |
.sp |
| 42 |
.RS 4 |
| 43 |
.ie n \{\ |
| 44 |
\h'-04' 1.\h'+01'\c |
| 45 |
.\} |
| 46 |
.el \{\ |
| 47 |
.sp -1 |
| 48 |
.IP " 1." 4.2 |
| 49 |
.\} |
| 50 |
If a valid machine ID is stored in |
| 51 |
/run/machine\-id, the machine ID is copied and used to initialize the machine ID in |
| 52 |
/etc/machine\-id\&. This step is skipped if |
| 53 |
\fB\-\-root=\fR |
| 54 |
is specified or running in a chroot environment\&. |
| 55 |
.RE |
| 56 |
.sp |
| 57 |
.RS 4 |
| 58 |
.ie n \{\ |
| 59 |
\h'-04' 2.\h'+01'\c |
| 60 |
.\} |
| 61 |
.el \{\ |
| 62 |
.sp -1 |
| 63 |
.IP " 2." 4.2 |
| 64 |
.\} |
| 65 |
If a valid D\-Bus machine ID is already configured for the system, the D\-Bus machine ID is copied and used to initialize the machine ID in |
| 66 |
/etc/machine\-id\&. |
| 67 |
.RE |
| 68 |
.sp |
| 69 |
.RS 4 |
| 70 |
.ie n \{\ |
| 71 |
\h'-04' 3.\h'+01'\c |
| 72 |
.\} |
| 73 |
.el \{\ |
| 74 |
.sp -1 |
| 75 |
.IP " 3." 4.2 |
| 76 |
.\} |
| 77 |
If a valid machine ID is provided through |
| 78 |
\fBsystem\&.machine_id\fR |
| 79 |
credential, the machine ID is copied and used to initialize the machine ID in |
| 80 |
/etc/machine\-id\&. This step is skipped if |
| 81 |
\fB\-\-root=\fR |
| 82 |
is specified or running in a chroot environment\&. |
| 83 |
.RE |
| 84 |
.sp |
| 85 |
.RS 4 |
| 86 |
.ie n \{\ |
| 87 |
\h'-04' 4.\h'+01'\c |
| 88 |
.\} |
| 89 |
.el \{\ |
| 90 |
.sp -1 |
| 91 |
.IP " 4." 4.2 |
| 92 |
.\} |
| 93 |
If run inside a KVM virtual machine and a UUID is configured (via the |
| 94 |
\fB\-uuid\fR |
| 95 |
option), this UUID is used to initialize the machine ID\&. The caller must ensure that the UUID passed is sufficiently unique and is different for every booted instance of the VM\&. This step is skipped if |
| 96 |
\fB\-\-root=\fR |
| 97 |
is specified or running in a chroot environment\&. |
| 98 |
.RE |
| 99 |
.sp |
| 100 |
.RS 4 |
| 101 |
.ie n \{\ |
| 102 |
\h'-04' 5.\h'+01'\c |
| 103 |
.\} |
| 104 |
.el \{\ |
| 105 |
.sp -1 |
| 106 |
.IP " 5." 4.2 |
| 107 |
.\} |
| 108 |
Similarly, if run inside a Linux container environment and a UUID is configured for the container, this is used to initialize the machine ID\&. For details, see the documentation of the |
| 109 |
\m[blue]\fBContainer Interface\fR\m[]\&\s-2\u[1]\d\s+2\&. This step is skipped if |
| 110 |
\fB\-\-root=\fR |
| 111 |
is specified or running in a chroot environment\&. |
| 112 |
.RE |
| 113 |
.sp |
| 114 |
.RS 4 |
| 115 |
.ie n \{\ |
| 116 |
\h'-04' 6.\h'+01'\c |
| 117 |
.\} |
| 118 |
.el \{\ |
| 119 |
.sp -1 |
| 120 |
.IP " 6." 4.2 |
| 121 |
.\} |
| 122 |
Otherwise, a new ID is randomly generated\&. |
| 123 |
.RE |
| 124 |
.PP |
| 125 |
The |
| 126 |
\fB\-\-commit\fR |
| 127 |
switch may be used to commit a transient machined ID to disk, making it persistent\&. For details, see below\&. |
| 128 |
.PP |
| 129 |
Use |
| 130 |
\fBsystemd-firstboot\fR(1) |
| 131 |
to initialize the machine ID on mounted (but not booted) system images\&. |
| 132 |
.SH "OPTIONS" |
| 133 |
.PP |
| 134 |
The following options are understood: |
| 135 |
.PP |
| 136 |
\fB\-\-root=\fR\fB\fIpath\fR\fR |
| 137 |
.RS 4 |
| 138 |
Takes a directory path as argument\&. All paths operated on will be prefixed with the given alternate |
| 139 |
\fIroot\fR |
| 140 |
path, including the path for |
| 141 |
/etc/machine\-id |
| 142 |
itself\&. |
| 143 |
.sp |
| 144 |
Added in version 212\&. |
| 145 |
.RE |
| 146 |
.PP |
| 147 |
\fB\-\-image=\fR\fB\fIpath\fR\fR |
| 148 |
.RS 4 |
| 149 |
Takes a path to a device node or regular file as argument\&. This is similar to |
| 150 |
\fB\-\-root=\fR |
| 151 |
as described above, but operates on a disk image instead of a directory tree\&. |
| 152 |
.sp |
| 153 |
Added in version 249\&. |
| 154 |
.RE |
| 155 |
.PP |
| 156 |
\fB\-\-image\-policy=\fR\fB\fIpolicy\fR\fR |
| 157 |
.RS 4 |
| 158 |
Takes an image policy string as argument, as per |
| 159 |
\fBsystemd.image-policy\fR(7)\&. The policy is enforced when operating on the disk image specified via |
| 160 |
\fB\-\-image=\fR, see above\&. If not specified, defaults to the |
| 161 |
"*" |
| 162 |
policy, i\&.e\&. all recognized file systems in the image are used\&. |
| 163 |
.RE |
| 164 |
.PP |
| 165 |
\fB\-\-commit\fR |
| 166 |
.RS 4 |
| 167 |
Commit a transient machine ID to disk\&. This command may be used to convert a transient machine ID into a persistent one\&. A transient machine ID file is one that was bind mounted from a memory file system (usually |
| 168 |
"tmpfs") to |
| 169 |
/etc/machine\-id |
| 170 |
during the early phase of the boot process\&. This may happen because |
| 171 |
/etc/ |
| 172 |
is initially read\-only and was missing a valid machine ID file at that point\&. |
| 173 |
.sp |
| 174 |
This command will execute no operation if |
| 175 |
/etc/machine\-id |
| 176 |
is not mounted from a memory file system, or if |
| 177 |
/etc/ |
| 178 |
is read\-only\&. The command will write the current transient machine ID to disk and unmount the |
| 179 |
/etc/machine\-id |
| 180 |
mount point in a race\-free manner to ensure that this file is always valid and accessible for other processes\&. |
| 181 |
.sp |
| 182 |
This command is primarily used by the |
| 183 |
\fBsystemd-machine-id-commit.service\fR(8) |
| 184 |
early boot service\&. |
| 185 |
.sp |
| 186 |
Added in version 227\&. |
| 187 |
.RE |
| 188 |
.PP |
| 189 |
\fB\-\-print\fR |
| 190 |
.RS 4 |
| 191 |
Print the machine ID generated or committed after the operation is complete\&. |
| 192 |
.sp |
| 193 |
Added in version 231\&. |
| 194 |
.RE |
| 195 |
.PP |
| 196 |
\fB\-h\fR, \fB\-\-help\fR |
| 197 |
.RS 4 |
| 198 |
Print a short help text and exit\&. |
| 199 |
.RE |
| 200 |
.PP |
| 201 |
\fB\-\-version\fR |
| 202 |
.RS 4 |
| 203 |
Print a short version string and exit\&. |
| 204 |
.RE |
| 205 |
.SH "EXIT STATUS" |
| 206 |
.PP |
| 207 |
On success, 0 is returned, a non\-zero failure code otherwise\&. |
| 208 |
.SH "SEE ALSO" |
| 209 |
.PP |
| 210 |
\fBsystemd\fR(1), \fBmachine-id\fR(5), \fBsystemd-machine-id-commit.service\fR(8), \fBdbus-uuidgen\fR(1), \fBsystemd-firstboot\fR(1) |
| 211 |
.SH "NOTES" |
| 212 |
.IP " 1." 4 |
| 213 |
Container Interface |
| 214 |
.RS 4 |
| 215 |
\%https://systemd.io/CONTAINER_INTERFACE |
| 216 |
.RE |