postinst is in logcheck 1.3.18.
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 | #!/bin/sh
set -e
# summary of how this script can be called:
# * <postinst> `configure' <most-recently-configured-version>
# * <old-postinst> `abort-upgrade' <new version>
# * <conflictor's-postinst> `abort-remove' `in-favour' <package>
# <new-version>
# * <deconfigured's-postinst> `abort-deconfigure' `in-favour'
# <failed-install-package> <version> `removing'
# <conflicting-package> <version>
# for details, see http://www.debian.org/doc/debian-policy/ or
# the debian-policy package
#
# quoting from the policy:
# Any necessary prompting should almost always be confined to the
# post-installation script, and should be protected with a conditional
# so that unnecessary prompting doesn't happen if a package's
# installation fails and the `postinst' is called with `abort-upgrade',
# `abort-remove' or `abort-deconfigure'.
case "$1" in
configure)
# Add logcheck user
# check for logcheck user or bad version without home
# touch cron job on updating accounts to fix #284788
if ! getent passwd logcheck > /dev/null; then
adduser --quiet --system --home /var/lib/logcheck --no-create-home \
--group logcheck || true
touch /etc/cron.d/logcheck || true
fi
# check for logcheck group in case account exists without group
if ! getent group logcheck >/dev/null; then
addgroup --system logcheck
usermod -g logcheck logcheck
fi
# make sure the home directory exists
if [ ! -d "$(getent passwd logcheck | cut -d: -f6)" ]; then
usermod -d /var/lib/logcheck logcheck > /dev/null || true
fi
# check for logcheck in adm group
if ! getent group adm | grep logcheck > /dev/null; then
adduser --quiet logcheck adm || true
fi
# add logcheck to /etc/aliases on install; not on upgrade
if [ -z "$2" ]; then
if [ -f /etc/aliases ] || [ -L /etc/aliases ]; then
if ! grep -qi "^logcheck[[:space:]]*:" /etc/aliases; then
echo "logcheck: root" >> /etc/aliases
test -x "$(command -v newaliases)" && newaliases || :
fi
fi
fi
# give logcheck system user a real name unless it has one.
if [ -z "$(getent passwd logcheck | cut -d: -f5)" ]; then
chfn -f 'logcheck system account' logcheck
fi
# Add logcheck mail header on install
if [ -z "$2" ] && [ ! -f /etc/logcheck/header.txt ]; then
cp -p /usr/share/logcheck/header.txt /etc/logcheck
fi
# Unconditionalizing this for now as we have files that are
# unreadable upon upgrade. <ttroxell@debian.org>
chgrp -R logcheck /etc/logcheck || true
# Set Permissions on install, not upgrade
if [ -z "$2" ]; then
chmod 2750 /etc/logcheck/ignore.d.paranoid || true
chmod 2750 /etc/logcheck/ignore.d.workstation || true
chmod 2750 /etc/logcheck/ignore.d.server || true
chmod 2750 /etc/logcheck/cracking.d || true
chmod 2750 /etc/logcheck/cracking.ignore.d || true
chmod 2750 /etc/logcheck/violations.d || true
chmod 2750 /etc/logcheck/violations.ignore.d || true
chmod 2750 /etc/logcheck/logcheck.logfiles.d || true
chmod -R g+rX /etc/logcheck || true
fi
chown -R logcheck:logcheck /var/lib/logcheck || true
chmod 0770 /var/lib/logcheck || true
;;
abort-upgrade|abort-remove|abort-deconfigure)
:
;;
*)
echo "postinst called with unknown argument \`$1'" >&2
exit 1
;;
esac
# dh_installdeb will replace this with shell code automatically
# generated by other debhelper scripts.
exit 0
|