1995-06-25 18:08:27 +00:00
|
|
|
.\" Copyright (C) 1995 by Joerg Wunsch, Dresden
|
|
|
|
.\" All rights reserved.
|
|
|
|
.\"
|
|
|
|
.\" Redistribution and use in source and binary forms, with or without
|
|
|
|
.\" modification, are permitted provided that the following conditions
|
|
|
|
.\" are met:
|
|
|
|
.\" 1. Redistributions of source code must retain the above copyright
|
|
|
|
.\" notice, this list of conditions and the following disclaimer.
|
|
|
|
.\" 2. Redistributions in binary form must reproduce the above copyright
|
|
|
|
.\" notice, this list of conditions and the following disclaimer in the
|
|
|
|
.\" documentation and/or other materials provided with the distribution.
|
|
|
|
.\"
|
|
|
|
.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR(S) ``AS IS'' AND ANY EXPRESS
|
|
|
|
.\" OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
|
|
|
.\" WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
|
|
|
.\" DISCLAIMED. IN NO EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY DIRECT,
|
|
|
|
.\" INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
|
|
|
.\" (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
|
|
|
.\" SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
|
|
|
.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
|
|
|
|
.\" STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
|
|
|
|
.\" IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
|
|
|
.\" POSSIBILITY OF SUCH DAMAGE.
|
|
|
|
.\"
|
1999-08-28 01:08:13 +00:00
|
|
|
.\" $FreeBSD$
|
1995-06-25 18:08:27 +00:00
|
|
|
.\"
|
2004-05-18 20:45:32 +00:00
|
|
|
.Dd January 26, 2004
|
2001-07-10 14:16:33 +00:00
|
|
|
.Os
|
1995-06-25 18:08:27 +00:00
|
|
|
.Dt KILLALL 1
|
|
|
|
.Sh NAME
|
|
|
|
.Nm killall
|
|
|
|
.Nd kill processes by name
|
|
|
|
.Sh SYNOPSIS
|
2000-11-20 19:21:22 +00:00
|
|
|
.Nm
|
2004-01-26 11:11:36 +00:00
|
|
|
.Op Fl delmsvz
|
1995-06-25 18:08:27 +00:00
|
|
|
.Op Fl help
|
2003-04-09 03:04:12 +00:00
|
|
|
.Op Fl j Ar jid
|
2000-08-28 22:09:38 +00:00
|
|
|
.Op Fl u Ar user
|
|
|
|
.Op Fl t Ar tty
|
|
|
|
.Op Fl c Ar procname
|
1995-06-25 18:08:27 +00:00
|
|
|
.Op Fl SIGNAL
|
2000-08-28 22:09:38 +00:00
|
|
|
.Op Ar procname ...
|
1995-06-25 18:08:27 +00:00
|
|
|
.Sh DESCRIPTION
|
2002-04-20 12:18:28 +00:00
|
|
|
The
|
|
|
|
.Nm
|
|
|
|
utility kills processes selected by name, as opposed to the selection by pid
|
1995-06-25 18:08:27 +00:00
|
|
|
as done by
|
|
|
|
.Xr kill 1 .
|
|
|
|
By default, it will send a
|
|
|
|
.Dv TERM
|
2001-11-30 00:30:28 +00:00
|
|
|
signal to all processes with a real UID identical to the
|
1995-06-25 18:08:27 +00:00
|
|
|
caller of
|
|
|
|
.Nm
|
|
|
|
that match the name
|
|
|
|
.Ar procname .
|
|
|
|
The super-user is allowed to kill any process.
|
|
|
|
.Pp
|
|
|
|
The options are as follows:
|
|
|
|
.Bl -tag -width 10n -offset indent
|
2000-12-19 16:00:12 +00:00
|
|
|
.It Fl d | v
|
2004-07-02 22:22:35 +00:00
|
|
|
Be more verbose about what will be done.
|
|
|
|
For a single
|
1995-06-25 18:08:27 +00:00
|
|
|
.Fl d
|
|
|
|
option, a list of the processes that will be sent the signal will be
|
|
|
|
printed, or a message indicating that no matching processes have been
|
2000-08-28 22:09:38 +00:00
|
|
|
found.
|
2004-01-26 11:11:36 +00:00
|
|
|
.It Fl e
|
2004-05-18 20:45:32 +00:00
|
|
|
Use the effective user ID instead of the (default) real user ID for matching
|
2004-01-26 11:11:36 +00:00
|
|
|
processes specified with the
|
|
|
|
.Fl u
|
|
|
|
option.
|
1995-06-25 18:08:27 +00:00
|
|
|
.It Fl help
|
|
|
|
Give a help on the command usage and exit.
|
|
|
|
.It Fl l
|
|
|
|
List the names of the available signals and exit, like in
|
|
|
|
.Xr kill 1 .
|
|
|
|
.It Fl m
|
|
|
|
Match the argument
|
|
|
|
.Ar procname
|
2004-01-18 17:51:34 +00:00
|
|
|
as a (case sensitive) regular expression against the names
|
2000-08-28 22:09:38 +00:00
|
|
|
of processes found.
|
2004-07-02 22:22:35 +00:00
|
|
|
CAUTION!
|
|
|
|
This is dangerous, a single dot will match any process
|
2001-11-30 00:30:28 +00:00
|
|
|
running under the real UID of the caller.
|
1995-06-25 18:08:27 +00:00
|
|
|
.It Fl s
|
1997-11-01 15:06:40 +00:00
|
|
|
Show only what would be done, but do not send any signal.
|
1995-06-25 18:08:27 +00:00
|
|
|
.It Fl SIGNAL
|
|
|
|
Send a different signal instead of the default
|
|
|
|
.Dv TERM .
|
|
|
|
The signal may be specified either as a name
|
2001-08-07 15:48:51 +00:00
|
|
|
(with or without a leading
|
|
|
|
.Dv SIG ) ,
|
1995-06-25 18:08:27 +00:00
|
|
|
or numerically.
|
2003-04-09 03:04:12 +00:00
|
|
|
.It Fl j Ar jid
|
|
|
|
Kill processes in the jail specified by
|
|
|
|
.Ar jid .
|
2000-08-28 22:09:38 +00:00
|
|
|
.It Fl u Ar user
|
|
|
|
Limit potentially matching processes to those belonging to
|
|
|
|
the specified
|
|
|
|
.Ar user .
|
2001-01-21 01:07:26 +00:00
|
|
|
.It Fl t Ar tty
|
2001-07-15 08:06:20 +00:00
|
|
|
Limit potentially matching processes to those running on
|
2000-08-28 22:09:38 +00:00
|
|
|
the specified
|
|
|
|
.Ar tty .
|
|
|
|
.It Fl c Ar procname
|
|
|
|
When used with the
|
|
|
|
.Fl u
|
|
|
|
or
|
|
|
|
.Fl t
|
|
|
|
flags, limit potentially matching processes to those matching
|
|
|
|
the specified
|
2002-07-15 11:33:30 +00:00
|
|
|
.Ar procname .
|
2002-04-14 22:25:57 +00:00
|
|
|
.It Fl z
|
2002-05-29 18:53:22 +00:00
|
|
|
Do not skip zombies.
|
2002-04-14 22:25:57 +00:00
|
|
|
This should not have any effect except to print a few error messages
|
|
|
|
if there are zombie processes that match the specified pattern.
|
1995-06-25 18:08:27 +00:00
|
|
|
.El
|
1996-02-03 22:52:27 +00:00
|
|
|
.Sh ALL PROCESSES
|
2001-07-15 08:06:20 +00:00
|
|
|
Sending a signal to all processes with uid
|
2002-04-20 12:18:28 +00:00
|
|
|
.Em XYZ
|
1996-02-03 22:52:27 +00:00
|
|
|
is already supported by
|
2001-07-15 08:06:20 +00:00
|
|
|
.Xr kill 1 .
|
|
|
|
So use
|
1996-02-03 22:52:27 +00:00
|
|
|
.Xr kill 1
|
2004-07-02 22:22:35 +00:00
|
|
|
for this job (e.g.\& $ kill -TERM -1 or
|
1996-02-03 22:52:27 +00:00
|
|
|
as root $ echo kill -TERM -1 | su -m <user>)
|
1995-06-25 18:08:27 +00:00
|
|
|
.Sh DIAGNOSTICS
|
|
|
|
The
|
|
|
|
.Nm
|
|
|
|
command will respond with a short usage message and exit with a status
|
2004-07-02 22:22:35 +00:00
|
|
|
of 2 in case of a command error.
|
|
|
|
A status of 1 will be returned if
|
1995-06-25 18:08:27 +00:00
|
|
|
either no matching process has been found or not all processes have
|
2004-07-02 22:22:35 +00:00
|
|
|
been signalled successfully.
|
|
|
|
Otherwise, a status of 0 will be
|
1995-06-25 18:08:27 +00:00
|
|
|
returned.
|
|
|
|
.Pp
|
|
|
|
Diagnostic messages will only be printed if requested by
|
|
|
|
.Fl d
|
|
|
|
options.
|
|
|
|
.Sh SEE ALSO
|
|
|
|
.Xr kill 1 ,
|
2004-03-27 23:45:33 +00:00
|
|
|
.Xr pkill 1 ,
|
2003-04-09 03:04:12 +00:00
|
|
|
.Xr sysctl 3 ,
|
|
|
|
.Xr jail 8
|
1995-06-25 18:08:27 +00:00
|
|
|
.Sh HISTORY
|
|
|
|
The
|
|
|
|
.Nm
|
1996-08-23 00:57:08 +00:00
|
|
|
command appeared in
|
|
|
|
.Fx 2.1 .
|
|
|
|
It has been modeled after the
|
1995-06-25 18:08:27 +00:00
|
|
|
.Nm
|
|
|
|
command as available on other platforms.
|
1998-03-23 07:48:45 +00:00
|
|
|
.Sh AUTHORS
|
2000-11-22 09:35:58 +00:00
|
|
|
.An -nosplit
|
2000-08-28 22:09:38 +00:00
|
|
|
The
|
|
|
|
.Nm
|
|
|
|
program was originally written in Perl and was contributed by
|
1998-03-23 07:48:45 +00:00
|
|
|
.An Wolfram Schneider ,
|
|
|
|
this manual page has been written by
|
2000-11-10 17:46:15 +00:00
|
|
|
.An J\(:org Wunsch .
|
2000-08-28 22:09:38 +00:00
|
|
|
The current version of
|
|
|
|
.Nm
|
2000-11-10 17:46:15 +00:00
|
|
|
was rewritten in C by
|
|
|
|
.An Peter Wemm
|
|
|
|
using
|
2000-08-28 22:09:38 +00:00
|
|
|
.Xr sysctl 3 .
|