Project

General

Profile

Bug #7433

stop method of mariadb (mysql, percona) sends a signal to all matched processes

Added by Denis Kozadaev almost 4 years ago. Updated almost 4 years ago.

Status:
Resolved
Priority:
Normal
Assignee:
Category:
OI-Userland
Target version:
-
Start date:
2016-09-28
Due date:
% Done:

0%

Estimated time:
Difficulty:
Medium
Tags:
needs-triage

Description

Current method stops an instance by calling a shell function:

mysql_stop()    {
        if [ -f ${PIDFILE} ]; then
        pkill mysqld
        fi
}

A zone may have more than one instances of the service, as the result,
all servers will be stopped.
A workaround could be look like:
mysql_stop()    {
        if [ -f ${PIDFILE} ]; then
            PID=`cat ${PIDFILE}`
            pgrep mysqld|grep -q ${PID} && kill -TERM ${PID}
        fi
}

It will send a TERM signal to the specified pid only if it matches to mysqld process.
The pid-file could have a pid of some other process (after crash, for example)

History

#1

Updated by Alexander Pyhalov almost 4 years ago

  • Status changed from New to Resolved

Also available in: Atom PDF