aboutsummaryrefslogtreecommitdiffstats
path: root/databases/pgpool-II-30
diff options
context:
space:
mode:
authorkuriyama <kuriyama@FreeBSD.org>2009-08-24 16:56:56 +0800
committerkuriyama <kuriyama@FreeBSD.org>2009-08-24 16:56:56 +0800
commit7a521e9e1eaa5d4744293c8648446109f5f989b5 (patch)
tree7ada85845671e84c2b53a1372db2d701b27ef7e5 /databases/pgpool-II-30
parent978649bbc8cd2173760ec588b31c47cf65e0f3d6 (diff)
downloadfreebsd-ports-gnome-7a521e9e1eaa5d4744293c8648446109f5f989b5.tar.gz
freebsd-ports-gnome-7a521e9e1eaa5d4744293c8648446109f5f989b5.tar.zst
freebsd-ports-gnome-7a521e9e1eaa5d4744293c8648446109f5f989b5.zip
- Upgrade to 2.2.4.
- Add my scripts in $FILES dir, but not installed (no warranty).
Diffstat (limited to 'databases/pgpool-II-30')
-rw-r--r--databases/pgpool-II-30/Makefile4
-rw-r--r--databases/pgpool-II-30/distinfo6
-rw-r--r--databases/pgpool-II-30/files/patch-recovery.c19
-rw-r--r--databases/pgpool-II-30/files/pgpool_copy_backup37
-rw-r--r--databases/pgpool-II-30/files/pgpool_remote_start13
-rw-r--r--databases/pgpool-II-30/files/pgpool_switch_xlog20
6 files changed, 94 insertions, 5 deletions
diff --git a/databases/pgpool-II-30/Makefile b/databases/pgpool-II-30/Makefile
index 0ebc691433b5..7b1e7dc687af 100644
--- a/databases/pgpool-II-30/Makefile
+++ b/databases/pgpool-II-30/Makefile
@@ -6,9 +6,9 @@
#
PORTNAME= pgpool-II
-PORTVERSION= 2.2.3
+PORTVERSION= 2.2.4
CATEGORIES= databases
-MASTER_SITES= http://pgfoundry.org/frs/download.php/2329/
+MASTER_SITES= http://pgfoundry.org/frs/download.php/2362/
MAINTAINER= kuriyama@FreeBSD.org
COMMENT= A connection pool server for PostgreSQL
diff --git a/databases/pgpool-II-30/distinfo b/databases/pgpool-II-30/distinfo
index 92586797a88e..74041e662b8d 100644
--- a/databases/pgpool-II-30/distinfo
+++ b/databases/pgpool-II-30/distinfo
@@ -1,3 +1,3 @@
-MD5 (pgpool-II-2.2.3.tar.gz) = a6bee08d6440765ffcea4e015c927717
-SHA256 (pgpool-II-2.2.3.tar.gz) = 3fbab1bdb3959d661ad14c93633785bdbeb176b3deeaad9e991be03d82feed13
-SIZE (pgpool-II-2.2.3.tar.gz) = 1038843
+MD5 (pgpool-II-2.2.4.tar.gz) = 2c9edd0512c5dc1dabab474b563a7a6c
+SHA256 (pgpool-II-2.2.4.tar.gz) = 49ac6ce7662c70685d88df4ade0a3166c00ce5ec7b131e8f4155ad5beebf3f53
+SIZE (pgpool-II-2.2.4.tar.gz) = 1039603
diff --git a/databases/pgpool-II-30/files/patch-recovery.c b/databases/pgpool-II-30/files/patch-recovery.c
new file mode 100644
index 000000000000..a6ac0c6bceca
--- /dev/null
+++ b/databases/pgpool-II-30/files/patch-recovery.c
@@ -0,0 +1,19 @@
+--- recovery.c.orig 2009-08-14 15:15:08.000000000 +0900
++++ recovery.c 2009-08-14 18:00:38.000000000 +0900
+@@ -91,7 +91,7 @@
+
+ pool_log("1st stage is done");
+
+- pool_log("starting 2nd stage");
++ pool_log("starting 2nd stage. waiting connections from clients to be closed");
+
+ /* 2nd stage */
+ *InRecovery = 1;
+@@ -332,6 +332,6 @@
+ sleep(3);
+ } while (i++ < WAIT_RETRY_COUNT);
+
+- pool_error("wait_connection_closed: existing connections did not close in %d sec.", pool_config->recovery_timeout);
++ pool_error("wait_connection_closed: existing connections (%d) did not close in %d sec.", Req_info->conn_counter, pool_config->recovery_timeout);
+ return 1;
+ }
diff --git a/databases/pgpool-II-30/files/pgpool_copy_backup b/databases/pgpool-II-30/files/pgpool_copy_backup
new file mode 100644
index 000000000000..31d0d4651921
--- /dev/null
+++ b/databases/pgpool-II-30/files/pgpool_copy_backup
@@ -0,0 +1,37 @@
+#!/bin/sh
+#
+# $FreeBSD$
+
+SRC=pgsql@$(hostname)
+SRCDIR=$1
+DEST=pgsql@$2
+DESTDIR=$3
+ARCLOG=$1/archive_log
+
+logger="logger -t pgpool -p local0.info"
+rsync="/usr/local/bin/rsync -av --delete --checksum"
+excl="--exclude=pg_log --exclude=archive_log --exclude=postmaster.pid"
+psql=/usr/local/bin/psql
+
+/bin/sh <<EOF | ${logger} 2>&1
+
+$psql -c "select pg_start_backup('pgpool-recovery')" template1
+
+ssh $DEST "
+/usr/local/etc/rc.d/postgresql stop;
+rm -rf $DESTDIR/pg_xlog;
+rm -f $DESTDIR/backup_label"
+
+echo "restore_command = 'scp $SRC:$ARCLOG/%f %p'" > $SRCDIR/recovery.conf
+
+$rsync $SRCDIR/ $excl $DEST:/$DESTDIR/
+
+ssh $DEST "
+mkdir -p $DESTDIR/pg_xlog/archive_status;
+mkdir -p $DESTDIR/pg_log"
+
+rm -f $SRCDIR/recovery.conf
+
+$psql -c 'select pg_stop_backup()' template1
+
+EOF
diff --git a/databases/pgpool-II-30/files/pgpool_remote_start b/databases/pgpool-II-30/files/pgpool_remote_start
new file mode 100644
index 000000000000..66a628b725fd
--- /dev/null
+++ b/databases/pgpool-II-30/files/pgpool_remote_start
@@ -0,0 +1,13 @@
+#!/bin/sh
+#
+# $FreeBSD$
+
+DEST=pgsql@$1
+
+logger="logger -t pgpool -p local0.info"
+
+/bin/sh <<EOF | ${logger} 2>&1
+
+ssh $DEST '/usr/local/etc/rc.d/postgresql start'
+
+EOF
diff --git a/databases/pgpool-II-30/files/pgpool_switch_xlog b/databases/pgpool-II-30/files/pgpool_switch_xlog
new file mode 100644
index 000000000000..8ce8b8603a46
--- /dev/null
+++ b/databases/pgpool-II-30/files/pgpool_switch_xlog
@@ -0,0 +1,20 @@
+#!/bin/sh
+#
+# $FreeBSD$
+
+logger="logger -t pgpool -p local0.info"
+psql=/usr/local/bin/psql
+
+/bin/sh <<EOF | ${logger} 2>&1
+
+$psql -t -c 'SELECT datname FROM pg_database WHERE NOT datistemplate AND datallowconn' template1 |
+while read i
+do
+ if [ "$i" != "" ];then
+ $psql -c "SELECT setval(oid, nextval(oid)) FROM pg_class WHERE relkind = 'S'" $i
+ fi
+done
+
+$psql -c 'select pg_switch_xlog()' template1
+
+EOF