wohali commented on issue #1594: Ubuntu package local.ini changes cause 
conflict on upgrade
URL: https://github.com/apache/couchdb/issues/1594#issuecomment-418497012
 
 
   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!

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to