Re: How to shoot yourself in the foot: kill -9 postmaster - Mailing list pgsql-hackers

From Lamar Owen
Subject Re: How to shoot yourself in the foot: kill -9 postmaster
Date
Msg-id 3AA524AA.1B1EB229@wgcr.org
Whole thread Raw
In response to Re: How to shoot yourself in the foot: kill -9 postmaster  (Peter Eisentraut <peter_e@gmx.net>)
Responses Re: How to shoot yourself in the foot: kill -9 postmaster  (Peter Eisentraut <peter_e@gmx.net>)
List pgsql-hackers
Peter Eisentraut wrote:
> 
> Lamar Owen writes:
> 
> > I missed something somehwere: wasn't the consensus a few weeks ago that
> > pg_ctl shouldn't be used for a system initscript?
> 
> The consensus(?) was that there was some work to do in pg_ctl before it
> was robust enough to be used (for anything).  That work has been done.

That was the detail I missed.

> case when the postmaster does not come down after 60 seconds.  But this is
> really no problem for the issue at hand because if you do a normal
> runlevel switch then the postmaster will simply keep running, and during a
> system shutdown all the backends are going to die anyway.

Only if each and every shutdown script succeeds in its task.  And I have
to make sure that the RPM's shipping script successfully pulls down the
system in an orderly fashion -- of course, I don't have to worry about
the case where a postmaster is going to be started back up if we are in
system shutdown -- but, as Tom also stated, I can't assume I'm in the
system's death throes when called with the stop parameter.

And it _is_ possible for an admin to set up the runlevels such that a
level is set aside where even networking isn't running (actually, that
level already exists, and is called 'single user mode') -- or a run
level for website maintenance where networking is still up, but the
webserver and postgresql (and other associated) processes are to be shut
down.  I personally use this -- I have set up runlevel 4 as a 'remote
single user mode' of sorts where I still have sshd running (and the
networking stack, obviously), but AOLserver, postgresql, and RealServer
are shut down.  I then switch runlevels back to 3 to return to normal. 
Much easier than manually stopping and restarting (in the correct order,
as AOLserver is not a happy camper if postmaster drops out from
underneath it) all the necessary pieces.

So I can't assume anything.  The default RPM installation used to
automatically configure runlevels 3, 4, and 5 (not any more), but my
script can't assume that the system is actually in that state by any
means.
--
Lamar Owen
WGCR Internet Radio
1 Peter 4:11


pgsql-hackers by date:

Previous
From: Zeugswetter Andreas SB
Date:
Subject: AW: AW: AW: AW: WAL-based allocation of XIDs is insecur e
Next
From: The Hermit Hacker
Date:
Subject: Re: mailing list messages