diff options
-rw-r--r-- | bin/couchdb.tpl.in | 17 |
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 |