* General improvements to debconf configuration handling.
- Do not abort the config script if we have no default realm and
dnsdomainname fails. (LP: #274886, #318132)
- Do not abort postinst if we can't resolve any host name for the
cell. Just continue in that case, omitting any configuration for
the local cell. (LP: #322054)
- Correctly set the default for AFS_CRYPT from the existing config.
- The cache size is high, not critical, since we have a default.
- Don't create the client ThisCell if no local cell was specified.
- Improve the leading comment in afs.conf.client. Users can edit it,
but any changes other than the setting values will be lost.
- Remove the openafs-fileserver/bosconfig_moved template, which would
only be shown on upgrades from pre-1.2.0 versions.
- Standardize coding style and always quote strings.
Kaseorg and Lutz Goehring for suggestions. (LP: #295897)
* Allow time-daemon to satisfy the openafs-fileserver recommends in
addition to ntp, allowing for openntpd. (Closes: #508258)
+ * General improvements to debconf configuration handling.
+ - Do not abort the config script if we have no default realm and
+ dnsdomainname fails. (LP: #274886, #318132)
+ - Do not abort postinst if we can't resolve any host name for the
+ cell. Just continue in that case, omitting any configuration for
+ the local cell. (LP: #322054)
+ - Correctly set the default for AFS_CRYPT from the existing config.
+ - The cache size is high, not critical, since we have a default.
+ - Don't create the client ThisCell if no local cell was specified.
+ - Improve the leading comment in afs.conf.client. Users can edit it,
+ but any changes other than the setting values will be lost.
+ - Remove the openafs-fileserver/bosconfig_moved template, which would
+ only be shown on upgrades from pre-1.2.0 versions.
+ - Standardize coding style and always quote strings.
* Update to debhelper compatibility level V7.
- Use dh where possible in debian/rules.
- Use dh_lintian to install Lintian overrides.
. /usr/share/debconf/confmodule
db_version 2.0
+
+# Configure the client cell. Default to the current ThisCell file and,
+# failing that, the lowercased local domain name, if available. Ignore errors
+# on read, since it may fail if there's no newline in the file.
if [ -r /etc/openafs/ThisCell ] ; then
- read cell </etc/openafs/ThisCell
- db_set openafs-client/thiscell $cell
- fi
+ read cell < /etc/openafs/ThisCell
+ db_set openafs-client/thiscell "$cell"
+fi
db_get openafs-client/thiscell || true
if [ "x$RET" = "x" ] ; then
- db_set openafs-client/thiscell `dnsdomainname | tr 'A-Z' 'a-z'`
- fi
-if [ -r /etc/openafs/cacheinfo ] ; then
- IFS=: read mountpoint cachedir cachesize </etc/openafs/cacheinfo
- db_set openafs-client/cachesize $cachesize
+ domain=`dnsdomainname 2>/dev/null || true`
+ if [ -n "$domain" ] ; then
+ db_set openafs-client/thiscell `echo "$domain" | tr 'A-Z' 'a-z'`
fi
-db_input high openafs-client/thiscell ||true
-db_input critical openafs-client/cachesize ||true
+fi
+db_input high openafs-client/thiscell || true
+
+# Configure the cache size. Default to the current value in the cacheinfo
+# configuration file.
+if [ -r /etc/openafs/cacheinfo ] ; then
+ IFS=: read mountpoint cachedir cachesize < /etc/openafs/cacheinfo
+ db_set openafs-client/cachesize "$cachesize"
+fi
+db_input high openafs-client/cachesize || true
db_go
-test -f /etc/openafs/afs.conf &&. /etc/openafs/afs.conf
+
+# Configure the AFS client parameters set in /etc/openafs/afs.conf, taking
+# defaults from the current file.
+test -f /etc/openafs/afs.conf && . /etc/openafs/afs.conf
if [ "x$AFS_CLIENT" != "x" ] ; then
- db_set openafs-client/run-client $AFS_CLIENT
- fi
+ db_set openafs-client/run-client "$AFS_CLIENT"
+fi
db_input low openafs-client/run-client || true
-if [ "x$AFS_AFSDB" != "x" ] ;then
- db_set openafs-client/afsdb $AFS_AFSDB
- fi
+if [ "x$AFS_AFSDB" != "x" ] ; then
+ db_set openafs-client/afsdb "$AFS_AFSDB"
+fi
+if [ "x$AFS_CRYPT" != "x" ] ; then
+ db_set openafs-client/crypt "$AFS_CRYPT"
+fi
if [ "x$AFS_DYNROOT" != "x" ] ; then
- db_set openafs-client/dynroot $AFS_DYNROOT
- fi
-if [ x$AFS_FAKESTAT != "x" ] ; then
- db_set openafs-client/fakestat $AFS_FAKESTAT
+ db_set openafs-client/dynroot "$AFS_DYNROOT"
+fi
+if [ "x$AFS_FAKESTAT" != "x" ] ; then
+ db_set openafs-client/fakestat "$AFS_FAKESTAT"
fi
-
db_beginblock
-db_input low openafs-client/afsdb ||true
+db_input low openafs-client/afsdb || true
db_input low openafs-client/crypt || true
db_input medium openafs-client/dynroot || true
-db_input low openafs-client/fakestat ||true
+db_input low openafs-client/fakestat || true
db_endblock
db_go
db_version 2.0
db_get openafs-client/thiscell
- echo $RET >/etc/openafs/ThisCell
- THISCELL=$RET
+ THISCELL="$RET"
+ if [ -n "$THISCELL" ] ; then
+ echo "$THISCELL" > /etc/openafs/ThisCell
+ fi
- if test -f /etc/openafs/CellServDB ; then
- :
- else
+ if [ ! -f /etc/openafs/CellServDB ] ; then
cp /usr/share/openafs/CellServDB /etc/openafs
fi
# If ThisCell is not in CellServDB, we have 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. We have to
- # override a lintian warning for this since prompts at installation time
- # are frowned upon.
- if grep -q -F "$RET" /etc/openafs/CellServDB && [ "x$RET" != "x" ] ; then
+ # need the CellServDB file, which is part of the package.
+ if grep -q -F "$THISCELL" /etc/openafs/CellServDB \
+ && [ "x$THISCELL" != "x" ] ; then
:
else
db_input critical openafs-client/cell-info || true
db_go
db_get openafs-client/cell-info
if [ "x$RET" != "x" ] ; then
- echo \>$THISCELL > /etc/openafs/CellServDB.new
+ 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 \
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
- exit 1
+ 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
- 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
echo /afs:/var/cache/openafs:$RET >/etc/openafs/cacheinfo
echo <<'EOF' > /etc/openafs/afs.conf.client
-# This file is managed by debconf. Do not edit directly. To modify these
-# settings, run dpkg-reconfigure openafs-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_CLIENT="$RET" > /etc/openafs/afs.conf.client
db_get openafs-client/afsdb
- echo AFS_AFSDB=$RET >>/etc/openafs/afs.conf.client
+ echo AFS_AFSDB="$RET" >> /etc/openafs/afs.conf.client
db_get openafs-client/crypt
- echo AFS_CRYPT=$RET >>/etc/openafs/afs.conf.client
+ echo AFS_CRYPT="$RET" >> /etc/openafs/afs.conf.client
db_get openafs-client/dynroot
- echo AFS_DYNROOT=$RET >>/etc/openafs/afs.conf.client
+ echo AFS_DYNROOT="$RET" >> /etc/openafs/afs.conf.client
db_get openafs-client/fakestat
- echo AFS_FAKESTAT=$RET >>/etc/openafs/afs.conf.client
+ echo AFS_FAKESTAT="$RET" >> /etc/openafs/afs.conf.client
fi
#DEBHELPER#
db_version 2.0
+# Warn anyone who's trying to run the file server on alpha.
arch=`dpkg --print-installation-architecture`
-case $arch in
- alpha)
- db_input high openafs-fileserver/alpha-broken ||true
-;;
-esac
+if [ "$arch" = "alpha" ] ; then
+ db_input high openafs-fileserver/alpha-broken || true
+fi
+# Configure the local cell. Ignore errors on read since it may fail if
+# there's no newline in the file. Default to the server ThisCell file and, if
+# that fails, the configured client cell.
if [ -r /etc/openafs/server/ThisCell ] ; then
- read cell </etc/openafs/server/ThisCell || true # error if no newline is ignore
- db_set openafs-fileserver/thiscell $cell
- fi
-
+ read cell < /etc/openafs/server/ThisCell || true
+ db_set openafs-fileserver/thiscell "$cell"
+fi
db_get openafs-fileserver/thiscell || true
if [ "x$RET" = "x" ] ; then
- db_get openafs-client/thiscell ||true
- db_set openafs-fileserver/thiscell "$RET"
- fi
-
-db_input low openafs-fileserver/thiscell || true
-if [ "x$2" != "x" ] ; then
- if dpkg --compare-versions $2 lt 1.2.0-1 ; then
- db_input high openafs-fileserver/bosconfig_moved ||true
- fi
+ db_get openafs-client/thiscell || true
+ db_set openafs-fileserver/thiscell "$RET"
fi
-
+db_input low openafs-fileserver/thiscell || true
db_go
-
-db_get openafs-fileserver/bosconfig_moved
-if [ $RET = "false" ] ; then
- db_reset openafs-fileserver/bosconfig_moved
- exit 2
-fi
Kerberos service and serve volumes into that cell. Normally, this cell is
the same cell as the workstation's client belongs to.
-Template: openafs-fileserver/bosconfig_moved
-Type: boolean
-Default: true
-_Description: Upgrading will move files to new locations; continue?
- Between Openafs 1.1 and Openafs 1.2, several files moved. In particular,
- files in /etc/openafs/server-local have been distributed to other
- locations. The BosConfig file is now located in /etc/openafs and the
- other files are located in /var/lib/openafs. If you continue with this
- upgrade, these files will be moved. You should use the bos restart
- command to reload your servers. Any configuration changes made before
- you do so will be lost.
-
Template: openafs-fileserver/alpha-broken
Type: note
_Description: OpenAFS file server probably does not work!