ash: Can't access tty problems (initramfs)

David Daney ddaney at
Thu May 17 17:05:30 PDT 2007

Hamish Moffatt wrote:
> On Fri, May 18, 2007 at 01:28:00AM +0200, Denis Vlasenko wrote:
>> On Thursday 17 May 2007 18:28, Dallas Clement wrote:
>>> I'm getting the infamous "Can't access tty; job control turned off"
>>> message when I try to invoke the ash shell during my initial bootup.
>>> I'm using busybox 1.5.0.  I also understand that ash requires a
>>> controlling tty rather than the console.  Though, I don't understand all
>>> the reasons.
>>> If I don't define a console however, I get a kernel panic from
>>> initramfs.
>> Boot with init=/bin/ash, and you will get "Can't access tty" message.
>> That's because fd# 0,1,2 are opened to /dev/console.
>> Now execute this in ash:
>> # exec /bin/ash </dev/tty1 >/dev/tty1 2>&1
>> This one will work ok, because fds are opened to /dev/tty0,
>> which can be a controlling tty.
>> Basically that's it. If you want ctty, open some device different from
>> /dev/console
> I got the controlling tty errors as a result of the following in
> inittab:
> ::askfirst:-/bin/sh
> Do you mean that this is wrong? (According to the documentation, it is an
> implicit rule if inittab is missing.)

It is incorrect.  You should use something like this:


That will open the shell on a device that can be a controlling tty 

David Daney

More information about the busybox mailing list