Thread: startup script for FreeBSD

startup script for FreeBSD

From
"Eduardo Kotujansky"
Date:
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


Re: startup script for FreeBSD

From
Alfred Perlstein
Date:
* 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."