25 lines
603 B
Plaintext
25 lines
603 B
Plaintext
# vim: set ft=upstart ts=4 et:
|
|
description "MongoDB"
|
|
|
|
start on runlevel [2345]
|
|
stop on runlevel [!2345]
|
|
|
|
limit nofile 64000 64000
|
|
|
|
kill timeout 300 # wait 300s between SIGTERM and SIGKILL.
|
|
|
|
pre-start script
|
|
[ -e /run/mongodb ] || install -m 755 -o mongodb -g mongodb -d /run/mongodb
|
|
end script
|
|
|
|
script
|
|
ENABLE_MONGODB="yes"
|
|
if [ -f /etc/default/mongodb ]; then
|
|
. /etc/default/mongodb
|
|
fi
|
|
if [ "x$ENABLE_MONGODB" = "xyes" ]; then
|
|
exec start-stop-daemon --start --quiet --chuid mongodb \
|
|
--exec /usr/bin/mongod -- --config /etc/mongodb.conf
|
|
fi
|
|
end script
|