LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 10-24-2007, 07:38 AM   #1
jiya_31
LQ Newbie
 
Registered: Oct 2007
Posts: 7

Rep: Reputation: 0
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.?
 
Old 10-24-2007, 12:12 PM   #2
rnturn
Senior Member
 
Registered: Jan 2003
Location: Illinois (SW Chicago 'burbs)
Distribution: openSUSE, Raspbian, Slackware. Previous: MacOS, Red Hat, Coherent, Consensys SVR4.2, Tru64, Solaris
Posts: 2,803

Rep: Reputation: 550Reputation: 550Reputation: 550Reputation: 550Reputation: 550Reputation: 550
Quote:
Originally Posted by jiya_31 View Post
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
 
Old 10-24-2007, 10:47 PM   #3
jiya_31
LQ Newbie
 
Registered: Oct 2007
Posts: 7

Original Poster
Rep: Reputation: 0
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.
 
Old 10-25-2007, 03:59 PM   #4
rnturn
Senior Member
 
Registered: Jan 2003
Location: Illinois (SW Chicago 'burbs)
Distribution: openSUSE, Raspbian, Slackware. Previous: MacOS, Red Hat, Coherent, Consensys SVR4.2, Tru64, Solaris
Posts: 2,803

Rep: Reputation: 550Reputation: 550Reputation: 550Reputation: 550Reputation: 550Reputation: 550
Quote:
Originally Posted by jiya_31 View Post
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
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
catching signals alaios Programming 3 11-16-2007 05:05 AM
signals between processes djgerbavore Programming 1 04-10-2006 04:07 AM
!!! about signals !!! b2na Programming 4 02-04-2005 12:34 AM
!! about signals !!! b2na General 1 01-03-2005 04:37 PM
Signals Speek Programming 2 12-24-2004 04:58 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 08:25 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration