aboutsummaryrefslogtreecommitdiffstats
path: root/testing/apache-couchdb/apache-couchdb.initd
diff options
context:
space:
mode:
authorLeonardo Arena <rnalrd@alpinelinux.org>2014-01-24 15:11:59 +0000
committerLeonardo Arena <rnalrd@alpinelinux.org>2014-01-24 15:13:41 +0000
commitf8a40875123e63fd11aa92f101c1f03620f4b6be (patch)
treeed778c78d857b4e2407888040df8d7cf229aaeca /testing/apache-couchdb/apache-couchdb.initd
parent0cecb8a7d67eafb0bea2ab9bdee9e15da802b68b (diff)
downloadaports-f8a40875123e63fd11aa92f101c1f03620f4b6be.tar.bz2
aports-f8a40875123e63fd11aa92f101c1f03620f4b6be.tar.xz
testing/apache-couchdb: rename git package dir to match pkgname
Diffstat (limited to 'testing/apache-couchdb/apache-couchdb.initd')
-rw-r--r--testing/apache-couchdb/apache-couchdb.initd50
1 files changed, 50 insertions, 0 deletions
diff --git a/testing/apache-couchdb/apache-couchdb.initd b/testing/apache-couchdb/apache-couchdb.initd
new file mode 100644
index 0000000000..c3a136dfb8
--- /dev/null
+++ b/testing/apache-couchdb/apache-couchdb.initd
@@ -0,0 +1,50 @@
+#!/sbin/runscript
+# Copyright 1999-2013 Dirkjan Ochtman
+# Distributed under the terms of the Apache License, Version 2.0
+
+depend() {
+ need net
+ after firewall
+}
+
+start() {
+ ebegin "Starting ${SVCNAME}"
+
+ args="-b"
+ if test -n "$COUCHDB_STDOUT_FILE"; then
+ args="$args -o $COUCHDB_STDOUT_FILE"
+ fi
+ if test -n "$COUCHDB_STDERR_FILE"; then
+ args="$args -e $COUCHDB_STDERR_FILE"
+ fi
+ if test -n "$COUCHDB_RESPAWN_TIMEOUT"; then
+ args="$args -r $COUCHDB_RESPAWN_TIMEOUT"
+ fi
+ if test -n "$COUCHDB_OPTIONS"; then
+ args="$args $COUCHDB_OPTIONS"
+ fi
+ if test -n "$COUCHDB_PID_FILE"; then
+ args="$args -p $COUCHDB_PID_FILE"
+ else
+ echo "* ERROR: COUCHDB_PID_FILE must be set"
+ return -1
+ fi
+ if test -z "$COUCHDB_USER"; then
+ echo "* ERROR: COUCHDB_USER must be set"
+ return -1
+ fi
+
+ checkpath --directory --owner ${COUCHDB_USER} ${COUCHDB_PID_FILE%/*}
+
+ start-stop-daemon --start --exec ${EXEC} --name ${COUCHDB_BEAM} \
+ --user ${COUCHDB_USER} --pidfile ${COUCHDB_PID_FILE} -- $args
+
+ eend $? "Failed to start ${SVCNAME}"
+}
+
+stop() {
+ ebegin "Stopping ${SVCNAME}"
+ start-stop-daemon --stop --exec ${EXEC} --name ${COUCHDB_BEAM} \
+ --pidfile ${COUCHDB_PID_FILE}
+ eend $? "Failed to stop ${SVCNAME}"
+}