Re: Updated macOS start scripts - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Updated macOS start scripts
Date
Msg-id 3786.1511896652@sss.pgh.pa.us
Whole thread Raw
In response to Re: Updated macOS start scripts  (Mark Dilger <hornschnorter@gmail.com>)
Responses Re: Updated macOS start scripts  (Mark Dilger <hornschnorter@gmail.com>)
List pgsql-hackers
Mark Dilger <hornschnorter@gmail.com> writes:
> Upon further review, I have noticed that `pg_ctl stop` does not work once
> the org.postgresql.postgres service has been started.  I was trying to stop,
> reinstall and re-initdb and restart postgres and this service was a pita.  I had
> to go back to your osx.patch to remind myself what I had done and only then
> could I stop the service and continue my work.

> Is there any way this patch could be improved to work nicely with pg_ctl?  It
> seems that `pg_ctl stop` indeed stops the postgres process, but the system
> launches a new one so quickly that pg_ctl thinks the service has not stopped,
> and it just waits forever (or until it times out, depending on your settings).

Hmm.  Maybe we should have the plist file set KeepAlive to false not true?
This would mean you'd need manual action to restart a failed postmaster,
but that probably comes with the territory --- I do not see how we'd
teach launchd the difference between a "failed" postmaster and a manually
shut down one.

I think the normal way to stop/restart a launchd service is to use
"launchctl unload/load" ... we'd need to see how that interacts with
using pg_ctl.  Some documentation might be needed in any case.
        regards, tom lane


pgsql-hackers by date:

Previous
From: Robert Haas
Date:
Subject: Re: With commit 4e5fe9ad19, range partition missing handling for theNULL partition key
Next
From: Robert Haas
Date:
Subject: Re: Typo in ExecBuildSlotPartitionKeyDescription prologue