[meta-virtualization] [meta-cloud-services][PATCH 2/6] init: no need to close (non-existing) ps file descriptors

Mark Asselstine mark.asselstine at windriver.com
Wed Nov 11 18:50:27 PST 2015


Attempting to get the status of various daemons which are part of the
compute image results in an error:

ps: write error: Bad file descriptor

Switch to using the more standard io redirection techniques to avoid
this error.

Signed-off-by: Mark Asselstine <mark.asselstine at windriver.com>
---
 meta-openstack/recipes-devtools/python/python-barbican/barbican.init    | 2 +-
 .../recipes-devtools/python/python-ceilometer/ceilometer.init           | 2 +-
 meta-openstack/recipes-devtools/python/python-cinder/cinder-volume      | 2 +-
 meta-openstack/recipes-devtools/python/python-cinder/cinder.init        | 2 +-
 meta-openstack/recipes-devtools/python/python-glance/glance.init        | 2 +-
 meta-openstack/recipes-devtools/python/python-heat/heat.init            | 2 +-
 meta-openstack/recipes-devtools/python/python-horizon/horizon.init      | 2 +-
 meta-openstack/recipes-devtools/python/python-keystone/keystone         | 2 +-
 .../recipes-devtools/python/python-neutron/neutron-agent.init           | 2 +-
 .../recipes-devtools/python/python-neutron/neutron-server.init          | 2 +-
 meta-openstack/recipes-devtools/python/python-nova/nova-all             | 2 +-
 meta-openstack/recipes-devtools/python/python-nova/nova-consoleauth     | 2 +-
 meta-openstack/recipes-devtools/python/python-nova/nova.init            | 2 +-
 meta-openstack/recipes-devtools/python/python-rally/rally.init          | 2 +-
 meta-openstack/recipes-devtools/python/python-trove/trove-init          | 2 +-
 15 files changed, 15 insertions(+), 15 deletions(-)

diff --git a/meta-openstack/recipes-devtools/python/python-barbican/barbican.init b/meta-openstack/recipes-devtools/python/python-barbican/barbican.init
index 5b353e1..a23a493 100644
--- a/meta-openstack/recipes-devtools/python/python-barbican/barbican.init
+++ b/meta-openstack/recipes-devtools/python/python-barbican/barbican.init
@@ -71,7 +71,7 @@ status()
 {
     pid=`cat $PIDFILE 2>/dev/null`
     if [ -n "$pid" ]; then
-        if ps -p $pid >&- ; then
+        if ps -p $pid > /dev/null 2>&1 ; then
             echo "$DESC is running"
             return
         fi
diff --git a/meta-openstack/recipes-devtools/python/python-ceilometer/ceilometer.init b/meta-openstack/recipes-devtools/python/python-ceilometer/ceilometer.init
index ba0f426..80fdff5 100644
--- a/meta-openstack/recipes-devtools/python/python-ceilometer/ceilometer.init
+++ b/meta-openstack/recipes-devtools/python/python-ceilometer/ceilometer.init
@@ -62,7 +62,7 @@ status()
 {
     pid=`cat $PIDFILE 2>/dev/null`
     if [ -n "$pid" ]; then
-        if ps -p $pid >&- ; then
+        if ps -p $pid > /dev/null 2>&1; then
             echo "$DESC is running"
             return
         fi
diff --git a/meta-openstack/recipes-devtools/python/python-cinder/cinder-volume b/meta-openstack/recipes-devtools/python/python-cinder/cinder-volume
index f753810..7d0aa14 100644
--- a/meta-openstack/recipes-devtools/python/python-cinder/cinder-volume
+++ b/meta-openstack/recipes-devtools/python/python-cinder/cinder-volume
@@ -61,7 +61,7 @@ status()
 {
     pid=`cat $PIDFILE 2>/dev/null`
     if [ -n "$pid" ]; then
-        if ps -p $pid >&- ; then
+        if ps -p $pid > /dev/null 2>&1 ; then
             echo "$DESC is running"
             return
         fi
diff --git a/meta-openstack/recipes-devtools/python/python-cinder/cinder.init b/meta-openstack/recipes-devtools/python/python-cinder/cinder.init
index f130ac8..4c97962 100644
--- a/meta-openstack/recipes-devtools/python/python-cinder/cinder.init
+++ b/meta-openstack/recipes-devtools/python/python-cinder/cinder.init
@@ -63,7 +63,7 @@ status()
 {
     pid=`cat $PIDFILE 2>/dev/null`
     if [ -n "$pid" ]; then
-        if ps -p $pid >&- ; then
+        if ps -p $pid > /dev/null 2>&1 ; then
             echo "$DESC is running"
             return
         fi
diff --git a/meta-openstack/recipes-devtools/python/python-glance/glance.init b/meta-openstack/recipes-devtools/python/python-glance/glance.init
index 5b1bf74..cbcfb0a 100644
--- a/meta-openstack/recipes-devtools/python/python-glance/glance.init
+++ b/meta-openstack/recipes-devtools/python/python-glance/glance.init
@@ -62,7 +62,7 @@ status()
 {
     pid=`cat $PIDFILE 2>/dev/null`
     if [ -n "$pid" ]; then
-        if ps -p $pid >&- ; then
+        if ps -p $pid > /dev/null 2>&1 ; then
             echo "$DESC is running"
             return
         fi
diff --git a/meta-openstack/recipes-devtools/python/python-heat/heat.init b/meta-openstack/recipes-devtools/python/python-heat/heat.init
index 5e0719f..794ac6a 100644
--- a/meta-openstack/recipes-devtools/python/python-heat/heat.init
+++ b/meta-openstack/recipes-devtools/python/python-heat/heat.init
@@ -68,7 +68,7 @@ status()
 {
     pid=`cat $PIDFILE 2>/dev/null`
     if [ -n "$pid" ]; then
-        if ps -p $pid >&- ; then
+        if ps -p $pid > /dev/null 2>&1 ; then
             echo "$DESC is running"
             return
         fi
diff --git a/meta-openstack/recipes-devtools/python/python-horizon/horizon.init b/meta-openstack/recipes-devtools/python/python-horizon/horizon.init
index 994fbec..be79353 100644
--- a/meta-openstack/recipes-devtools/python/python-horizon/horizon.init
+++ b/meta-openstack/recipes-devtools/python/python-horizon/horizon.init
@@ -58,7 +58,7 @@ status()
 {
     pid=`cat $PIDFILE 2>/dev/null`
     if [ -n "$pid" ]; then
-        if ps -p $pid >&- ; then
+        if ps -p $pid > /dev/null 2>&1 ; then
             echo "$DESC is running"
             return
         fi
diff --git a/meta-openstack/recipes-devtools/python/python-keystone/keystone b/meta-openstack/recipes-devtools/python/python-keystone/keystone
index 8953da8..0d8a538 100644
--- a/meta-openstack/recipes-devtools/python/python-keystone/keystone
+++ b/meta-openstack/recipes-devtools/python/python-keystone/keystone
@@ -59,7 +59,7 @@ status()
 {
     pid=`cat $PIDFILE 2>/dev/null`
     if [ -n "$pid" ]; then
-        if ps -p $pid >&- ; then
+        if ps -p $pid > /dev/null 2>&1 ; then
             echo "$DESC is running"
             return
         fi
diff --git a/meta-openstack/recipes-devtools/python/python-neutron/neutron-agent.init b/meta-openstack/recipes-devtools/python/python-neutron/neutron-agent.init
index 8b11a27..c9d8d72 100644
--- a/meta-openstack/recipes-devtools/python/python-neutron/neutron-agent.init
+++ b/meta-openstack/recipes-devtools/python/python-neutron/neutron-agent.init
@@ -60,7 +60,7 @@ status()
 {
     pid=`cat $PIDFILE 2>/dev/null`
     if [ -n "$pid" ]; then
-        if ps -p $pid >&- ; then
+        if ps -p $pid > /dev/null 2>&1 ; then
             echo "$DESC is running"
             return
         fi
diff --git a/meta-openstack/recipes-devtools/python/python-neutron/neutron-server.init b/meta-openstack/recipes-devtools/python/python-neutron/neutron-server.init
index 0c78de6..77f8f01 100644
--- a/meta-openstack/recipes-devtools/python/python-neutron/neutron-server.init
+++ b/meta-openstack/recipes-devtools/python/python-neutron/neutron-server.init
@@ -63,7 +63,7 @@ status()
 {
     pid=`cat $PIDFILE 2>/dev/null`
     if [ -n "$pid" ]; then
-        if ps -p $pid >&- ; then
+        if ps -p $pid > /dev/null 2>&1 ; then
             echo "$DESC is running"
             return
         fi
diff --git a/meta-openstack/recipes-devtools/python/python-nova/nova-all b/meta-openstack/recipes-devtools/python/python-nova/nova-all
index c1d537d..914b714 100644
--- a/meta-openstack/recipes-devtools/python/python-nova/nova-all
+++ b/meta-openstack/recipes-devtools/python/python-nova/nova-all
@@ -62,7 +62,7 @@ status()
 {
     pid=`cat $PIDFILE 2>/dev/null`
     if [ -n "$pid" ]; then
-        if ps -p $pid >&- ; then
+        if ps -p $pid > /dev/null 2>&1 ; then
             echo "$DESC is running"
             return
         fi
diff --git a/meta-openstack/recipes-devtools/python/python-nova/nova-consoleauth b/meta-openstack/recipes-devtools/python/python-nova/nova-consoleauth
index 99f04d5..9a74107 100644
--- a/meta-openstack/recipes-devtools/python/python-nova/nova-consoleauth
+++ b/meta-openstack/recipes-devtools/python/python-nova/nova-consoleauth
@@ -48,7 +48,7 @@ status()
 {
     pid=`cat $PIDFILE 2>/dev/null`
     if [ -n "$pid" ]; then
-        if ps -p $pid >&- ; then
+        if ps -p $pid > /dev/null 2>&1 ; then
             echo "$DESC is running"
             return
         fi
diff --git a/meta-openstack/recipes-devtools/python/python-nova/nova.init b/meta-openstack/recipes-devtools/python/python-nova/nova.init
index 46b28d3..607b6de 100644
--- a/meta-openstack/recipes-devtools/python/python-nova/nova.init
+++ b/meta-openstack/recipes-devtools/python/python-nova/nova.init
@@ -78,7 +78,7 @@ status()
 {
     pid=`cat $PIDFILE 2>/dev/null`
     if [ -n "$pid" ]; then
-        if ps -p $pid >&- ; then
+        if ps -p $pid > /dev/null 2>&1 ; then
             echo "$DESC is running"
             return
         fi
diff --git a/meta-openstack/recipes-devtools/python/python-rally/rally.init b/meta-openstack/recipes-devtools/python/python-rally/rally.init
index e834547..6128e48 100644
--- a/meta-openstack/recipes-devtools/python/python-rally/rally.init
+++ b/meta-openstack/recipes-devtools/python/python-rally/rally.init
@@ -63,7 +63,7 @@ status()
 {
     pid=`cat $PIDFILE 2>/dev/null`
     if [ -n "$pid" ]; then
-        if ps -p $pid >&- ; then
+        if ps -p $pid > /dev/null 2>&1 ; then
             echo "$DESC is running"
             return
         fi
diff --git a/meta-openstack/recipes-devtools/python/python-trove/trove-init b/meta-openstack/recipes-devtools/python/python-trove/trove-init
index 584bf77..ee0bd21 100644
--- a/meta-openstack/recipes-devtools/python/python-trove/trove-init
+++ b/meta-openstack/recipes-devtools/python/python-trove/trove-init
@@ -73,7 +73,7 @@ status()
 {
     pid=`cat $PIDFILE 2>/dev/null`
     if [ -n "$pid" ]; then
-        if ps -p $pid >&- ; then
+        if ps -p $pid > /dev/null 2>&1 ; then
             echo "$DESC is running"
             return
         fi
-- 
2.1.4



More information about the meta-virtualization mailing list