Advertisement
pveselov

/etc/init/mongod.conf

Mar 27th, 2015
384
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.47 KB | None | 0 0
  1. # Ubuntu upstart file at /etc/init/mongod.conf
  2.  
  3. # Recommended ulimit values for mongod or mongos
  4. # See http://docs.mongodb.org/manual/reference/ulimit/#recommended-settings
  5. #
  6. limit fsize unlimited unlimited
  7. limit cpu unlimited unlimited
  8. limit as unlimited unlimited
  9. limit nofile 64000 64000
  10. limit rss unlimited unlimited
  11. limit nproc 32000 32000
  12.  
  13. kill timeout 300 # wait 300s between SIGTERM and SIGKILL.
  14.  
  15. pre-start script
  16. DAEMONUSER=${DAEMONUSER:-mongodb}
  17. touch /var/run/mongodb.pid
  18. chown $DAEMONUSER /var/run/mongodb.pid
  19. end script
  20.  
  21. start on runlevel [2345]
  22. stop on runlevel [06]
  23.  
  24. script
  25. ENABLE_MONGOD="yes"
  26. CONF=/etc/mongod.conf
  27. DAEMON=/usr/bin/mongod
  28. DAEMONUSER=${DAEMONUSER:-mongodb}
  29.  
  30. if [ -f /etc/default/mongod ]; then . /etc/default/mongod; fi
  31.  
  32. # Handle NUMA access to CPUs (SERVER-3574)
  33. # This verifies the existence of numactl as well as testing that the command works
  34. NUMACTL_ARGS="--interleave=all"
  35. if which numactl >/dev/null 2>/dev/null && numactl $NUMACTL_ARGS ls / >/dev/null 2>/dev/null
  36. then
  37. NUMACTL="$(which numactl) -- $NUMACTL_ARGS"
  38. DAEMON_OPTS=${DAEMON_OPTS:-"--config $CONF"}
  39. else
  40. NUMACTL=""
  41. DAEMON_OPTS="-- "${DAEMON_OPTS:-"--config $CONF"}
  42. fi
  43.  
  44. if [ "x$ENABLE_MONGOD" = "xyes" ]
  45. then
  46. exec start-stop-daemon --start \
  47. --chuid $DAEMONUSER \
  48. --pidfile /var/run/mongodb.pid \
  49. --make-pidfile \
  50. --exec $NUMACTL $DAEMON $DAEMON_OPTS
  51. fi
  52. end script
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement