使用 busybox 經(jīng)常會發(fā)現(xiàn)無法使用 ctrl+c 退出程序。
其表現(xiàn)為 init 文件的最后一行為 sh 的話在進(jìn)入 sh 的時候會出現(xiàn)
busybox "sh: can't access tty; job control turned off"
One common problem reported on the mailing list is the "can't
access tty; job control turned off" error message, which typically
appears when one tries to use a shell with stdin/stdout on
/dev/console.
This device is special - it cannot be a controlling tty.
因此可以使用 cttyhack 解決這個問題。
解決方法:
把以下加入到 init 文件中
mknod -m 666 /dev/ttyS0 c 4 64
setsid /bin/cttyhack /bin/sh