mirror of
https://github.com/postgres/postgres.git
synced 2025-07-31 22:04:40 +03:00
Enhance pg_ctl so that it prints error messages from postmaster
if it fails to start up it (this is only vaild if -w is given).
This commit is contained in:
@ -8,10 +8,12 @@
|
|||||||
#
|
#
|
||||||
#
|
#
|
||||||
# IDENTIFICATION
|
# IDENTIFICATION
|
||||||
# $Header: /cvsroot/pgsql/src/bin/pg_ctl/Attic/pg_ctl.sh,v 1.10 2000/03/14 08:34:47 ishii Exp $
|
# $Header: /cvsroot/pgsql/src/bin/pg_ctl/Attic/pg_ctl.sh,v 1.11 2000/03/27 02:12:03 ishii Exp $
|
||||||
#
|
#
|
||||||
#-------------------------------------------------------------------------
|
#-------------------------------------------------------------------------
|
||||||
CMDNAME=`basename $0`
|
CMDNAME=`basename $0`
|
||||||
|
tmp=/tmp/tmp$$
|
||||||
|
trap "rm -f $tmp; exit" 0 1 2 13 15
|
||||||
|
|
||||||
# Check for echo -n vs echo \c
|
# Check for echo -n vs echo \c
|
||||||
|
|
||||||
@ -219,17 +221,17 @@ if [ $op = "start" -o $op = "restart" ];then
|
|||||||
if [ $op = "start" ];then
|
if [ $op = "start" ];then
|
||||||
# if we are in start mode, then look for postmaster.opts.default
|
# if we are in start mode, then look for postmaster.opts.default
|
||||||
if [ -f $DEFPOSTOPTS ];then
|
if [ -f $DEFPOSTOPTS ];then
|
||||||
eval "$po_path `cat $DEFPOSTOPTS`" &
|
eval "$po_path `cat $DEFPOSTOPTS`" >$tmp 2>&1&
|
||||||
else
|
else
|
||||||
$ECHO "$CMDNAME: Can't find $DEFPOSTOPTS"
|
$ECHO "$CMDNAME: Can't find $DEFPOSTOPTS"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
# if we are in restart mode, then look postmaster.opts
|
# if we are in restart mode, then look postmaster.opts
|
||||||
eval `cat $POSTOPTSFILE` &
|
eval `cat $POSTOPTSFILE` >$tmp 2>&1 &
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
eval "$po_path $POSTOPTS "&
|
eval "$po_path $POSTOPTS " >$tmp 2>&1&
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ -f $PIDFILE ];then
|
if [ -f $PIDFILE ];then
|
||||||
@ -253,6 +255,11 @@ if [ $op = "start" -o $op = "restart" ];then
|
|||||||
cnt=`expr $cnt + 1`
|
cnt=`expr $cnt + 1`
|
||||||
if [ $cnt -gt 60 ];then
|
if [ $cnt -gt 60 ];then
|
||||||
$ECHO "$CMDNAME: postmaster does not start up"
|
$ECHO "$CMDNAME: postmaster does not start up"
|
||||||
|
if [ -r $tmp ];then
|
||||||
|
$ECHO "$CMDNAME: messages from postmaster:"
|
||||||
|
$ECHO
|
||||||
|
cat $tmp
|
||||||
|
fi
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
sleep 1
|
sleep 1
|
||||||
|
Reference in New Issue
Block a user