cvs commit: src/usr.bin/pkill pkill.c

Pawel Jakub Dawidek pjd at FreeBSD.org
Wed Nov 16 11:59:28 GMT 2005


On Wed, Nov 16, 2005 at 02:24:19PM +0300, Andrey Chernov wrote:
+> On Wed, Nov 16, 2005 at 11:03:00AM +0000, Pawel Jakub Dawidek wrote:
+> >   - If a process dissappears while we are signalling it, don't count it as a
+> >     match/error.
+> 
+> I don't understand "match" part here, but can say something about "error" 
+> part: while it looks reasonable, it is wrong direction move. What about 
+> special signals handling? TSTP, HUP, USR1, etc? It should be restricted to 
+> KILL signal only, since it can't be trapped. Ever ILL should produce some 
+> warning when process dissappears, since usually dumps core.

Not sure if I understand, but I'll at least try to explain the change.

Let's say you call 'pkill sleep'. First it creates list of the matching
processes and when the list is done, it starts killing processes from
the list. When there is a race, so that process was inserted into the
list, but disappeared before killing, pkill(1) will quit with an error.
Which is bogus: there were 8 sleep processes, the 5th one disappeared,
so first 4 was killed, last 3 are still alive and pkill(1) returned an
error.

-- 
Pawel Jakub Dawidek                       http://www.wheel.pl
pjd at FreeBSD.org                           http://www.FreeBSD.org
FreeBSD committer                         Am I Evil? Yes, I Am!
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 187 bytes
Desc: not available
Url : http://lists.freebsd.org/pipermail/cvs-src/attachments/20051116/2d26a063/attachment.bin


More information about the cvs-src mailing list