if [ -x /usr/sbin/kextstat ]; then KMODSTAT=/usr/sbin/kextstat; fi
if [ -x /usr/sbin/kmodstat ]; then KMODSTAT=/usr/sbin/kmodstat; fi
+if [ -f $CONFIG/afs.conf ]; then
+ . $CONFIG/afs.conf
+fi
+
+# Check this file second so that if users have altered the file, it will
+# override the default options
+if [ -f $AFSDOPT ]; then
+ OPTIONS=`cat $AFSDOPT`
+fi
StartService()
{
echo "Starting OpenAFS"
- if [ -f $AFSDOPT ]; then
- OPTIONS=`cat $AFSDOPT`
+ if [ -z "$OPTIONS" ] || [ "$OPTIONS" = "AUTOMATIC" ] ; then
+ AFSD_OPTIONS="$VERBOSE"
else
- OPTIONS="$MEDIUM -fakestat"
+ AFSD_OPTIONS="$OPTIONS $VERBOSE"
fi
if [ "${NETWORKUP}" = "-NO-" ]; then
- echo $OPTIONS | grep -e '-dynroot' || exit
+ echo $AFSD_OPTIONS | grep -e '-dynroot' || exit
fi
# Need the commands ps, awk, kill, sleep
if [ -x /usr/afs/bin/bosserver ]; then
echo "Starting AFS Server processes"
/usr/afs/bin/bosserver
- OPTIONS="$OPTIONS -nosettime"
+ AFSD_OPTIONS="$AFSD_OPTIONS -nosettime"
sleep 30
fi
done
echo "Starting afsd"
- $AFSD $OPTIONS
+ $AFSD $AFSD_OPTIONS
+
+#
+# From /var/db/openafs/etc/config/afs.conf, call a post-init function or
+# command if it's been defined
+#
+ $AFS_POST_INIT
#
# Call afssettings (if it exists) to set customizable parameters
fi
#
+# From /var/db/openafs/etc/config/afs.conf, set a sysname list if one was
+# configured.
+#
+ if [ -n "$AFS_SYSNAME" ] ; then
+ fs sysname $AFS_SYSNAME
+ fi
+
+#
# Run package to update the disk
#
if [ -f /usr/afsws/etc/package -a -f $PACKAGE ]; then
{
echo "Stopping AFS"
+#
+# If a pre-shutdown function was defined in /var/db/openafs/etc/config/afs.conf
+# was defined, then run it
+#
+ $AFS_PRE_SHUTDOWN
+
if $KMODSTAT | perl -e 'exit not grep /openafs/, <>' ; then
echo "Unmounting /afs"
umount -f /afs 2>&1 > /dev/console
--- /dev/null
+# -*- sh -*-
+# WARNING: this file is ignored if /var/db/openafs/etc/config/afsd.options
+# exists.
+#
+# Copyright 2000, International Business Machines Corporation and others.
+# All Rights Reserved.
+#
+# This software has been released under the terms of the IBM Public
+# License. For details, see the LICENSE file in the top-level source
+# directory or online at http://www.openafs.org/dl/license10.html
+
+# Configuration information for AFS client.
+
+# Set to "-verbose" for a lot of debugging information from afsd. Only useful
+# for debugging as it prints a LOT of information.
+VERBOSE=
+
+# AFS client configuration options.
+#
+# Here is a (mostly) complete list of flags that afsd accepts and that are
+# useful here:
+#
+# -blocks The number of blocks available in the workstation cache.
+# -files The target number of files in the workstation cache (Default:
+# 1000).
+# -rootvol The name of the root volume to use.
+# -stat The number of stat cache entries.
+# -hosts List of servers to check for volume location info FOR THE
+# HOME CELL.
+# -memcache Use an in-memory cache rather than disk.
+# -cachedir The base directory for the workstation cache.
+# -mountdir The directory on which the AFS is to be mounted.
+# -confdir The configuration directory.
+# -nosettime Don't keep checking the time to avoid drift (default).
+# -settime Keep checking the time to avoid drift.
+# -verbose Be chatty.
+# -debug Print out additional debugging info.
+# -daemons The number of background daemons to start (Default: 2).
+# -rmtsys Also fires up an afs remote sys call (e.g. pioctl, setpag)
+# support daemon
+# -chunksize 2^n is the chunksize to be used (Default: use a kernel
+# module default).
+# -dcache The number of data cache entries.
+# -prealloc Number of preallocated "small" memory blocks
+# -waitclose Make close calls always synchronous (slows them down, though)
+# -files_per_subdir Number of files per cache subdir (Default: 2048).
+#
+# Using the memory cache is not recommended. It's less stable than the disk
+# cache and doesn't improve performance as much as it might sound.
+#
+# The default behavior is to let afsd automatically choose an apporpriate set
+# of flags. This should produce reasonable behavior for most working sets
+# provided that one is using a modern AFS client (1.4.2 or later).
+#
+# You can override that default behavior by setting OPTIONS to a specific set
+# of flags.
+OPTIONS="-afsdb -stat 2000 -dcache 800 -daemons 3 -volumes 70 -dynroot -fakestat-all"
+
+# The default value for the client sysname (as returned by fs sysname) is
+# determined during the kernel module build and is taken from the architecture
+# and the major Linux kernel version. Accesses to directories named "@sys" in
+# AFS will be internally redirected to a directory by this name by the AFS
+# client, allowing a single path to resolve to different directories depending
+# on the client architecture.
+#
+# If you would like to override the client sysname, uncomment this line and
+# set the variable to a space-separated list of sysnames. The AFS client will
+# attempt to resolve @sys to each directory name in the order given.
+AFS_SYSNAME=""
+
+# If you want to prefer particular servers for replicated volumes, you can
+# configure that by defining an afs_server_prefs function here and then
+# uncommenting the setting of AFS_POST_INIT below. For more information, see
+# fs help setserverprefs and fs getserverprefs (for the current values).
+
+#afs_server_prefs() {
+# fs setserverprefs <host> <rank>
+#}
+
+# If you want to always run some command after starting OpenAFS, you can put
+# it here. Note that you cannot run multiple commands, even combined with &&
+# or ; or similar shell meta-characters. If you want to run multiple
+# commands, define a shell function instead and put the name of the shell
+# function here.
+AFS_POST_INIT=
+
+# Uncomment this line if you defined an afs_server_prefs function. (If you
+# have other commands that you also want to run, you'll have to put them in
+# that function, as you can only run one function.)
+#AFS_POST_INIT=afs_server_prefs
+
+# If you want to always run some command before shutting down OpenAFS, you can
+# put it here. The same caveat applies about multiple commands.
+AFS_PRE_SHUTDOWN=