summary refs log tree commit diff
path: root/nixos/modules
diff options
context:
space:
mode:
authorEelco Dolstra <eelco.dolstra@logicblox.com>2014-04-28 08:28:44 +0200
committerEelco Dolstra <eelco.dolstra@logicblox.com>2014-04-28 08:28:44 +0200
commit56b4b841ae45c9fb512096852d06410e7ebe45d2 (patch)
treec93d6a0f1a9119f37ac54601f7699ac52a95e4af /nixos/modules
parent6eaced35820f4c575dd545fb721abd74f248c8cb (diff)
downloadnixlib-56b4b841ae45c9fb512096852d06410e7ebe45d2.tar
nixlib-56b4b841ae45c9fb512096852d06410e7ebe45d2.tar.gz
nixlib-56b4b841ae45c9fb512096852d06410e7ebe45d2.tar.bz2
nixlib-56b4b841ae45c9fb512096852d06410e7ebe45d2.tar.lz
nixlib-56b4b841ae45c9fb512096852d06410e7ebe45d2.tar.xz
nixlib-56b4b841ae45c9fb512096852d06410e7ebe45d2.tar.zst
nixlib-56b4b841ae45c9fb512096852d06410e7ebe45d2.zip
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
  ...
Diffstat (limited to 'nixos/modules')
-rw-r--r--nixos/modules/system/activation/switch-to-configuration.pl4
1 files 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"