Skip to content

Commit

Permalink
Add the trap for SIGTERM to enable respawning of etcd-proxy if SIGTER…
Browse files Browse the repository at this point in the history
…M is sent to all processes.
  • Loading branch information
feikesteenbergen committed May 27, 2015
1 parent 3af19a8 commit 1e279f0
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions postgres-appliance/postgres_ha.sh
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,14 @@ write_archive_command_environment
# for the -proxy on TDB the url of the etcd cluster
[ "$DEBUG" -eq 1 ] && exec /bin/bash

function noterm
{
echo "Received TERM signal, but not doing anything"
}

# resurrect etcd if it's gone
(
trap noterm SIGTERM
while true
do
etcd -name "proxy-$SCOPE" -proxy on --data-dir=etcd -discovery-srv $ETCD_DISCOVERY_URL
Expand Down

0 comments on commit 1e279f0

Please sign in to comment.