6 # Created by Claudio Bisegni on 24/06/07.
7 # Copyright 2007 INFN. All rights reserved.
9 # Portions Copyright (c) 2003 Apple Computer, Inc.
11 # Updated to match standard service scripts
12 # Phil Holland <hollandp@umich.edu>
21 CONFIG=$VICEETC/config
22 AFSDOPT=$CONFIG/afsd.options
23 PACKAGE=$CONFIG/package.options
25 if [ -x /usr/sbin/kextstat ]; then KMODSTAT=/usr/sbin/kextstat; fi
26 if [ -x /usr/sbin/kmodstat ]; then KMODSTAT=/usr/sbin/kmodstat; fi
29 if [ -f $CONFIG/afs.conf ]; then
33 # Check this file second so that if users have altered the file, it will
34 # override the default options
35 if [ -f $AFSDOPT ]; then
36 OPTIONS=`cat $AFSDOPT`
39 echo "Starting OpenAFS"
41 if [ -z "$OPTIONS" ] || [ "$OPTIONS" = "AUTOMATIC" ] ; then
42 AFSD_OPTIONS="$VERBOSE"
44 AFSD_OPTIONS="$OPTIONS $VERBOSE"
47 if [ "${NETWORKUP}" = "-NO-" ]; then
48 echo $AFSD_OPTIONS | grep -e '-dynroot' || exit
51 # Need the commands ps, awk, kill, sleep
52 PATH=${PATH}${PATH:+:}/sbin:/bin:/usr/bin
54 if [ -d $VICEETC/afs.kext ]; then
55 echo "Loading AFS kernel extensions"
56 kextload $VICEETC/afs.kext
58 echo "$VICEETC/afs.kext does not exist. Skipping AFS startup."
62 if $KMODSTAT | perl -e 'exit not grep /openafs/, <>' ; then
65 echo "AFS kernel extensions failed to initialize. Skipping AFS startup."
70 # Check that all of the client configuration files exist
73 for file in $AFSD $VICEETC/cacheinfo \
74 $VICEETC/ThisCell $VICEETC/CellServDB
76 if [ ! -f ${file} ]; then
77 echo "${file} does not exist. Not starting AFS client."
83 # Check that the root directory for AFS (/afs)
84 # and the cache directory (/usr/vice/cache) both exist
87 for dir in `awk -F: '{print $1, $2}' $VICEETC/cacheinfo`
89 if [ ! -d ${dir} ]; then
90 echo "${dir} does not exist. Not starting AFS client."
99 # From /var/db/openafs/etc/config/afs.conf, call a post-init function or
100 # command if it's been defined
105 # Call afssettings (if it exists) to set customizable parameters
107 if [ -x $CONFIG/afssettings ]; then