systemctl start mysqld fails with timeout if socket isn't specified
Affects | Status | Importance | Assigned to | Milestone | ||
---|---|---|---|---|---|---|
Percona Server moved to https://jira.percona.com/projects/PS | Status tracked in 5.7 | |||||
5.5 |
New
|
Undecided
|
Unassigned | |||
5.6 |
New
|
Undecided
|
Unassigned | |||
5.7 |
Triaged
|
Medium
|
Unassigned |
Bug Description
This seems a regression / partial fix of https:/
Problem:
On RHEL 7, If socket variable isn't specified on my.cnf and datadir is set to a non-standard location, Percona-Server will create a socket on /var/lib/
pinger function from /usr/bin/
/*) adminsocket=
"") adminsocket=
*) adminsocket=
Start or restart mysql service via systemctl will fail due to timeout:
[root@localhost data]# systemctl restart mysql
Job for mysqld.service failed because a timeout was exceeded. See "systemctl status mysqld.service" and "journalctl -xe" for details.
root@localhost data]# mysql --socket=
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 1
Server version: 5.5.52-38.3 Percona Server (GPL), Release 38.3, Revision 109ad68
Copyright (c) 2009-2016 Percona LLC and/or its affiliates
Copyright (c) 2000, 2016, 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@localhost data]# cat /etc/my.cnf | grep socket
[root@localhost data]# cat /etc/my.cnf | grep datadir
datadir=/mysql/data
How to reproduce:
1) Install Percona-Server
2) Change datadir location on my.cnf
3) Remove socket configuration from my.cnf
4) run systemctl [re]start mysql
description: | updated |
tags: | added: pkg |
Changed in percona-server: | |
assignee: | nobody → Muhammad Irfan (muhammad-irfan) |
tags: | added: regression |
I'm able to reproduce this problem. The mysql-systemd post fails to ping when you don't have explicitly set a socket in my.cnf.
$ sh -x /usr/bin/ mysql-systemd post /data/db/ data/mysql. sock /data/db/ data/mysql. sock ping /data/db/ data/mysql. sock ping /data/db/ data/mysql. sock ping
+ case $socket in
+ adminsocket=
+ /bin/true
+ sleep 1
+ mysqladmin --socket=
+ /bin/true
+ sleep 1
+ mysqladmin --socket=
+ /bin/true
+ sleep 1
+ mysqladmin --socket=
+ /bin/true
+ sleep 1
^C
Socket file doesn't exist in data directory:
$ ls -ltr /data/db/ data/mysql. sock data/mysql. sock: No such file or directory
ls: cannot access /data/db/
After adding following line in [mysqld] section in my.cnf file
socket= /var/lib/ mysql/mysql. sock
Here is the output of mysql-systemd post after explicitly setting socket file in my.cnf:
$ sh -x /usr/bin/ mysql-systemd post /var/lib/ mysql/mysql. sock /var/lib/ mysql/mysql. sock /var/lib/ mysql/mysql. sock ping
+ socket=
+ case $socket in
+ adminsocket=
+ /bin/true
+ sleep 1
+ mysqladmin --socket=
+ break
+ exit 0