summaryrefslogtreecommitdiff
path: root/meta/recipes-core/initscripts
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:46:13 +0000
commitadcb39845b6d3af9472fa5051a1d918344eb6bda (patch)
tree99a925c4ced9d24b5ebe23279ee9e2f2d6355234 /meta/recipes-core/initscripts
parent0b58d98567a1c0531ad8396c4464402da21a9665 (diff)
downloadopenembedded-core-adcb39845b6d3af9472fa5051a1d918344eb6bda.tar.gz
openembedded-core-adcb39845b6d3af9472fa5051a1d918344eb6bda.tar.bz2
openembedded-core-adcb39845b6d3af9472fa5051a1d918344eb6bda.zip
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. 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>
Diffstat (limited to 'meta/recipes-core/initscripts')
-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
killproc() { # kill the named process(es)
pid=`pidofproc $1` && kill $pid
}
+
+status() {
+ local pid
+ if [ "$#" = 0 ]; then
+ echo "Usage: status {program}"
+ return 1
+ fi
+ pid=`pidofproc $1`
+ if [ -n "$pid" ]; then
+ echo "$1 (pid $pid) is running..."
+ else
+ echo "$1 is stopped"
+ fi
+ return 3
+}
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
SECTION = "base"
LICENSE = "GPLv2"
LIC_FILES_CHKSUM = "file://COPYING;md5=751419260aa954499f7abaabaa882bbe"
-PR = "r139"
+PR = "r140"
INHIBIT_DEFAULT_DEPS = "1"