Unable to start PXC using systemd if log-error=/var/log/mysql*.log

Bug #1712864 reported by Ashraf Sharif
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Percona XtraDB Cluster moved to https://jira.percona.com/projects/PXC
New
Undecided
Unassigned

Bug Description

Trivial to reproduce.

Environment:
$ rpm -qa | grep -i percona
Percona-XtraDB-Cluster-57-5.7.18-29.20.1.el7.x86_64
percona-xtrabackup-24-2.4.8-1.el7.x86_64
Percona-XtraDB-Cluster-server-57-5.7.18-29.20.1.el7.x86_64
Percona-XtraDB-Cluster-client-57-5.7.18-29.20.1.el7.x86_64
Percona-XtraDB-Cluster-shared-compat-57-5.7.18-29.20.1.el7.x86_64
percona-toolkit-3.0.4-1.el7.x86_64
Percona-XtraDB-Cluster-shared-57-5.7.18-29.20.1.el7.x86_64

Consider the following my.cnf:
=====
[mysqld]
log-error=/var/log/mysql.log

[mysqld_safe]
log-error=/var/log/mysql.log
=====

Then when you try to start the MySQL service via systemd, it fails. When looking at the status:
=====
$ systemctl status mysql
mysql.service - Percona XtraDB Cluster
   Loaded: loaded (/usr/lib/systemd/system/mysql.service; enabled)
   Active: failed (Result: exit-code) since Thu 2017-08-24 16:14:31 UTC; 5s ago
  Process: 2856 ExecStopPost=/usr/bin/mysql-systemd stop-post (code=exited, status=0/SUCCESS)
  Process: 2173 ExecStop=/usr/bin/mysql-systemd stop (code=exited, status=0/SUCCESS)
  Process: 28349 ExecStartPost=/usr/bin/mysql-systemd start-post $MAINPID (code=exited, status=0/SUCCESS)
  Process: 28348 ExecStart=/usr/bin/mysqld_safe --basedir=/usr (code=exited, status=0/SUCCESS)
  Process: 3903 ExecStartPre=/usr/bin/mysql-systemd start-pre (code=exited, status=1/FAILURE)
 Main PID: 28348 (code=exited, status=0/SUCCESS)

Aug 24 16:14:31 ip-10-0-0-155 systemd[1]: Starting Percona XtraDB Cluster...
Aug 24 16:14:31 ip-10-0-0-155 mysql-systemd[3903]: install: invalid user '@MYSQLD_USER@'
Aug 24 16:14:31 ip-10-0-0-155 systemd[1]: mysql.service: control process exited, code=exited status=1
Aug 24 16:14:31 ip-10-0-0-155 systemd[1]: Failed to start Percona XtraDB Cluster.
Aug 24 16:14:31 ip-10-0-0-155 systemd[1]: Unit mysql.service entered failed state.
=====

Looking at line 48 of /usr/bin/mysql-systemd:
=====
mysql*.log) install /dev/null -m0640 -o@MYSQLD_USER@ -g@MYSQLD_USER@ "$log" ;;
=====

Temporary workaround is to replace both '@MYSQLD_USER@' with 'mysql'. However, this doesn't survive package reinstallation or upgrade.

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-2003

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.