X-Git-Url: https://git.teslayout.com/public/public/public/?a=blobdiff_plain;f=example%2Fdiameter%2Flauncher%2FDEPLOY.sh;h=a314a30f930628a66bd211d63ff02a8fe8a55f93;hb=refs%2Fheads%2Fdynamic_procedure_library;hp=bf8ec844f5b9b8a8f45235fc1e82fe3786d3bf3a;hpb=99843230fc40505d3b9c601c87ad13ea1fcb1689;p=anna.git diff --git a/example/diameter/launcher/DEPLOY.sh b/example/diameter/launcher/DEPLOY.sh index bf8ec84..a314a30 100755 --- a/example/diameter/launcher/DEPLOY.sh +++ b/example/diameter/launcher/DEPLOY.sh @@ -18,6 +18,10 @@ EXECS=( $EXEC_installed ./release/example_diameter_launcher ./debug/example_diam STACKMGMT_EXEC_installed=/opt/bin/anna/example_diameter_stackManagement STACKMGMT_EXECS=( $STACKMGMT_EXEC_installed ../stackManagement/release/example_diameter_stackManagement ../stackManagement/debug/example_diameter_stackManagement ) +# Dynamic library: +#DYNLIB_installed=/usr/local/lib/libanna_dynamicLauncherProcedure.so +#DYNLIBS=( $DYNLIB_installed ../../../dynamic/launcher/default/release/libanna_dynamicLauncherProcedure.so ../../../dynamic/launcher/default/debug/libanna_dynamicLauncherProcedure.so ) + ############# # FUNCTIONS # ############# @@ -70,6 +74,7 @@ STARTED=\`pgrep \$EXE$ 2>/dev/null\` 0> launcher.trace rm -f counters/* test-reports/* # Execution line: +export LD_LIBRARY_PATH=\$PWD/dynlibs ./\$EXE --services services.xml --cntDir counters --tmDir test-reports $other & echo \$! > .pid EOF @@ -89,6 +94,7 @@ echo "---------------------------------------" echo " (--help or -h for more info)" echo echo "Basic checkings ..." + # Launcher executable: available= for EXEC in ${EXECS[@]}; do @@ -97,6 +103,13 @@ for EXEC in ${EXECS[@]}; do echo "not found" done [ -z "$available" ] && _exit "Anna Diameter Launcher (ADML) is not installed neither linked. See README.md (Install section)." + +# Dynamic library variant: +dynlib_variant= +[ -f ./release/example_diameter_launcher ] && dynlib_variant=release +[ -f ./debug/example_diameter_launcher ] && dynlib_variant=debug +[ -z "$dynlib_variant" ] && _exit "Unknown dynamic library variant" + # Dictionary creation: available= for STACKMGMT_EXEC in ${STACKMGMT_EXECS[@]}; do @@ -107,6 +120,15 @@ done [ -z "$available" ] && _exit "Anna Diameter Stack Management Tool is not installed neither linked. See README.md (Install section)." STACKMGMT_EXEC=`readlink -f $STACKMGMT_EXEC` +# Dynamic library: +#available= +#for DYNLIB in ${DYNLIBS[@]}; do +# echo -n "Looking dynamic library at '$DYNLIB' ... " +# [ -x $DYNLIB ] && { available=yes ; echo "available !" ; break ; } +# echo "not found" +#done +#[ -z "$available" ] && _exit "Anna Diameter Launcher Dynamic Procedure Library (ADML) is not installed neither linked. See README.md (Install section)." + [ ! -d $SETUPS_DIR ] && _exit "Diameter stacks not found ($SETUPS_DIR)." echo @@ -176,6 +198,23 @@ mkdir -p $DPATH/stacks mkdir -p $DPATH/DTDs mkdir -p $DPATH/counters mkdir -p $DPATH/test-reports + +# Dynamic libs: +mkdir -p $DPATH/dynlibs +cd ../../../dynamic/launcher +DYNLIBS=( $(find . -name "*.so") ) +for dl in ${DYNLIBS[@]} +do + dir=$(dirname $dl | xargs dirname) + mkdir -p $DPATH/dynlibs/$dir + cp $dir/$dynlib_variant/*.so $DPATH/dynlibs/$dir +done +cd - >/dev/null +cp ./resources/scripts/select_dynlib.sh $DPATH/dynlibs/select.sh +cd $DPATH/dynlibs +ln -s default/libanna_dynamicLauncherProcedure.so +cd - >/dev/null + [ "$option" = "b" ] && mkdir -p $DPATH/services # ADML executable: @@ -190,9 +229,9 @@ fi if [ "$STACKMGMT_EXEC" = "$STACKMGMT_EXEC_installed" ] then ln -s $STACKMGMT_EXEC_installed $DPATH/stacks/stack-mgmt -else - cp $STACKMGMT_EXEC $DPATH/stack-mgmt fi +# Copy binary just in case: +[ ! -f $DPATH/stacks/stack-mgmt ] && cp $STACKMGMT_EXEC $DPATH/stacks/stack-mgmt cp -rL $DEPLOYMENTS_DIR/* $DPATH cp $SETUPS_DIR/*xml $DPATH/stacks @@ -208,10 +247,22 @@ cp $SRVDTD $DPATH/DTDs echo "Preparing ..." cd $DPATH createRunScript $option -stacks/makeAutonomous.sh commands_qosControl.xml ./stack-mgmt >/dev/null +stacks/makeAutonomous.sh commands_qosControl.xml stacks/stack-mgmt >/dev/null ln -s stacks/autonomous.commands_qosControl.xml dictionary.xml cd - >/dev/null +if [ "$option" = "s" ] +then + cd $DPATH + ln -s services_example services + mv run.sh .run-one.sh + mv run_all.sh run.sh + mv operation.sh .operation-one.sh + mv operation_all.sh operation.sh + rm dictionary.xml + cd - >/dev/null +fi + # Help: echo echo "Go to '$DPATH' and see README file"