Sophie

Sophie

distrib > Mandriva > 2009.0 > x86_64 > media > main-testing-src > by-pkgid > 91117ef1a9653edd6a912d3a095f594d > files > 29

mysql-5.0.84-0.1mdv2009.0.src.rpm

#!/bin/bash
#
# mysqld-ndb_cpcd - This shell script takes care of starting and stopping mysqld-ndb_cpcd
#
# chkconfig: - 10 90
# description: ndb_cpcd, the Management Server CPC Process
# processname: ndb_cpcd

# Source function library.
. /etc/rc.d/init.d/functions

# Source networking configuration.
. /etc/sysconfig/network

# Check that networking is up.
[ "${NETWORKING}" = "no" ] && exit 0

# Source configuration file
[ -f /etc/sysconfig/mysqld-ndb_cpcd ] && . /etc/sysconfig/mysqld-ndb_cpcd

RETVAL=0
# See how we were called.
case "$1" in
start)
    # Start daemons.
    if [ ! -f /var/lock/subsys/mysqld-ndb_cpcd ]; then
	echo -n "Starting mysqld-ndb_cpcd: "
	cd ${NDB_CPCD_CLUSTER_DIR:-"/var/lib/mysql-cluster"}
	daemon ndb_cpcd ${NDB_CPCD_OPTIONS:-""}
	RETVAL=$?
    [ $RETVAL -eq 0 ] && touch /var/lock/subsys/mysqld-ndb_cpcd
    else
	echo "mysqld-ndb_cpcd is allready running "
    fi
    ;;
stop)
    # Stop daemons.
    if [ -f /var/lock/subsys/mysqld-ndb_cpcd ]; then
	echo -n "Stopping mysqld-ndb_cpcd: "
	killproc ndb_cpcd
	rm -f /var/lock/subsys/mysqld-ndb_cpcd >/dev/null 2>&1
    else
	echo "mysqld-ndb_cpcd is not running "
    fi
    ;;
status)
    status ndb_cpcd
    exit $?
    ;;
restart|reload)
    $0 stop
    $0 start
    exit $?
    ;;
condrestart)
    [ -f /var/lock/subsys/mysqld-ndb_cpcd ] && restart
    ;;
    *)
    echo "Usage: $0 {start|stop|status|restart|condrestart|reload}"
    exit 1
esac
exit $RETVAL