Date: Fri, 3 Oct 2014 15:40:31 +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: r369911 - in head/net: haproxy-devel/files haproxy/files Message-ID: <201410031540.s93FeV4b033979@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
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@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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201410031540.s93FeV4b033979>