-
Notifications
You must be signed in to change notification settings - Fork 274
librc: clear dirfds when creating new svcdir #893
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
if for whatever reason, /run/openrc exists in the rootfs before first boot, we'd still end up with an invalid fd. while users are not really supposed to have anything in /run (under the tmpfs mount), should they do, it's better to not fail clearing the dirfds as we create svcdir also means we don't need a new librc api function to clear it, for now at least.
9c27665 to
9c3f974
Compare
|
FWIW I still reproduce boot failures with a read-only rootfs that contains /run/openrc, rc_parallel=YES, and tmpfs mounted over /run/openrc a bit later: So apparently it somehow opened /run/openrc before mounting /run, then mounted /run, created /run/openrc and still used the old read-only fd for /run/openrc? I don't think there are multiple processes at this point with rc_parallel so I'm not sure why the fd wasn't cleared properly... but anyway I think it's fine to require /run to be empty as long as it's known, so I didn't check further on this; please let me know if you'd like me to dig a bit into this as it's probably easier for me to reproduce this. |
while it'd be fine, it'd be somewhat breaking behaviour compared to 0.61, so i'd like to fix it if you could either attempt to debug it, or send me a full |
Fair enough!
So looking at strace output, the problem with this patch seems to be that Unfortunately we can't remove that checkpath as init.sh also copies a few things in /run/openrc (and e.g. writes to
I'm running this on a real board; but could reproduce with a container (the ugly first command is just the only way I know to build a container as a one-liner... it should work with docker instead of podman as well if you prefer/already have docker) You can run sh instead of the non-interactive command and run |
that works, but, i didn't want to add |
if for whatever reason, /run/openrc exists in the rootfs before first boot, we'd still end up with an invalid fd. while users are not really supposed to have anything in /run (under the tmpfs mount), should they do, it's better to not fail