Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Signals

Status
Not open for further replies.

quagsire

Programmer
Jul 11, 2002
12
0
0
ZA
How do I get the source of a signal to my programs?
 
Hi,

If i understand you correctly , i.e. you have a script that is running and you want to send a user defined kill signal
to this script and then act upon the signal it received .
( I haven't done this , but have a read to see if this helps )-

if you do kill -l ( thats LLLLLL lower case) list you kill signals in AIX . If you look at /usr/include/sys/signal.h
gives you definition of signal)

You have a script that is running in background , your
second script you run and in there it has something like this ,

kill -31 (process id of script running in the background)

so you've sent a user defined signal to your script running in the background .

in that script , you set up a trap i.e.

trap 'run_this' 31

run_this is a function which runs your piece of code i.e.

function run_this {

commands

}

Is this what you are looking for ?

also have a look at this site :-
 
My program is receiving a lot of signal 20 (SIGCHLD), but has no children. When I run the program on a different box, I don't receive any signals. I am trying to find out where the signals originate from. I can block the signals, but then I will never know what causes it.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top