使用 busybox 经常会发现无法使用 ctrl+c 退出程序。
其表现为 init 文件的最后一行为 sh 的话在进入 sh 的时候会出现
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
网友评论