Bug #21275 Instance manager doesn't like three character path values in mysqld-path option
Submitted: 25 Jul 2006 14:05 Modified: 6 Sep 2006 12:47
Reporter: Harrison Fisk Email Updates:
Status: Can't repeat Impact on me:
None 
Category:Instance Manager Severity:S3 (Non-critical)
Version:5.0.22 OS:Linux (Linux 2.6.15 (Ubuntu 6.06 LTS))
Assigned to: Alexander Nozdrin CPU Architecture:Any

[25 Jul 2006 14:05] Harrison Fisk
Description:
When you use certain my.cnf options for multiple MySQL servers and manage it with the instance manager, the instance manager will sometimes parse things wrong which will result in an error when you attempt to start the instance.

The error you get is similar to:

060725  9:42:46 starting instance mysqld2
/usr/local/xxx/bin/mysqld: Too many arguments (first extra is '').
Use --help to get a list of available options

It appears to be linked to having three character paths in the mysqld-path variable, as if you specify a different, longer path name, then it works fine.  When you use this three character path, it then gives the error.  If you switch to a longer path, then it works fine.

How to repeat:
Create a my.cnf with the following in it:

[mysqld1]
nonguarded
basedir         = /usr/local/xxx
pid_file        = /tmp/mysql.pid
mysqld-path     = /usr/local/xxx/bin/mysqld
log-error       = /data/xxx/xxx.err

Create a symlink from /usr/local/xxx to /usr/local/mysql

Start the instance manager using this configuration file.

Login to the instance manager and attempt to start the instance called 'mysqld1'.

mysql> start instance mysqld1;
Query OK, 0 rows affected (0.00 sec)
Instance started

Notice that it doesn't start and there is a error produced on the instance manager screen.

Suggested fix:
Allow you to use 3 character path names in the mysqld-path option.
[6 Sep 2006 12:47] Alexander Nozdrin
Can not repeat this for 5.0.25BK.

------------------------------------------------------------------
/home/alik/.my.cnf
------------------------------------------------------------------
[mysql]

[client]
port                = 3307
socket              = /usr/local/mysql/var/mysqld.socket

[manager]
password-file       = /home/alik/MySQL/etc/mysqlmanager.passwd

[mysqld1]
server_id           = 1
port                = 50001
socket              = /usr/local/mysql/var/mysqld1.socket
nonguarded

max_allowed_packet  = 20000000
language            = /usr/local/mysql/share/mysql/english
character-sets-dir  = /usr/local/mysql/share/mysql/charsets
basedir             = /usr/local/xxx
datadir             = /usr/local/mysql/var
mysqld-path         = /usr/local/xxx/libexec/mysqld
pid_file            = /tmp/mysqld1.pid
log-error           = /data/xxx/xxx.err
skip-stack-trace
skip-innodb

[mysqld2]
server_id           = 2
port                = 50002
socket              = /home/alik/MySQL/var/5.0-rt-bug19718/mysqld2.socket
nonguarded

max_allowed_packet  = 20000000
language            = /home/alik/MySQL/devel/5.0-rt-bug19718/sql/share/english
character-sets-dir  = /home/alik/MySQL/devel/5.0-rt-bug19718/sql/share/charsets
basedir             = /home/alik/MySQL/devel/5.0-rt-bug19718
datadir             = /home/alik/MySQL/var/5.0-rt-bug19718
skip-stack-trace
skip-innodb
------------------------------------------------------------------

(alik)[/usr/local/mysql]> ll /usr/local/xxx
lrwxrwxrwx  1 root root 16 Sep  6 16:25 /usr/local/xxx -> /usr/local/mysql

(alik)[/usr/local/mysql]> ll /data/xxx/xxx.err
-rw-rw----  1 alik users 762 Sep  6 16:37 /data/xxx/xxx.err

------------------------------------------------------------------
/data/xxx/xxx.err
------------------------------------------------------------------
060906 16:37:13 [Note] /usr/local/xxx/libexec/mysqld: ready for connections.
Version: '5.0.25-debug'  socket: '/usr/local/mysql/var/mysqld1.socket'  port: 50001  Source distribution
060906 16:37:34 [Note] Got signal 3 to shutdown mysqld
060906 16:37:34 [Note] /usr/local/xxx/libexec/mysqld: Normal shutdown
060906 16:37:34 [Note] /usr/local/xxx/libexec/mysqld: Shutdown complete
------------------------------------------------------------------

------------------------------------------------------------------
(alik)[/usr/local/mysql]> /usr/local/mysql/libexec/mysqlmanager --defaults-file=~/.my.cnf
------------------------------------------------------------------
060906 16:36:46 loaded user alik
060906 16:36:46 loaded user alik2
060906 16:36:46 loaded user abc
060906 16:36:46 IM pid file: '/usr/local/mysql/var/mysqlmanager.pid'; PID: 12661.
060906 16:36:46 accepting connections on ip socket
060906 16:36:46 accepting connections on unix socket /tmp/mysqlmanager.sock
060906 16:37:05 accepted mysql connection 1
060906 16:37:05 connection 1 is checked successfully
060906 16:37:08 connection 1: packet_length=15, command=3
060906 16:37:08 query for connection 1 : ----
show instances
-------------------------
060906 16:37:08 query for connection 1 successefully parsed
060906 16:37:08 query for connection 1 executed ok
060906 16:37:13 connection 1: packet_length=23, command=3
060906 16:37:13 query for connection 1 : ----
start instance mysqld1
-------------------------
060906 16:37:13 query for connection 1 successefully parsed
060906 16:37:13 query for connection 1 executed ok
060906 16:37:13 starting instance mysqld1
060906 16:37:15 connection 1: packet_length=15, command=3
060906 16:37:15 query for connection 1 : ----
show instances
-------------------------
060906 16:37:15 query for connection 1 successefully parsed
060906 16:37:15 query for connection 1 executed ok
060906 16:37:21 connection 1: packet_length=1, command=1
060906 16:37:21 query for connection 1 received quit command
Quit
------------------------------------------------------------------

------------------------------------------------------------------
(alik)[~]> /usr/local/mysql/bin/mysql --socket=/tmp/mysqlmanager.sock -u alik -palik
------------------------------------------------------------------
mysql> show instances;
+---------------+---------+
| instance_name | status  |
+---------------+---------+
| mysqld1       | offline |
| mysqld2       | offline |
+---------------+---------+
2 rows in set (0.00 sec)

mysql> start instance mysqld1;
Query OK, 0 rows affected (0.00 sec)
Instance started

mysql> show instances;
+---------------+---------+
| instance_name | status  |
+---------------+---------+
| mysqld1       | online  |
| mysqld2       | offline |
+---------------+---------+
2 rows in set (0.00 sec)

mysql> Aborted

------------------------------------------------------------------
(alik)[~]> /usr/local/mysql/bin/mysql --socket=/usr/local/mysql/var/mysqld1.socket -u root mysql
------------------------------------------------------------------
mysql> select 1;
+---+
| 1 |
+---+
| 1 |
+---+
1 row in set (0.00 sec)

mysql> select version();
+--------------+
| version()    |
+--------------+
| 5.0.25-debug |
+--------------+
1 row in set (0.00 sec)
------------------------------------------------------------------