Handle SIGCHLD signal to avoid zombies inside a Docker container
Synchronize haproxy reloads

The haproxy reload command immediately returns, possibly before it has written
a new /var/lib/haproxy.pid with its own pid. A (nearly) concurrent second reload
command might read the old /var/lib/haproxy.pid and send a signal to the wrong
haproxy process (the very old one). The consequence is that now two haproxies are
running which do not know of each other.

This patch synchronizes the reload command executions by putting a semaphore
around the exec.Command call. Furthermore, the haproxy reload command is
modified in such a way that it waits for all processes in /var/lib/haproxy.pid
to die before returning.

Fixes #30.
Make SIGCHLD handler blocking via the signal channel
Merge pull request #33 from sttts/reload-race-condition

Synchronize haproxy reloads
Update README.md
Update README.md
Make haproxy server backend id unique

With the old haproxy configuration the server backend ids collide if the
same port is chosen by Marathon/Mesos on different hosts. This patch adds
the host name itself to the id to make them unique even with the same port.
Merge pull request #34 from sttts/same-ports-on-different-hosts

Make haproxy server backend id unique
Add ServicePort to App (for templates), remove dead config from README
and provide example of ServicePort usage
Merge pull request #38 from rasputnik/master

expose service port from marathon REST API
Update README.md
Update README.md

Spelling fix
Merge pull request #39 from jhmartin/readmespelling

Update README.md
support multiple marathon URLs
Combine sequential update events

We move the haproxy update and reload logic into a go routine which listens for
update requests on updateChan. If an update is already queued, the channel is
drained and another update request is sent. This way there can only be one
pending update queued. At the same time, no update can be missed.

By moving the real haproxy reload work into a go routine, the actual HTTP
handler remains fast and slim. Before this patch in real world environements it
took over 2 seconds to return. Marathon sometimes sends a lot of events
sequentially, leading to HTTP POST timeouts on Marathon's side if the HTTP
handler takes so long. This patch will fix this and at the same time reduce the
number of reloads to a minimum.
Make bamboo verbose on haproxy reload errors