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.

+1 -1
+1 -1
nixos/modules/system/activation/switch-to-configuration.pl
··· 323 324 325 # Should we have systemd re-exec itself? 326 - my $prevSystemd = abs_path("/proc/1/exe") or die; 327 my $newSystemd = abs_path("@systemd@/lib/systemd/systemd") or die; 328 my $restartSystemd = $prevSystemd ne $newSystemd; 329
··· 323 324 325 # Should we have systemd re-exec itself? 326 + my $prevSystemd = abs_path("/proc/1/exe") // "/unknown"; 327 my $newSystemd = abs_path("@systemd@/lib/systemd/systemd") or die; 328 my $restartSystemd = $prevSystemd ne $newSystemd; 329