systemctl: always avoid being killed when doing switch-root

The same logic as described in acc28e2e30 applies to any time we are
switching root, to just set the flag unconditionally.
This commit is contained in:
Zbigniew Jędrzejewski-Szmek
2017-01-31 01:34:40 -05:00
parent 3ab2feefd7
commit b3ad0ff48c
+3 -5
View File
@@ -5655,11 +5655,9 @@ static int switch_root(int argc, char *argv[], void *userdata) {
}
/* Instruct PID1 to exclude us from its killing spree applied during
* the transition from the initrd to the main system otherwise we would
* exit with a failure status even though the switch to the new root
* has succeed. */
if (in_initrd())
argv_cmdline[0] = '@';
* the transition. Otherwise we would exit with a failure status even
* though the switch to the new root has succeed. */
argv_cmdline[0] = '@';
r = acquire_bus(BUS_MANAGER, &bus);
if (r < 0)