#!/bin/sh set -e # summary of how this script can be called: # # * `remove' # * `purge' # * `upgrade' # * `disappear' # * `failed-upgrade' # * `abort-install' # * `abort-install' # * `abort-upgrade' # # for details, see https://www.debian.org/doc/debian-policy/ or # the debian-policy package case "$1" in remove) # Trigger daemon restart after removing a driver dpkg-trigger libvirt-restart-libvirtd ;; purge) if getent passwd libvirt-qemu >/dev/null; then deluser libvirt-qemu >/dev/null || true fi if getent group libvirt-qemu >/dev/null; then delgroup libvirt-qemu >/dev/null || true fi # Clean up cached capabilities rm -rf /var/cache/libvirt/qemu/capabilities # Clean up obsolete runtime data rm -rf /var/lib/libvirt/qemu/channel/target/domain-* if [ -d /var/lib/libvirt/qemu/channel/target ]; then rmdir --ignore-fail-on-non-empty /var/lib/libvirt/qemu/channel/target fi if [ -d /var/lib/libvirt/qemu/channel ]; then rmdir --ignore-fail-on-non-empty /var/lib/libvirt/qemu/channel fi # Clean up created dirs if existent and empty, they contain precious # data otherwise for dir in /var/lib/libvirt/qemu/save \ /var/lib/libvirt/qemu/snapshot \ /var/lib/libvirt/qemu/dump \ /var/lib/libvirt/qemu/nvram \ /var/lib/libvirt/qemu/ram/libvirt/qemu \ /var/lib/libvirt/qemu/ram/libvirt \ /var/lib/libvirt/qemu/ram \ /var/lib/libvirt/qemu \ /var/cache/libvirt/qemu; do [ ! -d $dir ] || rmdir --ignore-fail-on-non-empty $dir done # Obsolete AppArmor stuff included until 9.6.0-1 ABSTRACTIONS_DIR="/etc/apparmor.d/abstractions" LOCAL_ABSTRACTIONS_DIR="/etc/apparmor.d/local/abstractions" name="libvirt-qemu" abstraction="$ABSTRACTIONS_DIR/$name" local_abstraction="$LOCAL_ABSTRACTIONS_DIR/$name" if [ ! -e "$abstraction" ]; then rm -f "$local_abstraction" if [ -d "$LOCAL_ABSTRACTIONS_DIR" ]; then rmdir --ignore-fail-on-non-empty "$LOCAL_ABSTRACTIONS_DIR" fi fi ;; upgrade|disappear|failed-upgrade|abort-install|abort-upgrade) ;; *) echo "postrm called with unknown argument \`$1'" >&2 exit 1 ;; esac # Automatically added by dh_installdeb/13.24.2 dpkg-maintscript-helper dir_to_symlink /usr/share/doc/libvirt-daemon-driver-qemu libvirt-common 10.6.0-2\~ -- "$@" # End automatically added section # Automatically added by dh_installdebconf/13.24.2 if [ "$1" = purge ] && [ -e /usr/share/debconf/confmodule ]; then . /usr/share/debconf/confmodule db_purge fi # End automatically added section exit 0