preinst is in postfix-cluebringer 2.0.10-1ubuntu1.
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 | #!/bin/sh -e
NAME=cluebringer
LOGFILE="/var/log/cbpolicyd.log"
RUN_DIR="/var/run/cluebringer"
if [ "$2" ]; then
if [ -x "/etc/init.d/postfix-cluebringer" ]; then
if [ -x /usr/sbin/invoke-rc.d ]; then
invoke-rc.d postfix-cluebringer stop || true
else
/etc/init.d/postfix-cluebringer stop || true
fi
fi
fi
case "$1" in
install)
# Check that the system user and group exist, if not create them.
if ! getent group $NAME >/dev/null ; then
echo "Adding system group $NAME ... "
addgroup --system --quiet $NAME || {
if ! getent group $NAME >/dev/null ; then
echo "Could not create system group $NAME." >&2
exit 1;
fi
}
fi
if ! getent passwd $NAME >/dev/null ; then
echo "Adding system user $NAME ... "
adduser --system --home "/etc/$NAME" --ingroup "$NAME" \
--no-create-home --disabled-login --shell "/usr/sbin/nologin" \
--quiet $NAME >/dev/null 2>&1 || {
if ! getent passwd $NAME >/dev/null ; then
echo "Could not create system user $NAME." >&2
exit 1;
fi
}
fi
;;
configure)
;;
upgrade|abort-upgrade)
;;
*)
echo "preinst called with unknown argument $1" >&2
exit 1
;;
esac
exit 0
|