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
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)
{