[Toybox] [PATCH] newtoy: kill

Rob Landley rob at landley.net
Mon Feb 27 09:38:55 PST 2012


On 02/27/2012 05:03 AM, Daniel Walter wrote:
> On Sun, Feb 26, 2012 at 01:48:39PM -0600, Rob Landley wrote:
>> Ok, it's not a case sensitivity issue, and it's not a "scan for known
>> -signal names first" issue. I actually _do_ have to teach lib/args.c
>> about strings that _must_ be a separate argument.
>>
>> Sigh. I'll check in what I have, and then I need to fix this...
>>
>> Rob
> hi,
> 
> yeah, all this stuff were my main reason not to use lib/args ;)

I fixed it!  (Took some doing...)

I'd much rather take the time to do it _right_, I'm just trying not to
block you guys. :)

> did you try how it all behaves if you try to do something like this
> 
> kill -HUP -1140 -1141 4490
> or 
> kill -9 -1

Um, in _theory_ it should work since the negative entries are passed
along to the system call and "man 2 kill" says it implements all the
right behavior. Haven't tried, though.

I need to make a test suite entry for this.  ("kill -stop 12345" was
_subtle_.)

This is where "unshare" comes in handy, for the test suite. Especially
when I get around to testing mount and such, which requires root access.
 (Oh, and I wrote a suid wrapper for id that tests real vs effective,
but that also requires root access _and_ is a dangerous binary to leave
lying around.  Not sure how to automate that test yet...)

I suspect need to do a minimal lxc for toybox. (90% of what it does is
combine "unshare" with an init binary, and then set up a unix domain
socket to provide /dev/console. There's some magic to move ethernet
interfaces into and out of the container, too, but it's really not that
big. Whole thing shouldn't be more than 1000 lines of C or I'm doing it
wrong.)

Not a priority just now, though.

> both are perfectly legal, but I had no chance to get them working with
> lib/args

I spent a reasonable chunk of Sunday on that.  Had to upgrade lib/args.c
to do it...

Rob



More information about the Toybox mailing list