-
Notifications
You must be signed in to change notification settings - Fork 29
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
Add extra protection to databases during package purge #52
Conversation
c3b71dd
to
82822ea
Compare
(I haven't ticked any of the checklist because I've genuinely not gotten that far.) |
fi | ||
|
||
pkill -u couchdb >/dev/null 2>&1 || true | ||
db_reset couchdb/mode | ||
db_reset couchdb/nodename | ||
db_reset couchdb/cookie |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
probably unrelated entirely but why do we forcibly reset the debconf settings after purge? I think we should not reset the couchdb/nodename
parameter if we're not purging the databases, but I don't know about the rest.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This sequence of events should be possible, and not result in a surprise:
apt install couchdb
# configure as single node with an admin user for testing, password "admin"
# do some testing, create some DBs
apt purge couch
apt install couchdb
# re-configure couchdb for a cluster with a real admin user/password combo
Have you tried this? I should test it myself before I +1 this.
82822ea
to
2b334ac
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I need to actually test an install/purge/install sequence myself on this branch. Have you done so?
fi | ||
|
||
pkill -u couchdb >/dev/null 2>&1 || true | ||
db_reset couchdb/mode | ||
db_reset couchdb/nodename | ||
db_reset couchdb/cookie |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This sequence of events should be possible, and not result in a surprise:
apt install couchdb
# configure as single node with an admin user for testing, password "admin"
# do some testing, create some DBs
apt purge couch
apt install couchdb
# re-configure couchdb for a cluster with a real admin user/password combo
Have you tried this? I should test it myself before I +1 this.
@rnewson ping, minor comments |
2b334ac
to
7778d76
Compare
Overview
Using
apt-get --purge
removes all CouchDB databases. This is surprising as--purge
isdefined as removing config files. Other database packages (like mysql) have an additional
debconf property for data destruction beyond config files. This PR follows the mysql package
in adding that property and defaulting it to false. This allows a purge with complete data removal if desired.
Testing recommendations
Install CouchDB, create databases, then purge the package. The .couch files should remain
in
/var/lib/couchdb
.GitHub issue number
N/A
Related Pull Requests
N/A
Checklist