]> granicus.if.org Git - psmisc/commitdiff
killall: use all namespaces by default
authorCraig Small <csmall@enc.com.au>
Sat, 5 May 2018 22:02:35 +0000 (08:02 +1000)
committerCraig Small <csmall@enc.com.au>
Sat, 5 May 2018 22:02:35 +0000 (08:02 +1000)
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.

ChangeLog
doc/killall.1
src/killall.c

index bea60d5684140abfd3f6de6e4347a4cbc7791cb3..5c7cc6b069024be4045380a947b97dc0f166b46d 100644 (file)
--- 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
index 37238f32d336a8754916c8280236c1336a7b48be..50d2a5279be9c59d900b3f6038c48419423d9a42 100644 (file)
@@ -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
index b6770b7fc452546dc95306e4da285ff45dfc17be..7bb9313863b6b78449dd2f6362cf6e0141b2e07d 100644 (file)
@@ -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':