aboutsummaryrefslogtreecommitdiffstats
path: root/yardstick/benchmark/scenarios/availability/ha_tools/start_service.bash
diff options
context:
space:
mode:
Diffstat (limited to 'yardstick/benchmark/scenarios/availability/ha_tools/start_service.bash')
-rwxr-xr-xyardstick/benchmark/scenarios/availability/ha_tools/start_service.bash14
1 files changed, 12 insertions, 2 deletions
diff --git a/yardstick/benchmark/scenarios/availability/ha_tools/start_service.bash b/yardstick/benchmark/scenarios/availability/ha_tools/start_service.bash
index 3164c44df..858d86ca0 100755
--- a/yardstick/benchmark/scenarios/availability/ha_tools/start_service.bash
+++ b/yardstick/benchmark/scenarios/availability/ha_tools/start_service.bash
@@ -15,8 +15,18 @@ set -e
service_name=$1
-if [ "$service_name" = "keystone" ]; then
- service apache2 start
+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 start $service_name
else
service $service_name start
fi