busybox 无法退出进程

使用 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

你可能感兴趣的:(busybox 无法退出进程)