fixes postgresql startup/shutdown issues. Fixes #9787
authorRyan Phillips <rphillips@gentoo.org>
Mon, 28 Oct 2002 01:26:00 +0000 (01:26 +0000)
committerRyan Phillips <rphillips@gentoo.org>
Mon, 28 Oct 2002 01:26:00 +0000 (01:26 +0000)
dev-db/postgresql/files/7.2.3/postgresql
dev-db/postgresql/files/postgresql [new file with mode: 0644]
dev-db/postgresql/postgresql-7.2.3.ebuild

index 0129b56440bf305c3469015cd25cf03f5f9121ec..e40f2fc3748529732eccc4f97b4596836620df57 100644 (file)
@@ -1,7 +1,7 @@
 #!/sbin/runscript
 # Copyright 1999-2002 Gentoo Technologies, Inc.
 # Distributed under the terms of the GNU General Public License, v2 or later
-# /space/gentoo/cvsroot/gentoo-x86/dev-db/mysql/files/mysql.rc6,v 1.1 2002/01/06 00:53:24 woodchip Exp
+# /space/gentoo/cvsroot/gentoo-x86/dev-db/postgresql/files/postgresql.rc6,v 1.1 2002/01/06 00:53:24 woodchip Exp
 
 depend() {
        need net
@@ -9,13 +9,19 @@ depend() {
 
 start()        {
        ebegin "Starting postgres"
-       start-stop-daemon  --start --quiet --background --chuid postgres --exec \
-               /usr/bin/postmaster -- -D/var/lib/postgresql/data -N 1024 -B 2048
+       su - $PGUSER -c "/usr/bin/pg_ctl start -D '$PGDATA' -s -l '$PGLOG' -o '$PGOPTS'"
        eend $?
 }
 
 stop ()        {
        ebegin "Stopping postgres"
-       start-stop-daemon --stop --quiet --pidfile=/var/lib/postgresql/data/postmaster.pid
+       su - $PGUSER -c "/usr/bin/pg_ctl stop -D '$PGDATA' -s -m fast"
        eend $?
 }
+
+svc_restart () {
+       ebegin "Restarting postgres"
+       su - $PGUSER -c "/usr/bin/pg_ctl restart -D '$PGDATA' -s -m fast -l '$PGLOG' -o '$PGOPTS'"
+       eend $?
+}
+
diff --git a/dev-db/postgresql/files/postgresql b/dev-db/postgresql/files/postgresql
new file mode 100644 (file)
index 0000000..dfc250b
--- /dev/null
@@ -0,0 +1,13 @@
+# PostgreSQL's Database Directory
+PGDATA=/var/lib/postgresql/data
+
+# Logfile path: (NOTE: This must be uid/gid owned by the value of $PGUSER!)
+PGLOG=/var/log/postgresql.log
+
+# Run the PostgreSQL user as:
+PGUSER=postgres
+
+# Extra options to run postmaster with.
+# If you want to enable TCP/IP for PostgreSQL, add -i to the following:
+PGOPTS="-N 1024 -B 2048"
+
index 41653bbbcdb110cfadd85855cc151f95e6e0460d..c5fd1a6da977e46044b4162ee96c2ea359695cbb 100644 (file)
@@ -1,6 +1,6 @@
 # Copyright 1999-2002 Gentoo Technologies, Inc.
 # Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/dev-db/postgresql/postgresql-7.2.3.ebuild,v 1.2 2002/10/18 11:14:00 mcummings Exp $
+# $Header: /var/cvsroot/gentoo-x86/dev-db/postgresql/postgresql-7.2.3.ebuild,v 1.3 2002/10/28 01:26:00 rphillips Exp $
 
 IUSE="ssl nls java python tcltk perl"
 
@@ -135,6 +135,9 @@ src_install () {
 
        exeinto /etc/init.d/
        doexe ${FILESDIR}/${PV}/${PN}
+
+       exeinto /etc/conf.d/
+       doexe ${FILESDIR}/postgresql
 }
 
 pkg_postinst() {