This file is indexed.

postinst is in 389-ds-base 1.3.2.16-0ubuntu1.

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

. /usr/share/debconf/confmodule

CONFIG_DIR=/etc/dirsrv
OUT=/dev/null

if [ "$1" = configure ]; then
    # lets give them a user/group in all cases.
    if ! getent passwd dirsrv > $OUT; then
	adduser --quiet --system --home /var/lib/dirsrv \
	    --disabled-password --group \
	    --gecos "389 Directory Server user" \
	    dirsrv > $OUT
    fi

    chown -R dirsrv:dirsrv /etc/dirsrv/ /var/log/dirsrv/ /var/lib/dirsrv/ > $OUT || true
    chmod 750 /etc/dirsrv/ /var/log/dirsrv/ /var/lib/dirsrv/ > $OUT || true

    if [ -n "$2" ]; then
        service dirsrv stop > $OUT 2>&1
        setup-ds -l $OUT -u -s General.UpdateMode=offline > $OUT 2>&1
        # instances are started below
    fi
fi

invoke_failure() {
    # invoke-rc.d failed, likely because no instance has been configured yet
    # but exit with an error if an instance is configured and the invoke failed
    INSTANCES=`ls -d /etc/dirsrv/slapd-* | grep -v removed`
    if [ -z $INSTANCES ]; then
        echo "... because no instance has been configured yet."
    else
	exit 1
    fi
}


# Automatically added by dh_installinit
if [ -x "/etc/init.d/dirsrv" ] || [ -e "/etc/init/dirsrv.conf" ]; then
	if [ ! -e "/etc/init/dirsrv.conf" ]; then
		update-rc.d dirsrv defaults 15 85 >/dev/null
	fi
	invoke-rc.d dirsrv start || invoke_failure
fi
# End automatically added section
# Automatically added by dh_makeshlibs
if [ "$1" = "configure" ]; then
	ldconfig
fi
# End automatically added section