pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Dave <dave@hawk-systems.com>
To: pgsql-admin@postgresql.org
Subject: Postgres not starting at boot(FreeBSD) - startup script not releasing
Date: Sun, 10 Mar 2002 09:11:11 -0500
Message-ID: <DBEIKNMKGOBGNDHAAKGNAEGGNAAA.dave@hawk-systems.com> (raw)

Try this on for size...   recently during a reboot (first in about 3 months for
this particular server) our entire rc.d directory failed to start...  after some
hacking of the rc file to output some helpful debuggin, it was apparent that the
010.pgsql.sh script in /usr/local/etc/rc.d was timing out and causing any
directives thereafter not to be processed.

Running the script manually as root starts the postmaster but doesn't return you
to the command prompt. ^C and checking the errlog shows

Waiting for postmaster starting up..DEBUG:  Data Base System is starting up at
Sat Mar  9 17:05:45 2002
DEBUG:  Data Base System was shut down at Sat Mar  9 17:05:39 2002
DEBUG:  Data Base System is in production state at Sat Mar  9 17:05:45 2002
Fast Shutdown request at Sat Mar  9 17:05:48 2002
DEBUG:  Data Base System shutting down at Sat Mar  9 17:05:48 2002
DEBUG:  Data Base System shut down at Sat Mar  9 17:05:48 2002

Can force it to return to command prompt by adding a "&" and doublt cr

web1# /usr/local/etc/rc.d/010.pgsql.sh start &
[1] 4635
web1#
[1]  + Suspended (tty output)        /usr/local/etc/rc.d/010.pgsql.sh start
web1#

and postgres stays up and frees the terminal.  Output in errlog for this is...

Waiting for postmaster starting up..DEBUG:  Data Base System is starting up at
Sat Mar  9 17:07:21 2002
DEBUG:  Data Base System was shut down at Sat Mar  9 17:05:48 2002
DEBUG:  Data Base System is in production state at Sat Mar  9 17:07:21 2002

No idea what could be causing the script not to function as it is the EXACT same
script as on the other servers we are operating (did a diff just to be sure)

In the interim we removed the script from the startup dir...   any ideas as to
why this is occuring?

Installed from port, left the port startup script as is... listed below.
Appreciate any feedback/comments.

Dave

# $FreeBSD: ports/databases/postgresql7/files/pgsql.sh.tmpl,v 1.9 2000/12/11
03:22:07 steve Exp $
#
# For postmaster startup options, edit $PGDATA/postmaster.opts.default
# Preinstalled options are -i -o "-F"

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

stop)
    [ -x /usr/local/pgsql/bin/pg_ctl ] && {
        exec su -l pgsql -c 'exec /usr/local/pgsql/bin/pg_ctl -w -m fast stop'
    }
    ;;

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

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




view thread (9+ messages)  latest in thread

Message-ID: <DBEIKNMKGOBGNDHAAKGNAEGGNAAA.dave@hawk-systems.com>
Permalink:  ../DBEIKNMKGOBGNDHAAKGNAEGGNAAA.dave@hawk-systems.com/
Also on:    postgresql.org/message-id/DBEIKNMKGOBGNDHAAKGNAEGGNAAA.dave@hawk-systems.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-admin@postgresql.org
  Cc: dave@hawk-systems.com
  Subject: Re: Postgres not starting at boot(FreeBSD) - startup script not releasing
  In-Reply-To: <DBEIKNMKGOBGNDHAAKGNAEGGNAAA.dave@hawk-systems.com>
  References: <DBEIKNMKGOBGNDHAAKGNAEGGNAAA.dave@hawk-systems.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox