postrm is in tomcat6 6.0.39-1.
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 | #!/bin/sh
set -e
# Automatically added by dh_installdebconf
if [ "$1" = purge ] && [ -e /usr/share/debconf/confmodule ]; then
. /usr/share/debconf/confmodule
db_purge
fi
# End automatically added section
# Automatically added by dh_installinit
if [ "$1" = "purge" ] ; then
update-rc.d tomcat6 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
CONFFILE=/etc/default/tomcat6
LR_CONFFILE=/etc/logrotate.d/tomcat6
# Remove cached files and auto-generated catalina.policy
rm -rf /var/cache/tomcat6/*
case "$1" in
remove)
# Remove ROOT webapp if not modified
RWLOC="/var/lib/tomcat6/webapps/ROOT"
RWFILES="$RWLOC/index.html $RWLOC/META-INF/context.xml"
if [ "`(cat $RWFILES | md5sum -) 2>/dev/null | cut -d ' ' -f 1`" \
= "c05987dd6c6bcbd651889e9a0ec98ade" ] ; then
rm $RWFILES
rmdir --ignore-fail-on-non-empty \
/var/lib/tomcat6/webapps/ROOT/META-INF \
/var/lib/tomcat6/webapps/ROOT \
/var/lib/tomcat6/webapps \
/var/lib/tomcat6 || true
fi
if [ -d /var/lib/tomcat6/common ] && [ -z "`(find var/lib/tomcat6/common/classes -type f)`" ] ; then
rmdir --ignore-fail-on-non-empty \
/var/lib/tomcat6/common/classes \
/var/lib/tomcat6/common || true
fi
if [ -d /var/lib/tomcat6/server ] && [ -z "`(find var/lib/tomcat6/server/classes -type f)`" ] ; then
rmdir --ignore-fail-on-non-empty \
/var/lib/tomcat6/server/classes \
/var/lib/tomcat6/server || true
fi
if [ -d /var/lib/tomcat6/shared ] && [ -z "`(find var/lib/tomcat6/shared/classes -type f)`" ] ; then
rmdir --ignore-fail-on-non-empty \
/var/lib/tomcat6/shared/classes \
/var/lib/tomcat6/shared || true
fi
if [ -d "/var/cache/tomcat6" ] ; then
rm -rf /var/cache/tomcat6
fi
;;
purge)
# ignore errors during purge
set +e
if [ -x "/usr/bin/ucf" ]; then
ucf --purge $CONFFILE
ucf --purge $LR_CONFFILE
fi
rm -rf /var/log/tomcat6 /var/lib/tomcat6/temp $CONFFILE $LR_CONFFILE
if [ -d "/var/lib/tomcat6" ] ; then
rmdir --ignore-fail-on-non-empty /var/lib/tomcat6
fi
rmdir --ignore-fail-on-non-empty /etc/tomcat6/policy.d \
/etc/tomcat6/Catalina/localhost /etc/tomcat6/Catalina /etc/tomcat6
# clean up /etc/authbind after conffiles have been removed
rmdir --ignore-fail-on-non-empty /etc/authbind/byuid /etc/authbind
# Put all files owned by group tomcat6 back into root group before deleting
# the tomcat6 user and group
chown -Rhf root:root /etc/tomcat6/ || true
# Remove user/group and log files (don't remove everything under
# /var/lib/tomcat6 because there might be user-installed webapps)
db_get tomcat6/username && TOMCAT6_USER="$RET" || TOMCAT6_USER="tomcat6"
db_get tomcat6/groupname && TOMCAT6_GROUP="$RET" || TOMCAT6_GROUP="tomcat6"
deluser $TOMCAT6_USER
delgroup $TOMCAT6_GROUP
set -e
;;
upgrade|failed-upgrade|abort-install|abort-upgrade|disappear)
# Nothing to do here
;;
*)
echo "$0 called with unknown argument \`$1'" >&2
exit 1
;;
esac
|