Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 14 Oct 2012 20:58:04 +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: r305893 - head/net/haproxy-devel/files
Message-ID:  <201210142058.q9EKw4C9041241@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: crees
Date: Sun Oct 14 20:58:04 2012
New Revision: 305893
URL: http://svn.freebsd.org/changeset/ports/305893

Log:
  Sync with net/haproxy
  
  Requested by:	demon (maintainer)
  Feature safe:	yes

Modified:
  head/net/haproxy-devel/files/haproxy.in

Modified: head/net/haproxy-devel/files/haproxy.in
==============================================================================
--- head/net/haproxy-devel/files/haproxy.in	Sun Oct 14 20:30:00 2012	(r305892)
+++ head/net/haproxy-devel/files/haproxy.in	Sun Oct 14 20:58:04 2012	(r305893)
@@ -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?201210142058.q9EKw4C9041241>