Note: This is a beta release of Red Hat Bugzilla 5.0. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Also email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback here.
Bug 82152 - /etc/rc.d/init.d/mysqld with custom my.cnf error
Summary: /etc/rc.d/init.d/mysqld with custom my.cnf error
Status: CLOSED DUPLICATE of bug 76051
Alias: None
Product: Red Hat Linux
Classification: Retired
Component: mysql
Version: 7.1
Hardware: i386
OS: Linux
Target Milestone: ---
Assignee: Patrick Macdonald
QA Contact: David Lawrence
Depends On:
TreeView+ depends on / blocked
Reported: 2003-01-18 12:22 UTC by Diederick van Dijk
Modified: 2006-02-21 18:51 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Last Closed: 2006-02-21 18:51:14 UTC

Attachments (Terms of Use)

Description Diederick van Dijk 2003-01-18 12:22:20 UTC
Description of problem: 
I have a custom my.cnf where I relocate the datadir to /mysql/databases 
When starting the mysql server it says that I need to create the mysql 
database. But it's there and has been there for ages. It isn't in the default 
location /var/lib/mysql. Although it gives this warning the mysql starts up. 
But when I wan't to restart it it doesn't. I suspect it searches its pid file in 
the wrong place. 
Version-Release number of selected component (if applicable): 

Comment 1 Peter Wroblewski 2003-02-28 19:09:46 UTC
Note: I use mysql-server-3.23.54a-4 on RH 8.0 and mysql-server-3.23.54a-3.72 on
RH 7.2.

I also have a custom my.cnf file, where I specify a different datadir.
The problem is that the init script for mysql has datadir hard-coded into it, so
at the point where it checks for the existence of the 'mysql' subdirectory, it
hasn't read the my.cnf file yet. Naturally, I have the option of *modifying* the
init script, but since the file is not marked as a %config file, it will be
ruthlessly overwritten next time I upgrade the package.

Would it be possible to do one of the following:
1) make the init script take /etc/my.cnf into consideration for variable definitions
2) create a separate config file (such as /etc/sysconfig/mysqld) that would
duplicate some of the data stored in /etc/my.cnf (like the datadir location) and
one that would be taken into consideration for variable definitions
3) make /etc/rc.d/init.d/mysqld a config file

I think option 1) would be most desirable here -- it would require more work
than 3), but be as complete as 2) without duplication of configuration data

Comment 2 Patrick Macdonald 2003-03-12 16:45:42 UTC

This is a duplicate of 76051.  In that bug report Henning provides
a solution to the problem.  I've marked 76051 as an enhancement as
there is a work around available.  As soon as we finish clearing
the backlog and shipping associated errata, we'll investigate 

Both Peter and Henning make a good point about not wanting to
alter the mysqld script as it's not marked as %config. 

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

Comment 3 Red Hat Bugzilla 2006-02-21 18:51:14 UTC
Changed to 'CLOSED' state since 'RESOLVED' has been deprecated.

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