Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie
Hi there,
There is an issue with role permissions that is being worked on at the moment.
If you are having trouble with access or permissions on regional forums please post here to get access: https://www.boards.ie/discussion/2058365403/you-do-not-have-permission-for-that#latest

Shell script to start PostgreSQL

  • 09-01-2002 5:24pm
    #1
    Registered Users, Registered Users 2 Posts: 2,518 ✭✭✭


    I installed the FreeBSD port of PostgreSQL onto my system (4.5-PRELEASE) here, while it starts fine with the postmaster or pg_ctl commands, it simply refuses to start at boot, even with the shell script that was supplied with the port.

    Seems to be in the right place (/usr/local/etc/rc.d/), it's executable and readable. I decided to run the script itself to see what the output is, this is what it returned: "su: no directory".

    heres the script itself:

    #!/bin/sh

    # $FreeBSD: ports/databases/postgresql7/files/pgsql.sh.tmpl,v 1.12 2001/05/02 11:44:38 olgeni Exp $
    #
    # For postmaster startup options, edit $PGDATA/postgresql.conf

    PGBIN=/usr/local/bin

    case $1 in
    start)
    [ -d /usr/local/lib ] && /sbin/ldconfig -m /usr/local/lib
    [ -x ${PGBIN}/pg_ctl ] && {
    su -l pgsql -c \
    '[ -d ${PGDATA} ] && exec /usr/local/bin/pg_ctl start -s -w -l ~pgsql/errlog'
    echo -n ' pgsql'
    }
    ;;

    stop)
    [ -x ${PGBIN}/pg_ctl ] && {
    su -l pgsql -c 'exec /usr/local/bin/pg_ctl stop -s -m fast'
    echo -n ' pgsql'
    }
    ;;

    status)
    [ -x ${PGBIN}/pg_ctl ] && {
    exec su -l pgsql -c 'exec /usr/local/bin/pg_ctl status'
    }
    ;;

    *)
    echo "usage: `basename $0` {start|stop|status}" >&2
    exit 64
    ;;
    esac

    Could it be somthing to do with Postgres' requirement that the dbms be started by an unpriveleged user ?


Advertisement