#!/bin/sh

N=`ps ax | grep -v grep | grep postmaster | head -1 | wc -l`
if [ "x$N" = "x1" ]; then exit 0; fi

X=__META_PREFIX__
D=__META_DATADIR__

PATH=$X/bin:$PATH
su postgres -c \
    "PATH=$X/bin:$PATH postmaster -D $D -i >& /dev/null" &
sleep 5
