summaryrefslogtreecommitdiff
path: root/rpm/init.d-mongod
diff options
context:
space:
mode:
Diffstat (limited to 'rpm/init.d-mongod')
-rwxr-xr-xrpm/init.d-mongod9
1 files changed, 5 insertions, 4 deletions
diff --git a/rpm/init.d-mongod b/rpm/init.d-mongod
index ffbd3005b86..6368964dd99 100755
--- a/rpm/init.d-mongod
+++ b/rpm/init.d-mongod
@@ -9,13 +9,10 @@
. /etc/rc.d/init.d/functions
-PIDFILEPATH="/var/run/mongodb/mongod.pid"
-PIDDIR=`dirname $PIDFILEPATH`
-
# NOTE: if you change any OPTIONS here, you get what you pay for:
# this script assumes all options are in the config file.
CONFIGFILE="/etc/mongod.conf"
-OPTIONS=" -f $CONFIGFILE --fork --pidfilepath $PIDFILEPATH"
+OPTIONS=" -f $CONFIGFILE"
mongod=${MONGOD-/usr/bin/mongod}
@@ -40,6 +37,10 @@ else
NUMACTL=""
fi
+# things from mongod.conf get there by mongod reading it
+PIDFILEPATH="`awk -F'[:=]' -v IGNORECASE=1 '/^[[:blank:]]*(processManagement\.)?pidfilepath[[:blank:]]*[:=][[:blank:]]*/{print $2}' \"$CONFIGFILE\" | tr -d \"[:blank:]\\"'\" | awk -F'#' '{print $1}'`"
+PIDDIR=`dirname $PIDFILEPATH`
+
start()
{
# Make sure the default pidfile directory exists