Bug 75453 - [PATCH] Can't assign another db path via rc.conf for MySQL
Summary: [PATCH] Can't assign another db path via rc.conf for MySQL
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: Normal Affects Only Me
Assignee: Alex Dupre
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-12-24 05:10 UTC by Boris Kovalenko
Modified: 2005-02-15 23:03 UTC (History)
0 users

See Also:


Attachments
patch-mysql-server.sh (1.01 KB, text/plain)
2004-12-24 05:10 UTC, Boris Kovalenko
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Boris Kovalenko 2004-12-24 05:10:25 UTC
	I want to change my MySQL's database path, but can't do this via rc.conf,
	because mysql-server.sh sets mysql_dbdir itself.

Fix: Apply patch attached. This patch also enables to change mysql_user and uses
	different form of variables initialization.
	
How-To-Repeat: 	Try to set mysql_dbdir in rc.conf and start mysql.
Comment 1 Boris Kovalenko 2004-12-24 05:25:35 UTC
Boris Kovalenko wrote:
Hello!

	Sorry, smal fix to previous patch. This one should be used

--- mysql-server.sh.orig        Fri Dec 17 16:05:48 2004
+++ mysql-server.sh     Fri Dec 24 10:23:12 2004
@@ -23,17 +23,21 @@

  name="mysql"
  rcvar=`set_rcvar`
-mysql_dbdir="%%DB_DIR%%"
-mysql_user="mysql"
+
+load_rc_config $name
+
+: ${mysql_enable="NO"}
+: ${mysql_user="mysql"}
+: ${mysqllimits_enable="NO"}
+: ${mysqllimits_args="-e -U $mysql_user"}
+: ${mysql_dbdir="%%DB_DIR%%"}
+
  pidfile="${mysql_dbdir}/`/bin/hostname`.pid"
  command="%%PREFIX%%/bin/mysqld_safe"
  command_args="--user=${mysql_user} --datadir=${mysql_dbdir} 
--pid-file=${pidfile} > /dev/null &"
  procname="%%PREFIX%%/libexec/mysqld"
  start_precmd="${name}_prestart"

-[ -z "$mysql_enable" ]         && mysql_enable="NO"
-[ -z "$mysqllimits_enable" ]   && mysqllimits_enable="NO"
-[ -z "$mysqllimits_args" ]     && mysqllimits_args="-e -U ${mysql_user}"

  mysql_prestart()
  {
@@ -47,5 +51,4 @@
  required_dirs="${mysql_dbdir}"
  required_files="${mysql_dbdir}/mysql/host.frm 
${mysql_dbdir}/mysql/user.frm ${mysql_dbdir}/mysql/db.frm"

-load_rc_config $name
  run_rc_command "$1"

-- 
With respect,
	Boris
Comment 2 Mark Linimon freebsd_committer freebsd_triage 2004-12-24 20:38:34 UTC
State Changed
From-To: open->feedback

To which one of the various MySQL ports does this apply?
Comment 3 Boris Kovalenko 2004-12-25 04:48:57 UTC
Mark Linimon wrote:
Hello!

    This patch may be applied to mysql40-server, mysql41-server, 
mysql50-server ports because they use the same startup script.

>Synopsis: [PATCH] Can't assign another db path via rc.conf for MySQL
>
>State-Changed-From-To: open->feedback
>State-Changed-By: linimon
>State-Changed-When: Fri Dec 24 20:38:34 GMT 2004
>State-Changed-Why: 
>To which one of the various MySQL ports does this apply?
>
>http://www.freebsd.org/cgi/query-pr.cgi?pr=75453
>
>  
>
With respect,
    Boris
Comment 4 Mark Linimon freebsd_committer freebsd_triage 2004-12-25 05:37:40 UTC
State Changed
From-To: feedback->open

Feedback received.  As it turns out, the same maintainer looks after all 
the MySQL ports, but I probably forgot that at some point. 


Comment 5 Mark Linimon freebsd_committer freebsd_triage 2004-12-25 05:37:40 UTC
Responsible Changed
From-To: freebsd-ports-bugs->ale
Comment 6 Boris Kovalenko 2005-02-13 12:34:52 UTC
Hello!

	This PR is long time without response. MySQL ports were updated without 
review of this patch. May somebody review it and possible commit?

With respect,
	Boris
Comment 7 Alex Dupre freebsd_committer 2005-02-15 23:02:59 UTC
State Changed
From-To: open->closed

Feature added, thanks!