Bug 247411 - killall does not kill processes if -d is specified
Summary: killall does not kill processes if -d is specified
Status: Closed FIXED
Alias: None
Product: Base System
Classification: Unclassified
Component: bin (show other bugs)
Version: CURRENT
Hardware: Any Any
: --- Affects Only Me
Assignee: Fernando Apesteguía
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-06-19 09:48 UTC by Mateusz Piotrowski
Modified: 2020-06-27 11:29 UTC (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Mateusz Piotrowski freebsd_committer 2020-06-19 09:48:05 UTC
Here's a code example

```
$ sleep 1 & killall -d sleep
[1] 13393
uid:1001
nprocs 64
sig:15, cmd:sleep, pid:13393, dev:0x2e6 uid:1001
$ jobs
[1]   Done                    sleep 1
```

As we can see, sleep is not getting killed if -d is specified.

It works fine with -v, however:

```
$ sleep 1 & killall -v sleep
kill -TERM 19067
[1]   Terminated              sleep 1
```

Is this a desired behavior?
Comment 1 Yuri Pankov freebsd_committer 2020-06-19 10:04:19 UTC
According to killall source, it seems to be expected:

https://github.com/freebsd/freebsd/blob/98fe3d31f1ff6f78e9424e5d5f5f067e7facb5bf/usr.bin/killall/killall.c#L424

May be man page needs to specify that -d implies -s? And it looks like -d and -v need separate descriptions while here.
Comment 2 Fernando Apesteguía freebsd_committer 2020-06-23 12:20:21 UTC
If there is no objection, I can give the man page a try.
Comment 3 Mateusz Piotrowski freebsd_committer 2020-06-23 13:48:41 UTC
(In reply to Fernando Apesteguía from comment #2)

Great, thanks!
Comment 4 Fernando Apesteguía freebsd_committer 2020-06-23 17:13:35 UTC
Changes in review D25413
Comment 5 commit-hook freebsd_committer 2020-06-27 11:28:57 UTC
A commit references this bug:

Author: fernape
Date: Sat Jun 27 11:28:12 UTC 2020
New revision: 362678
URL: https://svnweb.freebsd.org/changeset/base/362678

Log:
  killall(1): Clarify -d, -s and -v options

  -d and -v are not equivalent options. The former is more verbose than the
  latter and the former does not actually send the signals while the latter does.
  Let them have their own paragraphs.

  From the point of view of the output, -v is equivalent to -s, so describe them
  close to each other. The difference is that former actually sends the signals
  and the latter doesn't.

  PR:	247411
  Approved by:	manpages(0mp)
  Differential Revision:	https://reviews.freebsd.org/D25413

Changes:
  head/usr.bin/killall/killall.1
Comment 6 Fernando Apesteguía freebsd_committer 2020-06-27 11:29:50 UTC
Committed,

Thanks!