From: Craig Small Date: Sat, 5 May 2018 22:02:35 +0000 (+1000) Subject: killall: use all namespaces by default X-Git-Tag: v23.2~17 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=38829585c4f5b67c8c2a8cbdf86761a72ace43f6;p=psmisc killall: use all namespaces by default This is similar to the revert in procps where namespace filtering is added but by default it uses all of them. The issue is most people expect to see/kill all processes and the namespace filtering causes confusion, especially around ssh related processes. --- diff --git a/ChangeLog b/ChangeLog index bea60d5..5c7cc6b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,6 @@ +Changes in 23.2 +=============== + * killall: look at all namespaces by default Changes in 23.1 =============== * killall: Remove debug output Debian: #864753 diff --git a/doc/killall.1 b/doc/killall.1 index 37238f3..50d2a52 100644 --- a/doc/killall.1 +++ b/doc/killall.1 @@ -1,12 +1,12 @@ .\" .\" Copyright 1993-2002 Werner Almesberger -.\" 2002-2017 Craig Small +.\" 2002-2018 Craig Small .\" This program is free software; you can redistribute it and/or modify .\" it under the terms of the GNU General Public License as published by .\" the Free Software Foundation; either version 2 of the License, or .\" (at your option) any later version. .\" -.TH KILLALL 1 "2017-06-12" "psmisc" "User Commands" +.TH KILLALL 1 "2018-05-06" "psmisc" "User Commands" .SH NAME killall \- kill processes by name .SH SYNOPSIS @@ -101,8 +101,8 @@ Interactively ask for confirmation before killing. .IP "\fB\-l\fP, \fB\-\-list\fP" List all known signal names. .IP "\fB\-n\fP, \fB\-\-ns\fP" -Match against the PID namespace of the given PID. Use 0 to match against -all namespaces. The default is to match against the current PID namespace. +Match against the PID namespace of the given PID. The default is to match +against all namespaces. .IP "\fB\-o\fP, \fB\-\-older\-than\fP" Match only processes that are older (started before) the time specified. The time is specified as a float then a unit. The units diff --git a/src/killall.c b/src/killall.c index b6770b7..7bb9313 100644 --- a/src/killall.c +++ b/src/killall.c @@ -2,7 +2,7 @@ * killall.c - kill processes by name or list PIDs * * Copyright (C) 1993-2002 Werner Almesberger - * Copyright (C) 2002-2017 Craig Small + * Copyright (C) 2002-2018 Craig Small * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -761,7 +761,7 @@ usage (const char *msg) " -V,--version display version information\n" " -w,--wait wait for processes to die\n" " -n,--ns PID match processes that belong to the same namespaces\n" - " as PID or 0 for all namespaces\n")); + " as PID\n")); #ifdef WITH_SELINUX fprintf(stderr, _( @@ -830,7 +830,6 @@ main (int argc, char **argv) {"version", 0, NULL, 'V'}, {0,0,0,0 }}; - opt_ns_pid = getpid(); /* Setup the i18n */ #ifdef ENABLE_NLS @@ -924,6 +923,8 @@ main (int argc, char **argv) break; case 'n': opt_ns_pid = atoi(optarg); + if (opt_ns_pid == 0) + usage(_("Invalid namespace PID")); break; #ifdef WITH_SELINUX case 'Z':