postinst is in spread 3.17.4-3.
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 | #! /bin/sh -e
if [ "$1" = "configure" ]; then
addgroup --system spread || {
# addgroup failed. Why?
if ! getent group spread >/dev/null ; then
echo "Could not create system group spread." >&2
if getent group spread >/dev/null ; then
echo "Non-system group spread found. I will not overwrite a non-system" >&2
echo "user. Remove the group and reinstall spread." >&2
fi
exit 1
fi
# well, the group is there, so just ignore the error
}
adduser --system --ingroup spread --home /var/run/spread \
--gecos "Spread system user" --shell /bin/sh \
--disabled-password spread || {
echo "Could not create system user spread." >&2
# adduser failed. Why?
if getent passwd spread >/dev/null ; then
echo "Non-system user spread found. I will not overwrite a non-system" >&2
echo "user. Remove the user and reinstall spread." >&2
exit 1
fi
# unknown adduser error, simply exit
exit 1
}
# Add overrides
if ! dpkg-statoverride --list /etc/spread >/dev/null; then
dpkg-statoverride --update --add spread spread 755 \
/etc/spread
fi
if ! dpkg-statoverride --list /etc/spread/spread.conf >/dev/null; then
dpkg-statoverride --update --add spread spread 644 \
/etc/spread/spread.conf
fi
if ! dpkg-statoverride --list /var/run/spread >/dev/null; then
dpkg-statoverride --update --add spread spread 755 \
/var/run/spread
fi
fi
# Automatically added by dh_installinit
if [ -x "/etc/init.d/spread" ]; then
if [ ! -e "/etc/init/spread.conf" ]; then
update-rc.d spread defaults >/dev/null
fi
invoke-rc.d spread start || exit $?
fi
# End automatically added section
|