From: Muhammad Usama Date: Tue, 8 Dec 2020 10:15:50 +0000 (+0500) Subject: Delete any pre-existing watchdog command socket file at startup X-Git-Tag: V3_6_25~19 X-Git-Url: http://git.postgresql.org/gitweb/static/gitweb.js?a=commitdiff_plain;h=31953646e3c58c4920ed3bc8dd67f7c8967712c0;p=pgpool2.git Delete any pre-existing watchdog command socket file at startup 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 --- diff --git a/src/watchdog/watchdog.c b/src/watchdog/watchdog.c index b7dddb6f3..0760f18c4 100644 --- a/src/watchdog/watchdog.c +++ b/src/watchdog/watchdog.c @@ -1207,13 +1207,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) {