[RFC] Fixing the machine id
walters at verbum.org
Wed Mar 9 10:25:40 PST 2011
On Fri, Mar 4, 2011 at 4:40 PM, Lennart Poettering <mzqohf at 0pointer.de> wrote:
> one problem the D-Bus machine ID has for usage in various programs is
> that it is not available during early boot. Kay and I have been thinking
> about this for a while, and the obvious fix is of course to move it from
> /var/lib to /etc which is guaranteed to be around right from the
> beginning, and is the better place for it anyway, since it is everything
> but variable.
Sounds great! One comment:
> So, here's what systemd now does at boot: when it finds /etc/machine-id
> populated, then everything is fine. If it is not populated, it tries to
> initialize it from /var/lib/dbus/machine-id, with a fallback on
My one concern is that if systemd has a /dev/urandom fallback, and
it's silently used in the case of OS misconfiguration, it could make
consumers of it unreliable. Someone posted a DBus patch to get rid of
the file and just autogenerate it each time, but one of the major
points of this ID *is* that it's persistent; if your app or library
needs to store machine-specific state, you really don't want it to be
lost on reboot.
Or is systemd going to create /etc/machine-id from /dev/urandom
persistently? In that case, sounds good.
More information about the dbus