diff options
author | Edwin Fine <efine@users.noreply.github.com> | 2018-01-13 22:16:43 -0500 |
---|---|---|
committer | Adam Kocoloski <adam@kocolosk.net> | 2018-01-13 22:16:43 -0500 |
commit | 649b808af04720027c80390aecb6a5a01deb70b5 (patch) | |
tree | 8f607e1f42df01220404b6e3755aeb1e29d148a6 | |
parent | 1768aeab8b9100034e374a45f1bc9b7bd72dad2e (diff) | |
download | couchdb-649b808af04720027c80390aecb6a5a01deb70b5.tar.gz |
Allow override of `-args_file` and `-config` parameters (#1095)
The existing `couchdb` start script hard-codes the arguments to
`-args_file` and `-config`. Although it is possible to copy this
script and modify it, or modify it in place, that is less than ideal
and can lead to all kinds of difficulties.
This PR adds the following environment variables:
- `ARGS_FILE`: By default, set to the existing hard-coded value.
- `SYSCONFIG_FILE`: By default, set to the existing hard-coded value.
- `COUCHDB_ARGS_FILE`: If non-empty, overrides `ARGS_FILE`.
- `COUCHDB_SYSCONFIG_FILE`: If non-empty, overrides `SYSCONFIG_FILE`.
By changing the script to use these environment variables, it makes it easily
possible to use different settings without tinkering with the pristine
installed CouchDB environment.
-rwxr-xr-x | rel/overlay/bin/couchdb | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/rel/overlay/bin/couchdb b/rel/overlay/bin/couchdb index c82f581f4..a9e6e9bea 100755 --- a/rel/overlay/bin/couchdb +++ b/rel/overlay/bin/couchdb @@ -26,6 +26,10 @@ export BINDIR="$ROOTDIR/erts-$ERTS_VSN/bin" export EMU=beam export PROGNAME=`echo $0 | sed 's/.*\///'` +ARGS_FILE="${COUCHDB_ARGS_FILE:-$ROOTDIR/etc/vm.args}" +SYSCONFIG_FILE="${COUCHDB_SYSCONFIG_FILE:-$ROOTDIR/releases/$APP_VSN/sys.config}" + exec "$BINDIR/erlexec" -boot "$ROOTDIR/releases/$APP_VSN/couchdb" \ - -args_file "$ROOTDIR/etc/vm.args" \ - -config "$ROOTDIR/releases/$APP_VSN/sys.config" "$@" + -args_file "${ARGS_FILE}" \ + -config "${SYSCONFIG_FILE}" "$@" + |