Patchwork [1/1] rpcbind: fix init status and exit code

login
register
mail settings
Submitter wenzong.fan@windriver.com
Date Dec. 11, 2013, 9:07 a.m.
Message ID <6e1ed6ec99f4074ec6422f6de09429008bf01e22.1386752117.git.wenzong.fan@windriver.com>
Download mbox | patch
Permalink /patch/63219/
State Accepted
Commit 46215bd89e2e1136d6af7bacd5931952ee21716b
Headers show

Comments

wenzong.fan@windriver.com - Dec. 11, 2013, 9:07 a.m.
From: Wenzong Fan <wenzong.fan@windriver.com>

Print status messages and exit with proper code. This also allows debian
service script to get rpcbind status correctly.

Signed-off-by: Wenzong Fan <wenzong.fan@windriver.com>
---
 meta/recipes-extended/rpcbind/rpcbind/init.d |    8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

Patch

diff --git a/meta/recipes-extended/rpcbind/rpcbind/init.d b/meta/recipes-extended/rpcbind/rpcbind/init.d
index d418673..67499aa 100644
--- a/meta/recipes-extended/rpcbind/rpcbind/init.d
+++ b/meta/recipes-extended/rpcbind/rpcbind/init.d
@@ -16,6 +16,9 @@ 
 #                    RPC include NFS and NIS.
 ### END INIT INFO
 
+# Source function library.
+. /etc/init.d/functions
+
 test -f /sbin/rpcbind || exit 0
 
 OPTIONS=""
@@ -73,8 +76,7 @@  case "$1" in
         start $OPTIONS
         ;;
     status)
-        pidof /sbin/rpcbind >/dev/null
-        exit $?
+        status /sbin/rpcbind
         ;;
     *)
         echo "Usage: /etc/init.d/rpcbind {start|stop|force-reload|restart|status}"
@@ -82,4 +84,4 @@  case "$1" in
         ;;
 esac
 
-exit 0
+exit $?