summaryrefslogtreecommitdiffstats
path: root/meta/recipes-devtools/tcf-agent/tcf-agent/fix_tcf-agent.init.patch
diff options
context:
space:
mode:
Diffstat (limited to 'meta/recipes-devtools/tcf-agent/tcf-agent/fix_tcf-agent.init.patch')
-rw-r--r--meta/recipes-devtools/tcf-agent/tcf-agent/fix_tcf-agent.init.patch92
1 files changed, 92 insertions, 0 deletions
diff --git a/meta/recipes-devtools/tcf-agent/tcf-agent/fix_tcf-agent.init.patch b/meta/recipes-devtools/tcf-agent/tcf-agent/fix_tcf-agent.init.patch
new file mode 100644
index 0000000000..fa9e458714
--- /dev/null
+++ b/meta/recipes-devtools/tcf-agent/tcf-agent/fix_tcf-agent.init.patch
@@ -0,0 +1,92 @@
1--- a/Makefile
2+++ b/Makefile
3@@ -32,7 +32,7 @@
4 install -d -m 755 $(INSTALLROOT)$(SBIN)
5 install -d -m 755 $(INSTALLROOT)$(INIT)
6 install -c $(BINDIR)/agent -m 755 $(INSTALLROOT)$(SBIN)/tcf-agent
7- install -c $(TCF_AGENT_DIR)/main/tcf-agent.init -m 755 $(INSTALLROOT)$(INIT)/tcf-agent
8+ install -c tcf-agent.init -m 755 $(INSTALLROOT)$(INIT)/tcf-agent
9
10 clean:
11 rm -rf $(BINDIR)
12--- /dev/null
13+++ b/tcf-agent.init
14@@ -0,0 +1,78 @@
15+#!/bin/sh
16+### BEGIN INIT INFO
17+# Provides: tcf-agent
18+# Default-Start: 3 5
19+# Default-Stop: 0 1 2 6
20+# Short-Description: Target Communication Framework agent
21+### END INIT INFO
22+
23+DAEMON_PATH=/usr/sbin/tcf-agent
24+DAEMON_NAME=`basename $DAEMON_PATH`
25+
26+. /etc/init.d/functions
27+
28+test -x $DAEMON_PATH || exit 0
29+
30+PATH=/sbin:/usr/sbin:/bin:/usr/bin
31+export PATH
32+
33+RETVAL=0
34+
35+case "$1" in
36+ start)
37+ echo -n "Starting $DAEMON_NAME: "
38+ $DAEMON_PATH -d -L- -l0
39+ RETVAL=$?
40+ if [ $RETVAL -eq 0 ] ; then
41+ echo "OK"
42+ touch /var/lock/subsys/$DAEMON_NAME
43+ else
44+ echo "FAIL"
45+ fi
46+ ;;
47+
48+ stop)
49+ echo -n "Stopping $DAEMON_NAME: "
50+ count=0
51+ while [ -n "`/bin/pidof $DAEMON_PATH`" -a $count -lt 10 ] ; do
52+ killproc $DAEMON_PATH >& /dev/null
53+ sleep 1
54+ RETVAL=$?
55+ if [ $RETVAL != 0 -o -n "`/bin/pidof $DAEMON_PATH`" ] ; then
56+ sleep 3
57+ fi
58+ count=`expr $count + 1`
59+ done
60+ rm -f /var/lock/subsys/$DAEMON_NAME
61+ if [ -n "`/bin/pidof $DAEMON_PATH`" ] ; then
62+ echo "FAIL"
63+ else
64+ echo "OK"
65+ fi
66+ ;;
67+
68+ restart)
69+ $0 stop
70+ sleep 1
71+ $0 start
72+ ;;
73+
74+ status)
75+ if [ -n "`/bin/pidof $DAEMON_PATH`" ] ; then
76+ echo "$DAEMON_NAME is running"
77+ else
78+ echo "$DAEMON_NAME is not running"
79+ fi
80+ ;;
81+
82+ condrestart)
83+ [ -f /var/lock/subsys/$DAEMON_NAME ] && $0 restart
84+ ;;
85+
86+ *)
87+ echo "usage: $0 { start | stop | restart | condrestart | status }"
88+ ;;
89+esac
90+
91+exit $RETVAL
92+