Bug #61291 | 5.5 - scripts/mysql.server doesn't check for pid file on 'start' | ||
---|---|---|---|
Submitted: | 25 May 2011 22:08 | Modified: | 15 Aug 2012 16:56 |
Reporter: | Justin Rovang | Email Updates: | |
Status: | Can't repeat | Impact on me: | |
Category: | MySQL Server: Installing | Severity: | S2 (Serious) |
Version: | 5.5 | OS: | Linux (Ubuntu 10.4, Debian 6.0) |
Assigned to: | CPU Architecture: | Any | |
Tags: | init.d, mysql.server, pid check |
[25 May 2011 22:08]
Justin Rovang
[25 May 2011 22:26]
Justin Rovang
You could add something similar to what I see in my pre-canned debian init.d script to the 'start' case in the script (not sure what exit or logging you'd want) if [ -f "$mysqld_pid_file_path" ] && ps `cat $mysqld_pid_file_path` > /dev/null 2>&1 then echo "MySQL is already running" exit 0 fi
[26 May 2011 2:17]
Alexey Kishkin
verified as described. [root@archhome mysql]# ./support-files/mysql.server start Starting MySQL... SUCCESS! [root@archhome mysql]# ps ax |grep mysql 9422 pts/1 S 0:00 /bin/sh /usr/local/mysql/bin/mysqld_safe --datadir=/usr/local/mysql/data --pid-file=/usr/local/mysql/data/archhome.pid 9499 pts/1 Sl 0:00 /usr/local/mysql/bin/mysqld --basedir=/usr/local/mysql --datadir=/usr/local/mysql/data --plugin-dir=/usr/local/mysql/lib/plugin --user=mysql --log-error=/usr/local/mysql/data/archhome.err --pid-file=/usr/local/mysql/data/archhome.pid 9521 pts/1 S+ 0:00 grep mysql [root@archhome mysql]# ./support-files/mysql.server start Starting MySQL SUCCESS! [root@archhome mysql]# ps ax |grep mysql 9422 pts/1 S 0:00 /bin/sh /usr/local/mysql/bin/mysqld_safe --datadir=/usr/local/mysql/data --pid-file=/usr/local/mysql/data/archhome.pid 9499 pts/1 Sl 0:00 /usr/local/mysql/bin/mysqld --basedir=/usr/local/mysql --datadir=/usr/local/mysql/data --plugin-dir=/usr/local/mysql/lib/plugin --user=mysql --log-error=/usr/local/mysql/data/archhome.err --pid-file=/usr/local/mysql/data/archhome.pid 9528 pts/1 S 0:00 /bin/sh /usr/local/mysql/bin/mysqld_safe --datadir=/usr/local/mysql/data --pid-file=/usr/local/mysql/data/archhome.pid 9609 pts/1 Sl 0:00 /usr/local/mysql/bin/mysqld --basedir=/usr/local/mysql --datadir=/usr/local/mysql/data --plugin-dir=/usr/local/mysql/lib/plugin --user=mysql --log-error=/usr/local/mysql/data/archhome.err --pid-file=/usr/local/mysql/data/archhome.pid 9622 pts/1 S+ 0:00 grep mysql
[26 May 2011 2:19]
Alexey Kishkin
[root@archhome mysql]# bin/mysql ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)
[15 Jul 2011 0:13]
Justin Rovang
The same happens for the mysqld_multi script.
[22 Jun 2012 8:45]
Valeriy Kravchuk
I can not repeat this with 5.5.26: [openxs@chief 5.5]$ ./support-files/mysql.server start Starting MySQL... SUCCESS! [openxs@chief 5.5]$ ps aux | grep mysqld openxs 4673 0.1 0.0 108336 1432 pts/1 S 11:42 0:00 /bin/sh /home/openxs/dbs/5.5/bin/mysqld_safe --datadir=/home/openxs/dbs/5.5/data --pid-file=/home/openxs/dbs/5.5/data/chief.pid openxs 4776 2.9 2.2 457756 46056 pts/1 Sl 11:42 0:00 /home/openxs/dbs/5.5/bin/mysqld --basedir=/home/openxs/dbs/5.5 --datadir=/home/openxs/dbs/5.5/data --plugin-dir=/home/openxs/dbs/5.5/lib/plugin --log-error=/home/openxs/dbs/5.5/data/chief.err --pid-file=/home/openxs/dbs/5.5/data/chief.pid --socket=/tmp/mysql.sock openxs 4799 0.0 0.0 103376 824 pts/1 R+ 11:42 0:00 grep --color=auto mysqld [openxs@chief 5.5]$ bin/mysql -uroot test Reading table information for completion of table and column names You can turn off this feature to get a quicker startup with -A Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 1 Server version: 5.5.26-debug Source distribution Copyright (c) 2000, 2011, 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> exit Bye [openxs@chief 5.5]$ ./support-files/mysql.server start Starting MySQL SUCCESS! [openxs@chief 5.5]$ ps aux | grep mysqld openxs 4673 0.0 0.0 108336 1432 pts/1 S 11:42 0:00 /bin/sh /home/openxs/dbs/5.5/bin/mysqld_safe --datadir=/home/openxs/dbs/5.5/data --pid-file=/home/openxs/dbs/5.5/data/chief.pid openxs 4776 1.1 2.5 523552 50616 pts/1 Sl 11:42 0:00 /home/openxs/dbs/5.5/bin/mysqld --basedir=/home/openxs/dbs/5.5 --datadir=/home/openxs/dbs/5.5/data --plugin-dir=/home/openxs/dbs/5.5/lib/plugin --log-error=/home/openxs/dbs/5.5/data/chief.err --pid-file=/home/openxs/dbs/5.5/data/chief.pid --socket=/tmp/mysql.sock openxs 4891 0.0 0.0 103376 824 pts/1 R+ 11:42 0:00 grep --color=auto mysqld [openxs@chief 5.5]$ bin/mysql -uroot test Reading table information for completion of table and column names You can turn off this feature to get a quicker startup with -A Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 2 Server version: 5.5.26-debug Source distribution Copyright (c) 2000, 2011, 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. ... Probably fixed already.
[15 Aug 2012 16:56]
Justin Rovang
I can second that this has been fixed in 5.5.26 as well. I would say this should be closed - I would close it but I'm uncertain of the etiquette .