From e5da7115afeee64fa24b467ab5ed22767bb040b8 Mon Sep 17 00:00:00 2001 From: Ernie Hershey Date: Thu, 5 Jun 2014 10:50:54 -0400 Subject: [PATCH] SERVER-9985 Adjust pre-script mkdir commands in upstart config --- debian/mongod.upstart | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/debian/mongod.upstart b/debian/mongod.upstart index a2647362357..b5004510cf3 100644 --- a/debian/mongod.upstart +++ b/debian/mongod.upstart @@ -13,15 +13,12 @@ limit nproc 32000 32000 kill timeout 300 # wait 300s between SIGTERM and SIGKILL. pre-start script - 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 + 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 end script start on runlevel [2345]