summaryrefslogtreecommitdiffstats
path: root/usr.bin/pkill
Commit message (Collapse)AuthorAgeFilesLines
* Tell in a comment that the symlinks from /usr/bin areyar2006-08-201-0/+5
| | | | | | for compatibility with other OS types, too. Pointed out by: gad
* Install pkill(1), aka pgrep(1), to /bin so that rc scriptsyar2006-08-191-0/+5
| | | | | | | | | | | | 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)
* -mdoc sweep.ru2005-11-181-1/+1
|
* Sync as close as possible with NetBSD.pjd2005-11-161-92/+115
| | | | | | | | | | | | | | | 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]
* I often find myself doing:pjd2005-11-162-15/+45
| | | | | | | | | | | | | | % 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)
* Revert previous behaviour of '-F' option and add '-L' option, which willpjd2005-08-252-27/+43
| | | | | | | tell pkill(1)/pgrep(1) to try to flock(2) pidfile before reading PID from there. Discussed with: jhb, gad
* Modify '-F' option to work nicely with pidfile(3) - a pidfile given aspjd2005-08-242-0/+22
| | | | an argument has to be locked.
* Markup and wording fixes.ru2005-06-141-1/+1
| | | | Approved by: re (blanket)
* Whitespace fixes.pjd2005-03-202-7/+6
|
* - Introduce an '-o' option which allows to match oldest of the matchingpjd2005-03-202-14/+33
| | | | | | | | | | 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
* - Introduce '-S' option which allows to match system processes (pgrep only).pjd2005-03-202-21/+21
| | | | | | | | | | | | | - 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
* Sort options properly.pjd2005-03-201-4/+4
| | | | | Reviewed by: gad MFC after: 3 days
* Add a -i option to ignore case in the process match.pjd2005-03-202-6/+12
| | | | | | Obtained from: NetBSD Reviewed by: gad MFC after: 3 days
* Add and document '-F' option which allows to use file where PID is storedpjd2005-03-202-4/+53
| | | | | | | for matching. Reviewed by: gad MFC after: 3 days
* Add and document '-j' option which allows to match processes based on itspjd2005-03-202-4/+30
| | | | | | | jail ID. Reviewed by: gad MFC after: 3 days
* If a user or group is not known, report the problem user/group, rather thandelphij2005-03-031-3/+3
| | | | | | | | | 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)
* Removed bitrot.ru2004-11-132-16/+1
|
* Document the fact that matching against a process command-name willgad2004-08-161-0/+16
| | | | | | only work on the first MAXCOMLEN (19) characters of that name. Noticed by: Peter Holm
* Don't forget the arguments for -M and -N in the DESCRIPTION section.stefanf2004-07-181-2/+2
|
* Respect locale settings from the environment.tjr2004-07-151-0/+3
|
* Second half of the dev_t cleanup.phk2004-06-171-1/+1
| | | | | | | | | | | 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.
* Added pgrep to the SYNOPSIS.ru2004-05-191-14/+21
| | | | | Fixed SYNOPSIS. Fixed markup nits.
* Use KERN_PROC_PROC instead of KERN_PROC_ALL on the call to kvm_getprocs(),gad2004-03-301-1/+5
| | | | | | so we get one line per process instead of one for each kernel-thread. Noticed by: ache & tjr
* bde also tells me that he is confident that P_SYSTEM will not workgad2004-03-271-8/+1
| | | | | 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.
* Some style(9)-ish improvements, courtesy of bde.gad2004-03-271-6/+6
| | | | Noticed by: bde
* Remove the _PATH_DEVNULL setting for "swapf". From the kvm_open(3)gad2004-03-261-3/+3
| | | | | | man page: The swapfile argument is currently unused. Noticed by: ru
* Remove the NEED_KMEM support meant for FreeBSD 3.x. This base-systemgad2004-03-261-9/+1
| | | | | | version isn't going to be committed to that branch... Noticed by: des
* Switch to checking P_KTHREAD instead of P_SYSTEM when deciding whatgad2004-03-261-3/+10
| | | | | | "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.
* Avoid the manpage layering violation and low-level implementationru2004-03-261-3/+2
| | | | | details of libkvm, and just tell what the getbootfile(3) function will return, by using the text from netstat(1) and dmesg(8).
* Correct the description of options -N and -M to match reality.ru2004-03-261-4/+4
|
* Apply style.Makefile(5).ru2004-03-261-6/+4
|
* Send those -Debug messages to stderr, not stdout...gad2004-03-261-2/+2
|
* Add a debugging option, as I don't understand something that I'm seeing.gad2004-03-261-2/+18
| | | | (this is a probably temporary option, and is not to be documented)
* Remove a redundant check against mypid (the check is done later, ingad2004-03-261-1/+1
| | | | | | the "Take the appropriate action" section). Obtained from: the sysutils/pkill port
* Add a cast to get this to compile with WARNS=5 on sparc64. This isgad2004-03-262-2/+3
| | | | | | 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.
* Fixes so this will compile with WARNS=5 on i386.gad2004-03-261-19/+22
|
* Fix two cosmetic style(9) issues.gad2004-03-251-2/+2
|
* Add a comment for when these utilities were added to FreeBSD, and addgad2004-03-251-0/+3
| | | | a cross-reference to killall(1).
* Add `-M' and `-N' options to `pkill' and `pgrep', similar togad2004-03-252-6/+35
| | | | | | | | | | | | 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
* Use the correct type for some casts, thus avoiding a few warning messagesgad2004-03-251-4/+4
| | | | | | | when compiling with WARNS=3 Written by: Mario Sergio Fujikawa Ferreira <lioux@FreeBSD.org> Obtained from: the sysutils/pkill port
* Change some routine and variable names to match the FreeBSD system.gad2004-03-252-35/+55
| | | | | Written by: Mario Sergio Fujikawa Ferreira <lioux@FreeBSD.org> Obtained from: the sysutils/pkill port
* Add the `pkill' and `pgrep' commands from NetBSD. This is the sourcegad2004-03-253-0/+752
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)
OpenPOWER on IntegriCloud