This file is indexed.

postinst is in munin-async 2.0.25-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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
#! /bin/sh

set -e

prevver="$2"

add_munin_async_user() {
	if ! getent passwd munin-async >/dev/null; then
		adduser --group --system --home /var/lib/munin-async --shell /bin/bash munin-async
	fi
	# workaround bug (#531021) in xen-tools
	if ! getent group munin-async >/dev/null; then
		addgroup --system munin-async
		adduser --shell /bin/bash munin-async
	fi
}

initperms() {
	chown munin-async:munin-async /var/lib/munin-async
}

# Remove a no-longer used conffile.  From
# http://wiki.debian.org/DpkgConffileHandling
rm_conffile() {
    PKGNAME="$1"
    CONFFILE="$2"

    [ -e "$CONFFILE" ] || return 0

    md5sum="$(md5sum $CONFFILE | sed -e 's/ .*//')"
    old_md5sum="$(dpkg-query -W -f='${Conffiles}' $PKGNAME | \
            sed -n -e "\' $CONFFILE ' { s/ obsolete$//; s/.* //; p }")"
    if [ "$md5sum" != "$old_md5sum" ]; then
        echo "Obsolete conffile $CONFFILE has been modified by you." 1>&2
        echo "Saving as $CONFFILE.dpkg-bak ..." 1>&2
        mv -f "$CONFFILE" "$CONFFILE".dpkg-bak
    else
        echo "Removing obsolete conffile $CONFFILE ..." 1>&2
        rm -f "$CONFFILE"
    fi
}




case "$1" in
	configure)
		add_munin_async_user
		# after wheezy / squeeze-sloppy-backports just test for [ "$2" = 0 ]
		if dpkg --compare-versions "$2" le "2.0.6-1~" ; then
			initperms
		fi
                # cleanup to fix #717260
                if dpkg --compare-versions "$2" le "2.0.16-4"; then
                        rm_conffile munin-async /etc/logrotate.d/munin-async
                fi
		;;
	abort-upgrade|abort-deconfigure|abort-remove)
		:
		;;
	*)
		echo "Called with unknown argument $1, bailing out."
		exit 1
		;;
esac

# Automatically added by dh_systemd_enable
# This will only remove masks created by d-s-h on package removal.
deb-systemd-helper unmask munin-async.service >/dev/null || true

# was-enabled defaults to true, so new installations run enable.
if deb-systemd-helper --quiet was-enabled munin-async.service; then
	# Enables the unit on first installation, creates new
	# symlinks on upgrades if the unit file has changed.
	deb-systemd-helper enable munin-async.service >/dev/null || true
else
	# Update the statefile to add new symlinks (if any), which need to be
	# cleaned up on purge. Also remove old symlinks.
	deb-systemd-helper update-state munin-async.service >/dev/null || true
fi
# End automatically added section
# Automatically added by dh_installinit
if [ -x "/etc/init.d/munin-async" ]; then
	update-rc.d munin-async defaults >/dev/null
fi
if [ -x "/etc/init.d/munin-async" ] || [ -e "/etc/init/munin-async.conf" ]; then
	invoke-rc.d munin-async start || exit $?
fi
# End automatically added section