about summary refs log tree commit diff
path: root/nixos
diff options
context:
space:
mode:
authorEelco Dolstra <eelco.dolstra@logicblox.com>2016-02-03 14:58:18 +0100
committerEelco Dolstra <eelco.dolstra@logicblox.com>2016-02-03 15:01:18 +0100
commit42709fb4e994df64bce606afe46d38c3d93142b4 (patch)
tree4868565ec2849da6922e2dac70eb392dbf99ce72 /nixos
parent1dce7c0b82ff3d02ab2bdfef917d1dc47bb63399 (diff)
downloadnixlib-42709fb4e994df64bce606afe46d38c3d93142b4.tar
nixlib-42709fb4e994df64bce606afe46d38c3d93142b4.tar.gz
nixlib-42709fb4e994df64bce606afe46d38c3d93142b4.tar.bz2
nixlib-42709fb4e994df64bce606afe46d38c3d93142b4.tar.lz
nixlib-42709fb4e994df64bce606afe46d38c3d93142b4.tar.xz
nixlib-42709fb4e994df64bce606afe46d38c3d93142b4.tar.zst
nixlib-42709fb4e994df64bce606afe46d38c3d93142b4.zip
switch-to-configuration: Handle failure to read /proc/1/exe
It's not entirely clear why this happens, but sometimes /proc/1/exe
returns a bogus value, like
/ar3a3j6b9livhy5fcfv69izslhgk4gcz-systemd-217/lib/systemd/systemd. In
any case, we can just conservatively assume that we need to restart
systemd when this happens.

Fixes #10261.
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 655fbab2a843..d9048427801f 100644
--- a/nixos/modules/system/activation/switch-to-configuration.pl
+++ b/nixos/modules/system/activation/switch-to-configuration.pl
@@ -323,7 +323,7 @@ foreach my $device (keys %$prevSwaps) {
 
 
 # Should we have systemd re-exec itself?
-my $prevSystemd = abs_path("/proc/1/exe") or die;
+my $prevSystemd = abs_path("/proc/1/exe") // "/unknown";
 my $newSystemd = abs_path("@systemd@/lib/systemd/systemd") or die;
 my $restartSystemd = $prevSystemd ne $newSystemd;