kill -1 behaviour

Giuseppe Ciotta giuseppe at
Wed Mar 8 13:38:36 UTC 2006


I have basically to kill all system processes (except init) and
execute a pivot_root followed by a chroot into a new filesystem.  I've
disabled /bin/kill in favour of the ash builtin of the same
name. Note: I'm running an interactive ash.

Trying to kill all processes with ``kill -TERM -1'' kills the current
shell too, this is annoying since i cannot continue with pivot_root
and chroot.  Reading the kill(2) manual found on my debian
installation, i see:

¨POSIX 1003.1-2001 requires that kill(-1,sig) send sig to all processes
that the current process may send signals to, except possibly for some
implementation-defined system processes.  Linux allows a process to
signal itself, but on Linux the call kill(-1,sig) does not signal the
current process."

Then i assume there's something wrong in the specification or in the
kill(2) implementation, since kill(-1,sig) seems to signal the current
process which actually sent the signal.

Am I missing something out of the picture?

P.S.: init tricked me for a while into thinking ash was not receiving
the signal, but it was simply a respawn put into inittab creating a
new shell when the current ended. Well, then it's more correct to say
it was me tricking myself...

Giuseppe Ciotta
(string 99 105 97 111)

More information about the busybox mailing list