From 44df06cd32bf46817f4e2e43283cb13f195703e6 Mon Sep 17 00:00:00 2001 From: Tatsuo Ishii Date: Fri, 2 Apr 2021 14:14:08 +0900 Subject: [PATCH] Fix show pool_nodes when pg_isready is not in command search path. If pg_isready is not in the command search path, show pool_node's "pg_status" showed "down" because pg_isready cannot be invoked. To fix this, set Makefile variable PGSQL_BIN_DIR and use the path in the show pool_nodes. --- src/Makefile.am | 3 ++- src/utils/pool_process_reporting.c | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/Makefile.am b/src/Makefile.am index 03b8f6893..2756ac2ec 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -67,7 +67,8 @@ pgpool_SOURCES = main/main.c \ DEFS = @DEFS@ \ -DDEFAULT_CONFIGDIR=\"$(sysconfdir)\" \ - -DHEALTHCHECK_OPTS=$(HEALTHCHECK_DEBUG) + -DHEALTHCHECK_OPTS=$(HEALTHCHECK_DEBUG) \ + -DPGSQL_BIN_DIR=\"$(PGSQL_BIN_DIR)\" sysconf_DATA = sample/pgpool.conf.sample \ sample/pcp.conf.sample \ diff --git a/src/utils/pool_process_reporting.c b/src/utils/pool_process_reporting.c index 23e2e73a5..10dbc1654 100644 --- a/src/utils/pool_process_reporting.c +++ b/src/utils/pool_process_reporting.c @@ -2199,8 +2199,8 @@ char *db_node_status(int node) bkinfo = pool_get_node_info(node); host = bkinfo->backend_hostname; port = bkinfo->backend_port; - snprintf(command, sizeof(command), "pg_isready --dbname=%s --host=%s --port=%d --username=%s --quiet", - dbname, host, port, user); + snprintf(command, sizeof(command), "%s/pg_isready --dbname=%s --host=%s --port=%d --username=%s --quiet", + PGSQL_BIN_DIR, dbname, host, port, user); /* * Use pg_isready command to know if the backend is alive or not. */ -- 2.39.5