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/terraria: Wait for daemon to stop #44631
Conversation
cc @joachifm |
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.
Added a few superficial nits. I don't use this so can't comment on the specifics, but it makes sense to me at first glance fwiw.
@@ -105,14 +115,14 @@ in | |||
}; | |||
|
|||
config = mkIf cfg.enable { | |||
users.users.terraria = { | |||
users.extraUsers.terraria = { |
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 change seems unrelated to the PR subject. It is also somewhat redundant as these options are aliased.
@@ -18,6 +18,16 @@ let | |||
(boolFlag "secure" cfg.secure) | |||
(boolFlag "noupnp" cfg.noUPnP) | |||
]; | |||
stopScript = pkgs.writeScript "terraria-stop" '' | |||
#!${pkgs.stdenv.shell} |
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.
I think pkgs.runtimeShell
might be more appropriate, at least in concept.
RemainAfterExit = true; | ||
Type = "forking"; | ||
GuessMainPID = true; | ||
CapabilityBoundingSet = ""; |
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 capability changes seem strictly unrelated. I'd also expect this to be moot seing as the process runs as non-root to begin with, is there some way it can gain capabilities?
@joachifm Thank you for your review! I fixed your mentioned problems |
@@ -18,6 +18,16 @@ let | |||
(boolFlag "secure" cfg.secure) | |||
(boolFlag "noupnp" cfg.noUPnP) | |||
]; | |||
stopScript = pkgs.writeScript "terraria-stop" '' | |||
#!${pkgs.stdenv.runtimeShell} |
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.
Typo here, the correct attribute path is pkgs.runtimeShell
@joachifm Fixed and rebased |
Thank you |
Motivation for this change
systemd wasn't waiting for the daemon to exit (because it's asynchronous) and hence killed it without saving the world first.
Things done
sandbox
innix.conf
on non-NixOS)nix-shell -p nox --run "nox-review wip"
./result/bin/
)nix path-info -S
before and after)