diff options
author | Gary Lowell <glowell@inktank.com> | 2013-03-14 22:54:05 -0700 |
---|---|---|
committer | Sage Weil <sage@inktank.com> | 2013-03-15 16:25:39 -0700 |
commit | ee178fba4938d9b363a2fc245a06f627c5d104ee (patch) | |
tree | dce99a6fcd87a29f4a19cdd9564d3dc4bdc26404 /ceph.spec.in | |
parent | 65c31e1b97c51aace2d88530cae1bb2ff40b15f0 (diff) | |
download | ceph-ee178fba4938d9b363a2fc245a06f627c5d104ee.tar.gz |
ceph.spec.in: Additional clean-up on package removal
When removing the last instance of ceph, also remove the files
created by ceph during operation. These consist of the files
under /var/lib/ceph, /etc/ceph, and /var/log/ceph. Bug #4415.
Signed-off-by: Gary Lowell <gary.lowell@inktank.com>
Reviewed-by: Sage Weil <sage@inktank.com>
Diffstat (limited to 'ceph.spec.in')
-rw-r--r-- | ceph.spec.in | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/ceph.spec.in b/ceph.spec.in index 7f9ee6da8c6..30e821e153e 100644 --- a/ceph.spec.in +++ b/ceph.spec.in @@ -346,6 +346,20 @@ fi %restart_on_update ceph %insserv_cleanup %endif +# Package removal cleanup +if [ "$1" -eq "0" ] ; then + + # be a little careful, here: unmount anything beneath here before removing it. + rm -rf --one-file-system -- /var/lib/ceph || true + if [ -d /var/lib/ceph ]; then + find /var/lib/ceph -mindepth 1 -maxdepth 2 -type d -exec umount \{\} \; + fi + rm -rf --one-file-system -- /var/lib/ceph + + # Other Ceph directories + rm -rf /var/log/ceph + rm -rf /etc/ceph +fi ################################################################################# # files |