X-Git-Url: https://git.pld-linux.org/?a=blobdiff_plain;f=mysql-ndb-cpc.init;h=ad159b36cd10dbc6517b3cbacc7d58933e485d30;hb=874af6dea26c9ea8027718dfb18a711c037a6028;hp=eb1f9d2b683a373a976316c537333811f0964bd7;hpb=36eada1be9ae15281cf3a13b7f967cefe03f1fa4;p=packages%2Fmysql.git diff --git a/mysql-ndb-cpc.init b/mysql-ndb-cpc.init old mode 100644 new mode 100755 index eb1f9d2..ad159b3 --- a/mysql-ndb-cpc.init +++ b/mysql-ndb-cpc.init @@ -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