diff options
author | swills <swills@FreeBSD.org> | 2011-09-27 21:42:12 +0800 |
---|---|---|
committer | swills <swills@FreeBSD.org> | 2011-09-27 21:42:12 +0800 |
commit | 7abdd5406c2f34342ebd64c0b540fc565669c073 (patch) | |
tree | ad82061aaf5b37e05a1fe9811a933271b3db9dc8 /databases | |
parent | 3937377aeecf746ce48af64914b5f2217ac260b6 (diff) | |
download | freebsd-ports-gnome-7abdd5406c2f34342ebd64c0b540fc565669c073.tar.gz freebsd-ports-gnome-7abdd5406c2f34342ebd64c0b540fc565669c073.tar.zst freebsd-ports-gnome-7abdd5406c2f34342ebd64c0b540fc565669c073.zip |
- Improve rc script so that it only checks mysql_proxy_backend_addresses
on startup
- Various other rc cleanups
Submitted by: dougb
Diffstat (limited to 'databases')
-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" |