summary refs log tree commit diff
path: root/nixos
diff options
context:
space:
mode:
authorBjørn Forsman <bjorn.forsman@gmail.com>2016-07-01 08:28:04 +0200
committerBjørn Forsman <bjorn.forsman@gmail.com>2016-07-01 08:35:38 +0200
commit9050077cffa62e63e4d095e4f78c7ae41e2a59b0 (patch)
treebe9868dc3cad821bb03a53b8be3311976e0f27a8 /nixos
parent17e8032adb9b6ad8558594a19f6d13461d275b45 (diff)
downloadnixpkgs-9050077cffa62e63e4d095e4f78c7ae41e2a59b0.tar
nixpkgs-9050077cffa62e63e4d095e4f78c7ae41e2a59b0.tar.gz
nixpkgs-9050077cffa62e63e4d095e4f78c7ae41e2a59b0.tar.bz2
nixpkgs-9050077cffa62e63e4d095e4f78c7ae41e2a59b0.tar.lz
nixpkgs-9050077cffa62e63e4d095e4f78c7ae41e2a59b0.tar.xz
nixpkgs-9050077cffa62e63e4d095e4f78c7ae41e2a59b0.tar.zst
nixpkgs-9050077cffa62e63e4d095e4f78c7ae41e2a59b0.zip
switch-to-configuration: use absolute path to systemd-escape
Fixes issue when upgrading from very old NixOS systems that don't have
systemd-escape in $PATH:

  $ sudo nixos-rebuild switch
  ...
  building the system configuration...
  updating GRUB 2 menu...
  Can't exec "systemd-escape": No such file or directory at /nix/var/nix/profiles/system/bin/switch-to-configuration line 264.
  Unable to escape /!
Diffstat (limited to 'nixos')
-rw-r--r--nixos/modules/system/activation/switch-to-configuration.pl2
1 files changed, 1 insertions, 1 deletions
diff --git a/nixos/modules/system/activation/switch-to-configuration.pl b/nixos/modules/system/activation/switch-to-configuration.pl
index 093b7f1ff22..bb97d0c53a6 100644
--- a/nixos/modules/system/activation/switch-to-configuration.pl
+++ b/nixos/modules/system/activation/switch-to-configuration.pl
@@ -261,7 +261,7 @@ while (my ($unit, $state) = each %{$activePrev}) {
 
 sub pathToUnitName {
     my ($path) = @_;
-    open my $cmd, "-|", "systemd-escape", "--suffix=mount", "-p", $path
+    open my $cmd, "-|", "@systemd@/bin/systemd-escape", "--suffix=mount", "-p", $path
         or die "Unable to escape $path!\n";
     my $escaped = join "", <$cmd>;
     chomp $escaped;