All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] watchdog: Add wd_keepalive package
@ 2016-08-26 19:55 Fabio Berton
  2016-08-26 19:55 ` [PATCH 2/2] watchdog-config: Add recipe Fabio Berton
  2016-09-06 13:43 ` [PATCH 1/2] watchdog: Add wd_keepalive package Fabio Berton
  0 siblings, 2 replies; 4+ messages in thread
From: Fabio Berton @ 2016-08-26 19:55 UTC (permalink / raw)
  To: openembedded-core; +Cc: Otavio Salvador

This is a simplified version of the watchdog daemon. It only opens
/dev/watchdog, and keeps writing to it often enough to keep the kernel
from resetting, at least once per minute. Each write delays the reboot
time another minute. After a minute of inactivity the watchdog hardware
will cause a reset. In the case of the software watchdog the ability to
reboot will depend on the state of the machines and interrupts.

Installs wd_keepalive binary and enable initscript.

Signed-off-by: Fabio Berton <fabio.berton@ossystems.com.br>
Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
---
 .../watchdog/watchdog/wd_keepalive.init            | 121 +++++++++++++++++++++
 meta/recipes-extended/watchdog/watchdog_5.15.bb    |  23 +++-
 2 files changed, 141 insertions(+), 3 deletions(-)
 create mode 100644 meta/recipes-extended/watchdog/watchdog/wd_keepalive.init

diff --git a/meta/recipes-extended/watchdog/watchdog/wd_keepalive.init b/meta/recipes-extended/watchdog/watchdog/wd_keepalive.init
new file mode 100644
index 0000000..1d3e4c5
--- /dev/null
+++ b/meta/recipes-extended/watchdog/watchdog/wd_keepalive.init
@@ -0,0 +1,121 @@
+#!/bin/sh
+#/etc/init.d/wd_keepalive: start wd_keepalive daemon.
+
+### BEGIN INIT INFO
+# Provides:          wd_keepalive
+# Short-Description: Start watchdog keepalive daemon
+# Required-Start:    $remote_fs
+# Required-Stop:     $remote_fs
+# X-Start-Before:    $all
+# Default-Start:     2 3 4 5
+# Default-Stop
+### END INIT INFO
+
+PATH=/bin:/usr/bin:/sbin:/usr/sbin
+
+test -x /usr/sbin/wd_keepalive || exit 0
+
+# For configuration of the init script use the file
+# /etc/default/watchdog, do not edit this init script.
+
+# Set run_watchdog to 1 to start watchdog or 0 to disable it.
+run_watchdog=0
+
+# Specify additional watchdog options here (see manpage).
+watchdog_options=""
+
+# Specify module to load
+watchdog_module="none"
+
+[ -e /etc/default/watchdog ] && . /etc/default/watchdog
+
+NAME=wd_keepalive
+DAEMON=/usr/sbin/wd_keepalive
+
+STOP_RETRY_SCHEDULE='TERM/10/forever/KILL/1'
+
+# . /lib/lsb/init-functions
+
+# Mock Debian stuff
+log_begin_msg() {
+    echo -n $*
+}
+
+log_end_msg() {
+    if [ "$1" = "0" ]; then
+        echo 'done'
+    else
+        echo 'error'
+    fi
+}
+
+log_daemon_msg() {
+    echo $*
+}
+
+log_progress_msg() {
+    echo $*
+}
+
+
+case "$1" in
+  start)
+    if [ $run_watchdog = 1 ]
+    then
+        [ ${watchdog_module:-none} != "none" ] && /sbin/modprobe $watchdog_module
+	echo -n "Starting watchdog keepalive daemon: "
+	if start-stop-daemon --start --quiet \
+	    --exec $DAEMON -- $watchdog_options
+	then
+	    echo wd_keepalive.
+	else
+	    echo
+	fi
+    fi
+    ;;
+
+  stop)
+    if [ $run_watchdog = 1 ]
+    then
+	echo -n "Stopping watchdog keepalive daemon: "
+	if start-stop-daemon --stop --quiet --pidfile /var/run/$NAME.pid \
+	    $STOP_RETRY_SCHEDULE
+	then
+	    echo wd_keepalive.
+	else
+	    echo
+	fi
+    fi
+    ;;
+
+  status)
+    status_of_proc "$DAEMON" "$NAME" && exit 0 || exit $?
+    ;;
+
+  restart)
+    $0 force-reload
+    ;;
+
+  force-reload)
+    if [ $run_watchdog = 0 ]; then exit 0; fi
+    echo -n "Restarting $NAME daemon."
+    start-stop-daemon --stop --quiet --pidfile /var/run/$NAME.pid \
+	$STOP_RETRY_SCHEDULE
+    echo -n "."
+    if start-stop-daemon --start --quiet --pidfile /var/run/$NAME.pid \
+	--exec $DAEMON -- $watchdog_options
+    then
+	echo "done."
+    else
+	echo
+    fi
+    ;;
+
+  *)
+    echo "Usage: /etc/init.d/wd_keepalive {start|stop|status|restart|force-reload}"
+    exit 1
+
+esac
+
+exit 0
+
diff --git a/meta/recipes-extended/watchdog/watchdog_5.15.bb b/meta/recipes-extended/watchdog/watchdog_5.15.bb
index ee1a893..1c0049c 100644
--- a/meta/recipes-extended/watchdog/watchdog_5.15.bb
+++ b/meta/recipes-extended/watchdog/watchdog_5.15.bb
@@ -12,6 +12,7 @@ SRC_URI = "${SOURCEFORGE_MIRROR}/watchdog/watchdog-${PV}.tar.gz \
            file://0001-Include-linux-param.h-for-EXEC_PAGESIZE-definition.patch \
            file://watchdog-init.patch \
            file://watchdog-conf.patch \
+           file://wd_keepalive.init \
 "
 
 SRC_URI[md5sum] = "678c32f6f35a0492c9c1b76b4aa88828"
@@ -28,11 +29,27 @@ CFLAGS_append_libc-musl = " -I${STAGING_INCDIR}/tirpc "
 LDFLAGS_append_libc-musl = " -ltirpc "
 EXTRA_OECONF_append_libc-musl = " --disable-nfs "
 
-INITSCRIPT_NAME = "watchdog.sh"
-INITSCRIPT_PARAMS = "start 15 1 2 3 4 5 . stop 85 0 6 ."
+INITSCRIPT_PACKAGES = "${PN} ${PN}-keepalive"
 
-RRECOMMENDS_${PN} = "kernel-module-softdog"
+INITSCRIPT_NAME_${PN} = "watchdog.sh"
+INITSCRIPT_PARAMS_${PN} = "start 15 1 2 3 4 5 . stop 85 0 6 ."
+
+INITSCRIPT_NAME_${PN}-keepalive = "wd_keepalive"
+INITSCRIPT_PARAMS_${PN}-keepalive = "start 15 1 2 3 4 5 . stop 85 0 6 ."
 
 do_install_append() {
 	install -D ${S}/redhat/watchdog.init ${D}/${sysconfdir}/init.d/watchdog.sh
+    install -Dm 0755 ${WORKDIR}/wd_keepalive.init ${D}${sysconfdir}/init.d/wd_keepalive
 }
+
+PACKAGES =+ "${PN}-keepalive"
+
+FILES_${PN}-keepalive = " \
+    ${sysconfdir}/init.d/wd_keepalive \
+    ${sbindir}/wd_keepalive \
+"
+
+RDEPENDS_${PN} += "${PN}-keepalive"
+
+RRECOMMENDS_${PN} = "kernel-module-softdog"
+
-- 
2.1.4



^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH 2/2] watchdog-config: Add recipe
  2016-08-26 19:55 [PATCH 1/2] watchdog: Add wd_keepalive package Fabio Berton
@ 2016-08-26 19:55 ` Fabio Berton
  2016-09-06 13:44   ` Fabio Berton
  2016-09-06 13:43 ` [PATCH 1/2] watchdog: Add wd_keepalive package Fabio Berton
  1 sibling, 1 reply; 4+ messages in thread
From: Fabio Berton @ 2016-08-26 19:55 UTC (permalink / raw)
  To: openembedded-core; +Cc: Otavio Salvador

Provides configuration files for watchdog.
Add watchdog-config as a runtime dependence of watchdog and remove
watchdog.conf file from watchdog installation.

Signed-off-by: Fabio Berton <fabio.berton@ossystems.com.br>
Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
---
 meta/recipes-extended/watchdog/watchdog-config.bb  | 20 +++++++++++
 .../watchdog/watchdog-config/watchdog.conf         | 42 ++++++++++++++++++++++
 .../watchdog/watchdog-config/watchdog.default      |  2 ++
 meta/recipes-extended/watchdog/watchdog_5.15.bb    |  6 +++-
 4 files changed, 69 insertions(+), 1 deletion(-)
 create mode 100644 meta/recipes-extended/watchdog/watchdog-config.bb
 create mode 100644 meta/recipes-extended/watchdog/watchdog-config/watchdog.conf
 create mode 100644 meta/recipes-extended/watchdog/watchdog-config/watchdog.default

diff --git a/meta/recipes-extended/watchdog/watchdog-config.bb b/meta/recipes-extended/watchdog/watchdog-config.bb
new file mode 100644
index 0000000..8bf40f0
--- /dev/null
+++ b/meta/recipes-extended/watchdog/watchdog-config.bb
@@ -0,0 +1,20 @@
+SUMMARY = "Software watchdog"
+DESCRIPTION = "Watchdog is a daemon that checks if your system is still \
+working. If programs in user space are not longer executed it will reboot \
+the system."
+HOMEPAGE = "http://watchdog.sourceforge.net/"
+BUGTRACKER = "http://sourceforge.net/tracker/?group_id=172030&atid=860194"
+
+LICENSE = "MIT-X"
+LIC_FILES_CHKSUM = "file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420"
+
+SRC_URI = " \
+    file://watchdog.default \
+    file://watchdog.conf \
+"
+
+do_install() {
+    install -Dm 0644 ${WORKDIR}/watchdog.default ${D}${sysconfdir}/default/watchdog
+    install -Dm 0644 ${WORKDIR}/watchdog.conf ${D}${sysconfdir}/watchdog.conf
+}
+
diff --git a/meta/recipes-extended/watchdog/watchdog-config/watchdog.conf b/meta/recipes-extended/watchdog/watchdog-config/watchdog.conf
new file mode 100644
index 0000000..c493d12
--- /dev/null
+++ b/meta/recipes-extended/watchdog/watchdog-config/watchdog.conf
@@ -0,0 +1,42 @@
+#ping			= 172.31.14.1
+#ping			= 172.26.1.255
+#interface		= eth0
+#file			= /var/log/messages
+#change			= 1407
+
+# Uncomment to enable test. Setting one of these values to '0' disables it.
+# These values will hopefully never reboot your machine during normal use
+# (if your machine is really hung, the loadavg will go much higher than 25)
+#max-load-1		= 24
+#max-load-5		= 18
+#max-load-15		= 12
+
+# Note that this is the number of pages!
+# To get the real size, check how large the pagesize is on your machine.
+#min-memory		= 1
+
+#repair-binary		= /usr/sbin/repair
+#repair-timeout		= 
+#test-binary		= 
+#test-timeout		= 
+
+watchdog-device	= /dev/watchdog
+
+# Defaults compiled into the binary
+#temperature-device	=
+#max-temperature	= 120
+
+# Defaults compiled into the binary
+#admin			= root
+#interval		= 1
+#logtick                = 1
+#log-dir		= /var/log/watchdog
+
+# This greatly decreases the chance that watchdog won't be scheduled before
+# your machine is really loaded
+realtime		= yes
+priority		= 1
+
+# Check if rsyslogd is still running by enabling the following line
+#pidfile		= /var/run/rsyslogd.pid   
+
diff --git a/meta/recipes-extended/watchdog/watchdog-config/watchdog.default b/meta/recipes-extended/watchdog/watchdog-config/watchdog.default
new file mode 100644
index 0000000..647d5ab
--- /dev/null
+++ b/meta/recipes-extended/watchdog/watchdog-config/watchdog.default
@@ -0,0 +1,2 @@
+# Start watchdog at boot time? 0 or 1
+run_watchdog=1
diff --git a/meta/recipes-extended/watchdog/watchdog_5.15.bb b/meta/recipes-extended/watchdog/watchdog_5.15.bb
index 1c0049c..cedfc04 100644
--- a/meta/recipes-extended/watchdog/watchdog_5.15.bb
+++ b/meta/recipes-extended/watchdog/watchdog_5.15.bb
@@ -40,6 +40,9 @@ INITSCRIPT_PARAMS_${PN}-keepalive = "start 15 1 2 3 4 5 . stop 85 0 6 ."
 do_install_append() {
 	install -D ${S}/redhat/watchdog.init ${D}/${sysconfdir}/init.d/watchdog.sh
     install -Dm 0755 ${WORKDIR}/wd_keepalive.init ${D}${sysconfdir}/init.d/wd_keepalive
+
+    # watchdog.conf is provided by the watchdog-config recipe
+    rm ${D}${sysconfdir}/watchdog.conf
 }
 
 PACKAGES =+ "${PN}-keepalive"
@@ -49,7 +52,8 @@ FILES_${PN}-keepalive = " \
     ${sbindir}/wd_keepalive \
 "
 
-RDEPENDS_${PN} += "${PN}-keepalive"
+RDEPENDS_${PN} += "${PN}-config ${PN}-keepalive"
+RDEPENDS_${PN}-keepalive += "${PN}-config"
 
 RRECOMMENDS_${PN} = "kernel-module-softdog"
 
-- 
2.1.4



^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH 1/2] watchdog: Add wd_keepalive package
  2016-08-26 19:55 [PATCH 1/2] watchdog: Add wd_keepalive package Fabio Berton
  2016-08-26 19:55 ` [PATCH 2/2] watchdog-config: Add recipe Fabio Berton
@ 2016-09-06 13:43 ` Fabio Berton
  1 sibling, 0 replies; 4+ messages in thread
From: Fabio Berton @ 2016-09-06 13:43 UTC (permalink / raw)
  To: Patches and discussions about the oe-core layer; +Cc: Otavio Salvador

[-- Attachment #1: Type: text/plain, Size: 6004 bytes --]

ping?

On Fri, Aug 26, 2016 at 4:55 PM, Fabio Berton <fabio.berton@ossystems.com.br
> wrote:

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

[-- Attachment #2: Type: text/html, Size: 8014 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH 2/2] watchdog-config: Add recipe
  2016-08-26 19:55 ` [PATCH 2/2] watchdog-config: Add recipe Fabio Berton
@ 2016-09-06 13:44   ` Fabio Berton
  0 siblings, 0 replies; 4+ messages in thread
From: Fabio Berton @ 2016-09-06 13:44 UTC (permalink / raw)
  To: Patches and discussions about the oe-core layer; +Cc: Otavio Salvador

[-- Attachment #1: Type: text/plain, Size: 5264 bytes --]

ping?

On Fri, Aug 26, 2016 at 4:55 PM, Fabio Berton <fabio.berton@ossystems.com.br
> wrote:

> Provides configuration files for watchdog.
> Add watchdog-config as a runtime dependence of watchdog and remove
> watchdog.conf file from watchdog installation.
>
> Signed-off-by: Fabio Berton <fabio.berton@ossystems.com.br>
> Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
> ---
>  meta/recipes-extended/watchdog/watchdog-config.bb  | 20 +++++++++++
>  .../watchdog/watchdog-config/watchdog.conf         | 42
> ++++++++++++++++++++++
>  .../watchdog/watchdog-config/watchdog.default      |  2 ++
>  meta/recipes-extended/watchdog/watchdog_5.15.bb    |  6 +++-
>  4 files changed, 69 insertions(+), 1 deletion(-)
>  create mode 100644 meta/recipes-extended/watchdog/watchdog-config.bb
>  create mode 100644 meta/recipes-extended/watchdog/watchdog-config/
> watchdog.conf
>  create mode 100644 meta/recipes-extended/watchdog/watchdog-config/
> watchdog.default
>
> diff --git a/meta/recipes-extended/watchdog/watchdog-config.bb
> b/meta/recipes-extended/watchdog/watchdog-config.bb
> new file mode 100644
> index 0000000..8bf40f0
> --- /dev/null
> +++ b/meta/recipes-extended/watchdog/watchdog-config.bb
> @@ -0,0 +1,20 @@
> +SUMMARY = "Software watchdog"
> +DESCRIPTION = "Watchdog is a daemon that checks if your system is still \
> +working. If programs in user space are not longer executed it will reboot
> \
> +the system."
> +HOMEPAGE = "http://watchdog.sourceforge.net/"
> +BUGTRACKER = "http://sourceforge.net/tracker/?group_id=172030&atid=860194
> "
> +
> +LICENSE = "MIT-X"
> +LIC_FILES_CHKSUM = "file://${COREBASE}/meta/COPYING.MIT;md5=
> 3da9cfbcb788c80a0384361b4de20420"
> +
> +SRC_URI = " \
> +    file://watchdog.default \
> +    file://watchdog.conf \
> +"
> +
> +do_install() {
> +    install -Dm 0644 ${WORKDIR}/watchdog.default
> ${D}${sysconfdir}/default/watchdog
> +    install -Dm 0644 ${WORKDIR}/watchdog.conf ${D}${sysconfdir}/watchdog.
> conf
> +}
> +
> diff --git a/meta/recipes-extended/watchdog/watchdog-config/watchdog.conf
> b/meta/recipes-extended/watchdog/watchdog-config/watchdog.conf
> new file mode 100644
> index 0000000..c493d12
> --- /dev/null
> +++ b/meta/recipes-extended/watchdog/watchdog-config/watchdog.conf
> @@ -0,0 +1,42 @@
> +#ping                  = 172.31.14.1
> +#ping                  = 172.26.1.255
> +#interface             = eth0
> +#file                  = /var/log/messages
> +#change                        = 1407
> +
> +# Uncomment to enable test. Setting one of these values to '0' disables
> it.
> +# These values will hopefully never reboot your machine during normal use
> +# (if your machine is really hung, the loadavg will go much higher than
> 25)
> +#max-load-1            = 24
> +#max-load-5            = 18
> +#max-load-15           = 12
> +
> +# Note that this is the number of pages!
> +# To get the real size, check how large the pagesize is on your machine.
> +#min-memory            = 1
> +
> +#repair-binary         = /usr/sbin/repair
> +#repair-timeout                =
> +#test-binary           =
> +#test-timeout          =
> +
> +watchdog-device        = /dev/watchdog
> +
> +# Defaults compiled into the binary
> +#temperature-device    =
> +#max-temperature       = 120
> +
> +# Defaults compiled into the binary
> +#admin                 = root
> +#interval              = 1
> +#logtick                = 1
> +#log-dir               = /var/log/watchdog
> +
> +# This greatly decreases the chance that watchdog won't be scheduled
> before
> +# your machine is really loaded
> +realtime               = yes
> +priority               = 1
> +
> +# Check if rsyslogd is still running by enabling the following line
> +#pidfile               = /var/run/rsyslogd.pid
> +
> diff --git a/meta/recipes-extended/watchdog/watchdog-config/watchdog.default
> b/meta/recipes-extended/watchdog/watchdog-config/watchdog.default
> new file mode 100644
> index 0000000..647d5ab
> --- /dev/null
> +++ b/meta/recipes-extended/watchdog/watchdog-config/watchdog.default
> @@ -0,0 +1,2 @@
> +# Start watchdog at boot time? 0 or 1
> +run_watchdog=1
> diff --git a/meta/recipes-extended/watchdog/watchdog_5.15.bb
> b/meta/recipes-extended/watchdog/watchdog_5.15.bb
> index 1c0049c..cedfc04 100644
> --- a/meta/recipes-extended/watchdog/watchdog_5.15.bb
> +++ b/meta/recipes-extended/watchdog/watchdog_5.15.bb
> @@ -40,6 +40,9 @@ INITSCRIPT_PARAMS_${PN}-keepalive = "start 15 1 2 3 4 5
> . stop 85 0 6 ."
>  do_install_append() {
>         install -D ${S}/redhat/watchdog.init ${D}/${sysconfdir}/init.d/
> watchdog.sh
>      install -Dm 0755 ${WORKDIR}/wd_keepalive.init
> ${D}${sysconfdir}/init.d/wd_keepalive
> +
> +    # watchdog.conf is provided by the watchdog-config recipe
> +    rm ${D}${sysconfdir}/watchdog.conf
>  }
>
>  PACKAGES =+ "${PN}-keepalive"
> @@ -49,7 +52,8 @@ FILES_${PN}-keepalive = " \
>      ${sbindir}/wd_keepalive \
>  "
>
> -RDEPENDS_${PN} += "${PN}-keepalive"
> +RDEPENDS_${PN} += "${PN}-config ${PN}-keepalive"
> +RDEPENDS_${PN}-keepalive += "${PN}-config"
>
>  RRECOMMENDS_${PN} = "kernel-module-softdog"
>
> --
> 2.1.4
>
>

[-- Attachment #2: Type: text/html, Size: 7507 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2016-09-06 13:44 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-08-26 19:55 [PATCH 1/2] watchdog: Add wd_keepalive package Fabio Berton
2016-08-26 19:55 ` [PATCH 2/2] watchdog-config: Add recipe Fabio Berton
2016-09-06 13:44   ` Fabio Berton
2016-09-06 13:43 ` [PATCH 1/2] watchdog: Add wd_keepalive package Fabio Berton

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.