I am on Ubuntu 14.04.1 LTS.
$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 14.04.1 LTS
Release: 14.04
Codename: trusty
Instead of using the system provided MongoDB which is 2.4, I want to use 2.6 so I downloaded MongoDB executable and just put it in the places I wanted. Then I mostly copied the upstart script comes with the 2.4 package:
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
mkdir -p /data/db/
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/local/bin/mongod -- --config /etc/mongodb.conf
fi
end script
When I run manually like so:
sudo /usr/local/bin/mongod --config /etc/mongodb.conf
It runs just fine.
But when I use sudo start mongodb
the process probably dies out as I was not able to see it in ps -ef
. The upstart log doesn't say much (/var/log/upstart/mongodb.log):
warning: bind_ip of 0.0.0.0 is unnecessary; listens on all ips by default
What may be the problem?