Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions .assets/provision/fix_no_file.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#!/usr/bin/env sh
: '
# Fixes the "Too many open files" error.
sudo .assets/provision/fix_no_file.sh
'
set -eu

if [ "$(id -u)" -ne 0 ]; then
printf '\e[31;1mRun the script as root.\e[0m\n' >&2
exit 1
fi

if [ -f '/etc/systemd/user.conf' ] && grep -qw '#DefaultLimitNOFILE' '/etc/systemd/user.conf'; then
sed -i 's/^#DefaultLimitNOFILE=.*/DefaultLimitNOFILE=65535/' /etc/systemd/user.conf
fi
1 change: 1 addition & 0 deletions wsl/wsl_setup.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -388,6 +388,7 @@ process {

# *install packages
Show-LogContext 'updating system'
wsl.exe --distribution $Distro --user root --exec .assets/provision/fix_no_file.sh
wsl.exe --distribution $Distro --user root --exec .assets/provision/fix_secure_path.sh
wsl.exe --distribution $Distro --user root --exec .assets/provision/upgrade_system.sh
wsl.exe --distribution $Distro --user root --exec .assets/provision/install_base.sh $chk.user
Expand Down