]>
Commit | Line | Data |
---|---|---|
adda90b0 | 1 | <?xml version='1.0'?> <!--*-nxml-*--> |
3a54a157 | 2 | <!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN" |
eea10b26 | 3 | "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd"> |
db9ecf05 | 4 | <!-- SPDX-License-Identifier: LGPL-2.1-or-later --> |
adda90b0 ZJS |
5 | |
6 | <refentry id="systemd-id128" xmlns:xi="http://www.w3.org/2001/XInclude"> | |
7 | ||
8 | <refentryinfo> | |
9 | <title>systemd-id128</title> | |
10 | <productname>systemd</productname> | |
11 | </refentryinfo> | |
12 | ||
13 | <refmeta> | |
14 | <refentrytitle>systemd-id128</refentrytitle> | |
15 | <manvolnum>1</manvolnum> | |
16 | </refmeta> | |
17 | ||
18 | <refnamediv> | |
19 | <refname>systemd-id128</refname> | |
20 | <refpurpose>Generate and print sd-128 identifiers</refpurpose> | |
21 | </refnamediv> | |
22 | ||
23 | <refsynopsisdiv> | |
24 | <cmdsynopsis> | |
25 | <command>systemd-id128</command> | |
26 | <arg choice="opt" rep="repeat">OPTIONS</arg> | |
27 | <arg choice="plain">new</arg> | |
28 | </cmdsynopsis> | |
29 | ||
30 | <cmdsynopsis> | |
31 | <command>systemd-id128</command> | |
32 | <arg choice="opt" rep="repeat">OPTIONS</arg> | |
33 | <arg choice="plain">machine-id</arg> | |
34 | </cmdsynopsis> | |
35 | ||
36 | <cmdsynopsis> | |
37 | <command>systemd-id128</command> | |
38 | <arg choice="opt" rep="repeat">OPTIONS</arg> | |
39 | <arg choice="plain">boot-id</arg> | |
40 | </cmdsynopsis> | |
41 | ||
42 | <cmdsynopsis> | |
43 | <command>systemd-id128</command> | |
44 | <arg choice="opt" rep="repeat">OPTIONS</arg> | |
45 | <arg choice="plain">invocation-id</arg> | |
46 | </cmdsynopsis> | |
f4e518e8 ZJS |
47 | |
48 | <cmdsynopsis> | |
49 | <command>systemd-id128</command> | |
50 | <arg choice="opt" rep="repeat">OPTIONS</arg> | |
51 | <arg choice="plain">show</arg> | |
52 | <arg choice="opt" rep="repeat">NAME|UUID</arg> | |
53 | </cmdsynopsis> | |
adda90b0 ZJS |
54 | </refsynopsisdiv> |
55 | ||
56 | <refsect1> | |
57 | <title>Description</title> | |
58 | ||
59 | <para><command>id128</command> may be used to conveniently print | |
60 | <citerefentry><refentrytitle>sd-id128</refentrytitle><manvolnum>3</manvolnum></citerefentry> | |
61 | UUIDs. What identifier is printed depends on the specific verb.</para> | |
62 | ||
63 | <para>With <command>new</command>, a new random identifier will be generated.</para> | |
64 | ||
65 | <para>With <command>machine-id</command>, the identifier of the current machine will be | |
66 | printed. See | |
67 | <citerefentry><refentrytitle>machine-id</refentrytitle><manvolnum>5</manvolnum></citerefentry>. | |
68 | </para> | |
69 | ||
70 | <para>With <command>boot-id</command>, the identifier of the current boot will be | |
71 | printed.</para> | |
72 | ||
adda90b0 ZJS |
73 | <para>With <command>invocation-id</command>, the identifier of the current service invocation |
74 | will be printed. This is available in systemd services. See | |
75 | <citerefentry><refentrytitle>systemd.exec</refentrytitle><manvolnum>5</manvolnum></citerefentry>. | |
76 | </para> | |
dc972b07 | 77 | |
215e19eb LP |
78 | <para>With <command>show</command>, well-known IDs are printed (for now, only GPT partition type UUIDs), |
79 | along with brief identifier strings. When no arguments are specified, all known IDs are shown. When | |
f4e518e8 ZJS |
80 | arguments are specified, they may be the identifiers or ID values of one or more known IDs, which are |
81 | then printed with their name, or arbitrary IDs, which are then printed with a placeholder name. Combine | |
82 | with <option>--uuid</option> to list the IDs in UUID style, i.e. the way GPT partition type UUIDs are | |
83 | usually shown.</para> | |
b37e8184 ZJS |
84 | |
85 | <para><command>machine-id</command>, <command>boot-id</command>, and <command>show</command> may be | |
86 | combined with the <option>--app-specific=<replaceable>app-id</replaceable></option> switch to generate | |
87 | application-specific IDs. See | |
88 | <citerefentry><refentrytitle>sd_id128_get_machine</refentrytitle><manvolnum>3</manvolnum></citerefentry> | |
437e217a ZJS |
89 | for the discussion when this is useful. Support for <command>show --app-specific=</command> was added in |
90 | version 255.</para> | |
adda90b0 ZJS |
91 | </refsect1> |
92 | ||
93 | <refsect1> | |
94 | <title>Options</title> | |
95 | ||
96 | <para>The following options are understood:</para> | |
97 | ||
98 | <variablelist> | |
99 | <varlistentry> | |
100 | <term><option>-p</option></term> | |
101 | <term><option>--pretty</option></term> | |
102 | ||
ec07c3c8 AK |
103 | <listitem><para>Generate output as programming language snippets.</para> |
104 | ||
105 | <xi:include href="version-info.xml" xpointer="v240"/></listitem> | |
adda90b0 ZJS |
106 | </varlistentry> |
107 | ||
782902f2 ZJS |
108 | <varlistentry> |
109 | <term><option>-P</option></term> | |
110 | <term><option>--value</option></term> | |
111 | ||
112 | <listitem><para>Only print the value. May be combined with | |
437e217a ZJS |
113 | <option>-u</option>/<option>--uuid</option>.</para> |
114 | ||
115 | <xi:include href="version-info.xml" xpointer="v255"/></listitem> | |
782902f2 ZJS |
116 | </varlistentry> |
117 | ||
adda90b0 ZJS |
118 | <varlistentry> |
119 | <term><option>-a <replaceable>app-id</replaceable></option></term> | |
120 | <term><option>--app-specific=<replaceable>app-id</replaceable></option></term> | |
121 | ||
b37e8184 ZJS |
122 | <listitem><para>With this option, identifiers will be printed that are the result of hashing the |
123 | application identifier <replaceable>app-id</replaceable> and another ID. The | |
124 | <replaceable>app-id</replaceable> argument must be a valid sd-id128 string identifying the | |
125 | application. When used with <command>machine-id</command>, the other ID will be the machine ID as | |
126 | described in | |
127 | <citerefentry><refentrytitle>machine-id</refentrytitle><manvolnum>5</manvolnum></citerefentry>, when | |
128 | used with <command>boot-id</command>, the other ID will be the boot ID, and when used with | |
129 | <command>show</command>, the other ID or IDs should be specified via the positional arguments.</para> | |
ec07c3c8 AK |
130 | |
131 | <xi:include href="version-info.xml" xpointer="v240"/> | |
adda90b0 ZJS |
132 | </listitem> |
133 | </varlistentry> | |
134 | ||
a1db5bbc ZJS |
135 | <varlistentry> |
136 | <term><option>-u</option></term> | |
137 | <term><option>--uuid</option></term> | |
138 | ||
5bc9ea07 | 139 | <listitem><para>Generate output as a UUID formatted in the "canonical representation", with five |
c8cd6d7b ZJS |
140 | groups of digits separated by hyphens. See the Wikipedia entry for |
141 | <ulink url="https://en.wikipedia.org/wiki/Universally_unique_identifier#Format">Universally Unique Identifiers</ulink> | |
ec07c3c8 AK |
142 | for more discussion.</para> |
143 | ||
144 | <xi:include href="version-info.xml" xpointer="v244"/></listitem> | |
a1db5bbc ZJS |
145 | </varlistentry> |
146 | ||
a50666e3 LP |
147 | <xi:include href="standard-options.xml" xpointer="no-pager" /> |
148 | <xi:include href="standard-options.xml" xpointer="no-legend" /> | |
149 | <xi:include href="standard-options.xml" xpointer="json" /> | |
150 | <xi:include href="standard-options.xml" xpointer="j" /> | |
adda90b0 ZJS |
151 | <xi:include href="standard-options.xml" xpointer="help" /> |
152 | <xi:include href="standard-options.xml" xpointer="version" /> | |
153 | </variablelist> | |
154 | </refsect1> | |
155 | ||
156 | <refsect1> | |
157 | <title>Exit status</title> | |
158 | ||
f4e518e8 ZJS |
159 | <para>On success 0 is returned, and a non-zero failure code otherwise.</para> |
160 | </refsect1> | |
161 | ||
162 | <refsect1> | |
163 | <title>Examples</title> | |
164 | ||
165 | <example> | |
166 | <title>Show a well-known UUID</title> | |
167 | <programlisting> | |
b477c694 | 168 | $ systemd-id128 show --value user-home |
f4e518e8 ZJS |
169 | 773f91ef66d449b5bd83d683bf40ad16 |
170 | ||
b477c694 | 171 | $ systemd-id128 show --value --uuid user-home |
f4e518e8 ZJS |
172 | 773f91ef-66d4-49b5-bd83-d683bf40ad16 |
173 | ||
174 | $ systemd-id128 show 773f91ef-66d4-49b5-bd83-d683bf40ad16 | |
175 | NAME ID | |
176 | user-home 773f91ef66d449b5bd83d683bf40ad16 | |
177 | </programlisting> | |
178 | </example> | |
b37e8184 ZJS |
179 | |
180 | <example> | |
181 | <title>Generate an application-specific UUID</title> | |
182 | ||
183 | <programlisting> | |
184 | $ systemd-id128 machine-id -u | |
185 | 3a9d668b-4db7-4939-8a4a-5e78a03bffb7 | |
186 | ||
187 | $ systemd-id128 new -u | |
188 | 1fb8f24b-02df-458d-9659-cc8ace68e28a | |
189 | ||
b477c694 | 190 | $ systemd-id128 machine-id -u -a 1fb8f24b-02df-458d-9659-cc8ace68e28a |
b37e8184 ZJS |
191 | 47b82cb1-5339-43da-b2a6-1c350aef1bd1 |
192 | ||
b477c694 ZJS |
193 | $ systemd-id128 -Pu show 3a9d668b-4db7-4939-8a4a-5e78a03bffb7 \ |
194 | -a 1fb8f24b-02df-458d-9659-cc8ace68e28a | |
b37e8184 ZJS |
195 | 47b82cb1-5339-43da-b2a6-1c350aef1bd1 |
196 | </programlisting> | |
197 | ||
198 | <para>On a given machine with the ID 3a9d668b-4db7-4939-8a4a-5e78a03bffb7, for the application | |
b477c694 ZJS |
199 | 1fb8f24b-02df-458d-9659-cc8ace68e28a, we generate an application-specific machine ID |
200 | (47b82cb1-5339-43da-b2a6-1c350aef1bd1). If we want to later recreate the same calculation on a | |
201 | different machine, we need to specify both IDs explicitly as parameters to <command>show</command>. | |
b37e8184 ZJS |
202 | </para> |
203 | </example> | |
adda90b0 ZJS |
204 | </refsect1> |
205 | ||
206 | <refsect1> | |
207 | <title>See Also</title> | |
13a69c12 DT |
208 | <para><simplelist type="inline"> |
209 | <member><citerefentry><refentrytitle>systemd</refentrytitle><manvolnum>1</manvolnum></citerefentry></member> | |
210 | <member><citerefentry><refentrytitle>sd-id128</refentrytitle><manvolnum>3</manvolnum></citerefentry></member> | |
211 | <member><citerefentry><refentrytitle>sd_id128_get_machine</refentrytitle><manvolnum>3</manvolnum></citerefentry></member> | |
212 | </simplelist></para> | |
adda90b0 ZJS |
213 | </refsect1> |
214 | ||
215 | </refentry> |