diff options
author | Caleb Tennis <caleb@gentoo.org> | 2008-09-28 22:53:02 +0000 |
---|---|---|
committer | Caleb Tennis <caleb@gentoo.org> | 2008-09-28 22:53:02 +0000 |
commit | 5257b6c73ed026f202426b6440741563c4ea60dc (patch) | |
tree | 0e7177962f5d9d08bc56f49481fcc214d4c99772 /dev-db/postgresql-server | |
parent | whitespace (diff) | |
download | gentoo-2-5257b6c73ed026f202426b6440741563c4ea60dc.tar.gz gentoo-2-5257b6c73ed026f202426b6440741563c4ea60dc.tar.bz2 gentoo-2-5257b6c73ed026f202426b6440741563c4ea60dc.zip |
Change conf and init files for 8.3 for nicer startup/shutdown per 228639
(Portage version: 2.2_rc11/cvs/Linux 2.6.21-gentoo-r1 i686)
Diffstat (limited to 'dev-db/postgresql-server')
-rw-r--r-- | dev-db/postgresql-server/ChangeLog | 10 | ||||
-rw-r--r-- | dev-db/postgresql-server/files/postgresql.conf-8.3 | 4 | ||||
-rw-r--r-- | dev-db/postgresql-server/files/postgresql.init-8.3 | 22 |
3 files changed, 26 insertions, 10 deletions
diff --git a/dev-db/postgresql-server/ChangeLog b/dev-db/postgresql-server/ChangeLog index 38545d884e9d..8ce6ee0144c8 100644 --- a/dev-db/postgresql-server/ChangeLog +++ b/dev-db/postgresql-server/ChangeLog @@ -1,6 +1,14 @@ # ChangeLog for dev-db/postgresql-server # Copyright 1999-2008 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/dev-db/postgresql-server/ChangeLog,v 1.11 2008/09/25 08:07:52 robbat2 Exp $ +# $Header: /var/cvsroot/gentoo-x86/dev-db/postgresql-server/ChangeLog,v 1.12 2008/09/28 22:53:01 caleb Exp $ + + 28 Sep 2008; Caleb Tennis <caleb@gentoo.org> files/postgresql.conf-8.3, + files/postgresql.init-8.3: + Change conf and init files for 8.3 for a little nicer startup/shutdown + with options. + + This is per 228639 and thanks to a patch from Jeff Frost + (jeff@frostconsultingllc.com) 25 Sep 2008; Robin H. Johnson <robbat2@gentoo.org> Manifest: Caleb's last commit broke the Manifest for 7.4.19, fix it up. diff --git a/dev-db/postgresql-server/files/postgresql.conf-8.3 b/dev-db/postgresql-server/files/postgresql.conf-8.3 index 01e42f51d2b4..56561b0c40c5 100644 --- a/dev-db/postgresql-server/files/postgresql.conf-8.3 +++ b/dev-db/postgresql-server/files/postgresql.conf-8.3 @@ -40,6 +40,10 @@ WAIT_FOR_CLEANUP=60 # Set to 0 to deactivate it WAIT_FOR_QUIT=60 +# Comment this out if you don't want to wait for the server to +# startup before continuing. For example, if this server is a +# PITR log shipping based replication standby +WAIT_FOR_START="-w" # If you have to export environment variables for the database process, # this can be done here. diff --git a/dev-db/postgresql-server/files/postgresql.init-8.3 b/dev-db/postgresql-server/files/postgresql.init-8.3 index d68911b40783..84cc312243c6 100644 --- a/dev-db/postgresql-server/files/postgresql.init-8.3 +++ b/dev-db/postgresql-server/files/postgresql.init-8.3 @@ -1,7 +1,7 @@ #!/sbin/runscript # Copyright 1999-2008 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/dev-db/postgresql-server/files/postgresql.init-8.3,v 1.3 2008/05/13 07:00:36 dev-zero Exp $ +# $Header: /var/cvsroot/gentoo-x86/dev-db/postgresql-server/files/postgresql.init-8.3,v 1.4 2008/09/28 22:53:02 caleb Exp $ opts="${opts} reload" @@ -34,7 +34,7 @@ start() { local retval su -l ${PGUSER} \ - -c "env PGDATA=\"${PGDATA}\" /usr/lib/postgresql-8.3/bin/pg_ctl start -w -o '--silent-mode=true ${PGOPTS}'" + -c "env PGDATA=\"${PGDATA}\" /usr/lib/postgresql-8.3/bin/pg_ctl start ${WAIT_FOR_START} -o '--silent-mode=true ${PGOPTS}'" retval=$? [ $retval -ne 0 ] && eend $retval && return $retval @@ -58,16 +58,18 @@ stop() { local retval - start-stop-daemon --stop --pidfile "${PGDATA}/postmaster.pid" \ - --retry -TERM/${WAIT_FOR_DISCONNECT} + su -l ${PGUSER} \ + -c "env PGDATA=\"${PGDATA}\" /usr/lib/postgresql-8.3/bin/pg_ctl stop -t ${WAIT_FOR_DISCONNECT} -m smart" + retval=$? [ $retval -eq 0 ] && eend $retval && return $retval ewarn "Some clients did not disconnect within ${WAIT_FOR_DISCONNECT} seconds." ewarn "Going to shutdown the server anyway." - start-stop-daemon --stop --pidfile "${PGDATA}/postmaster.pid" \ - --retry -INT/${WAIT_FOR_CLEANUP} + su -l ${PGUSER} \ + -c "env PGDATA=\"${PGDATA}\" /usr/lib/postgresql-8.3/bin/pg_ctl stop -m fast" + retval=$? [ $retval -eq 0 ] && eend $retval && return $retval @@ -80,8 +82,9 @@ stop() { ewarn "Shutting down the server gracefully failed." ewarn "Forcing it to shutdown which leads to a recover-run on next startup." - start-stop-daemon --stop --pidfile "${PGDATA}/postmaster.pid" \ - --retry -QUIT/${WAIT_FOR_QUIT} + su -l ${PGUSER} \ + -c "env PGDATA=\"${PGDATA}\" /usr/lib/postgresql-8.3/bin/pg_ctl stop -m immediate" + retval=$? [ $retval -eq 0 ] && eend $retval && return $retval @@ -91,6 +94,7 @@ stop() { reload() { ebegin "Reloading PostgreSQL configuration" - start-stop-daemon --stop --pidfile "${PGDATA}/postmaster.pid" --signal HUP --oknodo + su -l ${PGUSER} \ + -c "env PGDATA=\"${PGDATA}\" /usr/lib/postgresql-8.3/bin/pg_ctl reload" eend $? } |