Skip to content

Instantly share code, notes, and snippets.

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

Revisions

  1. @abhishekdev abhishekdev revised this gist Mar 14, 2012. 1 changed file with 8 additions and 1 deletion.
    9 changes: 8 additions & 1 deletion pgSQLautorun.sh
    Original file line number Diff line number Diff line change
    @@ -2,8 +2,15 @@
    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
    sudo launchctl load -w /Library/LaunchDaemons/com.edb.launchd.postgresql-9.1.plist

    ## Manually Start PostgreSQL
    ## su as user "postgres" and run server:
    cd /Library/PostgreSQL/9.1/bin/
    ./pg_ctl -D /Library/PostgreSQL/9.1/data/ start

    ## Manually Stop PostgreSQL
    ./pg_ctl -D /Library/PostgreSQL/9.1/data/ stop

    ## Note:
    ## - Without "sudo" the commands seem to run successfully but don't take effect
  2. @abhishekdev abhishekdev renamed this gist Mar 2, 2012. 1 changed file with 0 additions and 0 deletions.
    File renamed without changes.
  3. @abhishekdev abhishekdev created this gist Mar 2, 2012.
    25 changes: 25 additions & 0 deletions com.edb.launchd.postgresql-9.1.plist
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,25 @@
    <?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>
    10 changes: 10 additions & 0 deletions gistfile1.sh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,10 @@
    ## 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)