1

From kill's man:

If pid is 0, sig shall be sent to all processes (excluding an unspecified set of system processes) whose process group ID is equal to the process group ID of the sender, and for which the process has permission to send a signal

What does for which the process has permission to send a signal exactly mean? How can I check which processes will receive a signal?

For example, kill -9 0 kills every process that was started in the current tty and the tty itself. Or is there something else?

1 Answer 1

3

What does for which the process has permission to send a signal exactly mean?

It's answered right there in the manpage:

For a process to have permission to send a signal it must either be privileged, or the real or effective user ID of the sending process must equal the real or saved set-user-ID of the target process. In the case of SIGCONT it suffices when the sending and receiving processes belong to the same session.

How can I check which processes will receive a signal?

You could walk the process list and try to kill each one with signal 0 (the dry run signal). That will tell you whether you would have had permission to send a real signal.

2
  • In translation: if you don't have elevated permissions, then you have permission if the process belongs to you. Commented Apr 9, 2017 at 11:28
  • @richard pretty much
    – Celada
    Commented Apr 9, 2017 at 11:36

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .