WDT in Linux

Discussion in 'General Linux' started by ryanHo, Jul 9, 2013.

  1. ryanHo

    ryanHo New Member

    Messages:
    2
    Likes Received:
    0
    Trophy Points:
    1
    I would like to trigger the WatchDog Timer from my system(Intel QM67 platform),what is the sample code/command to do so?
    Please advise.
    Thanks!


  2. ryanvade

    ryanvade Administrator Staff Member Staff Writer

    Messages:
    1,128
    Likes Received:
    376
    Trophy Points:
    83
    Do you have wdt installed?

    Code:
    #include <signal.h>
     
    void watchdog(int sig)
    {
      printf("Pet the dog\r\n");
      /* reset the timer so we get called again in 5 seconds */
      alarm(5);
    }
     
     
    /* start the timer - we want to wake up in 5 seconds */
    int main()
    {
      /* set up our signal handler to catch SIGALRM */
      signal(SIGALRM, watchdog);
      alarm(5);
      while (true)
      ;
    }
  3. ryanHo

    ryanHo New Member

    Messages:
    2
    Likes Received:
    0
    Trophy Points:
    1

    Thanks for reply.
    Actually, I need to run a program on my system to trigger a watchdog signal to the system.
    Can you help me to find the documentation or tools that would allow me to do this?
  4. ryanvade

    ryanvade Administrator Staff Member Staff Writer

    Messages:
    1,128
    Likes Received:
    376
    Trophy Points:
    83
    Okay, lets get the system setup. First what distro are you using? Is the kernel setup to use WDT? Have you installed wdt? IE bmc-watchdog in Ubuntu.

    You may not need to use a specific program. If you set the timer EXTREMELY low Watchdog may activate naturally.

Share This Page