postinst is in chef 11.8.2-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 | #!/bin/bash
set -e
. /usr/share/debconf/confmodule
export PATH=$PATH:/sbin:/usr/sbin:/bin:/usr/bin
TEMPLATE=/usr/share/chef/client.rb
CONFIGFILE=/etc/chef/client.rb
case "$1" in
configure|reconfigure)
db_get chef/chef_server_url && server_url="$RET"
TMPFILE=`mktemp`
if [ -n "$server_url" ]; then
sed "s#chef_server_url \".*\"#chef_server_url \"$server_url\"#" $TEMPLATE > $TMPFILE
fi
ucf --debconf-ok $TMPFILE $CONFIGFILE
test -f $CONFIGFILE && chmod 0640 $CONFIGFILE
# Workaround configuration conflict w/ checksum cache and client cleanup
mkdir -p /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-client" ] || [ -e "/etc/init/chef-client.conf" ]; then
if [ ! -e "/etc/init/chef-client.conf" ]; then
update-rc.d chef-client defaults 99 02 >/dev/null
fi
invoke-rc.d chef-client start || exit $?
fi
# End automatically added section
exit 0
|