Skip to content

Instantly share code, notes, and snippets.

@fsouza
Created January 16, 2013 17:52
Show Gist options
  • Select an option

  • Save fsouza/4549193 to your computer and use it in GitHub Desktop.

Select an option

Save fsouza/4549193 to your computer and use it in GitHub Desktop.
limit nofile 20000 20000
kill timeout 300 # wait 300s between SIGTERM and SIGKILL.
pre-start script
mkdir -p /var/lib/mongodb/
mkdir -p /var/log/mongodb/
end script
start on runlevel [2345]
stop on runlevel [06]
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment