]> git.pld-linux.org Git - packages/mysql.git/blobdiff - mysql-ndb-cpc.init
add more comments about log-output directive
[packages/mysql.git] / mysql-ndb-cpc.init
old mode 100644 (file)
new mode 100755 (executable)
index eb1f9d2..ad159b3
@@ -4,7 +4,7 @@
 #
 # chkconfig:   2345 80 30
 # description: mysql-ndb-cpc is a mysql NDB engine
-#              
+#
 # processname: ndbd
 
 # Source function library.
@@ -28,10 +28,7 @@ else
        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"
@@ -41,8 +38,9 @@ case "$1" in
        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"
@@ -50,23 +48,44 @@ case "$1" in
                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
 
This page took 0.044737 seconds and 4 git commands to generate.