Add MongoDB mongos upstart script to elements
The custom upstart script should be a part of the elements, as it is OS specific. This requires 2 parts - add the code to the elements (here), and remove the code from trove (follow-up). Partial-Bug: 1493515 Change-Id: I0ae98f173058cae6b9e0eee440318f0277972503
This commit is contained in:
@@ -35,3 +35,31 @@ apt-get install -y mongodb-org
|
||||
sed -i '/bindIp/d' /etc/mongod.conf
|
||||
# need to use smallFiles until the device is mounted
|
||||
sed -i 's/# mmapv1:/ mmapv1:\n smallFiles: true/' /etc/mongod.conf
|
||||
|
||||
cat > "/etc/init/mongos.conf" << '_EOF_'
|
||||
limit fsize unlimited unlimited # (file size)
|
||||
limit cpu unlimited unlimited # (cpu time)
|
||||
limit as unlimited unlimited # (virtual memory size)
|
||||
limit nofile 64000 64000 # (open files)
|
||||
limit nproc 64000 64000 # (processes/threads)
|
||||
|
||||
pre-start script
|
||||
mkdir -p /var/log/mongodb/
|
||||
end script
|
||||
|
||||
start on runlevel [2345]
|
||||
stop on runlevel [06]
|
||||
|
||||
script
|
||||
ENABLE_MONGOS="yes"
|
||||
if [ -f /etc/default/mongos ]
|
||||
then
|
||||
. /etc/default/mongos
|
||||
fi
|
||||
if [ "x$ENABLE_MONGOS" = "xyes" ]
|
||||
then
|
||||
exec start-stop-daemon --start --quiet --chuid mongodb \
|
||||
--exec /usr/bin/mongos -- --config /etc/mongod.conf
|
||||
fi
|
||||
end script
|
||||
_EOF_
|
||||
|
||||
Reference in New Issue
Block a user