Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 14 Oct 2012 11:46:53 +0000 (UTC)
From:      Chris Rees <crees@FreeBSD.org>
To:        ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org
Subject:   svn commit: r305869 - in head/net/haproxy: . files
Message-ID:  <201210141146.q9EBkrXV056565@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: crees
Date: Sun Oct 14 11:46:52 2012
New Revision: 305869
URL: http://svn.freebsd.org/changeset/ports/305869

Log:
  Remove superfluous setting of rc_flags, and remove single
  commands from functions
  
  Use standard message in _reload when not running
  
  Several microoptimisations and style fixes
  
  Approved by:	demon (maintainer)
  Feature safe:	yes

Modified:
  head/net/haproxy/Makefile
  head/net/haproxy/files/haproxy.in

Modified: head/net/haproxy/Makefile
==============================================================================
--- head/net/haproxy/Makefile	Sun Oct 14 11:25:22 2012	(r305868)
+++ head/net/haproxy/Makefile	Sun Oct 14 11:46:52 2012	(r305869)
@@ -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/
 

Modified: head/net/haproxy/files/haproxy.in
==============================================================================
--- head/net/haproxy/files/haproxy.in	Sun Oct 14 11:25:22 2012	(r305868)
+++ head/net/haproxy/files/haproxy.in	Sun Oct 14 11:46:52 2012	(r305869)
@@ -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"



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201210141146.q9EBkrXV056565>