Bug #11389
openshould not "rm -rf /etc/ceph" when uninstalling ceph-common
0%
Description
we have
%postun -n ceph-common # Package removal cleanup if [ "$1" -eq "0" ] ; then rm -rf /var/log/ceph rm -rf /etc/ceph fi
in our ceph.spec.
which basically nuke user's config file when user "rpm -e ceph-common".
but "rpm -e" should persist this file, per http://www.rpm.org/max-rpm/ch-rpm-erase.html .
Updated by Kefu Chai about 9 years ago
the quoted code was actually added in the fix of #4415.
i am not sure how to fix this without reverting the "rm -rf /etc/ceph" change. because, unlike "apt-get", "rpm" does not have a purge command. so we might want to
- update teuthology to remove the /var/log/ceph and /etc/ceph when removing ceph from the system.
or
- ship an empty ceph.conf in the ceph-common
- mark the ceph.conf as "%config" (N.B, not "%config(noreplace)"), so the empty ceph.conf will overwrite the user-edited one. and the changed ceph.conf will be saved as ceph.conf.rpmsave .
Updated by Sage Weil about 9 years ago
FWIW ceph-deploy has an explicit purgedata that does zap /var/lib/ceph and /etc/ceph. I think teuthology has the same, and if it doesn't, we can add it.
Updated by Ken Dreyer about 9 years ago
I always wondered why Ceph's packages did this? Was it a way of cleaning up during test runs, like a backup for teuthology-nuke's functionality?
We should stop deleting files in /etc
in any case. The ceph.spec file from Fedora/EPEL does not do this.
Updated by Sage Weil about 9 years ago
If it's not hte right thing we should remove it. As I recall we read the docs somewhere that remove was supposed to remove everything, including config files. I guess not? There is probbaly an old thread on ceph-devel about this, but I can't find it. The commit was https://github.com/ceph/ceph/commit/ee178fba4938d9b363a2fc245a06f627c5d104ee