Uploaded image for project: 'Percona XtraDB Cluster'
  1. Percona XtraDB Cluster
  2. PXC-2003

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

    Details

    • Type: Bug
    • Status: Done
    • Priority: Low
    • Resolution: Duplicate
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: None
    • Labels:

      Description

      **Reported in Launchpad by Ashraf Sharif last update 24-08-2017 16:58:02

      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.

        Smart Checklist

          Attachments

            Issue Links

              Activity

                People

                • Assignee:
                  Unassigned
                  Reporter:
                  lpjirasync lpjirasync (Inactive)
                • Votes:
                  0 Vote for this issue
                  Watchers:
                  2 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved: