#!/bin/sh
#
# $FreeBSD: ports/databases/pgcluster/files/pglb.sh.tmpl,v 1.3 2004/07/26 23:28:47 kuriyama Exp $
#
# PROVIDE: pglb
# REQUIRE: DAEMON
# KEYWORD: FreeBSD
#
# Add the following line to /etc/rc.conf to enable pglb:
#
# pglb_enable="YES"
#

pglb_enable=${pglb_enable-"NO"}
pglb_data=${pglb_data-"/usr/local/pgsql/data"}

. /etc/rc.subr

load_rc_config pglb

name=pglb
rcvar=`set_rcvar`
command=/usr/local/bin/pglb
pglb_user=pgsql
stop_cmd="pglb_stop"

pglb_flags="${pglb_flags} -D ${pglb_data}"

pglb_stop()
{
    su -m ${pglb_user} -c "exec ${command} -D ${pglb_data} stop"
}

load_rc_config $name
run_rc_command "$1"
