postinst is in openafs-client 1.8.0~pre5-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 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 | #! /bin/sh
set -e
# Load debconf.
. /usr/share/debconf/confmodule
db_version 2.0
# Create the standard AFS mount point if it doesn't exist.
test -d /afs || mkdir /afs
# Configure alternatives for pagsh and klog.
update-alternatives --install /usr/bin/pagsh pagsh \
/usr/bin/pagsh.openafs 100 \
--slave /usr/share/man/man1/pagsh.1.gz pagsh.1.gz \
/usr/share/man/man1/pagsh.openafs.1.gz
# Set the local cell. If ThisCell already exists, the config script will have
# set the debconf database parameter accordingly.
db_get openafs-client/thiscell
THISCELL="$RET"
if [ -n "$THISCELL" ] ; then
echo "$THISCELL" > /etc/openafs/ThisCell
fi
# On initial installation, or when afsdb is not configured, ensure that we
# have a CellServDB file.
db_get openafs-client/afsdb
afsdb="$RET"
if [ "$afsdb" = 'false' ] || { [ "$1" = 'configure' ] && [ -z "$2" ] ; } ; then
if [ ! -f /etc/openafs/CellServDB ] ; then
cp /usr/share/openafs/CellServDB /etc/openafs
fi
fi
# If ThisCell is not in CellServDB and the user is not using afsdb, we want to
# prompt the user for the VLDB servers. Unfortunately, we can't do this in
# config because we need the CellServDB file, which is part of the package.
havecell=
if [ -n "$THISCELL" ] ; then
if grep -qF "$THISCELL" /etc/openafs/CellServDB 2>/dev/null ; then
havecell=true
fi
fi
if [ "$afsdb" = 'false' ] && [ -z "$havecell" ] ; then
db_input critical openafs-client/cell-info || true
db_input high openafs-client/run-client || true
db_go
db_get openafs-client/cell-info
if [ "x$RET" != "x" ] ; then
echo ">$THISCELL" > /etc/openafs/CellServDB.new
perl -MSocket -e 'foreach (@ARGV) {' \
-e '@a=gethostbyname($_) and ' \
-e 'printf("%s\t\t# %s\n",inet_ntoa($a[4]),$a[0]) }' $RET \
>>/etc/openafs/CellServDB.new
if [ `wc -l </etc/openafs/CellServDB.new` -eq 1 ] ; then
echo 'None of the hostnames resolved to an address' 2>&1
db_reset openafs-client/cell-info || true
rm /etc/openafs/CellServDB.new
else
cat /etc/openafs/CellServDB.new /etc/openafs/CellServDB \
> /etc/openafs/CellServDB.tmp
mv /etc/openafs/CellServDB.tmp /etc/openafs/CellServDB
rm /etc/openafs/CellServDB.new
fi
fi
fi
# Our config script will have already taken care of extracting the cache size
# from the cacheinfo file and using it as the default for the debconf prompt,
# but the mount point and cache directory have no debconf prompts. For those,
# we need to get the default from the file.
mountpoint=/afs
cachedir=/var/cache/openafs
if [ -r /etc/openafs/cacheinfo ] ; then
IFS=: read mountpoint cachedir cachesize < /etc/openafs/cacheinfo
fi
db_get openafs-client/cachesize
echo "${mountpoint}:${cachedir}:${RET}" > /etc/openafs/cacheinfo
# Create the /etc/openafs/afs.conf.client configuration file, which stores
# most of the debconf results.
echo <<'EOF' > /etc/openafs/afs.conf.client
# This file is managed by debconf. You may change the parameters set below,
# but any additional lines or comments will be lost when the package is
# upgraded or reconfigured. Local modifications other than setting the
# following parameters should be made in /etc/openafs/afs.conf instead.
EOF
db_get openafs-client/run-client
echo AFS_CLIENT="$RET" > /etc/openafs/afs.conf.client
echo AFS_AFSDB="$afsdb" >> /etc/openafs/afs.conf.client
db_get openafs-client/crypt
echo AFS_CRYPT="$RET" >> /etc/openafs/afs.conf.client
db_get openafs-client/dynroot
echo AFS_DYNROOT="$RET" >> /etc/openafs/afs.conf.client
db_get openafs-client/fakestat
echo AFS_FAKESTAT="$RET" >> /etc/openafs/afs.conf.client
# Prepopulate the systemd EnvironmentFile
/usr/share/openafs/openafs-client-precheck
# Automatically added by dh_systemd_enable/11.1.4ubuntu1
if [ "$1" = "configure" ] || [ "$1" = "abort-upgrade" ] || [ "$1" = "abort-deconfigure" ] || [ "$1" = "abort-remove" ] ; then
# This will only remove masks created by d-s-h on package removal.
deb-systemd-helper unmask 'openafs-client.service' >/dev/null || true
# was-enabled defaults to true, so new installations run enable.
if deb-systemd-helper --quiet was-enabled 'openafs-client.service'; then
# Enables the unit on first installation, creates new
# symlinks on upgrades if the unit file has changed.
deb-systemd-helper enable 'openafs-client.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 'openafs-client.service' >/dev/null || true
fi
fi
# End automatically added section
# Automatically added by dh_installinit/11.1.4ubuntu1
if [ "$1" = "configure" ] || [ "$1" = "abort-upgrade" ] || [ "$1" = "abort-deconfigure" ] || [ "$1" = "abort-remove" ] ; then
if [ -x "/etc/init.d/openafs-client" ]; then
update-rc.d openafs-client defaults >/dev/null
invoke-rc.d openafs-client start || exit 1
fi
fi
# End automatically added section
exit 0
|