summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorErnie Hershey <ernie.hershey@10gen.com>2015-08-18 15:33:09 -0400
committerRamon Fernandez <ramon.fernandez@mongodb.com>2015-09-23 18:03:18 -0400
commit96f2d47ca3eff2f945f8f07faf14b323db319206 (patch)
treec3140ee4429a02591baee4eef9fc1038762cf84f
parent02a20a97251bb12a644fe1272c2cde345c2f5588 (diff)
downloadmongo-96f2d47ca3eff2f945f8f07faf14b323db319206.tar.gz
SERVER-18581 Start process with group=mongodb in .deb packages
(cherry picked from commit add69c51cf4469ec44db4bae7d21c25da23adbe2)
-rw-r--r--debian/init.d3
-rw-r--r--debian/mongod.upstart3
2 files changed, 4 insertions, 2 deletions
diff --git a/debian/init.d b/debian/init.d
index bc2aacd3caa..8d6b2c26160 100644
--- a/debian/init.d
+++ b/debian/init.d
@@ -93,6 +93,7 @@ DIETIME=10 # Time to wait for the server to die, in seconds
# 'restart' will not work
DAEMONUSER=${DAEMONUSER:-mongodb}
+DAEMONGROUP=${DAEMONGROUP:-mongodb}
set -e
@@ -140,7 +141,7 @@ start_server() {
# Start the process using the wrapper
start-stop-daemon --background --start --quiet --pidfile $PIDFILE \
- --make-pidfile --chuid $DAEMONUSER \
+ --make-pidfile --chuid $DAEMONUSER:$DAEMONGROUP \
--exec $NUMACTL $DAEMON $DAEMON_OPTS
errcode=$?
return $errcode
diff --git a/debian/mongod.upstart b/debian/mongod.upstart
index 286801a725d..3a334c0f8ec 100644
--- a/debian/mongod.upstart
+++ b/debian/mongod.upstart
@@ -32,6 +32,7 @@ script
CONF=/etc/mongod.conf
DAEMON=/usr/bin/mongod
DAEMONUSER=${DAEMONUSER:-mongodb}
+ DAEMONGROUP=${DAEMONGROUP:-mongodb}
if [ -f /etc/default/mongod ]; then . /etc/default/mongod; fi
@@ -50,7 +51,7 @@ script
if [ "x$ENABLE_MONGOD" = "xyes" ]
then
exec start-stop-daemon --start \
- --chuid $DAEMONUSER \
+ --chuid $DAEMONUSER:$DAEMONGROUP \
--pidfile /var/run/mongodb.pid \
--make-pidfile \
--exec $NUMACTL $DAEMON $DAEMON_OPTS