-
Notifications
You must be signed in to change notification settings - Fork 1
/
run1.sh
executable file
·57 lines (54 loc) · 1.53 KB
/
run1.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
47
48
49
50
51
52
53
54
55
56
57
#!/bin/bash
function write_conf()
{
echo "EXPORT{"
echo " Export_Id = 77 ;"
echo "Path=\"/$1\";"
echo "FSAL {"
echo "name = "GLUSTER";"
echo "hostname=\"$2\";"
echo "volume=\"$1\";"
echo "}"
echo "Access_type = RW;"
echo "Allow_root_access = true;"
echo "Pseudo=\"/$1\";"
echo "NFS_Protocols = \"3,4\" ;"
echo "Transport_Protocols = \"UDP,TCP\" ;"
echo "SecType = \"sys\";"
echo "Tag = \"$1\";"
echo "}"
}
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/lib
if ps aux | grep "[g]anesha.nfsd"
then
pkill ganesha.nfsd
sleep 10
fi
if [ "$1" == "ganesha-test-volume" ]
then
mkdir /tmp/brick98
mkdir /tmp/brick99
gluster volume create $1 $2:/tmp/brick98 $2:/tmp/brick99 force
else
mkdir /tmp/brick96
mkdir /tmp/brick97
gluster volume create $1 $2:/tmp/brick96 $2:/tmp/brick97 force
fi
gluster volume start $1
gluster volume set $1 nfs.disable ON
#sed -i s/volume.*/"volume=$1,hostname=$2\";"/ $3
#sed -i s/Pseudo.*/Pseudo="\"\/$1\";"/ $3
#sed -i s/Path.*/Path="\"\/$1\";"/ $3
#sed -i 's/\r//g' $3
write_conf $1 $2 > "/tmp/export_gluster.conf"
sed -i /conf/d/ $3
echo "%include \"/tmp/export_gluster.conf\"" >> $3
/usr/local/bin/ganesha.nfsd -f $3 -L ./nfs-ganesha.log -N NIV_FULL_DEBUG -d
echo "Started ganesha"
#exit 0
#sleep 3
#if ! ps aux | grep ganesha
#then
#echo "Couldn't start ganesha, exiting"
#exit 1
#fi