[BusyBox] Ctrl-C doesn't works

Jamie Guinan guinan at bluebutton.com
Thu May 6 15:25:33 UTC 2004


On Thu, 6 May 2004, Michael Pfeiffer wrote:

> Hi @ all,
> 
> currently I'm using BusyBox v1.00-pre8. There Ctrl-C doesn't works, so it 
> is impossible to break any program with it. In some older archives I found 
> the infomration that may be possible when busybox is running somehow with 
> pid 1. But thats not the case here.
> 
> So what could be the reason for this problem?

I had the same issue, I'm running Busybox's /sbin/init with this
inittab:

  ::sysinit:/etc/rcS
  ::respawn:-/bin/sh

my default shell is "ash", and I only have a serial console (no network,
no ssh).  The problem(?) was that neither init nor ash assumed "control"
of the tty.  There is code to do this in init.c, but it is under test,

  if (a->action & (SYSINIT | WAIT | CTRLALTDEL | SHUTDOWN | RESTART)) {

which is false for RESPAWN.

I hacked ash.c as below, which works for my purposes, but probably
isn't the right solution.

-Jamie

--- a/ash.c     14 Apr 2004 17:51:31 -0000      1.97
+++ b/ash.c     6 May 2004 14:51:30 -0000
@@ -6487,6 +6487,9 @@
                if (fd < 0)
                        goto out;
                fcntl(fd, F_SETFD, FD_CLOEXEC);
+
+               ioctl(0, TIOCSCTTY, 1);                 /* Hack. */
+
                do { /* while we are in the background */
                        if ((pgrp = tcgetpgrp(fd)) < 0) {
 out:





More information about the busybox mailing list