summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJason Smith (work) <jhs@iriscouch.com>2013-02-06 03:23:00 +0000
committerJason Smith (work) <jhs@iriscouch.com>2013-02-06 03:23:00 +0000
commit3fab6bb55759b98c32908f2ca735c761de3479ab (patch)
tree9796fea336af964ed754ade1f3c6ab58527a7be6
parent8097f988d635f9ed3fa5af3c2aa4a49058f107db (diff)
downloadcouchdb-3fab6bb55759b98c32908f2ca735c761de3479ab.tar.gz
Automatically support CouchDB plugins (GeoCouch, BrowserID, OAuth, etc.)
-rw-r--r--bin/couchdb.tpl.in17
1 files changed, 17 insertions, 0 deletions
diff --git a/bin/couchdb.tpl.in b/bin/couchdb.tpl.in
index 81bb8b840..8b2581a66 100644
--- a/bin/couchdb.tpl.in
+++ b/bin/couchdb.tpl.in
@@ -231,6 +231,23 @@ start_couchdb () {
touch $PID_FILE
interactive_option="+Bd -noinput"
fi
+
+ # Find plugins and add them to the Erlang path.
+ if test -d "%localerlanglibdir%/../../plugins"; then
+ for plugin in "%localerlanglibdir%/../../plugins"/*; do
+ if echo "$ERL_ZFLAGS" | grep "$plugin/ebin" > /dev/null 2> /dev/null; then
+ : # It's already loaded.
+ else
+ if echo "$COUCH_PLUGIN_BLACKLIST" | grep "$plugin" > /dev/null 2> /dev/null; then
+ : # Do not use this plugin.
+ else
+ ERL_ZFLAGS="$ERL_ZFLAGS -pz '$plugin/ebin'"
+ fi
+ fi
+ done
+ export ERL_ZFLAGS
+ fi
+
command="%ERL% $interactive_option $ERL_START_OPTIONS \
-env ERL_LIBS $ERL_LIBS:%localerlanglibdir% -couch_ini $start_arguments -s couch"
if test "$BACKGROUND" = "true" -a "$RECURSED" = "false"; then