diff options
author | Nick Stenning <nick@whiteink.com> | 2013-07-11 18:30:54 +0100 |
---|---|---|
committer | Benety Goh <benety@mongodb.com> | 2014-06-30 11:46:37 -0400 |
commit | 5d4b3fe40cfe91857850d89a7a99a07d41b1d48d (patch) | |
tree | c71885bcfd78fdca6814c24adaa4543387a634bc /debian | |
parent | 4350bfad7cea746d081190063a6f5a2b00531132 (diff) | |
download | mongo-5d4b3fe40cfe91857850d89a7a99a07d41b1d48d.tar.gz |
SERVER-10190 Upstart conf: use pidfile, not 'ps'
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.
Diffstat (limited to 'debian')
-rw-r--r-- | debian/mongod.upstart | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/debian/mongod.upstart b/debian/mongod.upstart index 08b425f4dfa..bc3bd2b87a4 100644 --- a/debian/mongod.upstart +++ b/debian/mongod.upstart @@ -13,12 +13,15 @@ limit nproc 32000 32000 kill timeout 300 # wait 300s between SIGTERM and SIGKILL. pre-start script + DAEMONUSER=${DAEMONUSER:-mongodb} if [ ! -d /var/lib/mongod ]; then mkdir -p /var/lib/mongodb && chown mongodb:mongodb /var/lib/mongodb fi if [ ! -d /var/log/mongod ]; then mkdir -p /var/log/mongodb && chown mongodb:mongodb /var/log/mongodb fi + touch /var/run/mongodb.pid + chown $DAEMONUSER /var/run/mongodb.pid end script start on runlevel [2345] @@ -48,6 +51,8 @@ script then exec start-stop-daemon --start \ --chuid $DAEMONUSER \ + --pidfile /var/run/mongodb.pid \ + --make-pidfile \ --exec $NUMACTL $DAEMON $DAEMON_OPTS fi end script |