db_version 2.0
db_input medium openafs-client/thiscell ||true
-db_go
-
db_input high openafs-client/cachesize ||true
-
+db_go
+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_input low openafs-client/run-client || true
db_go
+Template: openafs-client/cell-info
+Type: string
+Description: What hosts are DB servers for your home cell?
+ AFS uses the file /etc/openafs/CellServDB to hold the list of servers
+ that should be contacted to find parts of a cell. The cell you claim
+ this workstation belongs to is not in that file. Enter the host
+ names of the database servers separated by spaces.
+ IMPORTANT: If you are creating a new cell and this machine is to be
+ a database server in that cell, only enter this machine's name; add
+ the other servers later after they are functioning. Also, do not
+ enable the AFS client to start at boot on this server until the cell
+ is configured. When you are ready you can edit
+ /etc/openafs/afs.conf.client to enable the client.
+
+
Template: openafs-client/thiscell
Type: string
Description: What AFS cell does this workstation belong to?
Each workstation belongs to one cell. Usually the cell is the DNS
domain name of the workstation.
-template: openafs-client/cachesize
+Template: openafs-client/cachesize
Type: string
Default: 50000
Description: How large is your AFS cache (kb)?
on. Often, people find it useful to dedicate a partition to their
AFS cache.
-Template: openafs-client/nohomecell
-Type: note
-Description: Your home cell is not in CellServDb
- AFS uses the file /etc/openafs/CellServDB to hold the list of servers
- that should be contacted to find parts of a cell. The cell you claim
- this workstation belongs to is not in that file. You must either
- change the home cell of this workstation or edit CellServDB to add a
- new cell.
+Template: openafs-client/run-client
+Type: boolean
+Default: true
+Description: Run Openafs client at boot?
+ Should the Openafs filesystem be started and mounted at boot?
+ Normally, most users who install the openafs-client package expect to
+ run it at boot. However, if you are planning on setting up a new
+ cell or are on a laptop, you may not want it started at boot time.
+ If you answer no to this question, run /etc/init.d/openafs-client
+ force-start to run.
# dh_installdeb will replace this with shell code automatically
# generated by other debhelper scripts.
+#DEBHELPER#
+
+exit 0
# Add here commands to install the package into debian/tmp.
cat debian/filelist |sh debian/movefiles
- cp dest/root.client/usr/vice/etc/afs.rc debian/openafs-client/etc/init.d/openafs-client
- chmod 755 debian/openafs-client/etc/init.d/openafs-client
+ cp dest/root.client/usr/vice/etc/afs.rc debian/openafs-client.init
cp dest/root.client/usr/vice/etc/afs.conf debian/openafs-client/etc/openafs/afs.conf
install -m 755 -o root -g root debian/afs-rootvol debian/openafs-dbserver/usr/sbin
(cd debian&&pod2man --section 8 --center "Debian GNU/Linux" \
dh_installmenu
# dh_installemacsen
# dh_installpam
-# dh_installinit
+ dh_installinit -r
dh_installcron
# dh_installmanpages
dh_installinfo
# Configuration information for AFS client
# AFS_CLIENT and AFS_SERVER determine if we should start the client and or
-# the bosserver. Possible values are on and off.
-AFS_CLIENT=on
+# the bosserver. Possible values are true and false.
+# These are loaded from files written by debconf
+test -f /etc/openafs/afs.conf.client && . /etc/openafs/afs.conf.client
+
AFS_SERVER=off
# AFS client configuration options:
. /etc/openafs/afs.conf
fi
-# is_on returns 1 if value of arg is "on"
+# is_on returns 1 if value of arg is "true"
is_on() {
- if test "$1" = "on" ; then return 0
+ if test "$1" = "true" ; then return 0
else return 1
fi
}
# use the prefix command if required
set_prefix
- /sbin/insmod ${PREFIX:+-P $PREFIX} -f -m $MODLOADDIR/$LIBAFS > $MODLOADDIR/libafs.map 2>&1
+ LOADED=`/sbin/lsmod | fgrep openafs`
+ if [ -z "$LOADED" ] ; then
+ /sbin/insmod ${PREFIX:+-P $PREFIX} -f -m $MODLOADDIR/$LIBAFS > $MODLOADDIR/libafs.map 2>&1
+ fi
+}
+
+# start_client() -- run afsd
+start_client() {
+ start-stop-daemon --start --quiet --exec /usr/sbin/afsd \
+ -- ${OPTIONS}
+ echo -n " afsd"
+
}
+
case "$1" in
start)
# Load kernel extensions
fi
echo -n "Starting AFS services: "
- # Start bosserver, it if exists
- if is_on $AFS_SERVER && test -x /usr/afs/bin/bosserver ; then
- start-stop-daemon --start --quiet --pidfile /var/run/bos.pid \
- --exec /usr/afs/bin/bosserver
- echo -n " bosserver"
- fi
-
# Start AFS client
if is_on $AFS_CLIENT && test -x /usr/sbin/afsd ; then
- start-stop-daemon --start --quiet --exec /usr/sbin/afsd \
- -- ${OPTIONS}
- echo -n " afsd"
-
+ start_client
echo "."
$AFS_POST_INIT
fi
;;
- stop)
+force-start)
+ # Load kernel extensions
+ if load_client ; then :
+ else
+ echo Failed to load AFS client, not starting AFS services.
+ exit 1
+ fi
+
+ echo -n "Starting AFS services: "
+ # Start AFS client
+ if test -x /usr/sbin/afsd ; then
+ start_client
+ echo "."
+ $AFS_POST_INIT
+ fi
+ ;;
+ stop|force-stop)
# Stop AFS
echo -n "Stopping AFS services: "
- if is_on $AFS_CLIENT ; then
+ if mount |grep -q \^AFS ; then
umount /afs
echo -n " afsd"
fi
- if is_on $AFS_SERVER && test -x /usr/afs/bin/bos ; then
- echo "Stopping AFS bosserver"
- /usr/afs/bin/bos shutdown localhost -localauth -wait
- start-stop-daemon --stop --quiet --signal 1 \
- --pidfile /var/run/bos.pid
- fi
LIBAFS=`/sbin/lsmod | fgrep openafs`
if [ -n "$LIBAFS" ] ; then