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
13 if [ "${NETWORKUP}" = "-NO-" ]; then exit; fi
15 if [ -r /var/db/openafs ]; then
16 VICEETC=/var/db/openafs/etc
22 CONFIG=$VICEETC/config
23 AFSDOPT=$CONFIG/afsd.options
24 PACKAGE=$CONFIG/package.options
26 LARGE="-stat 2800 -dcache 2400 -daemons 5 -volumes 128"
27 MEDIUM="-stat 2000 -dcache 800 -daemons 3 -volumes 70"
28 SMALL="-stat 300 -dcache 100 -daemons 2 -volumes 50"
30 if [ -f $AFSDOPT ]; then
31 OPTIONS=`cat $AFSDOPT`
33 OPTIONS="$MEDIUM -fakestat"
36 if [ -x /usr/sbin/kmodstat ]; then
37 KMODSTAT=/usr/sbin/kmodstat
39 if [ -x /usr/sbin/kextstat ]; then
40 KMODSTAT=/usr/sbin/kextstat
44 # Need the commands ps, awk, kill, sleep
45 PATH=${PATH}${PATH:+:}/sbin:/bin:/usr/bin
46 if $KMODSTAT | perl -e 'exit not grep /openafs/, <>' ; then
49 if [ -d $VICEETC/afs.kext ]; then
50 echo "Loading AFS kernel extensions"
51 kextload $VICEETC/afs.kext
53 echo "$VICEETC/afs.kext does not exist. Skipping AFS startup."
57 if $KMODSTAT | perl -e 'exit not grep /openafs/, <>' ; then
60 echo "AFS kernel extensions failed to initialize. Skipping AFS startup."
65 # Start the AFS server processes if a bosserver exists
68 if [ -x /usr/afs/bin/bosserver ]; then
69 echo "Starting AFS Server processes"
70 /usr/afs/bin/bosserver
71 OPTIONS="$OPTIONS -nosettime"
76 # Check that all of the client configuration files exist
79 for file in $AFSD $VICEETC/cacheinfo \
80 $VICEETC/ThisCell $VICEETC/CellServDB
82 if [ ! -f ${file} ]; then
83 echo "${file} does not exist. Not starting AFS client."
89 # Check that the root directory for AFS (/afs)
90 # and the cache directory (/usr/vice/cache) both exist
93 for dir in `awk -F: '{print $1, $2}' $VICEETC/cacheinfo`
95 if [ ! -d ${dir} ]; then
96 echo "${dir} does not exist. Not starting AFS client."
105 # Run package to update the disk
107 if [ -f /usr/afsws/etc/package -a -f $PACKAGE ]; then
108 /usr/afsws/etc/package -v -o `cat $PACKAGE` > /dev/console 2>&1
111 (echo "Package completed successfully") > /dev/console 2>&1
112 date > /dev/console 2>&1
115 (echo "Rebooting to restart system") > /dev/console 2>&1
120 (echo "Package update failed; continuing") > /dev/console 2>&1
127 # Start AFS inetd services
128 # (See the AFS Command Ref. for notes on the proper configuration of inetd.afs)
130 if [ -f /usr/sbin/inetd.afs -a -f /etc/inetd.conf.afs ]; then
131 /usr/sbin/inetd.afs /etc/inetd.conf.afs