Added init script for autovacuum. (#68114)
authorMasatomo Nakano <nakano@gentoo.org>
Sat, 6 Nov 2004 19:26:26 +0000 (19:26 +0000)
committerMasatomo Nakano <nakano@gentoo.org>
Sat, 6 Nov 2004 19:26:26 +0000 (19:26 +0000)
dev-db/postgresql/ChangeLog
dev-db/postgresql/Manifest
dev-db/postgresql/files/pg_autovacuum.conf-8.0.0_beta3 [new file with mode: 0644]
dev-db/postgresql/files/pg_autovacuum.init-8.0.0_beta3 [new file with mode: 0644]
dev-db/postgresql/postgresql-8.0.0_beta3.ebuild

index befb36c9ee0b0e95f93a294d442fcdddd1b29718..23af1f2207e1598f7ab0977d67a6a0c543b0afc2 100644 (file)
@@ -1,6 +1,11 @@
 # ChangeLog for dev-db/postgresql
 # Copyright 2002-2004 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/dev-db/postgresql/ChangeLog,v 1.150 2004/11/05 13:50:17 nakano Exp $
+# $Header: /var/cvsroot/gentoo-x86/dev-db/postgresql/ChangeLog,v 1.151 2004/11/06 19:26:26 nakano Exp $
+
+  06 Nov 2004; Masatomo Nakano <nakano@gentoo.org>
+  +files/pg_autovacuum.conf-8.0.0_beta3,
+  +files/pg_autovacuum.init-8.0.0_beta3, postgresql-8.0.0_beta3.ebuild:
+  Added init script for autovacuum. (#68114)
 
   05 Nov 2004; Masatomo Nakano <nakano@gentoo.org> postgresql-7.3.8.ebuild,
   postgresql-7.4.6.ebuild:
index 0effdfadf03798af380be73473c0d4079389573d..0c2bad54d8d01368049ffa897f225214e7dc9add 100644 (file)
@@ -3,12 +3,12 @@ MD5 404b1d7d7a17778e8bc07087cee4f38e postgresql-7.4.3-r1.ebuild 10053
 MD5 c52dff5ec13ba6c008528fa42f226508 postgresql-7.4.5-r2.ebuild 10115
 MD5 50439b62313c31ff953d8325556480be postgresql-7.3.8.ebuild 7978
 MD5 34401cfece56ea7997bf68e0da495eb3 postgresql-7.4.6.ebuild 10142
-MD5 afd64dedb8ded9a9cf95cbb85caec6af postgresql-8.0.0_beta3.ebuild 6846
+MD5 ed46555c61a42131fa8f09551ac41e55 postgresql-8.0.0_beta3.ebuild 7050
 MD5 43cd40217c38d9cb9b6a2449d50c8095 postgresql-7.3.7-r2.ebuild 7950
 MD5 f21ab43b9a00dca552cd35c635241df7 postgresql-7.4.3.ebuild 9760
 MD5 fa39b30de3679dba54a788f4a4632e92 postgresql-7.4.5-r1.ebuild 10083
 MD5 b5bf2b1222e5fa77a17b0163f0f22d25 postgresql-7.4.5.ebuild 10070
-MD5 0f10d14fc43faf44fd136aeefc457b07 ChangeLog 26917
+MD5 bbf9583c0c7310b4d9bd2240a0217474 ChangeLog 27127
 MD5 f8d3d207746da2a3cd14dcaab8daab76 metadata.xml 163
 MD5 cd9e32f5a21def1a4e2d1ac0e042aa47 files/postgresql-7.3.7-gentoo.patch 529
 MD5 e9a2e5278a70bebace44f1ecf38129e6 files/postgresql-7.4.6-gentoo.patch 1160
@@ -52,4 +52,6 @@ MD5 2e87af398df0a957bf2f2dff754ac174 files/postgresql-7.4.5-vacuum-delay.patch 8
 MD5 2b0c84d2c26622573d4e2b7e0518fdad files/postgresql.conf 375
 MD5 7b8bf110e22829c7040aa1e87afa371c files/postgresql-7.4.3-gentoo.patch 631
 MD5 18249476d920987d48972156c34bec75 files/postgresql-7.4.5-r1-gentoo.patch 1160
+MD5 999379432735e7e6a71ec6ccd5a784e1 files/pg_autovacuum.conf-8.0.0_beta3 302
+MD5 bd52e7f304d4fde1b7bf2e83a45ec2fc files/pg_autovacuum.init-8.0.0_beta3 1420
 MD5 2e87af398df0a957bf2f2dff754ac174 files/postgresql-7.4.6-vacuum-delay.patch 8918
diff --git a/dev-db/postgresql/files/pg_autovacuum.conf-8.0.0_beta3 b/dev-db/postgresql/files/pg_autovacuum.conf-8.0.0_beta3
new file mode 100644 (file)
index 0000000..f342ebf
--- /dev/null
@@ -0,0 +1,14 @@
+# The PostgreSQL user is:
+PGUSER=postgres
+
+# LOG file is:
+PG_AUTOVACUUM_LOG=/var/lib/postgresql/data/pg_autovacuum.log
+
+# See the pg_autovacuum documentation for the details of how these
+# parameters affect pg_autovacuum's aggressiveness.
+
+VACUUM_BASE=1000
+VACUUM_SCALE=2
+
+SLEEP_BASE=300
+SLEEP_SCALE=2
diff --git a/dev-db/postgresql/files/pg_autovacuum.init-8.0.0_beta3 b/dev-db/postgresql/files/pg_autovacuum.init-8.0.0_beta3
new file mode 100644 (file)
index 0000000..e5b5667
--- /dev/null
@@ -0,0 +1,51 @@
+#!/sbin/runscript
+# Copyright 1999-2004 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/dev-db/postgresql/files/pg_autovacuum.init-8.0.0_beta3,v 1.1 2004/11/06 19:26:26 nakano Exp $
+
+depend() {
+       need postgresql logger
+}
+
+start() {
+       ebegin "Starting pg_autovacuum"
+       echo ""
+       echo -n "Waiting max. 10 sec. for postgresql to start "
+       CONTINUE=0
+       TOO_LONG=0
+       while [ "$CONTINUE" -eq 0 ] && [ $TOO_LONG -lt 10 ]
+       do
+               psql -U $PGUSER -d template1 -c "SELECT 1" 1> /dev/null 2> /dev/null
+               if [ "$?" -eq 0 ]
+               then
+                       CONTINUE=1
+               else
+                       echo -n "."
+                       TOO_LONG=`expr $TOO_LONG + 1`
+                       sleep 1
+               fi
+       done
+       start-stop-daemon -o --chuid $PGUSER --start --quiet --exec /usr/bin/pg_autovacuum -- -D -v $VACUUM_BASE -V $VACUUM_SCALE -s $SLEEP_BASE -S $SLEEP_SCALE -L $PG_AUTOVACUUM_LOG
+
+       sleep 1
+       pidof /usr/bin/pg_autovacuum > /dev/null
+       if [ $? -eq 0 ]; then
+               eend 0
+       else
+               eerror ""
+               eerror "Please see log file: $PG_AUTOVACUUM_LOG"
+               eerror "You may need to add following lines in /var/lib/postgresql/data/postgresql.conf and restart PostgreSQL."
+               eerror " stats_start_collector = true"
+               eerror " stats_row_level = true"
+
+               eerror "Please read ___DOCDIR___/contrib/README.pg_autovacuum for details."
+               eend 1
+       fi
+}
+
+stop() {
+       ebegin "Stopping pg_autovacuum"
+       start-stop-daemon --stop --quiet --exec /usr/bin/pg_autovacuum
+       result=$?
+       eend $result
+}
index 4b5c3e483e9830e199a58c4dba2cdf4e98b4fe7a..3de134145b279c9b9ee4060fdccb15a1f4f0f15a 100644 (file)
@@ -1,6 +1,6 @@
 # Copyright 1999-2004 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/dev-db/postgresql/postgresql-8.0.0_beta3.ebuild,v 1.2 2004/10/09 23:17:17 matsuu Exp $
+# $Header: /var/cvsroot/gentoo-x86/dev-db/postgresql/postgresql-8.0.0_beta3.ebuild,v 1.3 2004/11/06 19:26:26 nakano Exp $
 
 inherit eutils gnuconfig flag-o-matic
 
@@ -143,9 +143,12 @@ src_install() {
        cd ${S}
        exeinto /etc/init.d/
        newexe ${FILESDIR}/postgresql.init-8.0.0 postgresql || die
+       newexe ${FILESDIR}/pg_autovacuum.init-${PV} pg_autovacuum || die
+       dosed "s:___DOCDIR___:/usr/share/doc/${PF}:" /etc/init.d/pg_autovacuum
 
        insinto /etc/conf.d/
        newins ${FILESDIR}/postgresql.conf-8.0.0 postgresql || die
+       newins ${FILESDIR}/pg_autovacuum.conf-${PV} pg_autovacuum || die
 }
 
 pkg_postinst() {