Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eJlNx-0003ag-1f for pgsql-hackers@arkaria.postgresql.org; Tue, 28 Nov 2017 19:17:37 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eJlNw-0008DK-K8 for pgsql-hackers@arkaria.postgresql.org; Tue, 28 Nov 2017 19:17:36 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1eJlNw-0008DA-A7 for pgsql-hackers@lists.postgresql.org; Tue, 28 Nov 2017 19:17:36 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1eJlNt-000415-Tg for pgsql-hackers@postgreSQL.org; Tue, 28 Nov 2017 19:17:35 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id vASJHWKJ003787; Tue, 28 Nov 2017 14:17:32 -0500 From: Tom Lane To: Mark Dilger cc: pgsql-hackers@postgreSQL.org Subject: Re: Updated macOS start scripts In-reply-to: <173420E2-64DB-4802-9EB2-AEFB11F46045@gmail.com> References: <31338.1510763554@sss.pgh.pa.us> <6D443E39-13C2-4185-9FE4-B5CB416AB06E@gmail.com> <21689.1510772433@sss.pgh.pa.us> <173420E2-64DB-4802-9EB2-AEFB11F46045@gmail.com> Comments: In-reply-to Mark Dilger message dated "Tue, 28 Nov 2017 11:07:24 -0800" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <3785.1511896652.1@sss.pgh.pa.us> Content-Transfer-Encoding: quoted-printable Date: Tue, 28 Nov 2017 14:17:32 -0500 Message-ID: <3786.1511896652@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Mark Dilger writes: > Upon further review, I have noticed that `pg_ctl stop` does not work onc= e > the org.postgresql.postgres service has been started. I was trying to s= top, > 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 t= hen > 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 syst= em > launches a new one so quickly that pg_ctl thinks the service has not sto= pped, > and it just waits forever (or until it times out, depending on your sett= ings). 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