preinst is in redis-server 2:2.8.4-2.
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 | #!/bin/sh
set -eu
USER="redis"
GROUP="$USER"
HOME="/var/lib/redis"
# If we use NIS then errors should be tolerated.
if which ypwhich >/dev/null 2>&1 && ypwhich >/dev/null 2>&1
then
set +e
fi
if ! getent group $GROUP >/dev/null
then
addgroup --system $GROUP >/dev/null
fi
# creating user if it isn't already there
if ! getent passwd $USER >/dev/null
then
adduser \
--system \
--disabled-login \
--ingroup $GROUP \
--home $HOME \
--gecos "$USER server" \
--shell /bin/false \
$USER >/dev/null
fi
# end of NIS tolerance zone
set -e
|