aboutsummaryrefslogtreecommitdiffstats
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-27 11:59:51 +0000
commit5b3c4863665eabf7750ff1bdd975ea1f4772006b (patch)
treec6db7a2926e717b4ed24734dedb88f954d7d4eb9 /meta/recipes-devtools/tcf-agent
parent2988cef2f0ad857b5bbf6a0189ffb0fb88795f8c (diff)
downloadopenembedded-core-contrib-5b3c4863665eabf7750ff1bdd975ea1f4772006b.tar.gz
openembedded-core-contrib-5b3c4863665eabf7750ff1bdd975ea1f4772006b.tar.bz2
openembedded-core-contrib-5b3c4863665eabf7750ff1bdd975ea1f4772006b.zip
tcf-agent: add init.d/tcf-agent status command
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 0000000000..6303280aae
--- /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 09b153ed57..e7779cd210 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
}