Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eF0cC-0000pk-1s for pgsql-hackers@arkaria.postgresql.org; Wed, 15 Nov 2017 16:32:40 +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 1eF0cA-0000y1-Tu for pgsql-hackers@arkaria.postgresql.org; Wed, 15 Nov 2017 16:32:38 +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 1eF0cA-0000xr-Lc for pgsql-hackers@lists.postgresql.org; Wed, 15 Nov 2017 16:32:38 +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 1eF0c7-0004VK-Or for pgsql-hackers@postgreSQL.org; Wed, 15 Nov 2017 16:32:37 +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 vAFGWYX1031339 for ; Wed, 15 Nov 2017 11:32:34 -0500 From: Tom Lane To: pgsql-hackers@postgreSQL.org Subject: Updated macOS start scripts MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="----- =_aaaaaaaaaa0" Content-ID: <31220.1510763406.0@sss.pgh.pa.us> Date: Wed, 15 Nov 2017 11:32:34 -0500 Message-ID: <31338.1510763554@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk ------- =_aaaaaaaaaa0 Content-Type: text/plain; charset="us-ascii" Content-ID: <31220.1510763406.1@sss.pgh.pa.us> The stuff in contrib/start-scripts/osx/ does not, as far as I know, work at all on any recent release of macOS, because SystemStarter is long gone. I propose replacing it with the attached, which I've tested on current-vintage Macs. If anyone's interested in reviewing this, I'll stick it into the next commitfest. regards, tom lane ------- =_aaaaaaaaaa0 Content-Type: text/x-diff; name="new-macos-startup-1.patch"; charset="us-ascii" Content-ID: <31220.1510763406.2@sss.pgh.pa.us> Content-Description: new-macos-startup-1.patch Content-Transfer-Encoding: quoted-printable diff --git a/contrib/start-scripts/macos/README b/contrib/start-scripts/ma= cos/README index ...c4f2d9a . *** a/contrib/start-scripts/macos/README --- b/contrib/start-scripts/macos/README *************** *** 0 **** --- 1,24 ---- + To make macOS automatically launch your PostgreSQL server at system star= t, + do the following: + = + 1. Edit the postgres-wrapper.sh script and adjust the file path + variables at its start to reflect where you have installed Postgres, + if that's not /usr/local/pgsql. + = + 2. Copy the modified postgres-wrapper.sh script into some suitable + installation directory. It can be, but doesn't have to be, where + you keep the Postgres executables themselves. + = + 3. Edit the org.postgresql.postgres.plist file and adjust its path + for postgres-wrapper.sh to match what you did in step 2. Also, + if you plan to run the Postgres server under some user name other + than "postgres", adjust the UserName parameter value for that. + = + 4. Copy the modified org.postgresql.postgres.plist file into + /Library/LaunchDaemons/. You must do this as root: + sudo cp org.postgresql.postgres.plist /Library/LaunchDaemons + because the file will be ignored if it is not root-owned. + = + At this point a reboot should launch the server. But if you want + to test it without rebooting, you can do + sudo launchctl load /Library/LaunchDaemons/org.postgresql.postgres.p= list diff --git a/contrib/start-scripts/macos/org.postgresql.postgres.plist b/c= ontrib/start-scripts/macos/org.postgresql.postgres.plist index ...fdbd74f . *** a/contrib/start-scripts/macos/org.postgresql.postgres.plist --- b/contrib/start-scripts/macos/org.postgresql.postgres.plist *************** *** 0 **** --- 1,17 ---- + + + + + Label + org.postgresql.postgres + ProgramArguments + + /bin/sh + /usr/local/pgsql/bin/postgres-wrapper.sh + + UserName + postgres + KeepAlive + + + diff --git a/contrib/start-scripts/macos/postgres-wrapper.sh b/contrib/sta= rt-scripts/macos/postgres-wrapper.sh index ...3a4ebda . *** a/contrib/start-scripts/macos/postgres-wrapper.sh --- b/contrib/start-scripts/macos/postgres-wrapper.sh *************** *** 0 **** --- 1,25 ---- + #!/bin/sh + = + # PostgreSQL server start script (launched by org.postgresql.postgres.pl= ist) + = + # edit these as needed: + = + # directory containing postgres executable: + PGBINDIR=3D"/usr/local/pgsql/bin" + # data directory: + PGDATA=3D"/usr/local/pgsql/data" + # file to receive postmaster's initial log messages: + PGLOGFILE=3D"${PGDATA}/pgstart.log" + = + # (it's recommendable to enable the Postgres logging_collector feature + # so that PGLOGFILE doesn't grow without bound) + = + = + # set umask to ensure PGLOGFILE is not created world-readable + umask 077 + = + # wait for networking to be up (else server may not bind to desired port= s) + /usr/sbin/ipconfig waitall + = + # and launch the server + exec "$PGBINDIR"/postgres -D "$PGDATA" >>"$PGLOGFILE" 2>&1 ------- =_aaaaaaaaaa0--