diff options
author | Natanael Copa <ncopa@alpinelinux.org> | 2013-06-11 08:20:34 +0000 |
---|---|---|
committer | Natanael Copa <ncopa@alpinelinux.org> | 2013-06-11 08:20:49 +0000 |
commit | 5212570b3d01388b221efe65d6749837a95359f1 (patch) | |
tree | 5a5c51c5cf21c574f2393b203c6592318643a510 /testing/mongodb/mongodb.initd | |
parent | 26c4e189e825d62d0249fb5f499bcb545d40e1ab (diff) | |
download | aports-5212570b3d01388b221efe65d6749837a95359f1.tar.bz2 aports-5212570b3d01388b221efe65d6749837a95359f1.tar.xz |
testing/mongodb: new aport
High-performance, schema-free document-oriented database
http://www.mongodb.org
ref #1182
Diffstat (limited to 'testing/mongodb/mongodb.initd')
-rw-r--r-- | testing/mongodb/mongodb.initd | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/testing/mongodb/mongodb.initd b/testing/mongodb/mongodb.initd new file mode 100644 index 0000000000..5b7b77eebf --- /dev/null +++ b/testing/mongodb/mongodb.initd @@ -0,0 +1,40 @@ +#!/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/mongodb.initd,v 1.5 2013/01/18 11:19:27 ultrabug Exp $ + +depend() { + need net +} + +start() { + checkpath -d -m 0750 -o "${MONGODB_USER}":mongodb "${MONGODB_RUN}" + + # Listen to MONGODB_IP if configured + [ -z "${MONGODB_IP}" ] || MONGODB_OPTIONS="--bind_ip ${MONGODB_IP} ${MONGODB_OPTIONS}" + + # Baselayout-1 user should use --chuid instead of --user + local USEROPT="--user" + if [ ! -f /etc/init.d/sysfs ]; then + USEROPT="--chuid" + fi + + ebegin "Starting ${SVCNAME}" + start-stop-daemon --background --start --make-pidfile \ + --pidfile ${MONGODB_RUN:-/var/run/mongodb}/${SVCNAME}.pid \ + ${USEROPT} ${MONGODB_USER:-mongodb} \ + --exec ${MONGODB_EXEC:-/usr/bin/mongod} \ + -- \ + --port ${MONGODB_PORT:-27017} \ + --dbpath ${MONGODB_DATA:-/var/lib/mongodb} \ + --unixSocketPrefix ${MONGODB_RUN:-/var/run/mongodb} \ + --logappend --logpath /var/log/mongodb/${SVCNAME}.log \ + ${MONGODB_OPTIONS} + eend $? +} + +stop() { + ebegin "Stopping ${SVCNAME}" + start-stop-daemon --stop --pidfile ${MONGODB_RUN:-/var/run/mongodb}/${SVCNAME}.pid + eend $? +} |