Patchwork [5/6] sysklogd: add init.d/syslog status command for LSB compliance

login
register
mail settings
Submitter jackie huang
Date Aug. 20, 2013, 3:25 a.m.
Message ID <f7e4e6f405b910866847bb6037549824abb07815.1376968627.git.jackie.huang@windriver.com>
Download mbox | patch
Permalink /patch/56025/
State New
Headers show

Comments

jackie huang - Aug. 20, 2013, 3:25 a.m.
From: Jackie Huang <jackie.huang@windriver.com>

Signed-off-by: Li Wang <li.wang@windriver.com>
Signed-off-by: Jackie Huang <jackie.huang@windriver.com>
---
 meta/recipes-extended/sysklogd/files/sysklogd |   13 ++++++++++++-
 1 files changed, 12 insertions(+), 1 deletions(-)

Patch

diff --git a/meta/recipes-extended/sysklogd/files/sysklogd b/meta/recipes-extended/sysklogd/files/sysklogd
index dcbc81e..c966725 100755
--- a/meta/recipes-extended/sysklogd/files/sysklogd
+++ b/meta/recipes-extended/sysklogd/files/sysklogd
@@ -12,6 +12,9 @@ 
 # Short-Description:    System logger
 ### END INIT INFO
 
+# Source function library.
+. /etc/init.d/functions
+
 PATH=/bin:/usr/bin:/sbin:/usr/sbin
 
 pidfile_syslogd=/var/run/syslogd.pid
@@ -132,8 +135,16 @@  case "$1" in
 	$0 start
     fi
     ;;
+  status)
+    status syslogd;
+    RETVAL=$?
+    status klogd;
+    rval=$?
+    [ $RETVAL -eq 0 ] && exit $rval
+    exit $RETVAL
+    ;;
   *)
-    log_success_msg "Usage: /etc/init.d/sysklogd {start|stop|reload|restart|force-reload|reload-or-restart}"
+    log_success_msg "Usage: /etc/init.d/sysklogd {start|stop|reload|restart|force-reload|reload-or-restart|status}"
     exit 1
 esac