/bin/sh: can't access tty; job control turned off
来源:互联网 发布:飞利浦电视软件升级 编辑:程序博客网 时间:2024/05/01 21:34
/bin/sh: can't access tty; job control turned off
问题
最近在做嵌入式文件系统时使用了如下的inittab文件:
#/etc/inittab
::sysinit:/etc/init.d/rcS
::respawn:-/bin/sh
s3c2410_serial0::askfirst:-/bin/sh
::ctrlaltdel:/sbin/reboot
::shutdown:/bin/umount -a -r
::sysinit:/etc/init.d/rcS
::respawn:-/bin/sh
s3c2410_serial0::askfirst:-/bin/sh
::ctrlaltdel:/sbin/reboot
::shutdown:/bin/umount -a -r
结果出现了:/bin/sh: can't access tty; job control turned off
分析
BusyBox通过系统控制台来做些工作, 如果我们的shell启动在 /dev/console(5,1)上, tty_io.c 函数open中noctty就被设置成1,导致这个问题,具体原因还不知道。总之要启动在一个真实的串口就没有关系。
Job control will be turned off since your shell can not obtain a controlling terminal. This typically happens when you run your shell on /dev/console. The kernel will not provide a controlling terminal on the /dev/console device. Your should run your shell on a normal tty such as tty1 or ttyS0 and everything will work perfectly. If you REALLY want your shell to run on /dev/console, then you can hack your kernel (if you are into that sortof thing) by changing drivers/char/tty_io.c to change the lines where it sets "noctty = 1;" to instead set it to "0". I recommend you instead run your shell on a real console...解决方法
可以通过BusyBox的init指定shell的设备, 注意, S3C2410上, 串口0是s3c2410_serial0。也就是说去掉::respawn:-/bin/sh就可以啦~~
串口名称
串口名称可以是s3c2410_serialx、ttySACx和ttySx等,但底层使用的是设备的主设备号和次设备号来定位具体设备的。所以不管是串口的名称是什么,只要主设备号和次设备号对了就可以。此外,通过mdev生成设备节点时,串口的名称是s3c2410_serialx。S3C2410的串口驱动文件drivers/serial/s3c2410.c中,有如下数据结构:static struct uart_driver s3c24xx_uart_drv = {.owner = THIS_MODULE,.dev_name = "s3c2410_serial",.nr = 3,.cons = S3C24XX_SERIAL_CONSOLE,.driver_name = S3C24XX_SERIAL_NAME,.major = S3C24XX_SERIAL_MAJOR, // 主设备号为204.minor = S3C24XX_SERIAL_MINOR, // 次设备号为64,这指第1个串口;第2个为65};通过这个结构体就可以确定串口设备的主设备号和次设备号。
- /bin/sh: can't access tty; job control turned off
- /bin/sh: can't access tty; job control turned off
- /bin/sh:can't access tty;job control turned off
- sh: can't access tty; job control turned off 解决方法
- 出现/bin/sh: can't access tty; job control turned off的解决方案
- 出现/bin/sh: can't access tty; job control turned off的解决方案
- busybox "sh: can't access tty; job control turned off" 问题的解决
- android系统移植报错:sh: can't access tty; job control turned off
- can't access tty,job control turned off
- 启动开发板,提示:can't access tty,job control turned off
- 开发板启动时,内核打印出"can't access tty,job control turned off"
- ESX4.0 host boot stops at the error: VSD mount/Bin/SH:cant access TTY job control turned off
- 问题:/bin/sh: can't access tty; job controlturned off 解决记录
- ctrl+c不能终止进程(busybox提示can't access tty.job control
- ctrl+c不能终止进程(busybox提示can't access tty.job control )
- ctrl+c不能终止进程(busybox提示can't access tty.job control
- 交互shell设置为/dev/console之后提示job control turned off(上)
- 交互shell设置为/dev/console之后提示job control turned off(中)
- Ogre 1.8 Release Candidate 1 (RC1)
- ORA-01045: user lacks CREATE SESSION privilege; logon denied,修改密码
- MyEclipse安装aptana插件的问题
- dede 用户笔名 去除 更改
- .net 关闭子页面,同时刷新父页面
- /bin/sh: can't access tty; job control turned off
- WatiN与QTP的选择
- Git 抓取远程分支后建立本地分支
- Introducing to The Study of Embeded Development from Ten Years Experiences
- .net 图片的二进制数据库存储和显示
- 在ubuntu12.04下build自己的openjdk
- 由“warning: no newline at end of file”引申而来
- no Qt version assigned to this project for platform Win32
- javascript系统函数详解