Patchwork [8/21] initscripts: let status return 0 when proc is running well

login
register
mail settings
Submitter Mark Hatle
Date May 29, 2013, 3:09 p.m.
Message ID <1369840203-21898-9-git-send-email-mark.hatle@windriver.com>
Download mbox | patch
Permalink /patch/50719/
State Accepted
Commit d9d4fdc769dfe6bf9838f5c5f3189a80f0e3cf90
Headers show

Comments

Mark Hatle - May 29, 2013, 3:09 p.m.
From: Jesse Zhang <sen.zhang@windriver.com>

Ensure that the status returns 0 instead of the last shell command result,
otherwise the calling script can not properly detect the status of pid.

Signed-off-by: Jesse Zhang <sen.zhang@windriver.com>
Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
---
 meta/recipes-core/initscripts/initscripts-1.0/functions | 1 +
 1 file changed, 1 insertion(+)

Patch

diff --git a/meta/recipes-core/initscripts/initscripts-1.0/functions b/meta/recipes-core/initscripts/initscripts-1.0/functions
index 944e3a5..8e15762 100644
--- a/meta/recipes-core/initscripts/initscripts-1.0/functions
+++ b/meta/recipes-core/initscripts/initscripts-1.0/functions
@@ -52,6 +52,7 @@  status() {
     pid=`pidofproc $1`
     if [ -n "$pid" ]; then
         echo "$1 (pid $pid) is running..."
+        return 0
     else
         echo "$1 is stopped"
     fi