Add status argument that shows service status for all required services

Signed-off-by: Jeff Peeler <jpeeler@redhat.com>
This commit is contained in:
Jeff Peeler 2012-05-11 19:23:27 -04:00
parent 534416cfcd
commit 845a670f7d
1 changed files with 14 additions and 1 deletions

View File

@ -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."
;;