<!DOCTYPE REFENTRY PUBLIC "-//Sun Microsystems//DTD DocBook V3.0-Based SolBook Subset V2.0//EN" [
<!--ArborText, Inc., 1988-1999, v.4002-->
<!--ARC : LSARC 2006/368 D-BUS Message Bus System -->
<!ENTITY cmd "dbus-uuidgen">
<!ENTITY % commonents SYSTEM "smancommon.ent">
%commonents;
<!ENTITY % booktitles SYSTEM "booktitles.ent">
%booktitles;
<!ENTITY suncopy "Copyright (c) 2007,2009 Sun Microsystems, Inc. All Rights Reserved.">
]>
<refentry id="dbus-uuidgen-1">
<!-- %Z%%M% %I% %E% SMI; -->
<refmeta><refentrytitle>&cmd;</refentrytitle><manvolnum>1</manvolnum>
<refmiscinfo class="date">25 Feb 2009</refmiscinfo>
<refmiscinfo class="sectdesc">&man1;</refmiscinfo>
<refmiscinfo class="software">&release;</refmiscinfo>
<refmiscinfo class="arch">generic</refmiscinfo>
<refmiscinfo class="copyright">&suncopy;</refmiscinfo>
</refmeta>
<indexterm><primary>&cmd;</primary></indexterm>
<indexterm><primary>Utility to generate UUIDs</primary></indexterm>
<refnamediv id="dbus-uuidgen-1-name">
<refname>&cmd;</refname><refpurpose>
Utility to generate UUIDs
</refpurpose>
</refnamediv>
<refsynopsisdiv id="dbus-uuidgen-1-synp"><title>&synp-tt;</title>
<cmdsynopsis><command>&cmd;</command>
<arg choice="opt"><option>-ensure=<replaceable>file</replaceable></option></arg>
<arg choice="opt"><option>-get=<replaceable>file</replaceable></option></arg>
<arg choice="opt"><option>-version</option></arg>
</cmdsynopsis></refsynopsisdiv>

<refsect1 id="dbus-uuidgen-1-desc"><title>&desc-tt;</title>
<para>
The <command>&cmd;</command> command generates or reads a universally unique
ID.
</para>

<para>
Note that the D\-Bus UUID has no relationship to RFC 4122 and does not generate
UUIDs compatible with that spec.  Many systems have a separate command for that
(often called &quot;uuidgen&quot;).
</para>

<para>
The primary usage of <command>&cmd;</command> is to run in the post-install
script of a D\-Bus package as shown in the example section of this document.
</para>

<para>
This will ensure that <filename>/var/lib/dbus/machine-id</filename> exists and
has the uuid in it.  It will not overwrite an existing uuid, since this id
should remain fixed for a single machine until the next reboot at least.
</para>

<para>
The important properties of the machine UUID are that 1) it remains unchanged
until the next reboot and 2) it is different for any two running instances of
the OS kernel.  That is, if two processes see the same UUID, they should also
see the same shared memory, UNIX domain sockets, local X displays,
localhost.localdomain resolution, process IDs, and so forth.
</para>

<para>
If you run <command>&cmd;</command> with no options it just prints a new uuid
made up out of thin air.
</para>

<para>
If you run <command>&cmd;</command> with <option>-get</option>, it prints the
machine UUID by default, or the UUID in the specified file if you specify a
file.
</para>

<para>
If you try to change an existing machine-id on a running system, it will
probably result in bad things happening.  Do not try to change this file.
Also, do not make it the same on two different systems; it needs to be
different anytime there are two different kernels running.
</para>

<para>
The UUID should be different on two different virtual machines, because there
are two different kernels.
</para>
</refsect1>

<refsect1 id="dbus-uuidgen-1-opts"><title>&opts-tt;</title>
<para>
The following options are supported:
</para>

<variablelist termlength="wholeline">
<varlistentry>
<term><option>-ensure=<replaceable>file</replaceable></option></term>
<listitem><para>
If a <replaceable>file</replaceable> is not given, defaults to
<filename>/var/lib/dbus/machine-id</filename>.  If this
<replaceable>file</replaceable> exists then it will be validated, and a failure
code returned if it contains the wrong thing.  If the file does not exist, it
will be created with a new uuid in it.  On success, prints no output.
</para></listitem></varlistentry>

<varlistentry>
<term><option>-get=<replaceable>file</replaceable></option></term>
<listitem><para>
If a file is not given, defaults to
<filename>/var/lib/dbus/machine-id</filename>.  If this
<replaceable>file</replaceable> exists and is valid, the uuid in the file is
printed on <literal>stdout</literal>. Otherwise, the command exits with a
nonzero status.
</para></listitem></varlistentry>

<varlistentry>
<term><option>-version</option></term>
<listitem><para>
Print the version of <command>&cmd;</command>
</para></listitem></varlistentry>
</variablelist>
</refsect1>

<refsect1 id="dbus-uuidgen-1-exam"><title>&exam-tt;</title>
<example role="example">
<title>
The primary usage of <command>&cmd;</command> is to run in the post-install script of a D\-Bus package</title>

<para><screen>
          <command>&cmd;</command> --ensure</userinput>
</screen></para>

</example>
</refsect1>

<refsect1 id="dbus-uuidgen-1-exit"><title>&exit-tt;</title>
<para>
The following exit values are returned:
</para>

<variablelist termlength="xtranarrow">
<varlistentry>
<term><returnvalue>0</returnvalue></term>
<listitem><para>
Application exited successfully
</para></listitem></varlistentry>

<varlistentry>
<term><returnvalue>>0</returnvalue></term>
<listitem><para>
Application exited with failure
</para></listitem></varlistentry>
</variablelist>
</refsect1>

<refsect1 id="dbus-uuidgen-1-file"><title>&file-tt;</title>
<para>
The following files are used by this application:
</para>

<variablelist termlength="wide">
<varlistentry>
<term><filename>/usr/bin/&cmd;</filename></term>
<listitem><para>
Executable for <command>&cmd;</command>
</para></listitem></varlistentry>

<variablelist termlength="wide">
<varlistentry>
<term><filename>/var/lib/dbus/machine-id</filename></term>
<listitem><para>
File containing the uuid generated for this machine.
</para></listitem></varlistentry>

</variablelist>
</refsect1>

<refsect1 id="dbus-uuidgen-1-attr"><title>&attr-tt;</title>
<para>
See
<olink targetdocent="REFMAN5" localinfo="attributes-5">
<citerefentry><refentrytitle>attributes</refentrytitle>
<manvolnum>5</manvolnum></citerefentry></olink>
for descriptions of the following attributes:
</para>

<informaltable frame="all">
<tgroup cols="2" colsep="1" rowsep="1">
<colspec colname="COLSPEC0" colwidth="1*">
<colspec colname="COLSPEC1" colwidth="1*">
<thead>
<row>
<entry align="center" valign="middle">ATTRIBUTE TYPE</entry>
<entry align="center" valign="middle">ATTRIBUTE VALUE</entry>
</row>
</thead>
<tbody>
<row>
<entry><para>Availability</para></entry>
<entry><para>system/library/dbus</para></entry>
</row>
<row>
<entry colname="COLSPEC0"><para>Interface stability</para></entry>
<entry colname="COLSPEC1"><para>Volatile</para></entry>
</row>
</tbody></tgroup>
</informaltable>
</refsect1>

<refsect1 id="dbus-uuidgen-1-also"><title>&also-tt;</title>
<!--Reference to another man page-->
<!--Reference to a Help manual-->
<!--Reference to a book.-->
<para>
More information can be found at:
</para>

<para>
<literal>http://www.freedesktop.org/software/dbus/</literal>
</para>

<para>
<citerefentry><refentrytitle>dbus-binding-tool</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
<citerefentry><refentrytitle>dbus-cleanup-sockets</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
<citerefentry><refentrytitle>dbus-daemon</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
<citerefentry><refentrytitle>dbus-launch</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
<citerefentry><refentrytitle>dbus-monitor</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
<citerefentry><refentrytitle>dbus-send</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
<citerefentry><refentrytitle>libdbus-glib-1</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
<citerefentry><refentrytitle>attributes</refentrytitle><manvolnum>5</manvolnum></citerefentry>
</para>
</refsect1>

<refsect1 id="dbus-uuidgen-1-note"><title>&note-tt;</title>
<para>
For authorship information refer to
<literal>http://www.freedesktop.org/software/dbus/doc/AUTHORS</literal>.
Updated by Brian Cameron, Sun Microsystems Inc., 2007.
</para>

<para>
Please send bug reports to the D\-Bus mailing list or bug
tracker, see
<literal>http://www.freedesktop.org/software/dbus/</literal>
</para>
</refsect1>
</refentry>
