diff options
| -rwxr-xr-x | meta/recipes-devtools/tcf-agent/tcf-agent/tcf-agent.init | 75 | ||||
| -rw-r--r-- | meta/recipes-devtools/tcf-agent/tcf-agent_git.bb | 4 |
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 @@ | |||
| 1 | #!/bin/sh | ||
| 2 | ### BEGIN INIT INFO | ||
| 3 | # Provides: tcf-agent | ||
| 4 | # Default-Start: 3 5 | ||
| 5 | # Default-Stop: 0 1 2 6 | ||
| 6 | # Short-Description: Target Communication Framework agent | ||
| 7 | ### END INIT INFO | ||
| 8 | |||
| 9 | DAEMON_PATH=/usr/sbin/tcf-agent | ||
| 10 | DAEMON_NAME=`basename $DAEMON_PATH` | ||
| 11 | |||
| 12 | . /etc/init.d/functions | ||
| 13 | |||
| 14 | test -x $DAEMON_PATH || exit 0 | ||
| 15 | |||
| 16 | PATH=/sbin:/usr/sbin:/bin:/usr/bin | ||
| 17 | export PATH | ||
| 18 | |||
| 19 | RETVAL=0 | ||
| 20 | |||
| 21 | case "$1" in | ||
| 22 | start) | ||
| 23 | echo -n "Starting $DAEMON_NAME: " | ||
| 24 | $DAEMON_PATH -d -L- -l0 | ||
| 25 | RETVAL=$? | ||
| 26 | if [ $RETVAL -eq 0 ] ; then | ||
| 27 | echo "OK" | ||
| 28 | touch /var/lock/subsys/$DAEMON_NAME | ||
| 29 | else | ||
| 30 | echo "FAIL" | ||
| 31 | fi | ||
| 32 | ;; | ||
| 33 | |||
| 34 | stop) | ||
| 35 | echo -n "Stopping $DAEMON_NAME: " | ||
| 36 | count=0 | ||
| 37 | while [ -n "`/bin/pidof $DAEMON_PATH`" -a $count -lt 10 ] ; do | ||
| 38 | killproc $DAEMON_PATH >& /dev/null | ||
| 39 | sleep 1 | ||
| 40 | RETVAL=$? | ||
| 41 | if [ $RETVAL != 0 -o -n "`/bin/pidof $DAEMON_PATH`" ] ; then | ||
| 42 | sleep 3 | ||
| 43 | fi | ||
| 44 | count=`expr $count + 1` | ||
| 45 | done | ||
| 46 | rm -f /var/lock/subsys/$DAEMON_NAME | ||
| 47 | if [ -n "`/bin/pidof $DAEMON_PATH`" ] ; then | ||
| 48 | echo "FAIL" | ||
| 49 | else | ||
| 50 | echo "OK" | ||
| 51 | fi | ||
| 52 | ;; | ||
| 53 | |||
| 54 | restart) | ||
| 55 | $0 stop | ||
| 56 | sleep 1 | ||
| 57 | $0 start | ||
| 58 | ;; | ||
| 59 | |||
| 60 | status) | ||
| 61 | status $DAEMON_NAME | ||
| 62 | RETVAL=$? | ||
| 63 | ;; | ||
| 64 | |||
| 65 | condrestart) | ||
| 66 | [ -f /var/lock/subsys/$DAEMON_NAME ] && $0 restart | ||
| 67 | ;; | ||
| 68 | |||
| 69 | *) | ||
| 70 | echo "usage: $0 { start | stop | status | restart | condrestart | status }" | ||
| 71 | ;; | ||
| 72 | esac | ||
| 73 | |||
| 74 | exit $RETVAL | ||
| 75 | |||
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" | |||
| 11 | 11 | ||
| 12 | SRC_URI = "git://git.eclipse.org/gitroot/tcf/org.eclipse.tcf.agent.git \ | 12 | SRC_URI = "git://git.eclipse.org/gitroot/tcf/org.eclipse.tcf.agent.git \ |
| 13 | file://fix_ranlib.patch \ | 13 | file://fix_ranlib.patch \ |
| 14 | file://fix_tcf-agent.init.patch \ | 14 | file://tcf-agent.init \ |
| 15 | " | 15 | " |
| 16 | 16 | ||
| 17 | DEPENDS = "util-linux openssl" | 17 | DEPENDS = "util-linux openssl" |
| @@ -42,5 +42,7 @@ do_compile() { | |||
| 42 | 42 | ||
| 43 | do_install() { | 43 | do_install() { |
| 44 | oe_runmake install INSTALLROOT=${D} | 44 | oe_runmake install INSTALLROOT=${D} |
| 45 | install -d ${D}${sysconfdir}/init.d/ | ||
| 46 | install -m 0755 ${WORKDIR}/tcf-agent.init ${D}${sysconfdir}/init.d/tcf-agent | ||
| 45 | } | 47 | } |
| 46 | 48 | ||
