This is on Centos.
/etc/init.d/mongodb has this code in it:
# 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"`
PIDFILE=`awk -F= '/^dbpath\s=\s/{print $2}' "$CONFIGFILE"`
mongod=${MONGOD-/usr/bin/mongod}
The problem with that is it is BEFORE this statement:
if [ -f "$SYSCONFIG" ]; then
. "$SYSCONFIG"
fi
So if you've put a location for your CONFIGFILE in SYSCONFIG
(/etc/sysconfig/mongodb), the value for dbpath is still read from
/etc/mongod.conf instead of from the desired location of CONFIGFILE.
-Nigel
/etc/init.d/mongodb has this code in it:
# 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"`
PIDFILE=`awk -F= '/^dbpath\s=\s/{print $2}' "$CONFIGFILE"`
mongod=${MONGOD-/usr/bin/mongod}
The problem with that is it is BEFORE this statement:
if [ -f "$SYSCONFIG" ]; then
. "$SYSCONFIG"
fi
So if you've put a location for your CONFIGFILE in SYSCONFIG
(/etc/sysconfig/mongodb), the value for dbpath is still read from
/etc/mongod.conf instead of from the desired location of CONFIGFILE.
-Nigel