Hey, that is cool –thanks man J
From:
linux-cluster-bounces@xxxxxxxxxx [mailto:linux-cluster-bounces@xxxxxxxxxx] On Behalf Of Sean Gray
Sent: Friday, September 30, 2005
4:45 PM
To: linux-cluster@xxxxxxxxxx
Subject: script to
enable, disable, start,stop and query status of cluster services
I found the below useful
for my cluster testing, enjoy!
#!/bin/bash
# Name: cluster
# Authors: Sean Gray <me @ seangray.com, sgray @ bluestarinc.com>
# Copyright 2005 under the GPL
# Version 0.1
# Enable, disable, start, stop and query status of cluster services
# on RHEL4.
#
SERVICES="ccsd cman lock_gulmd fenced clvmd rgmanager gfs"
STARTORDER="ccsd cman lock_gulmd fenced clvmd gfs rgmanager"
STOPORDER="rgmanager gfs clvmd fenced lock_gulmd cman ccsd"
enableStuff (){
for SERVICE in `echo $SERVICES`;
do
chkconfig --level 2345 $SERVICE on;
done;
for SERVICE in `echo $SERVICES`;
do
chkconfig --list $SERVICE;
done;
}
disableStuff (){
for SERVICE in `echo $SERVICES`;
do
chkconfig --level 2345 $SERVICE off;
done;
for SERVICE in `echo $SERVICES`;
do
chkconfig --list $SERVICE;
done;
}
startStuff (){
for SERVICE in `echo $STARTORDER`;
do
service $SERVICE start;
done;
}
stopStuff (){
for SERVICE in `echo $STOPORDER`;
do
service $SERVICE stop;
done;
}
serviceStatus (){
for SERVICE in `echo $SERVICES`;
do
echo -e "\033[36m $SERVICE \033[0m"
service $SERVICE status;
echo -e "\n"
done;
}
case $1 in
"enable" )
enableStuff
;;
"disable" )
disableStuff
;;
"start" )
startStuff
;;
"stop" )
stopStuff
;;
"status" )
serviceStatus
;;
* )
echo -e "Usage: `basename $0`
{enable|disable|start|stop|status}"
;;
esac
|
--
Linux-cluster@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/linux-cluster