From 16604bc039835e2c607ef8480dba9199f70f53a8 Mon Sep 17 00:00:00 2001 From: Krister Johansen Date: Mon, 11 Jun 2018 08:29:08 -0700 Subject: [PATCH] Reboot should reboot instead of powering off. When busybox's reboot processing occurs in init, it runs all SHUTDOWN actions that are defined in inittab. Once those are complete, it will trigger either a halt, poweroff, or reboot, depending upon what signal is received. The mechanism that's used to shell out through inittab does not allow us to pass through exactly which invocation was requested. Due to the way that rc.shutdown works, it invokes the poweroff action for any and all SHUTDOWN callbacks, whether they're a reboot, poweroff, or halt. Instead of handling the reboot(2) syscall in rc.shutdown, return after killing and unmounting and let busybox's init process decide which reboot(2) action to use. Signed-off-by: Krister Johansen --- pkg/init/etc/inittab | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/pkg/init/etc/inittab b/pkg/init/etc/inittab index 1c4e4bfb4..5957ee059 100644 --- a/pkg/init/etc/inittab +++ b/pkg/init/etc/inittab @@ -6,4 +6,9 @@ ::ctrlaltdel:/bin/rc.shutdown reboot # Stuff to do on shutdown -::shutdown:/bin/rc.shutdown poweroff +# +# Use 'noop' so that rc.shutdown does not attempt to invoke its own shutdown +# actions. Instead, it will return after it invokes sync/umount. This lets +# init decide which shutdown action to run. (So that it's possible to correctly +# handle halt, reboot, or poweroff) +::shutdown:/bin/rc.shutdown noop