Fix that DB cluster path was not correct in watchdog_setup installation.
authorTatsuo Ishii <ishii@sraoss.co.jp>
Thu, 4 Feb 2021 02:28:57 +0000 (11:28 +0900)
committerTatsuo Ishii <ishii@sraoss.co.jp>
Thu, 4 Feb 2021 02:36:36 +0000 (11:36 +0900)
In the watchdog_setup installation generated path to DB clusters did
not correctly point to pgpool0/data0 etc. Correct them by using sed
command.

src/test/watchdog_setup.in

index ee5010cde8cedfa5174529ba6615812965bf2d91..ae262f95ab0622612d6bc789ac8c451aba0f94a3 100755 (executable)
@@ -1,6 +1,6 @@
 #!/usr/bin/env bash
 #
-# Copyright (c) 2013-2017 PgPool Global Development Group
+# Copyright (c) 2013-2021 PgPool Global Development Group
 #
 # Permission to use, copy, modify, and distribute this software and
 # its documentation for any purpose and without fee is hereby
@@ -299,11 +299,15 @@ do
     $PGPOOL_SETUP -m $MODE -p $port -pg $PGBASEPORT
     set_watchdog_params $cnt $W_NUM_PGPOOL $W_BASE_PORT
 
-    # remove "pg_ctl start" line from startall/shutdownall script in other than pgpool0
     if [ $cnt != 0 ]
     then
+       # remove "pg_ctl start" line from startall/shutdownall script in other than pgpool0
        sed -i '/.*data.*/d' startall
        sed -i '/.*data.*/d' shutdownall
+
+       # replace database cluster path to pgpool0 so that pgpool1 etc. share the cluster
+       PGPOOLCONF=etc/pgpool.conf
+       sed -i "/backend_data_directory/s/pgpool$cnt/pgpool0/g" $PGPOOLCONF
     fi
 
     echo "cd pgpool$cnt" >> $STARTALL