SERVER-20930 SERVER-20404: clarify sysconfig and default config override

This commit is contained in:
Sam Kleinman
2016-01-19 11:51:36 -05:00
parent 8a58e2fb57
commit 985e2a0be9
8 changed files with 70 additions and 61 deletions

6
debian/init.d vendored
View File

@@ -58,7 +58,10 @@ CONF=/etc/mongod.conf
PIDFILE=/var/run/$NAME.pid
ENABLE_MONGOD=yes
# Include mongodb defaults if available
# Include mongodb defaults if available.
# All variables set before this point can be overridden by users, by
# setting them directly in the defaults file. Use this to explicitly
# override these values, at your own risk.
if [ -f /etc/default/$NAME ] ; then
. /etc/default/$NAME
fi
@@ -75,6 +78,7 @@ else
DAEMON_OPTS="-- "${DAEMON_OPTS:-"--config $CONF"}
fi
if test ! -x $DAEMON; then
echo "Could not find $DAEMON"
exit 0

View File

@@ -10,28 +10,24 @@
. /etc/rc.d/init.d/functions
# things from mongod.conf get there by mongod reading it
# 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"
PIDFILEPATH=`awk -F'[:=]' -v IGNORECASE=1 '/^[[:blank:]]*(processManagement\.)?pidfilepath[[:blank:]]*[:=][[:blank:]]*/{print $2}' "$CONFIGFILE" | tr -d "[:blank:]\"'" | awk -F'#' '{print $1}'`
mongod=${MONGOD-/usr/bin/mongod}
MONGO_USER=mongod
MONGO_GROUP=mongod
# All variables set before this point can be overridden by users, by
# setting them directly in the SYSCONFIG file. Use this to explicitly
# override these values, at your own risk.
SYSCONFIG="/etc/sysconfig/mongod"
if [ -f "$SYSCONFIG" ]; then
. "$SYSCONFIG"
fi
PIDDIR=`dirname $PIDFILEPATH`
# Handle NUMA access to CPUs (SERVER-3574)
# This verifies the existence of numactl as well as testing that the command works
NUMACTL_ARGS="--interleave=all"
@@ -42,6 +38,10 @@ else
NUMACTL=""
fi
# things from mongod.conf get there by mongod reading it
PIDFILEPATH=`awk -F'[:=]' -v IGNORECASE=1 '/^[[:blank:]]*(processManagement\.)?pidfilepath[[:blank:]]*[:=][[:blank:]]*/{print $2}' "$CONFIGFILE" | tr -d "[:blank:]\"'" | awk -F'#' '{print $1}'`
PIDDIR=`dirname $PIDFILEPATH`
start()
{
# Make sure the default pidfile directory exists

View File

@@ -16,28 +16,24 @@
. /etc/rc.status
rc_reset
# things from mongod.conf get there by mongod reading it
# 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"
PIDFILEPATH=`awk -F'[:=]' -v IGNORECASE=1 '/^[[:blank:]]*(processManagement\.)?pidfilepath[[:blank:]]*[:=][[:blank:]]*/{print $2}' "$CONFIGFILE" | tr -d "[:blank:]\"'" | awk -F'#' '{print $1}'`
mongod=${MONGOD-/usr/bin/mongod}
MONGO_USER=mongod
MONGO_GROUP=mongod
# All variables set before this point can be overridden by users, by
# setting them directly in the SYSCONFIG file. Use this to explicitly
# override these values, at your own risk.
SYSCONFIG="/etc/sysconfig/mongod"
if [ -f "$SYSCONFIG" ]; then
. "$SYSCONFIG"
fi
PIDDIR=`dirname $PIDFILEPATH`
# Handle NUMA access to CPUs (SERVER-3574)
# This verifies the existence of numactl as well as testing that the command works
NUMACTL_ARGS="--interleave=all"
@@ -48,6 +44,10 @@ else
NUMACTL=""
fi
# things from mongod.conf get there by mongod reading it
PIDFILEPATH=`awk -F'[:=]' -v IGNORECASE=1 '/^[[:blank:]]*(processManagement\.)?pidfilepath[[:blank:]]*[:=][[:blank:]]*/{print $2}' "$CONFIGFILE" | tr -d "[:blank:]\"'" | awk -F'#' '{print $1}'`
PIDDIR=`dirname $PIDFILEPATH`
start()
{

View File

@@ -1 +1,6 @@
# TODO: add relevant configuration stuff here.
# override configuration values set in the config files
# CONFIGFILE=
# OPTIONS=
# MONGO_USER=
# MONGO_GROUP=

View File

@@ -212,7 +212,7 @@ fi
%{_bindir}/mongod
%{_mandir}/man1/mongod.1*
/etc/init.d/mongod
/etc/sysconfig/mongod
%config(noreplace) /etc/sysconfig/mongod
%attr(0755,mongod,mongod) %dir /var/lib/mongo
%attr(0755,mongod,mongod) %dir /var/log/mongodb
%attr(0755,mongod,mongod) %dir /var/run/mongodb

View File

@@ -221,7 +221,7 @@ fi
%{_bindir}/mongod
%{_mandir}/man1/mongod.1*
/etc/init.d/mongod
/etc/sysconfig/mongod
%config(noreplace) /etc/sysconfig/mongod
%attr(0755,mongod,mongod) %dir /var/lib/mongo
%attr(0755,mongod,mongod) %dir /var/log/mongodb
%attr(0755,mongod,mongod) %dir /var/run/mongodb

View File

@@ -211,7 +211,7 @@ fi
%{_bindir}/mongod
%{_mandir}/man1/mongod.1*
/etc/init.d/mongod
/etc/sysconfig/mongod
%config(noreplace) /etc/sysconfig/mongod
%attr(0755,mongod,mongod) %dir /var/lib/mongo
%attr(0755,mongod,mongod) %dir /var/log/mongodb
%attr(0755,mongod,mongod) %dir /var/run/mongodb

View File

@@ -221,7 +221,7 @@ fi
%{_bindir}/mongod
%{_mandir}/man1/mongod.1*
/etc/init.d/mongod
/etc/sysconfig/mongod
%config(noreplace) /etc/sysconfig/mongod
%attr(0755,mongod,mongod) %dir /var/lib/mongo
%attr(0755,mongod,mongod) %dir /var/log/mongodb
%attr(0755,mongod,mongod) %dir /var/run/mongodb