From owner-svn-ports-all@FreeBSD.ORG Mon Feb 9 13:06:12 2015 Return-Path: Delivered-To: svn-ports-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B8211203; Mon, 9 Feb 2015 13:06:12 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A25CFEA0; Mon, 9 Feb 2015 13:06:12 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t19D6CE2033235; Mon, 9 Feb 2015 13:06:12 GMT (envelope-from demon@FreeBSD.org) Received: (from demon@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t19D6CBU033234; Mon, 9 Feb 2015 13:06:12 GMT (envelope-from demon@FreeBSD.org) Message-Id: <201502091306.t19D6CBU033234@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: demon set sender to demon@FreeBSD.org using -f From: Dmitry Sivachenko Date: Mon, 9 Feb 2015 13:06:12 +0000 (UTC) To: ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org Subject: svn commit: r378727 - head/net/haproxy/files X-SVN-Group: ports-head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-ports-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the ports tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Feb 2015 13:06:12 -0000 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"