diff options
Diffstat (limited to 'xlators/mount/fuse/utils/mount.glusterfs.in')
-rwxr-xr-x | xlators/mount/fuse/utils/mount.glusterfs.in | 52 |
1 files changed, 32 insertions, 20 deletions
diff --git a/xlators/mount/fuse/utils/mount.glusterfs.in b/xlators/mount/fuse/utils/mount.glusterfs.in index 0bf8efd9dbc..19418191a3b 100755 --- a/xlators/mount/fuse/utils/mount.glusterfs.in +++ b/xlators/mount/fuse/utils/mount.glusterfs.in @@ -78,41 +78,50 @@ start_glusterfs () if [ -n "$direct_io_mode" ]; then cmd_line=$(echo "$cmd_line --disable-direct-io-mode"); fi + + if [ -n "$volume_name" ]; then + cmd_line=$(echo "$cmd_line --volume-name=$volume_name"); + fi + if [ -n "$log_server" ]; then + if [ -n "$log_server_port" ]; then + cmd_line=$(echo "$cmd_line \ +--log-server=$log_server \ +--log-server-port=$log_server_port"); + fi + fi + if [ -z "$volfile_loc" ]; then if [ -n "$server_ip" ]; then + cmd_line=$(echo "$cmd_line --volfile-server-port=$server_port"); if [ -n "$transport" ]; then - cmd_line=$(echo "$cmd_line \ ---volfile-server=$server_ip \ ---volfile-server-port=$server_port \ ---volfile-server-transport=$transport"); - else - cmd_line=$(echo "$cmd_line \ ---volfile-server=$server_ip \ ---volfile-server-port=$server_port"); - fi + cmd_line=$(echo "$cmd_line --volfile-server-transport=$transport"); + fi if [ -n "$volume_id" ]; then cmd_line=$(echo "$cmd_line --volfile-id=$volume_id"); fi + + if [ -n "$backupvolfile_server" ]; then + cmd_line1=$(echo "$cmd_line --volfile-server=$backupvolfile_server"); + fi + + cmd_line=$(echo "$cmd_line --volfile-server=$server_ip"); fi else cmd_line=$(echo "$cmd_line --volfile=$volfile_loc"); fi + + cmd_line=$(echo "$cmd_line $mount_point"); + $cmd_line; - if [ -n "$log_server" ]; then - if [ -n "$log_server_port" ]; then - cmd_line=$(echo "$cmd_line \ ---log-server=$log_server \ ---log-server-port=$log_server_port"); + # retry the failover + if [ $? != "0" ]; then + if [ -n "$cmd_line1" ]; then + cmd_line1=$(echo "$cmd_line1 $mount_point"); + $cmd_line1 fi fi - if [ -n "$volume_name" ]; then - cmd_line=$(echo "$cmd_line --volume-name=$volume_name"); - fi - - cmd_line=$(echo "$cmd_line $mount_point"); - exec $cmd_line; } usage () @@ -152,6 +161,7 @@ main () volfile_check=$(echo "$options" | sed -n 's/.*volfile-check=\([^,]*\).*/\1/p'); server_port=$(echo "$options" | sed -n 's/.*server-port=\([^,]*\).*/\1/p'); + backupvolfile_server=$(echo "$options" | sed -n 's/.*backupvolfile-server=\([^,]*\).*/\1/p'); log_server=$(echo "$options" | sed -n 's/.*log-server=\([^,]*\).*/\1/p'); @@ -184,6 +194,7 @@ main () -e 's/[,]*direct-io-mode=[^,]*//' \ -e 's/[,]*volfile-check=[^,]*//' \ -e 's/[,]*transport=[^,]*//' \ + -e 's/[,]*backupvolfile-server=[^,]*//' \ -e 's/[,]*server-port=[^,]*//' \ -e 's/[,]*volume-id=[^,]*//' \ -e 's/[,]*log-server=[^,]*//' \ @@ -223,3 +234,4 @@ main () } _init "$@" && main "$@"; + |