aboutsummaryrefslogtreecommitdiffstats
path: root/unmaintained/mongodb/mongos.initd
diff options
context:
space:
mode:
authorNatanael Copa <ncopa@alpinelinux.org>2014-10-28 15:48:23 +0000
committerNatanael Copa <ncopa@alpinelinux.org>2014-10-28 15:48:23 +0000
commit74ff2b35c9d2afbd9fab439d0055f5b66b386ad9 (patch)
treef8cd0d5c638de4ae4e3f26d597c04ad7fabfc1a2 /unmaintained/mongodb/mongos.initd
parente11a0b3bd993f05d269be00a893730d30a06e6b6 (diff)
downloadaports-74ff2b35c9d2afbd9fab439d0055f5b66b386ad9.tar.bz2
aports-74ff2b35c9d2afbd9fab439d0055f5b66b386ad9.tar.xz
testing/mongodb: move to unmaintained does not build
Diffstat (limited to 'unmaintained/mongodb/mongos.initd')
-rw-r--r--unmaintained/mongodb/mongos.initd45
1 files changed, 45 insertions, 0 deletions
diff --git a/unmaintained/mongodb/mongos.initd b/unmaintained/mongodb/mongos.initd
new file mode 100644
index 0000000000..2f9bd9a6ea
--- /dev/null
+++ b/unmaintained/mongodb/mongos.initd
@@ -0,0 +1,45 @@
+#!/sbin/runscript
+# Copyright 1999-2013 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.3 2013/01/18 11:19:27 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
+
+ checkpath -d -m 0750 -o "${MONGOS_USER}":mongodb "${MONGOS_RUN}"
+
+ # Listen to MONGOS_IP if configured
+ [ -z "${MONGOS_IP}" ] || MONGOS_OPTIONS="--bind_ip ${MONGOS_IP} ${MONGOS_OPTIONS}"
+
+ local USEROPT="--user"
+ ebegin "Starting ${SVCNAME}"
+ start-stop-daemon --background --start --make-pidfile \
+ --pidfile ${MONGOS_RUN:-/var/run/mongodb}/${SVCNAME}.pid \
+ ${USEROPT} ${MONGOS_USER:-mongodb} \
+ --exec ${MONGOS_EXEC:-/usr/bin/mongos} \
+ -- \
+ --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 $?
+}