summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergey Popov <pinkbyte@gentoo.org>2013-01-14 17:26:13 +0000
committerSergey Popov <pinkbyte@gentoo.org>2013-01-14 17:26:13 +0000
commit057f7fc690d4b2f7afb9737f94b580440b6d2653 (patch)
treeca6ac9b1507113cf6b2b5b3486e604501e7dea9d /dev-db/pgbouncer
parentKeyworded amd64-linux and x86-linux (diff)
downloadgentoo-2-057f7fc690d4b2f7afb9737f94b580440b6d2653.tar.gz
gentoo-2-057f7fc690d4b2f7afb9737f94b580440b6d2653.tar.bz2
gentoo-2-057f7fc690d4b2f7afb9737f94b580440b6d2653.zip
Update initscript, fix bugs #410645 and #410647, thanks to Johan Bergström
(Portage version: 2.2.0_alpha151/cvs/Linux x86_64, unsigned Manifest commit)
Diffstat (limited to 'dev-db/pgbouncer')
-rw-r--r--dev-db/pgbouncer/ChangeLog7
-rw-r--r--dev-db/pgbouncer/files/pgbouncer.initd16
2 files changed, 16 insertions, 7 deletions
diff --git a/dev-db/pgbouncer/ChangeLog b/dev-db/pgbouncer/ChangeLog
index 63d17b0b0e08..df39b93caeae 100644
--- a/dev-db/pgbouncer/ChangeLog
+++ b/dev-db/pgbouncer/ChangeLog
@@ -1,6 +1,9 @@
# ChangeLog for dev-db/pgbouncer
-# Copyright 1999-2012 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/dev-db/pgbouncer/ChangeLog,v 1.6 2012/11/13 02:54:25 titanofold Exp $
+# Copyright 1999-2013 Gentoo Foundation; Distributed under the GPL v2
+# $Header: /var/cvsroot/gentoo-x86/dev-db/pgbouncer/ChangeLog,v 1.7 2013/01/14 17:26:12 pinkbyte Exp $
+
+ 14 Jan 2013; Sergey Popov <pinkbyte@gentoo.org> files/pgbouncer.initd:
+ Update initscript, fix bugs #410645 and #410647, thanks to Johan Bergström
*pgbouncer-1.5.3 (13 Nov 2012)
diff --git a/dev-db/pgbouncer/files/pgbouncer.initd b/dev-db/pgbouncer/files/pgbouncer.initd
index b5cb52b62382..83e43cc10808 100644
--- a/dev-db/pgbouncer/files/pgbouncer.initd
+++ b/dev-db/pgbouncer/files/pgbouncer.initd
@@ -1,6 +1,6 @@
#!/sbin/runscript
-extra_started_commands="reload"
+extra_started_commands="reload upgrade"
if [ -d /run ] ; then
RUNDIR=/run/pgbouncer
@@ -14,8 +14,7 @@ depend() {
}
start() {
- mkdir -p ${RUNDIR}
- chown pgbouncer:pgbouncer ${RUNDIR}
+ checkpath -d -m 755 -o pgbouncer:pgbouncer ${RUNDIR}
ebegin "Starting pgbouncer"
start-stop-daemon --start --pidfile ${RUNDIR}/pgbouncer.pid \
@@ -31,7 +30,14 @@ stop() {
reload() {
ebegin "Gracefully reloading pgbouncer"
- start-stop-daemon --stop --oknodo --signal HUP \
- --pidfile ${RUNDIR}/pgbouncer.pid
+ kill -HUP $(head -n1 ${RUNDIR}/pgbouncer.pid)
eend $?
}
+
+upgrade() {
+ egrep -q "^unix_socket_dir" /etc/pgbouncer.conf || \
+ eerror "Not running with unix sockets, cannot upgrade"
+ ebegin "Gracefully upgrading pgbouncer"
+ /usr/bin/pgbouncer -R -q -d -u pgbouncer /etc/pgbouncer.conf
+ eend $?
+} \ No newline at end of file