From: Zbigniew Jędrzejewski-Szmek Date: Sun, 29 Jan 2017 02:18:31 +0000 (-0500) Subject: systemctl: always avoid being killed when doing switch-root X-Git-Tag: v233~196^2~3 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=b3ad0ff48c154ed056a6bded2adac609395a9439;p=thirdparty%2Fsystemd.git systemctl: always avoid being killed when doing switch-root The same logic as described in acc28e2e3037d689d6481e applies to any time we are switching root, to just set the flag unconditionally. --- diff --git a/src/systemctl/systemctl.c b/src/systemctl/systemctl.c index 41e8d6075a2..6eed921ecf5 100644 --- a/src/systemctl/systemctl.c +++ b/src/systemctl/systemctl.c @@ -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)