summaryrefslogtreecommitdiff
path: root/debian
diff options
context:
space:
mode:
authorIdan Kamara <idankk86@gmail.com>2013-06-16 20:46:33 +0300
committerErnie Hershey <ernie.hershey@mongodb.com>2014-06-05 10:46:26 -0400
commit849a83f3649a7c3e7f31c0858804dbb354cad298 (patch)
tree44948ed94a08586a28d426f25d4731f51e71b9d3 /debian
parent9ca367e8ef23be3f6e2a51f7d89411d8746fad56 (diff)
downloadmongo-849a83f3649a7c3e7f31c0858804dbb354cad298.tar.gz
SERVER-9985: chown dirs created by upstart's pre-start stanza
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>
Diffstat (limited to 'debian')
-rw-r--r--debian/mongod.upstart11
1 files changed, 9 insertions, 2 deletions
diff --git a/debian/mongod.upstart b/debian/mongod.upstart
index b76746123ca..a2647362357 100644
--- a/debian/mongod.upstart
+++ b/debian/mongod.upstart
@@ -13,8 +13,15 @@ limit nproc 32000 32000
kill timeout 300 # wait 300s between SIGTERM and SIGKILL.
pre-start script
- mkdir -p /var/lib/mongodb/
- mkdir -p /var/log/mongodb/
+ if ! [ -d /var/lib/mongodb/ ]; then
+ mkdir -p /var/lib/mongodb/
+ chown -R mongodb:mongodb /var/lib/mongodb/
+ fi
+
+ if ! [ -d /var/log/mongodb/ ]; then
+ mkdir -p /var/log/mongodb/
+ chown -R mongodb:mongodb /var/log/mongodb/
+ fi
end script
start on runlevel [2345]