[bug-notifications] [mysql5 0004646]: /var/opt/csw/mysql5/my.cnf ignored

Mantis Bug Tracker noreply at opencsw.org
Tue Jan 4 22:18:50 CET 2011


A NOTE has been added to this issue. 
====================================================================== 
https://www.opencsw.org/mantis/view.php?id=4646 
====================================================================== 
Reported By:                james
Assigned To:                maciej
====================================================================== 
Project:                    mysql5
Issue ID:                   4646
Category:                   other
Reproducibility:            always
Severity:                   major
Priority:                   normal
Status:                     feedback
====================================================================== 
Date Submitted:             2010-12-22 13:49 CET
Last Modified:              2011-01-04 22:18 CET
====================================================================== 
Summary:                    /var/opt/csw/mysql5/my.cnf ignored
Description: 
The start up script:
/var/opt/csw/svc/method/svc-cswmysql5
has provision to use a local configuration:
MYSQL_VAR=/var/opt/csw/mysql5
CONFFILE=$MYSQL_VAR/my.cnf

but it fails:

WARNING: Found two instances of my.cnf -
/opt/csw/mysql5/my.cnf and
/var/opt/csw/mysql5/my.cnf
IGNORING /var/opt/csw/mysql5/my.cnf

If I can't write to /opt this is a problem and if I can then I'm wasting
my time in /var/opt anyway.



====================================================================== 

---------------------------------------------------------------------- 
 (0008666) maciej (manager) - 2011-01-04 22:18
 https://www.opencsw.org/mantis/view.php?id=4646#c8666 
---------------------------------------------------------------------- 
Phil: Your proposed change can only take effect if you export the
MYSQL_HOME variable, and if you reject the idea to use environment
variables to configure MySQL, your proposal is internally inconsistent.

I don't know if we can properly match MySQL's precedence pattern to ours.

MySQL:
/etc/my.cnf (global) ? SYSCONFDIR/my.cnf (global) ? $MYSQL_HOME/my.cnf
(server) ? defaults-extra-file (runtime) ? ~/.my.cnf (user)

OpenCSW:
global_sysconfdir (global) ? sysconfdir (global) [ ? runtime ? user ]

The only way that I can see that would work is to hard-patch the initial
/etc/my.cnf to /opt/csw/mysql5/my.cnf.

If you agree it's okay to export MYSQL_HOME, we can do the following in
the startup script[1]:

prefix="/opt/csw/mysql5"
BASEDIR="${prefix}"
MYSQL_VAR="/var${prefix}"
sysconfdir="/etc${prefix}"
if [ -r "${sysconfdir}/my.cnf" ]; then
  MYSQL_HOME="${MYSQL_VAR}"
elif [ -r "${BASEDIR}/my.cnf" ]; then
  MYSQL_HOME="${BASEDIR}"
fi
export MYSQL_HOME


I think that this is what achieves the right OpenCSW precedence.  If
/etc/opt/csw/mysql5/my.cnf is present, /opt/csw/mysql5/my.cnf is ignored.

I've built updated packages with the above code, smoke-tested them and put
them into experimental.  Please test!

[1]
https://sourceforge.net/apps/trac/gar/browser/csw/mgar/pkg/mysql5/branches/mysql-5.0.x/files/cswmysql5



More information about the bug-notifications mailing list