Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow override of -args_file and -config parameters #1095

Merged
merged 2 commits into from
Jan 14, 2018
Merged

Allow override of -args_file and -config parameters #1095

merged 2 commits into from
Jan 14, 2018

Conversation

efine
Copy link
Contributor

@efine efine commented Jan 6, 2018

Overview

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.

Kindly consider this feature request as a useful, and "mostly harmless" addition to CouchDB.

Testing recommendations

This pull request is designed to be completely backward-compatible with the existing couchdb script.

Testing can be very simple:

  1. Run without any environment changes - should do precisely what the existing start script does.
  2. Run as COUCHDB_ARGS_FILE=/some/different/vm.args couchdb - should use the args from the specified vm.args.
  3. Run as COUCHDB_SYSCONFIG_FILE=/some/different/sys.config couchdb - should use the configuration in the specified sys.config.
  4. Run with both overrides - should be a combination of the above two tests.

Related Issues or Pull Requests

PR apache/couchdb-documentation#227

Checklist

  • Code is written and works correctly;
  • Changes are covered by tests;
  • Documentation reflects the changes;

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.

Kindly consider this feature request as a useful, and "mostly harmless"
addition to CouchDB.
@kocolosk
Copy link
Member

Definitely useful, I had wanted to do this a few months back but never got around to it. Thanks!

@kocolosk kocolosk merged commit 649b808 into apache:master Jan 14, 2018
willholley pushed a commit to willholley/couchdb that referenced this pull request May 22, 2018
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.
natevw added a commit to natevw/couchdb-documentation that referenced this pull request Nov 22, 2018
This seems to be a discrepancy from the start, see original pull requests:

* apache/couchdb#1095 (code)
* apache#227 (docs)

Note also the script seems unhappy with relative paths, so I've also snuck a wording change alongside the main fix here.
wohali pushed a commit to apache/couchdb-documentation that referenced this pull request Nov 23, 2018
This seems to be a discrepancy from the start, see original pull requests:

* apache/couchdb#1095 (code)
* #227 (docs)

Note also the script seems unhappy with relative paths, so I've also snuck a wording change alongside the main fix here.
adrienverge added a commit to adrienverge/couchdb that referenced this pull request Nov 1, 2019
This is the continuation of commit 649b808 "Allow override of
`-args_file` and `-config` parameters (apache#1095)".

This allows setting the `-couch_ini` files location if needed, using
`COUCHDB_INI_FILES` env var:
- If unset (the default), `-couch_ini` will have an empty list and
  CouchDB will start as usual.
- If set (to a file, or list of files like
  `COUCHDB_INI_FILES=/chroot/etc/couchdb/default.ini
  /chroot/etc/couchdb/default.d ...`) it will allow running CouchDB with
  different settings. A useful case is being able to run multiple
  CouchDB servers on the same machine.
adrienverge added a commit to adrienverge/couchdb that referenced this pull request Nov 21, 2019
This is the continuation of commit 649b808 "Allow override of
`-args_file` and `-config` parameters (apache#1095)".

This allows setting the `-couch_ini` files location if needed, using
`COUCHDB_INI_FILES` env var:
- If unset (the default), `-couch_ini` will have an empty list and
  CouchDB will start as usual.
- If set (to a file, or list of files like
  `COUCHDB_INI_FILES=/chroot/etc/couchdb/default.ini
  /chroot/etc/couchdb/default.d ...`) it will allow running CouchDB with
  different settings. A useful case is being able to run multiple
  CouchDB servers on the same machine.
adrienverge added a commit to adrienverge/couchdb that referenced this pull request Dec 12, 2019
This is the continuation of commit 649b808 "Allow override of
`-args_file` and `-config` parameters (apache#1095)".

This allows setting the `-couch_ini` files location if needed, using
`COUCHDB_INI_FILES` env var:
- If unset (the default), `-couch_ini` will have an empty list and
  CouchDB will start as usual.
- If set (to a file, or list of files like
  `COUCHDB_INI_FILES=/chroot/etc/couchdb/default.ini
  /chroot/etc/couchdb/default.d ...`) it will allow running CouchDB with
  different settings. A useful case is being able to run multiple
  CouchDB servers on the same machine.
adrienverge added a commit to adrienverge/couchdb that referenced this pull request Dec 12, 2019
This is the continuation of commit 649b808 "Allow override of
`-args_file` and `-config` parameters (apache#1095)".

This allows setting the `-couch_ini` files location if needed, using
`COUCHDB_INI_FILES` env var:
- If unset (the default), `-couch_ini` will have an empty list and
  CouchDB will start as usual.
- If set (to a file, or list of files like
  `COUCHDB_INI_FILES=/chroot/etc/couchdb/default.ini
  /chroot/etc/couchdb/default.d ...`) it will allow running CouchDB with
  different settings. A useful case is being able to run multiple
  CouchDB servers on the same machine.
adrienverge added a commit to adrienverge/couchdb that referenced this pull request Dec 12, 2019
This is the continuation of commit 649b808 "Allow override of
`-args_file` and `-config` parameters (apache#1095)".

This allows setting the `-couch_ini` files location if needed, using
`COUCHDB_INI_FILES` env var:
- If unset (the default), `-couch_ini` will have an empty list and
  CouchDB will start as usual.
- If set (to a file, or list of files like
  `COUCHDB_INI_FILES=/chroot/etc/couchdb/default.ini
  /chroot/etc/couchdb/default.d ...`) it will allow running CouchDB with
  different settings. A useful case is being able to run multiple
  CouchDB servers on the same machine.
adrienverge added a commit to adrienverge/couchdb that referenced this pull request Dec 12, 2019
This is the continuation of commit 649b808 "Allow override of
`-args_file` and `-config` parameters (apache#1095)".

This allows setting the `-couch_ini` files location if needed, using
`COUCHDB_INI_FILES` env var:
- If unset (the default), `-couch_ini` will have an empty list and
  CouchDB will start as usual.
- If set (to a file, or list of files like
  `COUCHDB_INI_FILES=/chroot/etc/couchdb/default.ini
  /chroot/etc/couchdb/default.d ...`) it will allow running CouchDB with
  different settings. A useful case is being able to run multiple
  CouchDB servers on the same machine.
adrienverge added a commit to adrienverge/couchdb that referenced this pull request Dec 12, 2019
This is the continuation of commit 649b808 "Allow override of
`-args_file` and `-config` parameters (apache#1095)".

This allows setting the `-couch_ini` files location if needed, using
`COUCHDB_INI_FILES` env var:
- If unset (the default), `-couch_ini` will have an empty list and
  CouchDB will start as usual.
- If set (to a file, or list of files like
  `COUCHDB_INI_FILES=/chroot/etc/couchdb/default.ini
  /chroot/etc/couchdb/default.d ...`) it will allow running CouchDB with
  different settings. A useful case is being able to run multiple
  CouchDB servers on the same machine.
adrienverge added a commit to adrienverge/couchdb that referenced this pull request Dec 12, 2019
This is the continuation of commit 649b808 "Allow override of
`-args_file` and `-config` parameters (apache#1095)".

This allows setting the `-couch_ini` files location if needed, using
`COUCHDB_INI_FILES` env var:
- If unset (the default), `-couch_ini` will have an empty list and
  CouchDB will start as usual.
- If set (to a file, or list of files like
  `COUCHDB_INI_FILES=/chroot/etc/couchdb/default.ini
  /chroot/etc/couchdb/default.d ...`) it will allow running CouchDB with
  different settings. A useful case is being able to run multiple
  CouchDB servers on the same machine.
adrienverge added a commit to adrienverge/couchdb that referenced this pull request Dec 12, 2019
This is the continuation of commit 649b808 "Allow override of
`-args_file` and `-config` parameters (apache#1095)".

This allows setting the `-couch_ini` files location if needed, using
`COUCHDB_INI_FILES` env var:
- If unset (the default), `-couch_ini` argument won't be passed.
- If set (to a file, or list of files like
  `COUCHDB_INI_FILES=/chroot/etc/couchdb/default.ini
  /chroot/etc/couchdb/default.d ...`) it will allow running CouchDB with
  different settings. A useful case is being able to run multiple
  CouchDB servers on the same machine.
adrienverge added a commit to adrienverge/couchdb that referenced this pull request Dec 12, 2019
This is the continuation of commit 649b808 "Allow override of
`-args_file` and `-config` parameters (apache#1095)".

This allows setting the `-couch_ini` files location if needed, using
`COUCHDB_INI_FILES` env var:
- If unset (the default), `-couch_ini` argument won't be passed.
- If set (to a file, or list of files like
  `COUCHDB_INI_FILES=/chroot/etc/couchdb/default.ini
  /chroot/etc/couchdb/default.d ...`) it will allow running CouchDB with
  different settings. A useful case is being able to run multiple
  CouchDB servers on the same machine.
adrienverge added a commit to adrienverge/couchdb that referenced this pull request Dec 12, 2019
This is the continuation of commit 649b808 "Allow override of
`-args_file` and `-config` parameters (apache#1095)".

This allows setting the `-couch_ini` files location if needed, using
`COUCHDB_INI_FILES` env var:
- If unset (the default), `-couch_ini` argument won't be passed.
- If set (to a file, or list of files like
  `COUCHDB_INI_FILES=/chroot/etc/couchdb/default.ini
  /chroot/etc/couchdb/default.d ...`) it will allow running CouchDB with
  different settings. A useful case is being able to run multiple
  CouchDB servers on the same machine.
adrienverge added a commit to adrienverge/couchdb that referenced this pull request Dec 12, 2019
This is the continuation of commit 649b808 "Allow override of
`-args_file` and `-config` parameters (apache#1095)".

This allows setting the `-couch_ini` files location if needed, using
`COUCHDB_INI_FILES` env var:
- If unset (the default), `-couch_ini` argument won't be passed.
- If set (to a file, or list of files like
  `COUCHDB_INI_FILES=/chroot/etc/couchdb/default.ini
  /chroot/etc/couchdb/default.d ...`) it will allow running CouchDB with
  different settings. A useful case is being able to run multiple
  CouchDB servers on the same machine.
adrienverge added a commit to adrienverge/couchdb that referenced this pull request Dec 12, 2019
This is the continuation of commit 649b808 "Allow override of
`-args_file` and `-config` parameters (apache#1095)".

This allows setting the `-couch_ini` files location if needed, using
`COUCHDB_INI_FILES` env var:
- If unset (the default), `-couch_ini` argument won't be passed.
- If set (to a file, or list of files like
  `COUCHDB_INI_FILES=/chroot/etc/couchdb/default.ini
  /chroot/etc/couchdb/default.d ...`) it will allow running CouchDB with
  different settings. A useful case is being able to run multiple
  CouchDB servers on the same machine.
adrienverge added a commit to adrienverge/couchdb that referenced this pull request Dec 12, 2019
This is the continuation of commit 649b808 "Allow override of
`-args_file` and `-config` parameters (apache#1095)".

This allows setting the `-couch_ini` files location if needed, using
`COUCHDB_INI_FILES` env var:
- If unset (the default), `-couch_ini` argument won't be passed.
- If set (to a file, or list of files like
  `COUCHDB_INI_FILES=/chroot/etc/couchdb/default.ini
  /chroot/etc/couchdb/default.d ...`) it will allow running CouchDB with
  different settings. A useful case is being able to run multiple
  CouchDB servers on the same machine.
adrienverge added a commit to adrienverge/couchdb that referenced this pull request Dec 13, 2019
This is the continuation of commit 649b808 "Allow override of
`-args_file` and `-config` parameters (apache#1095)".

This allows setting the `-couch_ini` files location if needed, using
`COUCHDB_INI_FILES` env var:
- If unset (the default), `-couch_ini` argument won't be passed.
- If set (to a file, or list of files like
  `COUCHDB_INI_FILES=/chroot/etc/couchdb/default.ini
  /chroot/etc/couchdb/default.d ...`) it will allow running CouchDB with
  different settings. A useful case is being able to run multiple
  CouchDB servers on the same machine.
adrienverge added a commit to adrienverge/couchdb that referenced this pull request Dec 13, 2019
This is the continuation of commit 649b808 "Allow override of
`-args_file` and `-config` parameters (apache#1095)".

This allows setting the `-couch_ini` files location if needed, using
`COUCHDB_INI_FILES` env var:
- If unset (the default), `-couch_ini` argument won't be passed.
- If set (to a file, or list of files like
  `COUCHDB_INI_FILES=/chroot/etc/couchdb/default.ini
  /chroot/etc/couchdb/default.d ...`) it will allow running CouchDB with
  different settings. A useful case is being able to run multiple
  CouchDB servers on the same machine.
adrienverge added a commit to adrienverge/couchdb that referenced this pull request Dec 13, 2019
This is the continuation of commit 649b808 "Allow override of
`-args_file` and `-config` parameters (apache#1095)".

This allows setting the `-couch_ini` files location if needed, using
`COUCHDB_INI_FILES` env var:
- If unset (the default), `-couch_ini` argument won't be passed.
- If set (to a file, or list of files like
  `COUCHDB_INI_FILES=/chroot/etc/couchdb/default.ini
  /chroot/etc/couchdb/default.d ...`) it will allow running CouchDB with
  different settings. A useful case is being able to run multiple
  CouchDB servers on the same machine.
wohali pushed a commit that referenced this pull request Dec 18, 2019
This is the continuation of commit 649b808 "Allow override of
`-args_file` and `-config` parameters (#1095)".

This allows setting the `-couch_ini` files location if needed, using
`COUCHDB_INI_FILES` env var:
- If unset (the default), `-couch_ini` argument won't be passed.
- If set (to a file, or list of files like
  `COUCHDB_INI_FILES=/chroot/etc/couchdb/default.ini
  /chroot/etc/couchdb/default.d ...`) it will allow running CouchDB with
  different settings. A useful case is being able to run multiple
  CouchDB servers on the same machine.
nickva pushed a commit to nickva/couchdb that referenced this pull request Sep 7, 2022
This seems to be a discrepancy from the start, see original pull requests:

* apache#1095 (code)
* apache/couchdb-documentation#227 (docs)

Note also the script seems unhappy with relative paths, so I've also snuck a wording change alongside the main fix here.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants