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:
Eelco Dolstra 2016-02-03 14:58:18 +01:00
parent 1dce7c0b82
commit 42709fb4e9

View File

@ -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;