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/switch-to-configuration: Never stop system.slice #43682

Merged
merged 1 commit into from Jul 28, 2018

Conversation

primeos
Copy link
Member

@primeos primeos commented Jul 17, 2018

Motivation for this change

Problem: Restarting (stopping) system.slice would not only stop X11 but
also most system units/services. We obviously don't want this happening
to users when they switch from 18.03 to 18.09 or nixos-unstable.

Reason: The following change in systemd:
systemd/systemd@d8e5a93

The commit adds system.slice to the perpetual units, which means
removing the unit file and adding it to the source code. This is done so
that system.slice can't be stopped anymore but in our case it ironically
would cause this script to stop system.slice because the unit file was
removed (and an older systemd version is still running).

Related issue: #39791

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.

@primeos
Copy link
Member Author

primeos commented Jul 17, 2018

cc @edolstra @ocharles (since you've contributed the most to switch-to-configuration.pl)

Is this change ok? I've tried to keep it as minimal as possible to avoid further bugs.

Running nixos-rebuild dry-activate 2>&1 | grep system.slice with and without this commit (after switching from 18.03 to nixos-unstable) should already be enough to verify it.

Edit: I've initially set the wrong branch, this should go into master (and 18.09), but we should probably also backport it to 18.03 in case we upgrade the systemd version.

Problem: Restarting (stopping) system.slice would not only stop X11 but
also most system units/services. We obviously don't want this happening
to users when they switch from 18.03 to 18.09 or nixos-unstable.

Reason: The following change in systemd:
systemd/systemd@d8e5a93

The commit adds system.slice to the perpetual units, which means
removing the unit file and adding it to the source code. This is done so
that system.slice can't be stopped anymore but in our case it ironically
would cause this script to stop system.slice because the unit file was
removed (and an older systemd version is still running).

Related issue: NixOS#39791
@primeos primeos merged commit 01cfa80 into NixOS:master Jul 28, 2018
@primeos
Copy link
Member Author

primeos commented Jul 28, 2018

(Merged it since there where no objections, the change is minimal, and we could revert it at any time.)

@matthewbauer: Thank you very much for your review :)

KiaraGrouwstra added a commit to KiaraGrouwstra/nix-config that referenced this pull request Aug 18, 2018
@samueldr samueldr removed the 9.needs: port to stable A PR needs a backport to the stable release. label Apr 17, 2019
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