Comment 5 for bug 1508697

Revision history for this message
Simon McVittie (smcv) wrote :

> systemd doesn't inself create /etc/machine-id when missing, which it should.

I think the solution to "my system-imaging setup isn't working" is to get that bug (presumably a systemd bug?) fixed - this one is rather minor by comparison. Do you have a correct bug# for it?

> I've put a lot of effort into making sure things that should be unique between machines, things that are unique when you do a manual Ubuntu install, are actually unique when we image a system.

Yeah, the list of things that should be unique has changed over time, unfortunately. I hope that future software needing a unique machine ID will just use /etc/machine-id, but D-Bus is older than systemd, so we didn't have that option at the time. Now /var/lib/dbus/machine-id needs to continue to exist, because some third party software depends on it, but libdbus doesn't actually rely on it any more - it will try reading both locations.

> After all, tools must already get along with a symlink due to the tmpfiles.d

Be a bit careful here... things must cope with /var/lib/dbus/machine-id being a symlink to /etc/machine-id *if we are booting with systemd*. If the init system is sysvinit or Upstart (still supported in Debian) then nothing guarantees there will ever be a /etc/machine-id.

However, systemd doesn't delete /etc/machine-id on purge, so after one has been created, I think it's guaranteed to stay.

I'd be happy to review a patch upstream that made _dbus_read_local_machine_uuid() with create_if_not_found=TRUE (i.e. the implementation of dbus-uuidgen --ensure) symlink the machine ID rather than copying it.

Alternatively, the postinst could create the symlink if /etc/machine-id exists and has syntactically valid contents, or run dbus-uuidgen --ensure if not.