From 36891dc1435741b8caf747b8ff82d6b25594f2c5 Mon Sep 17 00:00:00 2001 From: Chris Dent Date: Tue, 3 Feb 2015 16:22:44 +0000 Subject: [PATCH] Stop neutron services more explicitly After an unstack.sh several neutron services are left running. This change tries to do a better (but not always successful) job of stopping neutron agents. stop_process does its own checking to see if a service is enabled so we don't need to check before calling. Change-Id: I8becbe9db56121cbc619a6d156b18f6c6d31a6e7 --- lib/neutron | 8 ++++++++ lib/neutron_plugins/services/metering | 2 +- lib/neutron_plugins/services/vpn | 1 + 3 files changed, 10 insertions(+), 1 deletion(-) diff --git a/lib/neutron b/lib/neutron index 0f49476c4f..ededef50e3 100755 --- a/lib/neutron +++ b/lib/neutron @@ -749,13 +749,21 @@ function start_neutron_agents { # stop_neutron() - Stop running processes (non-screen) function stop_neutron { if is_service_enabled q-dhcp; then + stop_process q-dhcp pid=$(ps aux | awk '/[d]nsmasq.+interface=(tap|ns-)/ { print $2 }') [ ! -z "$pid" ] && sudo kill -9 $pid fi + + stop_process q-svc + stop_process q-l3 + if is_service_enabled q-meta; then sudo pkill -9 -f neutron-ns-metadata-proxy || : + stop_process q-meta fi + stop_process q-agt + if is_service_enabled q-lbaas; then neutron_lbaas_stop fi diff --git a/lib/neutron_plugins/services/metering b/lib/neutron_plugins/services/metering index 51123e2ff8..37ba019b98 100644 --- a/lib/neutron_plugins/services/metering +++ b/lib/neutron_plugins/services/metering @@ -23,7 +23,7 @@ function neutron_agent_metering_configure_agent { } function neutron_metering_stop { - : + stop_process q-metering } # Restore xtrace diff --git a/lib/neutron_plugins/services/vpn b/lib/neutron_plugins/services/vpn index 7e80b5b5f8..5912eab9ca 100644 --- a/lib/neutron_plugins/services/vpn +++ b/lib/neutron_plugins/services/vpn @@ -28,6 +28,7 @@ function neutron_vpn_stop { if [ -n "$pids" ]; then sudo kill $pids fi + stop_process q-vpn } # Restore xtrace