[MDEV-9349] mysqld_safe bug with --basedir option Created: 2015-12-30 Updated: 2016-01-13 Resolved: 2016-01-13 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | OTHER |
| Affects Version/s: | 10.1.9 |
| Fix Version/s: | N/A |
| Type: | Bug | Priority: | Minor |
| Reporter: | Quanah Gibson-Mount (Inactive) | Assignee: | Unassigned |
| Resolution: | Cannot Reproduce | Votes: | 0 |
| Labels: | None | ||
| Environment: |
Linux (Any) |
||
| Description |
|
When running multiple instances of mariadb, if mysqld_safe is passed the "basedir" option, it will fail to start the second instance of mariadb with: [zimbra@zre-ldap005 ~]$ /opt/zimbra/common/bin/mysqld_safe --basedir=/opt/zimbra/common --defaults-file=/opt/zimbra/conf/antispam-my.cnf --external-locking --malloc-lib=/opt/zimbra/common/lib/libtcmalloc_minimal.so --datadir=/opt/zimbra/data/amavisd/mysql/data --log-error=/opt/zimbra/log/antispam-mysqld.log --ledir=/opt/zimbra/common/sbin Removing the --basedir option allows it to successfully start: Note that this is the exact basedir value provided in the cnf file: It appears the issue is that the other mysql instance is running with the same basedir value: However, there is nothing wrong with two instances of mysqld having the same value for basedir, as the entire point is for mysqld to be sharing the same binaries. |
| Comments |
| Comment by Elena Stepanova [ 2016-01-13 ] | |||||||||||||||||||||||||||||||||||
|
There is indeed nothing wrong with running different instances of mysqld out of the same basedir, we do it all the time, it works just fine. There is something wrong with your example though.
cannot work. It will pass both options in the same order to the server, and the server cannot handle defaults-file when it's not the first option. However, it should just fail, and should not throw the message mysqld_safe A mysqld process already exists, this is also wrong. It happens when mysqld_safe finds a pid file in the location where it plans to create one, and when this pid file contains a pid of a process which is already running. There is no pid-file option on your command line, so I'm not sure what it will set it to, probably /opt/zimbra/data/amavisd/mysql/data/<hostname>.pid. So, if fixing the first part (the order or options) won't make the problem go away, check where it finds the pid file, and whether there is a process with the pid from this pid file. | |||||||||||||||||||||||||||||||||||
| Comment by Quanah Gibson-Mount (Inactive) [ 2016-01-13 ] | |||||||||||||||||||||||||||||||||||
|
Ok, thanks for the info. It's interesting, because this used to work just fine with the order, and was this way for years. So something got more strict at some point. In any case, since we already define the basedir in the config file, I stopped passing it in as an option to msyqld_safe. | |||||||||||||||||||||||||||||||||||
| Comment by Elena Stepanova [ 2016-01-13 ] | |||||||||||||||||||||||||||||||||||
|
Actually no, it has been like that for years. See 5.5.23 (this is 3.5 years ago):
If it had ever been different for you, maybe you really had a customized mysqld_safe script. | |||||||||||||||||||||||||||||||||||
| Comment by Quanah Gibson-Mount (Inactive) [ 2016-01-13 ] | |||||||||||||||||||||||||||||||||||
|
Yeah, this portion of our code was unused for many years. I.e., 5.0 or before. It wasn't until I dusted it off that I found that it had stopped working. |