aboutsummaryrefslogtreecommitdiff
path: root/databases/mongodb/files/mongod.in
diff options
context:
space:
mode:
Diffstat (limited to 'databases/mongodb/files/mongod.in')
-rw-r--r--databases/mongodb/files/mongod.in39
1 files changed, 39 insertions, 0 deletions
diff --git a/databases/mongodb/files/mongod.in b/databases/mongodb/files/mongod.in
new file mode 100644
index 000000000000..ddfd1d5400ea
--- /dev/null
+++ b/databases/mongodb/files/mongod.in
@@ -0,0 +1,39 @@
+#!/bin/sh
+
+# PROVIDE: mongod
+# REQUIRE: NETWORK
+#
+# 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.
+#
+# Additional configurable variables:
+# mongod_config (path): Set to %%PREFIX%%/etc/mongod.conf
+# by default. Additional configuration. You
+# can also use mongod_flags for additional
+# command line arguments.
+# mongod_dbpath (path): Set to /var/db/mongod by default
+# mongod_user (username): Set to "mongod" by default
+
+. %%RC_SUBR%%
+
+name="mongod"
+rcvar=${name}_enable
+
+command=%%PREFIX%%/bin/${name}
+
+load_rc_config $name
+
+: ${mongod_enable="NO"}
+: ${mongod_config="%%PREFIX%%/etc/mongodb.conf"}
+: ${mongod_dbpath="/var/db/mongodb"}
+: ${mongod_user="mongodb"}
+
+command_args="-f $mongod_config --dbpath $mongod_dbpath --logappend --logpath $mongod_dbpath/mongod.log --fork"
+
+required_dirs=${mongod_dbpath}
+
+run_rc_command "$1"
+