Skip to content

librc: don't create /run/openrc itself on demand. #879

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

Merged
merged 1 commit into from
Jun 15, 2025

Conversation

navi-desu
Copy link
Member

this is a temporary fix, in a system that boots with / as rw, /run unmounted, and has rc_parallel on, openrc would create a dirfd to /run/openrc before mounting /run, thus keeping an open fd to the old /run mountpoint, and creating 'exclusive' lockfiles under it, that subsequent services can't see nor lock on.

Fixes: #859
Fixes: 07d6f4d

@N-R-K
Copy link
Contributor

N-R-K commented Jun 11, 2025

I don't think I fully follow what's going on. Is it:

  1. openrc creates stuff under /run/openrc but /run isn't mounted yet.
  2. /run gets mounted and the older stuff can no longer be seen.

Or:

  1. openrc opens /run but doesn't create anything.
  2. /run is mounted
  3. Now it creates stuff, but the dirfd is pointing to the old /run.

If it's the former then I don't think this fixes it, if it's the latter then this patch makes sense. But why call it "temporary fix"?

@navi-desu
Copy link
Member Author

I don't think I fully follow what's going on. Is it:

1. openrc creates stuff under /run/openrc but /run isn't mounted yet.

2. /run gets mounted and the older stuff can no longer be seen.

Or:

1. openrc _opens_ `/run` but doesn't create anything.

2. /run is mounted

3. Now it creates stuff, but the dirfd is pointing to the old `/run`.

If it's the former then I don't think this fixes it, if it's the latter then this patch makes sense. But why call it "temporary fix"?

  1. openrc creates /run/openrc and opens a dirfd to it
  2. /run gets mounted, so /run/openrc can no longer be seen by new processes
  3. then openrc creates /run/openrc/exclusive under the dirfd for the old /run
  4. new processes try to check for exclusive in the new /run, find nothing

so it's both, at the same time, and this fixes the former case because it (now, i had forgotten to) restores old behaviour of only creating /run/openrc when rc_deptree_update_needed is called, which is always after do_sysinit

this is also why it's temporary, in my view, i don't like this "solution" of creating the runtime dir as a side-effect of this one "check" function

this is a temporary fix, in a system that boots with / as rw, /run
unmounted, and has rc_parallel on, openrc would create a dirfd to
/run/openrc before mounting /run, thus keeping an open fd to the old
/run mountpoint, and creating 'exclusive' lockfiles under it, that
subsequent services can't see nor lock on.

Fixes: #859
Fixes: 07d6f4d
@navi-desu navi-desu merged commit 83e6e4f into master Jun 15, 2025
10 checks passed
@navi-desu navi-desu deleted the run-parallel-fix branch June 15, 2025 21:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

openrc 0.62 breaks rc_parallel="YES"
2 participants