Comment 0 for bug 1712864

Revision history for this message
Ashraf Sharif (ashraf-sharif) wrote :

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 start the MySQL service fail, and 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" ;;

Replace both '@MYSQLD_USER@' with 'mysql' solves the problem.