-
Notifications
You must be signed in to change notification settings - Fork 247
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
start-stop-daemon, supervise-daemon: use close_range with musl #645
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
16 tasks
thesamesam
reviewed
Aug 29, 2023
Maybe we should also set CLOEXEC instead of closing it in start-stop-daemon, similar as it is done in supervise-daemon. |
I refactored it a bit to be less hackish. Also changed start-stop-daemon to use CLOEXEC instead of closing the filedescriptors, similar to what supervise-daemon does. |
algitbot
pushed a commit
to alpinelinux/aports
that referenced
this pull request
Aug 30, 2023
floppym
reviewed
Aug 31, 2023
ncopa
force-pushed
the
close_range
branch
2 times, most recently
from
September 1, 2023 07:34
a438f14
to
076e0db
Compare
Use HAVE_CLOSE_RANGE to tell if system provides a close_range(2) wrapper, which better explains the purpose. Add a compat inline which returns -1 if close_range is unavailable.
Move logic to set file descriptors to a cloexec_fds_from() function in misc.c so it can be shared by both supervisor-daemon and start-stop-daemon, and hide the details behind.
Set file descriptors to CLOEXEC instead of closing them before exec, similar to what we do in supervise-daemon. Use the share cloexec_fds_from() helper for this. closefrom() is no longer used so remove the test.
Add fallback for the close_range syscall wrapper. This is needed for musl libc, which currently does not have a close_range wrapper. Also set errno on errors.
bell-sw
pushed a commit
to bell-sw/alpaquita-aports
that referenced
this pull request
Sep 8, 2023
[ commit 76c4c51f8e4cdd27fbc76ecd2439d01260cadfd4 ] upstream: OpenRC/openrc#645
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Make sure that we use close_range also with musl libc, using syscall directly.
This fixes a severe performance issue when running openrc under docker where the maxfd may be 1G.