From nobody@FreeBSD.org  Sat Oct  6 17:48:38 2012
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52])
	by hub.freebsd.org (Postfix) with ESMTP id 780321065670
	for <freebsd-gnats-submit@FreeBSD.org>; Sat,  6 Oct 2012 17:48:38 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from red.freebsd.org (red.freebsd.org [IPv6:2001:4f8:fff6::22])
	by mx1.freebsd.org (Postfix) with ESMTP id 494C28FC0A
	for <freebsd-gnats-submit@FreeBSD.org>; Sat,  6 Oct 2012 17:48:38 +0000 (UTC)
Received: from red.freebsd.org (localhost [127.0.0.1])
	by red.freebsd.org (8.14.5/8.14.5) with ESMTP id q96HmcCb087345
	for <freebsd-gnats-submit@FreeBSD.org>; Sat, 6 Oct 2012 17:48:38 GMT
	(envelope-from nobody@red.freebsd.org)
Received: (from nobody@localhost)
	by red.freebsd.org (8.14.5/8.14.5/Submit) id q96HmcJU087344;
	Sat, 6 Oct 2012 17:48:38 GMT
	(envelope-from nobody)
Message-Id: <201210061748.q96HmcJU087344@red.freebsd.org>
Date: Sat, 6 Oct 2012 17:48:38 GMT
From: Daniel Ylitalo <daniel@produktion203.se>
To: freebsd-gnats-submit@FreeBSD.org
Subject: Allow to specify my.cnf path in /etc/rc.conf
X-Send-Pr-Version: www-3.1
X-GNATS-Notify:

>Number:         172408
>Category:       ports
>Synopsis:       databases/mysql55-server: Allow to specify my.cnf path in /etc/rc.conf
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    ale
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Sat Oct 06 17:50:24 UTC 2012
>Closed-Date:    Tue Apr 23 09:00:21 UTC 2013
>Last-Modified:  Fri May 17 14:30:00 UTC 2013
>Originator:     Daniel Ylitalo
>Release:        9.0-p4
>Organization:
203 Web Group AB
>Environment:
FreeBSD xxxx.myserver.com 9.0-RELEASE-p4 FreeBSD 9.0-RELEASE-p4 #0: Fri Oct  5 22:26:18 CEST 2012     daniel@xxxx.myserver.com:/usr/obj/usr/src/sys/GENERIC  amd64
>Description:
Right now you have to have the my.cnf file in your dbdir, which isnt optimal in all cases (for example when using a deploysystem that handles all the configfiles)
>How-To-Repeat:

>Fix:
Attached as patch

Patch attached with submission follows:

*** /usr/local/etc/rc.d/mysql-server        Fri Sep 21 04:02:03 2012
--- /usr/local/etc/rc.d/mysql-server        Sat Oct  6 13:43:40 2012
***************
*** 30,45 ****
  load_rc_config $name

  : ${mysql_enable="NO"}
  : ${mysql_limits="NO"}
  : ${mysql_dbdir="/var/db/mysql"}

  mysql_user="mysql"
  mysql_limits_args="-e -U ${mysql_user}"
  pidfile=${mysql_pidfile:-"${mysql_dbdir}/`/bin/hostname`.pid"}
  command="/usr/sbin/daemon"
! command_args="-c -f /usr/local/bin/mysqld_safe --defaults-extra-file=${mysql_dbdir}/my.cnf --user=${mysql_user} --datadir=${mysql_dbdir} --pid-file=${pidfile} ${mysql_args}"
  procname="/usr/local/libexec/mysqld"
  start_precmd="${name}_prestart"
  start_postcmd="${name}_poststart"
  mysql_install_db="/usr/local/bin/mysql_install_db"
  mysql_install_db_args="--basedir=/usr/local --datadir=${mysql_dbdir} --force"
--- 30,46 ----
  load_rc_config $name

  : ${mysql_enable="NO"}
  : ${mysql_limits="NO"}
  : ${mysql_dbdir="/var/db/mysql"}
+ : ${mysql_configfile="${mysql_dbdir}/my.cnf"}

  mysql_user="mysql"
  mysql_limits_args="-e -U ${mysql_user}"
  pidfile=${mysql_pidfile:-"${mysql_dbdir}/`/bin/hostname`.pid"}
  command="/usr/sbin/daemon"
! command_args="-c -f /usr/local/bin/mysqld_safe --defaults-extra-file=${mysql_configfile} --user=${mysql_user} --datadir=${mysql_dbdir} --pid-file=${pidfile} ${mysql_args}"
  procname="/usr/local/libexec/mysqld"
  start_precmd="${name}_prestart"
  start_postcmd="${name}_poststart"
  mysql_install_db="/usr/local/bin/mysql_install_db"
  mysql_install_db_args="--basedir=/usr/local --datadir=${mysql_dbdir} --force"


>Release-Note:
>Audit-Trail:

From: Mark Linimon <linimon@lonesome.com>
To: Daniel Ylitalo <daniel@produktion203.se>
Cc: freebsd-gnats-submit@FreeBSD.org
Subject: Re: ports/172408: Allow to specify my.cnf path in /etc/rc.conf
Date: Sat, 6 Oct 2012 13:10:43 -0500

 To which port does this PR apply?
 
 mcl

From: Daniel Ylitalo <daniel@produktion203.se>
To: Mark Linimon <linimon@lonesome.com>
Cc: freebsd-gnats-submit@FreeBSD.org
Subject: Re: ports/172408: Allow to specify my.cnf path in /etc/rc.conf
Date: Sat, 06 Oct 2012 20:15:37 +0200

 sorry for not specifying that one, its databases/mysql55-server :)
 
 // Daniel
 
 Mark Linimon skrev 2012-10-06 20:10:
 > To which port does this PR apply?
 >
 > mcl
 
Responsible-Changed-From-To: freebsd-ports-bugs->ale 
Responsible-Changed-By: edwin 
Responsible-Changed-When: Sat Oct 6 19:37:46 UTC 2012 
Responsible-Changed-Why:  
Over to maintainer (via the GNATS Auto Assign Tool) 

http://www.freebsd.org/cgi/query-pr.cgi?pr=172408 
State-Changed-From-To: open->closed 
State-Changed-By: ale 
State-Changed-When: Tue Apr 23 08:59:30 UTC 2013 
State-Changed-Why:  
That's only one of the default paths where my.cnf is searched. 
Look at MySQL docs for a complete list. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=172408 

From: Daniel Ylitalo <daniel@203core.se>
To: ale@FreeBSD.org
Cc: daniel@produktion203.se, freebsd-gnats-submit@FreeBSD.org
Subject: Re: ports/172408: databases/mysql55-server: Allow to specify my.cnf
 path in /etc/rc.conf
Date: Tue, 23 Apr 2013 12:57:33 +0200

 This is a multi-part message in MIME format.
 --------------080601050002060700010305
 Content-Type: text/plain; charset=ISO-8859-1; format=flowed
 Content-Transfer-Encoding: 7bit
 
 The point with the whole patch was that you would be able to specify 
 where mysql should look for the my.cnf file from the rc.conf (because 
 mine isnt located in a default path due to our deploysystem which has a 
 repo for all configs).
 
 Many other ports has this implementation already, (ie openvpn, lighttpd, 
 haproxy among others)
 
 Best regards
 Daniel Ylitalo
 
 <www.203webgroup.se>
 ale@FreeBSD.org skrev 2013-04-23 11:00:
 > Synopsis: databases/mysql55-server: Allow to specify my.cnf path in /etc/rc.conf
 >
 > State-Changed-From-To: open->closed
 > State-Changed-By: ale
 > State-Changed-When: Tue Apr 23 08:59:30 UTC 2013
 > State-Changed-Why:
 > That's only one of the default paths where my.cnf is searched.
 > Look at MySQL docs for a complete list.
 >
 > http://www.freebsd.org/cgi/query-pr.cgi?pr=172408
 
 
 --------------080601050002060700010305
 Content-Type: text/html; charset=ISO-8859-1
 Content-Transfer-Encoding: 7bit
 
 <html>
   <head>
     <meta content="text/html; charset=ISO-8859-1"
       http-equiv="Content-Type">
   </head>
   <body text="#000000" bgcolor="#FFFFFF">
     <div class="moz-cite-prefix">The point with the whole patch was that
       you would be able to specify where mysql should look for the
       my.cnf file from the rc.conf (because mine isnt located in a
       default path due to our deploysystem which has a repo for all
       configs).<br>
       <br>
       Many other ports has this implementation already, (ie openvpn,
       lighttpd, haproxy among others)<br>
       <br>
       <div class="moz-signature">
         <meta http-equiv="content-type" content="text/html;
           charset=ISO-8859-1">
         <title></title>
         <!--[if !mso]>
 <style>
 v\:* {behavior:url(#default#VML);}
 o\:* {behavior:url(#default#VML);}
 w\:* {behavior:url(#default#VML);}
 .shape {behavior:url(#default#VML);}
 </style>
 <![endif]-->
         <style>
 <!--
 @font-face
 	{font-family:"Cambria Math";
 	panose-1:2 4 5 3 5 4 6 3 2 4;}
 @font-face
 	{font-family:Calibri;
 	panose-1:2 15 5 2 2 2 4 3 2 4;}
 @font-face
 	{font-family:Tahoma;
 	panose-1:2 11 6 4 3 5 4 4 2 4;}
 span.MsoNormal, li.MsoNormal, div.MsoNormal
 	{margin:0cm;
 	margin-bottom:.0001pt;
 	font-size:11.0pt;
 	color:black;
 	font-family:"Calibri","sans-serif";}
 a:link
 	{mso-style-priority:99;
 	color:blue;
 	text-decoration:underline;}
 a:visited
 	{mso-style-priority:99;
 	color:purple;
 	text-decoration:underline;}
 @page Section1
 	{size:612.0pt 792.0pt;
 	margin:70.85pt 70.85pt 70.85pt 70.85pt;}
 div.Section1
 	{page:Section1;}
 -->
   </style><!--[if gte mso 9]><xml>
  <o:shapedefaults v:ext="edit" spidmax="2050" />
 </xml><![endif]--><!--[if gte mso 9]><xml>
  <o:shapelayout v:ext="edit">
   <o:idmap v:ext="edit" data="1" />
  </o:shapelayout></xml><![endif]-->
         <div class="Section1"> <span class="MsoNormal">Best regards<br>
             Daniel Ylitalo<br>
             <br>
           </span><a href="www.203webgroup.se"><span style="font-size:
               9pt; color: rgb(89, 89, 89);" class="MsoNormal"></span></a>
         </div>
       </div>
       <a class="moz-txt-link-abbreviated" href="mailto:ale@FreeBSD.org">ale@FreeBSD.org</a> skrev 2013-04-23 11:00:<br>
     </div>
     <blockquote
       cite="mid:201304230900.r3N90KgF062235@freefall.freebsd.org"
       type="cite">
       <pre wrap="">Synopsis: databases/mysql55-server: Allow to specify my.cnf path in /etc/rc.conf
 
 State-Changed-From-To: open-&gt;closed
 State-Changed-By: ale
 State-Changed-When: Tue Apr 23 08:59:30 UTC 2013
 State-Changed-Why: 
 That's only one of the default paths where my.cnf is searched.
 Look at MySQL docs for a complete list.
 
 <a class="moz-txt-link-freetext" href="http://www.freebsd.org/cgi/query-pr.cgi?pr=172408">http://www.freebsd.org/cgi/query-pr.cgi?pr=172408</a>
 </pre>
     </blockquote>
     <br>
   </body>
 </html>
 
 --------------080601050002060700010305--

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: ports/172408: commit references a PR
Date: Wed, 24 Apr 2013 15:08:30 +0000 (UTC)

 Author: ale
 Date: Wed Apr 24 15:08:22 2013
 New Revision: 316439
 URL: http://svnweb.freebsd.org/changeset/ports/316439
 
 Log:
   Allow to specify server-specific option file path in /etc/rc.conf
   
   PR:		ports/172408
   Submitted by:	Daniel Ylitalo <daniel@produktion203.se>
 
 Modified:
   head/databases/mysql55-server/files/mysql-server.in
   head/databases/mysql56-server/files/mysql-server.in
 
 Modified: head/databases/mysql55-server/files/mysql-server.in
 ==============================================================================
 --- head/databases/mysql55-server/files/mysql-server.in	Wed Apr 24 14:21:12 2013	(r316438)
 +++ head/databases/mysql55-server/files/mysql-server.in	Wed Apr 24 15:08:22 2013	(r316439)
 @@ -16,6 +16,8 @@
  #			just before mysql starts.
  # mysql_dbdir (str):	Default to "/var/db/mysql"
  #			Base database directory.
 +# mysql_optfile (str):	Server-specific option file.
 +#			Default to "${mysql_dbdir}/my.cnf".
  # mysql_pidfile (str):	Custum PID file path and name.
  #			Default to "${mysql_dbdir}/${hostname}.pid".
  # mysql_args (str):	Custom additional arguments to be passed
 @@ -32,12 +34,13 @@ load_rc_config $name
  : ${mysql_enable="NO"}
  : ${mysql_limits="NO"}
  : ${mysql_dbdir="/var/db/mysql"}
 +: ${mysql_optfile="${mysql_dbdir}/my.cnf"}
  
  mysql_user="mysql"
  mysql_limits_args="-e -U ${mysql_user}"
  pidfile=${mysql_pidfile:-"${mysql_dbdir}/`/bin/hostname`.pid"}
  command="/usr/sbin/daemon"
 -command_args="-c -f %%PREFIX%%/bin/mysqld_safe --defaults-extra-file=${mysql_dbdir}/my.cnf --user=${mysql_user} --datadir=${mysql_dbdir} --pid-file=${pidfile} ${mysql_args}"
 +command_args="-c -f %%PREFIX%%/bin/mysqld_safe --defaults-extra-file=${mysql_optfile} --user=${mysql_user} --datadir=${mysql_dbdir} --pid-file=${pidfile} ${mysql_args}"
  procname="%%PREFIX%%/libexec/mysqld"
  start_precmd="${name}_prestart"
  start_postcmd="${name}_poststart"
 
 Modified: head/databases/mysql56-server/files/mysql-server.in
 ==============================================================================
 --- head/databases/mysql56-server/files/mysql-server.in	Wed Apr 24 14:21:12 2013	(r316438)
 +++ head/databases/mysql56-server/files/mysql-server.in	Wed Apr 24 15:08:22 2013	(r316439)
 @@ -16,6 +16,8 @@
  #			just before mysql starts.
  # mysql_dbdir (str):	Default to "/var/db/mysql"
  #			Base database directory.
 +# mysql_optfile (str):	Server-specific option file.
 +#			Default to "${mysql_dbdir}/my.cnf".
  # mysql_pidfile (str):	Custum PID file path and name.
  #			Default to "${mysql_dbdir}/${hostname}.pid".
  # mysql_args (str):	Custom additional arguments to be passed
 @@ -32,12 +34,13 @@ load_rc_config $name
  : ${mysql_enable="NO"}
  : ${mysql_limits="NO"}
  : ${mysql_dbdir="/var/db/mysql"}
 +: ${mysql_optfile="${mysql_dbdir}/my.cnf"}
  
  mysql_user="mysql"
  mysql_limits_args="-e -U ${mysql_user}"
  pidfile=${mysql_pidfile:-"${mysql_dbdir}/`/bin/hostname`.pid"}
  command="/usr/sbin/daemon"
 -command_args="-c -f %%PREFIX%%/bin/mysqld_safe --defaults-extra-file=${mysql_dbdir}/my.cnf --user=${mysql_user} --datadir=${mysql_dbdir} --pid-file=${pidfile} ${mysql_args}"
 +command_args="-c -f %%PREFIX%%/bin/mysqld_safe --defaults-extra-file=${mysql_optfile} --user=${mysql_user} --datadir=${mysql_dbdir} --pid-file=${pidfile} ${mysql_args}"
  procname="%%PREFIX%%/libexec/mysqld"
  start_precmd="${name}_prestart"
  start_postcmd="${name}_poststart"
 _______________________________________________
 svn-ports-all@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/svn-ports-all
 To unsubscribe, send any mail to "svn-ports-all-unsubscribe@freebsd.org"
 

From: Daniel Ylitalo <daniel@203core.se>
To: Alex Dupre <ale@FreeBSD.org>
Cc: freebsd-gnats-submit@FreeBSD.org
Subject: Re: ports/172408: databases/mysql55-server: Allow to specify my.cnf
 path in /etc/rc.conf
Date: Fri, 17 May 2013 16:19:57 +0200

 This is a multi-part message in MIME format.
 --------------030903070201010300030300
 Content-Type: text/plain; charset=ISO-8859-1; format=flowed
 Content-Transfer-Encoding: 7bit
 
 I found a minor bug<www.203webgroup.se> regarding this.
 
 You do not have the argument --defaults-extra-file=${mysql_optfile} in 
 the mysql_install_db_args variable so if you have a custom var that is 
 used for mysql_install_db it will fail and use the default settings 
 while mysqld uses the my.cnf values.
 
 Correct values would be:
 mysql_install_db_args="--basedir=/usr/local --datadir=${mysql_dbdir} 
 --defaults-extra-file=${mysql_optfile} --force"
 
 This was found with /usr/ports/databases/mysql56-server
 
 Best regards
 Daniel
 
 Alex Dupre skrev 2013-04-24 17:12:
 > Daniel Ylitalo ha scritto:
 >> The point with the whole patch was that you would be able to specify
 >> where mysql should look for the my.cnf file from the rc.conf (because
 >> mine isnt located in a default path due to our deploysystem which has a
 >> repo for all configs).
 > After thinking twice I like the idea, commmitted, thanks.
 >
 
 
 --------------030903070201010300030300
 Content-Type: text/html; charset=ISO-8859-1
 Content-Transfer-Encoding: 7bit
 
 <html>
   <head>
     <meta content="text/html; charset=ISO-8859-1"
       http-equiv="Content-Type">
   </head>
   <body text="#000000" bgcolor="#FFFFFF">
     <div class="moz-cite-prefix"><span class="MsoNormal">I found a minor
         bug</span><a href="www.203webgroup.se"><span style="font-size:
           9pt; color: rgb(89, 89, 89);" class="MsoNormal"></span></a>
       regarding this.<br>
       <br>
       You do not have the argument
       --defaults-extra-file=${mysql_optfile} in the
       mysql_install_db_args variable so if you have a custom var that is
       used for mysql_install_db it will fail and use the default
       settings while mysqld uses the my.cnf values.<br>
       <br>
       Correct values would be:<br>
       mysql_install_db_args="--basedir=/usr/local
       --datadir=${mysql_dbdir} --defaults-extra-file=${mysql_optfile}
       --force"<br>
       <br>
       This was found with /usr/ports/databases/mysql56-server<br>
       <br>
       Best regards<br>
       Daniel<br>
       <br>
       <div class="moz-signature">
       </div>
       Alex Dupre skrev 2013-04-24 17:12:<br>
     </div>
     <blockquote cite="mid:5177F655.3070903@FreeBSD.org" type="cite">
       <pre wrap="">Daniel Ylitalo ha scritto:
 </pre>
       <blockquote type="cite">
         <pre wrap="">The point with the whole patch was that you would be able to specify
 where mysql should look for the my.cnf file from the rc.conf (because
 mine isnt located in a default path due to our deploysystem which has a
 repo for all configs).
 </pre>
       </blockquote>
       <pre wrap="">
 After thinking twice I like the idea, commmitted, thanks.
 
 </pre>
     </blockquote>
     <br>
   </body>
 </html>
 
 --------------030903070201010300030300--
>Unformatted:
