]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
ceph.spec.in: Additional clean-up on package removal
authorGary Lowell <glowell@inktank.com>
Fri, 15 Mar 2013 05:54:05 +0000 (22:54 -0700)
committerSage Weil <sage@inktank.com>
Fri, 15 Mar 2013 23:25:39 +0000 (16:25 -0700)
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>
ceph.spec.in

index 7f9ee6da8c6ae5ae568eba1fdebf0ea306cc2776..30e821e153ed5a1db0afdf2685d2d93130e495eb 100644 (file)
@@ -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