1 |
caleb 08/09/28 22:53:02 |
2 |
|
3 |
Modified: postgresql.conf-8.3 postgresql.init-8.3 |
4 |
Log: |
5 |
Change conf and init files for 8.3 for nicer startup/shutdown per 228639 |
6 |
(Portage version: 2.2_rc11/cvs/Linux 2.6.21-gentoo-r1 i686) |
7 |
|
8 |
Revision Changes Path |
9 |
1.2 dev-db/postgresql-server/files/postgresql.conf-8.3 |
10 |
|
11 |
file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/dev-db/postgresql-server/files/postgresql.conf-8.3?rev=1.2&view=markup |
12 |
plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/dev-db/postgresql-server/files/postgresql.conf-8.3?rev=1.2&content-type=text/plain |
13 |
diff : http://sources.gentoo.org/viewcvs.py/gentoo-x86/dev-db/postgresql-server/files/postgresql.conf-8.3?r1=1.1&r2=1.2 |
14 |
|
15 |
Index: postgresql.conf-8.3 |
16 |
=================================================================== |
17 |
RCS file: /var/cvsroot/gentoo-x86/dev-db/postgresql-server/files/postgresql.conf-8.3,v |
18 |
retrieving revision 1.1 |
19 |
retrieving revision 1.2 |
20 |
diff -u -r1.1 -r1.2 |
21 |
--- postgresql.conf-8.3 15 Apr 2008 09:29:55 -0000 1.1 |
22 |
+++ postgresql.conf-8.3 28 Sep 2008 22:53:02 -0000 1.2 |
23 |
@@ -40,6 +40,10 @@ |
24 |
# Set to 0 to deactivate it |
25 |
WAIT_FOR_QUIT=60 |
26 |
|
27 |
+# Comment this out if you don't want to wait for the server to |
28 |
+# startup before continuing. For example, if this server is a |
29 |
+# PITR log shipping based replication standby |
30 |
+WAIT_FOR_START="-w" |
31 |
|
32 |
# If you have to export environment variables for the database process, |
33 |
# this can be done here. |
34 |
|
35 |
|
36 |
|
37 |
1.4 dev-db/postgresql-server/files/postgresql.init-8.3 |
38 |
|
39 |
file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/dev-db/postgresql-server/files/postgresql.init-8.3?rev=1.4&view=markup |
40 |
plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/dev-db/postgresql-server/files/postgresql.init-8.3?rev=1.4&content-type=text/plain |
41 |
diff : http://sources.gentoo.org/viewcvs.py/gentoo-x86/dev-db/postgresql-server/files/postgresql.init-8.3?r1=1.3&r2=1.4 |
42 |
|
43 |
Index: postgresql.init-8.3 |
44 |
=================================================================== |
45 |
RCS file: /var/cvsroot/gentoo-x86/dev-db/postgresql-server/files/postgresql.init-8.3,v |
46 |
retrieving revision 1.3 |
47 |
retrieving revision 1.4 |
48 |
diff -u -r1.3 -r1.4 |
49 |
--- postgresql.init-8.3 13 May 2008 07:00:36 -0000 1.3 |
50 |
+++ postgresql.init-8.3 28 Sep 2008 22:53:02 -0000 1.4 |
51 |
@@ -1,7 +1,7 @@ |
52 |
#!/sbin/runscript |
53 |
# Copyright 1999-2008 Gentoo Foundation |
54 |
# Distributed under the terms of the GNU General Public License v2 |
55 |
-# $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 $ |
56 |
+# $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 $ |
57 |
|
58 |
opts="${opts} reload" |
59 |
|
60 |
@@ -34,7 +34,7 @@ |
61 |
local retval |
62 |
|
63 |
su -l ${PGUSER} \ |
64 |
- -c "env PGDATA=\"${PGDATA}\" /usr/lib/postgresql-8.3/bin/pg_ctl start -w -o '--silent-mode=true ${PGOPTS}'" |
65 |
+ -c "env PGDATA=\"${PGDATA}\" /usr/lib/postgresql-8.3/bin/pg_ctl start ${WAIT_FOR_START} -o '--silent-mode=true ${PGOPTS}'" |
66 |
retval=$? |
67 |
[ $retval -ne 0 ] && eend $retval && return $retval |
68 |
|
69 |
@@ -58,16 +58,18 @@ |
70 |
|
71 |
local retval |
72 |
|
73 |
- start-stop-daemon --stop --pidfile "${PGDATA}/postmaster.pid" \ |
74 |
- --retry -TERM/${WAIT_FOR_DISCONNECT} |
75 |
+ su -l ${PGUSER} \ |
76 |
+ -c "env PGDATA=\"${PGDATA}\" /usr/lib/postgresql-8.3/bin/pg_ctl stop -t ${WAIT_FOR_DISCONNECT} -m smart" |
77 |
+ |
78 |
retval=$? |
79 |
[ $retval -eq 0 ] && eend $retval && return $retval |
80 |
|
81 |
ewarn "Some clients did not disconnect within ${WAIT_FOR_DISCONNECT} seconds." |
82 |
ewarn "Going to shutdown the server anyway." |
83 |
|
84 |
- start-stop-daemon --stop --pidfile "${PGDATA}/postmaster.pid" \ |
85 |
- --retry -INT/${WAIT_FOR_CLEANUP} |
86 |
+ su -l ${PGUSER} \ |
87 |
+ -c "env PGDATA=\"${PGDATA}\" /usr/lib/postgresql-8.3/bin/pg_ctl stop -m fast" |
88 |
+ |
89 |
retval=$? |
90 |
[ $retval -eq 0 ] && eend $retval && return $retval |
91 |
|
92 |
@@ -80,8 +82,9 @@ |
93 |
ewarn "Shutting down the server gracefully failed." |
94 |
ewarn "Forcing it to shutdown which leads to a recover-run on next startup." |
95 |
|
96 |
- start-stop-daemon --stop --pidfile "${PGDATA}/postmaster.pid" \ |
97 |
- --retry -QUIT/${WAIT_FOR_QUIT} |
98 |
+ su -l ${PGUSER} \ |
99 |
+ -c "env PGDATA=\"${PGDATA}\" /usr/lib/postgresql-8.3/bin/pg_ctl stop -m immediate" |
100 |
+ |
101 |
retval=$? |
102 |
[ $retval -eq 0 ] && eend $retval && return $retval |
103 |
|
104 |
@@ -91,6 +94,7 @@ |
105 |
|
106 |
reload() { |
107 |
ebegin "Reloading PostgreSQL configuration" |
108 |
- start-stop-daemon --stop --pidfile "${PGDATA}/postmaster.pid" --signal HUP --oknodo |
109 |
+ su -l ${PGUSER} \ |
110 |
+ -c "env PGDATA=\"${PGDATA}\" /usr/lib/postgresql-8.3/bin/pg_ctl reload" |
111 |
eend $? |
112 |
} |