#
# chkconfig: 2345 80 30
# description: mysql-ndb-cpc is a mysql NDB engine
-#
+#
# processname: ndbd
# Source function library.
exit 0
fi
-RETVAL=0
-# See how we were called.
-case "$1" in
- start)
+start() {
# Start daemons.
if [ ! -f /var/lock/subsys/mysql-ndb-cpc ]; then
msg_starting "mysql ndb_cpcd"
else
msg_already_running "mysql ndb_cpcd"
fi
- ;;
- stop)
+}
+
+stop() {
# Stop daemons.
if [ -f /var/lock/subsys/mysql-ndb-cpc ]; then
msg_stopping "mysql ndb_cpcd"
rm -f /var/lock/subsys/mysql-ndb-cpc >/dev/null 2>&1
else
msg_not_running "mysql ndb_cpcd"
- fi
+ fi
+}
+
+condrestart() {
+ if [ -f /var/lock/subsys/mysql-ndb-cpc ]; then
+ stop
+ start
+ else
+ msg_not_running "mysql ndb_cpcd"
+ RETVAL=$1
+ fi
+}
+
+RETVAL=0
+# See how we were called.
+case "$1" in
+ start)
+ start
;;
- restart|force-reload)
- $0 stop
- $0 start
- exit $?
+ stop)
+ stop
+ ;;
+ restart)
+ stop
+ start
+ ;;
+ try-restart)
+ condrestart 0
+ ;;
+ force-reload)
+ condrestart 7
;;
status)
status ndb_cpcd
exit $?
;;
-# reload)
-# msg_reloading "mysql ndb_cpcd"
-# killproc ndb_cpcd -HUP
-# ;;
*)
- msg_usage "$0 {start|stop|restart|force-reload|status}"
+ msg_usage "$0 {start|stop|restart|try-restart|force-reload|status}"
exit 3
esac