This file is indexed.

postrm is in libvirt-daemon-system 4.0.0-1ubuntu8.

This file is a maintainer script. It is executed when installing (*inst) or removing (*rm) the package.

The actual contents of the file can be viewed below.

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
#!/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.6ubuntu1
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.6ubuntu1
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.6ubuntu1
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.6ubuntu1
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.6ubuntu1
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.6ubuntu1
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.6ubuntu1
dpkg-maintscript-helper rm_conffile /etc/init.d/virtlockd 3.5.0-1ubuntu1~ -- "$@"
# End automatically added section
# Automatically added by dh_installdeb/11.1.6ubuntu1
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.6ubuntu1
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.6ubuntu1
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.6ubuntu1
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.6ubuntu1
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.6ubuntu1
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.6ubuntu1
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.6ubuntu1
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.6ubuntu1
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.6ubuntu1
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.6ubuntu1
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
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
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