On Mi, 20.08.25 14:50, Demi Marie Obenour ([email protected]) wrote: > >> On a system where /etc is read-only, systemd-logind fails to start. > >> I have tried making / a writable overlayfs without any success so > >> far. The code is at https://github.com/DemiMarie/spectrum (branch > >> b4/systemd) and the problem can be reproduced by running > >> nix-shell --pure --run 'make run' in host/rootfs. Obviously, do > >> this in a VM to not affect your host system :). > > > > I frequently run logind with a read-only /etc/, so this definitely > > works. > > > > Please provide logs of systemd-logind when this fails. i.e. > > > > "journalctl -u systemd-logind" > > What if /var is also read-only?
/var/ must be writable during normal operation. Not just systemd-logind relies on that (i.e. it has StateDirectory=systemd/linger, which means we need to create a subdir in /var/lib/ for it.) This is widely documented btw: https://www.freedesktop.org/software/systemd/man/devel/file-hierarchy.html#/var/ Any anyway, the fact that /var/ is supposed to be writable is already in the name: "var" → "variable" It's fine to mount /var/ from tmpfs if you have a stateless system, but writable it must be, otherwise your system is not compatible with systemd and you get to keep the pieces. Lennart -- Lennart Poettering, Berlin
