<div dir="ltr"><div class="gmail_default" style="font-family:monospace,monospace;font-size:small">ping?<br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Aug 26, 2016 at 4:55 PM, Fabio Berton <span dir="ltr">&lt;<a href="mailto:fabio.berton@ossystems.com.br" target="_blank">fabio.berton@ossystems.com.br</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">This is a simplified version of the watchdog daemon. It only opens<br>
/dev/watchdog, and keeps writing to it often enough to keep the kernel<br>
from resetting, at least once per minute. Each write delays the reboot<br>
time another minute. After a minute of inactivity the watchdog hardware<br>
will cause a reset. In the case of the software watchdog the ability to<br>
reboot will depend on the state of the machines and interrupts.<br>
<br>
Installs wd_keepalive binary and enable initscript.<br>
<br>
Signed-off-by: Fabio Berton &lt;<a href="mailto:fabio.berton@ossystems.com.br">fabio.berton@ossystems.com.br</a><wbr>&gt;<br>
</span>Signed-off-by: Otavio Salvador &lt;<a href="mailto:otavio@ossystems.com.br">otavio@ossystems.com.br</a>&gt;<br>
<div class="HOEnZb"><div class="h5">---<br>
 .../watchdog/watchdog/wd_<wbr>keepalive.init            | 121 +++++++++++++++++++++<br>
 meta/recipes-extended/<wbr>watchdog/<a href="http://watchdog_5.15.bb" rel="noreferrer" target="_blank">watchdog_5.15.bb</a>    |  23 +++-<br>
 2 files changed, 141 insertions(+), 3 deletions(-)<br>
 create mode 100644 meta/recipes-extended/<wbr>watchdog/watchdog/wd_<wbr>keepalive.init<br>
<br>
diff --git a/meta/recipes-extended/<wbr>watchdog/watchdog/wd_<wbr>keepalive.init b/meta/recipes-extended/<wbr>watchdog/watchdog/wd_<wbr>keepalive.init<br>
new file mode 100644<br>
index 0000000..1d3e4c5<br>
--- /dev/null<br>
+++ b/meta/recipes-extended/<wbr>watchdog/watchdog/wd_<wbr>keepalive.init<br>
@@ -0,0 +1,121 @@<br>
+#!/bin/sh<br>
+#/etc/init.d/wd_keepalive: start wd_keepalive daemon.<br>
+<br>
+### BEGIN INIT INFO<br>
+# Provides:          wd_keepalive<br>
+# Short-Description: Start watchdog keepalive daemon<br>
+# Required-Start:    $remote_fs<br>
+# Required-Stop:     $remote_fs<br>
+# X-Start-Before:    $all<br>
+# Default-Start:     2 3 4 5<br>
+# Default-Stop<br>
+### END INIT INFO<br>
+<br>
+PATH=/bin:/usr/bin:/sbin:/<wbr>usr/sbin<br>
+<br>
+test -x /usr/sbin/wd_keepalive || exit 0<br>
+<br>
+# For configuration of the init script use the file<br>
+# /etc/default/watchdog, do not edit this init script.<br>
+<br>
+# Set run_watchdog to 1 to start watchdog or 0 to disable it.<br>
+run_watchdog=0<br>
+<br>
+# Specify additional watchdog options here (see manpage).<br>
+watchdog_options=&quot;&quot;<br>
+<br>
+# Specify module to load<br>
+watchdog_module=&quot;none&quot;<br>
+<br>
+[ -e /etc/default/watchdog ] &amp;&amp; . /etc/default/watchdog<br>
+<br>
+NAME=wd_keepalive<br>
+DAEMON=/usr/sbin/wd_keepalive<br>
+<br>
+STOP_RETRY_SCHEDULE=&#39;TERM/10/<wbr>forever/KILL/1&#39;<br>
+<br>
+# . /lib/lsb/init-functions<br>
+<br>
+# Mock Debian stuff<br>
+log_begin_msg() {<br>
+    echo -n $*<br>
+}<br>
+<br>
+log_end_msg() {<br>
+    if [ &quot;$1&quot; = &quot;0&quot; ]; then<br>
+        echo &#39;done&#39;<br>
+    else<br>
+        echo &#39;error&#39;<br>
+    fi<br>
+}<br>
+<br>
+log_daemon_msg() {<br>
+    echo $*<br>
+}<br>
+<br>
+log_progress_msg() {<br>
+    echo $*<br>
+}<br>
+<br>
+<br>
+case &quot;$1&quot; in<br>
+  start)<br>
+    if [ $run_watchdog = 1 ]<br>
+    then<br>
+        [ ${watchdog_module:-none} != &quot;none&quot; ] &amp;&amp; /sbin/modprobe $watchdog_module<br>
+       echo -n &quot;Starting watchdog keepalive daemon: &quot;<br>
+       if start-stop-daemon --start --quiet \<br>
+           --exec $DAEMON -- $watchdog_options<br>
+       then<br>
+           echo wd_keepalive.<br>
+       else<br>
+           echo<br>
+       fi<br>
+    fi<br>
+    ;;<br>
+<br>
+  stop)<br>
+    if [ $run_watchdog = 1 ]<br>
+    then<br>
+       echo -n &quot;Stopping watchdog keepalive daemon: &quot;<br>
+       if start-stop-daemon --stop --quiet --pidfile /var/run/$NAME.pid \<br>
+           $STOP_RETRY_SCHEDULE<br>
+       then<br>
+           echo wd_keepalive.<br>
+       else<br>
+           echo<br>
+       fi<br>
+    fi<br>
+    ;;<br>
+<br>
+  status)<br>
+    status_of_proc &quot;$DAEMON&quot; &quot;$NAME&quot; &amp;&amp; exit 0 || exit $?<br>
+    ;;<br>
+<br>
+  restart)<br>
+    $0 force-reload<br>
+    ;;<br>
+<br>
+  force-reload)<br>
+    if [ $run_watchdog = 0 ]; then exit 0; fi<br>
+    echo -n &quot;Restarting $NAME daemon.&quot;<br>
+    start-stop-daemon --stop --quiet --pidfile /var/run/$NAME.pid \<br>
+       $STOP_RETRY_SCHEDULE<br>
+    echo -n &quot;.&quot;<br>
+    if start-stop-daemon --start --quiet --pidfile /var/run/$NAME.pid \<br>
+       --exec $DAEMON -- $watchdog_options<br>
+    then<br>
+       echo &quot;done.&quot;<br>
+    else<br>
+       echo<br>
+    fi<br>
+    ;;<br>
+<br>
+  *)<br>
+    echo &quot;Usage: /etc/init.d/wd_keepalive {start|stop|status|restart|<wbr>force-reload}&quot;<br>
+    exit 1<br>
+<br>
+esac<br>
+<br>
+exit 0<br>
+<br>
diff --git a/meta/recipes-extended/<wbr>watchdog/<a href="http://watchdog_5.15.bb" rel="noreferrer" target="_blank">watchdog_5.15.bb</a> b/meta/recipes-extended/<wbr>watchdog/<a href="http://watchdog_5.15.bb" rel="noreferrer" target="_blank">watchdog_5.15.bb</a><br>
index ee1a893..1c0049c 100644<br>
--- a/meta/recipes-extended/<wbr>watchdog/<a href="http://watchdog_5.15.bb" rel="noreferrer" target="_blank">watchdog_5.15.bb</a><br>
+++ b/meta/recipes-extended/<wbr>watchdog/<a href="http://watchdog_5.15.bb" rel="noreferrer" target="_blank">watchdog_5.15.bb</a><br>
@@ -12,6 +12,7 @@ SRC_URI = &quot;${SOURCEFORGE_MIRROR}/<wbr>watchdog/watchdog-${PV}.tar.gz \<br>
            file://0001-Include-linux-<wbr>param.h-for-EXEC_PAGESIZE-<wbr>definition.patch \<br>
            file://watchdog-init.patch \<br>
            file://watchdog-conf.patch \<br>
+           file://wd_keepalive.init \<br>
 &quot;<br>
<br>
 SRC_URI[md5sum] = &quot;<wbr>678c32f6f35a0492c9c1b76b4aa888<wbr>28&quot;<br>
@@ -28,11 +29,27 @@ CFLAGS_append_libc-musl = &quot; -I${STAGING_INCDIR}/tirpc &quot;<br>
 LDFLAGS_append_libc-musl = &quot; -ltirpc &quot;<br>
 EXTRA_OECONF_append_libc-musl = &quot; --disable-nfs &quot;<br>
<br>
-INITSCRIPT_NAME = &quot;watchdog.sh&quot;<br>
-INITSCRIPT_PARAMS = &quot;start 15 1 2 3 4 5 . stop 85 0 6 .&quot;<br>
+INITSCRIPT_PACKAGES = &quot;${PN} ${PN}-keepalive&quot;<br>
<br>
-RRECOMMENDS_${PN} = &quot;kernel-module-softdog&quot;<br>
+INITSCRIPT_NAME_${PN} = &quot;watchdog.sh&quot;<br>
+INITSCRIPT_PARAMS_${PN} = &quot;start 15 1 2 3 4 5 . stop 85 0 6 .&quot;<br>
+<br>
+INITSCRIPT_NAME_${PN}-<wbr>keepalive = &quot;wd_keepalive&quot;<br>
+INITSCRIPT_PARAMS_${PN}-<wbr>keepalive = &quot;start 15 1 2 3 4 5 . stop 85 0 6 .&quot;<br>
<br>
 do_install_append() {<br>
        install -D ${S}/redhat/watchdog.init ${D}/${sysconfdir}/init.d/<wbr>watchdog.sh<br>
+    install -Dm 0755 ${WORKDIR}/wd_keepalive.init ${D}${sysconfdir}/init.d/wd_<wbr>keepalive<br>
 }<br>
+<br>
+PACKAGES =+ &quot;${PN}-keepalive&quot;<br>
+<br>
+FILES_${PN}-keepalive = &quot; \<br>
+    ${sysconfdir}/init.d/wd_<wbr>keepalive \<br>
+    ${sbindir}/wd_keepalive \<br>
+&quot;<br>
+<br>
+RDEPENDS_${PN} += &quot;${PN}-keepalive&quot;<br>
+<br>
+RRECOMMENDS_${PN} = &quot;kernel-module-softdog&quot;<br>
+<br>
--<br>
2.1.4<br>
<br>
</div></div></blockquote></div><br></div>