Skip to content
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

Merged
merged 1 commit into from Aug 20, 2018
Merged

nixos/terraria: Wait for daemon to stop #44631

merged 1 commit into from Aug 20, 2018

Conversation

dasJ
Copy link
Member

@dasJ dasJ commented Aug 7, 2018

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
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nox --run "nox-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Determined the impact on package closure size (by running nix path-info -S before and after)
  • Fits CONTRIBUTING.md.

@xeji
Copy link
Contributor

xeji commented Aug 7, 2018

cc @joachifm

Copy link
Contributor

@joachifm joachifm left a 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 = {
Copy link
Contributor

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}
Copy link
Contributor

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 = "";
Copy link
Contributor

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?

@dasJ
Copy link
Member Author

dasJ commented Aug 7, 2018

@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}
Copy link
Contributor

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

@dasJ
Copy link
Member Author

dasJ commented Aug 20, 2018

@joachifm Fixed and rebased

@joachifm joachifm merged commit 69d3bdf into NixOS:master Aug 20, 2018
@joachifm
Copy link
Contributor

Thank you

@dasJ dasJ deleted the terraria branch August 20, 2018 20:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants