Thread: Postgres, OS X Tiger, and launchd

Postgres, OS X Tiger, and launchd

From
Nicholas Tulach
Date:
I spent the last few hours attempting to get Postgres to start via
launchd in OS X Tiger, so I thought I'd share with the community what
I ended up doing:

I created a file called "org.postgres.PostgreSQL.plist", which I'm
including at the end of this message.

Simply place the file in the /Library/LaunchAgents folder, restart,
and Voila!  Your DB server should be running.

Feel free to email me if you've got ?s.

cheers,
-n



Here is the file (between the equals signs at the top and bottom)
====
<?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>GID</key>
     <integer>502</integer>
     <key>GroupName</key>
     <string>postgres</string>
     <key>Label</key>
     <string>org.postgres.PostgreSQL</string>
     <key>OnDemand</key>
     <false/>
     <key>ProgramArguments</key>
     <array>
         <string>/usr/local/pgsql/bin/postmaster</string>
         <string>-D</string>
         <string>/usr/local/pgsql/data</string>
     </array>
     <key>ServiceDescription</key>
     <string>PostgreSQL Database Server</string>
     <key>UID</key>
     <integer>502</integer>
     <key>UserName</key>
     <string>postgres</string>
</dict>
</plist>
====

Re: Postgres, OS X Tiger, and launchd

From
Jesse Wilson
Date:
Hey Nicholas - -

I tried your tip from May 6, 2005:
http://archives.postgresql.org/pgsql-ports/2005-05/msg00005.php

But I modified the .plist file. Your tip worked great, but
I had to put the file in the /Library/LaunchDaemons folder,
rather than /Library/LaunchAgents

Cheers,
Jesse

Attachment