Patchwork [OpenWrt-Devel] Stopping watchdog

login
register
Submitter Yury Polyanskiy
Date 2010-05-03 03:47:45
Message ID <20100502234745.47537ef9@penta.localdomain>
Download mbox | patch
Permalink /patch/61/
State Accepted, archived
Delegated to: Florian Fainelli
Headers show

Comments

Yury Polyanskiy - 2010-05-03 03:47:45
Dear all,

Here is a simple patch to provide /etc/init.d/watchdog stop. Just in
case someone is interested.
Florian Fainelli - 2010-05-03 11:11:38
On Monday 03 May 2010 05:47:45 Yury Polyanskiy wrote:
> Dear all,
> 
> Here is a simple patch to provide /etc/init.d/watchdog stop. Just in
> case someone is interested.
> 
> Index: package/base-files/files/etc/init.d/watchdog
> ===================================================================
> --- package/base-files/files/etc/init.d/watchdog        (revision 21164)
> +++ package/base-files/files/etc/init.d/watchdog        (working copy)
> @@ -6,3 +6,8 @@
>          [ -c /dev/watchdog ] && [ -x /sbin/watchdog ] && \
>                 watchdog -t 5 /dev/watchdog
>  }
> +
> +stop() {
> +       killall -q watchdog
> +       [ -c /dev/watchdog ] && echo "V" > /dev/watchdog
> +}

Applied in r21334, thanks!
--
Florian
Yury Polyanskiy - 2010-05-03 13:59:17
On Mon, 3 May 2010 09:35:59 +0000
Vasilis Tsiligiannis <b_tsiligiannis@silverton.gr> wrote:

> > +       [ -c /dev/watchdog ] && echo "V" > /dev/watchdog
> 
> Why is this needed? busybox watchdog applet writes the magic on shutdown. 

Ah, I didn't know it. Anyways, one line of code for extra-safety
wouldn't hurt.
edgar.soldin@web.de - 2010-05-03 14:16:07
On 03.05.2010 15:59, Yury Polyanskiy wrote:
> On Mon, 3 May 2010 09:35:59 +0000
> Vasilis Tsiligiannis<b_tsiligiannis@silverton.gr>  wrote:
>
>>> +       [ -c /dev/watchdog ]&&  echo "V">  /dev/watchdog
>>
>> Why is this needed? busybox watchdog applet writes the magic on shutdown.
>

What is magic? In this context .. thanks ede
Jo-Philipp Wich - 2010-05-03 14:35:16
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

The char "V" is the magic value to stop watchdog timers in linux (if
implemented by the corresponding driver)

~ Jow
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAkve3yEACgkQdputYINPTPNa9gCeM4mJScD1xTPusnD3CctVEmbj
CqIAnRGNseggRygB81te3meg6oxKP5LH
=cVs2
-----END PGP SIGNATURE-----

Patch

Index: package/base-files/files/etc/init.d/watchdog
===================================================================
--- package/base-files/files/etc/init.d/watchdog        (revision 21164)
+++ package/base-files/files/etc/init.d/watchdog        (working copy)
@@ -6,3 +6,8 @@ 
         [ -c /dev/watchdog ] && [ -x /sbin/watchdog ] && \
                watchdog -t 5 /dev/watchdog
 }
+
+stop() {
+       killall -q watchdog
+       [ -c /dev/watchdog ] && echo "V" > /dev/watchdog
+}