postinst is in pki-server 10.6.0-1ubuntu2.
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 | #!/bin/sh
set -e
OUT=/dev/null
VERSION=`dpkg-query -W pki-server | sed 's/.*\t//;s/-.*//;s/+git.*//;s/+[0-9][0-9]//'`
if [ "$1" = configure ]; then
# lets give them a user/group in all cases.
if ! getent passwd pkiuser > $OUT; then
adduser --quiet --system --home /var/lib/pki \
--shell /usr/sbin/nologin --group \
--no-create-home --gecos "CA System User" \
pkiuser > $OUT
fi
if [ -n "$2" ]; then
echo "Upgrading server at `date`." >> /var/log/pki/pki-server-upgrade-$VERSION.log 2>&1
pki-server-upgrade --silent >> /var/log/pki/pki-server-upgrade-$VERSION.log 2>&1
echo >> /var/log/pki/pki-server-upgrade-$VERSION.log 2>&1
# Migrate Tomcat configuration
pki-server migrate --tomcat 8 >> /var/log/pki/pki-server-upgrade-$VERSION.log 2>&1
echo >> /var/log/pki/pki-server-upgrade-$VERSION.log 2>&1
fi
fi
invoke_failure() {
# invoke-rc.d failed, likely because no instance has been configured yet
# but exit with an error if an instance is configured and the invoke failed
if [ ! -d /etc/pki/pki-tomcat ]; then
echo "pki-tomcatd start failed because no instance has been configured yet"
else
exit 1
fi
}
# Automatically added by dh_python2:
if which pycompile >/dev/null 2>&1; then
pycompile -p pki-server
fi
# End automatically added section
# Automatically added by dh_systemd_start/11.1.6ubuntu1
if [ "$1" = "configure" ] || [ "$1" = "abort-upgrade" ] || [ "$1" = "abort-deconfigure" ] || [ "$1" = "abort-remove" ] ; then
if [ -d /run/systemd/system ]; then
systemctl --system daemon-reload >/dev/null || true
deb-systemd-invoke start 'pki-tomcatd-nuxwdog.target' >/dev/null || true
fi
fi
# End automatically added section
# Automatically added by dh_installinit/11.1.6ubuntu1
if [ "$1" = "configure" ] || [ "$1" = "abort-upgrade" ] || [ "$1" = "abort-deconfigure" ] || [ "$1" = "abort-remove" ] ; then
if [ -x "/etc/init.d/pki-tomcatd" ]; then
update-rc.d pki-tomcatd defaults >/dev/null
invoke-rc.d pki-tomcatd start || invoke_failure
fi
fi
# End automatically added section
|