summaryrefslogtreecommitdiffstats
path: root/meta/recipes-devtools/tcf-agent
diff options
context:
space:
mode:
authorLi Wang <li.wang@windriver.com>2013-11-27 15:55:44 +0800
committerRichard Purdie <richard.purdie@linuxfoundation.org>2013-11-29 09:52:56 +0000
commitebe51c79e9d307e43a42a66b67ced87d092ce39f (patch)
tree561cbeb3f094f2cac73da197dfaf867129fd4454 /meta/recipes-devtools/tcf-agent
parent013a828eb9f7b68e3b9734037352a0442ba3a6b4 (diff)
downloadast2050-yocto-poky-ebe51c79e9d307e43a42a66b67ced87d092ce39f.zip
ast2050-yocto-poky-ebe51c79e9d307e43a42a66b67ced87d092ce39f.tar.gz
tcf-agent: add init.d/tcf-agent status command
(From OE-Core rev: 5b3c4863665eabf7750ff1bdd975ea1f4772006b) Signed-off-by: Li Wang <li.wang@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-devtools/tcf-agent')
-rwxr-xr-xmeta/recipes-devtools/tcf-agent/tcf-agent/tcf-agent.init75
-rw-r--r--meta/recipes-devtools/tcf-agent/tcf-agent_git.bb4
2 files changed, 78 insertions, 1 deletions
diff --git a/meta/recipes-devtools/tcf-agent/tcf-agent/tcf-agent.init b/meta/recipes-devtools/tcf-agent/tcf-agent/tcf-agent.init
new file mode 100755
index 0000000..6303280
--- /dev/null
+++ b/meta/recipes-devtools/tcf-agent/tcf-agent/tcf-agent.init
@@ -0,0 +1,75 @@
+#!/bin/sh
+### BEGIN INIT INFO
+# Provides: tcf-agent
+# Default-Start: 3 5
+# Default-Stop: 0 1 2 6
+# Short-Description: Target Communication Framework agent
+### END INIT INFO
+
+DAEMON_PATH=/usr/sbin/tcf-agent
+DAEMON_NAME=`basename $DAEMON_PATH`
+
+. /etc/init.d/functions
+
+test -x $DAEMON_PATH || exit 0
+
+PATH=/sbin:/usr/sbin:/bin:/usr/bin
+export PATH
+
+RETVAL=0
+
+case "$1" in
+ start)
+ echo -n "Starting $DAEMON_NAME: "
+ $DAEMON_PATH -d -L- -l0
+ RETVAL=$?
+ if [ $RETVAL -eq 0 ] ; then
+ echo "OK"
+ touch /var/lock/subsys/$DAEMON_NAME
+ else
+ echo "FAIL"
+ fi
+ ;;
+
+ stop)
+ echo -n "Stopping $DAEMON_NAME: "
+ count=0
+ while [ -n "`/bin/pidof $DAEMON_PATH`" -a $count -lt 10 ] ; do
+ killproc $DAEMON_PATH >& /dev/null
+ sleep 1
+ RETVAL=$?
+ if [ $RETVAL != 0 -o -n "`/bin/pidof $DAEMON_PATH`" ] ; then
+ sleep 3
+ fi
+ count=`expr $count + 1`
+ done
+ rm -f /var/lock/subsys/$DAEMON_NAME
+ if [ -n "`/bin/pidof $DAEMON_PATH`" ] ; then
+ echo "FAIL"
+ else
+ echo "OK"
+ fi
+ ;;
+
+ restart)
+ $0 stop
+ sleep 1
+ $0 start
+ ;;
+
+ status)
+ status $DAEMON_NAME
+ RETVAL=$?
+ ;;
+
+ condrestart)
+ [ -f /var/lock/subsys/$DAEMON_NAME ] && $0 restart
+ ;;
+
+ *)
+ echo "usage: $0 { start | stop | status | restart | condrestart | status }"
+ ;;
+esac
+
+exit $RETVAL
+
diff --git a/meta/recipes-devtools/tcf-agent/tcf-agent_git.bb b/meta/recipes-devtools/tcf-agent/tcf-agent_git.bb
index 09b153e..e7779cd 100644
--- a/meta/recipes-devtools/tcf-agent/tcf-agent_git.bb
+++ b/meta/recipes-devtools/tcf-agent/tcf-agent_git.bb
@@ -11,7 +11,7 @@ PR = "r2"
SRC_URI = "git://git.eclipse.org/gitroot/tcf/org.eclipse.tcf.agent.git \
file://fix_ranlib.patch \
- file://fix_tcf-agent.init.patch \
+ file://tcf-agent.init \
"
DEPENDS = "util-linux openssl"
@@ -42,5 +42,7 @@ do_compile() {
do_install() {
oe_runmake install INSTALLROOT=${D}
+ install -d ${D}${sysconfdir}/init.d/
+ install -m 0755 ${WORKDIR}/tcf-agent.init ${D}${sysconfdir}/init.d/tcf-agent
}
OpenPOWER on IntegriCloud