This file is indexed.

postinst is in mcollective-middleware 1.2.1+dfsg-2ubuntu1.

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
#!/bin/sh -e


# We give precedence to activemq config
if hash activemq > /dev/null 2>&1; then
	if [ ! -d /etc/activemq/instances-available/mcollective ]; then
		mkdir -p /etc/activemq/instances-available/mcollective
	fi
	if [ ! -f /etc/activemq/instances-available/mcollective/activemq.xml ]; then
		cp -p /usr/share/doc/mcollective/examples/activemq.xml /etc/activemq/instances-available/mcollective
	fi
	if [ ! -h /etc/activemq/instances-enabled/mcollective ]; then
		ln -sf /etc/activemq/instances-available/mcollective /etc/activemq/instances-enabled/mcollective
	fi
	invoke-rc.d activemq stop || :
	invoke-rc.d activemq start

elif hash rabbitmqctl >/dev/null 2>&1; then
	# Add the 'mcollective' user, with password, 'marionette', if none exists
	if [ "$(rabbitmqctl list_users | grep -c mcollective)" = "0" ]; then
		rabbitmqctl add_user mcollective marionette
		rabbitmqctl set_permissions mcollective \.\* \.\* \.\*
	else
		true
	fi
fi