3
0
Fork 0
forked from mirrors/nixpkgs

Making the stage2 'debug2' spawn a shell with job control, like in stage1, running it in a

virtual terminal and not in the console. This brings wonderful things like ^C.


svn path=/nixos/trunk/; revision=33001
This commit is contained in:
Lluís Batlle i Rossell 2012-03-11 22:01:46 +00:00
parent bbebba68f7
commit 331b1f46d3

View file

@ -170,8 +170,19 @@ export MODULE_DIR=@kernel@/lib/modules/
# For debugging Upstart.
if [ -n "$debug2" ]; then
# Get the console from the kernel cmdline
console=tty1
for o in $(cat /proc/cmdline); do
case $o in
console=*)
set -- $(IFS==; echo $o)
console=$2
;;
esac
done
echo "Debug shell called from @out@"
@shell@
setsid @shell@ < /dev/$console >/dev/$console 2>/dev/console
fi