From: Hugo Villeneuve Date: Wed, 6 Aug 2014 04:04:22 +0000 (-0400) Subject: Fix return values in MySQL bootscript X-Git-Url: http://gitweb.hugovil.com/?a=commitdiff_plain;h=8736214ae0db4817212fd150fa2da1dc2e866c4a;p=hvlinux.git Fix return values in MySQL bootscript --- diff --git a/stage3/bootscripts/mysql b/stage3/bootscripts/mysql index 3c5f935..d261939 100755 --- a/stage3/bootscripts/mysql +++ b/stage3/bootscripts/mysql @@ -14,15 +14,15 @@ mysql_start() if [ -f "$pid_file" ]; then if /bin/ps p `cat $pid_file` | grep mysqld >/dev/null; then # Warning, running... - return 0 + return ${EXIT_CODE_WARNING} else rm -f $pid_file if [ -f $pid_file ]; then - return 1 + return ${EXIT_CODE_FAILURE} fi fi fi - + /usr/bin/mysqld_safe --user=mysql 2>&1 >/dev/null & return $? } @@ -39,28 +39,28 @@ mysql_stop() sleep 1 done if [ -s $pid_file ]; then - return 1 + return ${EXIT_CODE_FAILURE} fi return 0 else # print_status warning not_running - return 1 + return ${EXIT_CODE_WARNING} fi } case "$1" in start) - cmd_run_log_box "MySQL start" mysql_start + cmd_run_log_box_warn "MySQL start" mysql_start ;; - + stop) - cmd_run_log_box "MySQL stop" mysql_stop + cmd_run_log_box_warn "MySQL stop" mysql_stop ;; - + reload) - cmd_run_log_box "MySQL reload" reloadproc mysqld + cmd_run_log_box_warn "MySQL reload" reloadproc mysqld ;; - + restart) $0 stop sleep 1 @@ -70,7 +70,7 @@ case "$1" in status) statusproc mysqld ;; - + *) echo "Usage: $0 {start|stop|reload|restart|status}" exit ${EXIT_CODE_FAILURE}