FreeBSD Bugzilla – Attachment 127963 Details for
Bug 171852
[PATCH] databases/mysql55-server: add support for multiple instances (profiles)
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
file.diff
file.diff (text/plain), 4.00 KB, created by
Frank Wall
on 2012-09-21 19:50:08 UTC
(
hide
)
Description:
file.diff
Filename:
MIME Type:
Creator:
Frank Wall
Created:
2012-09-21 19:50:08 UTC
Size:
4.00 KB
patch
obsolete
>--- databases/mysql55-server/files/mysql-server.in.orig 2012-09-20 16:26:05.550514234 +0200 >+++ databases/mysql55-server/files/mysql-server.in 2012-09-21 20:30:00.783520896 +0200 >@@ -1,6 +1,6 @@ > #!/bin/sh > # >-# $FreeBSD: ports/databases/mysql55-server/files/mysql-server.in,v 1.1 2012/08/05 23:19:36 dougb Exp $ >+# $FreeBSD$ > # > > # PROVIDE: mysql >@@ -11,13 +11,19 @@ > # Add the following line to /etc/rc.conf to enable mysql: > # mysql_enable (bool): Set to "NO" by default. > # Set it to "YES" to enable MySQL. >+# mysql_profiles (str): Set to "" by default. >+# Define your profiles here. > # mysql_limits (bool): Set to "NO" by default. > # Set it to yes to run `limits -e -U mysql` > # just before mysql starts. > # mysql_dbdir (str): Default to "/var/db/mysql" > # Base database directory. >-# mysql_pidfile (str): Custum PID file path and name. >+# mysql_pidfile (str): Custom PID file path and name. > # Default to "${mysql_dbdir}/${hostname}.pid". >+# mysql_bindip (str): Custom IP address to bind to. >+# Default is 0.0.0.0. >+# mysql_port (str): Custom port number. >+# Default is 3306. > # mysql_args (str): Custom additional arguments to be passed > # to mysqld_safe (default empty). > # >@@ -32,16 +38,78 @@ > : ${mysql_enable="NO"} > : ${mysql_limits="NO"} > : ${mysql_dbdir="/var/db/mysql"} >+: ${mysql_user="mysql"} >+: ${mysql_bindip="0.0.0.0"} >+: ${mysql_port="3306"} > >-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}" > procname="%%PREFIX%%/libexec/mysqld" > start_precmd="${name}_prestart" > start_postcmd="${name}_poststart" > mysql_install_db="%%PREFIX%%/bin/mysql_install_db" >+ >+if [ -n "$2" ]; then >+ profile="$2" >+ if [ "x${mysql_profiles}" != "x" ]; then >+ eval _bindip="\${mysql_${profile}_bindip}" >+ eval _port="\${mysql_${profile}_port}" >+ if [ "x$_bindip" = "x" ] && [ "x$_port" = "x" ]; then >+ echo "You must define either \"mysql_${profile}_port\" or \"mysql_${profile}_bindip\"" >+ exit 1 >+ fi >+ >+ eval mysql_enable="\${mysql_${profile}_enable:-${mysql_enable}}" >+ eval mysql_dbdir="\${mysql_${profile}_dbdir:-"/var/db/mysql-profile/${profile}"}" >+ eval pidfile="\${mysql_${profile}_pidfile:-"${mysql_dbdir}/${profile}.pid"}" >+ eval mysql_bindip="\${mysql_${profile}_bindip:-${mysql_bindip}}" >+ eval mysql_port="\${mysql_${profile}_port:-${mysql_port}}" >+ eval mysql_user="\${mysql_${profile}_user:-${mysql_user}}" >+ eval mysql_limits="\${mysql_${profile}_limits:-${mysql_limits}}" >+ eval mysql_args="\${mysql_${profile}_args:-${mysql_args}}" >+ else >+ echo "$0: extra argument ignored" >+ fi >+else >+ eval mysql_envvars=${envvars} >+ if [ "x${mysql_profiles}" != "x" -a "x$1" != "x" ]; then >+ for profile in ${mysql_profiles}; do >+ eval _enable="\${mysql_${profile}_enable}" >+ case "x${_enable:-${mysql_enable}}" in >+ x|x[Nn][Oo]|x[Nn][Oo][Nn][Ee]) >+ continue >+ ;; >+ x[Yy][Ee][Ss]) >+ ;; >+ *) >+ if test -z "$_enable"; then >+ _var=mysql_enable >+ else >+ _var=mysql_"${profile}"_enable >+ fi >+ echo "Bad value" \ >+ "'${_enable:-${mysql_enable}}'" \ >+ "for ${_var}. " \ >+ "Profile ${profile} skipped." >+ continue >+ ;; >+ esac >+ echo "===> mysql profile: ${profile}" >+ /usr/local/etc/rc.d/mysql-server $1 ${profile} >+ retcode="$?" >+ if [ "0${retcode}" -ne 0 ]; then >+ failed="${profile} (${retcode}) ${failed:-}" >+ else >+ success="${profile} ${success:-}" >+ fi >+ done >+ exit 0 >+ fi >+fi >+ >+# Construct arguments after the profile configuration has been processed. >+command_args="-c -f %%PREFIX%%/bin/mysqld_safe --defaults-extra-file=${mysql_dbdir}/my.cnf --user=${mysql_user} --datadir=${mysql_dbdir} --pid-file=${pidfile} --bind-address=${mysql_bindip} --port=${mysql_port} ${mysql_args}" > mysql_install_db_args="--basedir=%%PREFIX%% --datadir=${mysql_dbdir} --force" > > mysql_create_auth_tables()
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 171852
: 127963 |
127964