From 3bda11579bb9ac6cef26e6205c204ff6697c2ab6 Mon Sep 17 00:00:00 2001 From: Richard Kreuter Date: Thu, 23 Jun 2011 17:41:14 -0400 Subject: 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). --- rpm/init.d-mongod | 12 +++++++++--- 1 file 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 -- cgit v1.2.1