Make the rc.d(8) script use pg_ctl all the way.

ok pea@ (maintainer)
This commit is contained in:
ajacoutot 2012-06-01 15:06:45 +00:00
parent 84455e0877
commit f852823107
2 changed files with 16 additions and 8 deletions

View File

@ -1,4 +1,4 @@
# $OpenBSD: Makefile,v 1.163 2012/04/22 11:41:55 ajacoutot Exp $ # $OpenBSD: Makefile,v 1.164 2012/06/01 15:06:45 ajacoutot Exp $
COMMENT-main= PostgreSQL RDBMS (client) COMMENT-main= PostgreSQL RDBMS (client)
COMMENT-server= PostgreSQL RDBMS (server) COMMENT-server= PostgreSQL RDBMS (server)
@ -6,7 +6,7 @@ COMMENT-docs= PostgreSQL RDBMS documentation
COMMENT-contrib=PostgreSQL RDBMS contributions COMMENT-contrib=PostgreSQL RDBMS contributions
VERSION= 9.1.3 VERSION= 9.1.3
REVISION-server=1 REVISION-server=2
DISTNAME= postgresql-${VERSION} DISTNAME= postgresql-${VERSION}
PKGNAME-main= postgresql-client-${VERSION} PKGNAME-main= postgresql-client-${VERSION}
PKGNAME-server= postgresql-server-${VERSION} PKGNAME-server= postgresql-server-${VERSION}

View File

@ -1,23 +1,31 @@
#!/bin/sh #!/bin/sh
# #
# $OpenBSD: postgresql.rc,v 1.8 2011/03/17 16:49:27 ajacoutot Exp $ # $OpenBSD: postgresql.rc,v 1.9 2012/06/01 15:06:46 ajacoutot Exp $
daemon="${TRUEPREFIX}/bin/postgres" daemon="${TRUEPREFIX}/bin/pg_ctl"
daemon_flags="-l /var/postgresql/logfile"
daemon_user="_postgresql" daemon_user="_postgresql"
. /etc/rc.d/rc.subr . /etc/rc.d/rc.subr
bin="${TRUEPREFIX}/bin/pg_ctl"
datadir="/var/postgresql/data" datadir="/var/postgresql/data"
rc_check() {
${rcexec} "${daemon} -D ${datadir} status"
}
rc_reload() {
${rcexec} "${daemon} -D ${datadir} reload"
}
rc_start() { rc_start() {
rm -f ${datadir}/postmaster.pid rm -f ${datadir}/postmaster.pid
${rcexec} "${bin} -D ${datadir} start -l /var/postgresql/logfile" ${rcexec} "${daemon} -D ${datadir} start ${daemon_flags}"
} }
rc_stop() { rc_stop() {
${rcexec} "${bin} -D ${datadir} stop -m fast" || \ ${rcexec} "${daemon} -D ${datadir} stop -m fast" || \
${rcexec} "${bin} -D ${datadir} stop -m immediate" ${rcexec} "${daemon} -D ${datadir} stop -m immediate"
} }
rc_cmd $1 rc_cmd $1