How to get the PID of the process giving kill signal to a process?
I tried googling but didn't get any answer for this.
I have a process called "abc" and it is running with PID "123".
I have a putty session opened with PID "999".
I am giving kill -TERM 123 from putty session.
My process "abc" before dying it should catch the PID of the terminal which provided TERM signal to it.
Is there any way to find this out?
Your reply with sample pgms are really appreciated...
thanks in advance !
Assuming your process abc is a C/C++ program you have created or have the source for, take a look at the man page for sigaction, it should get you pointed in the right direction.
Net searches for sigaction should also provide some examples.
Excellant it works...
Thanks for the suggestion :)
|All times are GMT -5. The time now is 04:45 PM.|