LinuxQuestions.org
View the Most Wanted LQ Wiki articles.
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 09-18-2004, 12:33 PM   #1
feetyouwell
Member
 
Registered: Dec 2003
Location: NC, US
Distribution: Novell Linux Eval (2.6.5)
Posts: 240

Rep: Reputation: 30
how to send user defined signal in linux


how to send signal to a certain process, i know one way is though the keyboard, are there any other way such as writting a program that contains some sorta of send_sig function???
 
Old 09-18-2004, 12:38 PM   #2
mirradric
Member
 
Registered: May 2004
Location: Singapore
Distribution: Debian woody and debian sarge
Posts: 188

Rep: Reputation: 31
have you tried
Code:
man signal
man kill
kill is section 2 btw
 
Old 09-18-2004, 12:53 PM   #3
BluePyre
Member
 
Registered: Mar 2004
Location: London
Distribution: Mandrake 10
Posts: 172

Rep: Reputation: 30
kill -s (signal) pid

To get a list of signals which you can send to a program:
kill -l

I am a little confused about your question. Is it possible to write a program that has some send_sig function? Of course it is! Here's a python example:
Code:
#!/usr/bin/python
import os

def send_sig(signal, pid):
   command = "kill -s"
   command += signal
   command += pid
   os.system(command)

send_sig("SIGKILL", 2420)

Last edited by BluePyre; 09-18-2004 at 12:54 PM.
 
Old 09-18-2004, 12:54 PM   #4
feetyouwell
Member
 
Registered: Dec 2003
Location: NC, US
Distribution: Novell Linux Eval (2.6.5)
Posts: 240

Original Poster
Rep: Reputation: 30
yeah i read through those, but it's not what I wanted

I want to be able to send a user defined-signal to a group leader, which in term it will pass "my" signal down to all of its children. So far everything I read is about how to catch the signal, the only thing that tells me about sending is through keyboard, or kill(), raise(), <-- but these are not user-defined though.
 
Old 09-18-2004, 12:57 PM   #5
feetyouwell
Member
 
Registered: Dec 2003
Location: NC, US
Distribution: Novell Linux Eval (2.6.5)
Posts: 240

Original Poster
Rep: Reputation: 30
sorry man, my bad, i see what you mean now
 
Old 09-18-2004, 12:59 PM   #6
feetyouwell
Member
 
Registered: Dec 2003
Location: NC, US
Distribution: Novell Linux Eval (2.6.5)
Posts: 240

Original Poster
Rep: Reputation: 30
thanks guys, I just got a little confused on myself, thanks for the help, i think I got it now
 
Old 12-26-2007, 04:40 AM   #7
Micky_123
LQ Newbie
 
Registered: Dec 2007
Posts: 17

Rep: Reputation: 0
How to send user defined signals in linux using C.

Hi ,
I am also looking answer for the same question.
How to send user defined signals in linux using C.
I believe you already got the answer for this, so can you please share the same.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
how to send a signal to a thread stephenwalter Programming 2 10-17-2005 01:07 AM
Linux Script which uses user defined variables fieldyweb Linux - Newbie 3 09-26-2005 06:29 PM
trying to send signal from linux module andreiij Programming 1 05-02-2005 12:46 PM
how to define user-defined commands in linux mannoulla Linux - General 1 04-05-2005 09:01 PM
How to run user defined services and exe files on linux. Prabhat Sharda Linux - Software 6 01-05-2005 03:54 AM


All times are GMT -5. The time now is 11:50 AM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration