postinst is in 389-ds-base 1.3.4.9-1.
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 | #!/bin/sh
set -e
. /usr/share/debconf/confmodule
CONFIG_DIR=/etc/dirsrv
OUT=/dev/null
INSTANCES=`ls -d /etc/dirsrv/slapd-* 2>/dev/null | grep -v removed | sed 's/.*-//'`
if [ "$1" = configure ]; then
# lets give them a user/group in all cases.
if ! getent passwd dirsrv > $OUT; then
adduser --quiet --system --home /var/lib/dirsrv \
--disabled-password --group \
--gecos "389 Directory Server user" \
--no-create-home \
dirsrv > $OUT
fi
chown -R dirsrv:dirsrv /etc/dirsrv/ /var/log/dirsrv/ /var/lib/dirsrv/ > $OUT || true
chmod 750 /etc/dirsrv/ /var/log/dirsrv/ /var/lib/dirsrv/ > $OUT || true
if [ -n "$2" ]; then
for inst in $INSTANCES; do
service dirsrv@inst stop > $OUT 2>&1
done
setup-ds -l $OUT -u -s General.UpdateMode=offline > $OUT 2>&1
# instances are started below
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 [ -z $INSTANCES ]; then
echo "... because no instance has been configured yet."
else
exit 1
fi
}
# Automatically added by dh_systemd_enable
if deb-systemd-helper debian-installed dirsrv-snmp.service; then
# This will only remove masks created by d-s-h on package removal.
deb-systemd-helper unmask dirsrv-snmp.service >/dev/null || true
if deb-systemd-helper --quiet was-enabled dirsrv-snmp.service; then
# Create new symlinks, if any.
deb-systemd-helper enable dirsrv-snmp.service >/dev/null || true
fi
fi
# Update the statefile to add new symlinks (if any), which need to be cleaned
# up on purge. Also remove old symlinks.
deb-systemd-helper update-state dirsrv-snmp.service >/dev/null || true
# End automatically added section
# Automatically added by dh_systemd_start
if [ -d /run/systemd/system ]; then
systemctl --system daemon-reload >/dev/null || true
deb-systemd-invoke start dirsrv-snmp.service dirsrv.target >/dev/null || true
fi
# End automatically added section
|