Skip to content

Commit

Permalink
Add SIGHUP handler for graceful reload of postgres service
Browse files Browse the repository at this point in the history
  • Loading branch information
miketonks committed Dec 8, 2015
1 parent 39ca5f3 commit 7087921
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions governor.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,15 @@ def shutdown(signal, frame):
postgresql.stop()
sys.exit(0)


def graceful_reload(signal, frame):
logging.info("Governor Running: Received HUP Signal - Reloading")
postgresql.reload()


# atexit.register(shutdown)
signal.signal(signal.SIGTERM, shutdown)
signal.signal(signal.SIGHUP, graceful_reload)

# wait for etcd to be available
splash()
Expand Down

0 comments on commit 7087921

Please sign in to comment.