Re: startup script for FreeBSD - Mailing list pgsql-novice

From Alfred Perlstein
Subject Re: startup script for FreeBSD
Date
Msg-id 20001123113153.Y18037@fw.wintelcom.net
Whole thread Raw
In response to startup script for FreeBSD  ("Eduardo Kotujansky" <eduardo@complex.com.br>)
List pgsql-novice
* Eduardo Kotujansky <eduardo@complex.com.br> [001123 04:25] wrote:
> Could some one send-me an example ( or tell-me where it is  in docs )
> of a shell script for start postgresql  in a FreeBSD installation
>
> Thanks
>    Eduardo

this could be more modular, and you'll want to lower the -B and -S
options unless you have a gig of RAM.

#!/bin/sh

#
#  /usr/local/etc/rc.d startup script
#
# $Wintelcom: src/paycounter_backend/dbscripts/pg.sh,v 1.4 2000/07/04 09:13:49 bright Exp $
#

DATA=/vol/amrd0/database/data
DAEMON=/usr/local/pgsql/bin/postmaster
LOGFILE=/vol/amrd0/database/data/postgres.log
PGUSER=pgsql

case `/usr/bin/whoami` in
    root)
        if [ -d /usr/local/pgsql/lib ] ; then
            /sbin/ldconfig -m /usr/local/pgsql/lib
        fi
        su -l $PGUSER -c \
            "exec $DAEMON -i -B 32768 -D$DATA -S -o "-F -S 65534" > $LOGFILE"
    ;;
    $PGUSER)
        $DAEMON -i -B 32768 -D$DATA -S -o "-F -S 65534" > $LOGFILE
    ;;
    *)
        echo you either need to be root or $PGUSER to start postgresql
        exit
    ;;
esac

--
-Alfred Perlstein - [bright@wintelcom.net|alfred@freebsd.org]
"I have the heart of a child; I keep it in a jar on my desk."

pgsql-novice by date:

Previous
From: GH
Date:
Subject: Re: re : PHP and persistent connections
Next
From: GH
Date:
Subject: Skipping numbers in a sequence.