Patchwork [6/6] at: add init.d/atd status command for LSB compliance

login
register
mail settings
Submitter jackie huang
Date Aug. 20, 2013, 3:25 a.m.
Message ID <a1ff23db8b1205cf7f51bd24776c94b3ac0dff9a.1376968627.git.jackie.huang@windriver.com>
Download mbox | patch
Permalink /patch/56027/
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/at/files/S99at |   13 ++++++++++++-
 1 files changed, 12 insertions(+), 1 deletions(-)

Patch

diff --git a/meta/recipes-extended/at/files/S99at b/meta/recipes-extended/at/files/S99at
index 386f8a4..d2ba34b 100644
--- a/meta/recipes-extended/at/files/S99at
+++ b/meta/recipes-extended/at/files/S99at
@@ -5,6 +5,9 @@ 
 
 umask 077
 
+# Source function library.
+. /etc/init.d/functions
+
 start() {
 	echo -n "Starting atd: "
 	start-stop-daemon --start --quiet --pidfile /var/run/atd.pid --background --exec /usr/sbin/atd -- -f
@@ -20,6 +23,11 @@  restart() {
 	start
 }
 
+rh_status() {
+    # run checks to determine if the service is running or use generic status
+    status /usr/sbin/atd
+}
+
 case "$1" in
   start)
 	start
@@ -30,8 +38,11 @@  case "$1" in
   restart|reload)
 	restart
 	;;
+  status)
+	rh_status
+	;;
   *)
-	echo $"Usage: $0 {start|stop|restart}"
+	echo $"Usage: $0 {start|stop|restart|status}"
 	exit 1
 esac