Created
July 11, 2017 15:48
-
-
Save Maarc/d13b1e70f191d5b527a24d39dd3e2569 to your computer and use it in GitHub Desktop.
Bash script updating the ulimits
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# Automating https://blog.dekstroza.io/ulimit-shenanigans-on-osx-el-capitan/ | |
echo "Updating the ulimits on OSX to be able to run RHAMT tests." | |
sudo bash -c 'cat >/Library/LaunchDaemons/limit.maxfiles.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>limit.maxfiles</string> | |
<key>ProgramArguments</key> | |
<array> | |
<string>launchctl</string> | |
<string>limit</string> | |
<string>maxfiles</string> | |
<string>524288</string> | |
<string>524288</string> | |
</array> | |
<key>RunAtLoad</key> | |
<true/> | |
<key>ServiceIPC</key> | |
<false/> | |
</dict> | |
</plist> | |
EOF' | |
sudo bash -c 'cat >/Library/LaunchDaemons/limit.maxproc.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>limit.maxproc</string> | |
<key>ProgramArguments</key> | |
<array> | |
<string>launchctl</string> | |
<string>limit</string> | |
<string>maxproc</string> | |
<string>2048</string> | |
<string>2048</string> | |
</array> | |
<key>RunAtLoad</key> | |
<true /> | |
<key>ServiceIPC</key> | |
<false /> | |
</dict> | |
</plist> | |
EOF' | |
sudo launchctl load -w /Library/LaunchDaemons/limit.maxfiles.plist | |
sudo launchctl load -w /Library/LaunchDaemons/limit.maxproc.plist | |
echo "Please restart your system to make the changes effective." |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment