diff options
author | Dmitry Sivachenko <demon@FreeBSD.org> | 2013-10-04 12:37:58 +0000 |
---|---|---|
committer | Dmitry Sivachenko <demon@FreeBSD.org> | 2013-10-04 12:37:58 +0000 |
commit | dd2827e894e575c4effc8209e656c8ce58ea429d (patch) | |
tree | f04c7b03375efb59e4dcc7866f5508fbf856b1cf /net/haproxy/files/haproxy.in | |
parent | Make use of new option helpers. (diff) |
If running with nbproc > 1, haproxy spawns several processes and writes their
pids to $pidfile (one pid per line).
Our check_pidfile() from rc.subr will get only first pid and use it for
stop/status/etc which is incorrect.
Do not use pidfile for that, rather use $procname to get the list of running
haproxy processes.
[If you know how to do the same with pidfile, please tell me.]
Diffstat (limited to 'net/haproxy/files/haproxy.in')
-rw-r--r-- | net/haproxy/files/haproxy.in | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/net/haproxy/files/haproxy.in b/net/haproxy/files/haproxy.in index 73031792bc3b..e2caf3bb4f15 100644 --- a/net/haproxy/files/haproxy.in +++ b/net/haproxy/files/haproxy.in @@ -43,9 +43,10 @@ command="%%PREFIX%%/sbin/haproxy" # Load Configs/Set Defaults load_rc_config $name : ${haproxy_enable:="NO"} -pidfile=${haproxy_pidfile:-"/var/run/haproxy.pid"} +: ${haproxy_pidfile:="/var/run/haproxy.pid"} : ${haproxy_config:="%%PREFIX%%/etc/${name}.conf"} -: ${haproxy_flags="-q -f ${haproxy_config} -p ${pidfile}"} +: ${haproxy_flags="-q -f ${haproxy_config} -p ${haproxy_pidfile}"} +procname=${command} # Update the globals required_files=$haproxy_config @@ -67,8 +68,8 @@ haproxy_reload() if [ $? -ne 0 ]; then err 1 "Error found in ${haproxy_config} - not reloading current process!" fi - rc_pid=$(check_pidfile ${pidfile} ${command}) - if [ $rc_pid ]; then + rc_pid=$(check_process ${procname}) + if [ -n "$rc_pid" ]; then if [ $rc_force ]; then ${command} ${haproxy_flags} -st ${rc_pid} else |