[BusyBox] follow up: how to get ^C to actually break a running process

Robert P. J. Day rpjday at mindspring.com
Fri Feb 6 13:18:02 UTC 2004


  (by mistake, i responded to erik personally rather than to the list,
so i thought i'd follow up here for the benefit of anyone else who might
run into this.)

  the scenario here is that, when we boot our test board, we use as
part of the boot line:

  console=ttyS0,9600 ...

the critical line from /etc/inittab for starting our initial shell
is:

  ::respawn:-/bin/sh

which, as erik pointed out, causes the shell to run associated with
/dev/console and therefore won't handle job control properly; see:

  http://www.uclibc.org/FAQ.html#job_control

since we're using devfs at the moment, i checked and noticed that
we get the device file /dev/tts/0, so as a bit of a hack, i'm sure,
i just started another shell with:

  # sh < /dev/tts/0 > /dev/tts/0

and "tty" confirms that the new shell is associated with that tty
port, and job control now seems to work fine.

  but i'm sure there's a cleaner way to do this.  what exactly
should i put in /etc/inittab to get this effect?  i'm sure it
shouldn't be as ugly as the quick fix i use above, should it?
(even though that seems to work.)

rday







More information about the busybox mailing list