5

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.

Jonathan Leffler
  • 730,956
  • 141
  • 904
  • 1,278
Mur Quirk
  • 171
  • 1
  • 2
  • 12

2 Answers2

7

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
Glorfindel
  • 21,988
  • 13
  • 81
  • 109
James Allman
  • 40,573
  • 11
  • 57
  • 70
  • I got my fair share of headaches before reading this. Thanks to you, I can now continue with developing. – Mur Quirk Feb 12 '12 at 22:22
  • The up-to-date Ruby command for installing Homebrew can be found at http://mxcl.github.com/homebrew/ – Andrew Swan Apr 04 '13 at 02:58
  • 2
    I installed Postgres using homebrew, but had to create a /etc/sysctl.conf file before I could increase the max_connections parameter. – Andrew Swan Apr 05 '13 at 04:48
1

Mine contains the following:

kern.sysv.shmmax=134217728
kern.sysv.shmmin=1
kern.sysv.shmmni=256
kern.sysv.shmseg=64
kern.sysv.shmall=32768

I have Lion myself but I don't think there was anything else in it when I was using Snow Leopard.

Eelke
  • 20,897
  • 4
  • 50
  • 76