CARVIEW |
Select Language
HTTP/2 302
date: Tue, 15 Jul 2025 20:59:11 GMT
content-length: 0
location: https://github.com/NLnetLabs/nsd/pull/352
server-timing: nginx;desc="NGINX";dur=1.160099,glb;desc="GLB";dur=103.501079
x-voltron-version: fd8fbbc
vary: Accept-Encoding, Accept, X-Requested-With
server: github.com
x-frame-options: DENY
strict-transport-security: max-age=31536000; includeSubDomains; preload
set-cookie: _gh_sess=62H7zRUbQYmkdmIAniYp5%2B3c7%2BS9j8M5hADxciDbNKtxY9fIR6k%2Bz%2BaNxRGohgVo1sUGpZTEJjslg%2FFY2KrLyD1Zkt2YbJGq78bEOfoZOXfCRZ8CnkJLU20VY2C4ICBSCKZZK16R6EuLyincmPpOXoiF3o4%2Fyvuhp%2FkDnHPFmeALO43ro38lkkDTWVWFgxQlC%2FZNtLp%2BfF8%2BbJgKMLiAKj1evYNjwxeRU%2Fzg6q7u8ItS52VNr%2FeXKVWR3uiTYKnCSKbQjcboRzr2B0OLs8W%2BQQ%3D%3D--jG728kAzgHyuNaeC--F6ODn9C8inJdBTPD8AqhQA%3D%3D; Path=/; HttpOnly; Secure; SameSite=Lax
set-cookie: _octo=GH1.1.1746458006.1752613151; Path=/; Domain=github.com; Expires=Wed, 15 Jul 2026 20:59:11 GMT; Secure; SameSite=Lax
set-cookie: logged_in=no; Path=/; Domain=github.com; Expires=Wed, 15 Jul 2026 20:59:11 GMT; HttpOnly; Secure; SameSite=Lax
x-github-request-id: C30A:33CDEF:1536D1:1B61CD:6876C11F
HTTP/2 200
date: Tue, 15 Jul 2025 20:59:12 GMT
content-type: text/html; charset=utf-8
cache-control: no-cache
content-security-policy: default-src 'none'; base-uri 'self'; child-src github.githubassets.com github.com/assets-cdn/worker/ github.com/assets/ gist.github.com/assets-cdn/worker/; connect-src 'self' uploads.github.com www.githubstatus.com collector.github.com raw.githubusercontent.com api.github.com github-cloud.s3.amazonaws.com github-production-repository-file-5c1aeb.s3.amazonaws.com github-production-upload-manifest-file-7fdce7.s3.amazonaws.com github-production-user-asset-6210df.s3.amazonaws.com *.rel.tunnels.api.visualstudio.com wss://*.rel.tunnels.api.visualstudio.com objects-origin.githubusercontent.com copilot-proxy.githubusercontent.com proxy.individual.githubcopilot.com proxy.business.githubcopilot.com proxy.enterprise.githubcopilot.com *.actions.githubusercontent.com wss://*.actions.githubusercontent.com productionresultssa0.blob.core.windows.net/ productionresultssa1.blob.core.windows.net/ productionresultssa2.blob.core.windows.net/ productionresultssa3.blob.core.windows.net/ productionresultssa4.blob.core.windows.net/ productionresultssa5.blob.core.windows.net/ productionresultssa6.blob.core.windows.net/ productionresultssa7.blob.core.windows.net/ productionresultssa8.blob.core.windows.net/ productionresultssa9.blob.core.windows.net/ productionresultssa10.blob.core.windows.net/ productionresultssa11.blob.core.windows.net/ productionresultssa12.blob.core.windows.net/ productionresultssa13.blob.core.windows.net/ productionresultssa14.blob.core.windows.net/ productionresultssa15.blob.core.windows.net/ productionresultssa16.blob.core.windows.net/ productionresultssa17.blob.core.windows.net/ productionresultssa18.blob.core.windows.net/ productionresultssa19.blob.core.windows.net/ github-production-repository-image-32fea6.s3.amazonaws.com github-production-release-asset-2e65be.s3.amazonaws.com insights.github.com wss://alive.github.com api.githubcopilot.com api.individual.githubcopilot.com api.business.githubcopilot.com api.enterprise.githubcopilot.com; font-src github.githubassets.com; form-action 'self' github.com gist.github.com copilot-workspace.githubnext.com objects-origin.githubusercontent.com; frame-ancestors 'none'; frame-src viewscreen.githubusercontent.com notebooks.githubusercontent.com; img-src 'self' data: blob: github.githubassets.com media.githubusercontent.com camo.githubusercontent.com identicons.github.com avatars.githubusercontent.com private-avatars.githubusercontent.com github-cloud.s3.amazonaws.com objects.githubusercontent.com release-assets.githubusercontent.com secured-user-images.githubusercontent.com/ user-images.githubusercontent.com/ private-user-images.githubusercontent.com opengraph.githubassets.com copilotprodattachments.blob.core.windows.net/github-production-copilot-attachments/ github-production-user-asset-6210df.s3.amazonaws.com customer-stories-feed.github.com spotlights-feed.github.com objects-origin.githubusercontent.com *.githubusercontent.com; manifest-src 'self'; media-src github.com user-images.githubusercontent.com/ secured-user-images.githubusercontent.com/ private-user-images.githubusercontent.com github-production-user-asset-6210df.s3.amazonaws.com gist.github.com; script-src github.githubassets.com; style-src 'unsafe-inline' github.githubassets.com; upgrade-insecure-requests; worker-src github.githubassets.com github.com/assets-cdn/worker/ github.com/assets/ gist.github.com/assets-cdn/worker/
referrer-policy: no-referrer-when-downgrade
server-timing: pull_request_layout-fragment;desc="pull_request_layout fragment";dur=338.726822,conversation_content-fragment;desc="conversation_content fragment";dur=597.926801,conversation_sidebar-fragment;desc="conversation_sidebar fragment";dur=314.108542,nginx;desc="NGINX";dur=1.156152,glb;desc="GLB";dur=102.916228
strict-transport-security: max-age=31536000; includeSubdomains; preload
vary: X-PJAX, X-PJAX-Container, Turbo-Visit, Turbo-Frame, X-Requested-With,Accept-Encoding, Accept, X-Requested-With
x-content-type-options: nosniff
x-frame-options: deny
x-voltron-version: fd8fbbc
x-xss-protection: 0
server: github.com
content-encoding: gzip
accept-ranges: bytes
x-github-request-id: C30A:33CDEF:1536FF:1B61FB:6876C11F
contrib: add OpenRC service script, config file, and tmpfiles entry by orlitzky · Pull Request #352 · NLnetLabs/nsd · GitHub
Skip to content
Navigation Menu
{{ message }}
-
-
Notifications
You must be signed in to change notification settings - Fork 112
contrib: add OpenRC service script, config file, and tmpfiles entry #352
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
Conversation
This file contains hidden or 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
This skeleton configuration file simply presents the (default empty) NSD_EXTRA_OPTS variable to the user. The forthcoming OpenRC service script will make use of this variable in exactly the same manner that the systemd unit does.
This OpenRC service script is modified from the one currently used in Gentoo Linux to start NSD. The main benefit of having it upstream (i.e. here) is that several paths like @sbindir@ can be passed in from the build system. Having it here should also avoid some duplication of effort. Currently the script is unusable because the build system is unaware of it (and therefore doesn't make the necessary substitutions), but that will change in a subsequent commit.
In autoconf-2.70 and later, there is a separate --runstatedir flag that allows the user to specify the directory that would typically be /run on Linux or /var/run on BSD. The line, AC_PREREQ([2.70]) is added to configure.ac to ensure that autoconf supports this; the line runstatedir = @runstatedir@ is added to Makefile.in to allow the build system to make use of it. The $(EDIT) command (which simply runs sed) was also updated to make substitutions for @runstatedir@.
Use the pre-existing $(EDIT) command to make @foo@ substitutions in contrib/nsd.openrc.in, producing contrib/nsd.openrc as output.
Both systemd and OpenRC can make use of tmpfiles.d entries as described in https://www.freedesktop.org/software/systemd/man/latest/tmpfiles.d.html If the user wants to use a local control socket, then a writable temporary directory is needed to hold the socket. We cannot know beforehand what the user's configuration will be, so this commit adds a tmpfiles.d entry that unconditionally creates @runstatedir@/nsd and makes it writable by the nsd user. If the temporary directory turns out not to be needed, a superfluous one is no big deal. But if the user does want to use a local socket, then this saves him the trouble of securely creating a directory to hold it.
The new example makes use of the location @runstatedir@/nsd that is created by contrib/nsd-tmpfiles.conf and that will work "out of the box."
Once again this simply uses the pre-existing $(EDIT) command to run sed on the template file nsd-tmpfiles.conf.in and produce the output file nsd-tmpfiles.conf.
wcawijngaards
approved these changes
Jul 16, 2024
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The config looks nice and deals with the pidfile neatly. The contribution is appreciated!
wcawijngaards
added a commit
that referenced
this pull request
Jul 16, 2024
- Merge #352 from orlitzky: contrib: add OpenRC service script, config file, and tmpfiles entry.
Thank you! |
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.
You can’t perform that action at this time.
Add an OpenRC service script and config file under
contrib/
. The service script is integrated with the build system so that the correct paths are obtained from./configure
and do not need to be hard-coded. (This requires >=autoconf-2.70.) Tested on Gentoo, but it should work on other distros that use OpenRC as well.Add a tmpfiles entry under
contrib/
for both systemd and OpenRC. If installed, this will create at a boot a temporary "nsd" directory writable by the nsd user. This makes it easier to use a local control socket because the user no longer has to worry about creating the directory where the socket will live.Tweak the default config to show an example of using a local socket in the tmpfiles location.