summaryrefslogtreecommitdiff
path: root/debian
diff options
context:
space:
mode:
authorErnie Hershey <ernie.hershey@10gen.com>2014-03-07 22:04:14 -0500
committerErnie Hershey <ernie.hershey@10gen.com>2014-03-10 14:14:40 -0400
commit1beb3d92996d658e5612aec1b68fbcbe7e7ac4a9 (patch)
tree6c7c66bed18612f533fcf088fa883e9927c7876a /debian
parent2a161f7e565bc8706bb311f4d68a1783f3d7141e (diff)
downloadmongo-1beb3d92996d658e5612aec1b68fbcbe7e7ac4a9.tar.gz
SERVER-7268 Add numactl to upstart script
This is almost identical to the numactl logic in our Debian init script and similar to the logic in the RPM init script.
Diffstat (limited to 'debian')
-rw-r--r--debian/mongod.upstart22
1 files changed, 21 insertions, 1 deletions
diff --git a/debian/mongod.upstart b/debian/mongod.upstart
index ebfa006ad8b..b76746123ca 100644
--- a/debian/mongod.upstart
+++ b/debian/mongod.upstart
@@ -22,6 +22,26 @@ stop on runlevel [06]
script
ENABLE_MONGOD="yes"
+ CONF=/etc/mongod.conf
+ DAEMON=/usr/bin/mongod
+ DAEMONUSER=${DAEMONUSER:-mongodb}
+
if [ -f /etc/default/mongod ]; then . /etc/default/mongod; fi
- if [ "x$ENABLE_MONGOD" = "xyes" ]; then exec start-stop-daemon --start --quiet --chuid mongodb --exec /usr/bin/mongod -- --config /etc/mongod.conf; 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="$(which numactl) -- $NUMACTL_ARGS"
+ DAEMON_OPTS=${DAEMON_OPTS:-"--config $CONF"}
+ else
+ NUMACTL=""
+ DAEMON_OPTS="-- "${DAEMON_OPTS:-"--config $CONF"}
+ fi
+
+ if [ "x$ENABLE_MONGOD" = "xyes" ]
+ then
+ exec start-stop-daemon --start --chuid $DAEMONUSER --exec $NUMACTL $DAEMON $DAEMON_OPTS
+ fi
end script