This file is indexed.

postinst is in chef-server-api 10.12.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
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
#!/bin/bash
set -e

. /usr/share/debconf/confmodule
. /etc/default/chef-server

export PATH=$PATH:/sbin:/usr/sbin:/bin:/usr/bin

TEMPLATE=/usr/share/chef-server-api/server.rb
TMPDIR=`mktemp -d` # used for holding temp files
TMPFILE=`mktemp -p ${TMPDIR}` # used for holding rendered template
CONFIGFILE=/etc/chef/server.rb

case "$1" in
  configure)
    db_get chef-solr/amqp_password && amqp_pass="$RET"
    tsed=`mktemp -p ${TMPDIR}`
    cat << EOF > $tsed
s/^amqp_pass \".*\"/amqp_pass \"${amqp_pass}\"/g
EOF
    if [ ! -z "$amqp_pass" ]; then
      sed -f $tsed $TEMPLATE > $TMPFILE
    fi
    ucf --debconf-ok $TMPFILE $CONFIGFILE
    test -f $CONFIGFILE && chmod 0640 $CONFIGFILE
    rm -rf $TMPDIR
    if ! getent passwd chef > /dev/null; then
      adduser --system --quiet \
        --home /var/lib/chef --no-create-home \
        --shell /bin/false --group --gecos "Chef Daemon" chef
    fi
    chown -R $USER:$GROUP /etc/chef
    chown -R $USER:$GROUP /var/lib/chef
    chown -R $USER:$GROUP /var/log/chef
    chown -R $USER:$GROUP /var/cache/chef
    chown -R $USER:$GROUP /var/run/chef
    # Workaround configuration conflict w/ checksum cache and client cleanup
    mkdir -p /var/lib/chef/cookbook_index
    chown -R $USER:$GROUP /var/lib/chef/cookbook_index
    find /var/cache/chef/checksums/ -depth -mindepth 1 -type d -exec mv {} /var/lib/chef/cookbook_index \;
  ;;

  abort-upgrade|abort-remove|abort-deconfigure)
  ;;

  *)
    echo "postinst called with unknown argument \`$1'" >&2
    exit 1
  ;;
esac

db_stop

# dh_installdeb will replace this with shell code automatically
# generated by other debhelper scripts.

# Automatically added by dh_installinit
if [ -x "/etc/init.d/chef-server" ]; then
	update-rc.d chef-server defaults 90 02 >/dev/null
	invoke-rc.d chef-server start || exit $?
fi
# End automatically added section


exit 0