Skip to content

Instantly share code, notes, and snippets.

@hawkeyetwolf
Last active August 29, 2015 14:07
Show Gist options
  • Save hawkeyetwolf/338ebc78d7e0722147d9 to your computer and use it in GitHub Desktop.
Save hawkeyetwolf/338ebc78d7e0722147d9 to your computer and use it in GitHub Desktop.
Increase OS X Open Files Limit
#!/bin/bash
echo '<?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>Increase open files limit</string>
<key>ProgramArguments</key>
<array>
<string>/bin/launchctl</string>
<string>limit</string>
<string>maxfiles</string>
<string>unlimited</string>
</array>
<key>RunAtLoad</key>
<true/>
<key>ServiceIPC</key>
<false/>
</dict>
</plist>' | sudo tee /Library/LaunchDaemons/com.apple.launchd.limit.plist
<!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>Increase open files limit</string>
<key>ProgramArguments</key>
<array>
<string>/bin/launchctl</string>
<string>limit</string>
<string>maxfiles</string>
<string>unlimited</string>
</array>
<key>RunAtLoad</key>
<true/>
<key>ServiceIPC</key>
<false/>
</dict>
</plist>
@hawkeyetwolf
Copy link
Author

Create in /Library/LaunchDaemons/ with permissions root:wheel 644

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment