[GENERAL] postmaster does not come up

2005-11-24 Thread surabhi.ahuja
 this is in continuation of the problem i was facing 
some time back.
 
if i try to start postmaster ...it times out.
what can be the possible cause of it . I also have seen a core file being 
generated.
 
in case such a thing happens ... what shuld i be doing? 
how can i recover my database in such a situation?
 
 
i ll again copy paste the script i am using for starting up and shutting 
down postmaster
 
#! /bin/sh# dbxd    Script for starting up the 
PostgreSQL#   
server in the daemon mode##
# postgreSQL version is:PGVERSION=8.0
# Name of the scriptNAME=dbxd# Command issued 
start/stop/restartaction=""# Get SDC configiration#   . 
$SDCHOME/.SdCrc# Set defaults for port and database 
directoryPOSTGRES_LOG="$SDCHOME/nuevo/logfiles/postgreslog"if [ ! -f 
$POSTGRES_LOG ]; then   touch $POSTGRES_LOG   chown 
sdc:200 $POSTGRES_LOG   chmod 777 $POSTGRES_LOGfiif [ 
"`uname`" = "Linux" ]; then   #DEVMACHINE=`file /export/dbsroot | 
grep -c directory`   
POSTMASTER=/usr/bin/postmaster   PGCTL="/usr/bin/pg_ctl -w 
"   INITDB=/usr/bin/initdb   
PGDATA=$SdC_IMAGE_POOL/dbx   PGPORT=5432else   
echo "Cannot launch POSTGRES , unknown OS"   echo " [ FAILED 
]"   exit 1fiif [ "`uname`" = "Linux" ]; 
then   INITD=/etc/rc.d/init.d   . 
$INITD/functions   # Get config.   . 
/etc/sysconfig/networkfi# Check that networking is up.# Pretty much 
need it for postmaster.if [ "`uname`" = "Linux" ]; then   [ 
"${NETWORKING}" = "no" ] && exit 0fi
start(){
    # Check for the PGDATA 
structure    if [ -f 
$PGDATA/PG_VERSION ] && [ -d $PGDATA/base 
]    
then    # Check version of existing 
PGDATA
    
INSTPG_VERSION=`cat 
$PGDATA/PG_VERSION`    
if [ $INSTPG_VERSION != '8.0' -a $INSTPG_VERSION != '8.1' 
]    
then    
echo "An old version of the database format was 
found.\n"    
exit 
1    
fi    
else    # No existing PGDATA - call 
initdb    
echo "Initializing database: 
"    
#chmod 755 
/var/lib/pgsql    
if [ ! -d $PGDATA 
]    
then    
mkdir -p 
$PGDATA    
fi    
chown $SDCUSER:$SDCUSER 
$PGDATA    
chmod go-rwx 
$PGDATA    
# Make sure the locale from the initdb is preserved for later 
startups...    
[ -f /etc/sysconfig/i18n ] && cp /etc/sysconfig/i18n 
$PGDATA/../initdb.i18n    
# Just in case no locale was set, use en_US on 
Linux    
if [ "`uname`" = "Linux" ]; 
then    
[ ! -f /etc/sysconfig/i18n ] && echo "LANG=en_US" > 
$PGDATA/../initdb.i18n    
fi
    
# Initialize the 
database    
if [ "`uname`" = "Linux" ]; 
then    
/bin/sh -c "$INITDB --pgdata=$PGDATA > /dev/null 2>&1" < 
/dev/null    
fi
    
# Modify original postgres settings so that local connection are 
trusted    
mv $PGDATA/pg_hba.conf 
$PGDATA/pg_hba.conf.orig    
cat $PGDATA/pg_hba.conf.orig | sed "s/^local.*/local   
all    all    trust/" > 
$PGDATA/pg_hba.conf    
chown $SDCUSER:$SDCUSER 
$PGDATA/pg_hba.conf    
chmod 600 
$PGDATA/pg_hba.conf    
rm $PGDATA/pg_hba.conf.orig
    
fi    # Check for postmaster already 
running...    # note that pg_ctl only 
looks at the data structures in 
PGDATA    # you really do need the 
pidof()    if [ "`uname`" = "Linux" 
]; then   
pid=`pidof -s postmaster`    
else   pid=`ps 
-eaf | grep postmaster | grep -v grep | tail -1 | awk '{print 
$2}'`    
fi    if [ $pid ] && $PGCTL 
status -D $PGDATA > /dev/null 
2>&1    
then    
echo "Postmaster already running."    
else    
if [ "`uname`" = "Linux" ]; 
then   
rm -f /tmp/.s.PGSQL.${PGPORT} > 
/dev/null   
rm -f /tmp/.s.PGSQL.${PGPORT}.lock > 
/dev/null   
rm -f $PGDATA/postmaster.pid > 
/dev/null   
/bin/sh -c "$PGCTL -l $POSTGRES_LOG -D $PGDATA -p $POSTMASTER -o '-p ${PGPORT}' 
start  > /dev/null 2>&1"< 
/dev/null    
fi    
sleep 
1    
if [ "`uname`" = "Linux" ]; 
then   
pid=`pidof -s 
postmaster`    
else   
pid=`ps -eaf | grep postmaster | grep -v grep | tail -1 | awk '{print 
$2}'`    
fi    
if [ $pid 
]    
then    
#echo "success 
$PSQL_START"    
echo_success    
else    
#echo "failure 
$PSQL_START"    
echo_failure    
fi
    fi}
stop(){    echo "Stopping 
${NAME} service: "    if [ "`uname`" 
= "Linux" ]; 
then   /bin/sh -c 
"$PGCTL stop -D $PGDATA -s -m fast" > /dev/null 
2>&1    
fi    
ret=$?    if [ $ret -eq 0 
]    
then   

[GENERAL] postmaster does not come up

2005-12-05 Thread surabhi.ahuja
hi all..
sometime back i had asked a question 
is ther no way to recove the database in case postmaster fails to come 
up??
 
i dont remember what was there in the log file ... i had seen it sometime 
back ...for which i dont have the logs
 
i dint check if by restarting the system the problem would go away?..
 
do u need to take pg_dump then at regular intervals ?
 
thanks,
regards
Surabhi

Re: [GENERAL] postmaster does not come up

2005-11-24 Thread hubert depesz lubaczewski
On 11/25/05, surabhi.ahuja <[EMAIL PROTECTED]> wrote:
if i try to start postmaster ...it times out.
what can be the possible cause of it . I also have seen a core file being 
generated.i ll again copy paste the script i am using for starting up and shutting 
down postmasterPOSTGRES_LOG="$SDCHOME/nuevo/logfiles/postgreslog"
what does the log say?

depesz


Re: [GENERAL] postmaster does not come up

2005-11-28 Thread surabhi.ahuja




 
it just times out 
 
and nothing was there in the logs ...
 
i just specified the log file name while starting postmsater but it 
had nothing


From: hubert depesz lubaczewski 
[mailto:[EMAIL PROTECTED]Sent: Fri 11/25/2005 1:22 PMTo: 
surabhi.ahujaCc: pgsql-general@postgresql.orgSubject: Re: 
[GENERAL] postmaster does not come up


  
  
***
Your mail has been scanned by InterScan VirusWall.
***-***

On 11/25/05, surabhi.ahuja <[EMAIL PROTECTED]> wrote: 



  if i try to start postmaster ...it times out.
  what can be the possible cause of it . I also have seen a core file being 
  generated.
  i ll again copy paste the script i am using for starting up and shutting 
  down postmaster
  POSTGRES_LOG="$SDCHOME/nuevo/logfiles/postgreslog"what 
does the log say?depesz


Re: [GENERAL] postmaster does not come up

2005-12-05 Thread Jeffrey Webster
This is a little vague...There is a way to recover the data.  Make postmaster come back up.  Unless you're talking about postmaster not coming up due to corrupted data files, or a hardware failure.You do need to use pg_dump at regular intervals.  It is common practice to back up data, after all.
Now, instead of being vague, let's see if you can't give us a bit more information about why your postmaster is failing to start.  Have you tried starting it manually?  For example, running postmaster directly from the command line.  Like so:
postmaster -D /usr/local/pgsql/dataReplace "/usr/local/pgsql/data" with the path to your own.  If postmaster fails to come up, what errors/warnings did it report?
On 12/5/05, surabhi.ahuja <[EMAIL PROTECTED]> wrote:
hi all..
sometime back i had asked a question 
is ther no way to recove the database in case postmaster fails to come 
up??
 
i dont remember what was there in the log file ... i had seen it sometime 
back ...for which i dont have the logs
 
i dint check if by restarting the system the problem would go away?..
 
do u need to take pg_dump then at regular intervals ?
 
thanks,
regards
Surabhi