Welcome to the most active Linux Forum on the web.
Go Back > Forums > Linux Forums > Linux - Software
User Name
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.


  Search this Thread
Old 12-18-2007, 06:59 AM   #1
LQ Newbie
Registered: Dec 2007
Posts: 1

Rep: Reputation: 0
How to stop java deamon in clustered environment through shell script

Dear Members,

In my application we are executing java program as daemon thread(which runs continuously) in a clustered Linux(64 bit) environment.

Could any body please provide me shell script for stopping this daemon on clustered env.

Currently we are using following shell script , will it work on clustered environment?

# stopPollingAgentManager

# First, try to stop the PollingAgentManager the nice way:
cd /app/cbf/CLIF/version/process
cat /dev/null > PollingManager.stop

# Poll for 10 minutes, waiting for the process to stop
PID=$(cat /app/cbf/CLIF/version/process/
kill -0 $PID > /dev/null 2>&1
while [ $PS -eq 0 ] && [ $COUNT -gt 0 ]
sleep 60
COUNT=`expr $COUNT - 1`
kill -0 $PID > /dev/null 2>&1

# If not stopped, kill the process
kill -0 $PID > /dev/null 2>&1
if [ $PS -eq 0 ]
kill -15 $PID > /dev/null 2>&1
sleep 60
kill -9 $PID > /dev/null 2>&1

# Clean up the PID and stop files
rm -f
rm -f PollingManager.stop
Thanks & regards

Rakesh Nair



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
global environment variables in shell script a.toraby Programming 2 11-11-2007 04:25 AM
Perl: Source shell script to for environment variables? stefanlasiewski Programming 3 02-07-2006 07:27 PM
Need help setting environment variables via shell script srosburg Linux - Newbie 2 12-08-2005 08:58 PM
Setting environment variables from shell script theta Linux - General 5 09-02-2004 09:50 PM
How to use Java in a Shell Script arnneisp Programming 1 07-13-2004 03:18 AM > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 01:31 PM.

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