pgpool2.git / summary / log / commit / refs

commit    44df06cd32bf46817f4e2e43283cb13f195703e6
Author:   Tatsuo Ishii <ishii@sraoss.co.jp>
Date:     Fri Apr 02 05:14:08 2021 +0000

    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. */ [parent: 4462f9f1367e]