aboutsummaryrefslogtreecommitdiffstats
path: root/meta-oe/recipes-support/mcelog/mcelog_162.bb
blob: dfca3855bf0a9f9081b5abcf3b3868434e617ac7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
SUMMARY = "mcelog daemon accounts memory and some other errors in various ways."
DESCRIPTION = "mcelog is required by both 32bit x86 Linux kernels (since 2.6.30) \
and 64bit Linux kernels (since early 2.6 kernel releases) to log machine checks \
and should run on all Linux systems that need error handling."
HOMEPAGE = "http://mcelog.org/"
SECTION = "System Environment/Base"

SRC_URI = "git://git.kernel.org/pub/scm/utils/cpu/mce/mcelog.git;protocol=http; \
    file://run-ptest \
"

SRCREV = "6ed93e30f83519b0ab71f8ecd156b8ff0b2912b6"

LICENSE = "GPLv2"
LIC_FILES_CHKSUM = "file://README.md;md5=74bb47b9a68850cb398665cf78b31de6"

S = "${WORKDIR}/git"

inherit autotools-brokensep ptest

COMPATIBLE_HOST = '(x86_64.*|i.86.*)-linux'

do_install_append() {
    install -d ${D}${sysconfdir}/cron.hourly
    install -m 0755 ${S}/mcelog.cron ${D}${sysconfdir}/cron.hourly/
    sed -i 's/bash/sh/' ${D}${sysconfdir}/cron.hourly/mcelog.cron
}

do_install_ptest() {
    install -d ${D}${PTEST_PATH}
    cp -r ${S}/tests ${S}/input ${D}${PTEST_PATH}
    sed -i 's#../../mcelog#mcelog#' ${D}${PTEST_PATH}/tests/test
}

RDEPENDS_${PN}-ptest += "${PN} make bash mce-inject"
OpenEmbedded Core user contribution treesGrokmirror user
aboutsummaryrefslogtreecommitdiffstats
path: root/meta/recipes-devtools/tcf-agent/tcf-agent/fix_tcf-agent.init.patch
blob: 8ea5b43d53dd17058d22773fd4e4b2916ff83e69 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
Upstream-Status: Inappropriate [poky-specific script]

--- a/Makefile
+++ b/Makefile
@@ -64,7 +64,7 @@
 	install -d -m 755 $(INSTALLROOT)$(INCLUDE)/tcf/services
 	install -c $(BINDIR)/agent -m 755 $(INSTALLROOT)$(SBIN)/tcf-agent
 	install -c $(BINDIR)/client -m 755 $(INSTALLROOT)$(SBIN)/tcf-client
-	install -c main/tcf-agent.init -m 755 $(INSTALLROOT)$(INIT)/tcf-agent
+	install -c tcf-agent.init -m 755 $(INSTALLROOT)$(INIT)/tcf-agent
 	install -c config.h -m 755 $(INSTALLROOT)$(INCLUDE)/tcf/config.h
 	install -c -t $(INSTALLROOT)$(INCLUDE)/tcf/framework -m 644 framework/*.h
 	install -c -t $(INSTALLROOT)$(INCLUDE)/tcf/services -m 644 services/*.h
--- /dev/null
+++ b/tcf-agent.init
@@ -0,0 +1,80 @@
+#!/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
+        pid=$(/bin/pidof $DAEMON_PATH)
+        while [ -n "`/bin/pidof $DAEMON_PATH`" -a $count -lt 10 ] ; do
+            kill $pid > /dev/null 2>&1
+            sleep 1
+            RETVAL=$?
+            if [ $RETVAL != 0 -o -n "`/bin/pidof $DAEMON_PATH`" ] ; then
+                sleep 3
+            fi
+            count=`expr $count + 1`
+            pid=$(/bin/pidof $DAEMON_PATH)
+        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)
+        if [ -n "`/bin/pidof $DAEMON_PATH`" ] ; then
+            echo "$DAEMON_NAME is running"
+        else
+            echo "$DAEMON_NAME is not running"
+        fi
+        ;;
+
+    condrestart)
+        [ -f /var/lock/subsys/$DAEMON_NAME ] && $0 restart
+        ;;
+
+    *)
+        echo "usage: $0 { start | stop | restart | condrestart | status }"
+        ;;
+esac
+
+exit $RETVAL
+