From 0130b310c2f7a817f4f8065645cc7c7435400335 Mon Sep 17 00:00:00 2001 From: Muhammad Usama Date: Tue, 8 Dec 2020 15:00:11 +0500 Subject: [PATCH] Delete any pre-existing watchdog command socket file at startup MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Abnormal termination of Pgpool leaves behind the dangling socket files and prevent Pgpool-II from starting up. The solution is to delete any pre-existing watchdog command socket file before binding a watchdog command socket. Patch provided by Masaya Kawamoto --- src/watchdog/watchdog.c | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/src/watchdog/watchdog.c b/src/watchdog/watchdog.c index 47ece977c..381161661 100644 --- a/src/watchdog/watchdog.c +++ b/src/watchdog/watchdog.c @@ -1302,14 +1302,8 @@ wd_create_command_server_socket(void) ereport(INFO, (errmsg("IPC socket path: \"%s\"", get_watchdog_ipc_address()))); - if (get_watchdog_process_needs_cleanup()) - { - /* - * If we are recovering from crash or abnormal termination of watchdog - * process. Unlink the old socket file - */ - unlink(addr.sun_path); - } + /* Delete any pre-existing socket file to avoid failure at bind() time */ + unlink(addr.sun_path); if (bind(sock, (struct sockaddr *) &addr, len) == -1) { -- 2.39.5