Welcome to the most active Linux Forum on the web.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!


  Search this Thread
Old 06-15-2008, 01:36 PM   #1
LQ Newbie
Registered: Jun 2008
Posts: 4

Rep: Reputation: 1
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 ?

Last edited by rajdeepbhattacharya; 06-15-2008 at 01:39 PM.
Old 06-15-2008, 05:00 PM   #2
LQ Guru
Registered: Feb 2003
Location: Blue Ridge Mountain
Distribution: Linux Mint 17, Debian 8
Posts: 7,863

Rep: Reputation: 311Reputation: 311Reputation: 311Reputation: 311
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


discussion, linux

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
help with script to check processes on multiple servers ncsuapex Programming 7 06-10-2008 11:02 AM
can you do threading or multiple processes in a shell script? BrianK Programming 8 08-07-2006 04:40 PM
stopping other processes TranceDude Linux - Software 8 08-28-2005 08:55 AM
stopping all processes adhiraj Linux - General 0 01-29-2004 05:19 AM
Inittab - stopping processes upon boot jfshadow Linux - General 5 06-08-2002 04:21 AM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 06:16 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration