[Toybox] Fix, killall is not allowed to kill itself

David Seikel onefang at gmail.com
Sun Dec 23 18:45:07 PST 2012


On Mon, 17 Dec 2012 02:57:39 -0600 Rob Landley <rob at landley.net> wrote:

> On 12/16/2012 11:31:49 AM, David Seikel wrote:
> > On Sun, 16 Dec 2012 16:54:24 +0100 Elie De Brauwer
> > <eliedebrauwer at gmail.com> wrote:
> > 
> > > The LSB specification of killall says "A killall process never
> > > kills itself (but may kill other killall processes)."
> > >
> > > The current implementation of killall does not adhere to this
> > > rule, with the patch in attach killall will adhere to this rule.
> > >
> > > Before:
> > > edb at lapedb:~/edb-stuff/toybox/toybox$ ./toybox killall -9 toybox
> > > Killed
> > >
> > > After:
> > > edb at lapedb:~/edb-stuff/toybox/toybox$ ./toybox killall -9 toybox
> > > killall: No such process
> > 
> > It's 3AM and way past my bed time, but after it's run out of things
> > to kill, it just kills itself.  Seems pointless to not allow
> > suicide on something that will just suicide anyway, but I need
> > sleep.
> > 
> > Like rm'ing something that does not exist, the end result is the
> > same, except for the useless error.  The thing does not exist,
> > killall is no longer running.  The error message is superfluous, as
> > the result you wanted is exactly what you get.
> 
> I think the objection is that PIDs aren't monotonic (the PID
> namespace wraps), so if you kill things in increasing PID order this
> killall instance isn't guaranteed to be last so it won't necessarily
> kill everything it should.

A valid objection for not killing yourself until you are done killing
everyone else.  No excuse for an error message though, once killall is
done, the requested task is accomplished, that's not an error, that's
success.

-- 
A big old stinking pile of genius that no one wants
coz there are too many silver coated monkeys in the world.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: not available
URL: <http://lists.landley.net/pipermail/toybox-landley.net/attachments/20121224/139c1ff2/attachment-0002.sig>


More information about the Toybox mailing list