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 <krister.johansen@oracle.com>
This commit is contained in:
Krister Johansen 2018-06-11 08:29:08 -07:00
parent 154a5b3ea6
commit 16604bc039

View File

@ -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