Re: [OpenWrt-Devel] /dev/watchdog from shell script

2012-01-06 Thread Stefan Monnier
> I did this on my boxes, but it does not help. > Again a device is _pingable_, but all daemons are > not responding anymore: So either: - watchdog was killed and this just disabled the watchdog timer altogether. - watchdog was not killed for some reason (e.g. because the kernel considered that

Re: [OpenWrt-Devel] /dev/watchdog from shell script

2012-01-05 Thread Michael Büsch
On Thu, 05 Jan 2012 10:42:53 + Bastian Bittorf wrote: > > > # call this in cron.minutely > > > watchdogger -d /dev/watchdog --kick > > > > > > # do all checks with cron-called scripts > > > > > > if cron fails, the watchdog will reboot the device. > > > if you are more conservative, use timeo

Re: [OpenWrt-Devel] /dev/watchdog from shell script

2012-01-05 Thread Bastian Bittorf
> kernel.panic = 3 means that the kernel will reboot 3 seconds after > > getting a panic. OOM is not a condition to trigger a panic by > default, > unless you set panic_on_oom=1. So if you get the following > situation : > > OOM will cause a panic > panic will cause a reboot in 3 seconds. > > k

Re: [OpenWrt-Devel] /dev/watchdog from shell script

2012-01-05 Thread Bastian Bittorf
> An OOM is not considered to be a panic by default afaik. yes, it's only a seldom behaviour > Regarding your cronjob idea; won't work imo. Many (most?) watchdog > drivers do not support >= 60 second intervals. thats the smallest problem: #!/bin/sh watchdogger -d /dev/watchdog --kick sleep 30 w

Re: [OpenWrt-Devel] /dev/watchdog from shell script

2012-01-05 Thread Jo-Philipp Wich
An OOM is not considered to be a panic by default afaik. Regarding your cronjob idea; won't work imo. Many (most?) watchdog drivers do not support >= 60 second intervals. ~ Jow ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.

Re: [OpenWrt-Devel] /dev/watchdog from shell script

2012-01-05 Thread Bastian Bittorf
> > # call this in cron.minutely > > watchdogger -d /dev/watchdog --kick > > > > # do all checks with cron-called scripts > > > > if cron fails, the watchdog will reboot the device. > > if you are more conservative, use timeout 900 > > What about just using panic_on_oom? then we are busted 8-) se

Re: [OpenWrt-Devel] /dev/watchdog from shell script

2012-01-05 Thread Florian Fainelli
Hello, On 01/05/12 10:02, Bastian Bittorf wrote: would'nt it be senseful to adjust "START=01" to /etc/init.d/watchdog and place something like this? pid="$( pidof watchdog )" echo "1000">/proc/$pid/oom_score_adj yeah, could do this. I did this on my boxes, but it does not help. Again a de

Re: [OpenWrt-Devel] /dev/watchdog from shell script

2012-01-05 Thread Bastian Bittorf
> > would'nt it be senseful to adjust "START=01" to > /etc/init.d/watchdog > > and place something like this? > > > > pid="$( pidof watchdog )" > > echo "1000" >/proc/$pid/oom_score_adj > > yeah, could do this. I did this on my boxes, but it does not help. Again a device is _pingable_, but all

Re: [OpenWrt-Devel] /dev/watchdog from shell script

2011-12-29 Thread Michael Büsch
On Thu, 29 Dec 2011 06:52:18 + Bastian Bittorf wrote: > > > A better way would be IMHO to use a cron.minutely which fire's > > > an ioctl to /dev/watchdog. if crond is removed, the device > > should > > > reboot. so i need a way to invoke an ioctl from shellscript. > > > > I think this

Re: [OpenWrt-Devel] /dev/watchdog from shell script

2011-12-28 Thread Bastian Bittorf
> > A better way would be IMHO to use a cron.minutely which fire's > > an ioctl to /dev/watchdog. if crond is removed, the device > should > > reboot. so i need a way to invoke an ioctl from shellscript. > > I think this doesn't work. in our special case it would work, because all "daemon-checkin

Re: [OpenWrt-Devel] /dev/watchdog from shell script

2011-12-28 Thread Bastian Bittorf
> I think jow wrote something like this already, see: > http://luci.subsignal.org/trac/browser/luci/trunk/contrib/package/freifunk-watchdog > Interesting, but has the same design-issue like already mentioned: if the oom-killer is working it will likely kill the freifunk-watchdog and crond, so to

Re: [OpenWrt-Devel] /dev/watchdog from shell script

2011-12-28 Thread Michael Büsch
On Wed, 28 Dec 2011 10:39:33 + Bastian Bittorf wrote: > for having a better way not to lost a router i like to > use /dev/watchdog from a shell script. the reason is this: > > Sometimes the oom-killer removes important tasks like > ssh + httpd + routing + cron but leaves the watchdog-petting

Re: [OpenWrt-Devel] /dev/watchdog from shell script

2011-12-28 Thread Manuel Munz
On 28.12.2011 12:21, Florian Fainelli wrote: > > I do not think this will work better. If crond is not killed by the OOM > killer, then the watchdog keeps being kept alive, and you end up in the > same situation. Rather I think we need some kind of software monitoring > by a daemon like upstart wh

Re: [OpenWrt-Devel] /dev/watchdog from shell script

2011-12-28 Thread Florian Fainelli
Hello Bastian, On 12/28/11 11:39, Bastian Bittorf wrote: hi devs, for having a better way not to lost a router i like to use /dev/watchdog from a shell script. the reason is this: Sometimes the oom-killer removes important tasks like ssh + httpd + routing + cron but leaves the watchdog-petting

[OpenWrt-Devel] /dev/watchdog from shell script

2011-12-28 Thread Bastian Bittorf
hi devs, for having a better way not to lost a router i like to use /dev/watchdog from a shell script. the reason is this: Sometimes the oom-killer removes important tasks like ssh + httpd + routing + cron but leaves the watchdog-petting on, so the device is running, but in fact lost. A better w