LinuxQuestions.org
Review your favorite Linux distribution.
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 03-11-2009, 12:21 PM   #1
augustpasimio
LQ Newbie
 
Registered: Jan 2008
Location: Maryland
Distribution: Fedora
Posts: 3

Rep: Reputation: 0
SIGINT Being Sent To Other Processes


Hi,
I have a script perfmon.ksh, which calls perfmon.exe, and restarts it in case it dies.

When I run it, I see the 2 processes (perfmon.ksh, perfmon.exe). I also have 10 other programs running.

My script to stop the perfmon processes is stop_perfmon.ksh. Basically, it does this:
ps -ef | grep -v stop_ | grep perfmon | grep -v grep | awk '{print $2}' | xargs -i kill -2 {}

When I run stop_perfmon.ksh, it kills perfmon.ksh and perfmon.exe. It also kills my other 10 processes. Any ideas why it would kill the other 10 processes? I look in the debug logs of the 10 process, and all of them indicate that they terminated because they received SIGINT.

I can recreate the problem easily:
start the 10 processes
run perfmon.ksh
kill -2 perfmon.ksh
kill -2 perfmon.exe

When I do kill -2 perfmon.ksh, I noticed that it is not dying right away, but it waits until I kill -2 perfmon.exe, at which time perfmon.ksh will die, and all the other 10 processes will die.

I tried changing the stop_perfmon.ksh script so that it kill -9 perfmon.ksh, then kill -2 perfmon.exe. This seems to fix the problem.

I need to understand why
kill -2 perfmon.ksh, kill -2 perfmon.exe
kills my other processes.

Thanks,
AP
 
  


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
SIGINT problem brentos Linux - General 1 12-17-2008 10:43 PM
sigint custom handler nc3b Programming 6 05-09-2007 08:39 AM
overriding SIGINT xface66 Programming 3 04-02-2007 01:32 PM
SIGINT handler with Fork() xface66 Programming 1 04-02-2007 12:15 PM
SIGINT handling santhosh.bachu Linux - General 1 07-18-2006 01:18 AM

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

All times are GMT -5. The time now is 05:52 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