Skip to content

Commit

Permalink
SERVER-3574 updating init scripts for numa
Browse files Browse the repository at this point in the history
  • Loading branch information
miketheman committed Feb 28, 2012
1 parent 451dccb commit 04de909
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 3 deletions.
12 changes: 11 additions & 1 deletion debian/init.d
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -64,6 +64,16 @@ if [ -f /etc/default/$NAME ] ; then
. /etc/default/$NAME . /etc/default/$NAME
fi 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 if test ! -x $DAEMON; then
echo "Could not find $DAEMON" echo "Could not find $DAEMON"
exit 0 exit 0
Expand Down Expand Up @@ -119,7 +129,7 @@ start_server() {
# Start the process using the wrapper # Start the process using the wrapper
start-stop-daemon --background --start --quiet --pidfile $PIDFILE \ start-stop-daemon --background --start --quiet --pidfile $PIDFILE \
--make-pidfile --chuid $DAEMONUSER \ --make-pidfile --chuid $DAEMONUSER \
--exec $DAEMON -- $DAEMON_OPTS --exec $NUMACTL $DAEMON -- $DAEMON_OPTS
errcode=$? errcode=$?
return $errcode return $errcode
} }
Expand Down
16 changes: 14 additions & 2 deletions rpm/init.d-mongod
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -29,12 +29,24 @@ mongod=${MONGOD-/usr/bin/mongod}
MONGO_USER=mongod MONGO_USER=mongod
MONGO_GROUP=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() start()
{ {
echo -n $"Starting mongod: " echo -n $"Starting mongod: "
daemon --user "$MONGO_USER" $mongod $OPTIONS daemon --user "$MONGO_USER" $NUMACTL $mongod $OPTIONS
RETVAL=$? RETVAL=$?
echo echo
[ $RETVAL -eq 0 ] && touch /var/lock/subsys/mongod [ $RETVAL -eq 0 ] && touch /var/lock/subsys/mongod
Expand Down

0 comments on commit 04de909

Please sign in to comment.