Database shutdown

Started by Christian Marschalekabout 25 years ago3 messagesgeneral
Jump to latest

Hi all of you! :o)

I guess I do have to shut down the database before shutting down the
linux box?
How would I accomplish this?
Just by killing the postmaster per pid?

Tia and regards!

#2Björn Lundin
bjorn.lundin@swipnet.se.nospam
In reply to: Christian Marschalek (#1)
Re: Database shutdown

Christian Marschalek wrote:

Hi all of you! :o)

I guess I do have to shut down the database before shutting down the
linux box?
How would I accomplish this?
Just by killing the postmaster per pid?

Tia and regards!

---------------------------(end of broadcast)---------------------------
TIP 4: Don't 'kill -9' the postmaster

Add a symbolic link to /etc/inid.d/postgresql in /etc/inid.d/rcd.6 and
/etc/inid.d/rcd.0 (reboot and shutdown)

ln -s /etc/init.d/postgresql /etc/inid.d/rcd.0/K15postgresql

The K make the call with 'stop'.
At boottime there's proberly a call to /etc/inid.d/rcd.0/S85postgresql

where the S makes the call with 'start'

To shutdown manually just su to root and run
'/etc/init.d/postgresql stop'

The links kan be accomplished by running (as root) tksysv (a gui to start
and stop services)

Bj�rn

#3Richard Huxton
dev@archonet.com
In reply to: Christian Marschalek (#1)
Re: Database shutdown

Christian Marschalek wrote:

Hi all of you! :o)

I guess I do have to shut down the database before shutting down the
linux box?
How would I accomplish this?
Just by killing the postmaster per pid?

Be careful with that - there's a page on this in the admin's guide. You
should have a pg_ctl script somewhere though so you can just do:

pg_ctl stop

Also has flags for smart shutdown, options starting PG etc - see man pg_ctl.

You might consider putting a postgres start/stop script in your runlevel
startups so Linux will start/stop it for you automatically.

- Richard Huxton