Show the shutdown sequence on the active virtual terminal
authorMichel Stam <m.stam@fugro.nl>
Mon, 13 Oct 2014 14:14:35 +0000 (16:14 +0200)
committerJohn Crispin <blogic@openwrt.org>
Sun, 12 Oct 2014 11:24:11 +0000 (13:24 +0200)
commit8b27adcf7516fa89ced66c840cfb085f2b6067af
treec0e651faa5faa51e989f153361ed280704a36bd9
parent79872ea6ca5867631c1ec5405721af12bea818b2
Show the shutdown sequence on the active virtual terminal

procd by default writes to /dev/console. When rebooting, this means that the
terminal on which the reboot sequence was started will not see what is going
on. This patch fixes that by reopening stdin, stdout and stderr to the console
device specified on the commandline, /dev/tty0 or /dev/console upon reboot.

Also, due to (probably) pivot-root, /proc/1/fd shows 1-3 pointing to
/console. This patch also fixes that.

Signed-off-by: Michel Stam <m.stam@fugro.nl>
state.c