%PDF- %PDF-
Direktori : /var/lib/dpkg/info/ |
Current File : /var/lib/dpkg/info/libvirt-daemon-system.postrm |
#!/bin/sh # postrm script for libvirt-daemon-system # # see: dh_installdeb(1) set -e # summary of how this script can be called: # * <postrm> `remove' # * <postrm> `purge' # * <old-postrm> `upgrade' <new-version> # * <new-postrm> `failed-upgrade' <old-version> # * <new-postrm> `abort-install' # * <new-postrm> `abort-install' <old-version> # * <new-postrm> `abort-upgrade' <old-version> # * <disappearer's-postrm> `disappear' <overwriter> # <overwriter-version> # for details, see http://www.debian.org/doc/debian-policy/ or # the debian-policy package case "$1" in purge) if getent group libvirtd >/dev/null; then delgroup libvirtd || true fi if getent group libvirt >/dev/null; then delgroup libvirt >/dev/null || true fi if getent group libvirt-qemu >/dev/null; then delgroup libvirt-qemu >/dev/null || true fi if getent passwd libvirt-qemu >/dev/null; then deluser libvirt-qemu >/dev/null || true fi if getent passwd libvirt-dnsmasq >/dev/null; then deluser libvirt-dnsmasq >/dev/null || true fi # a running libvirt-dnsmasq will break these removals # yet the lifecycle of the network is non-related to the pkg purge # Therefore ignore errors on these removals, better leave a user than break if getent group libvirt-dnsmasq >/dev/null; then delgroup libvirt-dnsmasq --system 2>/dev/null >/dev/null || true fi if getent passwd libvirt-dnsmasq >/dev/null; then deluser libvirt-dnsmasq --system 2>/dev/null >/dev/null || true fi # Clean up logs and cached capabilities rm -rf /var/log/libvirt \ /var/cache/libvirt/qemu/capabilities # Clean up created dirs if existend and emtpy, 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/channel \ /var/lib/libvirt/qemu \ /var/cache/libvirt/qemu; do [ ! -d $dir ] || rmdir --ignore-fail-on-non-empty $dir done # Remove the link set up by postinst rm -f /etc/libvirt/qemu/networks/autostart/default.xml ;; remove) if [ -L /etc/dnsmasq.d/libvirt-daemon ]; then echo "Removing libvirt-daemon dnsmasq configuration" rm -f /etc/dnsmasq.d/libvirt-daemon 2>/dev/null || true # Try to restart a potential system wide dnsmasq invoke-rc.d dnsmasq restart 2>/dev/null || true fi ;; upgrade|failed-upgrade|abort-install|abort-upgrade|disappear) ;; *) echo "postrm called with unknown argument \`$1'" >&2 exit 1 ;; esac # dh_installdeb will replace this with shell code automatically # generated by other debhelper scripts. # Automatically added by dh_installinit/11.1.6ubuntu2 if [ "$1" = "purge" ] ; then update-rc.d libvirt-guests remove >/dev/null fi # In case this system is running systemd, we make systemd reload the unit files # to pick up changes. if [ -d /run/systemd/system ] ; then systemctl --system daemon-reload >/dev/null || true fi # End automatically added section # Automatically added by dh_installinit/11.1.6ubuntu2 if [ "$1" = "purge" ] ; then update-rc.d libvirtd remove >/dev/null fi # In case this system is running systemd, we make systemd reload the unit files # to pick up changes. if [ -d /run/systemd/system ] ; then systemctl --system daemon-reload >/dev/null || true fi # End automatically added section # Automatically added by dh_installinit/11.1.6ubuntu2 if [ "$1" = "purge" ] ; then update-rc.d virtlogd remove >/dev/null fi # In case this system is running systemd, we make systemd reload the unit files # to pick up changes. if [ -d /run/systemd/system ] ; then systemctl --system daemon-reload >/dev/null || true fi # End automatically added section # Automatically added by dh_installdeb/11.1.6ubuntu2 dpkg-maintscript-helper rm_conffile /etc/cron.daily/libvirt-daemon-system 3.10.0-1ubuntu1~ -- "$@" # End automatically added section # Automatically added by dh_installdeb/11.1.6ubuntu2 dpkg-maintscript-helper rm_conffile /etc/apparmor.d/local/usr.lib.libvirt.virt-aa-helper 3.5.0-1ubuntu1~ -- "$@" # End automatically added section # Automatically added by dh_installdeb/11.1.6ubuntu2 dpkg-maintscript-helper rm_conffile /etc/apparmor.d/local/usr.sbin.libvirtd 3.5.0-1ubuntu1~ -- "$@" # End automatically added section # Automatically added by dh_installdeb/11.1.6ubuntu2 dpkg-maintscript-helper rm_conffile /etc/init.d/virtlockd 3.5.0-1ubuntu1~ -- "$@" # End automatically added section # Automatically added by dh_installdeb/11.1.6ubuntu2 dpkg-maintscript-helper rm_conffile /etc/apparmor.d/libvirt/TEMPLATE 1.2.7-5~ libvirt-daemon-system -- "$@" # End automatically added section # Automatically added by dh_installdeb/11.1.6ubuntu2 dpkg-maintscript-helper rm_conffile /etc/apparmor.d/libvirt/TEMPLATE 1.2.7-5~ libvirt-bin -- "$@" # End automatically added section # Automatically added by dh_installdeb/11.1.6ubuntu2 dpkg-maintscript-helper rm_conffile /etc/polkit-1/rules.d/60-libvirt.rules 1.2.9-3~ -- "$@" # End automatically added section # Automatically added by dh_installdeb/11.1.6ubuntu2 dpkg-maintscript-helper rm_conffile /etc/apparmor.d/libvirtd/TEMPLATE 1.2.7-5~ libvirt-daemon-system -- "$@" # End automatically added section # Automatically added by dh_installdeb/11.1.6ubuntu2 dpkg-maintscript-helper rm_conffile /etc/apparmor.d/libvirtd/TEMPLATE 1.2.7-5~ libvirt-bin -- "$@" # End automatically added section # Automatically added by dh_installdeb/11.1.6ubuntu2 dpkg-maintscript-helper mv_conffile /etc/init.d/libvirt-bin /etc/init.d/libvirtd 1.2.6-1~ libvirt-bin -- "$@" # End automatically added section # Automatically added by dh_installdeb/11.1.6ubuntu2 dpkg-maintscript-helper mv_conffile /etc/default/libvirt-bin /etc/default/libvirtd 1.2.6-1~ libvirt-bin -- "$@" # End automatically added section # Automatically added by dh_systemd_start/11.1.6ubuntu2 if [ -d /run/systemd/system ]; then systemctl --system daemon-reload >/dev/null || true fi # End automatically added section # Automatically added by dh_systemd_start/11.1.6ubuntu2 if [ -d /run/systemd/system ]; then systemctl --system daemon-reload >/dev/null || true fi # End automatically added section # Automatically added by dh_systemd_enable/11.1.6ubuntu2 if [ "$1" = "remove" ]; then if [ -x "/usr/bin/deb-systemd-helper" ]; then deb-systemd-helper mask 'libvirt-guests.service' 'libvirtd.service' 'virtlockd.service' 'virtlockd.socket' 'virtlogd.service' 'virtlogd.socket' >/dev/null || true fi fi if [ "$1" = "purge" ]; then if [ -x "/usr/bin/deb-systemd-helper" ]; then deb-systemd-helper purge 'libvirt-guests.service' 'libvirtd.service' 'virtlockd.service' 'virtlockd.socket' 'virtlogd.service' 'virtlogd.socket' >/dev/null || true deb-systemd-helper unmask 'libvirt-guests.service' 'libvirtd.service' 'virtlockd.service' 'virtlockd.socket' 'virtlogd.service' 'virtlogd.socket' >/dev/null || true fi fi # End automatically added section # Automatically added by dh_installdebconf/11.1.6ubuntu2 if [ "$1" = purge ] && [ -e /usr/share/debconf/confmodule ]; then . /usr/share/debconf/confmodule db_purge fi # End automatically added section # Automatically added by dh_apparmor/2.12-4ubuntu5.1 if [ "$1" = "purge" ] && ! [ -e "/etc/apparmor.d/usr.sbin.libvirtd" ] ; then rm -f "/etc/apparmor.d/disable/usr.sbin.libvirtd" || true rm -f "/etc/apparmor.d/force-complain/usr.sbin.libvirtd" || true rm -f "/etc/apparmor.d/local/usr.sbin.libvirtd" || true rmdir /etc/apparmor.d/disable 2>/dev/null || true rmdir /etc/apparmor.d/local 2>/dev/null || true rmdir /etc/apparmor.d 2>/dev/null || true fi # End automatically added section # Automatically added by dh_apparmor/2.12-4ubuntu5.1 if [ "$1" = "purge" ] && ! [ -e "/etc/apparmor.d/usr.lib.libvirt.virt-aa-helper" ] ; then rm -f "/etc/apparmor.d/disable/usr.lib.libvirt.virt-aa-helper" || true rm -f "/etc/apparmor.d/force-complain/usr.lib.libvirt.virt-aa-helper" || true rm -f "/etc/apparmor.d/local/usr.lib.libvirt.virt-aa-helper" || true rmdir /etc/apparmor.d/disable 2>/dev/null || true rmdir /etc/apparmor.d/local 2>/dev/null || true rmdir /etc/apparmor.d 2>/dev/null || true fi # End automatically added section exit 0