Lines 9-17
Link Here
|
9 |
# |
9 |
# |
10 |
# mongod_enable (bool): Set to "NO" by default. |
10 |
# mongod_enable (bool): Set to "NO" by default. |
11 |
# Set it to "YES" to enable mongod. |
11 |
# Set it to "YES" to enable mongod. |
12 |
# mongod_limits (bool): Set to "NO" by default. |
12 |
%%LEGACY_LIMITS%%# mongod_limits (bool): Set to "NO" by default. |
13 |
# Set it to yes to run `limits -e -U mongodb` |
13 |
%%LEGACY_LIMITS%%# Set it to yes to run `limits -e -U mongodb` |
14 |
# just before mongod starts. |
14 |
%%LEGACY_LIMITS%%# just before mongod starts. |
15 |
# mongod_dbpath (str): Default to "/var/db/mongodb" |
15 |
# mongod_dbpath (str): Default to "/var/db/mongodb" |
16 |
# Base database directory. |
16 |
# Base database directory. |
17 |
# mongod_flags (str): Custom additional arguments to be passed to mongod. |
17 |
# mongod_flags (str): Custom additional arguments to be passed to mongod. |
Lines 28-34
rcvar=mongod_enable
Link Here
|
28 |
load_rc_config $name |
28 |
load_rc_config $name |
29 |
|
29 |
|
30 |
: ${mongod_enable="NO"} |
30 |
: ${mongod_enable="NO"} |
31 |
: ${mongod_limits="NO"} |
31 |
%%LEGACY_LIMITS%%: ${mongod_limits="NO"} |
32 |
: ${mongod_dbpath="/var/db/mongodb"} |
32 |
: ${mongod_dbpath="/var/db/mongodb"} |
33 |
: ${mongod_flags="--logpath ${mongod_dbpath}/mongod.log --logappend"} |
33 |
: ${mongod_flags="--logpath ${mongod_dbpath}/mongod.log --logappend"} |
34 |
: ${mongod_user="mongodb"} |
34 |
: ${mongod_user="mongodb"} |
Lines 51-61
mongod_prestart()
Link Here
|
51 |
if [ ! -d ${mongod_dbpath} ]; then |
51 |
if [ ! -d ${mongod_dbpath} ]; then |
52 |
mongod_create_dbpath || return 1 |
52 |
mongod_create_dbpath || return 1 |
53 |
fi |
53 |
fi |
54 |
if checkyesno mongod_limits; then |
54 |
%%LEGACY_LIMITS%% if checkyesno mongod_limits; then |
55 |
eval `/usr/bin/limits -e -U ${mongod_user}` 2>/dev/null |
55 |
%%LEGACY_LIMITS%% eval `/usr/bin/limits -e -U ${mongod_user}` 2>/dev/null |
56 |
else |
56 |
%%LEGACY_LIMITS%% else |
57 |
return 0 |
57 |
%%LEGACY_LIMITS%% return 0 |
58 |
fi |
58 |
%%LEGACY_LIMITS%% fi |
|
|
59 |
%%MODERN_LIMITS%% return 0 |
59 |
} |
60 |
} |
60 |
|
61 |
|
61 |
run_rc_command "$1" |
62 |
run_rc_command "$1" |