1<?xml version='1.0'?> <!--*-nxml-*-->
2<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
3  "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd">
4<!-- SPDX-License-Identifier: LGPL-2.1-or-later -->
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>
47  </refsynopsisdiv>
48
49  <refsect1>
50    <title>Description</title>
51
52    <para><command>id128</command> may be used to conveniently print
53    <citerefentry><refentrytitle>sd-id128</refentrytitle><manvolnum>3</manvolnum></citerefentry>
54    UUIDs. What identifier is printed depends on the specific verb.</para>
55
56    <para>With <command>new</command>, a new random identifier will be generated.</para>
57
58    <para>With <command>machine-id</command>, the identifier of the current machine will be
59    printed. See
60    <citerefentry><refentrytitle>machine-id</refentrytitle><manvolnum>5</manvolnum></citerefentry>.
61    </para>
62
63    <para>With <command>boot-id</command>, the identifier of the current boot will be
64    printed.</para>
65
66    <para>Both <command>machine-id</command> and <command>boot-id</command> may be combined
67    with the <option>--app-specific=<replaceable>app-id</replaceable></option> switch to
68    generate application-specific IDs. See
69    <citerefentry><refentrytitle>sd_id128_get_machine</refentrytitle><manvolnum>3</manvolnum></citerefentry>
70    for the discussion when this is useful.</para>
71
72    <para>With <command>invocation-id</command>, the identifier of the current service invocation
73    will be printed. This is available in systemd services. See
74    <citerefentry><refentrytitle>systemd.exec</refentrytitle><manvolnum>5</manvolnum></citerefentry>.
75    </para>
76
77    <para>With <command>show</command>, well-known IDs are printed (for now, only GPT partition type UUIDs),
78    along with brief identifier strings. When no arguments are specified, all known IDs are shown. When
79    arguments are specified, they must be the identifiers or ID values of one or more known IDs, which are
80    then printed. Combine with <option>--uuid</option> to list the IDs in UUID style, i.e. the way GPT
81    partition type UUIDs are usually shown.</para>
82  </refsect1>
83
84  <refsect1>
85    <title>Options</title>
86
87    <para>The following options are understood:</para>
88
89    <variablelist>
90      <varlistentry>
91        <term><option>-p</option></term>
92        <term><option>--pretty</option></term>
93
94        <listitem><para>Generate output as programming language snippets.</para></listitem>
95      </varlistentry>
96
97      <varlistentry>
98        <term><option>-a <replaceable>app-id</replaceable></option></term>
99        <term><option>--app-specific=<replaceable>app-id</replaceable></option></term>
100
101        <listitem><para>With this option, an identifier that is the result of hashing the
102        application identifier <replaceable>app-id</replaceable> and the machine identifier will be
103        printed. The <replaceable>app-id</replaceable> argument must be a valid sd-id128 string
104        identifying the application.</para>
105        </listitem>
106      </varlistentry>
107
108      <varlistentry>
109        <term><option>-u</option></term>
110        <term><option>--uuid</option></term>
111
112        <listitem><para>Generate output as an UUID formatted in the "canonical representation", with five
113        groups of digits separated by hyphens. See the
114        <ulink url="https://en.wikipedia.org/wiki/Universally_unique_identifier#Format">wikipedia</ulink>
115        for more discussion.</para></listitem>
116      </varlistentry>
117
118      <xi:include href="standard-options.xml" xpointer="help" />
119      <xi:include href="standard-options.xml" xpointer="version" />
120    </variablelist>
121  </refsect1>
122
123  <refsect1>
124    <title>Exit status</title>
125
126    <para>On success, 0 is returned, a non-zero failure code otherwise.</para>
127  </refsect1>
128
129  <refsect1>
130    <title>See Also</title>
131    <para>
132      <citerefentry><refentrytitle>systemd</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
133      <citerefentry><refentrytitle>sd-id128</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
134      <citerefentry><refentrytitle>sd_id128_get_machine</refentrytitle><manvolnum>3</manvolnum></citerefentry>
135    </para>
136  </refsect1>
137
138</refentry>
139