mysqld_safe issue on debian stretch

hi,

After installing perconna mysql server 5.7 on a brand new debian stretch i was able to start the server but then all actions of /etc/init.d/mysql failed. I tracked the issue to the fact that the pid file in the config files is in /var/run/mysql but mysqld_safe create it under /var/lib/mysql. See:

GUEST:root@stretch01:[~]: /etc/init.d/mysql status
[info] Percona Server 5.7.19-17 is not running.
GUEST:root@stretch01:[~]: ps auxwf|grep mysql
root 1030 0.0 0.0 13388 1020 pts/2 S+ 15:28 0:00 _ grep mysql
GUEST:root@stretch01:[~]: find /etc/mysql/ -type f -exec grep -i pid {} ;
pid-file = /var/run/mysqld/mysqld.pid
pid_file = /var/run/mysqld/mysqld.pid <= yes i tried this _ one too ;p
pid-file = /var/run/mysqld/mysqld.pid
pid_file = /var/run/mysqld/mysqld.pid <= yes i tried this _ one too ;p
pid-file = /var/run/mysqld/mysqld.pid
pid-file = /var/run/mysqld/mysqld.pid
pid_file = /var/run/mysqld/mysqld.pid <= yes i tried this _ one too ;p
GUEST:root@stretch01:[~]: /etc/init.d/mysql start
GUEST:root@stretch01:[~]: ps auxwf|grep mysql
root 1172 0.0 0.0 13388 972 pts/2 S+ 15:29 0:00 _ grep mysql
mysql 1076 0.0 0.0 4288 1572 ? S 15:29 0:00 /bin/sh /usr/bin/mysqld_safe
mysql 1141 25.7 1.5 1158856 196944 ? Sl 15:29 0:01 _ /usr/sbin/mysqld --basedir=/usr --datadir=/var/lib/mysql --plugin-dir=/usr/lib/mysql/plugin --log-error=stretch01.aqueos.net.err --pid-file=stretch01.aqueos.net.pid

GUEST:root@stretch01:[~]: /etc/init.d/mysql status
[info] Percona Server 5.7.19-17 is not running.

GUEST:root@stretch01:[~]: ll /var/run/mysqld/mysqld.pid
ls: cannot access ‘/var/run/mysqld/mysqld.pid’: No such file or directory
GUEST:root@stretch01:[~]: ll /var/lib/mysql/stretch01.aqueos.net.pid
-rw-r----- 1 mysql mysql 5 oct. 25 15:29 /var/lib/mysql/stretch01.aqueos.net.pid

The command of the init.d script seems to be good:

GUEST:root@stretch01:[~]: my_print_defaults mysqld_safe pid-file | sed -n “s/^–pid-file=//p” | tail -n 1
/var/run/mysqld/mysqld.pid

but it does not transmit this to mysqld_safe that do not read any of the cnf files so it creates the pid at the default location that is $DATADIR/xxxx.pid

my_print_defaults in mysqld-safe needs a default file location and the scritp do not send it. /etc/init.d/mysql send just :

su - mysql -s /bin/bash -c “mysqld_safe > /dev/null &”

removing all pid-file in the *.cnf files make all works again as mysqld_safe AND /etc/init.d/mysql use the default

GUEST:root@stretch01:[~]: find /etc/mysql/ -type f -exec grep -i pid {} ;
#pid-file = /var/run/mysqld/mysqld.pid
#pid-file = /var/run/mysqld/mysqld.pid

GUEST:root@stretch01:[~]: /etc/init.d/mysql status
[info] Percona Server 5.7.19-17 is running.

GUEST:root@stretch01:[~]: /etc/init.d/mysql restart
[info] Stopping Percona Server 5.7.19-17.

[info] Percona Server 5.7.19-17 is stopped.
[info] Re-starting Percona Server 5.7.19-17.
GUEST:root@stretch01:[~]:

so the /etc/init.d/mysql read the config files but mysqld_safe do not making different settings from the default fail.

best regards,
ghislain.

ps: debian stretch with sysV init (no systemd)
perconna installed by using the personna repository for debian and apt-get install percona-server-server-5.7

ii percona-release 0.1-4.stretch all Package to install Percona gpg key and APT repo
ii percona-server-client-5.7 5.7.19-17-1.stretch amd64 Percona Server database client binaries
ii percona-server-common-5.7 5.7.19-17-1.stretch amd64 Percona Server database common files (e.g. /etc/mysql/my.cnf)
ii percona-server-server-5.7 5.7.19-17-1.stretch amd64 Percona Server database server binaries