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
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容