<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>Watchdog on bramp.net</title>
    <link>https://blog.bramp.net/</link>
    <description>Recent content in Watchdog on bramp.net</description>
    <generator>Hugo -- gohugo.io</generator>
    <language>en-GB</language>
    <lastBuildDate>Fri, 16 Oct 2009 00:00:00 +0000</lastBuildDate>
    <atom:link href="https://blog.bramp.net/tags/watchdog/" rel="self" type="application/rss+xml" />
    
    <item>
      <title>FreeBSD Software Watchdog</title>
      <link>https://blog.bramp.net/post/2009/10/16/freebsd-software-watchdog/</link>
      <pubDate>Fri, 16 Oct 2009 00:00:00 +0000</pubDate>
      
      <guid>https://blog.bramp.net/post/2009/10/16/freebsd-software-watchdog/</guid>
      <description><p>Recently I’ve been doing some kernel hacking and I managed to deadlock my system. The system still responded to pings but the terminal was unresponsive, and it needed a hard reboot to fix. I would have loved to drop into a debugger or panic’ed the kernel to get a suitable back-trace.</p>
<p>I found that FreeBSD has a software watchdog feature, that will panic the kernel if a problem like this occurs. The watchdog does not seem to be built into the kernel by default, and I found the documentation a bit lacking. So here is what I did:</p>
<p>Firstly, build and install a custom kernel which includes: <code>options SW_WATCHDOG</code></p>
<p>Secondly, edit the <code>/etc/rc.conf</code> file and add a line: <code>watchdogd_enable=&quot;YES&quot;</code></p>
<p>When you next reboot, the watchdogd daemon will run, enabling the watchdog feature. Every second the watchdogd will reset a timer within the kernel. If after 16 seconds the timer has not been reset, the kernel will print out some interrupt information, and panic.</p>
<p>Watchdogd seems to have some useful features, for example, you can configure it to execute a specific command every second, and if that command fails the timer will not be reset. The configuration option I use is: <code>watchdogd_flags=&quot;-e /bin/ps&quot;</code></p>
<p>Read <a href="http://www.freebsd.org/cgi/man.cgi?query=watchdogd&amp;sektion=8">WATCHDOGD(8)</a> for more information.</p>
</description>
    </item>
    
  </channel>
</rss>
