Re: Read-only /etc, machine-id with an overlay - journald failing

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



I had similar problems with a case of booting with the rootfs read-only and then becoming read-write later...

Basically systemd only checks for machine-id very early (before reading any config file) and does not deal well with /etc changing status...

I did a complete analysis of what's going on, with a patch that improves the situation here : https://github.com/systemd/systemd/pull/14135
I am not sure how to deal with it in your specific case. 
the simplest approch would be to mount your overlay in a initrd (or in a small script shell that is run before systemd and exec systemd as its last step)

My patch wouldn't really help in your case, but maybe you can "cheat" by having the underlying /etc/machine-id bein a symlink to the overlay directory... that could work. 

Regards
Jeremy

Le mer. 26 févr. 2020 à 10:59, Andreas Kempe <andreas.kempe@xxxxxxxx> a écrit :
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
_______________________________________________
systemd-devel mailing list
systemd-devel@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/systemd-devel


--
SMILE 

20 rue des Jardins
92600 Asnières-sur-Seine

Jérémy ROSEN
Architecte technique

email jeremy.rosen@xxxxxxxx 
phone  +33 6 88 25 87 42 
url http://www.smile.eu

Twitter Facebook LinkedIn Github

Découvrez l’univers Smile, rendez-vous sur smile.eu
_______________________________________________
systemd-devel mailing list
systemd-devel@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/systemd-devel

[Index of Archives]     [LARTC]     [Bugtraq]     [Yosemite Forum]     [Photo]

  Powered by Linux