git.iko.soy/typeable/nixpkgs
on master help sign in
Revert "nixos/switch-to-configuration: Never stop system.slice"

This change was only a temporary workaround and isn't required anymore, since /etc/systemd/system/system.slice should not be present on any recent NixOS system (which makes this change a no-op). This reverts commit 7098b0fcdfd7fa4b82c036d8116b60b78f497316.

commit698388bc61ae5c1436925caa4eeb0171a87ab1d0 authorMichael Weiss <dev.primeos@gmail.com> dateMon 22 Apr 2019, 11:49 (8 years ago) parent8c80a29
1 file changed−18
nixos/modules/system/activation/switch-to-configuration.pl−18
nixos/modules/system/activation/switch-to-configuration.pl−18
@@ -166,24 +166,6 @@ while (my ($unit, $state) = each %{$activePrev}) {
166166
167167 if (-e $prevUnitFile && ($state->{state} eq "active" || $state->{state} eq "activating")) {
168168 if (! -e $newUnitFile || abs_path($newUnitFile) eq "/dev/null") {
169− # Ignore (i.e. never stop) these units:
170− if ($unit eq "system.slice") {
171− # TODO: This can be removed a few months after 18.09 is out
172− # (i.e. after everyone switched away from 18.03).
173− # Problem: Restarting (stopping) system.slice would not only
174− # stop X11 but also most system units/services. We obviously
175− # don't want this happening to users when they switch from 18.03
176− # to 18.09 or nixos-unstable.
177− # Reason: The following change in systemd:
178− # https://github.com/systemd/systemd/commit/d8e5a9338278d6602a0c552f01f298771a384798
179− # The commit adds system.slice to the perpetual units, which
180− # means removing the unit file and adding it to the source code.
181− # This is done so that system.slice can't be stopped anymore but
182− # in our case it ironically would cause this script to stop
183− # system.slice because the unit was removed (and an older
184− # systemd version is still running).
185− next;
186− }
187169 my $unitInfo = parseUnit($prevUnitFile);
188170 $unitsToStop{$unit} = 1 if boolIsTrue($unitInfo->{'X-StopOnRemoval'} // "yes");
189171 }