From 94cb5b94e792bc757b140cd9f39bfa751c0901f1 Mon Sep 17 00:00:00 2001 From: Christian Kruse Date: Thu, 16 Jan 2014 17:16:45 +0100 Subject: [PATCH] fix: reopen log file on SIGHUP --- repmgrd.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/repmgrd.c b/repmgrd.c index bd80c5ed..26b17d49 100644 --- a/repmgrd.c +++ b/repmgrd.c @@ -382,6 +382,12 @@ main(int argc, char **argv) PQfinish(myLocalConn); myLocalConn = establishDBConnection(local_options.conninfo, true); primaryConn = myLocalConn; + + if (*local_options.logfile) + { + freopen(local_options.logfile, "a", stderr); + } + update_registration(); } got_SIGHUP = false;