diff --git a/nixos/modules/system/activation/switch-to-configuration.pl b/nixos/modules/system/activation/switch-to-configuration.pl index cb5b49692fe1..e0649448c834 100644 --- a/nixos/modules/system/activation/switch-to-configuration.pl +++ b/nixos/modules/system/activation/switch-to-configuration.pl @@ -128,7 +128,7 @@ while (my ($unit, $state) = each %{$activePrev}) { $baseName =~ s/\.[a-z]*$//; if (-e $prevUnitFile && ($state->{state} eq "active" || $state->{state} eq "activating")) { - if (! -e $newUnitFile) { + if (! -e $newUnitFile || abs_path($newUnitFile) eq "/dev/null") { push @unitsToStop, $unit; }