LinuxQuestions.org
Support LQ: Use code LQ3 and save $3 on Domain Registration
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
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.

Notices

Reply
 
Search this Thread
Old 12-18-2007, 05:59 AM   #1
rakeshnair83
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
COUNT=10
PID=$(cat /app/cbf/CLIF/version/process/PollingManager.pid)
kill -0 $PID > /dev/null 2>&1
PS=$?
while [ $PS -eq 0 ] && [ $COUNT -gt 0 ]
do
sleep 60
COUNT=`expr $COUNT - 1`
kill -0 $PID > /dev/null 2>&1
PS=$?
done

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

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

Rakesh Nair
 
  


Reply

Tags
java


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


All times are GMT -5. The time now is 09:35 PM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration