[Pkg-systemd-maintainers] Bug#619244: Bug#619244: /etc/machine-id

Josh Triplett josh at joshtriplett.org
Fri Feb 21 15:01:35 GMT 2014


On Fri, Feb 21, 2014 at 06:04:42AM -0800, Martin Pitt wrote:
> Simon McVittie [2014-02-21 10:05 +0000]:
> > I've wondered whether to ask base-files or some similarly core package
> > to provide /etc/machine-id so that it exists even on non-systemd systems;
> > it would be easy to populate from something like
> > "sed s/-// /proc/sys/kernel/random/uuid" on Linux, and perhaps
> > /dev/[u]random on non-Linux. Do you think that's a good idea?
> 
> I don't think it's a bad idea. But are non-systemd systems going to
> care about this file at all? I've never quite liked this file as it
> isn't really configuration but state; it should be in /var/lib
> somewhere IMHO.

I agree that it it provides state rather than configuration, but
/var/lib won't work, for much the same reason that led to making /run to
replace /var/run: /var can legitimately be a separately mounted
filesystem, and machine-id may well be needed early.  Unfortunately,
there's no /var-like persistent guaranteed-to-be-on-/ filesystem to use
here.  You could put machine-id in lib (/lib/machine-id), though that
doesn't really fit, but in any case you'll need a symlink from /etc.  At
which point you might as well just put it in /etc.

> But aside from that: if we don't get it in base-files,
> we could at least do either of:
> 
>  * change systemd to read /var/lib/dbus/machine-id if /etc/machine-id
>    does not exist (my preferred solution), or

See above: /var is too late.

>  * change dbus-1 to create a symlink of /var/lib/dbus/machine-id to
>    /etc/machine-id, if /etc/machine-id does not already exist.

Likewise.

- Josh Triplett




More information about the Pkg-systemd-maintainers mailing list