[BusyBox] ash signal trapping

Hiroshi Ito ito at mlb.co.jp
Mon Nov 1 07:47:01 UTC 2004


Hello,

From: "Peter V. Saveliev" <peet at peet.spb.ru>
Subject: [BusyBox] ash signal trapping
Date: Sun, 31 Oct 2004 15:01:06 +0300
> 8<--------------------------------------------------------------------
> /tmp $ cat ./bala 
> #!/bin/sh
> 
> echo bala
> /tmp $ trap ./bala 2
> /tmp $    <------------- pressing Ctrl-C doesn't cause "bala" to display
> /tmp $    <------------- pressing Ctrl-C doesn't cause "bala" to display
> 8<--------------------------------------------------------------------
> 
> The problem is that I cannot interrupt programs like "vmstat" or "ifstat" by
> pressing Ctrl-C. I login via busybox' telnetd, if it can affect.

could you send result of "stty -a" ?
and, does "stty intr ^C" fix your problem ?
( ^C is character '^' and 'C' )

I don't know exactly, but I will explain what I think.

ash's command line editing function disbales termio's interupt character
and ^C is treated as special case. ( ^C is command of jump to next
line and if need to generate SIGINT, generate it (I'm not sure, but maybe) )

So, if the terminal's interupt character is not a ^C and ash is
invoked as interactive shell, trap command does not work well.
--------
Hiroshi Ito
Media Lab. Inc.,
URL http://www.mlb.co.jp ( Sorry, Japanese only. )
TEL +81-3-5294-7255  FAX +81-3-5294-7256



More information about the busybox mailing list