mirror of
https://github.com/actions/runner-images.git
synced 2025-12-19 08:22:12 +00:00
[macOS] Rename build scripts (#8887)
Co-authored-by: Alexey Ayupov <“alexey.ayupov@akvelon.com”>
This commit is contained in:
45
images/macos/scripts/build/configure-max-files-limitation.sh
Normal file
45
images/macos/scripts/build/configure-max-files-limitation.sh
Normal file
@@ -0,0 +1,45 @@
|
||||
#!/bin/bash -e -o pipefail
|
||||
################################################################################
|
||||
## File: configure-max-files-limitation.sh
|
||||
## Desc: Configure max files limitation
|
||||
################################################################################
|
||||
|
||||
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>Program</key>
|
||||
<string>/Users/runner/limit-maxfiles.sh</string>
|
||||
<key>RunAtLoad</key>
|
||||
<true/>
|
||||
<key>ServiceIPC</key>
|
||||
<false/>
|
||||
</dict>
|
||||
</plist>
|
||||
EOF
|
||||
|
||||
# Creating script for applying workaround https://developer.apple.com/forums/thread/735798
|
||||
|
||||
cat > "/Users/runner/limit-maxfiles.sh" << EOF
|
||||
#!/bin/bash
|
||||
sudo launchctl limit maxfiles 256 unlimited
|
||||
sudo launchctl limit maxfiles 65536 524288
|
||||
EOF
|
||||
|
||||
echo "limit.maxfiles.sh permissions changing"
|
||||
chmod +x "/Users/runner/limit-maxfiles.sh"
|
||||
|
||||
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"
|
||||
Reference in New Issue
Block a user