Thread: restart error
[postgresql@stell ~]$ ps axuw | grep postmaster 502 11134 0.0 0.2 19292 3020 pts/5 S Sep22 0:00 /usr/local/pgsql/bin/postmaster -D /var/pgsql/data 502 21676 0.0 0.0 4788 656 pts/12 S+ 10:42 0:00 grep postmaster [postgresql@stell ~]$ pg_ctl restart -D /var/pgsql/data waiting for postmaster to shut down............................................................... failed pg_ctl: postmaster does not shut down [postgresql@stell ~]$ yet postmaster is gone: [postgresql@stell ~]$ ps axuw | grep postmaster 502 21717 0.0 0.0 4640 644 pts/12 R+ 10:52 0:00 grep postmaster server.log not updated...? [postgresql@stell ~]$ ls -l /home/postgresql/server.log -rw-rw-r-- 1 postgresql postgresql 2343 Aug 23 09:48 /home/postgresql/server.log How can I figure out what the problem is?
Ray Stell <stellr@cns.vt.edu> writes: > [postgresql@stell ~]$ pg_ctl restart -D /var/pgsql/data > waiting for postmaster to shut down............................................................... failed > pg_ctl: postmaster does not shut down > [postgresql@stell ~]$ > yet postmaster is gone: Looking at the code, it seems that pg_ctl is waiting for the postmaster lock file (/var/pgsql/data/postmaster.pid) to disappear. Perhaps you've got some kind of file permissions bollix that prevented the postmaster from removing that file? regards, tom lane
On Wed, Oct 04, 2006 at 01:28:37PM -0400, Tom Lane wrote: > Ray Stell <stellr@cns.vt.edu> writes: > > [postgresql@stell ~]$ pg_ctl restart -D /var/pgsql/data > > waiting for postmaster to shut down............................................................... failed > > pg_ctl: postmaster does not shut down > > [postgresql@stell ~]$ > > > yet postmaster is gone: > > Looking at the code, it seems that pg_ctl is waiting for the postmaster > lock file (/var/pgsql/data/postmaster.pid) to disappear. Perhaps you've > got some kind of file permissions bollix that prevented the postmaster > from removing that file? Turns out I had an open session in another shell I'd forgotten about. I tried again with similar results and as I sent \q on the outstanding session, pm went down instantly: [postgresql@wireworm global]$ pg_ctl stop -D /usr/pgsql/data waiting for postmaster to shut down.................................................. done postmaster stopped Also, kill -15 on active psql sessions let postmaster go down quickly.
On Thursday 05 October 2006 16:26, Ray Stell wrote: > On Wed, Oct 04, 2006 at 01:28:37PM -0400, Tom Lane wrote: > > Ray Stell <stellr@cns.vt.edu> writes: > > > [postgresql@stell ~]$ pg_ctl restart -D /var/pgsql/data > > > waiting for postmaster to shut > > > down............................................................... > > > failed pg_ctl: postmaster does not shut down > > > [postgresql@stell ~]$ > > > > > > yet postmaster is gone: > > > > Looking at the code, it seems that pg_ctl is waiting for the postmaster > > lock file (/var/pgsql/data/postmaster.pid) to disappear. Perhaps you've > > got some kind of file permissions bollix that prevented the postmaster > > from removing that file? > > Turns out I had an open session in another shell I'd > forgotten about. I tried again with similar results and > as I sent \q on the outstanding session, pm went down instantly: select * from pg_stat_activity; is your friend. Sean
OR you can use
pg_ctl -D <data-folder> -mf
Thanks,
----
Shoaib Mir
EnterpriseDB (www.enterprisedb.com)
pg_ctl -D <data-folder> -mf
Thanks,
----
Shoaib Mir
EnterpriseDB (www.enterprisedb.com)
On 10/6/06, Sean Davis <sdavis2@mail.nih.gov> wrote:
On Thursday 05 October 2006 16:26, Ray Stell wrote:
> On Wed, Oct 04, 2006 at 01:28:37PM -0400, Tom Lane wrote:
> > Ray Stell <stellr@cns.vt.edu> writes:
> > > [ postgresql@stell ~]$ pg_ctl restart -D /var/pgsql/data
> > > waiting for postmaster to shut
> > > down...............................................................
> > > failed pg_ctl: postmaster does not shut down
> > > [postgresql@stell ~]$
> > >
> > > yet postmaster is gone:
> >
> > Looking at the code, it seems that pg_ctl is waiting for the postmaster
> > lock file (/var/pgsql/data/postmaster.pid) to disappear. Perhaps you've
> > got some kind of file permissions bollix that prevented the postmaster
> > from removing that file?
>
> Turns out I had an open session in another shell I'd
> forgotten about. I tried again with similar results and
> as I sent \q on the outstanding session, pm went down instantly:
select * from pg_stat_activity;
is your friend.
Sean
---------------------------(end of broadcast)---------------------------
TIP 2: Don't 'kill -9' the postmaster
On Fri, Oct 06, 2006 at 01:35:52AM +0500, Shoaib Mir wrote: > OR you can use > > pg_ctl -D <data-folder> -mf pg_ctl stop -D <data-folder> -mf nice. Had not found that in google, lots of kill -15 refs thanks.
This is actually a fast mode of stopping the database server. You saw a lot of -15 as all the clients were forcefully disconnected as result of the -mf switch.
You can find details at --> http://www.postgresql.org/docs/8.1/interactive/app-pg-ctl.html
""Fast" mode does not wait for clients to disconnect. All active transactions are rolled back and clients are forcibly disconnected, then the server is shut down"
Thanks,
-----
Shoaib Mir
EnterpriseDB (www.enterprisedb.com)
You can find details at --> http://www.postgresql.org/docs/8.1/interactive/app-pg-ctl.html
""Fast" mode does not wait for clients to disconnect. All active transactions are rolled back and clients are forcibly disconnected, then the server is shut down"
Thanks,
-----
Shoaib Mir
EnterpriseDB (www.enterprisedb.com)
On 10/6/06, Ray Stell <stellr@cns.vt.edu> wrote:
On Fri, Oct 06, 2006 at 01:35:52AM +0500, Shoaib Mir wrote:
> OR you can use
>
> pg_ctl -D <data-folder> -mf
pg_ctl stop -D <data-folder> -mf
nice. Had not found that in google, lots of kill -15 refs
thanks.