This file is indexed.

postinst is in couchdb 1.6.0-0ubuntu7.

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

# Copyright 2009, Noah Slater <nslater@tumbolia.org>

# Copying and distribution of this file, with or without modification, are
# permitted in any medium without royalty provided the copyright notice and this
# notice are preserved.

case $1 in
    configure)
        if ! getent passwd couchdb > /dev/null; then
            adduser --system --quiet \
                --home /var/lib/couchdb --no-create-home \
                --shell /bin/bash --group --gecos "CouchDB Administrator" couchdb
        fi
        if test "`id -u couchdb`" -eq 0; then
            echo "The couchdb administrative user must not be root." >&2
            false
        fi
        if test "`id -g couchdb`" -eq 0; then
            echo "The couchdb administrative group must not be root." >&2
            false
        fi
        # These should not be world readable:
        chmod 0640 /etc/couchdb/local.ini
        chmod 0750 /etc/couchdb/local.d
        chmod 0750 /var/lib/couchdb
        chmod 0750 /var/log/couchdb
        # And should be owned by the couchdb user and group:
        chown couchdb:couchdb /etc/couchdb/local.ini
        chown -R couchdb:couchdb /etc/couchdb/local.d
        chown -R couchdb:couchdb /var/lib/couchdb
        chown -R couchdb:couchdb /var/log/couchdb
        ;;
esac

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

# was-enabled defaults to true, so new installations run enable.
if deb-systemd-helper --quiet was-enabled couchdb.service; then
	# Enables the unit on first installation, creates new
	# symlinks on upgrades if the unit file has changed.
	deb-systemd-helper enable couchdb.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 couchdb.service >/dev/null || true
fi
# End automatically added section
# Automatically added by dh_installinit
if [ -x "/etc/init.d/couchdb" ]; then
	update-rc.d couchdb defaults >/dev/null
fi
if [ -x "/etc/init.d/couchdb" ] || [ -e "/etc/init/couchdb.conf" ]; then
	invoke-rc.d couchdb start || exit $?
fi
# End automatically added section