]> code.ossystems Code Review - openembedded-core.git/commitdiff
initscripts: Avoid starting rpcbind daemon twice
authorYue Tao <Yue.Tao@windriver.com>
Fri, 25 May 2018 02:48:08 +0000 (10:48 +0800)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Tue, 29 May 2018 20:06:03 +0000 (21:06 +0100)
Check the status before start it to avoid duplicates.

Signed-off-by: Yue Tao <Yue.Tao@windriver.com>
Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
Signed-off-by: Jeff Polk <jeff.polk@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/recipes-core/initscripts/initscripts-1.0/mountnfs.sh

index fe6c19605f30c53229014b9933fd3285864f627d..be9f5970fa7a709d1e95e3445f8927f7a50dd501 100755 (executable)
@@ -67,9 +67,12 @@ if test "$rpcbind" = yes
 then
        if test -x /usr/sbin/rpcbind
        then
-               echo -n "Starting rpcbind... "
-               start-stop-daemon --start --quiet --exec /usr/sbin/rpcbind
-               sleep 2
+               service rpcbind status > /dev/null
+               if [ $? != 0 ]; then
+                       echo -n "Starting rpcbind..."
+                       start-stop-daemon --start --quiet --exec /usr/sbin/rpcbind
+                       sleep 2
+               fi
        fi
 fi