Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save ne0x/b43389a0e70f45bd560985ccd3f33e4e to your computer and use it in GitHub Desktop.

Select an option

Save ne0x/b43389a0e70f45bd560985ccd3f33e4e to your computer and use it in GitHub Desktop.
Disable/Enable PostgreSQL Autostart on Mac OS X Lion
<?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>Disabled</key>
<false/>
<key>Label</key>
<string>com.edb.launchd.postgresql-9.1</string>
<key>ProgramArguments</key>
<array>
<string>/Library/PostgreSQL/9.1/bin/postmaster</string>
<string>-D/Library/PostgreSQL/9.1/data</string>
</array>
<key>RunAtLoad</key>
<true/>
<key>UserName</key>
<string>postgres</string>
<key>KeepAlive</key>
<dict>
<key>SuccessfulExit</key>
<false/>
</dict>
</dict>
</plist>
## Stop PostgreSQL from auto starting in Mac OS X 10.7.x (Lion)
sudo launchctl unload -w /Library/LaunchDaemons/com.edb.launchd.postgresql-9.1.plist
## Enable PostgreSQL to auto start in Mac OS X 10.7.x (Lion)
sudo launchctl unload -w /Library/LaunchDaemons/com.edb.launchd.postgresql-9.1.plist
## Note:
## - Without "sudo" the commands seem to run successfully but don't take effect
## - Contents of com.edb.launchd.postgresql-9.1.plist in attached file (Permission MUST be: -rw-r--r-- 1 root wheel)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment