The default upstart config installed with MongoDB doesn't provide the
`--pidfile` or `--make-pidfile` options to `start-stop-daemon`, which
means it determines whether or not MongoDB is running by inspecting the
process table to see if there are any instances of "mongod" running.
This is a pretty crude mechanism, and we can make it substantially more
reliable (not susceptible to mongod instances running inside LXC
containers or similar) by simply getting start-stop-daemon to write a
pidfile.
Usually these are created by the the post-install script that runs after installing the package, but if those were rm'ed later on and then created by this script, their permission would be most likely set to root, causing mongod to fail starting.
Signed-off-by: Ernie Hershey <ernie.hershey@mongodb.com>