From f855722a129470660b6bbfe9e87abd96a59580b2 Mon Sep 17 00:00:00 2001 From: Robert Date: Tue, 4 Jun 2013 12:03:43 +0900 Subject: [PATCH] UCLOUDNG-296 modify cinder-volume plugin so that it greps child pid. --- files/default/cinder-volume | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/files/default/cinder-volume b/files/default/cinder-volume index 5f74da6..d3d9484 100644 --- a/files/default/cinder-volume +++ b/files/default/cinder-volume @@ -230,9 +230,9 @@ cinder_volume_monitor() { # 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 - # [Robert] This isn't working because it greps wrong pid. Need to look into it later. # - # volume_amqp_check=`netstat -punt | grep -s "$OCF_RESKEY_amqp_server_port" | grep -s "$pid" | grep -qs "ESTABLISHED"` - volume_amqp_check=`netstat -punt | grep -s "$OCF_RESKEY_amqp_server_port" | grep -qs "ESTABLISHED"` + # [Robert] Fixed: Need to grep child_pid instead of pid. + child_pid=`ps -o pid --no-headers --ppid $pid` + volume_amqp_check=`netstat -punt | grep -s "$OCF_RESKEY_amqp_server_port" | grep -s "$child_pid" | grep -qs "ESTABLISHED"` rc=$? if [ $rc -ne 0 ]; then ocf_log err "Cinder Volume is not connected to the AMQP server: $rc"