← Commit list

426aff88a

Denys Vlasenko
Denys Vlasenko
2018-09-22
SUCCESS Duration: 148s

Subject

init: hopefully fix "rebooting" in containers

Binary

No binary (build failed)

Architecture & Compiler Flags

Architecture: x86_64-linux-gnu Compiler: gcc (Ubuntu 11.4.0-1ubuntu1~22.04.3) 11.4.0

—

Build Log

(log yok)

Commit Diff GitHub →

init/init.c+7 -2
@@ -752,8 +752,13 @@ static void pause_and_low_level_reboot(unsigned magic)
reboot(magic);
_exit(EXIT_SUCCESS);
}
- while (1)
- sleep(1);
+ /* Used to have "while (1) sleep(1)" here.
+ * However, in containers reboot() call is ignored, and with that loop
+ * we would eternally sleep here - not what we want.
+ */
+ waitpid(pid, NULL, 0);
+ sleep(1); /* paranoia */
+ _exit(EXIT_SUCCESS);
}
static void run_shutdown_and_kill_processes(void)