0

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?

2

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.

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.