The Skeleton initscript doesn't work on minimal image
authorRobert Yang <liezhi.yang@windriver.com>
Mon, 15 Aug 2011 08:26:55 +0000 (16:26 +0800)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Mon, 15 Aug 2011 14:26:21 +0000 (15:26 +0100)
Fixes bug [YOCTO #1165]

The /etc/init.d/skeleton doesn't work on minimal image, this is
because of the pidofproc doesn't return "$?" correctly, so store
$? in the variable status would fix it.

(From OE-Core rev: 4d31193a6969df25bb85a9862b7295e85dcec04b)

Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/recipes-core/initscripts/initscripts-1.0/functions

index c1eac3e..dd7da2b 100644 (file)
@@ -18,7 +18,8 @@ pidofproc () {
 
        # pidof output null when no program is running, so no "2>/dev/null".
        pid=`pidof $1`
-       case $? in
+       status=$?
+       case $status in
        0)
                echo $pid
                return 0
@@ -28,7 +29,7 @@ pidofproc () {
                exit 127
                ;;
        *)
-               return $?
+               return $status
                ;;
        esac
 }