mirror of
https://github.com/ilyakooo0/nixpkgs.git
synced 2024-12-26 04:43:09 +03:00
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.
This commit is contained in:
parent
1dce7c0b82
commit
42709fb4e9
@ -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;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user