Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 9 Feb 2015 13:06:12 +0000 (UTC)
From:      Dmitry Sivachenko <demon@FreeBSD.org>
To:        ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org
Subject:   svn commit: r378727 - head/net/haproxy/files
Message-ID:  <201502091306.t19D6CBU033234@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: demon
Date: Mon Feb  9 13:06:11 2015
New Revision: 378727
URL: https://svnweb.freebsd.org/changeset/ports/378727
QAT: https://qat.redports.org/buildarchive/r378727/

Log:
  Fix stop action to stop correctly multi-process haproxy instance.
  
  PR:		197024
  Submitted by:	ard_1@mail.ru

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

Modified: head/net/haproxy/files/haproxy.in
==============================================================================
--- head/net/haproxy/files/haproxy.in	Mon Feb  9 12:45:27 2015	(r378726)
+++ head/net/haproxy/files/haproxy.in	Mon Feb  9 13:06:11 2015	(r378727)
@@ -31,6 +31,7 @@ rcvar=haproxy_enable
 command="%%PREFIX%%/sbin/haproxy"
 extra_commands="reload configtest"
 reload_cmd="haproxy_reload"
+stop_cmd="haproxy_stop"
 
 : ${haproxy_enable:="NO"}
 : ${haproxy_config:="%%PREFIX%%/etc/${name}.conf"}
@@ -100,4 +101,17 @@ haproxy_reload()
 	fi
 }
 
+haproxy_stop()
+{
+	rc_pid=$(check_pidfile ${pidfile} ${command})
+	if [ $rc_pid ]; then
+		rc_pid=$(cat ${pidfile})
+		kill -$sig_stop $rc_pid
+		wait_for_pids $rc_pid
+	else
+		_run_rc_notrunning
+		return 1
+	fi
+}
+
 run_rc_command "$1"



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