Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Program 1 runs irregularly, and crashes program 2, which then crashes program 1.

I'm not able to find the proper way to make program 2 stop when program 1 is initiated, and then restart program 2 when program one quits. I'm tired of having to manually do this, and I have been searching for a solution for the past few hours.

Thanks.

share|improve this question

1 Answer 1

up vote 1 down vote accepted

a combination of trap and exit in a wrapper script should help ....

like on encountering the process prog2 in ps -ef | grep prog2 , you can use exit in wrapper to send signal to trap - using trap you can specify what action to do like normal exit or force kill ie kill -9 PID_progX !!

wrapper is something like a controling script that will start , stop and monitor the process so that you dont have to start or stop them your self.

share|improve this answer
    
Nice. Thank you. –  Eric Leroy May 22 '13 at 5:27

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.