summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'dev-db/mongodb/files/mongos.initd')
-rw-r--r--dev-db/mongodb/files/mongos.initd43
1 files changed, 43 insertions, 0 deletions
diff --git a/dev-db/mongodb/files/mongos.initd b/dev-db/mongodb/files/mongos.initd
new file mode 100644
index 000000000000..9279c4fc9993
--- /dev/null
+++ b/dev-db/mongodb/files/mongos.initd
@@ -0,0 +1,43 @@
+#!/sbin/runscript
+# Copyright 1999-2011 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/dev-db/mongodb/files/mongos.initd,v 1.1 2011/04/13 14:56:32 ultrabug Exp $
+
+depend() {
+ need net
+}
+
+checkconfig() {
+ if [ -z "${MONGOS_CONFIGDB}" ]; then
+ eerror "MONGOS_CONFIGDB is not defined, check your configuration file !"
+ return 1
+ fi
+ return 0
+}
+
+start() {
+ checkconfig || return 1
+
+ mkdir -p ${MONGOS_RUN:-/var/run/mongodb}
+ chown ${MONGOS_USER:-mongodb}: ${MONGOS_RUN:-/var/run/mongodb}
+
+ ebegin "Starting ${SVCNAME}"
+ start-stop-daemon --background --start --make-pidfile \
+ --pidfile ${MONGOS_RUN:-/var/run/mongodb}/${SVCNAME}.pid \
+ --chuid ${MONGOS_USER:-mongodb} \
+ --exec ${MONGOS_EXEC:-/usr/bin/mongos} \
+ -- \
+ --bind_ip ${MONGOS_IP:-127.0.0.1} \
+ --port ${MONGOS_PORT:-27018} \
+ --unixSocketPrefix ${MONGOS_RUN:-/var/run/mongodb} \
+ --logappend --logpath /var/log/mongodb/${SVCNAME}.log \
+ --configdb ${MONGOS_CONFIGDB} \
+ ${MONGOS_OPTIONS}
+ eend $?
+}
+
+stop() {
+ ebegin "Stopping ${SVCNAME}"
+ start-stop-daemon --stop --pidfile ${MONGOS_RUN:-/var/run/mongodb}/${SVCNAME}.pid
+ eend $?
+} \ No newline at end of file