Import Upstream version 1.8.5
[hcoop/debian/openafs.git] / src / afsd / rc.afs.rs_aix
CommitLineData
805e021f
CE
1#!/bin/sh
2# Copyright 2000, International Business Machines Corporation and others.
3# All Rights Reserved.
4#
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
8
9# rc.afs: rc script for AFS on AIX platforms
10#
11# Install this script as /etc/rc.afs
12# then make an entry in /etc/inittab after the NFS entry:
13# rcnfs:2:wait:/etc/rc.nfs > /dev/console 2>&1 # Start NFS Daemons
14# rcafs:2:wait:/etc/rc.afs > /dev/console 2>&1 # Start AFS Daemons
15#
16
17# Choose one depending on how much usage this client gets
18SMALL="-stat 300 -dcache 100 -daemons 2 -volumes 50"
19MEDIUM="-stat 2000 -dcache 800 -daemons 3 -volumes 70"
20LARGE="-stat 2800 -dcache 2400 -daemons 5 -volumes 128"
21OPTIONS=$LARGE
22
23# Choose one depending on how you want NFS requests handled by AFS
24# Use "none" if this machine won't be an AFS/NFS Translator.
25# To make the machine an AFS/NFS Translator, use iauth for:
26# AIX 4.1.x where x >= 5
27# AIX 4.2.x where x >= 1
28# AIX 4.3.x for any x
29# otherwise use "nfs"
30NFS_NONE="none"
31NFS_NFS="nfs"
32NFS_IAUTH="iauth"
33NFS=$NFS_NONE
34
35if [ "$NFS" = "nfs" ]; then
36 ExportExt=""
37 AFSExt=".trans"
38 RMTSYS="-rmtsys"
39elif [ "$NFS" = "iauth" ]; then
40 ExportExt=".nonfs"
41 AFSExt=".iauth"
42 RMTSYS="-rmtsys"
43else
44 ExportExt=".nonfs"
45 AFSExt=""
46 RMTSYS=""
47fi
48
49# find out whether we have 32 or 64 bit kernel
50
51kernel=32
52if [ -x /usr/sbin/bootinfo ]; then
53 kernel=`/usr/sbin/bootinfo -K`
54fi
55
56# Load AFS into the kernel
57
58echo "$0: Loading $kernel bit kernel AFS modules"
59cd /usr/vice/etc/dkload
60if [ $kernel -eq 32 ]; then
61 ./cfgexport -a export.ext${ExportExt} && ./cfgafs -a afs.ext.32
62else
63 ./cfgexport64 -a export64.ext${ExportExt} && ./cfgafs64 -a afs.ext.64
64fi
65if [ $? -ne 0 ]; then
66 /bin/echo "Unable to load AFS extensions into kernel. Not starting client."
67 exit 1
68fi
69
70
71# Start bosserver
72if [ -x /usr/afs/bin/bosserver ]; then
73 echo 'Starting bosserver' > /dev/console
74 /usr/afs/bin/bosserver &
75fi
76
77
78#
79# Check that all of the client configuration files exist
80#
81for file in afsd cacheinfo ThisCell CellServDB; do
82 if [ ! -f /usr/vice/etc/${file} ]; then
83 /bin/echo "/usr/vice/etc/${file} does not exist. Not starting AFS client."
84 exit 2
85 fi
86done
87
88
89#
90# Check that the root directory for AFS (/afs)
91# and the cache directory (/usr/vice/cache) both exist
92#
93for dir in `awk -F: '{print $1, $2}' /usr/vice/etc/cacheinfo`; do
94 if [ ! -d ${dir} ]; then
95 echo "${dir} does not exist. Not starting AFS client."
96 exit 3
97 fi
98done
99
100#
101# Make sure afs exists in /etc/name_to_sysnum
102#
103if grep -s "afs" /etc/vfs > /dev/null; then
104 echo "Entry for afs already exists in /etc/vfs"
105else
106 echo "Creating entry for afs in /etc/vfs"
107 cp /etc/vfs /etc/vfs.orig
108 sed '/cdrfs/i\
109afs 4 none none remote' /etc/vfs > /tmp/vfs
110 mv /tmp/vfs /etc/vfs
111fi
112
113
114# Start afsd
115/usr/vice/etc/afsd $OPTIONS $RMTSYS
116
117
118# Start AFS inetd services
119if [ -x /etc/inetd.afs -a -f /etc/inetd.conf.afs ]; then
120 /etc/inetd.afs /etc/inetd.conf.afs
121fi