summaryrefslogtreecommitdiff
path: root/rpm
diff options
context:
space:
mode:
authorBrian Samek <brian.samek@mongodb.com>2016-08-24 16:27:27 -0400
committerBrian Samek <brian.samek@mongodb.com>2016-08-25 13:28:50 -0400
commit3eaf36bc9fb28f9ca63b0d7de33e9f587aa88325 (patch)
treeb92041d2f2fb55d8ff2ebf1538897be542b44309 /rpm
parent1101287cc7789e9b8b52ba370cee55678aa6c58d (diff)
downloadmongo-3eaf36bc9fb28f9ca63b0d7de33e9f587aa88325.tar.gz
SERVER-12048 Don't start mongod if pidfile exists
Diffstat (limited to 'rpm')
-rwxr-xr-xrpm/init.d-mongod7
1 files changed, 7 insertions, 0 deletions
diff --git a/rpm/init.d-mongod b/rpm/init.d-mongod
index 0c18ac70800..18b0d88df0d 100755
--- a/rpm/init.d-mongod
+++ b/rpm/init.d-mongod
@@ -48,6 +48,13 @@ start()
install -d -m 0755 -o $MONGO_USER -g $MONGO_GROUP $PIDDIR
fi
+ # Make sure the pidfile does not exist
+ if [ -f $PIDFILEPATH ]; then
+ echo "Error starting mongod. $PIDFILEPATH exists."
+ RETVAL=1
+ return
+ fi
+
# Recommended ulimit values for mongod or mongos
# See http://docs.mongodb.org/manual/reference/ulimit/#recommended-settings
#