scripts/mysql.server fails to return 1 if restart fails to start

Bug #1339894 reported by Julia Kreger on 2014-07-09
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
MySQL patches by Codership
Status tracked in 5.6
5.5
Undecided
Alex Yurchenko
5.6
Undecided
Alex Yurchenko
Percona XtraDB Cluster moved to https://jira.percona.com/projects/PXC
Status tracked in 5.6
5.5
Fix Released
Medium
Unassigned
5.6
Fix Released
Medium
Unassigned

Bug Description

Utilizing: Percona-XtraDB-Cluster-5.5.37-rel35.0-25.10.756.Linux.i686.tar.gz

The restart sequence in scripts/mysql.server fails to capture and return if the start call fails to start the server, so a restart can occur that failed upon start-up and the script could still return 0 as if it worked without any issues.

Supplied script:

  'restart')
    # Stop the service and regardless of whether it was
    # running or not, start it again.
    if $0 stop $other_args; then
      $0 start $other_args
    else
      log_failure_msg "Failed to stop running server, so refusing to try to start."
      exit 1
    fi
    ;;

Possible solution:

  'restart')
    # Stop the service and regardless of whether it was
    # running or not, start it again.
    if $0 stop $other_args; then
      if ! $0 start $other_args; then
        log_failure_msg "Failed to restart server."
        exit 1
      fi
    else
      log_failure_msg "Failed to stop running server, so refusing to try to start."
      exit 1
    fi
    ;;

This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers