diff options
author | Steve Wills <swills@FreeBSD.org> | 2011-09-27 13:42:12 +0000 |
---|---|---|
committer | Steve Wills <swills@FreeBSD.org> | 2011-09-27 13:42:12 +0000 |
commit | ab95e61e3456f1e3bc1a62876e40f23126641022 (patch) | |
tree | f63e9b44fcad0cb52622e02a3b7d9be95eba000f /databases/mysql-proxy/files | |
parent | - Forced commit to note completion of repocopy from devel/py-zopeInterface (diff) |
- Improve rc script so that it only checks mysql_proxy_backend_addresses
on startup
- Various other rc cleanups
Submitted by: dougb
Notes
Notes:
svn path=/head/; revision=282487
Diffstat (limited to 'databases/mysql-proxy/files')
-rw-r--r-- | databases/mysql-proxy/files/mysql-proxy.in | 22 |
1 files changed, 13 insertions, 9 deletions
diff --git a/databases/mysql-proxy/files/mysql-proxy.in b/databases/mysql-proxy/files/mysql-proxy.in index 0a2f45be3dbf..03cdabf9ef8b 100644 --- a/databases/mysql-proxy/files/mysql-proxy.in +++ b/databases/mysql-proxy/files/mysql-proxy.in @@ -1,12 +1,10 @@ #!/bin/sh -# + # $FreeBSD$ # - # PROVIDE: mysql-proxy # REQUIRE: LOGIN # KEYWORD: shutdown - # # Add the following line to /etc/rc.conf to enable mysql-proxy: # mysql_proxy_enable (bool): Set to "NO" by default. @@ -35,15 +33,21 @@ load_rc_config $name : ${mysql_proxy_enable="NO"} : ${mysql_proxy_address=":4040"} : ${mysql_proxy_backend_addresses="127.0.0.1:3306"} -: ${mysql_proxy_pid_file="/var/run/mysql-proxy.pid"} -for addr in ${mysql_proxy_backend_addresses}; do - proxy_backend_addresses="${proxy_backend_addresses} --proxy-backend-addresses=${addr}" -done +start_precmd="${name}_prestart" + +mysql_proxy_prestart() +{ + local addr + + for addr in ${mysql_proxy_backend_addresses}; do + command_args="${command_args} --proxy-backend-addresses=${addr}" + done +} -pidfile="${mysql_proxy_pid_file}" +pidfile="${mysql_proxy_pid_file:-"/var/run/mysql-proxy.pid"}" command=%%PREFIX%%/libexec/mysql-proxy -command_args="--proxy-address=${mysql_proxy_address} ${proxy_backend_addresses} ${mysql_proxy_args} --daemon --pid-file=${mysql_proxy_pid_file}" +command_args="--proxy-address=${mysql_proxy_address} ${mysql_proxy_args} --daemon --pid-file=${pidfile}" procname=%%PREFIX%%/libexec/mysql-proxy run_rc_command "$1" |