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

David Seikel onefang at gmail.com
Sun Dec 23 21:44:27 PST 2012


On Sun, 23 Dec 2012 23:25:46 -0600 Rob Landley <rob at landley.net> wrote:

> On 12/23/2012 08:45:07 PM, David Seikel wrote:
> > > > Like rm'ing something that does not exist, the end result is the
> > > > same, except for the useless error.
> 
> Using the host version on Ubuntu:
> 
>    $ rm doesnotexist
>    rm: cannot remove `doesnotexist': No such file or directory
> 
> You're thinking rm -f maybe?
> 
> > > >  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.
> 
> Using the host version in ubuntu:
> 
>    $ killall doesnotexist
>    doesnotexist: no process found
> 
> You're thinking killall -q maybe? Which toybox implements?
> 
>    ./toybox killall -q killall

Yes, the "killall killall" case that this thread is all about.

I'm just ranting against the fact that getting the end result you asked
for (the thing you are trying to delete does not exist, the thing you
are trying to kill is dead) is considered an error.  The state of
things is precisely how you wanted them to be, what's the point of
declaring that as an error condition?

It's just a rant, nothing more.  I know toybox will continue to stick to
the the standards.  I'm allowed to point out that I think the standards
are stupid some times.  I think it's particularly hilarious that the
only way to "successfully" remove something that does not exist is to
forcefully remove it.  Kinda like beating a dead horse, by nuking it
from orbit, the horse isn't any more dead.  lol

-- 
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/6dfeca6a/attachment-0002.sig>


More information about the Toybox mailing list