Date: Fri, 24 Dec 2004 10:04:19 +0500 From: Boris Kovalenko <boris@tagnet.ru> To: FreeBSD-gnats-submit@FreeBSD.org Subject: ports/75453: [PATCH] Can't assign another db path via rc.conf for MySQL Message-ID: <E1Chhch-0007ND-Il@boris.nikom.ru> Resent-Message-ID: <200412240510.iBO5APHd020424@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
>Number: 75453 >Category: ports >Synopsis: [PATCH] Can't assign another db path via rc.conf for MySQL >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-ports-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: update >Submitter-Id: current-users >Arrival-Date: Fri Dec 24 05:10:25 GMT 2004 >Closed-Date: >Last-Modified: >Originator: Boris Kovalenko >Release: FreeBSD 5.3-STABLE i386 >Organization: JSC TAGNet >Environment: System: FreeBSD boris.nikom.ru 5.3-STABLE FreeBSD 5.3-STABLE #0: Fri Dec 17 09:51:27 YEKT 2004 root@boris.nikom.ru:/usr/obj/usr/src/sys/BSYS i386 >Description: 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. >How-To-Repeat: Try to set mysql_dbdir in rc.conf and start mysql. >Fix: Apply patch attached. This patch also enables to change mysql_user and uses different form of variables initialization. --- patch-mysql-server.sh begins here --- --- mysql-server.sh.orig Fri Dec 17 16:05:49 2004 +++ mysql-server.sh Fri Dec 24 09:57:28 2004 @@ -23,17 +23,21 @@ name="mysql" rcvar=`set_rcvar` -mysql_dbdir="%%DB_DIR%%" -mysql_user="mysql" + +load_rc_config $name + +: ${mysql_enable="NO"} +: ${mysqllimits_enable="NO"} +: ${mysqllimits_args="-e -U ${mysql_user}"} +: ${mysql_dbdir="%%DB_DIR%%"} +: ${mysql_user="mysql"} + 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" --- patch-mysql-server.sh ends here --- >Release-Note: >Audit-Trail: >Unformatted:
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?E1Chhch-0007ND-Il>