postinst is in activemq 5.5.0+dfsg-6ubuntu1.
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 | #!/bin/sh
set -e
AMQ_HOME=/var/lib/activemq
AMQ_GROUP=activemq
AMQ_USER=activemq
create_group() {
if ! getent group $AMQ_GROUP > /dev/null 2>&1; then
addgroup --system $AMQ_GROUP
fi
}
create_user() {
if ! getent passwd $AMQ_USER > /dev/null 2>&1; then
adduser --system --no-create-home --ingroup $AMQ_GROUP \
--home $AMQ_HOME --shell /bin/bash $AMQ_USER
else
AMQ_HOME=`getent passwd $AMQ_USER | cut -f6 -d:`
# Renable user (give him a shell)
usermod --shell /bin/bash $AMQ_USER
fi
}
if [ "$1" = "configure" ]; then
create_group
create_user
# Use dpkg-statoverride instead of direct chmod/chown
if ! dpkg-statoverride --list $AMQ_HOME >/dev/null 2>&1; then
dpkg-statoverride --update --add $AMQ_USER root 755 $AMQ_HOME
fi
fi
# Automatically added by dh_installinit
if [ -x "/etc/init.d/activemq" ]; then
if [ ! -e "/etc/init/activemq.conf" ]; then
update-rc.d activemq defaults >/dev/null
fi
invoke-rc.d activemq start || exit $?
fi
# End automatically added section
|