]> git.openfabrics.org - ~emulex/for-vlad/old/compat-rdma.git/commitdiff
ofed-mic add check for existing ibpd to start function
authorPhil Cayton <phil.cayton@intel.com>
Tue, 19 Aug 2014 19:10:49 +0000 (12:10 -0700)
committerVladimir Sokolovsky <vlad@mellanox.com>
Wed, 20 Aug 2014 10:00:01 +0000 (13:00 +0300)
Add a check for an existing ibpd daemon before starting another.
This prevents multiple "service ofed-mic start" commands from
launching multiple copies of the ibpd daemon, spawning more
driver worker threads than intended.

ofed_scripts/ofed-mic [changed mode: 0644->0755]

old mode 100644 (file)
new mode 100755 (executable)
index 5c9d2f1..4ad6b08
@@ -178,14 +178,17 @@ start()
 
        if [ "$nohost" -eq 0 ]; then
                echo -n "host"
-               (/usr/sbin/ibpd &) &&
+               if [ ! "$(pidof /usr/sbin/ibpd)" ]; then
+                       (/usr/sbin/ibpd &)
+                       retval=$?
+               fi
                modprobe ib_uverbs &&
                modprobe ibp_server &&
                modprobe ibp_cm_server &&
                modprobe ibp_sa_server &&
                modprobe ibscif
 
-               retval=$?
+               retval+=$?
                [ $retval -eq 0 ] && eval $_success || eval $_failure
        fi