Date: Sat, 20 Mar 2010 03:47:32 GMT From: Sevan Janiyan <venture37@geeklan.co.uk> To: FreeBSD-gnats-submit@FreeBSD.org Cc: ale@FreeBSD.org Subject: ports/144888: [PATCH] databases/mysql51-server: specify USE_LDCONFIG Message-ID: <201003200347.o2K3lWCF029560@tinderbox.thingamajig-systems.co.uk> Resent-Message-ID: <201003200350.o2K3o1n1048806@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
>Number: 144888 >Category: ports >Synopsis: [PATCH] databases/mysql51-server: specify USE_LDCONFIG >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-ports-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: change-request >Submitter-Id: current-users >Arrival-Date: Sat Mar 20 03:50:01 UTC 2010 >Closed-Date: >Last-Modified: >Originator: Sevan Janiyan >Release: FreeBSD 8.0-RELEASE-p2 i386 >Organization: >Environment: System: FreeBSD tinderbox.thingamajig-systems.co.uk 8.0-RELEASE-p2 FreeBSD 8.0-RELEASE-p2 #2: Mon Mar 1 00:17:47 GMT >Description: drop .sh extension from rc script Added file(s): - files/mysql-server.in Removed file(s): - files/mysql-server.sh.in Port maintainer (ale@FreeBSD.org) is cc'd. Generated with FreeBSD Port Tools 0.99 >How-To-Repeat: >Fix: --- mysql-server-5.1.45.patch begins here --- Index: Makefile =================================================================== RCS file: /home/ncvs/ports/databases/mysql51-server/Makefile,v retrieving revision 1.262 diff -u -u -r1.262 Makefile --- Makefile 18 Mar 2010 15:42:33 -0000 1.262 +++ Makefile 20 Mar 2010 03:45:57 -0000 @@ -19,6 +19,7 @@ SLAVEDIRS= databases/mysql51-client databases/mysql51-scripts GNU_CONFIGURE= yes MAKE_JOBS_SAFE= yes +USE_LDCONFIG= yes CONFIGURE_ARGS= --localstatedir=/var/db/mysql \ --without-debug \ @@ -98,7 +99,7 @@ CONFLICTS= mysql-server-[34].* mysql-server-5.[02-9].* -USE_RC_SUBR= mysql-server.sh +USE_RC_SUBR= mysql-server USERS= mysql GROUPS= mysql Index: files/mysql-server.in =================================================================== RCS file: files/mysql-server.in diff -N files/mysql-server.in --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ files/mysql-server.in 20 Mar 2010 03:45:57 -0000 @@ -0,0 +1,74 @@ +#!/bin/sh +# +# $FreeBSD: ports/databases/mysql51-server/files/mysql-server.sh.in,v 1.6 2008/07/30 06:11:16 ale Exp $ +# + +# PROVIDE: mysql +# REQUIRE: LOGIN +# KEYWORD: shutdown + +# +# 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_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_args (str): Custom additional arguments to be passed +# to mysqld_safe (default empty). +# + +. %%RC_SUBR%% + +name="mysql" +rcvar=`set_rcvar` + +load_rc_config $name + +: ${mysql_enable="NO"} +: ${mysql_limits="NO"} +: ${mysql_dbdir="/var/db/mysql"} +: ${mysql_args=""} + +mysql_user="mysql" +mysql_limits_args="-e -U ${mysql_user}" +pidfile="${mysql_dbdir}/`/bin/hostname`.pid" +command="%%PREFIX%%/bin/mysqld_safe" +command_args="--defaults-extra-file=${mysql_dbdir}/my.cnf --user=${mysql_user} --datadir=${mysql_dbdir} --pid-file=${pidfile} ${mysql_args} > /dev/null 2>&1 &" +procname="%%PREFIX%%/libexec/mysqld" +start_precmd="${name}_prestart" +start_postcmd="${name}_poststart" +mysql_install_db="%%PREFIX%%/bin/mysql_install_db" +mysql_install_db_args="--ldata=${mysql_dbdir}" + +mysql_create_auth_tables() +{ + eval $mysql_install_db $mysql_install_db_args >/dev/null 2>/dev/null + [ $? -eq 0 ] && chown -R ${mysql_user}:${mysql_user} ${mysql_dbdir} +} + +mysql_prestart() +{ + if [ ! -d "${mysql_dbdir}/mysql/." ]; then + mysql_create_auth_tables || return 1 + fi + if checkyesno mysql_limits; then + eval `/usr/bin/limits ${mysql_limits_args}` 2>/dev/null + else + return 0 + fi +} + +mysql_poststart() +{ + local timeout=15 + while [ ! -f "${pidfile}" -a ${timeout} -gt 0 ]; do + timeout=$(( timeout - 1 )) + sleep 1 + done + return 0 +} + +run_rc_command "$1" Index: files/mysql-server.sh.in =================================================================== RCS file: files/mysql-server.sh.in diff -N files/mysql-server.sh.in --- files/mysql-server.sh.in 30 Jul 2008 06:11:16 -0000 1.6 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,74 +0,0 @@ -#!/bin/sh -# -# $FreeBSD: ports/databases/mysql51-server/files/mysql-server.sh.in,v 1.6 2008/07/30 06:11:16 ale Exp $ -# - -# PROVIDE: mysql -# REQUIRE: LOGIN -# KEYWORD: shutdown - -# -# 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_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_args (str): Custom additional arguments to be passed -# to mysqld_safe (default empty). -# - -. %%RC_SUBR%% - -name="mysql" -rcvar=`set_rcvar` - -load_rc_config $name - -: ${mysql_enable="NO"} -: ${mysql_limits="NO"} -: ${mysql_dbdir="/var/db/mysql"} -: ${mysql_args=""} - -mysql_user="mysql" -mysql_limits_args="-e -U ${mysql_user}" -pidfile="${mysql_dbdir}/`/bin/hostname`.pid" -command="%%PREFIX%%/bin/mysqld_safe" -command_args="--defaults-extra-file=${mysql_dbdir}/my.cnf --user=${mysql_user} --datadir=${mysql_dbdir} --pid-file=${pidfile} ${mysql_args} > /dev/null 2>&1 &" -procname="%%PREFIX%%/libexec/mysqld" -start_precmd="${name}_prestart" -start_postcmd="${name}_poststart" -mysql_install_db="%%PREFIX%%/bin/mysql_install_db" -mysql_install_db_args="--ldata=${mysql_dbdir}" - -mysql_create_auth_tables() -{ - eval $mysql_install_db $mysql_install_db_args >/dev/null 2>/dev/null - [ $? -eq 0 ] && chown -R ${mysql_user}:${mysql_user} ${mysql_dbdir} -} - -mysql_prestart() -{ - if [ ! -d "${mysql_dbdir}/mysql/." ]; then - mysql_create_auth_tables || return 1 - fi - if checkyesno mysql_limits; then - eval `/usr/bin/limits ${mysql_limits_args}` 2>/dev/null - else - return 0 - fi -} - -mysql_poststart() -{ - local timeout=15 - while [ ! -f "${pidfile}" -a ${timeout} -gt 0 ]; do - timeout=$(( timeout - 1 )) - sleep 1 - done - return 0 -} - -run_rc_command "$1" --- mysql-server-5.1.45.patch ends here --- >Release-Note: >Audit-Trail: >Unformatted:
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201003200347.o2K3lWCF029560>