2 # Copyright 2000, International Business Machines Corporation and others.
5 # This software has been released under the terms of the IBM Public
6 # License. For details, see the LICENSE file in the top-level source
7 # directory or online at http://www.openafs.org/dl/license10.html
9 # Portions Copyright (c) 2003 Apple Computer, Inc.
15 if [ "${NETWORKUP}" = "-NO-" ]; then exit; fi
17 if [ -r /var/db/openafs ]; then
18 VICEETC=/var/db/openafs/etc
24 CONFIG=$VICEETC/config
25 AFSDOPT=$CONFIG/afsd.options
26 PACKAGE=$CONFIG/package.options
28 LARGE="-stat 2800 -dcache 2400 -daemons 5 -volumes 128"
29 MEDIUM="-stat 2000 -dcache 800 -daemons 3 -volumes 70"
30 SMALL="-stat 300 -dcache 100 -daemons 2 -volumes 50"
32 if [ -f $AFSDOPT ]; then
33 OPTIONS=`cat $AFSDOPT`
35 OPTIONS="$MEDIUM -fakestat"
38 if [ -x /usr/sbin/kmodstat ]; then
39 KMODSTAT=/usr/sbin/kmodstat
41 if [ -x /usr/sbin/kextstat ]; then
42 KMODSTAT=/usr/sbin/kextstat
46 # Need the commands ps, awk, kill, sleep
47 PATH=${PATH}${PATH:+:}/sbin:/bin:/usr/bin
48 if $KMODSTAT | perl -e 'exit not grep /openafs/, <>' ; then
51 if [ -d $VICEETC/afs.kext ]; then
52 echo "Loading AFS kernel extensions"
53 kextload $VICEETC/afs.kext
55 echo "$VICEETC/afs.kext does not exist. Skipping AFS startup."
59 if $KMODSTAT | perl -e 'exit not grep /openafs/, <>' ; then
62 echo "AFS kernel extensions failed to initialize. Skipping AFS startup."
67 # Start the AFS server processes if a bosserver exists
70 if [ -x /usr/afs/bin/bosserver ]; then
71 echo "Starting AFS Server processes"
72 /usr/afs/bin/bosserver
73 OPTIONS="$OPTIONS -nosettime"
78 # Check that all of the client configuration files exist
81 for file in $AFSD $VICEETC/cacheinfo \
82 $VICEETC/ThisCell $VICEETC/CellServDB
84 if [ ! -f ${file} ]; then
85 echo "${file} does not exist. Not starting AFS client."
91 # Check that the root directory for AFS (/afs)
92 # and the cache directory (/usr/vice/cache) both exist
95 for dir in `awk -F: '{print $1, $2}' $VICEETC/cacheinfo`
97 if [ ! -d ${dir} ]; then
98 echo "${dir} does not exist. Not starting AFS client."
107 # Call afssettings (if it exists) to set customizable parameters
109 if [ -x $VICEETC/config/afssettings ]; then
111 $VICEETC/config/afssettings
115 # Run package to update the disk
117 if [ -f /usr/afsws/etc/package -a -f $PACKAGE ]; then
118 /usr/afsws/etc/package -v -o `cat $PACKAGE` > /dev/console 2>&1
121 (echo "Package completed successfully") > /dev/console 2>&1
122 date > /dev/console 2>&1
125 (echo "Rebooting to restart system") > /dev/console 2>&1
130 (echo "Package update failed; continuing") > /dev/console 2>&1
137 # Start AFS inetd services
138 # (See the AFS Command Ref. for notes on the proper configuration of inetd.afs)
140 if [ -f /usr/sbin/inetd.afs -a -f /etc/inetd.conf.afs ]; then
141 /usr/sbin/inetd.afs /etc/inetd.conf.afs