From 56b4b841ae45c9fb512096852d06410e7ebe45d2 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Mon, 28 Apr 2014 08:28:44 +0200 Subject: [PATCH] switch-to-configuration: Use old systemctl to stop units Otherwise, when switching from systemd 203 to 212, you get errors like: Failed to stop remote-fs.target: Bad message Failed to stop systemd-udevd-control.socket: Bad message ... --- nixos/modules/system/activation/switch-to-configuration.pl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/nixos/modules/system/activation/switch-to-configuration.pl b/nixos/modules/system/activation/switch-to-configuration.pl index 7c2d64d2e1a1..7bce06cf3b5a 100644 --- a/nixos/modules/system/activation/switch-to-configuration.pl +++ b/nixos/modules/system/activation/switch-to-configuration.pl @@ -65,7 +65,7 @@ $SIG{PIPE} = "IGNORE"; sub getActiveUnits { # FIXME: use D-Bus or whatever to query this, since parsing the # output of list-units is likely to break. - my $lines = `LANG= @systemd@/bin/systemctl list-units --full --no-legend`; + my $lines = `LANG= systemctl list-units --full --no-legend`; my $res = {}; foreach my $line (split '\n', $lines) { chomp $line; @@ -297,7 +297,7 @@ foreach my $device (keys %$prevSwaps) { if (scalar @unitsToStop > 0) { @unitsToStop = unique(@unitsToStop); print STDERR "stopping the following units: ", join(", ", sort(@unitsToStop)), "\n"; - system("@systemd@/bin/systemctl", "stop", "--", @unitsToStop); # FIXME: ignore errors? + system("systemctl", "stop", "--", @unitsToStop); # FIXME: ignore errors? } print STDERR "NOT restarting the following units: ", join(", ", sort(@unitsToSkip)), "\n"