This file is indexed.

postinst is in activemq 5.13.2+dfsg-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
35
36
37
38
39
40
41
42
43
44
45
#!/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 [ "$1" = "configure" ] || [ "$1" = "abort-upgrade" ]; then
	if [ -x "/etc/init.d/activemq" ]; then
		update-rc.d activemq defaults >/dev/null
	fi
	if [ -x "/etc/init.d/activemq" ] || [ -e "/etc/init/activemq.conf" ]; then
		invoke-rc.d activemq start || exit $?
	fi
fi
# End automatically added section