Files
trove/integration/scripts/files/elements/ubuntu-xenial-mongodb/install.d/35-check-numa
Pierre Blanc 396619eae8 Fix systemd service mongodb on xenial element
We have several issues on mongodb element for xenial.

This change propose these actions:
  - fix a typo on check-numa script.
  - fix variable issue on the systemd parameter ExecStart.
  - create a dependency and an order between numa-check and mongo service.

Closes-bug: #1743612
Change-Id: I50123dad58b9a368f528d086fa28f6abc86464a6
2018-01-16 12:15:08 -05:00

25 lines
637 B
Bash
Executable File

#!/bin/sh
set -e
set -o xtrace
export DEBIAN_FRONTEND=noninteractive
mkdir -p /usr/share/mongodb
cat > /usr/share/mongodb/check-numa.sh << '_EOF_'
#!/bin/sh
# Handle NUMA access to CPUs (SERVER-3574)
# This verifies the existence of numactl as well as testing that the command works
# Then it generates an environment file for systemd
NUMACTL_ARGS="--interleave=all"
if which numactl >/dev/null 2>/dev/null && numactl $NUMACTL_ARGS ls / >/dev/null 2>/dev/null
then
echo -n NUMACTL="$(which numactl) $NUMACTL_ARGS" > /etc/numactl.env
else
echo -n NUMACTL="" > /etc/numactl.env
fi
_EOF_
chmod 755 /usr/share/mongodb/check-numa.sh