prerm is in root-system-rootd 5.34.30-0ubuntu8.
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 | #! /bin/sh
# prerm script for root-rootd
#
# see: dh_installdeb(1)
# Do not set - If we cannot remove the rootd user, it is OK
set -e
# dh_installdeb will replace this with shell code automatically
# generated by other debhelper scripts.
# Automatically added by dh_installinit
if [ -x "/etc/init.d/root-system-rootd" ] || [ -e "/etc/init/root-system-rootd.conf" ]; then
invoke-rc.d root-system-rootd stop || exit $?
fi
# End automatically added section
case "$1" in
remove)
if grep ^rootd /etc/inetd.conf > /dev/null 2>&1 ; then
update-inetd --remove rootd
fi
# Remove the rootd user and group
# Taken from mysql-server package and modified for ROOT
# rm -rf /var/spool/rootd
if getent passwd rootd > /dev/null; then
deluser rootd
reason=$?
if [ $reason -ne 0 ] ; then
# Could not remove user. Ignore.
echo "Couldn't remove user rootd, check it. Reason"
case $reason in
1) echo "can't update password file" ;;
2) echo "bad command syntax" ;;
6) echo "specified user doesn't exist" ;;
8) echo "user currently logged in" ;;
10) echo "can't update group file" ;;
12) echo "can't remove home directory" ;;
*) echo "Unrecognized exit code $reason" ;;
esac
fi
fi
;;
upgrade|deconfigure)
# Nothing to be done here
;;
failed-upgrade)
;;
*)
echo "prerm called with unknown argument \`$1'" >&2
exit 0
;;
esac
# Now we set fail-on-sub-error so that the debhelper stuff is done correctly.
# set -e
exit 0
|