[systemd-devel] Read-only /etc, machine-id with an overlay - journald failing

Andreas Kempe andreas.kempe at actia.se
Wed Feb 26 09:44:09 UTC 2020


Hello everyone,

I'm working in a project with an embedded Linux system based on
Openembedded using Systemd version 241 as our init process. We're
using a read-only /etc. To facilitate development, we want to use a
writeable overlay on /etc, but we ran into an issue.

When we start, Systemd detects that there is no machine-id file
present in /etc so it generates and mounts a /etc/machine-id. When our
mount unit then applies the overlay on /etc, it hides the mounted
file. Journald later fails to start because /etc/machine-id isn't
visible through the overlay.

At this point we're considering a number of workarounds, but I thought
it worthwhile asking the experts before we go patching Systemd or
similar.

My gut feeling is that using overlays on /etc can't be that uncommon
and it is likely PEBKAC on our end. Is there some canonical way of
doing overlays with Systemd and we're screwing things up?

Thank you in advance for any help!
Cordially,
Andreas Kempe


More information about the systemd-devel mailing list