diff options
author | Richard Kreuter <richard@10gen.com> | 2011-06-23 17:41:14 -0400 |
---|---|---|
committer | Richard Kreuter <richard@10gen.com> | 2011-06-23 17:41:59 -0400 |
commit | 95a7bcb172c295b9e49c88a6b898f66f75a332c0 (patch) | |
tree | 2d829dd22c38ec16c712efc4adf23e135d3c85e2 /rpm | |
parent | 5449421885df50fdc691ce7d9f91841c3def9853 (diff) | |
download | mongo-95a7bcb172c295b9e49c88a6b898f66f75a332c0.tar.gz |
SERVER-3142, part 1
Kind of a hack, for compatibility w/1.8 (and because I don't have
time to test the new --shutdown flag everywhere).
Diffstat (limited to 'rpm')
-rw-r--r-- | rpm/init.d-mongod | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/rpm/init.d-mongod b/rpm/init.d-mongod index b7d4567fa53..423eed56ba6 100644 --- a/rpm/init.d-mongod +++ b/rpm/init.d-mongod @@ -13,10 +13,16 @@ # things from mongod.conf get there by mongod reading it - -OPTIONS=" -f /etc/mongod.conf" +# NOTE: if you change any OPTIONS here, you get what you pay for: +# this script assumes all options are in the config file. +CONFIGFILE="/etc/mongod.conf" +OPTIONS=" -f $CONFIGFILE" SYSCONFIG="/etc/sysconfig/mongod" +# FIXME: 1.9.x has a --shutdown flag that parses the config file and +# shuts down the correct running pid, but that's unavailable in 1.8 +# for now. This can go away when this script stops supporting 1.8. +DBPATH=`awk -F= '/^dbpath=/{print $2}' "$CONFIGFILE"` mongod=${MONGOD-/usr/bin/mongod} MONGO_USER=mongod @@ -36,7 +42,7 @@ start() stop() { echo -n $"Stopping mongod: " - killproc -p /var/lib/mongo/mongod.lock -t30 -TERM /usr/bin/mongod + killproc -p "$DBPATH"/mongod.lock -t30 -TERM /usr/bin/mongod RETVAL=$? echo [ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/mongod |