Patchwork [1/1] The Skeleton initscript doesn't work on minimal image

login
register
mail settings
Submitter Robert Yang
Date Aug. 15, 2011, 10:18 a.m.
Message ID <bdd2c02c63135504189aca642d137a097c219706.1313400143.git.liezhi.yang@windriver.com>
Download mbox | patch
Permalink /patch/9843/
State New, archived
Headers show

Comments

Robert Yang - Aug. 15, 2011, 10:18 a.m.
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.

Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
---
 .../initscripts/initscripts-1.0/functions          |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

Patch

diff --git a/meta/recipes-core/initscripts/initscripts-1.0/functions b/meta/recipes-core/initscripts/initscripts-1.0/functions
index c1eac3e..dd7da2b 100644
--- a/meta/recipes-core/initscripts/initscripts-1.0/functions
+++ b/meta/recipes-core/initscripts/initscripts-1.0/functions
@@ -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
 }