Steps to reproduce: * install systemd on a system without dbus * run systemd-machine-id-setup if not already run by maintainer scripts * install dbus * run dbus-uuidgen --ensure if not already run by maintainer scripts (In a minimal Debian chroot: apt-get install --no-install-recommends systemd; apt-get install dbus. *.postinst run the relevant binaries automatically) Expected result: * /etc/machine-id contains 32 hex digits + "\n" * /var/lib/dbus/machine-id contains exactly the same thing Actual result: * /etc/machine-id contains 32 hex digits + "\n" * /var/lib/dbus/machine-id contains a different 32 hex digits + "\n" If you do it the other way round (install dbus, run dbus-uuidgen --ensure, install systemd, run systemd-machine-id-setup) then it works as expected: we generate a D-Bus machine ID, then systemd-machine-id-setup just copies it. Patches in a moment.
Created attachment 97973 [details] [review] [1/2] _dbus_write_uuid_file: factor out function to write a known UUID
Created attachment 97974 [details] [review] [2/2] Try to read /etc/machine-id before inventing a new /var/lib/dbus/machine-id It's least confusing if the two files have the same contents. systemd already knows how to pick up our /var/lib/dbus/machine-id if it exists and /etc/machine-id doesn't, but the converse is not currently true. We should make it true, so that it doesn't matter what order systemd-machine-id-setup and "dbus-uuidgen --ensure" were invoked in. In Debian, systemd currently Recommends dbus, so "dbus-uuidgen --ensure" will *usually* - but not always! - run first, and the two files will match. However, if you install systemd without dbus, and then install dbus later, there will be a mismatch. With this change, it doesn't matter which one is installed first: whichever one happens to come first, it will generate the machine ID, and then the other one will copy it.
looks good to me!
Fixed in git for 1.8.2, 1.9.0
Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.