summaryrefslogtreecommitdiffstats
path: root/meta
diff options
context:
space:
mode:
authorJesse Zhang <sen.zhang@windriver.com>2013-01-26 17:18:54 +0800
committerRichard Purdie <richard.purdie@linuxfoundation.org>2013-02-08 14:50:38 +0000
commit2e913bc62abd9a5a1373bc9f0fbce68c0838cbdf (patch)
tree6ae0a583ddf72bbc3d4d76fd4fd31c7095c319a4 /meta
parent9a7b076176e6404bc68fb741086574a5b8662e65 (diff)
downloadpoky-2e913bc62abd9a5a1373bc9f0fbce68c0838cbdf.tar.gz
initscripts: Add status function to /etc/init.d/functions
[ CQID: WIND00388860 ] Many initscripts want a simple way to display status information. Add the 'status' function to the functions file. (From OE-Core rev: adcb39845b6d3af9472fa5051a1d918344eb6bda) Signed-off-by: Jesse Zhang <sen.zhang@windriver.com> Signed-off-by: Mark Hatle <mark.hatle@windriver.com> Signed-off-by: Saul Wold <sgw@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta')
-rw-r--r--meta/recipes-core/initscripts/initscripts-1.0/functions15
-rw-r--r--meta/recipes-core/initscripts/initscripts_1.0.bb2
2 files changed, 16 insertions, 1 deletions
diff --git a/meta/recipes-core/initscripts/initscripts-1.0/functions b/meta/recipes-core/initscripts/initscripts-1.0/functions
index dd7da2b1c3..944e3a59b0 100644
--- a/meta/recipes-core/initscripts/initscripts-1.0/functions
+++ b/meta/recipes-core/initscripts/initscripts-1.0/functions
@@ -42,3 +42,18 @@ machine_id() { # return the machine ID
42killproc() { # kill the named process(es) 42killproc() { # kill the named process(es)
43 pid=`pidofproc $1` && kill $pid 43 pid=`pidofproc $1` && kill $pid
44} 44}
45
46status() {
47 local pid
48 if [ "$#" = 0 ]; then
49 echo "Usage: status {program}"
50 return 1
51 fi
52 pid=`pidofproc $1`
53 if [ -n "$pid" ]; then
54 echo "$1 (pid $pid) is running..."
55 else
56 echo "$1 is stopped"
57 fi
58 return 3
59}
diff --git a/meta/recipes-core/initscripts/initscripts_1.0.bb b/meta/recipes-core/initscripts/initscripts_1.0.bb
index 68f80346ef..649e18269e 100644
--- a/meta/recipes-core/initscripts/initscripts_1.0.bb
+++ b/meta/recipes-core/initscripts/initscripts_1.0.bb
@@ -3,7 +3,7 @@ DESCRIPTION = "Initscripts provide the basic system startup initialization scrip
3SECTION = "base" 3SECTION = "base"
4LICENSE = "GPLv2" 4LICENSE = "GPLv2"
5LIC_FILES_CHKSUM = "file://COPYING;md5=751419260aa954499f7abaabaa882bbe" 5LIC_FILES_CHKSUM = "file://COPYING;md5=751419260aa954499f7abaabaa882bbe"
6PR = "r139" 6PR = "r140"
7 7
8INHIBIT_DEFAULT_DEPS = "1" 8INHIBIT_DEFAULT_DEPS = "1"
9 9