busybox 無法退出進(jìn)程

使用 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
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時請結(jié)合常識與多方信息審慎甄別。
平臺聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點,簡書系信息發(fā)布平臺,僅提供信息存儲服務(wù)。

相關(guān)閱讀更多精彩內(nèi)容

友情鏈接更多精彩內(nèi)容