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-25 13:28:50 -0400 |
commit | 3eaf36bc9fb28f9ca63b0d7de33e9f587aa88325 (patch) | |
tree | b92041d2f2fb55d8ff2ebf1538897be542b44309 /rpm | |
parent | 1101287cc7789e9b8b52ba370cee55678aa6c58d (diff) | |
download | mongo-3eaf36bc9fb28f9ca63b0d7de33e9f587aa88325.tar.gz |
SERVER-12048 Don't start mongod if pidfile exists
Diffstat (limited to 'rpm')
-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 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 # |