Details
-
Bug
-
Status: Closed (View Workflow)
-
Minor
-
Resolution: Won't Fix
-
5.5.34, 10.0.6
-
None
-
RPM-based (e.g. Fedora 18/20)
Description
Courtesy of philip_38.
/etc/init.d/mysql script, among other smart logic, attempts to deduce the location of the datadir and the pidfile and passes them to mysqld_safe script.
By default, my.cnf file installed with the packages is empty, it does not have either basedir or datadir. So, /etc/init.d/mysql uses defaults: basedir=/usr, datadir=/var/lib/mysql, pidfile=$datadir/<name>.pid. All is good.
If one sets a non-default datadir in my.cnf, the script picks it up and adjusts the paths for datadir and pidfile accordingly. All is still good.
The problem starts when one sets a basedir explicitly in the cnf file (even if it's the same /usr), but does not set any datadir. In this case /etc/init.d/mysql deduces that the basedir was set to something, while datadir was not, and in an attempt to be smart it sets the datadir to $basedir/data rather than the default-default /var/lib/mysql. So, it ends up with datadir=/usr/data and pid_file=/usr/data/fedora20.pid. Since /usr/data does not exist, the pid file cannot be created, and the whole thing fails.
I think it's an unnecessary complication, deb packages are doing just fine without it. However, the changes should be careful since whatever weird logic the scripts have, somebody already relies on it.
Attachments
Issue Links
- relates to
-
MDEV-5334 Permission Error on softlink is wrong
- Closed