LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
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!

Notices


Reply
  Search this Thread
Old 06-15-2008, 02:36 PM   #1
rajdeepbhattacharya
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 02:39 PM.
 
Old 06-15-2008, 06:00 PM   #2
jailbait
LQ Guru
 
Registered: Feb 2003
Location: Blue Ridge Mountain
Distribution: Debian Jessie, Linux Mint 17
Posts: 7,751

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


Reply

Tags
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 12:02 PM
can you do threading or multiple processes in a shell script? BrianK Programming 8 08-07-2006 05:40 PM
stopping other processes TranceDude Linux - Software 8 08-28-2005 09:55 AM
stopping all processes adhiraj Linux - General 0 01-29-2004 06:19 AM
Inittab - stopping processes upon boot jfshadow Linux - General 5 06-08-2002 05:21 AM


All times are GMT -5. The time now is 09:25 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration