diff options
author | Chris Rees <crees@FreeBSD.org> | 2012-10-14 11:46:52 +0000 |
---|---|---|
committer | Chris Rees <crees@FreeBSD.org> | 2012-10-14 11:46:52 +0000 |
commit | 65ec3f23db2c8fb56e3410d044b760fb484cfa62 (patch) | |
tree | 975b0b34553565104186fed33b3fb0d93d7e3d52 /net/haproxy | |
parent | 2821c45f279cf66fe1d7a3784f6d028ee867dba6 (diff) | |
download | ports-65ec3f23db2c8fb56e3410d044b760fb484cfa62.tar.gz ports-65ec3f23db2c8fb56e3410d044b760fb484cfa62.zip |
Notes
Diffstat (limited to 'net/haproxy')
-rw-r--r-- | net/haproxy/Makefile | 1 | ||||
-rw-r--r-- | net/haproxy/files/haproxy.in | 42 |
2 files changed, 13 insertions, 30 deletions
diff --git a/net/haproxy/Makefile b/net/haproxy/Makefile index 1efed5fd92d8..866d98c54543 100644 --- a/net/haproxy/Makefile +++ b/net/haproxy/Makefile @@ -7,6 +7,7 @@ PORTNAME= haproxy PORTVERSION= 1.4.22 +PORTREVISION= 1 CATEGORIES= net www MASTER_SITES= http://haproxy.1wt.eu/download/1.4/src/ diff --git a/net/haproxy/files/haproxy.in b/net/haproxy/files/haproxy.in index 823eb10109e5..73031792bc3b 100644 --- a/net/haproxy/files/haproxy.in +++ b/net/haproxy/files/haproxy.in @@ -43,28 +43,31 @@ command="%%PREFIX%%/sbin/haproxy" # Load Configs/Set Defaults load_rc_config $name : ${haproxy_enable:="NO"} +pidfile=${haproxy_pidfile:-"/var/run/haproxy.pid"} : ${haproxy_config:="%%PREFIX%%/etc/${name}.conf"} -: ${haproxy_pidfile:="/var/run/${name}.pid"} -: ${haproxy_flags="-q -f ${haproxy_config} -p ${haproxy_pidfile}"} +: ${haproxy_flags="-q -f ${haproxy_config} -p ${pidfile}"} # Update the globals -pidfile=${haproxy_pidfile} -required_files=${haproxy_config} +required_files=$haproxy_config # Commands: start, stop, restart, reload, configtest extra_commands="reload configtest" -configtest_cmd="haproxy_checkconfig" +configtest_cmd="$command -c -f $haproxy_config" +start_precmd="$command -q -c -f $haproxy_config" reload_cmd="haproxy_reload" +# For stopping, SIGUSR1 = softstop, SIGTERM = faststop +sig_stop=${rc_force:-USR1} + haproxy_reload() { # Check configuration file quietly first ${command} -q -c -f ${haproxy_config} if [ $? -ne 0 ]; then - err 1 "Error found in ${haproxy_config} - not reloading current process!" + err 1 "Error found in ${haproxy_config} - not reloading current process!" fi - rc_pid=$(check_pidfile ${haproxy_pidfile} ${command}) + rc_pid=$(check_pidfile ${pidfile} ${command}) if [ $rc_pid ]; then if [ $rc_force ]; then ${command} ${haproxy_flags} -st ${rc_pid} @@ -72,30 +75,9 @@ haproxy_reload() ${command} ${haproxy_flags} -sf ${rc_pid} fi else - err 1 "No process found. Maybe $command isn't running?" + _run_rc_notrunning + return 1 fi } -haproxy_checkconfig() -{ - ${command} -c -f ${haproxy_config} -} - -haproxy_prestart() -{ - ${command} -q -c -f ${haproxy_config} - rc_flags=${haproxy_flags} -} - -haproxy_prestop() -{ - # SIGUSR1 = softstop, SIGTERM = faststop - if [ $rc_force ]; then - sig_stop="SIGTERM" - else - sig_stop="SIGUSR1" - fi -} - - run_rc_command "$1" |