summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--debian/mongod.upstart5
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