summaryrefslogtreecommitdiff
path: root/rpm
diff options
context:
space:
mode:
authorJiri Tyr <jiri.tyr@gmail.com>2015-01-01 23:00:34 +0000
committerBenety Goh <benety@mongodb.com>2015-01-05 11:09:52 -0500
commitf96a473723e8a478f7c3c1adf991ef795e9acebc (patch)
treeb75644fb9451400b3c53c8f8363b4f6988b6c25d /rpm
parent20fa913b96326608f80cbd135f26c7c7e3487bb3 (diff)
downloadmongo-f96a473723e8a478f7c3c1adf991ef795e9acebc.tar.gz
Prevent init.d script to fail when pidfilepath isn't configured
This change moves the PIDFILEPATH definition behind the sourcing of the sysconfig file to prevent the init.d script to fail when there is no pidfilepath defined in the config file. It is still possible to define it in the sysconfig file. Closes #895 Signed-off-by: Benety Goh <benety@mongodb.com>
Diffstat (limited to 'rpm')
-rwxr-xr-xrpm/init.d-mongod3
1 files changed, 2 insertions, 1 deletions
diff --git a/rpm/init.d-mongod b/rpm/init.d-mongod
index 342a83d67a6..a6257933b46 100755
--- a/rpm/init.d-mongod
+++ b/rpm/init.d-mongod
@@ -21,7 +21,6 @@ SYSCONFIG="/etc/sysconfig/mongod"
DBPATH=`awk -F'[:=]' -v IGNORECASE=1 '/^[[:blank:]]*dbpath[[:blank:]]*[:=][[:blank:]]*/{print $2}' "$CONFIGFILE" | tr -d '[:blank:]'`
PIDFILEPATH=`awk -F'[:=]' -v IGNORECASE=1 '/^[[:blank:]]*pidfilepath[[:blank:]]*[:=][[:blank:]]*/{print $2}' "$CONFIGFILE" | tr -d '[:blank:]'`
-PIDDIR=`dirname $PIDFILEPATH`
mongod=${MONGOD-/usr/bin/mongod}
@@ -32,6 +31,8 @@ if [ -f "$SYSCONFIG" ]; then
. "$SYSCONFIG"
fi
+PIDDIR=`dirname $PIDFILEPATH`
+
# Handle NUMA access to CPUs (SERVER-3574)
# This verifies the existence of numactl as well as testing that the command works
NUMACTL_ARGS="--interleave=all"