Bug 192430 - net/haproxy: rc.d script kills non-related processes
Summary: net/haproxy: rc.d script kills non-related processes
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: Dmitry Sivachenko
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-08-06 11:53 UTC by renchap
Modified: 2014-10-03 15:41 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description renchap 2014-08-06 11:53:51 UTC
http://svnweb.freebsd.org/ports?view=revision&revision=329298

This commit changes the reload command to handle multiple haproxy processes.
We run multiple haproxy instances, each one with a different configuration file, on the same server, and when we reload the main haproxy (handled by the default rc.d script) all other haproxy processes PIDs are used for haproxy -sf, killing all running instances.

It is a very dangerous behavior as the rc.d script kills processes not related to it. When using nbproc > 1, haproxy writes all the PIDs in the pidfile. The reload command can be changed to something like :
  ${command} ${haproxy_flags} -st $( cat $haproxy_pidfile )

This is what the debian init.d script does : http://anonscm.debian.org/cgit/pkg-haproxy/haproxy.git/tree/debian/haproxy.init#n69
Comment 1 John Marino freebsd_committer freebsd_triage 2014-08-06 13:53:24 UTC
over to maintainer...
Comment 2 commit-hook freebsd_committer freebsd_triage 2014-10-03 15:41:03 UTC
A commit references this bug:

Author: demon
Date: Fri Oct  3 15:40:32 UTC 2014
New revision: 369911
URL: https://svnweb.freebsd.org/changeset/ports/369911

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

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