Thread: how to stop postmaster

how to stop postmaster

From
"Keith Worthington"
Date:
Hi All,

I've just gotten PostgreSQL installed.  The problem is now that I have started
the postmaster (incorrectly it appears) how do I stop it?  I have read the
tips long enough to know that I shouldn't kill it!  Here is what I did.

$ postmaster -D /raid02/databases/
LOG:  database system was shut down at 2004-10-08 14:28:45 EDT
LOG:  checkpoint record is at 0/8018BC
LOG:  redo record is at 0/8018BC; undo record is at 0/0; shutdown TRUE
LOG:  next transaction id: 480; next oid: 16976
LOG:  database system is ready
$

$ pg_ctl stop -m smart
pg_ctl: cannot find /var/lib/pgsql/data/postmaster.pid
Is postmaster running?
$ ps -ef | grep postmaster
postgres 24379 24089  0 14:29 pts/5    00:00:00 postmaster -D
/raid02/databases/postgres 24481 24089  0 14:36 pts/5    00:00:00 grep postmaster
$ pg_ctl status
pg_ctl: postmaster or postgres is not running
$

I would also like to know how to start the postmaster properly on a permanent
basis.  For instance at boot time.

Kind Regards,
Keith

______________________________________________
99main Internet Services http://www.99main.com


Re: how to stop postmaster

From
Tom Lane
Date:
"Keith Worthington" <keithw@narrowpathinc.com> writes:
> Here is what I did.

> $ postmaster -D /raid02/databases/

> $ pg_ctl stop -m smart
> pg_ctl: cannot find /var/lib/pgsql/data/postmaster.pid
> Is postmaster running?

pg_ctl evidently thinks that PGDATA is /var/lib/pgsql/data, which I
suppose it got from an environment variable you have set; but you
told the postmaster to use PGDATA = /raid02/databases.  So you need
    pg_ctl stop -D /raid02/databases/ -m whatever

Or change your environment variable.

> I would also like to know how to start the postmaster properly on a permanent
> basis.  For instance at boot time.

Usually people do that with an init script.  There's a simple one in the
source distribution (look in contrib/start-scripts) but you're probably
better off using the one that comes with the RPM distribution.

            regards, tom lane