From 699a29f72decbfc1edabde3042a236ba0ae5760f Mon Sep 17 00:00:00 2001 From: Dean Troyer Date: Mon, 10 Sep 2012 14:10:27 -0500 Subject: [PATCH] Implement screen process stop() function Implements screen process stop in ceilometer, cinder, glance, heat, n-vol Change-Id: Ic5e02926f026d0e6f4b39846bfe77634dd414c60 --- lib/ceilometer | 8 ++++++++ lib/cinder | 7 +++++-- lib/glance | 2 +- lib/heat | 8 +++++--- lib/n-vol | 5 +++-- 5 files changed, 22 insertions(+), 8 deletions(-) diff --git a/lib/ceilometer b/lib/ceilometer index 020875375e..972621d6db 100644 --- a/lib/ceilometer +++ b/lib/ceilometer @@ -72,5 +72,13 @@ function start_ceilometer() { screen_it ceilometer-api "cd $CEILOMETER_DIR && $CEILOMETER_BIN_DIR/ceilometer-api -d -v --log-dir=$CEILOMETER_API_LOG_DIR" } +# stop_ceilometer() - Stop running processes +function stop_ceilometer() { + # Kill the ceilometer screen windows + for serv in ceilometer-acompute ceilometer-acentral ceilometer-collector ceilometer-api; do + screen -S $SCREEN_NAME -p $serv -X kill + done +} + # Restore xtrace $XTRACE diff --git a/lib/cinder b/lib/cinder index de2debce2d..14c2df8b3f 100644 --- a/lib/cinder +++ b/lib/cinder @@ -225,9 +225,12 @@ function start_cinder() { screen_it c-sch "cd $CINDER_DIR && $CINDER_BIN_DIR/cinder-scheduler --config-file $CINDER_CONF" } -# stop_cinder() - Stop running processes (non-screen) +# stop_cinder() - Stop running processes function stop_cinder() { - # FIXME(dtroyer): stop only the cinder screen window? + # Kill the cinder screen windows + for serv in c-api c-sch c-vol; do + screen -S $SCREEN_NAME -p $serv -X kill + done if is_service_enabled c-vol; then stop_service tgt diff --git a/lib/glance b/lib/glance index 44990f1412..4cc6253e00 100644 --- a/lib/glance +++ b/lib/glance @@ -169,7 +169,7 @@ function start_glance() { fi } -# stop_glance() - Stop running processes (non-screen) +# stop_glance() - Stop running processes function stop_glance() { # Kill the Glance screen windows screen -S $SCREEN_NAME -p g-api -X kill diff --git a/lib/heat b/lib/heat index e713b39979..6e823f2f24 100644 --- a/lib/heat +++ b/lib/heat @@ -173,10 +173,12 @@ function start_heat() { screen_it h-meta "cd $HEAT_DIR; bin/heat-metadata --config-dir=$HEAT_CONF_DIR/heat-metadata.conf" } -# stop_heat() - Stop running processes (non-screen) +# stop_heat() - Stop running processes function stop_heat() { - # This function intentionally left blank - : + # Kill the cinder screen windows + for serv in h-eng h-api-cfn h-api-cw h-meta; do + screen -S $SCREEN_NAME -p $serv -X kill + done } # Restore xtrace diff --git a/lib/n-vol b/lib/n-vol index cc669cbd1d..db53582b45 100644 --- a/lib/n-vol +++ b/lib/n-vol @@ -114,9 +114,10 @@ function start_nvol() { screen_it n-vol "cd $NOVA_DIR && $NOVA_BIN_DIR/nova-volume" } -# stop_nvol() - Stop running processes (non-screen) +# stop_nvol() - Stop running processes function stop_nvol() { - # FIXME(dtroyer): stop only the n-vol screen window? + # Kill the nova volume screen window + screen -S $SCREEN_NAME -p n-vol -X kill stop_service tgt }