From: Phil Cayton Date: Tue, 19 Aug 2014 19:10:49 +0000 (-0700) Subject: ofed-mic add check for existing ibpd to start function X-Git-Tag: vofed-3.12-1-rc1~1 X-Git-Url: https://openfabrics.org/gitweb/?a=commitdiff_plain;h=6071f10c7e3d375fadab527005a682b0e0e3ff43;p=~emulex%2Ffor-vlad%2Fold%2Fcompat-rdma.git ofed-mic add check for existing ibpd to start function 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. --- diff --git a/ofed_scripts/ofed-mic b/ofed_scripts/ofed-mic old mode 100644 new mode 100755 index 5c9d2f1..4ad6b08 --- a/ofed_scripts/ofed-mic +++ b/ofed_scripts/ofed-mic @@ -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