Take the 2-minute tour ×
Raspberry Pi Stack Exchange is a question and answer site for users and developers of hardware and software for Raspberry Pi. It's 100% free, no registration required.

I have tried to run the WatchDog Daemon using the tutorial found at http://binerry.de/post/28263824530/raspberry-pi-watchdog-timer

So basic process I ran through to get WatchDog up and running is:

1. sudo modprobe bcm2708_wdog
2. sudo nano /etc/modules (add line “bcm2708_wdog”)
3. apt-get install watchdog chkconfig
4. chkconfig watchdog on
5. /etc/init.d/watchdog start
6. nano /etc/watchdog.conf (enable line “watchdog-device = /dev/watchdog”)

When I reboot I see that the WatchDog daemon starts in one of the last system startup tasks, however when I try a fork bomb, System becomes unusable but never resets.

Fork bomb code use below:(Warning to others reading, below code can cause damage. Read linked tutorial on top for more info)

#!/bin/bash
:(){ :|:& };:
share|improve this question

2 Answers 2

a) for a effective forkbomb you need to disable the swap partition. (swapoff -a) b) the system may survive a single forkbomb. Simply start a number of them.

A very simply test can be done by killing the watchdog process. By doing so the watchdog process doesn't ping the watchdog device, so the hardware watchdog will reboot the pi. In a realworld situation the watchdog daemon my not be able to ping anything because of high load on the system. The result would be the hardware reboot.

share|improve this answer
    
I turned off swap, and let process run for a while but still the unit did not restart. would multiple fork bombs be more effective than just the one? I would think you would acheive the same result with just one(I really don't know, just from my limited knowledge on how forks work). –  Richard Nov 26 '12 at 18:25

I have a theory of why system is not rebooting, but not yet tested.

in /etc/watchdog.conf there are lines:

realtime = yes
priority = 1

basically what I am thinking is that the forkbomb runs but at a lower priority than 1. WatchDog Daemon is still able to get the pulses to the hardware WatchDog. System is still running pretty inoperable, but because WatchDog Daemon has such a high priority, it is happy.

in the same config file there is a line:

max-load-1     =24

I uncommeted this line and now the WatchDog Daemon works as expected.

only problem here is that it is possible to reboot machine when it is not truly hung. In my case, I am not running lxde and only running a few python cron jobs that are not resource hungry so it shouldn't be a issue for me.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.