Hi @ahayes, thanks for this report.

You've made changes to a packaged config file. We very rarely, but 
occasionally, make changes to `local.ini` to change the commented-out defaults 
to their new values, or to add new values to it. This did happen with 2.2.0.

The Debian/Ubuntu warnings on the conffile are part of us adhering to Debian 
policy which [dictates 
](http://www.debian.org/doc/debian-policy/ch-files.html#s-config-files) that 
package upgrades MUST take care of preserving user changes to configuration 
files. We can't simultaneously do that while updating the contents of that file 
with new guidance or recommendations.

You have two options available to you the way things are today:

1. Pass the appropriate option to `dpkg` from `apt` when doing an upgrade, as 
[documented 
here](https://raphaelhertzog.com/2010/09/21/debian-conffile-configuration-file-managed-by-dpkg/).
 In your case, I expect you'd prefer to have our new version installed as 
`local.ini.dpkg-dist`. This can be done with:
```bash
$ apt-get -o Dpkg::Options::"-force-confdef" -o 
Dpkg::Options::"--force-confold" install --only-upgrade couchdb
```
  * The first option tells dpkg to decide on its own whenever possible, 
prompting only when necessary, and overwriting any config files that have not 
been modified.
  * The second option says to not modify the current configuration file if 
changed, and install the new version from tha package with the `.dpkg-dist` 
suffix.
  * I've shown `install --only-upgrade couchdb` to limit this process to just 
the `couchdb` package. If you'd used `dist-upgrade` there, `apt-get` would 
proceed to apply the same approach across all packages, not just `couchdb`. You 
can use this if you want.
2. Another workaround is for you to simply not modify `local.ini`, and instead 
place new files inside of the `local.d` directory named with a `.ini` 
extension. These files are processed after all other files, including 
`local.ini`, [per the order described in the 
documentation](http://docs.couchdb.org/en/stable/config/intro.html#configuration-files).
 In this case, there will never be a change to `local.ini` that will conflict 
with your changes.

I agree with your assessment that we should improve this going forward. 
Ideally, we wouldn't have `default.ini` or `local.ini` files at all, and would 
just use the contents of the `local.d` directory as provided by you, the end 
user. This would be part of a larger config subsystem rewrite that would 
address concerns like #777. I will open a new ticket on the roadmap for this 
(it's been under discussion for a while, but no roadmap ticket exists yet) and 
link back to this one so you can follow its progress in the future.

Thanks again for your interest in Apache CouchDB!

[ Full content available at: https://github.com/apache/couchdb/issues/1594 ]
This message was relayed via gitbox.apache.org for [email protected]

Reply via email to