Bug 181614 - mysqld startup script contains hard-coded data path
Summary: mysqld startup script contains hard-coded data path
Keywords:
Status: CLOSED DUPLICATE of bug 76051
Alias: None
Product: Red Hat Enterprise Linux 3
Classification: Red Hat
Component: mysql
Version: 3.0
Hardware: x86_64
OS: Linux
medium
low
Target Milestone: ---
Assignee: Tom Lane
QA Contact: David Lawrence
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2006-02-15 14:23 UTC by Gavin Edwards
Modified: 2013-07-03 03:08 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2006-02-15 15:28:00 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Gavin Edwards 2006-02-15 14:23:52 UTC
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.0.1) Gecko/20060111 Firefox/1.5.0.1

Description of problem:
The /etc/rc.d/init.d/mysqld startup script contains a data path hard-coded into the script. This means that if you change mysqld's data directory in /etc/my.cnf you also have to manually edit the startup script.

This can't be intentional as it's trivial to include a statement to extract the path from /etc/my.cnf and under normal circumstances one wouldn't be expected to manually edit startup scripts.

Version-Release number of selected component (if applicable):
mysql-server-3.23.58-16.RHEL3.1

How reproducible:
Always

Steps to Reproduce:
1. Change datadir variable in /etc/my.cnf
2. Attempt to start mysqld for the first time when databases are to be initialised.
3. Watch it fail.
  

Actual Results:  In my particular case I moved the mysqld data path in /etc/my.cnf to /home/mysql and then put a softlink from the original path to the new path.

i.e.
cd /var/liv
mv mysql mysql.ORIG
ln -s /home/mysql mysql

During the database initialisation phase of the startup script it puts the initial databases in owned as root and then chowns the files. However, it performs a chown command "chown -R mysql:mysqm /var/lib/mysql" This only chown's the softlink and not the directory it points to and files therein.

So there seemed to be two solutions.
1) Change the datadir path in /etc/my.cnf to the new location
2) Manually edit the startup script to include a trailing slash in the chown command.

As it turns out, you have to edit the startup script either way thanks to the hard-coded data path.

Expected Results:  I would expect the startup script to enquire where the data path is configured in /etc/my.cnf

Additional info:

Comment 1 Tom Lane 2006-02-15 15:28:00 UTC
That is how it works as of RHEL4.  I am disinclined to change the behavior of
the script in RHEL3, though, since it seems at least as likely to break existing
installations as do anything very helpful for them :-(

*** This bug has been marked as a duplicate of 76051 ***


Note You need to log in before you can comment on or make changes to this bug.