Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Add plugin dependencies to Erlang library path

If a plugin (like GeoCouch) has additional dependencies, they
are stored within a directory called "deps" within the directory
of the plugin. This "deps" directory gets added to the ERL_LIBS
environment variable in case it exists and the plugin is enabled.

Change-Id: Ifc463fd031ccd142410da9420e53e90d42418b0d
Reviewed-on: http://review.couchbase.org/9883
Reviewed-by: Filipe David Borba Manana <fdmanana@gmail.com>
Tested-by: Filipe David Borba Manana <fdmanana@gmail.com>
  • Loading branch information...
commit 7ef409ddc505bb0aca4ce3f2ed2dd42dbdf4f3f6 1 parent 051c820
@vmx vmx authored fdmanana committed
Showing with 7 additions and 2 deletions.
  1. +7 −2 bin/couchdb.tpl.in
View
9 bin/couchdb.tpl.in
@@ -231,8 +231,7 @@ start_couchdb () {
touch $PID_FILE
interactive_option="+Bd -noinput"
fi
- command="'%ERL%' $interactive_option $ERL_START_OPTIONS \
- -env ERL_LIBS '%localerlanglibdir%' %localerlanglibargs% -couch_ini $start_arguments -s couch"
+ ERL_LIBS="$ERL_LIBS:'%localerlanglibdir%'"
# Find plugins and add them to the Erlang path.
if test -d "%localerlanglibdir%/../../plugins"; then
@@ -244,12 +243,18 @@ start_couchdb () {
: # Do not use this plugin.
else
ERL_ZFLAGS="$ERL_ZFLAGS -pz '$plugin/ebin'"
+ if test -d "$plugin/deps"; then
+ ERL_LIBS="$ERL_LIBS:'$plugin/deps'"
+ fi
fi
fi
done
export ERL_ZFLAGS
fi
+ command="'%ERL%' $interactive_option $ERL_START_OPTIONS \
+ -env ERL_LIBS $ERL_LIBS %localerlanglibargs% -couch_ini $start_arguments -s couch"
+
if test "$BACKGROUND" = "true" -a "$RECURSED" = "false"; then
$0 $background_start_arguments -b -r $RESPAWN_TIMEOUT -p $PID_FILE \
-o $STDOUT_FILE -e $STDERR_FILE -R &
Please sign in to comment.
Something went wrong with that request. Please try again.