From 4466707ddf3476b07f157e198f6de554de0ec0c2 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Mon, 13 Apr 2015 12:28:12 +0200 Subject: [PATCH] switch-to-configuration: Better error checking --- nixos/modules/system/activation/switch-to-configuration.pl | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/nixos/modules/system/activation/switch-to-configuration.pl b/nixos/modules/system/activation/switch-to-configuration.pl index 7aa4b12a654..4289740322a 100644 --- a/nixos/modules/system/activation/switch-to-configuration.pl +++ b/nixos/modules/system/activation/switch-to-configuration.pl @@ -322,7 +322,9 @@ foreach my $device (keys %$prevSwaps) { # Should we have systemd re-exec itself? -my $restartSystemd = abs_path("/proc/1/exe") ne abs_path("@systemd@/lib/systemd/systemd"); +my $prevSystemd = abs_path("/proc/1/exe") or die; +my $newSystemd = abs_path("@systemd@/lib/systemd/systemd") or die; +my $restartSystemd = $prevSystemd ne $newSystemd; sub filterUnits {