From 14c45740a89aaea67900d3d7975c3806911d4dea Mon Sep 17 00:00:00 2001 From: "CanbiZ (MickLesk)" <47820557+MickLesk@users.noreply.github.com> Date: Thu, 16 Jul 2026 11:40:52 +0200 Subject: [PATCH] MongoDB: Implement kernel version check and patch --- misc/tools.func | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/misc/tools.func b/misc/tools.func index 82f87ffea..c80a879d8 100644 --- a/misc/tools.func +++ b/misc/tools.func @@ -7431,6 +7431,18 @@ setup_mongodb() { mkdir -p /var/lib/mongodb chown -R mongodb:mongodb /var/lib/mongodb + local KERNEL_VERSION MONGO_MAJOR + KERNEL_VERSION=$(uname -r | cut -d- -f1) + MONGO_MAJOR="${MONGO_VERSION%%.*}" + if ((MONGO_MAJOR >= 8)) && [[ "$(printf '%s\n' "6.19" "$KERNEL_VERSION" | sort -V | head -n1)" == "6.19" ]]; then + mkdir -p /etc/systemd/system/mongod.service.d + cat </etc/systemd/system/mongod.service.d/rseq.conf +[Service] +Environment=GLIBC_TUNABLES=glibc.pthread.rseq=1 +EOF + systemctl daemon-reload + fi + $STD systemctl enable mongod || { msg_warn "Failed to enable mongod service" }