From: Tatsuo Ishii Date: Tue, 1 Apr 2025 06:45:40 +0000 (+0900) Subject: Test: skip inaccessible Unix socket directories. X-Git-Tag: V4_7_0_BETA1~135 X-Git-Url: http://waps.l3s.uni-hannover.de/gitweb/faq.html?a=commitdiff_plain;h=d766e4a812f2aa78bfc946449620c31e416958a4;p=pgpool2.git Test: skip inaccessible Unix socket directories. Commit 182b65bfc allows to use multiple Unix socket directories: /tmp and /var/run/postgresql. However if the system does not have accessible /var/run/postgresql, pgpool_setup fails unless $PGSOCKET_DIR is explicitly set. Instead of failing, this commit allows pgpool_setup to skip inaccessible directories. Backpatch-through: v4.5 --- diff --git a/src/test/pgpool_setup.in b/src/test/pgpool_setup.in index 00510037f..4eff7dd73 100644 --- a/src/test/pgpool_setup.in +++ b/src/test/pgpool_setup.in @@ -76,8 +76,24 @@ PGPOOLDIR=${PGPOOLDIR:-"@@PGPOOL_CONFIG_DIR@@"} PGBIN=${PGBIN:-"@@PGSQL_BIN_DIR@@"} # LD_LIBRARY_PATH LPATH=${PGLIB:-"@@PGSQL_LIB_DIR@@"} -# unix socket directory +# unix socket directories PGSOCKET_DIR=${PGSOCKET_DIR:-"/tmp,/var/run/postgresql"} +# remove inaccessible diretories from PGSOCKET_DIR +tmp=`echo $PGSOCKET_DIR|sed "s/,/ /"` +dir="" +first=true +for i in $tmp +do + if [ -w $i ];then + if [ $first != "true" ];then + dir="$dir,$i" + else + dir=$i + fi + fi + first=false +done +PGSOCKET_DIR=$dir # initdb args INITDBARG="--no-locale -E UTF_8" # Use replication slot