-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathstartStopAFS.sh
executable file
·46 lines (38 loc) · 1.03 KB
/
startStopAFS.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
#!/usr/bin/env bash
function usage() {
echo "$0 -o <start|stop> -v <kernel version> -s <software version>"
exit
}
operation=""
kversion=""
while getopts "o:v:s:" c; do
case $c in
o) operation=$OPTARG;;
v) kversion=$OPTARG;;
esac
done
[ -z $operation ] && usage
[ -z $kversion ] && usage
if [ $operation = "start" ]; then
cp /openafs/ThisCell /usr/vice/etc/
cp /openafs/CellServDB /usr/vice/etc/
cp /openafs/krb5.conf /etc
cp /openafs/cacheinfo /usr/vice/etc
koloc=$(find /build -name openafs.ko)
cp ${koloc} /lib/modules/${kversion}/
if [ ! -d "/openafs/afscache" ]; then
mkdir /openafs/afscache
fi
if [ ! -d "/openafs/afs" ]; then
mkdir /openafs/afs
fi
insmod /lib/modules/${kversion}/extra/openafs/openafs.ko
/build/openafs/src/afsd/afsd -stat 100000 -daemons 12 -volumes 1536 -chunksize 20 -files 115000 -dcache 25000 -disable-dynamic-vcaches -mountdir /openafs/afs
sleep 10
exit 0
elif [ $operation = "stop" ]; then
umount /openafs/afs
/build/openafs/src/afsd/afsd -shutdown
rmmod openafs
exit 0
fi