#!/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
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 $?
+}
+
--- /dev/null
+# 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"
+
# 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"
exeinto /etc/init.d/
doexe ${FILESDIR}/${PV}/${PN}
+
+ exeinto /etc/conf.d/
+ doexe ${FILESDIR}/postgresql
}
pkg_postinst() {