linuxkit/pkg/init/etc/inittab
Krister Johansen 16604bc039 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>
2018-06-11 08:29:08 -07:00

15 lines
448 B
Plaintext

# /etc/inittab
::sysinit:/bin/rc.init
# Stuff to do for the 3-finger salute
::ctrlaltdel:/bin/rc.shutdown reboot
# Stuff to do on shutdown
#
# 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