add /etc/init.d script for DB2 workaround

git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@9227 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd
This commit is contained in:
lissav 2011-04-05 16:13:29 +00:00
parent fe0d60e2d3
commit 6de4ddda88

View File

@ -0,0 +1,90 @@
#!/bin/sh
# IBM(c) 2007 EPL license http://www.eclipse.org/legal/epl-v10.html
# chkconfig: 345 70 65
# description: xCAT DB2 service
# processname: db2fmcd
### BEGIN INIT INFO
# Provides: db2fmcd
# Required-Start:
# Required-Stop:
# Should-Start:
# Default-Start: 3 4 5
# Default-stop: 0 1 2 6
# Short-Description: DB2 Fault Monitor
# Description: DB2 Fault Monitor Coordinator
### END INIT INFO
RHSuccess()
{
success
echo
}
RHFailure()
{
failure
echo
}
MStatus()
{
ps ax|grep -v grep|grep db2fmcd: >& /dev/null
if [ "$?" = "0" ]; then
RVAL=0
echo "db2fmcd service is running"
else
RVAL=3
echo "db2fmcd service is not running"
fi
return $RVAL
}
if [ -f /etc/init.d/functions ]; then
#echo RH
. /etc/init.d/functions
START_DAEMON=daemon
STATUS=MStatus
LOG_SUCCESS=RHSuccess
LOG_FAILURE=RHFailure
LOG_WARNING=passed
elif [ -f /lib/lsb/init-functions ]; then
. /lib/lsb/init-functions
START_DAEMON=start_daemon
STATUS=MStatus
LOG_SUCCESS=log_success_msg
LOG_FAILURE=log_failure_msg
LOG_WARNING=log_warning_msg
else
echo "Error, don't know how to start on this platform"
exit 1
fi
case $1 in
restart)
echo -n "Restart of db2fmcd not supported "
;;
reload)
echo -n "Reload of db2fmcd not supported "
;;
status)
$STATUS
;;
stop)
echo -n "Stop of db2fmcd not supported "
;;
start)
$STATUS >& /dev/null
if [ "$?" == "0" ]; then
echo -n "db2fmcd already running\n "
$LOG_WARNING
exit
fi
echo -n "Starting db2fmcd "
/opt/ibm/db2/V9.7/bin/db2fmcd &
;;
esac