Bug 1398920 - mysql heartbeat script runs mysqld_safe directly instead of systemd service
Summary: mysql heartbeat script runs mysqld_safe directly instead of systemd service
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: resource-agents
Version: 7.2
Hardware: x86_64
OS: Linux
unspecified
medium
Target Milestone: rc
: ---
Assignee: Oyvind Albrigtsen
QA Contact: cluster-qe@redhat.com
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-11-27 10:26 UTC by Tzafrir Cohen
Modified: 2017-11-02 00:02 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2017-11-01 16:06:33 UTC
Target Upstream Version:


Attachments (Terms of Use)

Description Tzafrir Cohen 2016-11-27 10:26:47 UTC
Description of problem:
The "mysql" heartbeat resource (/usr/lib/ocf/resource.d/heartbeat/mysql) seems to generally work. E.g. '/usr/lib/ocf/resource.d/heartbeat/mysql start' will start an instance of MariaDB. However it does that by running 'mysqld_safe' directly and not through calling the mariadb service.

Version-Release number of selected component (if applicable):
3.9.5-54.el7_2.17

How reproducible:
Consistent.

Steps to Reproduce:
Create a service. From that service, run:

/usr/lib/ocf/resource.d/heartbeat/mysql stop

/usr/lib/ocf/resource.d/heartbeat/mysql start

(Or similar manipulations)

Actual results:
An instance of MariaDB running in the same cgroup of your service, regardless of the mariadb service.


Expected results:
The MariaDB service stopped and started.

Additional info:

My initial workaround (currently in a copy of that script, due to packaging concerns, but really belongs in /usr/lib/ocf/lib/heartbeat/mysql-common.sh) is:

# Redefine functions from mysql-common.sh:

mysql_common_start() {
    systemctl start mariadb
}

mysql_common_stop() {
    systemctl stop mariadb
}

mysql_common_status() {
    local loglevel=$1
    if systemctl is-active --quiet mariadb; then
        return $OCF_SUCCESS;
    else
        ocf_log $loglevel "MySQL not running"
        return $OCF_NOT_RUNNING;
    fi
}

Comment 6 Oyvind Albrigtsen 2017-11-01 16:06:33 UTC
Closing as this change would require a full rewrite of the configuration parsing, which in turn might not be backwards compatible either.


Note You need to log in before you can comment on or make changes to this bug.