Initial IBM OpenAFS 1.0 tree
[openafs.git] / src / afsd / rc.afs.rs_aix
1 #!/bin/sh
2 #
3 # rc.afs: rc script for AFS on AIX platforms
4 #
5 # Install this script as /etc/rc.afs
6 # then make an entry in /etc/inittab after the NFS entry:
7 # rcnfs:2:wait:/etc/rc.nfs > /dev/console 2>&1 # Start NFS Daemons
8 # rcafs:2:wait:/etc/rc.afs > /dev/console 2>&1 # Start AFS Daemons
9
10
11 # Choose one depending on how much usage this client gets
12 SMALL="-stat 300 -dcache 100 -daemons 2 -volumes 50"
13 MEDIUM="-stat 2000 -dcache 800 -daemons 3 -volumes 70"
14 LARGE="-stat 2800 -dcache 2400 -daemons 5 -volumes 128"
15 OPTIONS=$LARGE
16
17 # Choose one depending on how you want NFS requests handled by AFS
18 # Use "none" if this machine won't be an AFS/NFS Translator.
19 # To make the machine an AFS/NFS Translator, use iauth for:
20 #   AIX 4.1.x  where x >= 5
21 #   AIX 4.2.x  where x >= 1
22 #   AIX 4.3.x  for any x
23 # otherwise use "nfs"
24 NFS_NONE="none"
25 NFS_NFS="nfs"
26 NFS_IAUTH="iauth"
27 NFS=$NFS_NONE
28
29 if [ "$NFS" = "nfs" ]; then
30   ExportExt=""
31   AFSExt=".trans"
32   RMTSYS="-rmtsys"
33 elif [ "$NFS" = "iauth" ]; then
34   ExportExt=".nonfs"
35   AFSExt=".iauth"
36   RMTSYS="-rmtsys"
37 else
38   ExportExt=".nonfs"
39   AFSExt=""
40   RMTSYS=""
41 fi
42
43 # Load AFS into the kernel
44 cd /usr/vice/etc/dkload
45 /usr/vice/etc/dkload/cfgexport -a /usr/vice/etc/dkload/export.ext${ExportExt}
46 /usr/vice/etc/dkload/cfgafs -a /usr/vice/etc/dkload/afs.ext${AFSExt}
47 if [ $? -ne 0 ]; then
48   /bin/echo "Unable to load AFS extensions into kernel. Not starting client."
49   exit 1
50 fi
51
52
53 # Start bosserver
54 if [ -x /usr/afs/bin/bosserver ]; then
55   echo 'Starting bosserver' > /dev/console
56   /usr/afs/bin/bosserver &
57 fi
58
59
60 #
61 # Check that all of the client configuration files exist
62 #
63 for file in afsd cacheinfo ThisCell CellServDB; do
64   if [ ! -f /usr/vice/etc/${file} ]; then
65     /bin/echo "/usr/vice/etc/${file} does not exist. Not starting AFS client."
66     exit 2
67   fi
68 done
69
70
71 #
72 # Check that the root directory for AFS (/afs) 
73 # and the cache directory (/usr/vice/cache) both exist
74 #
75 for dir in `awk -F: '{print $1, $2}' /usr/vice/etc/cacheinfo`; do
76   if [ ! -d ${dir} ]; then
77     echo "${dir} does not exist. Not starting AFS client."
78     exit 3
79   fi
80 done
81
82
83 # Start afsd
84 /usr/vice/etc/afsd $OPTIONS $RMTSYS
85
86
87 # Start AFS inetd services
88 if [ -x /etc/inetd.afs -a -f /etc/inetd.conf.afs ]; then
89     /etc/inetd.afs /etc/inetd.conf.afs
90 fi