summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--dev-db/pgbouncer/ChangeLog6
-rw-r--r--dev-db/pgbouncer/Manifest7
-rw-r--r--dev-db/pgbouncer/files/modify-config-paths.patch23
-rw-r--r--dev-db/pgbouncer/files/pgbouncer.initd38
-rw-r--r--dev-db/pgbouncer/pgbouncer-1.3-r1.ebuild (renamed from dev-db/pgbouncer/pgbouncer-1.3.ebuild)9
5 files changed, 56 insertions, 27 deletions
diff --git a/dev-db/pgbouncer/ChangeLog b/dev-db/pgbouncer/ChangeLog
index f40a0ac7f..19ba5890c 100644
--- a/dev-db/pgbouncer/ChangeLog
+++ b/dev-db/pgbouncer/ChangeLog
@@ -2,6 +2,12 @@
# Copyright 1999-2009 Gentoo Foundation; Distributed under the GPL v2
# $Header: $
+ 17 May 2009; Johan Bergström (jbergstroem) <bugs@bergstroem.nu>
+ -pgbouncer-1.3.ebuild, +pgbouncer-1.3-r1.ebuild,
+ +files/modify-config-paths.patch, files/pgbouncer.initd:
+ New init script and fixes to the ebuild to reflect this. Also remove a typo
+ in RDEPEND
+
11 May 2009; Johan Bergström (jbergstroem) <bugs@bergstroem.nu>
+pgbouncer-1.3.ebuild, +files/pgbouncer.initd, +metadata.xml:
New ebuild for bug 243232 - thanks to gentoo-sunrise for all help
diff --git a/dev-db/pgbouncer/Manifest b/dev-db/pgbouncer/Manifest
index fa8d1932e..aaac3fb1c 100644
--- a/dev-db/pgbouncer/Manifest
+++ b/dev-db/pgbouncer/Manifest
@@ -1,5 +1,6 @@
-AUX pgbouncer.initd 1020 RMD160 cfae30b9d57c8ddb84b6a7547fc3595119321eee SHA1 4533c11693e9ef1da85be5abfd6551a89777f48a SHA256 738e49d42a28353075c93b77908f008522bfc15592ea095b5731388267797cf5
+AUX modify-config-paths.patch 572 RMD160 cd84c2aa6a9eb4fd8e0e244bf80883ab9b6e8c13 SHA1 d2a62c820199fdd4ed2966ec9e35dab8b9322ce3 SHA256 8ee4f5563d4e4136194c7ebdba0d6ca6beaef08c4356c908923ec9203f6f3073
+AUX pgbouncer.initd 711 RMD160 e4f65df75f624a52fbcf1190fb49033839c42791 SHA1 682c5f1e6bc7fbb90399a7519ec4821ae46cc1e1 SHA256 32ebdb63868d228c1555a282d6836cfc825a241359899fd05692e81200fa1f91
DIST pgbouncer-1.3.tgz 160154 RMD160 581cf06c22567300fb38cfc1f212d44a8d770af5 SHA1 a86d5b5025affd38270c30fccdc1fde5ede3ff7f SHA256 87b489e173d7e66c440218e7b026943789da66c2b5bd6ef85f5a354a92a66cae
-EBUILD pgbouncer-1.3.ebuild 1390 RMD160 e887bc2a3b05d62f68d6a9c09e577b71d7115915 SHA1 09a3e44a0d55fd4c32648d2b081745f9f3d1159b SHA256 00f9341f065976462e5b5dfb79e9cc6319bea2061d865787f57e3b0e9f236aee
-MISC ChangeLog 317 RMD160 1510fb028de00c8dc2f1d249a8305b0afbd0095a SHA1 1482cb44cd246c09f06260bc3dfb070e70b81f03 SHA256 941b2f4a1361915872dba12012f4d8834546879622d541be5e31b0bc3876ae6e
+EBUILD pgbouncer-1.3-r1.ebuild 1625 RMD160 42382794b46f510f04c8671844e899855d9452a3 SHA1 15db21b623c9d5371fd243b66fcedb90573710db SHA256 c35bc056d61420f60e9684564de1cbda646e7b8144e6cc100b21118b1f451f91
+MISC ChangeLog 586 RMD160 d6ecd5bff34d96c6f121ca90c252b192d7271286 SHA1 c9c2dd6034842fb8f46307e5d9694c39408885e4 SHA256 54f29a2796cea3c621ac1856ef6aea16166ac956176340bd0cb642043ff75b5d
MISC metadata.xml 170 RMD160 645927a396fdc21cdeb089fe42c5397332420ea6 SHA1 ac7f48a14fec325926f9ce1be8fbf1f311b4f2e4 SHA256 d797a2ec6f9dc516c9f9c1a758ee87ad3e8c43101b5dc76c2f872d5bd4639b42
diff --git a/dev-db/pgbouncer/files/modify-config-paths.patch b/dev-db/pgbouncer/files/modify-config-paths.patch
new file mode 100644
index 000000000..3cdcd5a20
--- /dev/null
+++ b/dev-db/pgbouncer/files/modify-config-paths.patch
@@ -0,0 +1,23 @@
+--- etc/pgbouncer.ini 2009-02-18 14:34:26.000000000 +0100
++++ etc/pgbouncer-new.ini 2009-05-17 13:13:32.000000000 +0200
+@@ -22,8 +22,8 @@
+ ;;; Administrative settings
+ ;;;
+
+-logfile = pgbouncer.log
+-pidfile = pgbouncer.pid
++logfile = /var/log/pgbouncer/pgbouncer.log
++pidfile = /var/run/pgbouncer/pgbouncer.pid
+
+ ;;;
+ ;;; Where to wait for clients
+@@ -41,7 +41,7 @@
+ ; any, trust, plain, crypt, md5
+ auth_type = trust
+ #auth_file = 8.0/main/global/pg_auth
+-auth_file = etc/userlist.txt
++auth_file = /etc/userlist.txt
+
+ ;;;
+ ;;; Users allowed into database 'pgbouncer'
+
diff --git a/dev-db/pgbouncer/files/pgbouncer.initd b/dev-db/pgbouncer/files/pgbouncer.initd
index c2cdabf27..883ae8804 100644
--- a/dev-db/pgbouncer/files/pgbouncer.initd
+++ b/dev-db/pgbouncer/files/pgbouncer.initd
@@ -4,8 +4,8 @@
opts="start stop reload checkconfig"
depend() {
- need net
- after postgresql
+ need net
+ after postgresql
}
checkconfig(){
@@ -15,31 +15,23 @@ checkconfig(){
}
start() {
- checkconfig || return 1
- ebegin "Starting pgbouncer as pgbouncer user"
+ checkconfig || return 1
+ ebegin "Starting pgbouncer"
-# if [ -f "/var/run/postgresql/pgbouncer.pid" ] ; then
-# rm -f "/var/run/postgresql/pgbouncer.pid"
-# fi
- PIDFILE="/var/run/postgresql/pgbouncer.pid"
- TIMEOUT=${TIMEOUT:-10}
- PGBOUNCER_OPTS="-d -u pgbouncer /etc/pgbouncer.conf"
- /usr/bin/pgbouncer ${PGBOUNCER_OPTS}
-
- let i=0
- while [ ! -e "${PIDFILE}" ] && [ $i -lt ${TIMEOUT} ]; do
- sleep 1 && i=$(expr $i + 1)
- done
- test $i -le ${TIMEOUT}
- eend $?
+ start-stop-daemon --start --pidfile /var/run/pgbouncer/pgbouncer.pid \
+ --exec /usr/bin/pgbouncer -- -d -u pgbouncer /etc/pgbouncer.conf
+ eend $? "Failed to start pgbouncer"
+
}
stop() {
- ebegin "Stopping pgbouncer"
- start-stop-daemon --stop --quiet --pidfile /var/run/postgresql/pgbouncer.pid
- eend $?
+ ebegin "Stopping pgbouncer"
+ start-stop-daemon --stop --quiet --pidfile /var/run/pgbouncer/pgbouncer.pid
+ eend $?
}
+
reload() {
- ebegin "Reloading pgbouncer configuration"
- start-stop-daemon --stop --pidfile /var/run/postgresql/pgbouncer.pid --signal HUP
+ ebegin "Reloading pgbouncer configuration"
+ kill -HUP `cat /var/run/pgbouncer/pgbouncer.pid`
+ eend $?
}
diff --git a/dev-db/pgbouncer/pgbouncer-1.3.ebuild b/dev-db/pgbouncer/pgbouncer-1.3-r1.ebuild
index fe6aff0b6..b5c5033dc 100644
--- a/dev-db/pgbouncer/pgbouncer-1.3.ebuild
+++ b/dev-db/pgbouncer/pgbouncer-1.3-r1.ebuild
@@ -15,7 +15,7 @@ IUSE="debug"
DEPEND=">=virtual/postgresql-base-8.0
>=dev-libs/libevent-1.3"
-RDEPEND="${DEPENDS}"
+RDEPEND="${DEPEND}"
pkg_setup() {
enewgroup pgbouncer
@@ -29,6 +29,8 @@ src_unpack() {
}
src_compile() {
+ epatch "${FILESDIR}/modify-config-paths.patch"
+
econf \
$(use_enable debug) \
$(use_enable debug cassert)
@@ -45,6 +47,11 @@ src_install() {
dodoc README NEWS AUTHORS || die "Install failed"
dodoc doc/*.txt || die "Install failed"
+
+ # Create log/run directories and set owner to pgbouncer
+ keepdir /var/{run,log}/pgbouncer/
+ fperms 0700 /var/{run,log}/pgbouncer/
+ fowners pgbouncer:pgbouncer /var/{run,log}/pgbouncer/
}
pkg_postinst() {