title: haproxy starts two processes, normal or not?
body: <p>background:I wrote a python script to read database, update haproxy.cfg and reload haproxy per minute. To avoid missing request, I referred to <a href="http://www.mgoff.in/2010/04/18/haproxy-reloading-your-config-with-minimal-service-impact/#wrapper" rel="nofollow">HAProxy: Reloading Your Config With Minimal Service Impact</a> and linux command "man haproxy".  Now, I reached the goal, and no bug appears yet.  What confused me is that two haproxy processes, sometimes three working at the same time. In other words, option '-sf' doesn't work always.  Is it normal or not, and why?
  <br />
  part of the python script is:</p>
  
  <pre><code>if 0 != os.system('/usr/local/sbin/haproxy -f /usr/local/sbin/haproxy.cfg -p /var/run/haproxy.pid -sf $(cat /var/run/haproxy.pid)'):
          print '[ERROR] restart haproxy fails'
  </code></pre>
  
  <p><br />
  the 'haproxy.cfg' file is like such:</p>
  
  <pre>
  global
          log 127.0.0.1   local3 info
          maxconn 5000
          daemon
          nbproc 1
  
  defaults
          log             global
          mode            tcp
          option          dontlognull
          retries         3
          maxconn         2000
          timeout connect    5000
          timeout client     50000
          timeout server     50000
  
  listen  xtbroker_1_20001_7080 0.0.0.0:58002
          mode    tcp
          balance roundrobin
          server xtbroker_1_20001_7080_0 127.0.0.1:58101 check inter 5000 rise 1 fall 2
          server xtbroker_1_20001_7080_1 127.0.0.1:58102 check inter 5000 rise 1 fall 2
  
  listen  xtbroker_1_21001_8090 0.0.0.0:58004
          mode    tcp
          balance roundrobin
          server xtbroker_1_21001_8090_0 127.0.0.1:58103 check inter 5000 rise 1 fall 2
  
  listen  xtbroker_1_21001_8888 0.0.0.0:58006
          mode    tcp
          balance roundrobin
          server xtbroker_1_21001_8888_0 127.0.0.1:58104 check inter 5000 rise 1 fall 2
  
  listen  xtbroker_1_21001_1001 0.0.0.0:58008
          mode    tcp
          balance roundrobin
          server xtbroker_1_21001_1001_0 127.0.0.1:58105 check inter 5000 rise 1 fall 2
          server xtbroker_1_21001_1001_1 127.0.0.1:58106 check inter 5000 rise 1 fall 2
          server xtbroker_1_21001_1001_2 127.0.0.1:58107 check inter 5000 rise 1 fall 2
          server xtbroker_1_21001_1001_3 127.0.0.1:58108 check inter 5000 rise 1 fall 2
          server xtbroker_1_21001_1001_4 127.0.0.1:58109 check inter 5000 rise 1 fall 2
  
  
  listen  xtbroker_1_21001_3010 0.0.0.0:58012
          mode    tcp
          balance roundrobin
          server xtbroker_1_21001_3010_0 127.0.0.1:58112 check inter 5000 rise 1 fall 2
  
  
  listen  xtbroker_1_21001_8060 0.0.0.0:58018
          mode    tcp
          balance roundrobin
          server xtbroker_1_21001_8060_0 127.0.0.1:58117 check inter 5000 rise 1 fall 2
          server xtbroker_1_21001_8060_1 127.0.0.1:58118 check inter 5000 rise 1 fall 2
  </pre>
  
  <p><br/></p>
  
  <pre>
  root@linux-kas9:/home/rzrk/server/pyScripts # ps aux | grep haproxy
  root     12258  0.0  0.0   6016  1552 ?        Ss   14:19   0:00 /usr/local/sbin/haproxy -f /usr/local/sbin/haproxy.cfg -p /var/run/haproxy.pid -sf 19512
  root     17500  0.0  0.0   5936  1152 ?        Ss   14:56   0:00 /usr/local/sbin/haproxy -f /usr/local/sbin/haproxy.cfg -p /var/run/haproxy.pid -sf 11722
  root     21187  0.0  0.0   5920   800 pts/4    S+   14:56   0:00 grep haproxy
  root     47545  0.0  0.0   5900  1524 ?        Ss   14:38   0:00 /usr/local/sbin/haproxy -f /usr/local/sbin/haproxy.cfg -p /var/run/haproxy.pid -sf 42333
  You have new mail in /var/mail/root
  </pre>