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>
%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