Thread: Problems shutting down Postmaster

Problems shutting down Postmaster

From
Andrew Edson
Date:
I need to add a system to our postgres pg_hba.conf file; the main server went down a few days ago, and this system was mistakenly left off the list of allowed systems when the server was brought back up.  (Older version of the .conf file; I managed to accidentally delete the more current one while trying to copy it for safekeeping.  Proves what an idiot I am...)
 
Someone else added the IP address for the other system to the pg_hba.conf file later, but since we had already started postgres by then, it didn't take.  And now, for some reason, postgres doesn't seem to want to let me shut down.  I keep getting the following error when trying to shut the postmaster down:
 
./pg_ctl stop -D /usr/local/pgsql/data/
waiting for postmaster to shut down............................................................... failed
pg_ctl: postmaster does not shut down
 
I am doing this as the postgres user, so I'm not sure what else I might be doing wrong.  Does anyone have any kind of suggestions about how to solve this?  Alternately, would someone please let me know of other ways to shut down the postmaster so we can restart it with the updated .conf file?
 
Thank you for your consideration.


Don't be flakey. Get Yahoo! Mail for Mobile and
always stay connected to friends.

Re: Problems shutting down Postmaster

From
Tom Lane
Date:
Andrew Edson <cheighlund@yahoo.com> writes:
>   Someone else added the IP address for the other system to the
>   pg_hba.conf file later, but since we had already started postgres by
>   then, it didn't take.

You don't need to shut down the server to adjust pg_hba.conf ... just
"pg_ctl reload".

> And now, for some reason, postgres doesn't seem to want to let me shut
> down.

A standard shutdown doesn't finish until all existing sessions exit of
their own accord.  Perhaps you wanted "-m fast"?

            regards, tom lane

Re: Problems shutting down Postmaster

From
Rodrigo Gonzalez
Date:
Andrew Edson wrote:
> I need to add a system to our postgres pg_hba.conf file; the main server
> went down a few days ago, and this system was mistakenly left off the
> list of allowed systems when the server was brought back up.  (Older
> version of the .conf file; I managed to accidentally delete the more
> current one while trying to copy it for safekeeping.  Proves what an
> idiot I am...)
>
> Someone else added the IP address for the other system to the
> pg_hba.conf file later, but since we had already started postgres by
> then, it didn't take.  And now, for some reason, postgres doesn't seem
> to want to let me shut down.  I keep getting the following error when
> trying to shut the postmaster down:
>
> ./pg_ctl stop -D /usr/local/pgsql/data/
> waiting for postmaster to shut
> down............................................................... failed
> pg_ctl: postmaster does not shut down
>
> I am doing this as the postgres user, so I'm not sure what else I might
> be doing wrong.  Does anyone have any kind of suggestions about how to
> solve this?  Alternately, would someone please let me know of other ways
> to shut down the postmaster so we can restart it with the updated .conf
> file?
>
> Thank you for your consideration.
>
> ------------------------------------------------------------------------
> Don't be flakey. Get Yahoo! Mail for Mobile
> <http://us.rd.yahoo.com/evt=43909/*http://mobile.yahoo.com/mail> and
> always stay connected
> <http://us.rd.yahoo.com/evt=43909/*http://mobile.yahoo.com/mail> to
> friends.

Take a look at the -m option for pg_ctl

Re: Problems shutting down Postmaster

From
Richard Troy
Date:
On Thu, 8 Feb 2007, Andrew Edson wrote:
<snip>
>   Someone else added the IP address for the other system to the
> pg_hba.conf file later, but since we had already started postgres by
> then, it didn't take.  And now, for some reason, postgres doesn't seem
> to want to let me shut down.

Try telling Postgres about your new pg_hba.cfg file by using

    pg_ctl reload

I'm not aware why you couldn't just stop it with

   pg_ctl stop

even with the wrong pg_hba.conf file.

HTH,
Richard

--
Richard Troy, Chief Scientist
Science Tools Corporation
510-924-1363 or 202-747-1263
rtroy@ScienceTools.com, http://ScienceTools.com/


Re: Problems shutting down Postmaster

From
Andrew Edson
Date:
Okay, for some reason we still had a problem connecting after a pg_ctl reload, but the shutdown went through this time, and everything's working now.  Thanks for the assistance.

Tom Lane <tgl@sss.pgh.pa.us> wrote:
Andrew Edson writes:
> Someone else added the IP address for the other system to the
> pg_hba.conf file later, but since we had already started postgres by
> then, it didn't take.

You don't need to shut down the server to adjust pg_hba.conf ... just
"pg_ctl reload".

> And now, for some reason, postgres doesn't seem to want to let me shut
> down.

A standard shutdown doesn't finish until all existing sessions exit of
their own accord. Perhaps you wanted "-m fast"?

regards, tom lane


Looking for earth-friendly autos?
Browse Top Cars by "Green Rating" at Yahoo! Autos' Green Center.