summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Kreuter <richard@10gen.com>2011-06-23 17:41:14 -0400
committerRichard Kreuter <richard@10gen.com>2011-06-23 17:43:35 -0400
commit3bda11579bb9ac6cef26e6205c204ff6697c2ab6 (patch)
treed228259d5b9d76e074423b5fe1413883236b1249
parent1f9df58e76cd47a19475c7532b114e4ec55af9b5 (diff)
downloadmongo-3bda11579bb9ac6cef26e6205c204ff6697c2ab6.tar.gz
SERVER-3142, part 2 (backport to 1.8)
Kind of a hack, for compatibility w/1.8 (and because I don't have time to test the new --shutdown flag everywhere).
-rw-r--r--rpm/init.d-mongod12
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