-
-
Notifications
You must be signed in to change notification settings - Fork 14.5k
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
nixos/systemd: allow preStart with other ExecStartPre cmdlines #109976
Merged
roberth
merged 1 commit into
NixOS:master
from
hercules-ci:systemd-allow-preStart-with-ExecStartPre
Jan 22, 2021
Merged
nixos/systemd: allow preStart with other ExecStartPre cmdlines #109976
roberth
merged 1 commit into
NixOS:master
from
hercules-ci:systemd-allow-preStart-with-ExecStartPre
Jan 22, 2021
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
Declaring them as lists enables the concatenation, supporting lib.mkBefore, lib.mkOrder, etc. This is useful when you need to extend a service with a pre-start script that needs to run as root.
@GrahamcOfBorg test redis |
ofborg
bot
added
6.topic: nixos
Issues or PRs affecting NixOS modules, or package usability issues specific to NixOS
8.has: module (update)
This PR changes an existing module in `nixos/`
10.rebuild-darwin: 0
This PR does not cause any packages to rebuild on Darwin
10.rebuild-linux: 0
This PR does not cause any packages to rebuild on Linux
labels
Jan 19, 2021
Any interest in |
✔️ |
aanderse
approved these changes
Jan 22, 2021
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.
This is awesome! I've seen a couple issues come up over the past year that this would have solved. Thanks ✨
6 tasks
7c6f434c
added a commit
that referenced
this pull request
Feb 12, 2021
Follow-up to: nixos/systemd: allow preStart with other ExecStartPre cmdlines #109976 As the additional ExecStartPre and ExecStartPost are now lists, update their processing by service-runner.nix
9 tasks
mweinelt
pushed a commit
to mweinelt/nixpkgs
that referenced
this pull request
May 22, 2021
Follow-up to: nixos/systemd: allow preStart with other ExecStartPre cmdlines NixOS#109976 As the additional ExecStartPre and ExecStartPost are now lists, update their processing by service-runner.nix (cherry picked from commit 9486375)
ivanbakel
added a commit
to ivanbakel/nixpkgs
that referenced
this pull request
Mar 23, 2023
The definition of `ExecStartPre` used for redis is non-composable, and causes issues if a module tries to define `redis.preStart` (despite the fact that these definitions can be compatible.) This uses the approach suggested by NixOS#109976 to allow for composing use of `preStart` and `ExecStartPre`, by making the default value of `ExecStartPre` defined internally a list with `mkBefore`.
12 tasks
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
6.topic: nixos
Issues or PRs affecting NixOS modules, or package usability issues specific to NixOS
8.has: module (update)
This PR changes an existing module in `nixos/`
10.rebuild-darwin: 0
This PR does not cause any packages to rebuild on Darwin
10.rebuild-linux: 0
This PR does not cause any packages to rebuild on Linux
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.
Declaring them as lists enables the concatenation, supporting
lib.mkBefore, lib.mkOrder, etc.
This leaves all existing configurations as they are.
New configurations will be possible that have both
preStart
andserviceConfig.ExecStartPre = lib.mkBefore [ ...... ]
in services.Same for
ExecStartPost
.Motivation for this change
This is useful when you need to extend a service with a pre-start
script that needs to run as root.
For example, when a service configuration needs custom filesystem initialization.
It may also be useful for merging external secrets into configuration, for non-dynamicuser services or depending on the outcome of NixOS/rfcs#59 (comment)
Things done
sandbox
innix.conf
on non-NixOS linux)nix-shell -p nixpkgs-review --run "nixpkgs-review wip"
./result/bin/
)nix path-info -S
before and after)