summaryrefslogtreecommitdiff
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-29 16:32:41 -0400
commit133c8ccd7922518785f4086eb172c23dcdb24d82 (patch)
tree2d3f14adacc304b20d892a82b4153ac600d09d42
parentbca02ccf20c3165fe13e8cf19bb4cff2872f7590 (diff)
downloadmongo-133c8ccd7922518785f4086eb172c23dcdb24d82.tar.gz
SERVER-12048 Don't start mongod if pidfile exists
-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
#