aboutsummaryrefslogtreecommitdiff
path: root/webui.sh
diff options
context:
space:
mode:
authorkernelmethod <17100608+kernelmethod@users.noreply.github.com>2023-05-25 14:51:47 -0400
committerkernelmethod <17100608+kernelmethod@users.noreply.github.com>2023-05-25 14:51:47 -0400
commitd29fe44e467c6ecc435f561a776ead8f5116f077 (patch)
tree722660cef67ad47db78b992c3afd807970ce1d54 /webui.sh
parent89f9faa63388756314e8a1d96cf86bf5e0663045 (diff)
Small fixes to prepare_tcmalloc for Debian/Ubuntu compatibility
- /usr/sbin (where ldconfig is usually located) is not typically on users' PATHs by default, so we set that variable before trying to run ldconfig. - The libtcmalloc library is called libtcmalloc_minimal on Debian/Ubuntu systems. We now check whether libtcmalloc_minimal exists when running prepare_tcmalloc.
Diffstat (limited to 'webui.sh')
-rwxr-xr-xwebui.sh2
1 files changed, 1 insertions, 1 deletions
diff --git a/webui.sh b/webui.sh
index 19cf2f78..7f26d6bf 100755
--- a/webui.sh
+++ b/webui.sh
@@ -183,7 +183,7 @@ fi
# Try using TCMalloc on Linux
prepare_tcmalloc() {
if [[ "${OSTYPE}" == "linux"* ]] && [[ -z "${NO_TCMALLOC}" ]] && [[ -z "${LD_PRELOAD}" ]]; then
- TCMALLOC="$(ldconfig -p | grep -Po "libtcmalloc.so.\d" | head -n 1)"
+ TCMALLOC="$(PATH=/usr/sbin:$PATH ldconfig -p | grep -Po "libtcmalloc(_minimal|)\.so\.\d" | head -n 1)"
if [[ ! -z "${TCMALLOC}" ]]; then
echo "Using TCMalloc: ${TCMALLOC}"
export LD_PRELOAD="${TCMALLOC}"