From 4cf0b03b976dd7050595f835092b551623468dbe Mon Sep 17 00:00:00 2001 From: Michal Schmidt Date: Wed, 30 Sep 2015 15:12:19 +0200 Subject: core: change how crash_shell and crash_reboot interact Instead of freezing in PID1 and letting the forked child freeze or reboot when exec("/bin/sh") fails, just wait for the child's exit and then do the freeze_or_reboot in PID1 as usual. This means that when both crash_shell and crash_reboot are enabled, the system will reboot after the shell exits. --- src/core/main.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'src/core/main.c') diff --git a/src/core/main.c b/src/core/main.c index 2fa96901c7..13fa78fed8 100644 --- a/src/core/main.c +++ b/src/core/main.c @@ -231,11 +231,10 @@ noreturn static void crash(int sig) { (void) execle("/bin/sh", "/bin/sh", NULL, environ); log_emergency_errno(errno, "execle() failed: %m"); - freeze_or_reboot(); _exit(EXIT_FAILURE); } else { log_info("Spawned crash shell as PID "PID_FMT".", pid); - freeze(); + (void) wait_for_terminate(pid, NULL); } } -- cgit v1.2.3-54-g00ecf