<feed xmlns='http://www.w3.org/2005/Atom'>
<title>src/usr.bin/pkill/pkill.c, branch main</title>
<subtitle>FreeBSD source tree</subtitle>
<id>https://cgit-dev.freebsd.org/src/atom?h=main</id>
<link rel='self' href='https://cgit-dev.freebsd.org/src/atom?h=main'/>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/'/>
<updated>2008-08-31T14:27:59Z</updated>
<entry>
<title>pkill(1) first appeared in /usr/bin, but later it was moved to /bin</title>
<updated>2008-08-31T14:27:59Z</updated>
<author>
<name>Yaroslav Tykhiy</name>
<email>ytykhiy@gmail.com</email>
</author>
<published>2008-08-31T14:27:59Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=21be3b318337f81324d33fcdd361482058b9bafb'/>
<id>urn:sha1:21be3b318337f81324d33fcdd361482058b9bafb</id>
<content type='text'>
for the convenience of rc.d.  Now it has happily lived there for quite
a while.  So move the pkill(1) source files from usr.bin to bin, too.

Approved by:	gad
</content>
</entry>
<entry>
<title>Fix and extend the -j option to pkill/pgrep WRT the jail</title>
<updated>2006-11-23T11:55:17Z</updated>
<author>
<name>Yaroslav Tykhiy</name>
<email>ytykhiy@gmail.com</email>
</author>
<published>2006-11-23T11:55:17Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=a6afe5ada834e957bbb240dac940c329cc78f7a7'/>
<id>urn:sha1:a6afe5ada834e957bbb240dac940c329cc78f7a7</id>
<content type='text'>
wildcard specifications.  Earlier the only wildcard syntax
was "-j 0" for "any jail".  There were at least
two shortcomings in it:  First, jail ID 0 was abused; it
meant "no jail" in other utils, e.g., ps(1).  Second, it
was impossible to match processed not in jail, which could
be useful to rc.d developers.  Therefore a new syntax is
introduced: "-j any" means any jail while "-j none" means
out of jail.  The old syntax is preserved for compatibility,
but now it's deprecated because it's limited and confusing.

Update the respective regression tests.  While I'm here,
make the tests more complex but sensitive:  Start several
processes, some in jail and some out of jail, so we can
detect that only the right processes are killed by pkill
or matched by pgrep.

Reviewed by:	gad, pjd
MFC after:	1 week
</content>
</entry>
<entry>
<title>Sync as close as possible with NetBSD.</title>
<updated>2005-11-16T11:03:00Z</updated>
<author>
<name>Pawel Jakub Dawidek</name>
<email>pjd@FreeBSD.org</email>
</author>
<published>2005-11-16T11:03:00Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=53ff091d149bb93e887f04a353ce604772f69cf3'/>
<id>urn:sha1:53ff091d149bb93e887f04a353ce604772f69cf3</id>
<content type='text'>
This includes fixes and cleanups listed below:

- If a process dissappears while we are signalling it, don't count it as a
  match/error.
- Better handling of errors and messages.
- Downgrade failure to kill(2) (other than ESRCH) from fatal error to a
  warning; otherwise processing aborts and possibly matching killees would
  remain unsignalled. This makes pkill match the Solaris behavior.
- Exit with 2 on usage errors as documented.

Obtained from:	NetBSD
Glanced at by:	maintainer (gad) [a bit different version of this patch]
</content>
</entry>
<entry>
<title>I often find myself doing:</title>
<updated>2005-11-16T10:36:44Z</updated>
<author>
<name>Pawel Jakub Dawidek</name>
<email>pjd@FreeBSD.org</email>
</author>
<published>2005-11-16T10:36:44Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=b77640621bd5ac57b56ec983e86e5309eb4c9f5c'/>
<id>urn:sha1:b77640621bd5ac57b56ec983e86e5309eb4c9f5c</id>
<content type='text'>
	% pgrep &lt;something&gt; [to verify which processes match]
	% pkill &lt;something&gt;

To speed such operation up, add -I option which works like rm(1)'s -i
option (unfortunately -i is already used in pkill(1)), ie. pkill will
ask for confirmation before killing each matching process.

After adding -j, -F, -i, -S, -o and -L options and other improvements,
I think I can add myself to the copyright header.

Glanced at by:	maintainer (gad)
</content>
</entry>
<entry>
<title>Revert previous behaviour of '-F' option and add '-L' option, which will</title>
<updated>2005-08-25T20:10:47Z</updated>
<author>
<name>Pawel Jakub Dawidek</name>
<email>pjd@FreeBSD.org</email>
</author>
<published>2005-08-25T20:10:47Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=70ffddc463ac470d1b8fd9404e35ca39f791fed2'/>
<id>urn:sha1:70ffddc463ac470d1b8fd9404e35ca39f791fed2</id>
<content type='text'>
tell pkill(1)/pgrep(1) to try to flock(2) pidfile before reading PID from
there.

Discussed with:	jhb, gad
</content>
</entry>
<entry>
<title>Modify '-F' option to work nicely with pidfile(3) - a pidfile given as</title>
<updated>2005-08-24T19:38:28Z</updated>
<author>
<name>Pawel Jakub Dawidek</name>
<email>pjd@FreeBSD.org</email>
</author>
<published>2005-08-24T19:38:28Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=712bf6af1640d84212b3b34f65e7ebcab0cd206d'/>
<id>urn:sha1:712bf6af1640d84212b3b34f65e7ebcab0cd206d</id>
<content type='text'>
an argument has to be locked.
</content>
</entry>
<entry>
<title>Whitespace fixes.</title>
<updated>2005-03-20T11:47:44Z</updated>
<author>
<name>Pawel Jakub Dawidek</name>
<email>pjd@FreeBSD.org</email>
</author>
<published>2005-03-20T11:47:44Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=d0cf19a1611c9359fbb0e31152ff49a0faa9c5f6'/>
<id>urn:sha1:d0cf19a1611c9359fbb0e31152ff49a0faa9c5f6</id>
<content type='text'>
</content>
</entry>
<entry>
<title>- Introduce an '-o' option which allows to match oldest of the matching</title>
<updated>2005-03-20T11:42:26Z</updated>
<author>
<name>Pawel Jakub Dawidek</name>
<email>pjd@FreeBSD.org</email>
</author>
<published>2005-03-20T11:42:26Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=0a5f326cd24818e9660f381fc30bc1689edc2839'/>
<id>urn:sha1:0a5f326cd24818e9660f381fc30bc1689edc2839</id>
<content type='text'>
  processes.
  This option can be also found in Solaris and Linux.
- Use timercmp(9) macro for timeval comparsion.
- Include time.h directly, don't depend on stat.h doing it for us.

Reviewed by:	gad (first point)
MFC after:	3 days
</content>
</entry>
<entry>
<title>- Introduce '-S' option which allows to match system processes (pgrep only).</title>
<updated>2005-03-20T11:30:26Z</updated>
<author>
<name>Pawel Jakub Dawidek</name>
<email>pjd@FreeBSD.org</email>
</author>
<published>2005-03-20T11:30:26Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=d054f5d7cd96b0b19dcdcd3d268ac711b56ed19a'/>
<id>urn:sha1:d054f5d7cd96b0b19dcdcd3d268ac711b56ed19a</id>
<content type='text'>
- Rename IS_KERNPROC() macro to PSKIP() and extend its functionality.
  Now it'll skip calling process and system processes when -S is not given.
  As a side effect it fixes '-n' option. Before it was always matching
  calling process (because of missing 'if (kp-&gt;ki_pid == mypid)' check)
  and after that, calling process was ignored.
- When '-l' option is given and there are no arguments, use p_comm as an
  arguments list (this is helpful for kernel threads matching).

Reviewed by:	gad
MFC after:	3 days
</content>
</entry>
<entry>
<title>Add a -i option to ignore case in the process match.</title>
<updated>2005-03-20T11:12:13Z</updated>
<author>
<name>Pawel Jakub Dawidek</name>
<email>pjd@FreeBSD.org</email>
</author>
<published>2005-03-20T11:12:13Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=46a4b46cd753114e515e0ffbeb18fee6564e3cfa'/>
<id>urn:sha1:46a4b46cd753114e515e0ffbeb18fee6564e3cfa</id>
<content type='text'>
Obtained from:	NetBSD
Reviewed by:	gad
MFC after:	3 days
</content>
</entry>
</feed>
