Well, I made some interesting, if not completely helpful,
observations while looking deeper into this. If I were beginning to
look into this problem, I'd want the slight advantage of knowing
what I'm writing here. Thanks to Sam Pointer and others, including in the MongoDB forum, for help in circling the wagons. 1. Following Upstart's instructions to the letter, I discovered that MongoDB (mongod) forks (or clones) itself 63 times starting up. --I don't really believe that, I'm skeptical of the documentation's exact procedure, but that's what its advice using strace and a regular _expression_ led to. I spent time in the trace itself and, while I'm an old guy with 2+ decades in C and Unix internals and recognized all the system calls made, I don't actually grok the cloning going on that pushes the count so high.2. Feeling pretty bummed, but nimble-fingered, I experimented with all the possible permutations of expect forkplus none of these at all (what MongoDB ships with). No permutation worked. Some left a state of claiming that the service was running when ps -ef | grep [m]ongo proved that it was not. No permutation left my VM with a running mongod daemon, even after reboot, something that the edelight cookbook succeeds at (read on). 3. Conducting a survey of all the MongoDB cookbooks I could find public, I observed that edelight's (the one I originally followed to begin learning Chef) uses what MongoDB ships with and its single.rb recipe succeeds in getting mongod launched and working, something I had already observed a couple of months ago, but Upstart is non-plussed and behaves exactly as I have complained. This said, when rebooted, such a node gets over the problem and Upstart begins to accept the installation as legitimate from then on. --a possible direction to pursue here would be to cannibalize edelight's cookbook to see if I can't make it do all the things my own does so well.4. I observe that the other public MongoDB cookbooks I found do not use Upstart (init.d instead). I presume because they are trying to support non-Upstart platforms and so choose not to use Upstart on Ubuntu. I thought to investigate walking that path which strikes me as more promising even though I'm not interested in any platform except Ubuntu. Nevertheless, ... 5. On the way to #4, I stumbled upon a hack which works very well, as well as #3. I don't like it much because I don't think Upstart scripts were meant to be written so, but it solves the problem in my exact environment, Ubuntu 12.04 (LTS). Here is what my script looks like for starting a mongod (or mongos). What tricks out Upstart is the pre-start which apparently doesn't count. description "Keeps MongoDB running between boots" On 10/3/2013 5:10 PM, Sam Pointer
wrote:
" type="cite"> |
Archive powered by MHonArc 2.6.16.