Merge pull request #3 from robertchoi8099/develop

UCLOUDNG-296 modify cinder-volume plugin so that it greps child pid.
This commit is contained in:
Andrew Yongjoon Kong
2013-06-04 19:23:04 -07:00

View File

@@ -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) # 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 # check the connections according to the PID
# [Robert] This isn't working because it greps wrong pid. Need to look into it later. # # [Robert] Fixed: Need to grep child_pid instead of pid.
# volume_amqp_check=`netstat -punt | grep -s "$OCF_RESKEY_amqp_server_port" | grep -s "$pid" | grep -qs "ESTABLISHED"` child_pid=`ps -o pid --no-headers --ppid $pid`
volume_amqp_check=`netstat -punt | grep -s "$OCF_RESKEY_amqp_server_port" | grep -qs "ESTABLISHED"` volume_amqp_check=`netstat -punt | grep -s "$OCF_RESKEY_amqp_server_port" | grep -s "$child_pid" | grep -qs "ESTABLISHED"`
rc=$? rc=$?
if [ $rc -ne 0 ]; then if [ $rc -ne 0 ]; then
ocf_log err "Cinder Volume is not connected to the AMQP server: $rc" ocf_log err "Cinder Volume is not connected to the AMQP server: $rc"