Re: [GENERAL] Again: How the hell do I restart immediately

From: Ted Nolan SRI Augusta GA <ted(at)ags(dot)ga(dot)erg(dot)sri(dot)com>
To: pgsql-general(at)postgreSQL(dot)org
Subject: Re: [GENERAL] Again: How the hell do I restart immediately
Date: 1999-10-08 18:35:26
Message-ID: 199910081829.OAA02909@ags.ga.erg.sri.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

In message <199910081726(dot)SAA06340(at)argh(dot)demon(dot)co(dot)uk>you write:
>
>Call this script postmasterangel.sh (as in guardian angel) and run it
>instead of the postmaster. Change the postmaster line in here to be
>your postmaster boot configuration options.
>
><disclaimer>
>This runs under linux. It will probably work under most un*x
>flavors. Dont expect anything under doze unless you use cygwin for it.
>Yes its nasty, I wrote it to doa job, not to look good
></disclaimer>
>
>----------------------------------------------
>#!/bin/sh -
>
>pma=`ps x | grep -v grep | grep postmasterangel | grep 'sh -' | wc -l`
>
>if [ "$pma" -gt "2" ]
>then
> exit 0
>fi
>
>while [ 1 ]
>do
>
> pm=`ps x | grep -v grep | grep -v angel | grep postmaster`
> if [ "x$pm" = "x" ]
> then
> /usr/bin/postmaster -o "-F -S 10240" -d 1 -N 512 -B 3000 -D/var/lib/pg
>sql/data -o -F > /tmp/postmasterout 2> /tmp/postmastererr
> else
> sleep 60
> fi
>
>done
>
>************
>

Hmm, perhaps I'm missing something, but since the postmaster doesnt go
into the background by default, couldn't you just run a script
with a loop creating postmasters as they die? Something like:

#! /bin/sh

while :
do
postmaster >> post.out 2>&1
done

Ted

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Doran L. Barton 1999-10-08 19:37:13 Re: [GENERAL] Again: How the hell do I restart immediately
Previous Message Michael Simms 1999-10-08 17:26:50 Re: [GENERAL] Again: How the hell do I restart immediately