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/mysql: split database provisioning into a separate systemd unit #81432
Conversation
520bf93
to
d49a17c
Compare
@GrahamcOfBorg test mysql mysql-replication |
Failing test was already failing before this PR, see https://hydra.nixos.org/build/124999727. |
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.
Very cool, thanks for your work. This should finally make it easier to customise the service to allow much more complicated scenarios (without replacing the module).
Some random thoughts: Maybe it makes sense to add a test which uses the new mysql.target
to not only ensure that ordering works correctly but also to have a working example on how to write those services. Additionally, maybe it makes sense to initialise each database in its own unit - that way you could order your services after eg. mysql-init-mydatabase.service
.
NoNewPrivileges = true; | ||
# Sandboxing | ||
ProtectSystem = "strict"; | ||
ProtectHome = true; |
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.
Did you check whether confinement.enable
works here? Because if that's the case we can even restrict access to just the relevant store paths.
I like the suggestion of a separate |
Motivation for this change
mysql/mariadb
server from restarting for no good reason when usingensure*
optionsmysql.target
so module authors have a.target
to use for custom database scriptsThings 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)ping @thorstenweber83