[BusyBox] How can i run my shell on normal tty?

杨立峰 yanglifeng at powercn.com
Tue Jun 7 19:26:19 MDT 2005


Hi, guys. 
I keep getting "sh: can't access tty; job control turned off"? 
Why doesn't Control-C work within my shell? 
So, how can i run my shell on normal tty, such as tty1, ttyS0.

Do you have the good suggestion? Thank you!
 
 
About my environment:
 
ARM9, 
serial port, 
Linux-2.4.18, 
busybox-snapshot  01-Jun-2005
 
 
#cat initab
ttyS0::askfirst:/bin/sh </dev/ttyS0 >/dev/ttyS0 2>/dev/ttyS0 &
ttyS0::sysinit:/etc/rcS
::respawn:/sbin/getty -L ttyS0 115200 vt100
::respawn:/sbin/utelnetd
 
 
#cat rcS
mount -t devfs dev /dev
mount -t devpts /dev/pts

for i in 0 1 2 3
do
 mknod /dev/ttyp$i c 3 $i;
 mknod /dev/ptyp$i c 2 $i
done
mknod /dev/pty c 2 176
mknod /dev/ptya0 c 2 177
mknod /dev/tty c 5 0
mknod /dev/tty1 c 4 1
mknod /dev/tty2 c 4 2
mknod /dev/tty3 c 4 3
mknod /dev/tty4 c 4 4
mknod /dev/tty5 c 4 5
mknod /dev/tty6 c 4 6
mknod /dev/tty7 c 4 7
mknod /dev/tty8 c 4 8
chmod 666 /dev/tty*
chmod 666 /dev/pty*
# Mount the /proc file system
mount -t proc proc /proc
# turn on flushing of buffers etc
update
# make some writable bits of filesystem
echo "creating writable /tmp"
mount -t tmpfs -o size=1m none /tmp
insmod /drivers/cs89x0.o MAC=00:50:04:8B:04:10
insmod /drivers/dsp.o
mknod /dev/dsp c 254 0
insmod /drivers/cpld.o
mknod /dev/cpld c 253 0
insmod /drivers/flash.o
mknod /dev/flash c 252 0
insmod /drivers/watchdog.o
mknod /dev/watchdog c 251 0

insmod /drivers/hc_sl811.o
insmod /drivers/p80211.o
insmod /drivers/prism2_usb.o
/vowlan/bin/wlanctl wlan0 lnxreq_ifstate ifstate=enable
/vowlan/bin/wlanctl wlan0 lnxreq_autojoin ssid=powercomtest_11g authtype=opensystem
#ifconfig eth0 down
ifconfig wlan0 192.168.100.100

ifconfig wlan0 down
ifconfig eth0 192.168.0.6
ifconfig eth0 up
 
/vowlan/bin/route add default gw 192.168.100.1
/bin/busybox date 010100002005
ifconfig lo 127.0.0.1
cp /vowlan/bin/asc16 /tmp
cp /vowlan/bin/hzk16 /tmp
cp /vowlan/bin/wlanc /tmp
chmod +x /tmp/wlanc
#Add by ryan
#/bin/stty intr ^C kill ^U erase ^?

/vowlan/bin/voip
 
#end rcS
---------------------------------------------------------------
 
When the system start complete. I press CTRL-C to interrupt voip
Sometimes I can enter the system, and I can run  ps -a, but The system 
very quickly exit, and then no longer responded to, just display 
"Please press Enter to activate this console.", when I press ENTER.
The system can return to prompt.
 
 
The screen run as follow:
 
telnetd: starting
  port: 23; interface: any; login program: /bin/login
                                                                                
Please press Enter to activate this console.( I Press ENTER )
                                                                                
BusyBox v1.00 (2005.06.06-01:04+0000) Built-in shell (ash)
Enter 'help' for a list of built-in commands.
                                                                                
/bin/sh: can't access tty; job control turned off
/ # ps -a
  PID  Uid     VmSize Stat Command
    1 0           540 S   init
    2 0               SW  [keventd]
    3 0               SWN [ksoftirqd_CPU0]
    4 0               SW  [kswapd]
    5 0               SW  [bdflush]
    6 0               SW  [kupdated]
    7 0               SW  [khubd]
 1089 0           464 S   /sbin/utelnetd
 1100 0           760 S   /bin/login -- ps -a
 1101 0           676 S   /bin/sh
 1103 0           660 S   /bin/sh
 1105 0           660 S   /bin/sh
 1106 0           548 S   init
 1107 0           564 R   ps -a

/ # ls
Please press Enter to activate this console.( I press ENTER )
BusyBox v1.00 (2005.06.07-01:58+0000) Built-in shell (ash)
Enter 'help' for a list of built-in commands.
/bin/sh: can't access tty; job control turned off
/ #
Login timed out after 60 seconds.
Please press Enter to activate this console.( I press ENTER )
BusyBox v1.00 (2005.06.07-01:58+0000) Built-in shell (ash)
Enter 'help' for a list of built-in commands.
/bin/sh: can't access tty; job control turned off
/ #
(none) login:( press ENTER )
Please press Enter to activate this console.
BusyBox v1.00 (2005.06.07-01:58+0000) Built-in shell (ash)
Enter 'help' for a list of built-in commands.
/bin/sh: can't access tty; job control turned off
/ #
(none) login:( press ENTER )
(none) login:( press ENTER )
(none) login:( press ENTER )
(none) login:( press ENTER )
                .
                .
                .
 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/ms-tnef
Size: 12814 bytes
Desc: not available
Url : http://busybox.net/lists/busybox/attachments/20050608/fa9d5cef/attachment-0001.bin


More information about the busybox mailing list