Patchwork rpcbind: Fix rpcbind restart failure when rpcbind is not running

login
register
mail settings
Submitter Zhangle Yang
Date Nov. 27, 2013, 2 p.m.
Message ID <1385560821-10168-1-git-send-email-zhangle.yang@windriver.com>
Download mbox | patch
Permalink /patch/62479/
State Accepted
Commit 3ee3d3ac83cd36ad608b8ea7d6ea5a68a09a78c4
Headers show

Comments

Zhangle Yang - Nov. 27, 2013, 2 p.m.
From: Zhangle Yang <zhangle.yang@windriver.com>

"rpcbind restart" executes stop and then start function. However, if
rpcbind is not started, "exit 0" shall be run in stop function, so start
function will not be run at all. This patch changes "exit 0" to "return 0".

Signed-off-by: Zhangle Yang <zhangle.yang@windriver.com>
---
 meta/recipes-extended/rpcbind/rpcbind/init.d | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Patch

diff --git a/meta/recipes-extended/rpcbind/rpcbind/init.d b/meta/recipes-extended/rpcbind/rpcbind/init.d
index 5c756bb..d418673 100644
--- a/meta/recipes-extended/rpcbind/rpcbind/init.d
+++ b/meta/recipes-extended/rpcbind/rpcbind/init.d
@@ -47,7 +47,7 @@  stop ()
     echo "Stopping rpcbind daemon..."
     if ! pidof /sbin/rpcbind >/dev/null; then
         echo "not running."
-        exit 0
+        return 0
     fi
     start-stop-daemon --stop --quiet --exec /sbin/rpcbind
     if [ $? -eq 0 ]; then