Review your favorite Linux distribution.
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 01-11-2012, 11:29 AM   #1
LQ Newbie
Registered: Jan 2012
Posts: 2

Rep: Reputation: Disabled
Linux cluster service- trouble running script

Hey guys,

I'm having a bit of trouble setting up a linux cluster service and am hoping you can point me in the right direction. I'm a software developer and don't have much background with linux. So here's the details:

I have two laptops running Scientific Linux (basically redhat from my understanding), and set them up in a 2 node failover cluster. Got that working using conga- luci, ricci, and rgmanager.

My goal is to have the cluster manage and monitor the failover of a process- specifically a java program. I created a script to start the program and that runs fine on its own. The program is meant to run continuously, so the script doesn't ever exit. Using the cluster, I created a service and added the script as a resource. I'm having trouble running the service correctly though. I have tried two approaches with the service with varying results:

1. Simply ran the service with the script running in foreground. Script seems to start up the process, but the service seems to be stuck. If I refresh the page, it shows the service is running, but is then unable to stop the service. It is also unable to relocate the service.

2. Ran the service with the script running in the background. The service starts up fine, but it reruns the script every 10-20 seconds or so. So I end up with 5/6 processes running within the first minute.

So my question is can the cluster be used to monitor the process of my application? ideally if the process stops the cluster would try to restart or relocate it. if the cluster can be used, are there any ideas what i'm setting up wrong?

Also, is it the default behavior of a cluster service to rerun scripts that finish executing? I've been through the documentation but can't find anything useful on how a service with a script resource should be used- or any of the options available when configuring these.

Thanks for any help you can give!
Old 01-17-2012, 09:22 AM   #2
Dean Guilberry
LQ Newbie
Registered: Apr 2010
Posts: 11

Rep: Reputation: 1
I had a similar situation

The problem we had with one of our clusters was the service script had no status function built into it.
The Cluster service would get stupid as it would check the status and never get an answer.
We wrote in a small function to return the status and this let the cluster services check the status of the service script.
If you do a command like service network status it will return something about the network.

To check your application you can run (As root)
# service yourservicename status

does it return anything?
If it returns something you probably have other issues if it doesnt then look at the status portion of your script if it has one, if not it needs to be created. At minimum all services under cluster control have to have a start stop and status function.

I hope this helps.
Old 01-17-2012, 10:33 AM   #3
LQ Newbie
Registered: Jan 2012
Posts: 2

Original Poster
Rep: Reputation: Disabled
Thanks Dean,

I'll look into the service status, maybe its similar for a cluster and a regular service. Perhaps some of my confusion in setting this up is that I created a "cluster service" through conga. There is no actual service for my application on the two machines I'm running- so the command you gave me doesn't recognize the service I created in the cluster. I think I'm close to a workaround for my initial problem, but have run into another and perhaps you can help.

The application I'm running is supposed to listen at a port, 2280. Before the machines were clustered, this ran fine. Now that they're clustered, I can no longer find the port when the application is running. I've been using

netstat -an | grep 2280

and it hasn't returned with any port. My application had been set to default to run on the localhost. Any idea how the cluster may cause this to fail? I eventually need the cluster to manage a virtual ip, but for now it simply fails to run at all on the machines original ip.

Thanks again for your help!


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
[SOLVED] Having trouble running tsch script in bash protolocke Linux - General 3 11-02-2010 01:22 PM
Trouble with a shell script running with inetd scottd431 Linux - Networking 0 11-11-2004 10:57 AM
Trouble with a shell script running with inetd scottd431 Linux - General 0 11-11-2004 10:05 AM
Trouble running firewall script - pls help Wags Linux - Security 1 07-29-2004 09:19 AM
script to check if the service is running eyt Linux - Newbie 2 02-16-2004 08:27 AM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 11:27 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