summaryrefslogtreecommitdiff
path: root/rpm
diff options
context:
space:
mode:
authorMike Fiedler <miketheman@gmail.com>2012-02-28 12:10:49 -0500
committerMike Fiedler <miketheman@gmail.com>2012-02-28 12:10:49 -0500
commit04de9098bb96c61c083d7a55215e604522ab132d (patch)
tree85a718885a5fe1407c3158fc07ec1a5823810fda /rpm
parent451dccb3ec7801b0929a870f30adaf2f78286922 (diff)
downloadmongo-04de9098bb96c61c083d7a55215e604522ab132d.tar.gz
SERVER-3574 updating init scripts for numa
Diffstat (limited to 'rpm')
-rw-r--r--rpm/init.d-mongod16
1 files changed, 14 insertions, 2 deletions
diff --git a/rpm/init.d-mongod b/rpm/init.d-mongod
index e9a6202ad9c..376f82a33a2 100644
--- a/rpm/init.d-mongod
+++ b/rpm/init.d-mongod
@@ -29,12 +29,24 @@ mongod=${MONGOD-/usr/bin/mongod}
MONGO_USER=mongod
MONGO_GROUP=mongod
-. "$SYSCONFIG" || true
+if [ -f "$SYSCONFIG" ]; then
+ . "$SYSCONFIG"
+fi
+
+# Handle NUMA access to CPUs (SERVER-3574)
+# This verifies the existence of numactl as well as testing that the command works
+NUMACTL_ARGS="--interleave=all"
+if which numactl >/dev/null 2>/dev/null && numactl $NUMACTL_ARGS ls / >/dev/null 2>/dev/null
+then
+ NUMACTL="numactl $NUMACTL_ARGS"
+else
+ NUMACTL=""
+fi
start()
{
echo -n $"Starting mongod: "
- daemon --user "$MONGO_USER" $mongod $OPTIONS
+ daemon --user "$MONGO_USER" $NUMACTL $mongod $OPTIONS
RETVAL=$?
echo
[ $RETVAL -eq 0 ] && touch /var/lock/subsys/mongod