X-Git-Url: https://gerrit.opnfv.org/gerrit/gitweb?a=blobdiff_plain;f=yardstick%2Fbenchmark%2Fscenarios%2Favailability%2Fha_tools%2Fstop_service.bash;h=fd8534e24275a431a734792bc00bb892d1269f4a;hb=67da8f2ddb5cbf14bbf0df48b10240ba6ebadbe9;hp=a8901784e0ed9da1de891169c7365acc1d344514;hpb=9b19d7542e494c9c39da7aead2ef630a866b8455;p=yardstick.git diff --git a/yardstick/benchmark/scenarios/availability/ha_tools/stop_service.bash b/yardstick/benchmark/scenarios/availability/ha_tools/stop_service.bash index a8901784e..fd8534e24 100755 --- a/yardstick/benchmark/scenarios/availability/ha_tools/stop_service.bash +++ b/yardstick/benchmark/scenarios/availability/ha_tools/stop_service.bash @@ -15,7 +15,22 @@ set -e service_name=$1 -service $service_name stop +Distributor=$(lsb_release -a | grep "Distributor ID" | awk '{print $3}') + +if [ "$Distributor" != "Ubuntu" -a "$service_name" != "keystone" -a "$service_name" != "neutron-server" -a "$service_name" != "haproxy" ]; then + service_name="openstack-"${service_name} +elif [ "$Distributor" = "Ubuntu" -a "$service_name" = "keystone" ]; then + service_name="apache2" +elif [ "$service_name" = "keystone" ]; then + service_name="httpd" +fi + +if which systemctl 2>/dev/null; then + systemctl stop $service_name +else + service $service_name stop +fi + # TODO # check the service status