diff options
| -rw-r--r-- | extras/ganesha/scripts/ganesha-ha.sh | 8 | ||||
| -rwxr-xr-x | extras/hook-scripts/start/post/S31ganesha-start.sh | 10 | 
2 files changed, 9 insertions, 9 deletions
diff --git a/extras/ganesha/scripts/ganesha-ha.sh b/extras/ganesha/scripts/ganesha-ha.sh index 55a019e6b33..30b7e2f3c14 100644 --- a/extras/ganesha/scripts/ganesha-ha.sh +++ b/extras/ganesha/scripts/ganesha-ha.sh @@ -241,6 +241,10 @@ refresh_config ()          local HA_CONFDIR=${2}          local short_host=$(hostname -s) +        local export_id=$(grep ^[[:space:]]*Export_Id $HA_CONFDIR/exports/export.$VOL.conf |\ +                          awk -F"[=,;]" '{print $2}' | tr -d '[[:space:]]') + +          if [ -e ${SECRET_PEM} ]; then          while [[ ${3} ]]; do              current_host=`echo ${3} | cut -d "." -f 1` @@ -250,7 +254,7 @@ refresh_config ()  "dbus-send --print-reply --system --dest=org.ganesha.nfsd \  /org/ganesha/nfsd/ExportMgr org.ganesha.nfsd.exportmgr.UpdateExport \  string:$HA_CONFDIR/exports/export.$VOL.conf \ -string:\"EXPORT(Path=/$VOL)\" 2>&1") +string:\"EXPORT(Export_Id=$export_id)\" 2>&1")                  ret=$?                  logger <<< "${output}"                  if [ ${ret} -ne 0 ]; then @@ -272,7 +276,7 @@ string:\"EXPORT(Path=/$VOL)\" 2>&1")          output=$(dbus-send --print-reply --system --dest=org.ganesha.nfsd \  /org/ganesha/nfsd/ExportMgr org.ganesha.nfsd.exportmgr.UpdateExport \  string:$HA_CONFDIR/exports/export.$VOL.conf \ -string:"EXPORT(Path=/$VOL)" 2>&1) +string:"EXPORT(Export_Id=$export_id)" 2>&1)          ret=$?          logger <<< "${output}"          if [ ${ret} -ne 0 ] ; then diff --git a/extras/hook-scripts/start/post/S31ganesha-start.sh b/extras/hook-scripts/start/post/S31ganesha-start.sh index 1b258cc0ae4..1bbeeab9567 100755 --- a/extras/hook-scripts/start/post/S31ganesha-start.sh +++ b/extras/hook-scripts/start/post/S31ganesha-start.sh @@ -61,6 +61,7 @@ echo "}"  }  #This function keeps track of export IDs and increments it with every new entry +#Also it adds the export dynamically by sending dbus signals  function export_add()  {          count=`ls -l $GANESHA_DIR/exports/*.conf | wc -l` @@ -79,17 +80,13 @@ function export_add()          #fi          fi          echo $EXPORT_ID > $GANESHA_DIR/.export_added -        sed -i s/Export_Id.*/"Export_Id= $EXPORT_ID ;"/ \ +        sed -i s/Export_Id.*/"Export_Id=$EXPORT_ID;"/ \  $GANESHA_DIR/exports/export.$VOL.conf          echo "%include \"$GANESHA_DIR/exports/export.$VOL.conf\"" >> $CONF1 -} -#This function adds a new export dynamically by sending dbus signals -function dynamic_export_add() -{          dbus-send --print-reply --system --dest=org.ganesha.nfsd \  /org/ganesha/nfsd/ExportMgr org.ganesha.nfsd.exportmgr.AddExport \ -string:$GANESHA_DIR/exports/export.$VOL.conf string:"EXPORT(Path=/$VOL)" +string:$GANESHA_DIR/exports/export.$VOL.conf string:"EXPORT(Export_Id=$EXPORT_ID)"  } @@ -99,7 +96,6 @@ function start_ganesha()          sed -i /$VOL.conf/d  $CONF1          #Create a new export entry          export_add $VOL -        dynamic_export_add $VOL  }  | 
