Order of the machine-id files

Simon McVittie simon.mcvittie at collabora.co.uk
Thu Jan 9 04:03:02 PST 2014


On 09/01/14 08:03, Fridrich Strba wrote:
> On 09/01/14 02:58, Yang Chengwei wrote:
>> On Wed, Jan 08, 2014 at 09:12:35AM +0100, Fridrich Strba wrote:
>> Is there any bugzilla used to track the issue?
>
> Will do, but I wanted to open it directly with a patch.

Sending a mail to this mailing list, with a patch that you aren't sure
is correct, is just as much work for the maintainers as opening a bug
with a patch you aren't sure is correct. Either way, we have to work out
whether it's correct or not :-) and a patch in Bugzilla has built-in
"did we resolve this?" tracking.

(Patches that you aren't sure are correct are very welcome, particularly
if you label them as such.)

>> I think probably this is a distro issue,
>> %localstatedir/lib/dbus/machine-id should be generated by
>> dbus-uuidgen at first, then not bother on /etc/machine-id.
> 
> It is generated on SUSE, albeit, sometimes it happens that the
> /etc/machine-id differs from that one.

This does sound to me like a system-integration issue: if you have both
files, they should be identical. I would expect that anything that
generates a machine ID (dbus-uuidgen and systemd-machine-id-setup)
should try reading both locations: if its preferred location doesn't
exist (or is syntactically invalid), but the other location does (and is
valid), it should either do nothing, or copy the ID from the other
location. Actually generating a new ID should be a last resort.

If you want to make /etc/machine-id consistently "higher priority" than
/var/lib/dbus/machine-id, please check the other D-Bus implementations
(GDBus, libsystemd-dbus, dbus-java, ndesk-dbus) and check which priority
order they use. If "consistently use /etc/machine-id" turns out to be
simpler than "consistently use /var/lib/dbus/machine-id", I wouldn't
oppose a patch for the D-Bus Specification to make it recommend this; at
that point, it would become appropriate to change the implementation.

    S



More information about the dbus mailing list