This file is indexed.

postinst is in groonga-server-common 8.0.0-1.

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

set -e

add_system_user() {
    if ! getent passwd groonga >/dev/null; then
        adduser --group --system --home /var/lib/groonga groonga
    fi
}

fixperms() {
    for target in /var/run/groonga /var/lib/groonga /var/log/groonga
    do
        dpkg-statoverride --list $target >/dev/null || \
            dpkg-statoverride --update --add groonga groonga 0755 $target
    done
}

create_database() {
    if [ ! -d /var/lib/groonga/db ]; then
        mkdir -p /var/lib/groonga/db
        groonga -n /var/lib/groonga/db/db shutdown > /dev/null
        chown -R groonga:groonga /var/lib/groonga
    fi
}

case "$1" in
    configure)
        add_system_user
        create_database
        fixperms
        ;;
    abort-upgrade|abort-deconfigure|abort-remove)
        :
        ;;
    *)
        echo "Called with unknown argument $1, bailing out."
        exit 1
        ;;
esac