From f85282310782b5bf498365e3cb3b1308551d63fc Mon Sep 17 00:00:00 2001 From: ajacoutot Date: Fri, 1 Jun 2012 15:06:45 +0000 Subject: [PATCH] Make the rc.d(8) script use pg_ctl all the way. ok pea@ (maintainer) --- databases/postgresql/Makefile | 4 ++-- databases/postgresql/pkg/postgresql.rc | 20 ++++++++++++++------ 2 files changed, 16 insertions(+), 8 deletions(-) diff --git a/databases/postgresql/Makefile b/databases/postgresql/Makefile index 89ee1192042..27ea6840fe3 100644 --- a/databases/postgresql/Makefile +++ b/databases/postgresql/Makefile @@ -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-server= PostgreSQL RDBMS (server) @@ -6,7 +6,7 @@ COMMENT-docs= PostgreSQL RDBMS documentation COMMENT-contrib=PostgreSQL RDBMS contributions VERSION= 9.1.3 -REVISION-server=1 +REVISION-server=2 DISTNAME= postgresql-${VERSION} PKGNAME-main= postgresql-client-${VERSION} PKGNAME-server= postgresql-server-${VERSION} diff --git a/databases/postgresql/pkg/postgresql.rc b/databases/postgresql/pkg/postgresql.rc index fa95a698dd5..c363c88d588 100644 --- a/databases/postgresql/pkg/postgresql.rc +++ b/databases/postgresql/pkg/postgresql.rc @@ -1,23 +1,31 @@ #!/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" . /etc/rc.d/rc.subr -bin="${TRUEPREFIX}/bin/pg_ctl" datadir="/var/postgresql/data" +rc_check() { + ${rcexec} "${daemon} -D ${datadir} status" +} + +rc_reload() { + ${rcexec} "${daemon} -D ${datadir} reload" +} + rc_start() { rm -f ${datadir}/postmaster.pid - ${rcexec} "${bin} -D ${datadir} start -l /var/postgresql/logfile" + ${rcexec} "${daemon} -D ${datadir} start ${daemon_flags}" } rc_stop() { - ${rcexec} "${bin} -D ${datadir} stop -m fast" || \ - ${rcexec} "${bin} -D ${datadir} stop -m immediate" + ${rcexec} "${daemon} -D ${datadir} stop -m fast" || \ + ${rcexec} "${daemon} -D ${datadir} stop -m immediate" } rc_cmd $1