diff options
author | Brian Samek <brian.samek@mongodb.com> | 2016-08-24 16:27:27 -0400 |
---|---|---|
committer | Brian Samek <brian.samek@mongodb.com> | 2016-08-29 16:35:31 -0400 |
commit | 4f52ad46435d9f3776e0d37dca26cec1b9fc9ab8 (patch) | |
tree | 571d465c374b825945e0e5646b8bdeea828d2a45 | |
parent | b0c2895902d50a86d7bf0bbfd633f765bde7ebf0 (diff) | |
download | mongo-4f52ad46435d9f3776e0d37dca26cec1b9fc9ab8.tar.gz |
SERVER-12048 Don't start mongod if pidfile exists
-rwxr-xr-x | rpm/init.d-mongod | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/rpm/init.d-mongod b/rpm/init.d-mongod index 76a19cebdac..0f225daee2c 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 # |