summaryrefslogtreecommitdiff
path: root/debian
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 /debian
parent451dccb3ec7801b0929a870f30adaf2f78286922 (diff)
downloadmongo-04de9098bb96c61c083d7a55215e604522ab132d.tar.gz
SERVER-3574 updating init scripts for numa
Diffstat (limited to 'debian')
-rw-r--r--debian/init.d12
1 files changed, 11 insertions, 1 deletions
diff --git a/debian/init.d b/debian/init.d
index 59e94ae51d6..f2cfb7d08ac 100644
--- a/debian/init.d
+++ b/debian/init.d
@@ -64,6 +64,16 @@ if [ -f /etc/default/$NAME ] ; then
. /etc/default/$NAME
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
+
if test ! -x $DAEMON; then
echo "Could not find $DAEMON"
exit 0
@@ -119,7 +129,7 @@ start_server() {
# Start the process using the wrapper
start-stop-daemon --background --start --quiet --pidfile $PIDFILE \
--make-pidfile --chuid $DAEMONUSER \
- --exec $DAEMON -- $DAEMON_OPTS
+ --exec $NUMACTL $DAEMON -- $DAEMON_OPTS
errcode=$?
return $errcode
}