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 # afs.rc: rc script for AFS on SGI Irix platforms
11 # Install this script as /etc/init.d/afs
12 # then make links like this:
13 # ln -s ../init.d/afs /etc/rc0.d/K35afs
14 # ln -s ../init.d/afs /etc/rc2.d/S35afs
16 # Config Files (in /etc/config)
17 # afsclient - machine should be an AFS client
18 # afsserver - machine should be an AFS server
19 # afsxnfs - machine should be an AFS/NFS translator (must also be
21 # afsml - dynamically load afs (using ml(1M))
23 # Option files (in /etc/config)
24 # afsd.options - options to pass to afsd. If present it overrides
27 # The following are 'recommended' values for various sized machines.
28 # These options should be given in /etc/config/afsd.options.
29 # If afsd.options does not exist then $OPTIONS is used.
31 LARGE
="-stat 2800 -dcache 2400 -daemons 5 -volumes 128"
32 MEDIUM
="-stat 2000 -dcache 800 -daemons 3 -volumes 70"
33 SMALL
="-stat 300 -dcache 100 -daemons 2 -volumes 50"
38 AFSDOPT
=$CONFIG/afsd.options
42 # The verbose flag controls the printing of the names of daemons as they
45 if $IS_ON verbose
; then
48 else # For a quiet startup and shutdown
54 # Run afsd in -nosettime mode if we have an alternative time sync
55 # OR we are a server and a client machine
57 if $IS_ON timed ||
$IS_ON timeslave || \
58 ( $IS_ON afsserver
&& $IS_ON afsclient
) ; then
64 # The network startup script (/etc/init.d/network) still runs
65 # "/etc/init.d/afs netstart" to accomodate the loading of AFS 3.3
66 # at a particular time relative to NFS. Post AFS 3.3, we need to
67 # start up after the network script has completed, so the 'netstart'
68 # option is now a no-op and the 'start' option loads AFS.
69 # Note that this option could be used to start inetd.afs if we run
70 # into cases where other servers got ports we want.
77 # Figure out what kind of machine we're on.
81 # Figure out if we need load the NFS translator
83 if $IS_ON afsxnfs
&& test -x /etc
/havenfs
&& /etc
/havenfs
;
85 NAME
="libafs.${IPNO}.o"
87 NAME
="libafs.${IPNO}.nonfs.o"
90 if [ -r /usr
/afs
/bin
/sgiload
/$NAME ]
92 MOD
=/usr
/afs
/bin
/sgiload
/$NAME
93 elif [ -r /usr
/vice
/etc
/sgiload
/$NAME ]
95 MOD
=/usr
/vice
/etc
/sgiload
/$NAME
97 echo "Cannot find afs kernel library: $NAME"
98 echo "Aborting AFS start"
102 $ECHO "Loading AFS from $MOD...\c"
103 if ml ld
$VERBOSE -j $MOD -p Afs_
-a afs
107 echo "Dynamic load of AFS failed - Aborting AFS start"
111 $ECHO "Not loading AFS kernel extensions - afsml config option is off"
114 if $IS_ON afsserver
&& test -x /usr
/afs
/bin
/bosserver
116 $ECHO "Starting AFS bosserver"
117 /usr
/afs
/bin
/bosserver
>/dev
/console
2>&1
120 if $IS_ON afsclient
&& test -x /usr
/vice
/etc
/afsd
; then
121 if test -s /usr
/vice
/etc
/ThisCell
; then
122 MYCELL
=`cat /usr/vice/etc/ThisCell`
124 echo "/usr/vice/etc/ThisCell not valid - Aborting AFS start"
127 if test -r $AFSDOPT ; then
128 OPTIONS
=`cat $AFSDOPT`
130 if $IS_ON afsxnfs
; then
131 OPTIONS
="$OPTIONS -rmtsys"
133 /usr
/vice
/etc
/afsd
$TIMESYNC $OPTIONS >/dev
/console
2>&1
135 # Let AFS think for a while
137 while test ! -x $AFSMT/$MYCELL -a $i -gt 0 ; do
141 if test ! -x $AFSMT/$MYCELL ; then
142 echo "Warning AFS initialization did not complete correctly"
145 # now that /afs is mounted - start up alternate inetd
146 AFSWS
=$AFSMT/$MYCELL/@sys
/usr
/afsws
147 if test -x $AFSWS/etc
/inetd.afs
-a -r $AFSWS/etc
/inetd.conf
; then
148 $ECHO "Starting AFS inetd"
149 $AFSWS/etc
/inetd.afs
$AFSWS/etc
/inetd.conf
2>/dev
/null
</dev
/null
&
157 # Stop the AFS inetd and server processes
158 # Note that the afsd processes cannot be killed
160 if $IS_ON afsclient
; then
164 if $IS_ON afsserver
&& test -x /usr
/afs
/bin
/bos
166 $ECHO "Stopping AFS bosserver"
167 /usr
/afs
/bin
/bos shutdown localhost
-localauth -wait
168 killall
-HUP bosserver
173 echo "usage: $0 {start|stop}"