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>
This commit is contained in:
parent
013a828eb9
commit
ebe51c79e9
|
@ -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
|
||||||
|
|
|
@ -11,7 +11,7 @@ PR = "r2"
|
||||||
|
|
||||||
SRC_URI = "git://git.eclipse.org/gitroot/tcf/org.eclipse.tcf.agent.git \
|
SRC_URI = "git://git.eclipse.org/gitroot/tcf/org.eclipse.tcf.agent.git \
|
||||||
file://fix_ranlib.patch \
|
file://fix_ranlib.patch \
|
||||||
file://fix_tcf-agent.init.patch \
|
file://tcf-agent.init \
|
||||||
"
|
"
|
||||||
|
|
||||||
DEPENDS = "util-linux openssl"
|
DEPENDS = "util-linux openssl"
|
||||||
|
@ -42,5 +42,7 @@ do_compile() {
|
||||||
|
|
||||||
do_install() {
|
do_install() {
|
||||||
oe_runmake install INSTALLROOT=${D}
|
oe_runmake install INSTALLROOT=${D}
|
||||||
|
install -d ${D}${sysconfdir}/init.d/
|
||||||
|
install -m 0755 ${WORKDIR}/tcf-agent.init ${D}${sysconfdir}/init.d/tcf-agent
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue