Files
trove/integration/scripts/files/elements/ubuntu-xenial-mongodb/install.d/41-mongod-systemd
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

32 lines
663 B
Bash
Executable File

#!/bin/sh
set -e
set -o xtrace
cat > /lib/systemd/system/mongod.service << '_EOF_'
[Unit]
Description=High-performance, schema-free document-oriented database
After=network.target check-numa.service
Wants=check-numa.service
Documentation=https://docs.mongodb.org/manual
[Service]
User=mongodb
Group=mongodb
RuntimeDirectory=mongodb
EnvironmentFile=/etc/numactl.env
ExecStart=/bin/bash -c "${NUMACTL} /usr/bin/mongod --quiet --config /etc/mongod.conf"
LimitFSIZE=infinity
LimitCPU=infinity
LimitAS=infinity
LimitNOFILE=64000
LimitRSS=infinity
LimitNPROC=64000
[Install]
WantedBy=multi-user.target
_EOF_
systemctl daemon-reload
systemctl enable mongod.service