[MDEV-8168] pid_file in my.cnf ignored Created: 2015-05-15  Updated: 2022-09-08

Status: Open
Project: MariaDB Server
Component/s: OTHER
Affects Version/s: 5.5, 10.0, 10.1
Fix Version/s: 10.1

Type: Bug Priority: Minor
Reporter: Carol Assignee: Sergei Golubchik
Resolution: Unresolved Votes: 1
Labels: verified
Environment:

RHEL 6.5. Tested on 10.0.12-MariaDB-log and 10.0.19-MariaDB-log


Attachments: File my.cnf    

 Description   

'pid_file' entry in my.cnf is ignored. PID file is created in datadir as $(hostname).pid.
'pid-file' works as spected.



 Comments   
Comment by Elena Stepanova [ 2015-05-18 ]

Hi,

Please provide your cnf file(s) and specify how you start the server.

Thanks.

Comment by Carol [ 2015-05-18 ]

my.cnf attached

[root@mytest01 ~]# service mysql start
Starting MySQL.                                            [  OK  ]
[root@mytest01 ~]# ls -l /var/run/mysql/
total 0
srwxrwxrwx 1 mysql mysql 0 May 18 12:15 3306.sock
[root@mytest01 ~]# ls -l /var/lib/data1/mysql/3306/
total 110716
-rw-rw---- 1 mysql mysql    16384 May 18 12:15 aria_log.00000001
-rw-rw---- 1 mysql mysql       52 May 18 12:15 aria_log_control
-rw-rw---- 1 mysql mysql        6 May 18 12:15 mytest01.local.lan.pid
-rw-rw---- 1 mysql mysql 12582912 May 18 12:15 ibdata1
-rw-rw---- 1 mysql mysql 50331648 May 18 12:15 ib_logfile0
-rw-rw---- 1 mysql mysql 50331648 May 18 11:53 ib_logfile1
-rw-rw---- 1 mysql mysql        0 May 18 11:56 multi-master.info
drwx------ 2 mysql root      4096 May 18 11:53 mysql
drwx------ 2 mysql mysql     4096 May 18 11:53 performance_schema
drwx------ 2 mysql root      4096 May 18 11:53 test

Comment by Carol [ 2015-05-18 ]

Could be related to issue MDEV-6095?

root     28189     1  0 13:00 pts/0    00:00:00 /bin/sh /usr/bin/mysqld_safe --datadir=/var/lib/data1/mysql/3306/ --pid-file=/var/lib/data1/mysql/3306//mytest01.local.lan.pid
mysql    28396 28189  3 13:00 pts/0    00:00:00 /usr/sbin/mysqld --basedir=/usr --datadir=/var/lib/data1/mysql/3306/ --plugin-dir=/usr/lib64/mysql/plugin --user=mysql --log-error=/var/log/mysql/3306-error.log --pid-file=/var/lib/data1/mysql/3306//mytest01.local.lan.pid --socket=/var/run/mysql/3306.sock

Comment by Elena Stepanova [ 2015-05-18 ]

Thank you.

It's a problem of the service init script (mysql.server.sh).
While mysqld_safe handles both dash and underscore in the options that it reads from the server config, the service script does not:

mysql.server.sh

...
      --log-basename=*|--hostname=*|--loose-log-basename=*)
        mysqld_pid_file_path=`echo "$arg.pid" | sed -e 's/^[^=]*=//'`
        ;;
      --pid-file=*) mysqld_pid_file_path=`echo "$arg" | sed -e 's/^[^=]*=//'` ;;
      --service-startup-timeout=*) service_startup_timeout=`echo "$arg" | sed -e 's/^[^=]*=//'` ;;
...

mysqld_safe.sh

...
     --basedir=*) MY_BASEDIR_VERSION="$val" ;;
      --datadir=*|--data=*) DATADIR="$val" ;;
      --pid[-_]file=*) pid_file="$val" ;;
      --plugin[-_]dir=*) PLUGIN_DIR="$val" ;;
...

Comment by Faustin Lammler [ 2018-08-16 ]

Same report here
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=874370

Generated at Thu Feb 08 07:25:09 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.