[This is a resend because it looks like it never made it to the mail list. I apologize if this is a double post.]
I have this MongoDB recipe that's working pretty well, but suffers from a problem that I've not been able to solve. The basic question is why does upstart stuff not work at the end of the recipe nor when the node(s) is(are) rebooted?
My use of upstart mechanisms is identical to what comes out of the MongoDB package and to other MongoDB community recipes. Or so I think.
First, particulars: Ubuntu 12.04 (LTS) everywhere, Chef server and clients (11.x).
The Chef recipe appears to work and finish perfectly, but upstart won't start the service. What I'm seeing is:
Is #4 something to do with pid?
- upstart service says MongoDB daemon not launched (mongodb stop/waiting)
- performing service mongodb start by hand does not start it (mongodb stop/waiting)
- executing the start-stop-daemon by hand just as in /etc/init/mongodb.conf will launch the daemon
- once launched, upstart doesn't see it as the service is running (mongodb stop/waiting)
- processor status (ps) shows the daemon is running
I hope someone sees what I've done wrong here. I very much appreciate the help.
Russ
Console scrape illustrating the list above, from end of Chef run:
.
.
.
[2013-10-03T18:33:59+00:00] INFO: template[/data/mongodb/mongodb.conf] sending restart action to service[mongodb] (immediate)
* service[mongodb] action restart[2013-10-03T18:33:59+00:00] INFO: Processing service[mongodb] action restart (mongodb::replica line 23)
[2013-10-03T18:33:59+00:00] INFO: service[mongodb] restarted
- restart service service[mongodb]
* service[mongodb] action enable[2013-10-03T18:33:59+00:00] INFO: Processing service[mongodb] action enable (mongodb::replica line 42)
(up to date)
* service[mongodb] action start[2013-10-03T18:33:59+00:00] INFO: Processing service[mongodb] action start (mongodb::replica line 42)
[2013-10-03T18:33:59+00:00] INFO: service[mongodb] started
- start service service[mongodb]
[2013-10-03T18:33:59+00:00] INFO: Chef Run complete in 5.902176274 seconds
[2013-10-03T18:33:59+00:00] INFO: Running report handlers
[2013-10-03T18:33:59+00:00] INFO: Report handlers complete
Chef Client finished, 7 resources updated
:~# service mongodb status
mongodb stop/waiting
:~# service mongodb start
mongodb stop/waiting
:~# cat /etc/init/mongodb.conf
description "Keeps MongoDB running between boots"
limit nofile 20000 20000
kill timeout 300 # wait 300s between SIGTERM and SIGKILL.
start on runlevel [2345]
stop on runlevel [06]
expect fork
script
ENABLE_MONGODB="yes"
PIDFILE=/var/run/mongodb.pid
if [ -f /etc/default/mongodb ]; then . /etc/default/mongodb; fi
if [ "x$ENABLE_MONGODB" = "xyes" ]; then
exec start-stop-daemon --start --quiet --chuid mongodb -m --pidfile $PIDFILE \
--exec /usr/bin/mongod -- --config /data/mongodb/mongodb.conf
fi
end script
:~# PIDFILE=/var/run/mongodb.pid
:~# exec start-stop-daemon --start --chuid mongodb -m --pidfile $PIDFILE --exec /usr/bin/mongod -- --config /data/mongodb/mongodb.conf
about to fork child process, waiting until server is ready for connections.
forked process: 3969
all output going to: /data/mongodb/mongodb.log
child process started successfully, parent exiting
:~$ service mongodb status
mongodb stop/waiting
:~$ ps -ef | grep [m]ongo
mongodb 3969 1 0 18:35 ? 00:00:00 /usr/bin/mongod --config /data/mongodb/mongodb.conf
Archive powered by MHonArc 2.6.16.