From f3fafd8099bd579aa922337c6a3f5a413d69fd50 Mon Sep 17 00:00:00 2001 From: Craig Small Date: Sun, 25 Mar 2001 07:13:02 +0000 Subject: [PATCH] remove debug message, put -# back in killall --- ChangeLog | 6 ++++++ configure.in | 2 +- doc/killall.1 | 43 ++++++++++++++++++++++++++----------------- src/killall.c | 8 ++++++-- 4 files changed, 39 insertions(+), 20 deletions(-) diff --git a/ChangeLog b/ChangeLog index ef87d2b..4b76879 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +Changes in 20.1 +=============== + - command line - put back in. + - got rid of annoying "sending signal #" debug message + - updated killall.1 + Changes from 19 to 20 (14-DEC-2000) =================================== - New maintainer diff --git a/configure.in b/configure.in index bc57d3d..049d78b 100644 --- a/configure.in +++ b/configure.in @@ -1,7 +1,7 @@ dnl Process this file with autoconf to produce a configure script. AC_INIT(src/comm.h) AM_CONFIG_HEADER(config.h) -AM_INIT_AUTOMAKE(psmisc,20) +AM_INIT_AUTOMAKE(psmisc,20.1) dnl Checks for programs. AC_PROG_CC diff --git a/doc/killall.1 b/doc/killall.1 index edaa2b2..c11799f 100644 --- a/doc/killall.1 +++ b/doc/killall.1 @@ -1,18 +1,26 @@ -.TH KILLALL 1 "Sep 7, 1999" "Linux" "User Commands" +.TH KILLALL 1 "March 25, 2001" "Linux" "User Commands" .SH NAME killall \- kill processes by name .SH SYNOPSIS .ad l .B killall -.RB [ \-egiqvw ] -.RB [ \-\fIsignal\fB ] +.RB [ \-e , --exact ] +.RB [ \-g , \-\-process-group ] +.RB [ \-i , \-\-interactive ] +.RB [ \-q , \-\-quiet ] +.RB [ \-v , \-\-verbose ] +.RB [ \-w , \-\-wait ] +.RB [ \-V, \-\-version ] +.RB [ \-s , \-\-signal +.IR signal ] +.RB [ \-\- ] .I name ... .br .B killall .RB \-l .br .B killall -.RB \-V +.RB \-V, \-\-version .ad b .SH DESCRIPTION .B killall @@ -20,8 +28,7 @@ sends a signal to all processes running any of the specified commands. If no signal name is specified, SIGTERM is sent. .PP Signals can be specified either by name (e.g. \fB\-HUP\fP) or by number -(e.g. \fB\-1\fP). Signal 0 (check if a process exists) can only be specified -by number. +(e.g. \fB\-1\fP). .PP If the command name contains a slash (\fB/\fP), processes executing that particular file will be selected for killing, independent of their name. @@ -33,28 +40,28 @@ each command, \fBkillall\fP returns zero. A \fBkillall\fP process never kills itself (but may kill other \fBkillall\fP processes). .SH OPTIONS -.IP \fB\-e\fP +.IP "\fB\-e\fP, \fB\-\-exact\fP" Require an exact match for very long names. If a command name is longer than 15 characters, the full name may be unavailable (i.e. it is swapped out). In this case, \fBkillall\fP will kill everything that matches within the first 15 characters. With \fB\-e\fP, such entries are skipped. \fBkillall\fP prints a message for each skipped entry if \fB\-v\fP is specified in addition to \fB\-e\fP, -.IP \fB\-g\fP +.IP "\fB\-g\fP, \fB\-\-process-group\fP" Kill the process group to which the process belongs. The kill signal is only sent once per group, even if multiple processes belonging to the same process group were found. -.IP \fB\-i\fP +.IP "\fB\-i\fP, \fB\-\-interactive\fP" Interactively ask for confirmation before killing. -.IP \fB\-l\fP +.IP "\fB\-l\fP, \fB\-\-list\fP" List all known signal names. -.IP \fB\-q\fP +.IP "\fB\-q\fP, \fB\-\-quiet\fP" Do not complain if no processes were killed. -.IP \fB\-v\fP +.IP "\fB\-v\fP, \fB\-\-verbose\fP" Report if the signal was successfully sent. -.IP \fB\-V\fP +.IP "\fB\-V\fP, \fB\-\-version\fP" Display version information. -.IP \fB\-w\fP +.IP "\fB\-w\fP, \fB\-\-wait\fP" Wait for all killed processes to die. \fBkillall\fP checks once per second if any of the killed processes still exist and only returns if none are left. Note that \fBkillall\fP may wait forever if the signal was ignored, had no @@ -73,8 +80,10 @@ user. .PP \fBkillall \-w\fP doesn't detect if a process disappears and is replaced by a new process with the same PID between scans. -.SH AUTHOR -Werner Almesberger +.SH AUTHORS +Werner Almesberger wrote the original version +of psmisc. Since version 20 Craig Small +can be blamed. .SH "SEE ALSO" -kill(1), fuser(1), pidof(1), ps(1), kill(2) +kill(1), fuser(1), pgrep(1), pidof(1), ps(1), kill(2) .\"{{{}}} diff --git a/src/killall.c b/src/killall.c index e4c4321..74b8bbb 100644 --- a/src/killall.c +++ b/src/killall.c @@ -348,6 +348,7 @@ main (int argc, char **argv) int sig_num; int optc; int myoptind; + int optsig = 0; struct option options[] = { {"exact", 0, NULL, 'e'}, @@ -356,7 +357,7 @@ main (int argc, char **argv) {"list-signals", 0, NULL, 'l'}, {"quiet", 0, NULL, 'q'}, {"signal", 1, NULL, 's'}, - {"verbose", 0, NULL, 's'}, + {"verbose", 0, NULL, 'v'}, {"wait", 0, NULL, 'w'}, {"version", 0, NULL, 'V'}, {0,0,0,0 }}; @@ -416,6 +417,9 @@ main (int argc, char **argv) * is upper case */ if (argv[optind-1][1] >= 'A' && argv[optind-1][1] <= 'Z') sig_num = get_signal (argv[optind-1]+1, "killall"); + /* Might also be a -## signal too */ + if (argv[optind-1][1] >= '0' && argv[optind-1][1] <= '9') + sig_num = atoi(argv[optind-1]+1); break; } } @@ -438,6 +442,6 @@ main (int argc, char **argv) exit (1); } argv = argv + myoptind; - printf("sending signal %d to procs\n", sig_num); + /*printf("sending signal %d to procs\n", sig_num);*/ return kill_all (sig_num, argc - myoptind, argv ); } -- 2.40.0