69 words — 1 minutes read

Start postgres with launchd on OS X

The startup item for Postgres on OS X always fails on Tiger. Launchd (the launch daemon) to rescue:

PostgreSQL launchd on Tiger gave me the starting point and my /Library/LaunchDaemons/org.postgresql.PostgreSQL.plist looks like this:

< ?xml version="1.0" encoding="UTF-8"?>
< !DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "https://www.apple.com/DTDs/PropertyList-1.0.dtd">


    GroupName
    postgres
    Label
    org.postgresql.PostgreSQL
    OnDemand

    ProgramArguments

        /opt/local/lib/pgsql8/bin/pg_ctl
        -D
        /opt/local/var/pgsql8/defaultd
        -l
        /opt/local/var/log/psql8/
        start

    RunAtLoad

    ServiceDescription
    PostgreSQL Server
    UserName
    postgres8

Technorati Tags: mac, postgresql, launchd

Jens-Christian Fischer

Maker. Musician