From: Jeff Peeler Date: Fri, 11 May 2012 23:23:27 +0000 (-0400) Subject: Add status argument that shows service status for all required services X-Git-Tag: 2014.1~1833 X-Git-Url: https://review.fuel-infra.org/gitweb?a=commitdiff_plain;h=845a670f7d8b7e96db6491661bd4bdec06250520;p=openstack-build%2Fheat-build.git Add status argument that shows service status for all required services Signed-off-by: Jeff Peeler --- diff --git a/tools/openstack b/tools/openstack index ea617678..032dd2bc 100755 --- a/tools/openstack +++ b/tools/openstack @@ -11,7 +11,7 @@ action=$1 if [ -z "$action" ] then - echo "openstack [start|stop|install|erase]" + echo "openstack [start|stop|install|erase|status]" echo "" echo "This tool is designed to control OpenStack on a Fedora 16/17 system" echo "" @@ -21,6 +21,16 @@ then echo "erase - permanently destroys an existing installation of OpenStack" fi +function os_status() { + services=(qpidd mysqld openstack-keystone tgtd openstack-glance-api openstack-glance-registry openstack-nova-api openstack-nova-objectstore openstack-nova-compute openstack-nova-network openstack-nova-volume openstack-nova-scheduler openstack-nova-cert) + for service in ${services[@]} + do + output=$(systemctl show "$service.service" --property=ActiveState) + running=(${output//=/ }) #ActiveState=active + echo "$service ${running[1]}" | awk '{ printf "%-40s %s\n", $1, $2}' + done +} + function os_start() { action=start sudo systemctl $action qpidd.service mysqld.service @@ -162,6 +172,9 @@ case $action in install) os_install ;; + status) + os_status + ;; *) echo "The action \"$action\" is not supported." ;;