kill -1 behaviour

Devin Bayer devin at freeshell.org
Thu Mar 9 16:33:20 UTC 2006


On Mar 9, 2006, at 4:39, Robin Farine wrote:

> On Thursday March 9 2006 10:33, Giuseppe Ciotta wrote:
>
>> So the point is that ash currently forks when executing builtins
>> (in this case, kill) and this causes the shell to receive the
>> signal?
>
> Whether you use the kill built-in or the kill applet, you should be
> able to prevent your shell to be killed by doing
>
> 	trap : 15
>
> before you send the TERM signal.

But if you are sending a SIGKILL signal I think the only way is by  
using the killall5 program.  It isn't included in busybox, but  
essentially it does:

i=0
while [ 0$i -lt 40000 ]; do
	echo killing group $i;
	[ $i -eq $$ ] || kill -$i
	i=$(( $i + 1 ));
done

So it kills all the process groups except the current one.

-- 
Devin Bayer



More information about the busybox mailing list