dev.apple

Q: Setting kernel parameters permanently sysctl

Hello Folks,

I want to install the PostgreSQL 9.0 on my MAC OS X 10.6.7
now the basic requirement for the installation is that the shared memory is

kern.sysv.shmmax=1610612736
kern.sysv.shmall=393216
kern.sysv.shmmin=1
kern.sysv.shmmni=32
kern.sysv.shmseg=8
kern.maxprocperuid=512
kern.maxproc=2048

Now tried changing these parameter by editing the /etc/sysctl.conf file
but the issue is when I reboot the kern.sysv.shmmax values is not the same.

How can I set the kern.sysv.shmmax value once and for all?

MacBook Pro, Mac OS X (10.6.6)

Posted on Mar 13, 2011 8:58 AM

Close

Q: Setting kernel parameters permanently sysctl

  • All replies
  • Helpful answers

  • by Linc Davis,

    Linc Davis Linc Davis Mar 13, 2011 9:12 AM in response to dev.apple
    Level 10 (207,963 points)
    Applications
    Mar 13, 2011 9:12 AM in response to dev.apple
    Others have reported that sysctl.conf is ignored, even though the man page (last updated in 2007) says it shouldn't be. Without delving into the Darwin source code, I can't confirm it one way or the other. You could set the kernel parameters in a launchd item that runs at startup. That definitely does work.
  • by dev.apple,

    dev.apple dev.apple Mar 14, 2011 8:02 AM in response to Linc Davis
    Level 1 (0 points)
    Mar 14, 2011 8:02 AM in response to Linc Davis
    Please let me know how to do that ?
  • by Linc Davis,Solvedanswer

    Linc Davis Linc Davis Mar 14, 2011 2:03 PM in response to dev.apple
    Level 10 (207,963 points)
    Applications
    Mar 14, 2011 2:03 PM in response to dev.apple
    sudo -s
    cat > /Library/LaunchDaemons/sysctl.plist << EOF
    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
    <plist version="1.0">
    <dict>
    <key>Label</key>
    <string>sysctl</string>
    <key>ProgramArguments</key>
    <array>
    <string>/usr/sbin/sysctl</string>
    <string>-w</string>
    <string>kern.sysv.shmmax=1610612736</string>
    <string>kern.sysv.shmall=393216</string>
    <string>kern.sysv.shmmin=1</string>
    <string>kern.sysv.shmmni=32</string>
    <string>kern.sysv.shmseg=8</string>
    <string>kern.maxprocperuid=512</string>
    <string>kern.maxproc=2048</string>
    </array>
    <key>RunAtLoad</key>
    <true/>
    </dict>
    </plist>
    EOF
    launchctl load /Library/LaunchDaemons/sysctl.plist