#!/bin/bash # # mysqld-ndbd - This shell script takes care of starting and stopping ndbd # # chkconfig: - 10 90 # description: ndbd, the Storage Engine Node Process # processname: ndbd # 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-ndbd ] && . /etc/sysconfig/mysqld-ndbd RETVAL=0 # See how we were called. case "$1" in start) # Start daemons. if [ ! -f /var/lock/subsys/mysqld-ndbd ]; then echo -n "Starting mysqld-ndbd: " cd ${NDB_CLUSTER_DIR:-"/var/lib/mysql-cluster"} daemon ndbd ${NDB_OPTIONS:-"--daemon"} RETVAL=$? [ $RETVAL -eq 0 ] && touch /var/lock/subsys/mysqld-ndbd else echo "mysqld-ndbd is allready running " fi ;; stop) # Stop daemons. if [ -f /var/lock/subsys/mysqld-ndbd ]; then echo -n "Stopping mysqld-ndbd: " killproc ndbd rm -f /var/lock/subsys/mysqld-ndbd >/dev/null 2>&1 else echo "mysqld-ndbd is not running " fi ;; status) status ndbd exit $? ;; restart|reload) $0 stop $0 start exit $? ;; condrestart) [ -f /var/lock/subsys/mysqld-ndbd ] && restart ;; *) echo "Usage: $0 {start|stop|status|restart|condrestart|reload}" exit 1 esac exit $RETVAL