CiscoCloud / haproxy-consul

Dynamic haproxy configuration using consul
Apache License 2.0
168 stars 85 forks source link

Using exec to launch consul-template, in order to take PID 1. #31

Open eesprit opened 8 years ago

eesprit commented 8 years ago

This tiny modification makes consul-template takes PID 1 over the initial bash process, which allow a better signal management (docker stop/kill will be forwarded to consul-template wich will andle it nicely and stop the "runner" - aka haproxy).

Without this, the docker stop signal (SIGTERM) is not forwarded to consul-template by bash, and the process is killed (SIGKILL) by docker after 10 seconds (default timeout), which is not really clean.

lalarsson commented 8 years ago

@eesprit I've checked your changes locally (with updates towards master) and it looks ok. @stevendborrelli This change looks ok.

lalarsson commented 8 years ago

@eesprit @stevendborrelli Change is present in master so there's no need for this PR anymore.