pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Adrian Klaver <adrian.klaver@aklaver.com>
To: Telium Technical Support <support@telium.io>
To: pgsql-general@lists.postgresql.org
Subject: Re: pg_ctlcluster is not stopping cluster
Date: Fri, 7 Apr 2023 15:47:17 -0700
Message-ID: <5beba911-281c-685f-509a-73d7af990897@aklaver.com> (raw)
In-Reply-To: <010001875dd4ebe6-ba96b71f-2461-45da-ab24-0abf56f56f4f-000000@email.amazonses.com>
References: <010001875dd4ebe6-ba96b71f-2461-45da-ab24-0abf56f56f4f-000000@email.amazonses.com>

On 4/7/23 15:27, Telium Technical Support wrote:
> I am string to stop my PostgreSQL (on debian 11) server using the 
> following command
> 
> root@d11:/# sudo -u postgres /usr/bin/pg_ctlcluster 15 main stop -- -m 
> fast -D /var/lib/postgresql/13/main
> 
> Notice: extra pg_ctl/postgres options given, bypassing systemctl for 
> stop operation
> 
> pg_ctl: PID file "/var/lib/postgresql/13/main/postmaster.pid" does not exist
> 
> Is server running?
> 
> The notice is correct, the is no such postmaster.pid file in that 
> directory, but yes the service is running. I can confirm it's running with:
> 
> root@d11:/# sudo -u postgres /usr/bin/pg_ctlcluster 15 main status -- -D 
> /var/lib/postgresql/13/main
> 
> pg_ctl: server is running (PID: 2701882)
> 
> /usr/lib/postgresql/15/bin/postgres "-D" "/var/lib/postgresql/13/main" 
> "-c" "config_file=/etc/postgresql/15/main/postgresql.conf"
> 
> So why is my stop command being ignored? (I tried without the -m fast 
> option but no change, and I'd like to keep that for other reasons). I 
> confirmed with 'ps ax' that postgresql 15 is running, despite the 
> directory suggesting it might be 13.  Coincidentally, there is a 
> postmaster.pid file in a directory OTHER than the data directory:
> 
> /var/lib/postgresql/15/main/postmaster.pid
> 
> (and notice the 15). Is this a clue?

Yes that this:

  sudo -u postgres /usr/bin/pg_ctlcluster 15 main stop -- -m fast -D 
/var/lib/postgresql/13/main

is not correct.

First do:

pg_lsclusters

to determine what is actually running.

Then do

sudo -u postgres /usr/bin/pg_ctlcluster <version> main stop -- -m fast 
-D /var/lib/postgresql/13/main stop -m fast

for whatever version is running.

> 

-- 
Adrian Klaver
adrian.klaver@aklaver.com






view thread (10+ messages)  latest in thread

Message-ID: <5beba911-281c-685f-509a-73d7af990897@aklaver.com>
Permalink:  ../5beba911-281c-685f-509a-73d7af990897@aklaver.com/
Also on:    postgresql.org/message-id/5beba911-281c-685f-509a-73d7af990897@aklaver.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-general@postgresql.org
  Cc: adrian.klaver@aklaver.com, support@telium.io
  Subject: Re: pg_ctlcluster is not stopping cluster
  In-Reply-To: <5beba911-281c-685f-509a-73d7af990897@aklaver.com>
  References: <010001875dd4ebe6-ba96b71f-2461-45da-ab24-0abf56f56f4f-000000@email.amazonses.com> <5beba911-281c-685f-509a-73d7af990897@aklaver.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox