Files
runner-images/images/macos/provision/configuration/max-files.sh
Mikhail Timofeev 0d46520ccf [macOS] Fail builds on errors during the image generation (#1756)
* set -e and fix all the scripts

* add source utils to finalize_vm script

* change xcode version in postbuild script

* fix for softwareupdates and for xcode version
2020-10-23 17:59:08 +03:00

38 lines
961 B
Bash
Executable File

#!/bin/bash -e -o pipefail
Launch_Daemons="/Library/LaunchDaemons"
# EOF in quotes to disable variable expansion
echo "Creating limit.maxfiles.plist"
cat > "${Launch_Daemons}/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>52428</string>
<string>524288</string>
</array>
<key>RunAtLoad</key>
<true/>
<key>ServiceIPC</key>
<false/>
</dict>
</plist>
EOF
echo "limit.maxfiles.plist permissions changing"
chown root:wheel "${Launch_Daemons}/limit.maxfiles.plist"
chmod 0644 "${Launch_Daemons}/limit.maxfiles.plist"
echo "Done, limit.maxfiles has been updated"