diff --git a/ocf/ceilometer-agent-central b/ocf/ceilometer-agent-central index 2fc46e5..ea4fc22 100644 --- a/ocf/ceilometer-agent-central +++ b/ocf/ceilometer-agent-central @@ -250,7 +250,7 @@ ceilometer_agent_central_start() { # run the actual ceilometer-agent-central daemon. Don't use ocf_run as we're sending the tool's output # straight to /dev/null anyway and using ocf_run would break stdout-redirection here. su ${OCF_RESKEY_user} -s /bin/sh -c "${OCF_RESKEY_binary} --config-file=$OCF_RESKEY_config \ - $OCF_RESKEY_additional_parameters"' >> /dev/null 2>&1 & echo $!' > $OCF_RESKEY_pid + $OCF_RESKEY_additional_parameters"' >> /dev/null 2>&1 & echo $!' > $OCF_RESKEY_pid # Spin waiting for the server to come up. while true; do @@ -310,7 +310,7 @@ ceilometer_agent_central_stop() { if [ $rc -ne $OCF_NOT_RUNNING ]; then # SIGTERM didn't help either, try SIGKILL ocf_log info "OpenStack Ceilometer Central Agent (ceilometer-agent-central) failed to stop after ${shutdown_timeout}s \ - using SIGTERM. Trying SIGKILL ..." + using SIGTERM. Trying SIGKILL ..." ocf_run kill -s KILL $pid fi @@ -324,10 +324,13 @@ ceilometer_agent_central_stop() { ####################################################################### case "$1" in - meta-data) meta_data - exit $OCF_SUCCESS;; - usage|help) usage - exit $OCF_SUCCESS;; + meta-data) + meta_data + exit $OCF_SUCCESS + ;; + usage|help) usage + exit $OCF_SUCCESS + ;; esac # Anything except meta-data and help must pass validation @@ -335,11 +338,22 @@ ceilometer_agent_central_validate || exit $? # What kind of method was invoked? case "$1" in - start) ceilometer_agent_central_start;; - stop) ceilometer_agent_central_stop;; - status) ceilometer_agent_central_status;; - monitor) ceilometer_agent_central_monitor;; - validate-all) ;; - *) usage - exit $OCF_ERR_UNIMPLEMENTED;; + start) + ceilometer_agent_central_start + ;; + stop) + ceilometer_agent_central_stop + ;; + status) + ceilometer_agent_central_status + ;; + monitor) + ceilometer_agent_central_monitor + ;; + validate-all) + ;; + *) + usage + exit $OCF_ERR_UNIMPLEMENTED + ;; esac diff --git a/ocf/cinder-api b/ocf/cinder-api index a8ad1cf..78570f0 100644 --- a/ocf/cinder-api +++ b/ocf/cinder-api @@ -247,9 +247,9 @@ cinder_api_monitor() { if [ -n "$OCF_RESKEY_os_username" ] && [ -n "$OCF_RESKEY_os_password" ] \ && [ -n "$OCF_RESKEY_os_tenant_name" ] && [ -n "$OCF_RESKEY_keystone_get_token_url" ]; then token=`curl -s -d "{\"auth\":{\"passwordCredentials\": {\"username\": \"$OCF_RESKEY_os_username\", \ - \"password\": \"$OCF_RESKEY_os_password\"}, \"tenantName\": \"$OCF_RESKEY_os_tenant_name\"}}" \ - -H "Content-type: application/json" $OCF_RESKEY_keystone_get_token_url | tr ',' '\n' | grep '"id":' \ - | cut -d'"' -f4 | head --lines 1` + \"password\": \"$OCF_RESKEY_os_password\"}, \"tenantName\": \"$OCF_RESKEY_os_tenant_name\"}}" \ + -H "Content-type: application/json" $OCF_RESKEY_keystone_get_token_url | tr ',' '\n' | grep '"id":' \ + | cut -d'"' -f4 | head --lines 1` http_code=`curl --write-out %{http_code} --output /dev/null -sH "X-Auth-Token: $token" $OCF_RESKEY_url` rc=$? if [ $rc -ne 0 ] || [ $http_code -ne 200 ]; then @@ -275,7 +275,7 @@ cinder_api_start() { # run the actual cinder-api daemon. Don't use ocf_run as we're sending the tool's output # straight to /dev/null anyway and using ocf_run would break stdout-redirection here. su ${OCF_RESKEY_user} -s /bin/sh -c "${OCF_RESKEY_binary} --config-file=$OCF_RESKEY_config \ - $OCF_RESKEY_additional_parameters"' >> /dev/null 2>&1 & echo $!' > $OCF_RESKEY_pid + $OCF_RESKEY_additional_parameters"' >> /dev/null 2>&1 & echo $!' > $OCF_RESKEY_pid # Spin waiting for the server to come up. # Let the CRM/LRM time us out if required @@ -336,7 +336,7 @@ cinder_api_stop() { if [ $rc -ne $OCF_NOT_RUNNING ]; then # SIGTERM didn't help either, try SIGKILL ocf_log info "OpenStack Cinder API (cinder-api) failed to stop after ${shutdown_timeout}s \ - using SIGTERM. Trying SIGKILL ..." + using SIGTERM. Trying SIGKILL ..." ocf_run kill -s KILL $pid fi @@ -350,10 +350,14 @@ cinder_api_stop() { ####################################################################### case "$1" in - meta-data) meta_data - exit $OCF_SUCCESS;; - usage|help) usage - exit $OCF_SUCCESS;; + meta-data) + meta_data + exit $OCF_SUCCESS + ;; + usage|help) + usage + exit $OCF_SUCCESS + ;; esac # Anything except meta-data and help must pass validation @@ -361,12 +365,23 @@ cinder_api_validate || exit $? # What kind of method was invoked? case "$1" in - start) cinder_api_start;; - stop) cinder_api_stop;; - status) cinder_api_status;; - monitor) cinder_api_monitor;; - validate-all) ;; - *) usage - exit $OCF_ERR_UNIMPLEMENTED;; + start) + cinder_api_start + ;; + stop) + cinder_api_stop + ;; + status) + cinder_api_status + ;; + monitor) + cinder_api_monitor + ;; + validate-all) + ;; + *) + usage + exit $OCF_ERR_UNIMPLEMENTED + ;; esac diff --git a/ocf/cinder-schedule b/ocf/cinder-schedule index 6ee8fe2..e40e935 100644 --- a/ocf/cinder-schedule +++ b/ocf/cinder-schedule @@ -250,7 +250,7 @@ cinder_scheduler_start() { # run the actual cinder-schedule daemon. Don't use ocf_run as we're sending the tool's output # straight to /dev/null anyway and using ocf_run would break stdout-redirection here. su ${OCF_RESKEY_user} -s /bin/sh -c "${OCF_RESKEY_binary} --config-file=$OCF_RESKEY_config \ - $OCF_RESKEY_additional_parameters"' >> /dev/null 2>&1 & echo $!' > $OCF_RESKEY_pid + $OCF_RESKEY_additional_parameters"' >> /dev/null 2>&1 & echo $!' > $OCF_RESKEY_pid # Spin waiting for the server to come up. while true; do @@ -310,7 +310,7 @@ cinder_scheduler_stop() { if [ $rc -ne $OCF_NOT_RUNNING ]; then # SIGTERM didn't help either, try SIGKILL ocf_log info "OpenStack Cinder Scheduler (cinder-schedule) failed to stop after ${shutdown_timeout}s \ - using SIGTERM. Trying SIGKILL ..." + using SIGTERM. Trying SIGKILL ..." ocf_run kill -s KILL $pid fi @@ -324,10 +324,14 @@ cinder_scheduler_stop() { ####################################################################### case "$1" in - meta-data) meta_data - exit $OCF_SUCCESS;; - usage|help) usage - exit $OCF_SUCCESS;; + meta-data) + meta_data + exit $OCF_SUCCESS + ;; + usage|help) + usage + exit $OCF_SUCCESS + ;; esac # Anything except meta-data and help must pass validation @@ -335,11 +339,22 @@ cinder_scheduler_validate || exit $? # What kind of method was invoked? case "$1" in - start) cinder_scheduler_start;; - stop) cinder_scheduler_stop;; - status) cinder_scheduler_status;; - monitor) cinder_scheduler_monitor;; - validate-all) ;; - *) usage - exit $OCF_ERR_UNIMPLEMENTED;; + start) + cinder_scheduler_start + ;; + stop) + cinder_scheduler_stop + ;; + status) + cinder_scheduler_status + ;; + monitor) + cinder_scheduler_monitor + ;; + validate-all) + ;; + *) + usage + exit $OCF_ERR_UNIMPLEMENTED + ;; esac diff --git a/ocf/cinder-volume b/ocf/cinder-volume index b4e0498..46d8b19 100644 --- a/ocf/cinder-volume +++ b/ocf/cinder-volume @@ -215,26 +215,26 @@ cinder_volume_monitor() { pid=`cat $OCF_RESKEY_pid` if ocf_is_true "$OCF_RESKEY_multibackend"; then - # Grab the child's PIDs - for i in `ps -o pid --no-headers --ppid $pid` - do - volume_amqp_check=`netstat -punt | grep -s "$OCF_RESKEY_amqp_server_port" | grep -s "$i" | grep -qs "ESTABLISHED"` + # Grab the child's PIDs + for i in `ps -o pid --no-headers --ppid $pid` + do + volume_amqp_check=`netstat -punt | grep -s "$OCF_RESKEY_amqp_server_port" | grep -s "$i" | grep -qs "ESTABLISHED"` + rc=$? + if [ $rc -ne 0 ]; then + ocf_log err "This child process from Cinder Volume is not connected to the AMQP server: $rc" + return $OCF_NOT_RUNNING + fi + done + else + # Check the connections according to the PID + # We are sure to hit the scheduler process and not other nova process with the same connection behavior (for example nova-cert) + # check the connections according to the PID + volume_amqp_check=`netstat -punt | grep -s "$OCF_RESKEY_amqp_server_port" | grep -s "$pid" | grep -qs "ESTABLISHED"` rc=$? if [ $rc -ne 0 ]; then - ocf_log err "This child process from Cinder Volume is not connected to the AMQP server: $rc" - return $OCF_NOT_RUNNING + ocf_log err "Cinder Volume is not connected to the AMQP server: $rc" + return $OCF_NOT_RUNNING fi - done - else - # Check the connections according to the PID - # We are sure to hit the scheduler process and not other nova process with the same connection behavior (for example nova-cert) - # check the connections according to the PID - volume_amqp_check=`netstat -punt | grep -s "$OCF_RESKEY_amqp_server_port" | grep -s "$pid" | grep -qs "ESTABLISHED"` - rc=$? - if [ $rc -ne 0 ]; then - ocf_log err "Cinder Volume is not connected to the AMQP server: $rc" - return $OCF_NOT_RUNNING - fi fi ocf_log debug "OpenStack Cinder Volume (cinder-volume) monitor succeeded" @@ -254,7 +254,7 @@ cinder_volume_start() { # run the actual cinder-volume daemon. Don't use ocf_run as we're sending the tool's output # straight to /dev/null anyway and using ocf_run would break stdout-redirection here. su ${OCF_RESKEY_user} -s /bin/sh -c "${OCF_RESKEY_binary} --config-file=$OCF_RESKEY_config \ - $OCF_RESKEY_additional_parameters"' >> /dev/null 2>&1 & echo $!' > $OCF_RESKEY_pid + $OCF_RESKEY_additional_parameters"' >> /dev/null 2>&1 & echo $!' > $OCF_RESKEY_pid # Spin waiting for the server to come up. # Let the CRM/LRM time us out if required @@ -315,7 +315,7 @@ cinder_volume_stop() { if [ $rc -ne $OCF_NOT_RUNNING ]; then # SIGTERM didn't help either, try SIGKILL ocf_log info "OpenStack Cinder Volume (cinder-volume) failed to stop after ${shutdown_timeout}s \ - using SIGTERM. Trying SIGKILL ..." + using SIGTERM. Trying SIGKILL ..." ocf_run kill -s KILL $pid fi @@ -329,10 +329,14 @@ cinder_volume_stop() { ####################################################################### case "$1" in - meta-data) meta_data - exit $OCF_SUCCESS;; - usage|help) usage - exit $OCF_SUCCESS;; + meta-data) + meta_data + exit $OCF_SUCCESS + ;; + usage|help) + usage + exit $OCF_SUCCESS + ;; esac # Anything except meta-data and help must pass validation @@ -340,11 +344,22 @@ cinder_volume_validate || exit $? # What kind of method was invoked? case "$1" in - start) cinder_volume_start;; - stop) cinder_volume_stop;; - status) cinder_volume_status;; - monitor) cinder_volume_monitor;; - validate-all) ;; - *) usage - exit $OCF_ERR_UNIMPLEMENTED;; + start) + cinder_volume_start + ;; + stop) + cinder_volume_stop + ;; + status) + cinder_volume_status + ;; + monitor) + cinder_volume_monitor + ;; + validate-all) + ;; + *) + usage + exit $OCF_ERR_UNIMPLEMENTED + ;; esac diff --git a/ocf/glance-api b/ocf/glance-api index 841de1e..89d90b4 100644 --- a/ocf/glance-api +++ b/ocf/glance-api @@ -268,7 +268,7 @@ glance_api_start() { # run the actual glance-api daemon. Don't use ocf_run as we're sending the tool's output # straight to /dev/null anyway and using ocf_run would break stdout-redirection here. su ${OCF_RESKEY_user} -s /bin/sh -c "${OCF_RESKEY_binary} --config-file $OCF_RESKEY_config \ - $OCF_RESKEY_additional_parameters"' >> /dev/null 2>&1 & echo $!' > $OCF_RESKEY_pid + $OCF_RESKEY_additional_parameters"' >> /dev/null 2>&1 & echo $!' > $OCF_RESKEY_pid # Spin waiting for the server to come up. # Let the CRM/LRM time us out if required @@ -329,7 +329,7 @@ glance_api_stop() { if [ $rc -ne $OCF_NOT_RUNNING ]; then # SIGTERM didn't help either, try SIGKILL ocf_log info "OpenStack ImageService (glance-api) failed to stop after ${shutdown_timeout}s \ - using SIGTERM. Trying SIGKILL ..." + using SIGTERM. Trying SIGKILL ..." ocf_run kill -s KILL $pid fi @@ -343,10 +343,14 @@ glance_api_stop() { ####################################################################### case "$1" in - meta-data) meta_data - exit $OCF_SUCCESS;; - usage|help) usage - exit $OCF_SUCCESS;; + meta-data) + meta_data + exit $OCF_SUCCESS + ;; + usage|help) + usage + exit $OCF_SUCCESS + ;; esac # Anything except meta-data and help must pass validation @@ -354,11 +358,22 @@ glance_api_validate || exit $? # What kind of method was invoked? case "$1" in - start) glance_api_start;; - stop) glance_api_stop;; - status) glance_api_status;; - monitor) glance_api_monitor;; - validate-all) ;; - *) usage - exit $OCF_ERR_UNIMPLEMENTED;; + start) + glance_api_start + ;; + stop) + glance_api_stop + ;; + status) + glance_api_status + ;; + monitor) + glance_api_monitor + ;; + validate-all) + ;; + *) + usage + exit $OCF_ERR_UNIMPLEMENTED + ;; esac diff --git a/ocf/glance-registry b/ocf/glance-registry index 053f3c4..4e9d2f7 100644 --- a/ocf/glance-registry +++ b/ocf/glance-registry @@ -249,9 +249,9 @@ glance_registry_monitor() { if [ -n "$OCF_RESKEY_os_username" ] && [ -n "$OCF_RESKEY_os_password" ] \ && [ -n "$OCF_RESKEY_os_tenant_name" ] && [ -n "$OCF_RESKEY_keystone_get_token_url" ]; then token=`curl -s -d "{\"auth\":{\"passwordCredentials\": {\"username\": \"$OCF_RESKEY_os_username\", \ - \"password\": \"$OCF_RESKEY_os_password\"}, \"tenantName\": \"$OCF_RESKEY_os_tenant_name\"}}" \ - -H "Content-type: application/json" $OCF_RESKEY_keystone_get_token_url | tr ',' '\n' | grep '"id":' \ - | cut -d'"' -f4 | head --lines 1` + \"password\": \"$OCF_RESKEY_os_password\"}, \"tenantName\": \"$OCF_RESKEY_os_tenant_name\"}}" \ + -H "Content-type: application/json" $OCF_RESKEY_keystone_get_token_url | tr ',' '\n' | grep '"id":' \ + | cut -d'"' -f4 | head --lines 1` http_code=`curl --write-out %{http_code} --output /dev/null -sH "X-Auth-Token: $token" $OCF_RESKEY_url` rc=$? if [ $rc -ne 0 ] || [ $http_code -ne 200 ]; then @@ -277,7 +277,7 @@ glance_registry_start() { # run the actual glance-registry daemon. Don't use ocf_run as we're sending the tool's output # straight to /dev/null anyway and using ocf_run would break stdout-redirection here. su ${OCF_RESKEY_user} -s /bin/sh -c "${OCF_RESKEY_binary} --config-file $OCF_RESKEY_config \ - $OCF_RESKEY_additional_parameters"' >> /dev/null 2>&1 & echo $!' > $OCF_RESKEY_pid + $OCF_RESKEY_additional_parameters"' >> /dev/null 2>&1 & echo $!' > $OCF_RESKEY_pid # Spin waiting for the server to come up. # Let the CRM/LRM time us out if required @@ -338,7 +338,7 @@ glance_registry_stop() { if [ $rc -ne $OCF_NOT_RUNNING ]; then # SIGTERM didn't help either, try SIGKILL ocf_log info "OpenStack ImageService (glance-registry) failed to stop after ${shutdown_timeout}s \ - using SIGTERM. Trying SIGKILL ..." + using SIGTERM. Trying SIGKILL ..." ocf_run kill -s KILL $pid fi @@ -352,10 +352,14 @@ glance_registry_stop() { ####################################################################### case "$1" in - meta-data) meta_data - exit $OCF_SUCCESS;; - usage|help) usage - exit $OCF_SUCCESS;; + meta-data) + meta_data + exit $OCF_SUCCESS + ;; + usage|help) + usage + exit $OCF_SUCCESS + ;; esac # Anything except meta-data and help must pass validation @@ -363,11 +367,22 @@ glance_registry_validate || exit $? # What kind of method was invoked? case "$1" in - start) glance_registry_start;; - stop) glance_registry_stop;; - status) glance_registry_status;; - monitor) glance_registry_monitor;; - validate-all) ;; - *) usage - exit $OCF_ERR_UNIMPLEMENTED;; + start) + glance_registry_start + ;; + stop) + glance_registry_stop + ;; + status) + glance_registry_status + ;; + monitor) + glance_registry_monitor + ;; + validate-all) + ;; + *) + usage + exit $OCF_ERR_UNIMPLEMENTED + ;; esac diff --git a/ocf/heat-engine b/ocf/heat-engine index 4315c73..789530a 100644 --- a/ocf/heat-engine +++ b/ocf/heat-engine @@ -260,7 +260,7 @@ heat_engine_start() { # run the actual heat-engine daemon. Don't use ocf_run as we're sending the tool's output # straight to /dev/null anyway and using ocf_run would break stdout-redirection here. su ${OCF_RESKEY_user} -s /bin/sh -c "${OCF_RESKEY_binary} --config-file=$OCF_RESKEY_config \ - $OCF_RESKEY_additional_parameters"' >> /dev/null 2>&1 & echo $!' > $OCF_RESKEY_pid + $OCF_RESKEY_additional_parameters"' >> /dev/null 2>&1 & echo $!' > $OCF_RESKEY_pid # Spin waiting for the server to come up. while true; do @@ -320,7 +320,7 @@ heat_engine_stop() { if [ $rc -ne $OCF_NOT_RUNNING ]; then # SIGTERM didn't help either, try SIGKILL ocf_log info "OpenStack Orchestration Engine (heat-engine) failed to stop after ${shutdown_timeout}s \ - using SIGTERM. Trying SIGKILL ..." + using SIGTERM. Trying SIGKILL ..." ocf_run kill -s KILL $pid fi @@ -334,10 +334,14 @@ heat_engine_stop() { ####################################################################### case "$1" in - meta-data) meta_data - exit $OCF_SUCCESS;; - usage|help) usage - exit $OCF_SUCCESS;; + meta-data) + meta_data + exit $OCF_SUCCESS + ;; + usage|help) + usage + exit $OCF_SUCCESS + ;; esac # Anything except meta-data and help must pass validation @@ -345,11 +349,22 @@ heat_engine_validate || exit $? # What kind of method was invoked? case "$1" in - start) heat_engine_start;; - stop) heat_engine_stop;; - status) heat_engine_status;; - monitor) heat_engine_monitor;; - validate-all) ;; - *) usage - exit $OCF_ERR_UNIMPLEMENTED;; + start) + heat_engine_start + ;; + stop) + heat_engine_stop + ;; + status) + heat_engine_status + ;; + monitor) + heat_engine_monitor + ;; + validate-all) + ;; + *) + usage + exit $OCF_ERR_UNIMPLEMENTED + ;; esac diff --git a/ocf/keystone b/ocf/keystone index 396bc46..cc7c9ab 100644 --- a/ocf/keystone +++ b/ocf/keystone @@ -270,7 +270,7 @@ keystone_start() { # run the actual keystone daemon. Don't use ocf_run as we're sending the tool's output # straight to /dev/null anyway and using ocf_run would break stdout-redirection here. su ${OCF_RESKEY_user} -s /bin/sh -c "${OCF_RESKEY_binary} --config-file $OCF_RESKEY_config \ - $OCF_RESKEY_additional_parameters"' >> /dev/null 2>&1 & echo $!' > $OCF_RESKEY_pid + $OCF_RESKEY_additional_parameters"' >> /dev/null 2>&1 & echo $!' > $OCF_RESKEY_pid # Spin waiting for the server to come up. # Let the CRM/LRM time us out if required @@ -331,7 +331,7 @@ keystone_stop() { if [ $rc -ne $OCF_NOT_RUNNING ]; then # SIGTERM didn't help either, try SIGKILL ocf_log info "OpenStack Identity (Keystone) failed to stop after ${shutdown_timeout}s \ - using SIGTERM. Trying SIGKILL ..." + using SIGTERM. Trying SIGKILL ..." ocf_run kill -s KILL $pid fi @@ -345,10 +345,14 @@ keystone_stop() { ####################################################################### case "$1" in - meta-data) meta_data - exit $OCF_SUCCESS;; - usage|help) usage - exit $OCF_SUCCESS;; + meta-data) + meta_data + exit $OCF_SUCCESS + ;; + usage|help) + usage + exit $OCF_SUCCESS + ;; esac # Anything except meta-data and help must pass validation @@ -356,11 +360,22 @@ keystone_validate || exit $? # What kind of method was invoked? case "$1" in - start) keystone_start;; - stop) keystone_stop;; - status) keystone_status;; - monitor) keystone_monitor;; - validate-all) ;; - *) usage - exit $OCF_ERR_UNIMPLEMENTED;; + start) + keystone_start + ;; + stop) + keystone_stop + ;; + status) + keystone_status + ;; + monitor) + keystone_monitor + ;; + validate-all) + ;; + *) + usage + exit $OCF_ERR_UNIMPLEMENTED + ;; esac diff --git a/ocf/neutron-agent-dhcp b/ocf/neutron-agent-dhcp index 35c52c0..74aafc3 100644 --- a/ocf/neutron-agent-dhcp +++ b/ocf/neutron-agent-dhcp @@ -241,8 +241,8 @@ neutron_dhcp_agent_start() { # run the actual neutron-dhcp-agent daemon. Don't use ocf_run as we're sending the tool's output # straight to /dev/null anyway and using ocf_run would break stdout-redirection here. su ${OCF_RESKEY_user} -s /bin/sh -c "${OCF_RESKEY_binary} --config-file=$OCF_RESKEY_config \ - --config-file=$OCF_RESKEY_plugin_config --log-file=/var/log/neutron/dhcp-agent.log $OCF_RESKEY_additional_parameters"' >> \ - /dev/null 2>&1 & echo $!' > $OCF_RESKEY_pid + --config-file=$OCF_RESKEY_plugin_config --log-file=/var/log/neutron/dhcp-agent.log $OCF_RESKEY_additional_parameters"' >> \ + /dev/null 2>&1 & echo $!' > $OCF_RESKEY_pid # Spin waiting for the server to come up. # Let the CRM/LRM time us out if required @@ -304,7 +304,7 @@ neutron_dhcp_agent_stop() { if [ $rc -ne $OCF_NOT_RUNNING ]; then # SIGTERM didn't help either, try SIGKILL ocf_log info "OpenStack DHCP Server (neutron-dhcp-agent) failed to stop after ${shutdown_timeout}s \ - using SIGTERM. Trying SIGKILL ..." + using SIGTERM. Trying SIGKILL ..." ocf_run kill -s KILL $pid fi @@ -318,10 +318,14 @@ neutron_dhcp_agent_stop() { ####################################################################### case "$1" in - meta-data) meta_data - exit $OCF_SUCCESS;; - usage|help) usage - exit $OCF_SUCCESS;; + meta-data) + meta_data + exit $OCF_SUCCESS + ;; + usage|help) + usage + exit $OCF_SUCCESS + ;; esac # Anything except meta-data and help must pass validation @@ -329,11 +333,22 @@ neutron_dhcp_agent_validate || exit $? # What kind of method was invoked? case "$1" in - start) neutron_dhcp_agent_start;; - stop) neutron_dhcp_agent_stop;; - status) neutron_dhcp_agent_status;; - monitor) neutron_dhcp_agent_monitor;; - validate-all) ;; - *) usage - exit $OCF_ERR_UNIMPLEMENTED;; + start) + neutron_dhcp_agent_start + ;; + stop) + neutron_dhcp_agent_stop + ;; + status) + neutron_dhcp_agent_status + ;; + monitor) + neutron_dhcp_agent_monitor + ;; + validate-all) + ;; + *) + usage + exit $OCF_ERR_UNIMPLEMENTED + ;; esac diff --git a/ocf/neutron-agent-l3 b/ocf/neutron-agent-l3 index 2b6be7e..f689150 100644 --- a/ocf/neutron-agent-l3 +++ b/ocf/neutron-agent-l3 @@ -243,8 +243,8 @@ neutron_l3_agent_start() { # run the actual neutron-l3-agent daemon. Don't use ocf_run as we're sending the tool's output # straight to /dev/null anyway and using ocf_run would break stdout-redirection here. su ${OCF_RESKEY_user} -s /bin/sh -c "${OCF_RESKEY_binary} --config-file=$OCF_RESKEY_config \ - --config-file=$OCF_RESKEY_plugin_config --log-file=/var/log/neutron/l3-agent.log $OCF_RESKEY_additional_parameters"' >> \ - /dev/null 2>&1 & echo $!' > $OCF_RESKEY_pid + --config-file=$OCF_RESKEY_plugin_config --log-file=/var/log/neutron/l3-agent.log $OCF_RESKEY_additional_parameters"' >> \ + /dev/null 2>&1 & echo $!' > $OCF_RESKEY_pid # Spin waiting for the server to come up. # Let the CRM/LRM time us out if required @@ -305,7 +305,7 @@ neutron_l3_agent_stop() { if [ $rc -ne $OCF_NOT_RUNNING ]; then # SIGTERM didn't help either, try SIGKILL ocf_log info "OpenStack L3 Server (neutron-l3-agent) failed to stop after ${shutdown_timeout}s \ - using SIGTERM. Trying SIGKILL ..." + using SIGTERM. Trying SIGKILL ..." ocf_run kill -s KILL $pid fi @@ -319,10 +319,14 @@ neutron_l3_agent_stop() { ####################################################################### case "$1" in - meta-data) meta_data - exit $OCF_SUCCESS;; - usage|help) usage - exit $OCF_SUCCESS;; + meta-data) + meta_data + exit $OCF_SUCCESS + ;; + usage|help) + usage + exit $OCF_SUCCESS + ;; esac # Anything except meta-data and help must pass validation @@ -330,11 +334,22 @@ neutron_l3_agent_validate || exit $? # What kind of method was invoked? case "$1" in - start) neutron_l3_agent_start;; - stop) neutron_l3_agent_stop;; - status) neutron_l3_agent_status;; - monitor) neutron_l3_agent_monitor;; - validate-all) ;; - *) usage - exit $OCF_ERR_UNIMPLEMENTED;; + start) + neutron_l3_agent_start + ;; + stop) + neutron_l3_agent_stop + ;; + status) + neutron_l3_agent_status + ;; + monitor) + neutron_l3_agent_monitor + ;; + validate-all) + ;; + *) + usage + exit $OCF_ERR_UNIMPLEMENTED + ;; esac diff --git a/ocf/neutron-ha-tool b/ocf/neutron-ha-tool index 50465f3..81e8324 100644 --- a/ocf/neutron-ha-tool +++ b/ocf/neutron-ha-tool @@ -230,10 +230,14 @@ neutron_ha_tool_stop() { ####################################################################### case "$1" in - meta-data) meta_data - exit $OCF_SUCCESS;; - usage|help) usage - exit $OCF_SUCCESS;; + meta-data) + meta_data + exit $OCF_SUCCESS + ;; + usage|help) + usage + exit $OCF_SUCCESS + ;; esac # Anything except meta-data and help must pass validation @@ -250,11 +254,22 @@ fi # What kind of method was invoked? case "$1" in - start) neutron_ha_tool_start;; - stop) neutron_ha_tool_stop;; - status) neutron_ha_tool_status;; - monitor) neutron_ha_tool_monitor;; - validate-all) ;; - *) usage - exit $OCF_ERR_UNIMPLEMENTED;; + start) + neutron_ha_tool_start + ;; + stop) + neutron_ha_tool_stop + ;; + status) + neutron_ha_tool_status + ;; + monitor) + neutron_ha_tool_monitor + ;; + validate-all) + ;; + *) + usage + exit $OCF_ERR_UNIMPLEMENTED + ;; esac diff --git a/ocf/neutron-metadata-agent b/ocf/neutron-metadata-agent index 4485099..d901f3e 100644 --- a/ocf/neutron-metadata-agent +++ b/ocf/neutron-metadata-agent @@ -294,7 +294,7 @@ neutron_metadata_agent_stop() { if [ $rc -ne $OCF_NOT_RUNNING ]; then # SIGTERM didn't help either, try SIGKILL ocf_log info "OpenStack Neutron Metadata Agent (neutron-metadata-agent) failed to stop after ${shutdown_timeout}s \ - using SIGTERM. Trying SIGKILL ..." + using SIGTERM. Trying SIGKILL ..." ocf_run kill -s KILL $pid fi @@ -308,10 +308,14 @@ neutron_metadata_agent_stop() { ####################################################################### case "$1" in - meta-data) meta_data - exit $OCF_SUCCESS;; - usage|help) usage - exit $OCF_SUCCESS;; + meta-data) + meta_data + exit $OCF_SUCCESS + ;; + usage|help) + usage + exit $OCF_SUCCESS + ;; esac # Anything except meta-data and help must pass validation @@ -319,11 +323,22 @@ neutron_metadata_agent_validate || exit $? # What kind of method was invoked? case "$1" in - start) neutron_metadata_agent_start;; - stop) neutron_metadata_agent_stop;; - status) neutron_metadata_agent_status;; - monitor) neutron_metadata_agent_monitor;; - validate-all) ;; - *) usage - exit $OCF_ERR_UNIMPLEMENTED;; + start) + neutron_metadata_agent_start + ;; + stop) + neutron_metadata_agent_stop + ;; + status) + neutron_metadata_agent_status + ;; + monitor) + neutron_metadata_agent_monitor + ;; + validate-all) + ;; + *) + usage + exit $OCF_ERR_UNIMPLEMENTED + ;; esac diff --git a/ocf/neutron-server b/ocf/neutron-server index c3a5afa..841d7b2 100644 --- a/ocf/neutron-server +++ b/ocf/neutron-server @@ -347,7 +347,7 @@ neutron_server_stop() { if [ $rc -ne $OCF_NOT_RUNNING ]; then # SIGTERM didn't help either, try SIGKILL ocf_log info "OpenStack Neutron Server (neutron-server) failed to stop after ${shutdown_timeout}s \ - using SIGTERM. Trying SIGKILL ..." + using SIGTERM. Trying SIGKILL ..." ocf_run kill -s KILL $pid fi @@ -361,10 +361,14 @@ neutron_server_stop() { ####################################################################### case "$1" in - meta-data) meta_data - exit $OCF_SUCCESS;; - usage|help) usage - exit $OCF_SUCCESS;; + meta-data) + meta_data + exit $OCF_SUCCESS + ;; + usage|help) + usage + exit $OCF_SUCCESS + ;; esac # Anything except meta-data and help must pass validation @@ -372,11 +376,22 @@ neutron_server_validate || exit $? # What kind of method was invoked? case "$1" in - start) neutron_server_start;; - stop) neutron_server_stop;; - status) neutron_server_status;; - monitor) neutron_server_monitor;; - validate-all) ;; - *) usage - exit $OCF_ERR_UNIMPLEMENTED;; + start) + neutron_server_start + ;; + stop) + neutron_server_stop + ;; + status) + neutron_server_status + ;; + monitor) + neutron_server_monitor + ;; + validate-all) + ;; + *) + usage + exit $OCF_ERR_UNIMPLEMENTED + ;; esac diff --git a/ocf/nova-api b/ocf/nova-api index 3f899da..934e7ed 100644 --- a/ocf/nova-api +++ b/ocf/nova-api @@ -247,9 +247,9 @@ nova_api_monitor() { if [ -n "$OCF_RESKEY_os_username" ] && [ -n "$OCF_RESKEY_os_password" ] \ && [ -n "$OCF_RESKEY_os_tenant_name" ] && [ -n "$OCF_RESKEY_keystone_get_token_url" ]; then token=`curl -s -d "{\"auth\":{\"passwordCredentials\": {\"username\": \"$OCF_RESKEY_os_username\", \ - \"password\": \"$OCF_RESKEY_os_password\"}, \"tenantName\": \"$OCF_RESKEY_os_tenant_name\"}}" \ - -H "Content-type: application/json" $OCF_RESKEY_keystone_get_token_url | tr ',' '\n' | grep '"id":' \ - | cut -d'"' -f4 | head --lines 1` + \"password\": \"$OCF_RESKEY_os_password\"}, \"tenantName\": \"$OCF_RESKEY_os_tenant_name\"}}" \ + -H "Content-type: application/json" $OCF_RESKEY_keystone_get_token_url | tr ',' '\n' | grep '"id":' \ + | cut -d'"' -f4 | head --lines 1` http_code=`curl --write-out %{http_code} --output /dev/null -sH "X-Auth-Token: $token" $OCF_RESKEY_url` rc=$? if [ $rc -ne 0 ] || [ $http_code -ne 200 ]; then @@ -275,7 +275,7 @@ nova_api_start() { # run the actual nova-api daemon. Don't use ocf_run as we're sending the tool's output # straight to /dev/null anyway and using ocf_run would break stdout-redirection here. su ${OCF_RESKEY_user} -s /bin/sh -c "${OCF_RESKEY_binary} --config-file=$OCF_RESKEY_config \ - $OCF_RESKEY_additional_parameters"' >> /dev/null 2>&1 & echo $!' > $OCF_RESKEY_pid + $OCF_RESKEY_additional_parameters"' >> /dev/null 2>&1 & echo $!' > $OCF_RESKEY_pid # Spin waiting for the server to come up. # Let the CRM/LRM time us out if required @@ -336,7 +336,7 @@ nova_api_stop() { if [ $rc -ne $OCF_NOT_RUNNING ]; then # SIGTERM didn't help either, try SIGKILL ocf_log info "OpenStack Nova API (nova-api) failed to stop after ${shutdown_timeout}s \ - using SIGTERM. Trying SIGKILL ..." + using SIGTERM. Trying SIGKILL ..." ocf_run kill -s KILL $pid fi @@ -350,10 +350,14 @@ nova_api_stop() { ####################################################################### case "$1" in - meta-data) meta_data - exit $OCF_SUCCESS;; - usage|help) usage - exit $OCF_SUCCESS;; + meta-data) + meta_data + exit $OCF_SUCCESS + ;; + usage|help) + usage + exit $OCF_SUCCESS + ;; esac # Anything except meta-data and help must pass validation @@ -361,12 +365,23 @@ nova_api_validate || exit $? # What kind of method was invoked? case "$1" in - start) nova_api_start;; - stop) nova_api_stop;; - status) nova_api_status;; - monitor) nova_api_monitor;; - validate-all) ;; - *) usage - exit $OCF_ERR_UNIMPLEMENTED;; + start) + nova_api_start + ;; + stop) + nova_api_stop + ;; + status) + nova_api_status + ;; + monitor) + nova_api_monitor + ;; + validate-all) + ;; + *) + usage + exit $OCF_ERR_UNIMPLEMENTED + ;; esac diff --git a/ocf/nova-cert b/ocf/nova-cert index cc1657a..4aaebc4 100644 --- a/ocf/nova-cert +++ b/ocf/nova-cert @@ -288,7 +288,7 @@ nova_cert_start() { # run the actual nova-cert daemon. Don't use ocf_run as we're sending the tool's output # straight to /dev/null anyway and using ocf_run would break stdout-redirection here. su ${OCF_RESKEY_user} -s /bin/sh -c "${OCF_RESKEY_binary} --config-file=$OCF_RESKEY_config \ - $OCF_RESKEY_additional_parameters"' >> /dev/null 2>&1 & echo $!' > $OCF_RESKEY_pid + $OCF_RESKEY_additional_parameters"' >> /dev/null 2>&1 & echo $!' > $OCF_RESKEY_pid # Spin waiting for the server to come up. # Let the CRM/LRM time us out if required @@ -349,7 +349,7 @@ nova_cert_stop() { if [ $rc -ne $OCF_NOT_RUNNING ]; then # SIGTERM didn't help either, try SIGKILL ocf_log info "OpenStack Nova Cert (nova-cert) failed to stop after ${shutdown_timeout}s \ - using SIGTERM. Trying SIGKILL ..." + using SIGTERM. Trying SIGKILL ..." ocf_run kill -s KILL $pid fi @@ -363,10 +363,14 @@ nova_cert_stop() { ####################################################################### case "$1" in - meta-data) meta_data - exit $OCF_SUCCESS;; - usage|help) usage - exit $OCF_SUCCESS;; + meta-data) + meta_data + exit $OCF_SUCCESS + ;; + usage|help) + usage + exit $OCF_SUCCESS + ;; esac # Anything except meta-data and help must pass validation @@ -374,12 +378,23 @@ nova_cert_validate || exit $? # What kind of method was invoked? case "$1" in - start) nova_cert_start;; - stop) nova_cert_stop;; - status) nova_cert_status;; - monitor) nova_cert_monitor;; - validate-all) ;; - *) usage - exit $OCF_ERR_UNIMPLEMENTED;; + start) + nova_cert_start + ;; + stop) + nova_cert_stop + ;; + status) + nova_cert_status + ;; + monitor) + nova_cert_monitor + ;; + validate-all) + ;; + *) + usage + exit $OCF_ERR_UNIMPLEMENTED + ;; esac diff --git a/ocf/nova-consoleauth b/ocf/nova-consoleauth index a964a8c..9713174 100644 --- a/ocf/nova-consoleauth +++ b/ocf/nova-consoleauth @@ -288,7 +288,7 @@ nova_consoleauth_start() { # run the actual nova-consoleauth daemon. Don't use ocf_run as we're sending the tool's output # straight to /dev/null anyway and using ocf_run would break stdout-redirection here. su ${OCF_RESKEY_user} -s /bin/sh -c "${OCF_RESKEY_binary} --config-file=$OCF_RESKEY_config \ - $OCF_RESKEY_additional_parameters"' >> /dev/null 2>&1 & echo $!' > $OCF_RESKEY_pid + $OCF_RESKEY_additional_parameters"' >> /dev/null 2>&1 & echo $!' > $OCF_RESKEY_pid # Spin waiting for the server to come up. # Let the CRM/LRM time us out if required @@ -349,7 +349,7 @@ nova_consoleauth_stop() { if [ $rc -ne $OCF_NOT_RUNNING ]; then # SIGTERM didn't help either, try SIGKILL ocf_log info "OpenStack Nova ConsoleAuth (nova-consoleauth) failed to stop after ${shutdown_timeout}s \ - using SIGTERM. Trying SIGKILL ..." + using SIGTERM. Trying SIGKILL ..." ocf_run kill -s KILL $pid fi @@ -363,10 +363,14 @@ nova_consoleauth_stop() { ####################################################################### case "$1" in - meta-data) meta_data - exit $OCF_SUCCESS;; - usage|help) usage - exit $OCF_SUCCESS;; + meta-data) + meta_data + exit $OCF_SUCCESS + ;; + usage|help) + usage + exit $OCF_SUCCESS + ;; esac # Anything except meta-data and help must pass validation @@ -374,12 +378,23 @@ nova_consoleauth_validate || exit $? # What kind of method was invoked? case "$1" in - start) nova_consoleauth_start;; - stop) nova_consoleauth_stop;; - status) nova_consoleauth_status;; - monitor) nova_consoleauth_monitor;; - validate-all) ;; - *) usage - exit $OCF_ERR_UNIMPLEMENTED;; + start) + nova_consoleauth_start + ;; + stop) + nova_consoleauth_stop + ;; + status) + nova_consoleauth_status + ;; + monitor) + nova_consoleauth_monitor + ;; + validate-all) + ;; + *) + usage + exit $OCF_ERR_UNIMPLEMENTED + ;; esac diff --git a/ocf/nova-network b/ocf/nova-network index 7541971..bbf78b3 100644 --- a/ocf/nova-network +++ b/ocf/nova-network @@ -267,7 +267,7 @@ nova_network_start() { # run the actual nova-network daemon. Don't use ocf_run as we're sending the tool's output # straight to /dev/null anyway and using ocf_run would break stdout-redirection here. su ${OCF_RESKEY_user} -s /bin/sh -c "${OCF_RESKEY_binary} --config-file=$OCF_RESKEY_config \ - $OCF_RESKEY_additional_parameters"' >> /dev/null 2>&1 & echo $!' > $OCF_RESKEY_pid + $OCF_RESKEY_additional_parameters"' >> /dev/null 2>&1 & echo $!' > $OCF_RESKEY_pid # Spin waiting for the server to come up. # Let the CRM/LRM time us out if required @@ -329,7 +329,7 @@ nova_network_stop() { if [ $rc -ne $OCF_NOT_RUNNING ]; then # SIGTERM didn't help either, try SIGKILL ocf_log info "OpenStack Nova Network (nova-network) failed to stop after ${shutdown_timeout}s \ - using SIGTERM. Trying SIGKILL ..." + using SIGTERM. Trying SIGKILL ..." ocf_run kill -s KILL $pid fi @@ -343,10 +343,14 @@ nova_network_stop() { ####################################################################### case "$1" in - meta-data) meta_data - exit $OCF_SUCCESS;; - usage|help) usage - exit $OCF_SUCCESS;; + meta-data) + meta_data + exit $OCF_SUCCESS + ;; + usage|help) + usage + exit $OCF_SUCCESS + ;; esac # Anything except meta-data and help must pass validation @@ -354,11 +358,22 @@ nova_network_validate || exit $? # What kind of method was invoked? case "$1" in - start) nova_network_start;; - stop) nova_network_stop;; - status) nova_network_status;; - monitor) nova_network_monitor;; - validate-all) ;; - *) usage - exit $OCF_ERR_UNIMPLEMENTED;; + start) + nova_network_start + ;; + stop) + nova_network_stop + ;; + status) + nova_network_status + ;; + monitor) + nova_network_monitor + ;; + validate-all) + ;; + *) + usage + exit $OCF_ERR_UNIMPLEMENTED + ;; esac diff --git a/ocf/nova-novnc b/ocf/nova-novnc index 1240dde..3d3ed2b 100644 --- a/ocf/nova-novnc +++ b/ocf/nova-novnc @@ -237,7 +237,7 @@ nova_vnc_console_start() { # run the actual nova-novncproxy daemon. Don't use ocf_run as we're sending the tool's output # straight to /dev/null anyway and using ocf_run would break stdout-redirection here. su ${OCF_RESKEY_user} -s /bin/sh -c "${OCF_RESKEY_binary} --config-file=$OCF_RESKEY_config --web /usr/share/novnc/ \ - $OCF_RESKEY_additional_parameters"' >> /dev/null 2>&1 & echo $!' > $OCF_RESKEY_pid + $OCF_RESKEY_additional_parameters"' >> /dev/null 2>&1 & echo $!' > $OCF_RESKEY_pid # Spin waiting for the server to come up. # Let the CRM/LRM time us out if required @@ -298,7 +298,7 @@ nova_vnc_console_stop() { if [ $rc -ne $OCF_NOT_RUNNING ]; then # SIGTERM didn't help either, try SIGKILL ocf_log info "OpenStack Nova VNC Console (nova-novncproxy) failed to stop after ${shutdown_timeout}s \ - using SIGTERM. Trying SIGKILL ..." + using SIGTERM. Trying SIGKILL ..." ocf_run kill -s KILL $pid fi @@ -312,10 +312,14 @@ nova_vnc_console_stop() { ####################################################################### case "$1" in - meta-data) meta_data - exit $OCF_SUCCESS;; - usage|help) usage - exit $OCF_SUCCESS;; + meta-data) + meta_data + exit $OCF_SUCCESS + ;; + usage|help) + usage + exit $OCF_SUCCESS + ;; esac # Anything except meta-data and help must pass validation @@ -323,12 +327,23 @@ nova_vnc_console_validate || exit $? # What kind of method was invoked? case "$1" in - start) nova_vnc_console_start;; - stop) nova_vnc_console_stop;; - status) nova_vnc_console_status;; - monitor) nova_vnc_console_monitor;; - validate-all) ;; - *) usage - exit $OCF_ERR_UNIMPLEMENTED;; + start) + nova_vnc_console_start + ;; + stop) + nova_vnc_console_stop + ;; + status) + nova_vnc_console_status + ;; + monitor) + nova_vnc_console_monitor + ;; + validate-all) + ;; + *) + usage + exit $OCF_ERR_UNIMPLEMENTED + ;; esac diff --git a/ocf/nova-scheduler b/ocf/nova-scheduler index c54e9fd..3ccf7fa 100644 --- a/ocf/nova-scheduler +++ b/ocf/nova-scheduler @@ -287,7 +287,7 @@ nova_scheduler_start() { # run the actual nova-scheduler daemon. Don't use ocf_run as we're sending the tool's output # straight to /dev/null anyway and using ocf_run would break stdout-redirection here. su ${OCF_RESKEY_user} -s /bin/sh -c "${OCF_RESKEY_binary} --config-file=$OCF_RESKEY_config \ - $OCF_RESKEY_additional_parameters"' >> /dev/null 2>&1 & echo $!' > $OCF_RESKEY_pid + $OCF_RESKEY_additional_parameters"' >> /dev/null 2>&1 & echo $!' > $OCF_RESKEY_pid # Spin waiting for the server to come up. while true; do @@ -347,7 +347,7 @@ nova_scheduler_stop() { if [ $rc -ne $OCF_NOT_RUNNING ]; then # SIGTERM didn't help either, try SIGKILL ocf_log info "OpenStack Nova Scheduler (nova-scheduler) failed to stop after ${shutdown_timeout}s \ - using SIGTERM. Trying SIGKILL ..." + using SIGTERM. Trying SIGKILL ..." ocf_run kill -s KILL $pid fi @@ -361,10 +361,14 @@ nova_scheduler_stop() { ####################################################################### case "$1" in - meta-data) meta_data - exit $OCF_SUCCESS;; - usage|help) usage - exit $OCF_SUCCESS;; + meta-data) + meta_data + exit $OCF_SUCCESS + ;; + usage|help) + usage + exit $OCF_SUCCESS + ;; esac # Anything except meta-data and help must pass validation @@ -372,12 +376,23 @@ nova_scheduler_validate || exit $? # What kind of method was invoked? case "$1" in - start) nova_scheduler_start;; - stop) nova_scheduler_stop;; - status) nova_scheduler_status;; - monitor) nova_scheduler_monitor;; - validate-all) ;; - *) usage - exit $OCF_ERR_UNIMPLEMENTED;; + start) + nova_scheduler_start + ;; + stop) + nova_scheduler_stop + ;; + status) + nova_scheduler_status + ;; + monitor) + nova_scheduler_monitor + ;; + validate-all) + ;; + *) + usage + exit $OCF_ERR_UNIMPLEMENTED + ;; esac