postinst is in zookeeper 3.4.10-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 | #!/bin/sh
set -e
NAME="zookeeper"
GROUP=$NAME
USER=$NAME
DATADIR="/var/lib/zookeeper"
# shamelessly copied from debian mysql-server package...
if ! getent group $GROUP >/dev/null ; then
# Adding system group
addgroup --system $GROUP >/dev/null
fi
# creating zookeeper user if it isn't already there
if ! getent passwd $USER >/dev/null ; then
# Adding system user
adduser \
--system \
--disabled-login \
--ingroup $GROUP \
--home $DATADIR \
--gecos "ZooKeeper" \
--shell /bin/false \
$USER >/dev/null
fi
chown $USER:$GROUP /var/log/$NAME
chown $USER:$GROUP /var/lib/$NAME
chmod o-rwx /var/lib/$NAME
update-alternatives --install /etc/$NAME/conf $NAME-conf /etc/$NAME/conf_example 5
|