From 9050077cffa62e63e4d095e4f78c7ae41e2a59b0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B8rn=20Forsman?= Date: Fri, 1 Jul 2016 08:28:04 +0200 Subject: [PATCH] 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 /! --- nixos/modules/system/activation/switch-to-configuration.pl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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;