diff options
author | Ronald Klop <ronald@FreeBSD.org> | 2024-07-23 17:44:45 +0200 |
---|---|---|
committer | Ronald Klop <ronald@FreeBSD.org> | 2024-07-23 17:44:45 +0200 |
commit | f2c9ba7c53c9a599c36b722305a189fd912db5d2 (patch) | |
tree | accade01ff4ca28522f8702d4a8864689c862da1 /databases/mongodb80/files/mongod.in | |
parent | sysutils/cfengine*-lts: cfengine* 3.24.0 is LTS (diff) |
databases/mongodb80: new port 8.0.0-rc14
Still release candidate, use with care.
Notes:
https://www.mongodb.com/docs/v8.0/release-notes/8.0/
Diffstat (limited to 'databases/mongodb80/files/mongod.in')
-rw-r--r-- | databases/mongodb80/files/mongod.in | 53 |
1 files changed, 53 insertions, 0 deletions
diff --git a/databases/mongodb80/files/mongod.in b/databases/mongodb80/files/mongod.in new file mode 100644 index 000000000000..20b0f5c0f43d --- /dev/null +++ b/databases/mongodb80/files/mongod.in @@ -0,0 +1,53 @@ +#!/bin/sh + +# PROVIDE: mongod +# REQUIRE: NETWORK ldconfig +# KEYWORD: shutdown +# +# 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_dbpath (str): Default to "/var/db/mongodb" +# Base database directory. +# mongod_flags (str): Custom additional arguments to be passed to mongod. +# Default to "--logpath ${mongod_dbpath}/mongod.log --logappend". +# mongod_config (str): Default to "%%PREFIX%%/etc/mongodb.conf" +# Path to config file +# + +. /etc/rc.subr + +name="mongod" +rcvar=mongod_enable + +load_rc_config $name + +: ${mongod_enable="NO"} +: ${mongod_dbpath="/var/db/mongodb"} +: ${mongod_flags="--logpath ${mongod_dbpath}/mongod.log --logappend --setParameter=disabledSecureAllocatorDomains=\*"} +: ${mongod_user="mongodb"} +: ${mongod_group="mongodb"} +: ${mongod_config="%%PREFIX%%/etc/mongodb.conf"} + +pidfile="${mongod_dbpath}/mongod.lock" +command=%%PREFIX%%/bin/${name} +command_args="--config $mongod_config --dbpath $mongod_dbpath --fork >/dev/null 2>/dev/null" +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 + return 0 +} + +run_rc_command "$1" |