Increasing shared memory limits with kern.sysv.*

What is the correct way to increase sysv shared memory limits which survives a system reboot? Currently we create this file:

/Library/LaunchDaemons/com.gemtalksystems.shared-memory.plist

<?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>shmemsetup</string> <key>UserName</key> <string>root</string> <key>GroupName</key> <string>wheel</string> <key>ProgramArguments</key> <array> <string>/usr/sbin/sysctl</string> <string>kern.sysv.shmmax=12884901888</string> <string>kern.sysv.shmall=3145728</string> <string>kern.sysv.shmmin=1</string> <string>kern.sysv.shmseg=8</string> </array> <key>KeepAlive</key> <false/> <key>RunAtLoad</key> <true/> </dict> </plist>

File attributes:

normg@oink>xattr -l com.gemtalksystems.shared-memory.plist com.apple.provenance:

This used to work but no longer does.

Now I have to manually execute:

sysctl kern.sysv.shmmax=12884901888

after reboot to increase the limits which is not ideal. Is there a better way?

System info:

normg@oink>sw_vers ProductName: macOS ProductVersion: 13.5 BuildVersion: 22G74 /Library/LaunchDaemons

normg@oink>uname -a Darwin oink.gemtalksystems.com 22.6.0 Darwin Kernel Version 22.6.0: Wed Jul 5 22:17:35 PDT 2023; root:xnu-8796.141.3~6/RELEASE_ARM64_T8112 arm64

I still have this problem on Sonoma. Can anyone help with this? I've confirmed launchd runs this plist and sets the new shared memory limits yet they somehow get reset to the lower values.

Increasing shared memory limits with kern.sysv.*
 
 
Q