Default /etc/sysctl.conf settings for Mac OS X Snow Leopard?

Mur Quirk picture Mur Quirk · Feb 12, 2012 · Viewed 10.8k times · Source

I tried to install PostgreSQL 9.1.2 for Mac OS X 10.6 and it asked me to edit the sysctl.conf file inside the /etc/ directory, so it could use more of the shared memory PostgreSQL was asking for.

I went ahead and edited the file, saved it, rebooted and then on the login screen I was asked to login as safe boot for some reason, I logged in and internet did not seem to work and the dock menu was laggy.

So it was pretty obvious this was happening because of the sysctl.conf file that I edited before the reboot, so I went back into the /etc directory and deleted the sysctl.conf file thinking it would auto-create a new sysctl.conf file with the default settings but that wasn't the case even after a reboot.

So now I'm pretty much left without a sysctl.conf file, I read the Mac Developer documentation for this file and it didn't say much. I know I probably shouldn't be messing with files that I don't have a clue about but I really wanted to get PostgreSQL working for my local Ruby on Rails development.

Anything on this topic would be helpful.

Answer

James Allman picture James Allman · Feb 12, 2012

I have no /etc/sysctl.conf file on OS X 10.7.2 (Lion).


I suggest you save yourself a lot of headaches and install Postgres using the Homebrew package manager.

The steps, once XCode is installed, are:

Install Homebrew

ruby -e "$(curl -fsSL https://raw.github.com/mxcl/homebrew/go)"

Install Postgres

brew update; brew install postgres

Initialize Postgres

initdb /usr/local/var/postgres

Set Postgres to run automatically

mkdir -p ~/Library/LaunchAgents
cp /usr/local/Cellar/postgresql/9.1.2/homebrew.mxcl.postgresql.plist ~/Library/LaunchAgents/
launchctl load -w ~/Library/LaunchAgents/homebrew.mxcl.postgresql.plist