I've written a plist file to try to get Postgres to load on startup on Mac OS X but I can't get it to start the service. The plist file is saved in /Library/LaunchDaemons.
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN"
"http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>org.postgres</string>
<key>UserName</key>
<string>postgres</string>
<key>ProgramArguments</key>
<array>
<string>/usr/local/pgsql/bin/postgres</string>
<string>-D/usr/local/pgsql/data</string>
<string>-l /var/log/pgsql/logfile</string>
</array>
<key>RunAtLoad</key>
<true/>
<!--The Sockets block was added in an attempt to get it to work but it makes no difference -->
<key>Sockets</key>
<dict>
<key>Listeners</key>
<dict>
<key>SockServiceName</key>
<string>postgresql</string>
<key>SockType</key>
<string>stream</string>
<key>SockFamily</key>
<string>IPv4</string>
</dict>
</dict>
<key>StandardOutPath</key>
<string>/var/log/pgsql/psql.log</string>
<key>StandardErrorPath</key>
<string>/var/log/pgsql/psql.log</string>
<key>KeepAlive</key>
<true/>
</dict>
</plist>
The postgres daemon refuses to start and psql.log contains a single line on each attempt: FATAL: SSL is not supported by this build
. If I run the postgres executable manually with
sudo - u postgres /usr/local/pgsql/bin/postgres -D/usr/local/pgsql/data -l/var/log/psql.log
it starts normally. Both the postgres data directory and the logfile and directory are owned by the postgres user.
I built postgres without SSL support due to problems I was having with the build on Max OS X - it's my development machine so doesn't need it.
I added the Sockets entry in the XML after reading through Apple's launchctl docs but it doesn't make any difference. For completeness my /etc/services file has these two entries:
postgresql 5432/udp # PostgreSQL Database
postgresql 5432/tcp # PostgreSQL Database
Mac OS X Catalina
I can't see why launchctl needs SSL to start the service anyway. It seems like launchctl is connecting via a secure socket which is causing my SSL-free installation of postgres to die. Am I correct and if so, it there a way to stop it?