[Pkg-systemd-maintainers] Bug#619244: Bug#619244: Bug#619244: systemd: unowned files after purge (policy 6.8, 10.8): /etc/machine-id

Tobias Frost tobi at frost.de
Tue Apr 15 13:10:58 BST 2014


Hi Simon,

Just finished my analysis of dbus but well, you answered faster...

For the curious, the code is here
http://sources.debian.net/src/dbus/1.8.0-3/dbus/dbus-sysdeps-unix.c?hl=3589#L3573

Maybe it is sufficient to agree on a load order, like switch the order dbus
tries to read the uuid? So first try /etc/machine-id and then its own...
(Of course systemd could first tries to read from dbus before trying
/etc/machine-id? But as systemd is supposed to start earlier, I guess, it is
probably better to have dbus read it first to avoid races)

I was just about to send the same th> On 14/04/14 22:12, Michael Biebl wrote:
>> That said, I don't know if any other package relies on
>> /etc/machine-id. I do know that dbus makes use of it but I dunno
>> all the details regarding the /var/lib/dbus/machine-id fallback
>
> libdbus, and other D-Bus implementations, read
> /var/lib/dbus/machine-id or /etc/machine-id (in that order), taking
> the contents of the first one that looks sane; except that systemd-bus
> might do it the other way round, because Lennart.
>
>> Say we first install systemd, which generates /etc/machine-id,
>> then later dbus. Will in this case a /var/lib/dbus/machine-id file
>> be created or will dbus use /etc/machine-id?
>
> dbus.postinst runs dbus-uuidgen, which creates
> /var/lib/dbus/machine-id, unless it already exists and has suitable
> contents; if /var/lib/dbus/machine-id does not exist but
> /etc/machine-id does, it does *not* copy /etc/machine-id to
> /var/lib/dbus/machine-id, but instead creates an entirely new machine
> ID in /var/lib/dbus/machine-id (which libdbus and GDBus will use in
> preference to /etc/machine-id). I consider that to be a bug, tbh - it
> should prefer to take the ID from /etc/machine-id and copy it into
> /var/lib/dbus. I'd be happy to review patches upstream.
>
> When it happens the other way round, I think systemd-machine-id-setup
> *does* copy /var/lib/dbus/machine-id to /etc/machine-id rather than
> creating its own.
>
>> In this case we can't remove /etc/machine-id again, as it would
>> break dbus, unless dbus would on-the-fly generate a
>> /var/lib/dbus/machine-id if no /etc/machine-id is available.
>
> /var/lib/dbus/machine-id is used by both root and unprivileged users,
> but can only be set up by root, so creating it on-demand is not possible.
>
> Ideally, I would like this to be done in base-files, but if that isn't
> feasible, the next best thing would be for each of systemd and dbus to
> copy the other's idea of the machine ID in preference to creating its own.
>
>     S
>

Tobi




More information about the Pkg-systemd-maintainers mailing list