From 8275f0e1a81c8d92dc56311a9f00679c81fa5359 Mon Sep 17 00:00:00 2001 From: Michele Locati Date: Thu, 14 Jan 2021 14:47:26 +0100 Subject: [PATCH] Speedup apt-get operations in Debian Jessie --- install-php-extensions | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/install-php-extensions b/install-php-extensions index bab5302..2e6d30d 100755 --- a/install-php-extensions +++ b/install-php-extensions @@ -46,6 +46,15 @@ setPHPVersionVariables() { PHP_MAJMINPAT_VERSION=$(printf '%s' "$setPHPVersionVariables_textual" | awk -F. '{print $1*10000+$2*100+$3}') } +# Fix apt-get being very slow on Debian Jessie +# See https://bugs.launchpad.net/ubuntu/+source/apt/+bug/1332440 +fixMaxOpenFiles() { + fixMaxOpenFiles_cur=$(ulimit -n 2>/dev/null || echo 0) + if test "$fixMaxOpenFiles_cur" -gt 10000; then + ulimit -n 10000 + fi +} + # Get the directory containing the compiled PHP extensions # # Output: @@ -2242,6 +2251,11 @@ mkdir -p /tmp/pickle.tmp IPE_ERRFLAG_FILE="$(mktemp -p /tmp/src)" CONFIGURE_FILE=/tmp/configure-options setDistro +case "$DISTRO_VERSION" in + debian@8) + fixMaxOpenFiles || true + ;; +esac setPHPVersionVariables setPHPPreinstalledModules case "$PHP_MAJMIN_VERSION" in