Advertisement
pveselov

/etc/init/mongoa.conf

Mar 28th, 2015
404
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.68 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/mongoa.pid
  18. chown $DAEMONUSER /var/run/mongoa.pid
  19. if ! test -d /var/db/mongoa; then
  20. mkdir -p /var/db/mongoa
  21. chown $DAEMONUSER /var/db/mongoa
  22. fi
  23. if ! test -d /var/log/mongo; then
  24. mkdir -p /var/log/mongo
  25. chown $DAEMONUSER /var/log/mongo
  26. fi
  27. end script
  28.  
  29. start on runlevel [2345]
  30. stop on runlevel [06]
  31.  
  32. script
  33. ENABLE_MONGOD="yes"
  34. CONF=/etc/mongoa.conf
  35. DAEMON=/usr/bin/mongod
  36. DAEMONUSER=${DAEMONUSER:-mongodb}
  37.  
  38. if [ -f /etc/default/mongod ]; then . /etc/default/mongod; fi
  39.  
  40. # Handle NUMA access to CPUs (SERVER-3574)
  41. # This verifies the existence of numactl as well as testing that the command works
  42. NUMACTL_ARGS="--interleave=all"
  43. if which numactl >/dev/null 2>/dev/null && numactl $NUMACTL_ARGS ls / >/dev/null 2>/dev/null
  44. then
  45. NUMACTL="$(which numactl) -- $NUMACTL_ARGS"
  46. DAEMON_OPTS=${DAEMON_OPTS:-"--config $CONF"}
  47. else
  48. NUMACTL=""
  49. DAEMON_OPTS="-- "${DAEMON_OPTS:-"--config $CONF"}
  50. fi
  51.  
  52. if [ "x$ENABLE_MONGOD" = "xyes" ]
  53. then
  54. exec start-stop-daemon --start \
  55. --chuid $DAEMONUSER \
  56. --pidfile /var/run/mongoa.pid \
  57. --make-pidfile \
  58. --exec $NUMACTL $DAEMON $DAEMON_OPTS
  59. fi
  60. end script
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement