LinuxCommandLibrary

dbus-uuidgen

Generate a unique machine ID

SYNOPSIS

dbus-uuidgen [OPTION...]

PARAMETERS

-h, --help
    Show help message and exit.

-v, --version
    Show version number and exit.

--ensure[=FILENAME]
    If FILENAME exists, its contents are printed to standard output. Otherwise, a new UUID is generated, stored in FILENAME, and then printed. If FILENAME is omitted, it defaults to /var/lib/dbus/machine-id.

--get[=FILENAME]
    If FILENAME exists, its contents are printed to standard output. Otherwise, the command exits with an error. If FILENAME is omitted, it defaults to /var/lib/dbus/machine-id.

--create-machine-id
    Deprecated. This option is equivalent to `dbus-uuidgen --ensure`. It was used to create or ensure the existence of the machine ID file.

--template
    Deprecated. This option previously output a template for the machine ID file, which was just a newly generated UUID. Its functionality is now covered by simply running `dbus-uuidgen` without any options to generate a new UUID and print it to standard output.

DESCRIPTION

dbus-uuidgen is a fundamental utility within the D-Bus message bus system, primarily used to generate or retrieve a unique machine identifier. This identifier is a Universally Unique Identifier (UUID), specifically a version 4 UUID, which is randomly generated. The generated UUID is typically stored in the file /var/lib/dbus/machine-id.

The D-Bus daemon and various D-Bus applications rely on this stable machine ID to identify the local system uniquely, especially in scenarios involving network-transparent communication or when maintaining consistent state across reboots. It plays a vital role in ensuring that D-Bus instances can correctly identify their host and interact properly.

If the /var/lib/dbus/machine-id file does not exist, `dbus-uuidgen` can be used to create it with a new UUID. If the file already exists, the command can retrieve and print its existing content. This tool is often run automatically during system installation or when setting up the D-Bus environment to ensure a unique identifier is present.

CAVEATS

The `--create-machine-id` and `--template` options are deprecated; users should prefer `--ensure` or simply running `dbus-uuidgen` for generating a new UUID.

The machine ID (typically in /var/lib/dbus/machine-id) should remain constant for a given system. Changing it frequently can lead to issues with D-Bus applications and services that rely on a stable machine identity.

The /var/lib/dbus/machine-id file must have appropriate permissions (typically readable by the `dbus` user/group, such as 0444 or 0644) to ensure proper D-Bus functionality and security.

<B>UUID FORMAT</B>

The UUID generated by `dbus-uuidgen` is a standard version 4 UUID (randomly generated) as specified in RFC 4122. It consists of 32 hexadecimal digits, displayed in 5 groups separated by hyphens (e.g., `xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx`), where the '4' indicates the UUID version and the 'y' indicates the variant.

HISTORY

`dbus-uuidgen` has been an integral part of the D-Bus package since its early days, facilitating the setup and management of unique machine identifiers essential for inter-process communication within the D-Bus architecture. Its core functionality of generating and retrieving UUIDs has remained consistent over time, though specific options have been deprecated in favor of more consistent naming conventions or simplified usage.

SEE ALSO

dbus-daemon(1), dbus-send(1), machine-id(5)

Copied to clipboard