summaryrefslogtreecommitdiff
path: root/databases/mongodb32/files/mongod.in
diff options
context:
space:
mode:
authorThomas Zander <riggs@FreeBSD.org>2018-05-20 09:24:10 +0000
committerThomas Zander <riggs@FreeBSD.org>2018-05-20 09:24:10 +0000
commite05d147edb7a57122f616545a4b47ad09264cfc1 (patch)
tree66e8ac483681b1ef7f03744276e9f14eba946bc6 /databases/mongodb32/files/mongod.in
parent- Add LICENSE (diff)
Adapt ${name}_limits to the new resource limiting mechanics for services
PR: 227218 Submitted by: 0mp
Diffstat (limited to 'databases/mongodb32/files/mongod.in')
-rw-r--r--databases/mongodb32/files/mongod.in21
1 files changed, 11 insertions, 10 deletions
diff --git a/databases/mongodb32/files/mongod.in b/databases/mongodb32/files/mongod.in
index ace3936e0b51..94a538b46668 100644
--- a/databases/mongodb32/files/mongod.in
+++ b/databases/mongodb32/files/mongod.in
@@ -7,11 +7,11 @@
# Add the following lines to /etc/rc.conf.local or /etc/rc.conf
# to enable this service:
#
-# mongod_enable (bool): Set to "NO" by default.
+# mongod_enable (bool): Set to "NO" by default.
# Set it to "YES" to enable mongod.
-# mongod_limits (bool): Set to "NO" by default.
-# Set it to yes to run `limits -e -U mongodb`
-# just before mongod starts.
+%%LEGACY_LIMITS%%# mongod_limits (bool): Set to "NO" by default.
+%%LEGACY_LIMITS%%# Set it to yes to run `limits -e -U mongodb`
+%%LEGACY_LIMITS%%# just before mongod starts.
# mongod_dbpath (str): Default to "/var/db/mongodb"
# Base database directory.
# mongod_flags (str): Custom additional arguments to be passed to mongod.
@@ -28,7 +28,7 @@ rcvar=mongod_enable
load_rc_config $name
: ${mongod_enable="NO"}
-: ${mongod_limits="NO"}
+%%LEGACY_LIMITS%%: ${mongod_limits="NO"}
: ${mongod_dbpath="/var/db/mongodb"}
: ${mongod_flags="--logpath ${mongod_dbpath}/mongod.log --logappend"}
: ${mongod_user="mongodb"}
@@ -52,11 +52,12 @@ mongod_prestart()
if [ ! -d ${mongod_dbpath} ]; then
mongod_create_dbpath || return 1
fi
- if checkyesno mongod_limits; then
- eval `/usr/bin/limits -e -U ${mongod_user}` 2>/dev/null
- else
- return 0
- fi
+%%LEGACY_LIMITS%% if checkyesno mongod_limits; then
+%%LEGACY_LIMITS%% eval `/usr/bin/limits -e -U ${mongod_user}` 2>/dev/null
+%%LEGACY_LIMITS%% else
+%%LEGACY_LIMITS%% return 0
+%%LEGACY_LIMITS%% fi
+%%MODERN_LIMITS%% return 0
}
run_rc_command "$1"