History log of /freebsd-10.0-release/bin/pkill/
Revision Date Author Comments
(<<< Hide modified files)
(Show modified files >>>)
259065 07-Dec-2013 gjb

- Copy stable/10 (r259064) to releng/10.0 as part of the
10.0-RELEASE cycle.
- Update __FreeBSD_version [1]
- Set branch name to -RC1

[1] 10.0-CURRENT __FreeBSD_version value ended at '55', so
start releng/10.0 at '100' so the branch is started with
a value ending in zero.

Approved by: re (implicit)
Sponsored by: The FreeBSD Foundation

256281 10-Oct-2013 gjb

Copy head (r256279) to stable/10 as part of the 10.0-RELEASE cycle.

Approved by: re (implicit)
Sponsored by: The FreeBSD Foundation


256050 04-Oct-2013 trasz

Remove useless check - ki_loginclass is an array; can't be NULL.

CID: 1006559
Approved by: re (kib)
MFC after: 2 weeks
Sponsored by: FreeBSD Foundation


254134 09-Aug-2013 trasz

Add -c flag to pgrep(1) and pkill(1), to match login classes.

MFC after: 1 month


218285 04-Feb-2011 jilles

Make sys_signame upper case.

This matches the constants from <signal.h> with 'SIG' removed, which POSIX
requires kill and trap to accept and 'kill -l' to write.

'kill -l', 'trap', 'trap -l' output is now upper case.

In Turkish locales, signal names with an upper case 'I' are now accepted,
while signal names with a lower case 'i' are no longer accepted, and the
output of 'killall -l' now contains proper capital 'I' without dot instead
of a dotted capital 'I'.


209924 12-Jul-2010 brian

Add -l to the synopsis

Submitted by: jhell at dataix dot net
MFC after: 3 days


209363 20-Jun-2010 brian

Recognise the -l switch with pkill - list kill command(s) used.

PR: 143558
Submitted by: eitanadlerlist at gmail dot com
MFC after: 3 weeks


204553 02-Mar-2010 joel

The NetBSD Foundation has granted permission to remove clause 3 and 4 from
their software.

Approved by: pjd
Obtained from: NetBSD


203802 12-Feb-2010 pjd

- Implement -q option for pgrep(1).
- Add regression test to test -q option.


203688 08-Feb-2010 brucec

Initialize the execfile argument to NULL instead of _PATH_DEVNULL. This allows the -M option to be used without specifying -N.

PR: bin/138146
Approved by: rrs (mentor)
MFC after: 3 days


202532 17-Jan-2010 ed

Raise WARNS for various tools where possible.

Submitted by: Marius NĂ¼nnerich <marius@nuenneri.ch>


201487 04-Jan-2010 obrien

Committed the wrong version in r201484. This time really fix the "-t"
functionality. Per the regression tests (pgrep-t.t & pkill-t.t), "-t"
should accept "v1", which means a plain number should be accepted for
UNIX98-style PTY's.


201484 04-Jan-2010 obrien

Fix the "-t" functionality. Per the regression tests (pgrep-t.t & pkill-t.t),
"-t" should accept "v1", which means a plain number should be accepted for
UNIX98-style PTY's.


201145 28-Dec-2009 antoine

(S)LIST_HEAD_INITIALIZER takes a (S)LIST_HEAD as an argument.
Fix some wrong usages.
Note: this does not affect generated binaries as this argument is not used.

PR: 137213
Submitted by: Eygene Ryabinkin (initial version)
MFC after: 1 month


192242 17-May-2009 brian

When finding processes, ignore ourself and our ancestors. It is almost
always surprising when you kill a 'sh -c ...' ancestor or when you kill
yourself when using -f.

Add a -a switch for backwards compatibility.

MFC after: 3 weeks


183502 30-Sep-2008 ed

Improve the `pkill -t' handling, which I changed in my previous commit.

In my previous commit I disabled pkill(1)'s automatic prepending of the
"tty" string when `pkill -t' was being used. Re-enable it and stat()
both possible device names when called.

Requested by: jhb, rwatson (MFC)
MFC after: 1 month


183438 28-Sep-2008 ed

Don't automatically prepend the "tty" prefix to `pkill -t' arguments.

Because we now enforce UNIX98-style PTY's, we now use a lot of TTY's
that don't have the traditional /dev/ttyXX naming scheme. pkill(1)'s -t
flag automatically prepended the word "tty" to each TTY that was passed
on the command line. This meant that `pkill -t pts/0' was actually
converted to /dev/ttypts/0. Disable this broken behaviour for now.

Reported by: erwin


182543 31-Aug-2008 yar

pkill(1) first appeared in /usr/bin, but later it was moved to /bin
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


165382 20-Dec-2006 ru

Be more accurate in the description of the -I option:
signaling to a process doesn't necessarily kill it.


164558 23-Nov-2006 yar

Fix and extend the -j option to pkill/pgrep WRT the jail
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


161463 20-Aug-2006 yar

Tell in a comment that the symlinks from /usr/bin are
for compatibility with other OS types, too.

Pointed out by: gad


161458 19-Aug-2006 yar

Install pkill(1), aka pgrep(1), to /bin so that rc scripts
can use this small and nifty utility. Create compatibility
symlinks from /usr/bin for the time being to avoid breaking
custom scripts relying on the hardcoded path to the utility.

If pkill(1) takes root, its source should be repocopied some
day to src/bin.

Idea by: des
Discussed with: brooks (in cvs-src and cvs-all)


152568 18-Nov-2005 ru

-mdoc sweep.


152521 16-Nov-2005 pjd

Sync as close as possible with NetBSD.
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]


152518 16-Nov-2005 pjd

I often find myself doing:

% pgrep <something> [to verify which processes match]
% pkill <something>

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)


149471 25-Aug-2005 pjd

Revert previous behaviour of '-F' option and add '-L' option, which will
tell pkill(1)/pgrep(1) to try to flock(2) pidfile before reading PID from
there.

Discussed with: jhb, gad


149435 24-Aug-2005 pjd

Modify '-F' option to work nicely with pidfile(3) - a pidfile given as
an argument has to be locked.


147370 14-Jun-2005 ru

Markup and wording fixes.

Approved by: re (blanket)


143879 20-Mar-2005 pjd

Whitespace fixes.


143878 20-Mar-2005 pjd

- Introduce an '-o' option which allows to match oldest of the matching
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


143877 20-Mar-2005 pjd

- Introduce '-S' option which allows to match system processes (pgrep only).
- 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->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


143876 20-Mar-2005 pjd

Sort options properly.

Reviewed by: gad
MFC after: 3 days


143875 20-Mar-2005 pjd

Add a -i option to ignore case in the process match.

Obtained from: NetBSD
Reviewed by: gad
MFC after: 3 days


143874 20-Mar-2005 pjd

Add and document '-F' option which allows to use file where PID is stored
for matching.

Reviewed by: gad
MFC after: 3 days


143873 20-Mar-2005 pjd

Add and document '-j' option which allows to match processes based on its
jail ID.

Reviewed by: gad
MFC after: 3 days


143079 03-Mar-2005 delphij

If a user or group is not known, report the problem user/group, rather than
the first user/group. Caused huge fun in error messages from large script.
Old: pgrep -u root,NoSuchUser,daemon -> pgrep: unknown user `root'
Now: pgrep -u root,NoSuchUser,daemon -> pgrep: unknown user `NoSuchUser'

Obtained from: NetBSD (rev. 1.8)
MFC After: 1 week (if re@ would have approved this)


137670 13-Nov-2004 ru

Removed bitrot.


133804 16-Aug-2004 gad

Document the fact that matching against a process command-name will
only work on the first MAXCOMLEN (19) characters of that name.

Noticed by: Peter Holm


132370 18-Jul-2004 stefanf

Don't forget the arguments for -M and -N in the DESCRIPTION section.


132198 15-Jul-2004 tjr

Respect locale settings from the environment.


130640 17-Jun-2004 phk

Second half of the dev_t cleanup.

The big lines are:
NODEV -> NULL
NOUDEV -> NODEV
udev_t -> dev_t
udev2dev() -> findcdev()

Various minor adjustments including handling of userland access to kernel
space struct cdev etc.


129438 19-May-2004 ru

Added pgrep to the SYNOPSIS.
Fixed SYNOPSIS.
Fixed markup nits.


127622 30-Mar-2004 gad

Use KERN_PROC_PROC instead of KERN_PROC_ALL on the call to kvm_getprocs(),
so we get one line per process instead of one for each kernel-thread.

Noticed by: ache & tjr


127472 27-Mar-2004 gad

bde also tells me that he is confident that P_SYSTEM will not work
any better on 4.x than it does on 5.2. If that's true then there
is no point to the __FreeBSD_version check that I had added.


127470 27-Mar-2004 gad

Some style(9)-ish improvements, courtesy of bde.

Noticed by: bde


127462 26-Mar-2004 gad

Remove the _PATH_DEVNULL setting for "swapf". From the kvm_open(3)
man page: The swapfile argument is currently unused.

Noticed by: ru


127457 26-Mar-2004 gad

Remove the NEED_KMEM support meant for FreeBSD 3.x. This base-system
version isn't going to be committed to that branch...

Noticed by: des


127456 26-Mar-2004 gad

Switch to checking P_KTHREAD instead of P_SYSTEM when deciding what
"system processes" to always ignore. Based on my testing with `-D',
I am pretty sure this is what we want for 5.x-current. If my thinking
is wrong, this also makes it easier to switch to a different check.


127445 26-Mar-2004 ru

Avoid the manpage layering violation and low-level implementation
details of libkvm, and just tell what the getbootfile(3) function
will return, by using the text from netstat(1) and dmesg(8).


127444 26-Mar-2004 ru

Correct the description of options -N and -M to match reality.


127437 26-Mar-2004 ru

Apply style.Makefile(5).


127434 26-Mar-2004 gad

Send those -Debug messages to stderr, not stdout...


127433 26-Mar-2004 gad

Add a debugging option, as I don't understand something that I'm seeing.
(this is a probably temporary option, and is not to be documented)


127432 26-Mar-2004 gad

Remove a redundant check against mypid (the check is done later, in
the "Take the appropriate action" section).

Obtained from: the sysutils/pkill port


127431 26-Mar-2004 gad

Add a cast to get this to compile with WARNS=5 on sparc64. This is
needed because off_t == __int64_t, while size_t == __uint64_t. This
also compiles with WARNS=5 on amd64, but I haven't tested the other
platforms yet.


127430 26-Mar-2004 gad

Fixes so this will compile with WARNS=5 on i386.


127429 25-Mar-2004 gad

Fix two cosmetic style(9) issues.


127428 25-Mar-2004 gad

Add a comment for when these utilities were added to FreeBSD, and add
a cross-reference to killall(1).


127427 25-Mar-2004 gad

Add `-M' and `-N' options to `pkill' and `pgrep', similar to
what are supported in `ps':

-M Extract values associated with the name list from the
specified core instead of the default /dev/kmem.
-N Extract the name list from the specified system instead
of the default /kernel.

Written by: Mario Sergio Fujikawa Ferreira <lioux@FreeBSD.org>
Obtained from: the sysutils/pkill port


127426 25-Mar-2004 gad

Use the correct type for some casts, thus avoiding a few warning messages
when compiling with WARNS=3

Written by: Mario Sergio Fujikawa Ferreira <lioux@FreeBSD.org>
Obtained from: the sysutils/pkill port


127425 25-Mar-2004 gad

Change some routine and variable names to match the FreeBSD system.

Written by: Mario Sergio Fujikawa Ferreira <lioux@FreeBSD.org>
Obtained from: the sysutils/pkill port


127412 25-Mar-2004 gad

Add the `pkill' and `pgrep' commands from NetBSD. This is the source
straight from NetBSD (except to add the RCS-ID lines for FreeBSD).
These will probably require a few updates before they are added to
the FreeBSD buildworld. I might MFC these to 4.x-stable after 4.10.

Discussed on: freebsd-arch
Obtained from: NetBSD (and OpenBSD also has these)