LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   sending signals (https://www.linuxquestions.org/questions/linux-software-2/sending-signals-594180/)

jiya_31 10-24-2007 07:38 AM

sending signals
 
I need to send a signal to a number of independent processes at the same time.
These processes are not members of a process group.
Can anybody please suggest me, how do i do that.?

rnturn 10-24-2007 12:12 PM

Quote:

Originally Posted by jiya_31 (Post 2934871)
I need to send a signal to a number of independent processes at the same time.

You can specify multiple PIDs on the "kill" command line. The tough part is how you build that list of PIDs.

Are the processes all running from the same pty? Are they all running using the same uid? Of is it a subset of one of those? Gotta be careful lest you whack a process that you didn't intend to.

--
RT

jiya_31 10-24-2007 10:47 PM

If all these processes have the same process group ID or they are in the same session , then, sending a signal would not be a problem.
But how do i send it to all of them if:
They are in a different session.

rnturn 10-25-2007 03:59 PM

Quote:

Originally Posted by jiya_31 (Post 2935902)
But how do i send it to all of them if:
They are in a different session.

I guess I can't quite figure out what you're trying to do. It sounds like there's no particular relationship amongst these processes that would link them together such that you could easily predict that one of the many processes running on the system is a candidate to receive a signal and another process is not. Absent some way of distinguishing which process is suppose to get signaled -- i.e., run by the same user, process group, terminal, etc. -- I can't see any way of doing this other than manually. You could do it via "top" or by cutting and pasting PIDs out of the output of a "ps" command.

Can you be a bit more specific about what situation you're trying to work with?

--
RT


All times are GMT -5. The time now is 10:57 PM.