I am using PostgreSQL 9.2 on RedHat 6
I'm a little confused as to why the following is happening:
-
When postgres is running, performing "service postgresql92-postgresql status" as root results in "postmaster (pid 1379) is running…" (as expected)
-
As postgres run "pg_ctl stop -D $PGDATA -m s" to stop postgres
-
As postgres run "pg_ctl -D $PGDATA start" to start postgres (postgres is now running correctly)
-
Now as root run "service postgresql92-postgresql status", output is now "postmaster dead but pid file exists"
My confusion is why am I getting the message in step 4 when postgres is running correctly? Am I stopping/starting postgres incorrectly?
Best Answer
service postgresql92-postgresql status
checks if the file postmaster.5432.pid instead of postmaster.pid.I'd recommend to use only
pg_ctl
as postgres and check withps aux
as root. Or use onlyservice postgresql92-postgresql start/stop/status
as root. Mixing the two methods would turn into conflicts.