diff options
author | Sam Kleinman <samk@10gen.com> | 2016-01-19 11:51:36 -0500 |
---|---|---|
committer | Sam Kleinman <samk@10gen.com> | 2016-02-09 13:17:41 -0500 |
commit | 985e2a0be95709ac064c57f0a9bb385a55937285 (patch) | |
tree | 640cabbfa77d72dbf7b8d068403009b347253070 /rpm | |
parent | 8a58e2fb57806c0ccd415773d490167e783941bf (diff) | |
download | mongo-985e2a0be95709ac064c57f0a9bb385a55937285.tar.gz |
SERVER-20930 SERVER-20404: clarify sysconfig and default config override
Diffstat (limited to 'rpm')
-rwxr-xr-x | rpm/init.d-mongod | 16 | ||||
-rw-r--r-- | rpm/init.d-mongod.suse | 16 | ||||
-rw-r--r-- | rpm/mongod.sysconfig | 7 | ||||
-rw-r--r-- | rpm/mongodb-enterprise-unstable.spec | 4 | ||||
-rw-r--r-- | rpm/mongodb-enterprise.spec | 4 | ||||
-rw-r--r-- | rpm/mongodb-org-unstable.spec | 4 | ||||
-rw-r--r-- | rpm/mongodb-org.spec | 4 |
7 files changed, 30 insertions, 25 deletions
diff --git a/rpm/init.d-mongod b/rpm/init.d-mongod index 7ddff0be2eb..cd135c51af6 100755 --- a/rpm/init.d-mongod +++ b/rpm/init.d-mongod @@ -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 diff --git a/rpm/init.d-mongod.suse b/rpm/init.d-mongod.suse index 2d35e8032c3..fae1fb8b3f3 100644 --- a/rpm/init.d-mongod.suse +++ b/rpm/init.d-mongod.suse @@ -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() { diff --git a/rpm/mongod.sysconfig b/rpm/mongod.sysconfig index 5dbfce1dad9..e6d6672d5f3 100644 --- a/rpm/mongod.sysconfig +++ b/rpm/mongod.sysconfig @@ -1 +1,6 @@ -# TODO: add relevant configuration stuff here. +# override configuration values set in the config files + +# CONFIGFILE= +# OPTIONS= +# MONGO_USER= +# MONGO_GROUP= diff --git a/rpm/mongodb-enterprise-unstable.spec b/rpm/mongodb-enterprise-unstable.spec index d62a92b3280..cd4c66607b8 100644 --- a/rpm/mongodb-enterprise-unstable.spec +++ b/rpm/mongodb-enterprise-unstable.spec @@ -183,7 +183,7 @@ if ! /usr/bin/id -g mongod &>/dev/null; then /usr/sbin/groupadd -r mongod fi if ! /usr/bin/id mongod &>/dev/null; then - /usr/sbin/useradd -M -r -g mongod -d /var/lib/mongo -s /bin/false -c mongod mongod > /dev/null 2>&1 + /usr/sbin/useradd -M -r -g mongod -d /var/lib/mongo -s /bin/false -c mongod mongod > /dev/null 2>&1 fi %post server @@ -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 diff --git a/rpm/mongodb-enterprise.spec b/rpm/mongodb-enterprise.spec index 26a0e001a99..95fd1410306 100644 --- a/rpm/mongodb-enterprise.spec +++ b/rpm/mongodb-enterprise.spec @@ -192,7 +192,7 @@ if ! /usr/bin/id -g mongod &>/dev/null; then /usr/sbin/groupadd -r mongod fi if ! /usr/bin/id mongod &>/dev/null; then - /usr/sbin/useradd -M -r -g mongod -d /var/lib/mongo -s /bin/false -c mongod mongod > /dev/null 2>&1 + /usr/sbin/useradd -M -r -g mongod -d /var/lib/mongo -s /bin/false -c mongod mongod > /dev/null 2>&1 fi %post server @@ -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 diff --git a/rpm/mongodb-org-unstable.spec b/rpm/mongodb-org-unstable.spec index fa3f4f45ae7..27b2266bd3e 100644 --- a/rpm/mongodb-org-unstable.spec +++ b/rpm/mongodb-org-unstable.spec @@ -182,7 +182,7 @@ if ! /usr/bin/id -g mongod &>/dev/null; then /usr/sbin/groupadd -r mongod fi if ! /usr/bin/id mongod &>/dev/null; then - /usr/sbin/useradd -M -r -g mongod -d /var/lib/mongo -s /bin/false -c mongod mongod > /dev/null 2>&1 + /usr/sbin/useradd -M -r -g mongod -d /var/lib/mongo -s /bin/false -c mongod mongod > /dev/null 2>&1 fi %post server @@ -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 diff --git a/rpm/mongodb-org.spec b/rpm/mongodb-org.spec index 2c8095046ab..00e30576b5c 100644 --- a/rpm/mongodb-org.spec +++ b/rpm/mongodb-org.spec @@ -192,7 +192,7 @@ if ! /usr/bin/id -g mongod &>/dev/null; then /usr/sbin/groupadd -r mongod fi if ! /usr/bin/id mongod &>/dev/null; then - /usr/sbin/useradd -M -r -g mongod -d /var/lib/mongo -s /bin/false -c mongod mongod > /dev/null 2>&1 + /usr/sbin/useradd -M -r -g mongod -d /var/lib/mongo -s /bin/false -c mongod mongod > /dev/null 2>&1 fi %post server @@ -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 |