svn commit: r369911 - in head/net: haproxy-devel/files haproxy/files

Dmitry Sivachenko demon at FreeBSD.org
Fri Oct 3 15:40:32 UTC 2014


Author: demon
Date: Fri Oct  3 15:40:31 2014
New Revision: 369911
URL: https://svnweb.freebsd.org/changeset/ports/369911
QAT: https://qat.redports.org/buildarchive/r369911/

Log:
  Do not search for process by name;
  rather use all pids stored in pidfile, in multi-process mode haoroxy writes
  all pids there.
  
  PR:		192430
  Submitted by:	renchap at cocoa-x.com

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

Modified: head/net/haproxy-devel/files/haproxy.in
==============================================================================
--- head/net/haproxy-devel/files/haproxy.in	Fri Oct  3 15:37:21 2014	(r369910)
+++ head/net/haproxy-devel/files/haproxy.in	Fri Oct  3 15:40:31 2014	(r369911)
@@ -43,9 +43,9 @@ command="%%PREFIX%%/sbin/haproxy"
 # Load Configs/Set Defaults
 load_rc_config $name
 : ${haproxy_enable:="NO"}
-: ${haproxy_pidfile:="/var/run/haproxy.pid"}
+pidfile=${haproxy_pidfile:-"/var/run/haproxy.pid"}
 : ${haproxy_config:="%%PREFIX%%/etc/${name}.conf"}
-: ${haproxy_flags="-q -f ${haproxy_config} -p ${haproxy_pidfile}"}
+: ${haproxy_flags="-q -f ${haproxy_config} -p ${pidfile}"}
 procname=${command}
 
 # Update the globals
@@ -68,12 +68,12 @@ haproxy_reload()
 	if [ $? -ne 0 ]; then
 	    err 1 "Error found in ${haproxy_config} - not reloading current process!"
 	fi
-	rc_pid=$(check_process ${procname})
-	if [ -n "$rc_pid" ]; then
+	rc_pid=$(check_pidfile ${pidfile} ${command})
+	if [ $rc_pid ]; then
 		if [ $rc_force ]; then
-			${command} ${haproxy_flags} -st ${rc_pid}
+			${command} ${haproxy_flags} -st $(cat ${pidfile})
 		else
-			${command} ${haproxy_flags} -sf ${rc_pid}
+			${command} ${haproxy_flags} -sf $(cat ${pidfile})
 		fi
 	else
 		_run_rc_notrunning

Modified: head/net/haproxy/files/haproxy.in
==============================================================================
--- head/net/haproxy/files/haproxy.in	Fri Oct  3 15:37:21 2014	(r369910)
+++ head/net/haproxy/files/haproxy.in	Fri Oct  3 15:40:31 2014	(r369911)
@@ -43,9 +43,9 @@ command="%%PREFIX%%/sbin/haproxy"
 # Load Configs/Set Defaults
 load_rc_config $name
 : ${haproxy_enable:="NO"}
-: ${haproxy_pidfile:="/var/run/haproxy.pid"}
+pidfile=${haproxy_pidfile:-"/var/run/haproxy.pid"}
 : ${haproxy_config:="%%PREFIX%%/etc/${name}.conf"}
-: ${haproxy_flags="-q -f ${haproxy_config} -p ${haproxy_pidfile}"}
+: ${haproxy_flags="-q -f ${haproxy_config} -p ${pidfile}"}
 procname=${command}
 
 # Update the globals
@@ -68,12 +68,12 @@ haproxy_reload()
 	if [ $? -ne 0 ]; then
 	    err 1 "Error found in ${haproxy_config} - not reloading current process!"
 	fi
-	rc_pid=$(check_process ${procname})
-	if [ -n "$rc_pid" ]; then
+	rc_pid=$(check_pidfile ${pidfile} ${command})
+	if [ $rc_pid ]; then
 		if [ $rc_force ]; then
-			${command} ${haproxy_flags} -st ${rc_pid}
+			${command} ${haproxy_flags} -st $(cat ${pidfile})
 		else
-			${command} ${haproxy_flags} -sf ${rc_pid}
+			${command} ${haproxy_flags} -sf $(cat ${pidfile})
 		fi
 	else
 		_run_rc_notrunning


More information about the svn-ports-all mailing list