postinst is in torrus-common 2.08-4.
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 | #!/bin/sh
set -e
configure_user_group() {
# Create the user/group. It only returns non-zero if there is some real
# error, so in that case it's better to bail out anyway.
adduser --quiet --system --no-create-home --home /nonexistent \
--force-badname --group Debian-torrus > /dev/null 2>&1
}
fix_owner_perm() {
chown -R Debian-torrus:Debian-torrus /var/lib/torrus /var/cache/torrus \
/var/log/torrus
chmod g+s /var/lib/torrus/db
chmod g+w /var/lib/torrus/db /var/cache/torrus /var/log/torrus
chmod g+w /var/lib/torrus/session_data/lock /var/lib/torrus/session_data/store
addgroup www-data Debian-torrus > /dev/null 2>&1
}
dpkg-maintscript-helper rm_conffile /etc/logrotate.d/torrus-common 2.01-3 -- "$@"
# Remove torrus-apache2.conf symlink that used to be installed in
# the now dropped package torrus-apache2 ... it has mod_perl configuration
# statements that break apache2 restarts until the configuration has been
# purged (if libapache2-mod-perl has been autoremoved in the meantime)
test -L /etc/apache2/conf.d/torrus-apache2.conf && rm /etc/apache2/conf.d/torrus-apache2.conf
case "$1" in
configure)
configure_user_group
fix_owner_perm
su Debian-torrus -s /bin/sh -c "/usr/bin/db_recover -h /var/lib/torrus/db"
torrus clearcache
;;
abort-upgrade|abort-remove|abort-deconfigure)
;;
*)
echo "${0} called with unknown argument ${1}"
exit 1
;;
esac
# Automatically added by dh_installinit
if [ -x "/etc/init.d/torrus-common" ]; then
update-rc.d torrus-common defaults >/dev/null
fi
if [ -x "/etc/init.d/torrus-common" ] || [ -e "/etc/init/torrus-common.conf" ]; then
invoke-rc.d torrus-common start || exit $?
fi
# End automatically added section
exit 0
|