LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Stopping Multiple processes with a script (https://www.linuxquestions.org/questions/linux-newbie-8/stopping-multiple-processes-with-a-script-649468/)

rajdeepbhattacharya 06-15-2008 01:36 PM

Stopping Multiple processes with a script
 
I have a java application deployed on jboss . The problem is if we run the application multiple times (by mistake) the already running thread blocks the new thread causing the whole application to hang . We use jps to find out all the application threads and manually kill the threads . Can we have a script which can automatically kill all the application threads ?

jailbait 06-15-2008 05:00 PM

You can conditionally issue a lock request at the beginning of the program. If the program successfully locks then it knows it is the only copy running and it continues normally. If the program is told the lock is already in use then it knows that another copy is already running and the program terminates without doing anything.

------------------
Steve Stites


All times are GMT -5. The time now is 01:53 AM.