setsid cttyhack ash

JoSH Lehan krellan at gmail.com
Thu Dec 27 19:47:55 PST 2007


Saw the earlier thread in the mailing list archives about this, and
was having the same problem too.
A shell opened, as part of the /etc/init.d/rc.S file, wouldn't have a
controlling tty.

This command seemed to fix it for me, though:

setsid cttyhack ash

This makes the ash error about job control go away, and "echo Hi >
/dev/tty" now works.

Is this the recommended approach, or is there a better way?

I like this approach because it doesn't rely on a specific terminal
device, such as /dev/tty1.
In my case, sometimes console may be on a serial port instead
(/dev/ttyS0), and my script can't tell this at runtime, so it's good
to have a command that will work for both.

Josh


More information about the busybox mailing list