Page MenuHomeFreeBSD

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

Authored by fernape on Jun 23 2020, 5:11 PM.

Details

Summary

It comes from PR 247411

-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.
-d does not implies -s because the output generated is different (when using
-d and -s the output is the union of the output of both flags)

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

e.g:

$ killall -d firefox
uid:1001
nprocs 35
sig:15, cmd:firefox, pid:60723, dev:0xffffffffffffffff uid:1001
sig:15, cmd:firefox, pid:60620, dev:0xffffffffffffffff uid:1001
sig:15, cmd:firefox, pid:97822, dev:0xffffffffffffffff uid:1001
sig:15, cmd:firefox, pid:97475, dev:0xffffffffffffffff uid:1001
sig:15, cmd:firefox, pid:97285, dev:0xffffffffffffffff uid:1001
sig:15, cmd:firefox, pid:97131, dev:0xffffffffffffffff uid:1001

$ killall -s firefox
kill -TERM 60723
kill -TERM 60620
kill -TERM 97822
kill -TERM 97475
kill -TERM 97285
kill -TERM 97131

$ killall -d -s firefox
uid:1001
nprocs 34
sig:15, cmd:firefox, pid:3346, dev:0xffffffffffffffff uid:1001
kill -TERM 3346
sig:15, cmd:firefox, pid:3345, dev:0xffffffffffffffff uid:1001
kill -TERM 3345
sig:15, cmd:firefox, pid:3344, dev:0xffffffffffffffff uid:1001
kill -TERM 3344
sig:15, cmd:firefox, pid:3308, dev:0xffffffffffffffff uid:1001
kill -TERM 3308
sig:15, cmd:firefox, pid:3306, dev:0xffffffffffffffff uid:1001
kill -TERM 3306

$ killall -v firefox
kill -TERM 60723
kill -TERM 60620
kill -TERM 97822
kill -TERM 97475
kill -TERM 97285
kill -TERM 97131
<--- Here firefox gets actually killed

The changes:

  • Split -d and -v option descriptions. Detail the former a bit more.
  • Add -v section
  • Change -s section to mention -v

Note: I removed the "For a single -d option..." because as far as I can tell, it
does not matter if we use one or several -d flags.

Test Plan
  • mandoc -Tlint clean
  • igor clean (except for a non-related warning)
  • aspell happy
  • man ./killall.1 renders the page properly

Diff Detail

Repository
rS FreeBSD src repository
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

Would you mind updating the diagnosis section as well with regard to specifying multiple -d flags?

Otherwise, seems pretty good! Thanks!

0mp requested changes to this revision.Jun 23 2020, 6:08 PM
This revision now requires changes to proceed.Jun 23 2020, 6:08 PM

Update DIAGNOSTICS section to signify that there aren't multiple -d options.

Spotted by 0mp@

LGTM, I just left one comment for your consideration.

usr.bin/killall/killall.1
64 ↗(On Diff #73532)

I think that this sentence could be reworded a little bit but I don't have any ideas.

Maybe someone else could chime in on this one.

This revision is now accepted and ready to land.Jun 23 2020, 6:31 PM
usr.bin/killall/killall.1
64 ↗(On Diff #73532)

I think that this sentence could be reworded a little bit but I don't have any ideas.

Maybe someone else could chime in on this one.

Agreed. I'll have a look at it tomorrow :-)

usr.bin/killall/killall.1
64 ↗(On Diff #73532)

How about something like this?

Be more verbose about what will be done, but do not
send any signal. The total number of user processes
and the real user ID of the caller is shown. In addition, a list of the
processes that the signal would be delivered to is shown if any.
Otherwise, a message indicating that no matching processes have been found
is displayed.

usr.bin/killall/killall.1
64 ↗(On Diff #73532)

Looks good to me! Great!

This revision was automatically updated to reflect the committed changes.