[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Problems with Softdog...



Hi all.
I need to use Softdog in my system.
I'm doing some tests to get it working...

I have an old Debian machine [ kernel 2.4.21, Debian 3.0 ]
I start my app ( see test.c ), if I interrupt it I get:
  SOFTDOG: WDT device closed unexpectedly.  WDT will not stop!
and the machine reboot within 60 secs.
All ok.

I have another machine [ kernel 2.4.26, Debian 3.1 ]
I start my app, if I interrupt it I don't get nothing...

In both machines' kernel I have:
  CONFIG_SOFT_WATCHDOG=y
I tried also as module... nothing change.

I don't know what to do now...
Someone can help me?
Thank you in advance,
-Mat-

=== test.c ===

#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <stdio.h>
#include <unistd.h>

int main( int argc, const char *argv[] )
{
    int fd=open("/dev/watchdog",O_WRONLY);

    if (fd==-1) {
        perror("watchdog");
        exit(1);
    }
    while(1) {
        write(fd, "\0", 1);
        sleep(10);
    }

    return 0;
}



Reply to: