diff options
author | Ross Brattain <ross.b.brattain@intel.com> | 2018-05-08 08:57:30 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@opnfv.org> | 2018-05-08 08:57:30 +0000 |
commit | 245e2e7c3fe831027944709c7712e8552ef2e2fc (patch) | |
tree | f5e7912594361fd707e5924819d7bdc46ae9dba4 | |
parent | c47c33e6071a14485929bb58ee6e1d2aaeff7243 (diff) | |
parent | 131b9f04a360ccc894510a275bd33c57634608fc (diff) |
Merge "Add support for restarting a service"
-rwxr-xr-x | yardstick/benchmark/scenarios/availability/ha_tools/start_service.bash | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/yardstick/benchmark/scenarios/availability/ha_tools/start_service.bash b/yardstick/benchmark/scenarios/availability/ha_tools/start_service.bash index 858d86ca0..1d0fffd06 100755 --- a/yardstick/benchmark/scenarios/availability/ha_tools/start_service.bash +++ b/yardstick/benchmark/scenarios/availability/ha_tools/start_service.bash @@ -9,11 +9,12 @@ # http://www.apache.org/licenses/LICENSE-2.0 ############################################################################## -# Start a service and check the service is started +# Start or restart a service and check the service is started set -e service_name=$1 +operation=${2-start} # values are "start" or "restart" Distributor=$(lsb_release -a | grep "Distributor ID" | awk '{print $3}') @@ -26,7 +27,7 @@ elif [ "$service_name" = "keystone" ]; then fi if which systemctl 2>/dev/null; then - systemctl start $service_name + systemctl $operation $service_name else - service $service_name start + service $service_name $operation fi |