Setting up D-Bus library for the machine-id uuid file

Simon McVittie simon.mcvittie at collabora.co.uk
Wed Mar 6 02:52:43 PST 2013


On 06/03/13 09:29, Bogdan Lotko wrote:
> Attempting to start the application linked with the D-Bus Library I get the
>>>D-Dus library appears to be incorrectly set up, failed to read machine
> uuid: Failed to open "/etc/machine-id"<<
> message.
> 
> The library expects the "/etc/machine-id" file, whereas on SLES11 the
> file path is "/var/lib/dbus/machine-id"

The message is slightly misleading; a modern version of libdbus will try
both ${localstatedir}/lib/dbus/machine-id and /etc/machine-id.

> ("brutal force" link helps :), but it'd prefer the proper solution )

If your distribution doesn't otherwise provide a unique machine ID (e.g.
because SLES11 is relatively old), providing one in /etc/machine-id is
no bad thing; and copying the machine ID traditionally generated by dbus
into /etc/machine-id (or symlinking, or hardlinking, or whatever) is a
perfectly good way to get one.

<http://0pointer.de/public/systemd-man/machine-id.html> documents how
/etc/machine-id is expected to work. It's a sensible generalization of
the D-Bus machine ID, and I would hope that any modern Unix system that
doesn't use systemd also adopts it.

> My question is how to configure the D-Bus library for this case.

Configure local installations of dbus with --localstatedir=/var. The GNU
default "politely" uses a subdirectory of ${prefix}, but in practice
locally-installed dbus upgrades benefit from sharing /var with the
system copy of dbus.

    S


More information about the dbus mailing list