Project

General

Profile

Actions

Bug #11389

open

should not "rm -rf /etc/ceph" when uninstalling ceph-common

Added by Kefu Chai about 9 years ago. Updated over 4 years ago.

Status:
New
Priority:
Normal
Assignee:
-
Category:
-
Target version:
-
% Done:

0%

Source:
Community (dev)
Tags:
Backport:
Regression:
No
Severity:
3 - minor
Reviewed:
Affected Versions:
ceph-qa-suite:
Pull request ID:
Crash signature (v1):
Crash signature (v2):

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 .

Actions #1

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

  1. update teuthology to remove the /var/log/ceph and /etc/ceph when removing ceph from the system.

or

  1. ship an empty ceph.conf in the ceph-common
  2. 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 .
Actions #2

Updated by Kefu Chai about 9 years ago

  • Assignee deleted (Kefu Chai)
Actions #3

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.

Actions #4

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.

Actions #5

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

Actions #6

Updated by Patrick Donnelly over 4 years ago

  • Status changed from 12 to New
Actions

Also available in: Atom PDF