Edit

IABSD.fr/ports/databases/postgresql/pkg/postgresql.rc

Branch :

  • Show log

    Commit

  • Author : sthen
    Date : 2014-09-23 08:41:10
    Hash : b85142c7
    Message : use -w when starting postgresql, to wait for startup to complete before continuing. suggested by frantisek holop, ok ajacoutot@ while there, s/an another/another/ in README

  • databases/postgresql/pkg/postgresql.rc
  • #!/bin/sh
    #
    # $OpenBSD: postgresql.rc,v 1.11 2014/09/23 08:41:10 sthen Exp $
    
    datadir="/var/postgresql/data"
    
    daemon="${TRUEPREFIX}/bin/pg_ctl"
    daemon_flags="-w -l /var/postgresql/logfile"
    daemon_user="_postgresql"
    
    . /etc/rc.d/rc.subr
    
    rc_usercheck=NO
    
    rc_check() {
    	${rcexec} "${daemon} -D ${datadir} status"
    }
    
    rc_reload() {
    	${rcexec} "${daemon} -D ${datadir} reload"
    }
    
    rc_start() {
    	rm -f ${datadir}/postmaster.pid
    	${rcexec} "${daemon} -D ${datadir} start ${daemon_flags}"
    }
    
    rc_stop() {
    	${rcexec} "${daemon} -D ${datadir} stop -m fast" || \
    		${rcexec} "${daemon} -D ${datadir} stop -m immediate"
    }
    
    rc_cmd $1