systemctl stop doesn't stop the bootstrapped node on Debian Jessie and Ubuntu Vivid

Bug #1531829 reported by Hrvoje Matijakovic
18
This bug affects 3 people
Affects Status Importance Assigned to Milestone
Percona XtraDB Cluster moved to https://jira.percona.com/projects/PXC
Status tracked in 5.6
5.5
Confirmed
Undecided
Unassigned
5.6
Confirmed
Undecided
EvgeniyPatlan

Bug Description

systemctl stop doesn't stop the bootstrapped node when systemd is used (on Debian Jessie and Ubuntu Vivid):

root@pxc1:~# systemctl status mysql
● mysql.service - LSB: Start and stop the mysql (Percona XtraDB Cluster) daemon
   Loaded: loaded (/etc/init.d/mysql)
   Active: inactive (dead) since Thu 2016-01-07 11:46:34 UTC; 6min ago
  Process: 3935 ExecStop=/etc/init.d/mysql stop (code=exited, status=0/SUCCESS)

Jan 07 11:46:28 pxc1 /etc/init.d/mysql[3414]: MySQL PID not found, pid_file detected/guessed: /var...pid
Jan 07 11:46:30 pxc1 mysql[3380]: Starting MySQL (Percona XtraDB Cluster) database server: mysqld ..
Jan 07 11:46:34 pxc1 /etc/init.d/mysql[3972]: MySQL PID not found, pid_file detected/guessed: /var...pid
Jan 07 11:46:34 pxc1 /etc/init.d/mysql[3976]: MySQL PID not found, pid_file detected/guessed: /var...pid
Jan 07 11:46:34 pxc1 mysql[3935]: Stopping MySQL (Percona XtraDB Cluster): mysqld.
Hint: Some lines were ellipsized, use -l to show in full.
root@pxc1:~# mysql
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 6
Server version: 5.6.27-76.0-56 Percona XtraDB Cluster (GPL), Release rel76.0, Revision 6d2cd81, WSREP version 25.13, wsrep_25.13

Copyright (c) 2009-2015 Percona LLC and/or its affiliates
Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql>

root@pxc1:~# systemctl stop mysql
root@pxc1:~# mysql
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 7
Server version: 5.6.27-76.0-56 Percona XtraDB Cluster (GPL), Release rel76.0, Revision 6d2cd81, WSREP version 25.13, wsrep_25.13

Copyright (c) 2009-2015 Percona LLC and/or its affiliates
Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql>

Current workoarounds are to use systemctrl bootstrap-stop to stop the service or sytemctl to restart the service.

root@pxc1:~# service mysql bootstrap-stop
[ ok ] Stopping MySQL (Percona XtraDB Cluster): mysqld.
root@pxc1:~# mysql
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)
root@pxc1:~#

 The issue is that, without systemd units in place, systemctl overrides
    options in /etc/init.d/mysql.

    The issue is that, with systemd being default init system, non-default
    options like bootstrap-pxc are not recognized by it, but instead
    passed-through to the init script itself.

    ie. service mysql start works with systemctl. However, for
    non-standard options like bootstrap-pxc this can be a problem.

    So, what happens is, for bootstrapping:

    a) service mysql bootstrap-pxc flies right by systemd. It doesn't know
    about this!

    b) service mysql stop will fail because systemd sees nothing was
    started. This won't apply to service mysql start because systemd knows
    about that.

For more reference on the changes implemented see internal PXC-375.

This issue affects versions Percona XtraDB Cluster 5.6.24-25.11 or newer.

Changed in percona-xtradb-cluster:
status: New → Confirmed
description: updated
description: updated
Revision history for this message
Shahriyar Rzayev (rzayev-sehriyar) wrote :

Percona now uses JIRA for bug reports so this bug report is migrated to: https://jira.percona.com/browse/PXC-1881

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.