postinst 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 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
case "$1" in
configure)
# Install user rootd for anonymous file access in /var/spool/rootd
# directory.
# The lines below are taken from the mysql-server package, and
# modified to reflects the needs of rootd.
# Make sure we can add a user properly
if [ ! -x "`which adduser`" ]; then
echo "I need adduser(8) from the adduser package !";
exit 1;
fi
if [ ! -x "`which addgroup`" ]; then
echo "I need addgroup(8) from the adduser package !";
exit 1;
fi
if [ ! -x "`which usermod`" ]; then
echo "I need usermod(8) from the passwd package !";
exit 1;
fi
# Now we have to ensure the following state:
# /etc/passwd: rootd:x:Anonymous rootd:/var/spool/rootd:/bin/false
# /etc/group: rootd:x:72:rootd
if ! getent group rootd > /dev/null; then
addgroup --system rootd
fi
if ! getent passwd rootd > /dev/null; then
#echo Adding system user: rootd.
adduser \
--system \
--disabled-login \
--ingroup rootd \
--gecos "Anonymous rootd" \
--shell /bin/false \
--home /var/spool/rootd \
rootd >/dev/null
fi
chown rootd:rootd /var/spool/rootd
# modifying the user
# usermod -c "Anonymous rootd" rootd > /dev/null
# usermod -d "/var/spool/rootd" rootd > /dev/null
# usermod -g "rootd" rootd > /dev/null
# usermod -s "/bin/false" rootd > /dev/null
# Since the home directory was created before putting the user
# into the rootd group and moreover we cannot guarantee that
# the permissions were correctly *before* calling this script,
# we fix them now.
#echo
#echo "SECURITY: Fixing permission of /var/spool/rootd !"
#echo "(I.e. replacing GIDs other than root and rootd with rootd.)"
#echo
find /var/spool/rootd \
-not \( -group root -or -group rootd \) \
-exec chgrp rootd {} \;
# Make tmp and pub directories in /var/spool/rootd
# world read- and writable.
if [ -d /var/spool/rootd/tmp ] ; then
chmod 1777 /var/spool/rootd/tmp
fi
if [ -d /var/spool/rootd/pub ] ; then
chmod 1777 /var/spool/rootd/pub
fi
# Nothing to be done here
# if [ "$1" = "upgrade" ]
# then
# start-stop-daemon --stop --quiet --oknodo \
# --pidfile /var/run/root.pid \
# --exec @prefix@/sbin/root 2>/dev/null || true
# fi
;;
*)
echo "postinst called with unknown argument \`$1'" >&2
exit 0
;;
esac
# dh_installdeb will replace this with shell code automatically
# generated by other debhelper scripts.
# Automatically added by dh_installinit
if [ "$1" = "configure" ] || [ "$1" = "abort-upgrade" ]; then
if [ -x "/etc/init.d/root-system-rootd" ]; then
update-rc.d root-system-rootd defaults >/dev/null
fi
if [ -x "/etc/init.d/root-system-rootd" ] || [ -e "/etc/init/root-system-rootd.conf" ]; then
invoke-rc.d root-system-rootd start || exit $?
fi
fi
# End automatically added section
|