From 62166b29b30b86fcbf9b04b69e1b1bf11965b16f Mon Sep 17 00:00:00 2001 From: Alex Dupre Date: Fri, 29 Mar 2013 08:56:13 +0000 Subject: Update to 2.4.1 release and overhaul: - use bundled boost lib, since 1.52 from ports make mongod segfaulting - set LICENSE - use V8 Javascript engine by default (SM still an option, deprecated) - make SSL optional (ON by default) - add support for running regression tests - enhance rc script - add support for ccache - install c++ driver / client library - take maintainership Approved by: maintainer timeout (> 6 months) --- databases/mongodb/files/mongod.in | 64 ++++++++++++++++++++++----------------- 1 file changed, 37 insertions(+), 27 deletions(-) (limited to 'databases/mongodb/files/mongod.in') diff --git a/databases/mongodb/files/mongod.in b/databases/mongodb/files/mongod.in index 272ecbea3ca7..a06b88ff5226 100644 --- a/databases/mongodb/files/mongod.in +++ b/databases/mongodb/files/mongod.in @@ -7,45 +7,55 @@ # 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. -# Set it to YES to enable mongod. +# 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. +# mongod_dbpath (str): Default to "/var/db/mongodb" +# Base database directory. +# mongod_pidfile (str): Custum PID file path and name. +# Default to "${mongod_dbpath}/mongod.pid". +# mongod_flags (str): Custom additional arguments to be passed to mongod. +# Default to "--logpath ${mongod_dbpath}/mongod.log --logappend". # -# Additional configurable variables: -# mongod_config (path): Set to %%PREFIX%%/etc/mongodb.conf -# by default. Additional configuration. You -# can also use mongod_flags for additional -# command line arguments. -# mongod_dbpath (path): Set to /var/db/mongodb by default -# mongod_user (username): Set to "mongodb" by default . /etc/rc.subr name="mongod" rcvar=mongod_enable -command=%%PREFIX%%/bin/${name} - load_rc_config $name : ${mongod_enable="NO"} -: ${mongod_config="%%PREFIX%%/etc/mongodb.conf"} +: ${mongod_limits="NO"} : ${mongod_dbpath="/var/db/mongodb"} +: ${mongod_flags="--logpath ${mongod_dbpath}/mongod.log --logappend"} : ${mongod_user="mongodb"} +: ${mongod_group="mongodb"} -# Note: if you use a config file for mongodb, -# the parameters passed on cl override the config file -# ie, dbpath, logappend, logpath etc in the command_args below. -# This means that your config file will be ignored unless -# you comment out remove the cl parameters. -# -# Using config file: uncomment the following line AND comment out -# the next line. - -# command_args="-f $mongod_config" - -command_args="-f $mongod_config --dbpath $mongod_dbpath --logappend --logpath $mongod_dbpath/mongod.log --fork" - -required_dirs=${mongod_dbpath} +pidfile=${mongod_pidfile:-"${mongod_dbpath}/mongod.pid"} +command=%%PREFIX%%/bin/${name} +command_args="--config %%PREFIX%%/etc/mongodb.conf --dbpath $mongod_dbpath --pidfilepath ${pidfile} --fork" +start_precmd="${name}_prestart" + +mongod_create_dbpath() +{ + mkdir ${mongod_dbpath} >/dev/null 2>/dev/null + [ $? -eq 0 ] && chown -R ${mongod_user}:${mongod_group} ${mongod_dbpath} +} + + +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 +} run_rc_command "$1" - -- cgit v1.2.3